arm: Support for new STM32F4 socs (STM32F407 and STM32F429)

In order to support the discovery STM32F4 and STM32F429 boards,
it is necessary to make these socs available.

Change-Id: I351d294fb02c4385f291a6e258a3f7d81e85627e
Signed-off-by: Gustavo Denardin <gustavo.denardin@gmail.com>
This commit is contained in:
Gustavo Denardin 2017-02-13 21:38:52 -02:00 committed by Kumar Gala
commit 3fdfcfc94f
4 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,24 @@
# Kconfig - ST STM32F407XX MCU configuration options
#
# Copyright (c) 2016 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
#
if SOC_STM32F407XX
config SOC
string
default stm32f407xx
config SRAM_SIZE
default 192
config FLASH_SIZE
default 1024
config NUM_IRQS
int
default 85
endif # SOC_STM32F407XX

View file

@ -0,0 +1,24 @@
# Kconfig - ST STM32F429XX MCU configuration options
#
# Copyright (c) 2016 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
#
if SOC_STM32F429XX
config SOC
string
default stm32f429xx
config SRAM_SIZE
default 256
config FLASH_SIZE
default 2048
config NUM_IRQS
int
default 85
endif # SOC_STM32F429XX

View file

@ -15,4 +15,10 @@ config SOC_STM32F401XE
config SOC_STM32F411XE
bool "STM32F411XE"
config SOC_STM32F407XX
bool "STM32F407XX"
config SOC_STM32F429XX
bool "STM32F429XX"
endchoice

View file

@ -77,6 +77,18 @@ static inline void __setup_flash(void)
} else if (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC <= 100000000) {
regs->acr.bit.latency = STM32F4X_FLASH_LATENCY_3;
}
#elif defined(CONFIG_SOC_STM32F407XX) || defined(CONFIG_SOC_STM32F429XX)
else if (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC <= 60000000) {
regs->acr.bit.latency = STM32F4X_FLASH_LATENCY_1;
} else if (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC <= 90000000) {
regs->acr.bit.latency = STM32F4X_FLASH_LATENCY_2;
} else if (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC <= 120000000) {
regs->acr.bit.latency = STM32F4X_FLASH_LATENCY_3;
} else if (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC <= 150000000) {
regs->acr.bit.latency = STM32F4X_FLASH_LATENCY_4;
} else if (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC <= 180000000) {
regs->acr.bit.latency = STM32F4X_FLASH_LATENCY_5;
}
#else
else {
__ASSERT(0, "Flash latency not set");