soc: arm: remove all unnecessary NMI_INIT() calls

NMI_INIT() is now a no-op, so remove it from all SoC code. Also remove
the irq lock/unlock pattern as it was likely a cause of copy&paste when
NMI_INIT() was called.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2023-06-30 11:15:25 +02:00 committed by Carles Cufí
commit fcaa259e22
81 changed files with 4 additions and 1198 deletions

View file

@ -3,11 +3,3 @@
#
# SPDX-License-Identifier: Apache-2.0
#
zephyr_library()
zephyr_library_sources(soc.c)
zephyr_library_include_directories(
${ZEPHYR_BASE}/kernel/include
${ZEPHYR_BASE}/arch/${ARCH}/include
)

View file

@ -1,52 +0,0 @@
/*
* Copyright (c) 2020, Seagate
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief System/hardware module for nxp_lpc11u6x platform
*
* This module provides routines to initialize and support board-level
* hardware for the nxp_lpc11u6x platform.
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <soc.h>
#include <zephyr/linker/sections.h>
#include <zephyr/arch/cpu.h>
#include <aarch32/cortex_m/exc.h>
/**
*
* @brief Perform basic hardware initialization
*
* Initialize the interrupt controller device drivers.
* Also initialize the timer device driver, if required.
*
* @return 0
*/
static int nxp_lpc11u6x_init(void)
{
/* old interrupt lock level */
unsigned int old_level;
/* disable interrupts */
old_level = irq_lock();
/* install default handler that simply resets the CPU if configured in
* the kernel, NOP otherwise
*/
NMI_INIT();
/* restore interrupt state */
irq_unlock(old_level);
return 0;
}
SYS_INIT(nxp_lpc11u6x_init, PRE_KERNEL_1, 0);

View file

@ -18,7 +18,6 @@
#include <soc.h>
#include <zephyr/drivers/uart.h>
#include <zephyr/linker/sections.h>
#include <zephyr/arch/cpu.h>
#include <aarch32/cortex_m/exc.h>
#include <fsl_power.h>
#include <fsl_clock.h>
@ -109,13 +108,6 @@ static ALWAYS_INLINE void clock_init(void)
static int nxp_lpc54114_init(void)
{
/* old interrupt lock level */
unsigned int oldLevel;
/* disable interrupts */
oldLevel = irq_lock();
/* Initialize FRO/system clock to 48 MHz */
clock_init();
@ -124,15 +116,6 @@ static int nxp_lpc54114_init(void)
PINT_Init(PINT);
#endif
/*
* install default handler that simply resets the CPU if configured in
* the kernel, NOP otherwise
*/
NMI_INIT();
/* restore interrupt state */
irq_unlock(oldLevel);
return 0;
}

View file

@ -297,13 +297,6 @@ DT_FOREACH_STATUS_OKAY(nxp_lpc_ctimer, CTIMER_CLOCK_SETUP)
static int nxp_lpc55xxx_init(void)
{
/* old interrupt lock level */
unsigned int oldLevel;
/* disable interrupts */
oldLevel = irq_lock();
z_arm_clear_faults();
/* Initialize FRO/system clock to 96 MHz */
@ -314,15 +307,6 @@ static int nxp_lpc55xxx_init(void)
PINT_Init(PINT);
#endif
/*
* install default handler that simply resets the CPU if configured in
* the kernel, NOP otherwise
*/
NMI_INIT();
/* restore interrupt state */
irq_unlock(oldLevel);
return 0;
}