Skip to content
Open
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
3 changes: 0 additions & 3 deletions boards/oct/osd32mp1_brk/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,4 @@ config SPI_STM32_INTERRUPT
default y
depends on SPI

config CLOCK_STM32_HSE_CLOCK
default 24000000

endif # BOARD_OSD32MP1_BRK
4 changes: 4 additions & 0 deletions boards/oct/osd32mp1_brk/osd32mp1_brk_defconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# HSE is controlled by Cortex-A but its
# frequency must be provided to the HAL
CONFIG_CLOCK_STM32_HSE_CLOCK=24000000

# Enable GPIO
CONFIG_GPIO=y

Expand Down
5 changes: 1 addition & 4 deletions boards/st/stm32mp157c_dk2/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ config SPI_STM32_INTERRUPT
default y
depends on SPI

config CLOCK_STM32_HSE_CLOCK
default 24000000

endif # BOARD_STM32MP157_Dk2
endif # BOARD_STM32MP157_DK2
4 changes: 4 additions & 0 deletions boards/st/stm32mp157c_dk2/stm32mp157c_dk2_defconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# HSE is controlled by Cortex-A but its
# frequency must be provided to the HAL
CONFIG_CLOCK_STM32_HSE_CLOCK=24000000

# enable GPIO
CONFIG_GPIO=y

Expand Down
36 changes: 22 additions & 14 deletions drivers/clock_control/Kconfig.stm32
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,31 @@ menuconfig CLOCK_CONTROL_STM32_CUBE

if CLOCK_CONTROL_STM32_CUBE

DT_STM32_HSE_CLOCK := $(dt_nodelabel_path,clk_hse)
DT_STM32_HSE_CLOCK_FREQ := $(dt_node_int_prop_int,$(DT_STM32_HSE_CLOCK),clock-frequency)
TMP_HSE := $(dt_nodelabel_path, clk_hse)

config CLOCK_STM32_HSE_CLOCK
int "HSE clock value"
default "$(DT_STM32_HSE_CLOCK_FREQ)" if "$(dt_nodelabel_enabled,clk_hse)"
default 8000000
int "HSE clock value" if !$(dt_nodelabel_enabled,clk_hse)
####### default $(dt_nodelabel_int_prop,clk_hse,clock-frequency)
default $(dt_node_int_prop_int,$(TMP_HSE),clock-frequency)
help
Value of external high-speed clock (HSE). This symbol could be optionally
configured using device tree by setting "clock-frequency" value of clk_hse
node. For instance:
&clk_hse{
status = "okay";
clock-frequency = <DT_FREQ_M(25)>;
};
Note: Device tree configuration is overridden when current symbol is set:
CONFIG_CLOCK_STM32_HSE_CLOCK=32000000
Frequency of external high-speed clock (HSE).

The value of this symbol is used to set the preprocessor
definition "HSE_VALUE" notably consumed by the HAL.

Usually, this symbol's value is directly taken from the
"clock-frequency" property of the "clk_hse" Device Tree
node, which usually looks similar to:

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

If the "clk_hse" node does not exist or is not enabled
(status != "okay"), this symbol becomes visible and can
be assigned a value through Kconfig configuration files.
This mechanism is used on specific STM32 platforms.

config CLOCK_STM32_MUX
bool "STM32 clock mux driver"
Expand Down