diff --git a/drivers/clock_control/Kconfig b/drivers/clock_control/Kconfig index cf829f0cade..42804db65a1 100644 --- a/drivers/clock_control/Kconfig +++ b/drivers/clock_control/Kconfig @@ -16,6 +16,12 @@ menuconfig CLOCK_CONTROL if CLOCK_CONTROL +config CLOCK_CONTROL_INIT_PRIORITY + int "Clock control init priority" + default KERNEL_INIT_PRIORITY_OBJECTS + help + Clock control driver device initialization priority. + module = CLOCK_CONTROL module-str = clock control source "subsys/logging/Kconfig.template.log_config" diff --git a/drivers/clock_control/Kconfig.beetle b/drivers/clock_control/Kconfig.beetle index 147c83bb2d2..2a7a6efd341 100644 --- a/drivers/clock_control/Kconfig.beetle +++ b/drivers/clock_control/Kconfig.beetle @@ -13,16 +13,6 @@ menuconfig CLOCK_CONTROL_BEETLE Enable driver for Reset & Clock Control subsystem found in STM32F4 family of MCUs -config CLOCK_CONTROL_BEETLE_DEVICE_INIT_PRIORITY - int "Clock Control Device Priority" - default 1 - depends on CLOCK_CONTROL_BEETLE - help - This option controls the priority of clock control - device initialization. Higher priority ensures that the device - is initialized earlier in the startup cycle. If unsure, leave - at default value 1 - config ARM_CLOCK_CONTROL_DEV_NAME string "Clock Config Device name" default "CLOCK_CONTROL_0" diff --git a/drivers/clock_control/Kconfig.stm32 b/drivers/clock_control/Kconfig.stm32 index 6ab508f9a2f..8ba4f20c3e1 100644 --- a/drivers/clock_control/Kconfig.stm32 +++ b/drivers/clock_control/Kconfig.stm32 @@ -15,15 +15,6 @@ menuconfig CLOCK_CONTROL_STM32_CUBE if CLOCK_CONTROL_STM32_CUBE -config CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY - int "Clock Control Device Priority" - default 1 - help - This option controls the priority of clock control - device initialization. Higher priority ensures that the device - is initialized earlier in the startup cycle. If unsure, leave - at default value 1 - 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) diff --git a/drivers/clock_control/beetle_clock_control.c b/drivers/clock_control/beetle_clock_control.c index 6ca82ace05a..5ef5b6d795e 100644 --- a/drivers/clock_control/beetle_clock_control.c +++ b/drivers/clock_control/beetle_clock_control.c @@ -247,5 +247,5 @@ DEVICE_DEFINE(clock_control_beetle, CONFIG_ARM_CLOCK_CONTROL_DEV_NAME, NULL, NULL, &beetle_cc_cfg, PRE_KERNEL_1, - CONFIG_CLOCK_CONTROL_BEETLE_DEVICE_INIT_PRIORITY, + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &beetle_clock_control_api); diff --git a/drivers/clock_control/clock_agilex.c b/drivers/clock_control/clock_agilex.c index 3a7101ad233..00e74636fcb 100644 --- a/drivers/clock_control/clock_agilex.c +++ b/drivers/clock_control/clock_agilex.c @@ -53,5 +53,5 @@ static const struct clock_control_driver_api clk_api = { }; DEVICE_DT_DEFINE(DT_NODELABEL(clock), clk_init, NULL, NULL, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &clk_api); diff --git a/drivers/clock_control/clock_control_esp32.c b/drivers/clock_control/clock_control_esp32.c index 09cdeaddf64..04e4f61a2a3 100644 --- a/drivers/clock_control/clock_control_esp32.c +++ b/drivers/clock_control/clock_control_esp32.c @@ -248,7 +248,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(rtc), NULL, &esp32_clock_config0, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &clock_control_esp32_api); BUILD_ASSERT((CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC) == diff --git a/drivers/clock_control/clock_control_esp32s2.c b/drivers/clock_control/clock_control_esp32s2.c index 5b8c7654093..47f3baae557 100644 --- a/drivers/clock_control/clock_control_esp32s2.c +++ b/drivers/clock_control/clock_control_esp32s2.c @@ -227,7 +227,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(rtc), NULL, &esp32_clock_config0, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &clock_control_esp32_api); BUILD_ASSERT((CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC) == diff --git a/drivers/clock_control/clock_control_litex.c b/drivers/clock_control/clock_control_litex.c index 485b7bb7c38..51163836ef3 100644 --- a/drivers/clock_control/clock_control_litex.c +++ b/drivers/clock_control/clock_control_litex.c @@ -1788,4 +1788,4 @@ static const struct litex_clk_device ldev_init = { DEVICE_DT_DEFINE(DT_NODELABEL(clock0), &litex_clk_init, NULL, NULL, &ldev_init, POST_KERNEL, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &litex_clk_api); + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &litex_clk_api); diff --git a/drivers/clock_control/clock_control_lpc11u6x.c b/drivers/clock_control/clock_control_lpc11u6x.c index bc40a25489c..cfbdd6df419 100644 --- a/drivers/clock_control/clock_control_lpc11u6x.c +++ b/drivers/clock_control/clock_control_lpc11u6x.c @@ -397,5 +397,5 @@ DEVICE_DT_INST_DEFINE(0, &lpc11u6x_syscon_init, NULL, &syscon_data, &syscon_config, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, + PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &lpc11u6x_clock_control_api); diff --git a/drivers/clock_control/clock_control_mchp_xec.c b/drivers/clock_control/clock_control_mchp_xec.c index 851130fb783..f3044f07fd3 100644 --- a/drivers/clock_control/clock_control_mchp_xec.c +++ b/drivers/clock_control/clock_control_mchp_xec.c @@ -647,5 +647,5 @@ DEVICE_DT_INST_DEFINE(0, NULL, NULL, &xec_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &xec_clock_control_api); diff --git a/drivers/clock_control/clock_control_mcux_ccm.c b/drivers/clock_control/clock_control_mcux_ccm.c index 03e7a5c7301..8030dac1115 100644 --- a/drivers/clock_control/clock_control_mcux_ccm.c +++ b/drivers/clock_control/clock_control_mcux_ccm.c @@ -155,5 +155,5 @@ DEVICE_DT_INST_DEFINE(0, &mcux_ccm_init, NULL, NULL, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &mcux_ccm_driver_api); diff --git a/drivers/clock_control/clock_control_mcux_ccm_rev2.c b/drivers/clock_control/clock_control_mcux_ccm_rev2.c index a7aeba8d196..007816df1d6 100644 --- a/drivers/clock_control/clock_control_mcux_ccm_rev2.c +++ b/drivers/clock_control/clock_control_mcux_ccm_rev2.c @@ -101,5 +101,5 @@ DEVICE_DT_INST_DEFINE(0, &mcux_ccm_init, NULL, NULL, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &mcux_ccm_driver_api); diff --git a/drivers/clock_control/clock_control_mcux_mcg.c b/drivers/clock_control/clock_control_mcux_mcg.c index d55b9e619ef..727a5b40f95 100644 --- a/drivers/clock_control/clock_control_mcux_mcg.c +++ b/drivers/clock_control/clock_control_mcux_mcg.c @@ -68,5 +68,5 @@ DEVICE_DT_INST_DEFINE(0, &mcux_mcg_init, NULL, NULL, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &mcux_mcg_driver_api); diff --git a/drivers/clock_control/clock_control_mcux_pcc.c b/drivers/clock_control/clock_control_mcux_pcc.c index c7ba59fa00c..8b6688f9429 100644 --- a/drivers/clock_control/clock_control_mcux_pcc.c +++ b/drivers/clock_control/clock_control_mcux_pcc.c @@ -79,7 +79,7 @@ static const struct clock_control_driver_api mcux_pcc_api = { NULL, \ NULL, &mcux_pcc##inst##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, \ + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, \ &mcux_pcc_api); DT_INST_FOREACH_STATUS_OKAY(MCUX_PCC_INIT) diff --git a/drivers/clock_control/clock_control_mcux_scg.c b/drivers/clock_control/clock_control_mcux_scg.c index 74d314d4cd9..ca5325a4ff3 100644 --- a/drivers/clock_control/clock_control_mcux_scg.c +++ b/drivers/clock_control/clock_control_mcux_scg.c @@ -127,5 +127,5 @@ DEVICE_DT_INST_DEFINE(0, &mcux_scg_init, NULL, NULL, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &mcux_scg_driver_api); diff --git a/drivers/clock_control/clock_control_mcux_sim.c b/drivers/clock_control/clock_control_mcux_sim.c index 3ae79d3763f..575bb8419cf 100644 --- a/drivers/clock_control/clock_control_mcux_sim.c +++ b/drivers/clock_control/clock_control_mcux_sim.c @@ -103,5 +103,5 @@ DEVICE_DT_DEFINE(NXP_KINETIS_SIM_NODE, &mcux_sim_init, NULL, NULL, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &mcux_sim_driver_api); diff --git a/drivers/clock_control/clock_control_mcux_syscon.c b/drivers/clock_control/clock_control_mcux_syscon.c index 3c5e895ce4a..e2a6627fb32 100644 --- a/drivers/clock_control/clock_control_mcux_syscon.c +++ b/drivers/clock_control/clock_control_mcux_syscon.c @@ -121,7 +121,7 @@ DEVICE_DT_INST_DEFINE(n, \ &mcux_lpc_syscon_clock_control_init, \ NULL, \ NULL, NULL, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, \ &mcux_lpc_syscon_api); DT_INST_FOREACH_STATUS_OKAY(LPC_CLOCK_INIT) diff --git a/drivers/clock_control/clock_control_npcx.c b/drivers/clock_control/clock_control_npcx.c index 93431114d4e..92e94a21da6 100644 --- a/drivers/clock_control/clock_control_npcx.c +++ b/drivers/clock_control/clock_control_npcx.c @@ -237,5 +237,5 @@ DEVICE_DT_INST_DEFINE(0, NULL, NULL, &pcc_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &npcx_clock_control_api); diff --git a/drivers/clock_control/clock_control_nrf.c b/drivers/clock_control/clock_control_nrf.c index 09bb53de151..2712e8f4393 100644 --- a/drivers/clock_control/clock_control_nrf.c +++ b/drivers/clock_control/clock_control_nrf.c @@ -722,7 +722,7 @@ static const struct nrf_clock_control_config config = { DEVICE_DT_DEFINE(DT_NODELABEL(clock), clk_init, NULL, &data, &config, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &clock_control_api); static int cmd_status(const struct shell *shell, size_t argc, char **argv) diff --git a/drivers/clock_control/clock_control_rcar_cpg_mssr.c b/drivers/clock_control/clock_control_rcar_cpg_mssr.c index cb926484cf0..03f0d6b162f 100644 --- a/drivers/clock_control/clock_control_rcar_cpg_mssr.c +++ b/drivers/clock_control/clock_control_rcar_cpg_mssr.c @@ -221,7 +221,7 @@ static const struct clock_control_driver_api rcar_cpg_mssr_api = { NULL, \ NULL, &rcar_mssr##inst##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, \ + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, \ &rcar_cpg_mssr_api); DT_INST_FOREACH_STATUS_OKAY(RCAR_MSSR_INIT) diff --git a/drivers/clock_control/clock_control_rv32m1_pcc.c b/drivers/clock_control/clock_control_rv32m1_pcc.c index fa6419607d1..093e1d78d6b 100644 --- a/drivers/clock_control/clock_control_rv32m1_pcc.c +++ b/drivers/clock_control/clock_control_rv32m1_pcc.c @@ -72,7 +72,7 @@ static const struct clock_control_driver_api rv32m1_pcc_api = { NULL, \ NULL, &rv32m1_pcc##inst##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, \ + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, \ &rv32m1_pcc_api); DT_INST_FOREACH_STATUS_OKAY(RV32M1_PCC_INIT) diff --git a/drivers/clock_control/clock_stm32_ll_common.c b/drivers/clock_control/clock_stm32_ll_common.c index d15ae18ca51..e1f5393f7ac 100644 --- a/drivers/clock_control/clock_stm32_ll_common.c +++ b/drivers/clock_control/clock_stm32_ll_common.c @@ -726,5 +726,5 @@ DEVICE_DT_DEFINE(DT_NODELABEL(rcc), NULL, NULL, NULL, PRE_KERNEL_1, - CONFIG_CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY, + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &stm32_clock_control_api); diff --git a/drivers/clock_control/clock_stm32_ll_h7.c b/drivers/clock_control/clock_stm32_ll_h7.c index 6c6251cf378..b5642682713 100644 --- a/drivers/clock_control/clock_stm32_ll_h7.c +++ b/drivers/clock_control/clock_stm32_ll_h7.c @@ -734,5 +734,5 @@ DEVICE_DT_DEFINE(DT_NODELABEL(rcc), NULL, NULL, NULL, PRE_KERNEL_1, - CONFIG_CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY, + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &stm32_clock_control_api); diff --git a/drivers/clock_control/clock_stm32_ll_mp1.c b/drivers/clock_control/clock_stm32_ll_mp1.c index c1c9cde9556..c5f909ffa8b 100644 --- a/drivers/clock_control/clock_stm32_ll_mp1.c +++ b/drivers/clock_control/clock_stm32_ll_mp1.c @@ -414,5 +414,5 @@ DEVICE_DT_DEFINE(DT_NODELABEL(rcc), NULL, NULL, NULL, PRE_KERNEL_1, - CONFIG_CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY, + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &stm32_clock_control_api); diff --git a/drivers/clock_control/clock_stm32_ll_u5.c b/drivers/clock_control/clock_stm32_ll_u5.c index 4edbb170cec..33a6acf4805 100644 --- a/drivers/clock_control/clock_stm32_ll_u5.c +++ b/drivers/clock_control/clock_stm32_ll_u5.c @@ -595,5 +595,5 @@ DEVICE_DT_DEFINE(DT_NODELABEL(rcc), NULL, NULL, NULL, PRE_KERNEL_1, - CONFIG_CLOCK_CONTROL_STM32_DEVICE_INIT_PRIORITY, + CONFIG_CLOCK_CONTROL_INIT_PRIORITY, &stm32_clock_control_api); diff --git a/soc/arm/arm/beetle/Kconfig.defconfig.series b/soc/arm/arm/beetle/Kconfig.defconfig.series index 9fcaf9873c9..2c2f58634a0 100644 --- a/soc/arm/arm/beetle/Kconfig.defconfig.series +++ b/soc/arm/arm/beetle/Kconfig.defconfig.series @@ -16,4 +16,8 @@ config NUM_IRQS config SYS_CLOCK_HW_CYCLES_PER_SEC default 24000000 +config CLOCK_CONTROL_INIT_PRIORITY + default 1 + depends on CLOCK_CONTROL + endif # SOC_SERIES_BEETLE diff --git a/soc/arm/st_stm32/common/Kconfig.defconfig.series b/soc/arm/st_stm32/common/Kconfig.defconfig.series index 6ad33b6c120..fd8de68c417 100644 --- a/soc/arm/st_stm32/common/Kconfig.defconfig.series +++ b/soc/arm/st_stm32/common/Kconfig.defconfig.series @@ -25,6 +25,10 @@ config CLOCK_CONTROL_STM32_CUBE default y depends on CLOCK_CONTROL +config CLOCK_CONTROL_INIT_PRIORITY + default 1 + depends on CLOCK_CONTROL + config UART_STM32 default y depends on SERIAL