1 /*
2  * Copyright (c) 2016-2017, Texas Instruments Incorporated
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <kernel.h>
8 #include <device.h>
9 #include <init.h>
10 #include <soc.h>
11 #include <driverlib/rom.h>
12 #include <driverlib/rom_map.h>
13 #include <driverlib/prcm.h>
14 
15 /* Overrides the weak ARM implementation */
sys_arch_reboot(int type)16 void sys_arch_reboot(int type)
17 {
18 	MAP_PRCMMCUReset(!!type);
19 }
20 
ti_cc32xx_init(const struct device * arg)21 static int ti_cc32xx_init(const struct device *arg)
22 {
23 	ARG_UNUSED(arg);
24 
25 	/* Note: This function also performs CC3220 Initialization */
26 	MAP_PRCMCC3200MCUInit();
27 
28 #ifdef CONFIG_UART_CC32XX
29 	/*
30 	 * Enable Peripheral Clocks, ensuring UART can wake the processor from
31 	 * idle (after ARM wfi instruction)
32 	 */
33 	MAP_PRCMPeripheralClkEnable(PRCM_UARTA0, PRCM_RUN_MODE_CLK |
34 				    PRCM_SLP_MODE_CLK);
35 #endif
36 
37 	return 0;
38 }
39 
40 SYS_INIT(ti_cc32xx_init, PRE_KERNEL_1, 0);
41