From fd733ca8f120614b368ae624c2d5504d1b193c6c Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 5 Apr 2017 11:26:50 -0500 Subject: [PATCH] arm: dts: st: Convert STM32F3 based boards to dts Converted over all STM32F3 based boards to use device tree and removed associated bits that now come from the device tree for STM32F3. Boards that are now using devicetree: * Nucleo f334r8 * STM32373C Eval Change-Id: I081a1d83f86e417a98b6864c745354b6b32953b7 Signed-off-by: Kumar Gala --- .../soc/st_stm32/stm32f3/Kconfig.defconfig.series | 10 ---------- .../st_stm32/stm32f3/Kconfig.defconfig.stm32f303xc | 6 ------ .../st_stm32/stm32f3/Kconfig.defconfig.stm32f334x8 | 6 ------ .../st_stm32/stm32f3/Kconfig.defconfig.stm32f373xc | 6 ------ boards/arm/nucleo_f334r8/nucleo_f334r8_defconfig | 4 +++- boards/arm/stm32373c_eval/stm32373c_eval_defconfig | 4 +++- dts/arm/Makefile | 2 ++ dts/arm/nucleo_f334r8.fixup | 13 +++++++++++++ dts/arm/stm32373c_eval.fixup | 13 +++++++++++++ 9 files changed, 34 insertions(+), 30 deletions(-) create mode 100644 dts/arm/nucleo_f334r8.fixup create mode 100644 dts/arm/stm32373c_eval.fixup diff --git a/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.series b/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.series index 8cecc5e8983..c83ba459134 100644 --- a/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.series +++ b/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.series @@ -12,16 +12,6 @@ source "arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f3*" config SOC_SERIES default stm32f3 -config SRAM_BASE_ADDRESS - default 0x20000000 - -config FLASH_BASE_ADDRESS - default 0x08000000 - -config NUM_IRQ_PRIO_BITS - int - default 4 - if WATCHDOG config IWDG_STM32 diff --git a/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f303xc b/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f303xc index 674a4a49d93..6feb4da214a 100644 --- a/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f303xc +++ b/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f303xc @@ -11,12 +11,6 @@ config SOC string default stm32f303xc -config SRAM_SIZE - default 40 - -config FLASH_SIZE - default 256 - config FLASH_PAGE_SIZE hex default 0x800 diff --git a/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f334x8 b/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f334x8 index aa248104492..7ec81993846 100644 --- a/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f334x8 +++ b/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f334x8 @@ -11,12 +11,6 @@ config SOC string default stm32f334x8 -config SRAM_SIZE - default 12 - -config FLASH_SIZE - default 64 - config FLASH_PAGE_SIZE hex default 0x800 diff --git a/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f373xc b/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f373xc index 64aa9472d1a..9e682b839fd 100644 --- a/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f373xc +++ b/arch/arm/soc/st_stm32/stm32f3/Kconfig.defconfig.stm32f373xc @@ -11,12 +11,6 @@ config SOC string default stm32f373xc -config SRAM_SIZE - default 32 - -config FLASH_SIZE - default 256 - config FLASH_PAGE_SIZE hex default 0x800 diff --git a/boards/arm/nucleo_f334r8/nucleo_f334r8_defconfig b/boards/arm/nucleo_f334r8/nucleo_f334r8_defconfig index 948923d9f69..96d53aec552 100644 --- a/boards/arm/nucleo_f334r8/nucleo_f334r8_defconfig +++ b/boards/arm/nucleo_f334r8/nucleo_f334r8_defconfig @@ -23,7 +23,6 @@ CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_STM32=y # enable USART2 - passthrough to STLINK v2 connector CONFIG_UART_STM32_PORT_2=y -CONFIG_UART_STM32_PORT_2_BAUD_RATE=115200 # enable console on this port by default CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y @@ -55,3 +54,6 @@ CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9 CONFIG_CLOCK_STM32_AHB_PRESCALER=1 CONFIG_CLOCK_STM32_APB1_PRESCALER=2 CONFIG_CLOCK_STM32_APB2_PRESCALER=1 + +#enable DTS +CONFIG_HAS_DTS=y diff --git a/boards/arm/stm32373c_eval/stm32373c_eval_defconfig b/boards/arm/stm32373c_eval/stm32373c_eval_defconfig index d881b4e6155..9df327b2b48 100644 --- a/boards/arm/stm32373c_eval/stm32373c_eval_defconfig +++ b/boards/arm/stm32373c_eval/stm32373c_eval_defconfig @@ -30,7 +30,6 @@ CONFIG_UART_STM32=y # enable USART2 - passthrough to STLINK v2 connector CONFIG_UART_STM32_PORT_2=y CONFIG_UART_STM32_PORT_2_NAME="UART_2" -CONFIG_UART_STM32_PORT_2_BAUD_RATE=115200 # enable console on this port by default CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y @@ -64,3 +63,6 @@ CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9 CONFIG_CLOCK_STM32_AHB_PRESCALER=1 CONFIG_CLOCK_STM32_APB1_PRESCALER=2 CONFIG_CLOCK_STM32_APB2_PRESCALER=2 + +#enable DTS +CONFIG_HAS_DTS=y diff --git a/dts/arm/Makefile b/dts/arm/Makefile index 9a1a500e16a..0b938665668 100644 --- a/dts/arm/Makefile +++ b/dts/arm/Makefile @@ -12,6 +12,8 @@ dtb-$(CONFIG_BOARD_NUCLEO_F411RE) = nucleo_f411re.dts_compiled dtb-$(CONFIG_BOARD_NUCLEO_F103RB) = nucleo_f103rb.dts_compiled dtb-$(CONFIG_BOARD_STM3210C_EVAL) = stm3210c_eval.dts_compiled dtb-$(CONFIG_BOARD_STM32_MINI_A15) = stm32_mini_a15.dts_compiled +dtb-$(CONFIG_BOARD_NUCLEO_F334R8) = nucleo_f334r8.dts_compiled +dtb-$(CONFIG_BOARD_STM32373C_EVAL) = stm32373c_eval.dts_compiled always := $(dtb-y) endif diff --git a/dts/arm/nucleo_f334r8.fixup b/dts/arm/nucleo_f334r8.fixup new file mode 100644 index 00000000000..4b3ec44ea99 --- /dev/null +++ b/dts/arm/nucleo_f334r8.fixup @@ -0,0 +1,13 @@ +/* This file is a temporary workaround for mapping of the generated information + * to the current driver definitions. This will be removed when the drivers + * are modified to handle the generated information, or the mapping of + * generated data matches the driver definitions. + */ + + +#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS + +#define CONFIG_UART_STM32_PORT_2_BASE_ADDRESS ST_STM32_USART_40004400_BASE_ADDRESS +#define CONFIG_UART_STM32_PORT_2_BAUD_RATE ST_STM32_USART_40004400_BAUD_RATE +#define CONFIG_UART_STM32_PORT_2_IRQ_PRI ST_STM32_USART_40004400_IRQ_0_PRIORITY +#define PORT_2_IRQ ST_STM32_USART_40004400_IRQ_0 diff --git a/dts/arm/stm32373c_eval.fixup b/dts/arm/stm32373c_eval.fixup new file mode 100644 index 00000000000..4b3ec44ea99 --- /dev/null +++ b/dts/arm/stm32373c_eval.fixup @@ -0,0 +1,13 @@ +/* This file is a temporary workaround for mapping of the generated information + * to the current driver definitions. This will be removed when the drivers + * are modified to handle the generated information, or the mapping of + * generated data matches the driver definitions. + */ + + +#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS + +#define CONFIG_UART_STM32_PORT_2_BASE_ADDRESS ST_STM32_USART_40004400_BASE_ADDRESS +#define CONFIG_UART_STM32_PORT_2_BAUD_RATE ST_STM32_USART_40004400_BAUD_RATE +#define CONFIG_UART_STM32_PORT_2_IRQ_PRI ST_STM32_USART_40004400_IRQ_0_PRIORITY +#define PORT_2_IRQ ST_STM32_USART_40004400_IRQ_0