From affddef4cf0ff4764106ca17823756eb87c81310 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Tue, 24 Sep 2019 21:42:10 +0200 Subject: [PATCH] soc: arm: do not include kernel headers in soc.h We shall not include core kernel headers in soc.h header of ARM SoCs. We should try to only include the vendor headers and auto-generated board header from DTS. This commit implements this policy for the SoCs, whose builds have shown to fail due to header inclusion cycles. Signed-off-by: Ioannis Glaropoulos --- soc/arm/arm/beetle/soc.h | 9 ++++----- soc/arm/atmel_sam/same70/soc.h | 9 ++++----- soc/arm/st_stm32/stm32f4/soc.h | 9 ++++----- soc/arm/st_stm32/stm32f7/soc.h | 9 ++++----- soc/arm/st_stm32/stm32l4/soc.h | 9 ++++----- soc/arm/st_stm32/stm32wb/soc.h | 9 ++++----- 6 files changed, 24 insertions(+), 30 deletions(-) diff --git a/soc/arm/arm/beetle/soc.h b/soc/arm/arm/beetle/soc.h index 07579fc7b4a..42f7477bed3 100644 --- a/soc/arm/arm/beetle/soc.h +++ b/soc/arm/arm/beetle/soc.h @@ -12,6 +12,8 @@ #ifndef _ARM_BEETLE_SOC_H_ #define _ARM_BEETLE_SOC_H_ +#include + #ifndef _ASMLANGUAGE #include "CMSDK_BEETLE.h" #endif @@ -93,11 +95,8 @@ #ifndef _ASMLANGUAGE -/* ARM CMSIS definitions must be included before kernel_includes.h. - * Therefore, it is essential to include kernel_includes.h after including - * core SOC-specific headers. - */ -#include +/* Add include for DTS generated information */ +#include #include "soc_pins.h" #include "soc_power.h" diff --git a/soc/arm/atmel_sam/same70/soc.h b/soc/arm/atmel_sam/same70/soc.h index fbeba61ae36..a836394b280 100644 --- a/soc/arm/atmel_sam/same70/soc.h +++ b/soc/arm/atmel_sam/same70/soc.h @@ -13,6 +13,8 @@ #ifndef _ATMEL_SAME70_SOC_H_ #define _ATMEL_SAME70_SOC_H_ +#include + #ifndef _ASMLANGUAGE #define DONT_USE_CMSIS_INIT @@ -64,11 +66,8 @@ #include "../common/soc_pmc.h" #include "../common/soc_gpio.h" -/* ARM CMSIS definitions must be included before kernel_includes.h. - * Therefore, it is essential to include kernel_includes.h after including - * core SOC-specific headers. - */ -#include +/* Add include for DTS generated information */ +#include #endif /* _ASMLANGUAGE */ diff --git a/soc/arm/st_stm32/stm32f4/soc.h b/soc/arm/st_stm32/stm32f4/soc.h index cfe0fbca1f6..3a785476d31 100644 --- a/soc/arm/st_stm32/stm32f4/soc.h +++ b/soc/arm/st_stm32/stm32f4/soc.h @@ -18,15 +18,14 @@ #ifndef _STM32F4_SOC_H_ #define _STM32F4_SOC_H_ +#include + #ifndef _ASMLANGUAGE #include -/* ARM CMSIS definitions must be included before kernel_includes.h. - * Therefore, it is essential to include kernel_includes.h after including - * core SOC-specific headers. - */ -#include +/* Add include for DTS generated information */ +#include #ifdef CONFIG_EXTI_STM32 #include diff --git a/soc/arm/st_stm32/stm32f7/soc.h b/soc/arm/st_stm32/stm32f7/soc.h index ed83526fa18..74cdbe20d2b 100644 --- a/soc/arm/st_stm32/stm32f7/soc.h +++ b/soc/arm/st_stm32/stm32f7/soc.h @@ -17,15 +17,14 @@ #ifndef _STM32F7_SOC_H_ #define _STM32F7_SOC_H_ +#include + #ifndef _ASMLANGUAGE #include -/* ARM CMSIS definitions must be included before kernel_includes.h. - * Therefore, it is essential to include kernel_includes.h after including - * core SOC-specific headers. - */ -#include +/* Add include for DTS generated information */ +#include #ifdef CONFIG_EXTI_STM32 #include diff --git a/soc/arm/st_stm32/stm32l4/soc.h b/soc/arm/st_stm32/stm32l4/soc.h index 46eac860bf6..25be37f3d3a 100644 --- a/soc/arm/st_stm32/stm32l4/soc.h +++ b/soc/arm/st_stm32/stm32l4/soc.h @@ -19,16 +19,15 @@ #ifndef _STM32L4X_SOC_H_ #define _STM32L4X_SOC_H_ +#include + #ifndef _ASMLANGUAGE #include #include -/* ARM CMSIS definitions must be included before kernel_includes.h. - * Therefore, it is essential to include kernel_includes.h after including - * core SOC-specific headers. - */ -#include +/* Add include for DTS generated information */ +#include #ifdef CONFIG_EXTI_STM32 #include diff --git a/soc/arm/st_stm32/stm32wb/soc.h b/soc/arm/st_stm32/stm32wb/soc.h index ca1b77ab1e6..cfbc248ee9a 100644 --- a/soc/arm/st_stm32/stm32wb/soc.h +++ b/soc/arm/st_stm32/stm32wb/soc.h @@ -17,15 +17,14 @@ #ifndef _STM32WBX_SOC_H_ #define _STM32WBX_SOC_H_ +#include + #ifndef _ASMLANGUAGE #include -/* ARM CMSIS definitions must be included before kernel_includes.h. - * Therefore, it is essential to include kernel_includes.h after including - * core SOC-specific headers. - */ -#include +/* Add include for DTS generated information */ +#include #ifdef CONFIG_GPIO_STM32 #include