From 217eee060da41202c81e54ae9ce3bd646c235829 Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Tue, 4 May 2021 10:36:37 +0200 Subject: [PATCH] boards: olimexino_stm32: Use dts for clocks configuration Convert board to use of device tree for clocks configuration. Signed-off-by: Erwan Gouriou --- .../arm/olimexino_stm32/olimexino_stm32.dts | 19 +++++++++++++++++++ .../olimexino_stm32/olimexino_stm32_defconfig | 15 +-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/boards/arm/olimexino_stm32/olimexino_stm32.dts b/boards/arm/olimexino_stm32/olimexino_stm32.dts index 3648a577d0b..eaf9c5f7f67 100644 --- a/boards/arm/olimexino_stm32/olimexino_stm32.dts +++ b/boards/arm/olimexino_stm32/olimexino_stm32.dts @@ -47,6 +47,25 @@ }; }; +&clk_hse { + clock-frequency = ; + status = "okay"; +}; + +&pll { + mul = <9>; + clocks = <&clk_hse>; + status = "okay"; +}; + +&rcc { + clocks = <&pll>; + clock-frequency = ; + ahb-prescaler = <1>; + apb1-prescaler = <2>; + apb2-prescaler = <1>; +}; + uext_i2c: &i2c2 {}; uext_spi: &spi1 {}; uext_serial: &usart1 {}; diff --git a/boards/arm/olimexino_stm32/olimexino_stm32_defconfig b/boards/arm/olimexino_stm32/olimexino_stm32_defconfig index 25e902ce7b2..cb38d407d60 100644 --- a/boards/arm/olimexino_stm32/olimexino_stm32_defconfig +++ b/boards/arm/olimexino_stm32/olimexino_stm32_defconfig @@ -2,8 +2,6 @@ CONFIG_SOC_SERIES_STM32F1X=y CONFIG_SOC_STM32F103XB=y -# 72MHz system clock -CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000 # Enable MPU CONFIG_ARM_MPU=y @@ -24,16 +22,5 @@ CONFIG_PINMUX=y # enable GPIO CONFIG_GPIO=y -# clock configuration +# enable clocks CONFIG_CLOCK_CONTROL=y -# Clock configuration for Cube Clock control driver -CONFIG_CLOCK_STM32_HSE_CLOCK=8000000 -CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y -# use HSE as PLL input -CONFIG_CLOCK_STM32_PLL_SRC_HSE=y -# produce 72MHz clock at PLL output -CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9 -CONFIG_CLOCK_STM32_AHB_PRESCALER=1 -# APB1 clock must not to exceed 36MHz limit -CONFIG_CLOCK_STM32_APB1_PRESCALER=2 -CONFIG_CLOCK_STM32_APB2_PRESCALER=1