Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32: Board conversion to DT clock configuration. STM32F3 #34742

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions boards/arm/nucleo_f302r8/nucleo_f302r8.dts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,27 @@
};
};

&clk_hse {
hse-bypass;
clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
status = "okay";
};

&pll {
prediv = <1>;
mul = <9>;
clocks = <&clk_hse>;
status = "okay";
};

&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(72)>;
ahb-prescaler = <1>;
apb1-prescaler = <2>;
apb2-prescaler = <1>;
};

&i2c1 {
pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
status = "okay";
Expand Down
19 changes: 1 addition & 18 deletions boards/arm/nucleo_f302r8/nucleo_f302r8_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

CONFIG_SOC_SERIES_STM32F3X=y
CONFIG_SOC_STM32F302X8=y
# 72 MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000

CONFIG_SERIAL=y

Expand All @@ -17,20 +15,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
# however, the board does not have an external oscillator, so just use
# the 8MHz clock signal coming from integrated STLink
CONFIG_CLOCK_STM32_HSE_BYPASS=y
# produce 72MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_PREDIV=1
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
CONFIG_CLOCK_STM32_APB2_PRESCALER=1
21 changes: 21 additions & 0 deletions boards/arm/nucleo_f303re/nucleo_f303re.dts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,27 @@
};
};

&clk_hse {
hse-bypass;
clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
status = "okay";
};

&pll {
prediv = <1>;
mul = <9>;
clocks = <&clk_hse>;
status = "okay";
};

&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(72)>;
ahb-prescaler = <1>;
apb1-prescaler = <2>;
apb2-prescaler = <1>;
};

&usart2 {
pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
current-speed = <115200>;
Expand Down
19 changes: 1 addition & 18 deletions boards/arm/nucleo_f303re/nucleo_f303re_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

CONFIG_SOC_SERIES_STM32F3X=y
CONFIG_SOC_STM32F303XE=y
# 72 MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000

CONFIG_SERIAL=y

Expand All @@ -23,20 +21,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
# however, the board does not have an external oscillator, so just use
# the 8MHz clock signal coming from integrated STLink
CONFIG_CLOCK_STM32_HSE_BYPASS=y
# produce 72MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_PREDIV1=1
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
CONFIG_CLOCK_STM32_APB2_PRESCALER=1
20 changes: 20 additions & 0 deletions boards/arm/stm32373c_eval/stm32373c_eval.dts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,26 @@
};
};

&clk_hse {
clock-frequency = <DT_FREQ_M(8)>;
status = "okay";
};

&pll {
prediv = <1>;
mul = <9>;
clocks = <&clk_hse>;
status = "okay";
};

&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(72)>;
ahb-prescaler = <1>;
apb1-prescaler = <2>;
apb2-prescaler = <2>;
};

&usart2 {
pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6>;
current-speed = <115200>;
Expand Down
17 changes: 1 addition & 16 deletions boards/arm/stm32373c_eval/stm32373c_eval_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ CONFIG_ARM_MPU=y
# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y

# General Kernel Options
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000

# Serial Drivers
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
Expand All @@ -31,17 +28,5 @@ CONFIG_PINMUX=y
# GPIO Controller
CONFIG_GPIO=y

# Clock configuration
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# SYSCLK selection
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# HSE configuration
CONFIG_CLOCK_STM32_HSE_CLOCK=8000000
# PLL configuration
CONFIG_CLOCK_STM32_PLL_SRC_HSE=y
# produce 72MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_PREDIV=1
CONFIG_CLOCK_STM32_PLL_MULTIPLIER=9
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=2
CONFIG_CLOCK_STM32_APB2_PRESCALER=2