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. STM32L4 #34724

Merged
21 changes: 21 additions & 0 deletions boards/arm/nucleo_l412rb_p/nucleo_l412rb_p.dts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,27 @@
};
};

&clk_hsi {
status = "okay";
};

&pll {
div-m = <1>;
mul-n = <10>;
div-q = <2>;
div-r = <2>;
clocks = <&clk_hsi>;
status = "okay";
};

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

&lpuart1 {
pinctrl-0 = <&lpuart1_tx_pa2 &lpuart1_rx_pa3>;
current-speed = <115200>;
Expand Down
16 changes: 1 addition & 15 deletions boards/arm/nucleo_l412rb_p/nucleo_l412rb_p_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

CONFIG_SOC_SERIES_STM32L4X=y
CONFIG_SOC_STM32L412XX=y
# 80MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=80000000

# Enable MPU
CONFIG_ARM_MPU=y
Expand All @@ -24,17 +22,5 @@ CONFIG_PINMUX=y
# enable GPIO
CONFIG_GPIO=y

# clock configuration
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# SYSCLK selection
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# PLL configuration
CONFIG_CLOCK_STM32_PLL_SRC_HSI=y
# produce 80MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_M_DIVISOR=1
CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=10
CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2
CONFIG_CLOCK_STM32_PLL_R_DIVISOR=2
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=1
CONFIG_CLOCK_STM32_APB2_PRESCALER=1
22 changes: 22 additions & 0 deletions boards/arm/nucleo_l432kc/nucleo_l432kc.dts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,28 @@
};
};

&clk_hsi {
status = "okay";
};

&pll {
div-m = <1>;
mul-n = <20>;
div-p = <7>;
div-q = <2>;
div-r = <4>;
clocks = <&clk_hsi>;
status = "okay";
};

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

&usart1 {
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
current-speed = <115200>;
Expand Down
17 changes: 1 addition & 16 deletions boards/arm/nucleo_l432kc/nucleo_l432kc_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

CONFIG_SOC_SERIES_STM32L4X=y
CONFIG_SOC_STM32L432XX=y
# 80MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=80000000

# Enable MPU
CONFIG_ARM_MPU=y
Expand All @@ -20,21 +18,8 @@ CONFIG_PINMUX=y
# enable GPIO
CONFIG_GPIO=y

# clock configuration
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# SYSCLK selection
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# PLL configuration
CONFIG_CLOCK_STM32_PLL_SRC_HSI=y
# produce 80MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_M_DIVISOR=1
CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=20
CONFIG_CLOCK_STM32_PLL_P_DIVISOR=7
CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2
CONFIG_CLOCK_STM32_PLL_R_DIVISOR=4
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=1
CONFIG_CLOCK_STM32_APB2_PRESCALER=1

# console
CONFIG_CONSOLE=y
Expand Down
22 changes: 22 additions & 0 deletions boards/arm/nucleo_l433rc_p/nucleo_l433rc_p.dts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@
};
};

&clk_hsi {
status = "okay";
};

&pll {
div-m = <1>;
mul-n = <20>;
div-p = <7>;
div-q = <2>;
div-r = <4>;
clocks = <&clk_hsi>;
status = "okay";
};

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

&lpuart1 {
pinctrl-0 = <&lpuart1_tx_pa2 &lpuart1_rx_pa3>;
current-speed = <115200>;
Expand Down
17 changes: 1 addition & 16 deletions boards/arm/nucleo_l433rc_p/nucleo_l433rc_p_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

CONFIG_SOC_SERIES_STM32L4X=y
CONFIG_SOC_STM32L433XX=y
# 80MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=80000000

# Enable MPU
CONFIG_ARM_MPU=y
Expand All @@ -20,21 +18,8 @@ CONFIG_PINMUX=y
# enable GPIO
CONFIG_GPIO=y

# clock configuration
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# SYSCLK selection
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# PLL configuration
CONFIG_CLOCK_STM32_PLL_SRC_HSI=y
# produce 80MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_M_DIVISOR=1
CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=20
CONFIG_CLOCK_STM32_PLL_P_DIVISOR=7
CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2
CONFIG_CLOCK_STM32_PLL_R_DIVISOR=4
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=1
CONFIG_CLOCK_STM32_APB2_PRESCALER=1

# console
CONFIG_CONSOLE=y
Expand Down
22 changes: 22 additions & 0 deletions boards/arm/nucleo_l452re/nucleo_l452re_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@
};
};

