From ee7ac70c1037dbaa5d352f26f36a69a06d7b7ddb Mon Sep 17 00:00:00 2001 From: Immo Birnbaum Date: Thu, 2 Sep 2021 17:15:30 +0200 Subject: [PATCH] modules: cmsis: add core_ca inclusion for aarch32 Cortex-A SoCs Add the inclusion of the Common Peripheral Access Layer for aarch32 Cortex-A SoCs in combination with the respective SoC's header file, in which the feature flags evaluated in core_ca.h must be provided. The corresponding CMSIS include path is added to the build by setting the HAS_CMSIS_CORE_A Kconfig item for all aarch32 Cortex-A CPUs. Signed-off-by: Immo Birnbaum --- include/arch/arm/aarch32/cortex_a_r/cmsis.h | 17 +++++++++++++++++ modules/Kconfig.cmsis | 1 + 2 files changed, 18 insertions(+) diff --git a/include/arch/arm/aarch32/cortex_a_r/cmsis.h b/include/arch/arm/aarch32/cortex_a_r/cmsis.h index a6b7837ba2c..69609ca8548 100644 --- a/include/arch/arm/aarch32/cortex_a_r/cmsis.h +++ b/include/arch/arm/aarch32/cortex_a_r/cmsis.h @@ -24,10 +24,18 @@ extern "C" { #define __CR_REV 0U #endif +#ifndef __CA_REV +#define __CA_REV 0U +#endif + #ifndef __FPU_PRESENT #define __FPU_PRESENT CONFIG_CPU_HAS_FPU #endif +#ifndef __MMU_PRESENT +#define __MMU_PRESENT CONFIG_CPU_HAS_MMU +#endif + #ifdef __cplusplus } #endif @@ -38,6 +46,15 @@ extern "C" { #include #elif defined(CONFIG_CPU_CORTEX_R7) #include +#elif defined(CONFIG_CPU_AARCH32_CORTEX_A) +/* + * Any defines relevant for the proper inclusion of CMSIS' Cortex-A + * Common Peripheral Access Layer (such as __CORTEX_A) which are not + * covered by the Kconfig-based default assignments above must be + * provided by each aarch32 Cortex-A SoC's header file (already in- + * cluded above). + */ +#include #else #error "Unknown device" #endif diff --git a/modules/Kconfig.cmsis b/modules/Kconfig.cmsis index 1ebdddc07ba..98409e59382 100644 --- a/modules/Kconfig.cmsis +++ b/modules/Kconfig.cmsis @@ -4,6 +4,7 @@ config HAS_CMSIS_CORE bool select HAS_CMSIS_CORE_A if CPU_CORTEX_A + select HAS_CMSIS_CORE_A if CPU_AARCH32_CORTEX_A select HAS_CMSIS_CORE_R if CPU_CORTEX_R select HAS_CMSIS_CORE_M if CPU_CORTEX_M