main.c 490 Bytes
Newer Older
1
2
3
/*
 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
 */

7
#include <m0_param.h>
8
9
#include "rk3399_mcu.h"

10
__attribute__((noreturn)) void main(void)
11
{
12
13
14
15
16
17
18
19
20
	switch (mmio_read_32(PARAM_ADDR + PARAM_M0_FUNC)) {
	case M0_FUNC_SUSPEND:
		handle_suspend();
		break;
	case M0_FUNC_DRAM:
		handle_dram();
		break;
	default:
		break;
21
22
	}

23
	mmio_write_32(PARAM_ADDR + PARAM_M0_DONE, M0_DONE_FLAG);
24
25

	for (;;)
26
		__asm__ volatile ("wfi");
27
}