&clk_hsi {
status = "okay";
};

&pll {
div-m = <1>;
mul-n = <20>;
div-p = <7>;
div-q = <2>;
div-r = <4>;
clocks = <&clk_hsi>;
status = "okay";
};

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

&usart1 {
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
current-speed = <115200>;
Expand Down
17 changes: 1 addition & 16 deletions boards/arm/nucleo_l452re/nucleo_l452re_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

CONFIG_SOC_SERIES_STM32L4X=y
CONFIG_SOC_STM32L452XX=y
# 80MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=80000000

# enable uart driver
CONFIG_SERIAL=y
Expand All @@ -20,21 +18,8 @@ CONFIG_PINMUX=y
# enable GPIO
CONFIG_GPIO=y

# clock configuration
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# SYSCLK selection
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# PLL configuration
CONFIG_CLOCK_STM32_PLL_SRC_HSI=y
# produce 80MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_M_DIVISOR=1
CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=20
CONFIG_CLOCK_STM32_PLL_P_DIVISOR=7
CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2
CONFIG_CLOCK_STM32_PLL_R_DIVISOR=4
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=1
CONFIG_CLOCK_STM32_APB2_PRESCALER=1

# console
CONFIG_CONSOLE=y
Expand Down
17 changes: 1 addition & 16 deletions boards/arm/nucleo_l452re/nucleo_l452re_p_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

CONFIG_SOC_SERIES_STM32L4X=y
CONFIG_SOC_STM32L452XX=y
# 80MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=80000000

# enable uart driver
CONFIG_SERIAL=y
Expand All @@ -20,21 +18,8 @@ CONFIG_PINMUX=y
# enable GPIO
CONFIG_GPIO=y

# clock configuration
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# SYSCLK selection
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# PLL configuration
CONFIG_CLOCK_STM32_PLL_SRC_HSI=y
# produce 80MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_M_DIVISOR=1
CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=20
CONFIG_CLOCK_STM32_PLL_P_DIVISOR=7
CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2
CONFIG_CLOCK_STM32_PLL_R_DIVISOR=4
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=1
CONFIG_CLOCK_STM32_APB2_PRESCALER=1

# console
CONFIG_CONSOLE=y
Expand Down
22 changes: 22 additions & 0 deletions boards/arm/nucleo_l496zg/nucleo_l496zg.dts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,28 @@
};
};

&clk_hsi {
status = "okay";
};

&pll {
div-m = <1>;
mul-n = <20>;
div-p = <7>;
div-q = <2>;
div-r = <4>;
clocks = <&clk_hsi>;
status = "okay";
};

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

&usart2 {
pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6>;
current-speed = <115200>;
Expand Down
17 changes: 1 addition & 16 deletions boards/arm/nucleo_l496zg/nucleo_l496zg_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

CONFIG_SOC_SERIES_STM32L4X=y
CONFIG_SOC_STM32L496XX=y
# 80MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=80000000

# enable uart driver
CONFIG_SERIAL=y
Expand All @@ -14,21 +12,8 @@ CONFIG_PINMUX=y
# enable GPIO
CONFIG_GPIO=y

# clock configuration
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# SYSCLK selection
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# PLL configuration
CONFIG_CLOCK_STM32_PLL_SRC_HSI=y
# produce 80MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_M_DIVISOR=1
CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=20
CONFIG_CLOCK_STM32_PLL_P_DIVISOR=7
CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=2
CONFIG_CLOCK_STM32_PLL_R_DIVISOR=4
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=1
CONFIG_CLOCK_STM32_APB2_PRESCALER=1

# console
CONFIG_CONSOLE=y
Expand Down
22 changes: 22 additions & 0 deletions boards/arm/nucleo_l4r5zi/nucleo_l4r5zi.dts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,28 @@
};
};

&clk_hsi {
status = "okay";
};

&pll {
div-m = <4>;
mul-n = <40>;
div-p = <7>;
div-q = <2>;
div-r = <2>;
clocks = <&clk_hsi>;
status = "okay";
};

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

&usart1 {
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
current-speed = <115200>;
Expand Down
Loading