arch: arm: move nmi to common location
The nmi_on_reset.S functions are used by all ARM platforms. It makes no sense to repeat the same code for all platforms. Moving the code from each SOC implementation to arch/arm/core. The same treatment for the NMI_INIT() macro. Moving it from a per SOC implementation to the include/arch/arm/cortex_m/nmi.h. Change-Id: I574d8880a44046cc7b9e1b635e80d6e83657b8c1 Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
This commit is contained in:
parent
27a3f8bb10
commit
983ec93bd4
11 changed files with 23 additions and 84 deletions
|
@ -4,7 +4,7 @@ ccflags-y +=-I$(srctree)/arch/$(ARCH)/platforms/$(SOC_NAME)
|
||||||
asflags-y = $(ccflags-y)
|
asflags-y = $(ccflags-y)
|
||||||
|
|
||||||
obj-y = vector_table.o reset.o \
|
obj-y = vector_table.o reset.o \
|
||||||
prep_c.o scs.o scb.o nmi.o \
|
nmi_on_reset.o prep_c.o scs.o scb.o nmi.o \
|
||||||
exc_manage.o exc_wrapper.o
|
exc_manage.o exc_wrapper.o
|
||||||
|
|
||||||
obj-$(CONFIG_ERRNO) += errno.o
|
obj-$(CONFIG_ERRNO) += errno.o
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
obj-y += soc.o nmi_on_reset.o
|
obj-y += soc.o
|
||||||
|
|
|
@ -28,12 +28,7 @@
|
||||||
#include <init.h>
|
#include <init.h>
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
|
|
||||||
#ifdef CONFIG_RUNTIME_NMI
|
#include <arch/cpu.h>
|
||||||
extern void _NmiInit(void);
|
|
||||||
#define NMI_INIT() _NmiInit()
|
|
||||||
#else
|
|
||||||
#define NMI_INIT()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup various clock on SoC.
|
* @brief Setup various clock on SoC.
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
obj-y += soc_config.o
|
obj-y += soc_config.o
|
||||||
obj-y += soc.o
|
obj-y += soc.o
|
||||||
obj-y += nmi_on_reset.o
|
|
||||||
obj-y += wdog.o
|
obj-y += wdog.o
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#include <drivers/k6x_pmc.h>
|
#include <drivers/k6x_pmc.h>
|
||||||
#include <sections.h>
|
#include <sections.h>
|
||||||
|
|
||||||
|
#include <arch/cpu.h>
|
||||||
|
|
||||||
|
|
||||||
/* board's setting for PLL multipler (PRDIV0) */
|
/* board's setting for PLL multipler (PRDIV0) */
|
||||||
#define FRDM_K64F_PLL_DIV_20 (20 - 1)
|
#define FRDM_K64F_PLL_DIV_20 (20 - 1)
|
||||||
|
@ -41,13 +43,6 @@
|
||||||
/* board's setting for PLL multipler (VDIV0) */
|
/* board's setting for PLL multipler (VDIV0) */
|
||||||
#define FRDM_K64F_PLL_MULT_48 (48 - 24)
|
#define FRDM_K64F_PLL_MULT_48 (48 - 24)
|
||||||
|
|
||||||
#ifdef CONFIG_RUNTIME_NMI
|
|
||||||
extern void _NmiInit(void);
|
|
||||||
#define NMI_INIT() _NmiInit()
|
|
||||||
#else
|
|
||||||
#define NMI_INIT()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* K64F Flash configuration fields
|
* K64F Flash configuration fields
|
||||||
* These 16 bytes, which must be loaded to address 0x400, include default
|
* These 16 bytes, which must be loaded to address 0x400, include default
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
obj-y += soc_config.o
|
obj-y += soc_config.o
|
||||||
obj-y += soc.o
|
obj-y += soc.o
|
||||||
obj-y += nmi_on_reset.o
|
|
||||||
obj-y += scp.o
|
obj-y += scp.o
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013-2014 Wind River Systems, Inc.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file
|
|
||||||
* @brief Default basic NMI handler before the kernel is up
|
|
||||||
*
|
|
||||||
* Provide a default handler for NMI before the system is up. The default action
|
|
||||||
* is to hard hang, sleeping.
|
|
||||||
*
|
|
||||||
* This might be preferable than rebooting to help debugging, or because
|
|
||||||
* rebooting might trigger the exact same problem over and over.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define _ASMLANGUAGE
|
|
||||||
|
|
||||||
#include <toolchain.h>
|
|
||||||
#include <sections.h>
|
|
||||||
|
|
||||||
_ASM_FILE_PROLOGUE
|
|
||||||
|
|
||||||
GTEXT(_SysNmiOnReset)
|
|
||||||
|
|
||||||
SECTION_FUNC(TEXT, _SysNmiOnReset)
|
|
||||||
wfi
|
|
||||||
b _SysNmiOnReset
|
|
|
@ -27,12 +27,7 @@
|
||||||
#include <init.h>
|
#include <init.h>
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
|
|
||||||
#ifdef CONFIG_RUNTIME_NMI
|
#include <arch/cpu.h>
|
||||||
extern void _NmiInit(void);
|
|
||||||
#define NMI_INIT() _NmiInit()
|
|
||||||
#else
|
|
||||||
#define NMI_INIT()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -51,6 +51,7 @@ extern "C" {
|
||||||
#include <arch/arm/cortex_m/asm_inline.h>
|
#include <arch/arm/cortex_m/asm_inline.h>
|
||||||
#include <arch/arm/cortex_m/addr_types.h>
|
#include <arch/arm/cortex_m/addr_types.h>
|
||||||
#include <arch/arm/cortex_m/sys_io.h>
|
#include <arch/arm/cortex_m/sys_io.h>
|
||||||
|
#include <arch/arm/cortex_m/nmi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define STACK_ALIGN 4
|
#define STACK_ALIGN 4
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @brief NMI routines for ARM Cortex M series
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2014 Wind River Systems, Inc.
|
* Copyright (c) 2015 Intel Corporation
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -14,26 +20,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
#ifndef __CORTEX_M_NMI_H
|
||||||
* @file
|
#define __CORTEX_M_NMI_H
|
||||||
* @brief Default basic NMI handler before the kernel is up
|
|
||||||
*
|
|
||||||
* Provide a default handler for NMI before the system is up. The default action
|
|
||||||
* is to hard hang, sleeping.
|
|
||||||
*
|
|
||||||
* This might be preferable than rebooting to help debugging, or because
|
|
||||||
* rebooting might trigger the exact same problem over and over.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define _ASMLANGUAGE
|
#ifdef CONFIG_RUNTIME_NMI
|
||||||
|
extern void _NmiInit(void);
|
||||||
|
#define NMI_INIT() _NmiInit()
|
||||||
|
#else
|
||||||
|
#define NMI_INIT()
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <toolchain.h>
|
#endif /* __CORTEX_M_NMI_H */
|
||||||
#include <sections.h>
|
|
||||||
|
|
||||||
_ASM_FILE_PROLOGUE
|
|
||||||
|
|
||||||
GTEXT(_SysNmiOnReset)
|
|
||||||
|
|
||||||
SECTION_FUNC(TEXT, _SysNmiOnReset)
|
|
||||||
wfi
|
|
||||||
b _SysNmiOnReset
|
|
Loading…
Add table
Add a link
Reference in a new issue