1 /* 2 * Copyright (c) 2020, Seagate 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /** 8 * @file 9 * @brief System/hardware module for nxp_lpc11u6x platform 10 * 11 * This module provides routines to initialize and support board-level 12 * hardware for the nxp_lpc11u6x platform. 13 */ 14 15 #include <kernel.h> 16 #include <device.h> 17 #include <init.h> 18 #include <soc.h> 19 #include <linker/sections.h> 20 #include <arch/cpu.h> 21 #include <aarch32/cortex_m/exc.h> 22 23 /** 24 * 25 * @brief Perform basic hardware initialization 26 * 27 * Initialize the interrupt controller device drivers. 28 * Also initialize the timer device driver, if required. 29 * 30 * @return 0 31 */ 32 nxp_lpc11u6x_init(const struct device * arg)33static int nxp_lpc11u6x_init(const struct device *arg) 34 { 35 ARG_UNUSED(arg); 36 37 /* old interrupt lock level */ 38 unsigned int old_level; 39 40 /* disable interrupts */ 41 old_level = irq_lock(); 42 43 /* install default handler that simply resets the CPU if configured in 44 * the kernel, NOP otherwise 45 */ 46 NMI_INIT(); 47 48 /* restore interrupt state */ 49 irq_unlock(old_level); 50 51 return 0; 52 } 53 SYS_INIT(nxp_lpc11u6x_init, PRE_KERNEL_1, 0); 54