diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 485a84f5e35..507a6718d78 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -67,6 +67,7 @@ config ARCH_CHIP_IMX6 bool "NXP/Freescale iMX.6" select ARCH_CORTEXA9 select ARCH_HAVE_MULTICPU + select ARMV7A_HAVE_GIC select ARMV7A_HAVE_L2CC_PL310 select ARCH_HAVE_FPU select ARCH_HAVE_LOWVECTORS diff --git a/arch/arm/src/armv7-a/Kconfig b/arch/arm/src/armv7-a/Kconfig index 6d41a2c6189..a6536e94b8a 100644 --- a/arch/arm/src/armv7-a/Kconfig +++ b/arch/arm/src/armv7-a/Kconfig @@ -5,11 +5,18 @@ comment "ARMv7-A Configuration Options" +config ARMV7A_HAVE_GIC + bool + default n + ---help--- + Selected by the configuration tool if the architecture supports the + Generic Interrupt Controller (GIC) + config ARMV7A_HAVE_L2CC bool default n ---help--- - Selected by the configuration tool if the architecutre supports any + Selected by the configuration tool if the architecture supports any kind of L2 cache. config ARMV7A_HAVE_L2CC_PL310 diff --git a/arch/arm/src/armv7-a/gic.h b/arch/arm/src/armv7-a/gic.h index 43ae6a0bbcc..f4bc30d787a 100644 --- a/arch/arm/src/armv7-a/gic.h +++ b/arch/arm/src/armv7-a/gic.h @@ -48,8 +48,11 @@ * Included Files ****************************************************************************/ +#include "nuttx/config.h" #include "mpcore.h" +#ifdef CONFIG_ARMV7A_HAVE_GIC + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -401,4 +404,57 @@ # define GIC_ICDSGIR_TGTFILTER_OTHER (1 << GIC_ICDSGIR_TGTFILTER_SHIFT) /* Interrupt is sent to all but requesting CPU */ # define GIC_ICDSGIR_TGTFILTER_THIS (2 << GIC_ICDSGIR_TGTFILTER_SHIFT) /* Interrupt is sent to requesting CPU only */ +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifndef __ASSEMBLY__ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Name: arm_gic_initialize + * + * Description: + * Perform basic GIC initialization for the current CPU + * + * Input Parameters: + * None + * + * Returned Value: + * None + * + ****************************************************************************/ + +void arm_gic_initialize(void); + +/**************************************************************************** + * Name: arm_decodeirq + * + * Description: + * This function is called from the IRQ vector handler in arm_vectors.S. + * At this point, the interrupt has been taken and the registers have + * been saved on the stack. This function simply needs to determine the + * the irq number of the interrupt and then to call arm_doirq to dispatch + * the interrupt. + * + * Input parameters: + * regs - A pointer to the register save area on the stack. + * + ****************************************************************************/ + +uint32_t *arm_decodeirq(uint32_t *regs); + +#undef EXTERN +#ifdef __cplusplus +} +#endif +#endif /* __ASSEMBLY__ */ + +#endif /* CONFIG_ARMV7A_HAVE_GIC */ #endif /* __ARCH_ARM_SRC_ARMV7_A_GIC_H */