From c6c3e194d9b52c1abb3ea8772bbbe2ffae321be9 Mon Sep 17 00:00:00 2001 From: Aksel Skauge Mellbye Date: Wed, 2 Oct 2024 22:37:29 +0200 Subject: [PATCH] boards: silabs: Remove clock configuration Clock setup is now done by the clock manager based on device tree configuration. Signed-off-by: Aksel Skauge Mellbye --- boards/silabs/dev_kits/sltb010a/board.c | 30 -------------- boards/silabs/dev_kits/xg24_dk2601b/board.c | 36 ----------------- .../xg24_dk2601b/xg24_dk2601b_defconfig | 2 - boards/silabs/dev_kits/xg27_dk2602a/board.c | 30 -------------- .../thing_plus_matter_mgm240p/board.c | 39 ------------------- ...arkfun_thing_plus_matter_mgm240p_defconfig | 2 - 6 files changed, 139 deletions(-) diff --git a/boards/silabs/dev_kits/sltb010a/board.c b/boards/silabs/dev_kits/sltb010a/board.c index 7572f0fad39..ac43052e362 100644 --- a/boards/silabs/dev_kits/sltb010a/board.c +++ b/boards/silabs/dev_kits/sltb010a/board.c @@ -8,22 +8,12 @@ #include #include -#ifdef CONFIG_SOC_GECKO_DEV_INIT -#include "em_cmu.h" -#endif - - LOG_MODULE_REGISTER(thunderboard, CONFIG_BOARD_SLTB010A_LOG_LEVEL); -static int thunderboard_init_clocks(void); - static int thunderboard_init(void) { int ret; -#ifdef CONFIG_SOC_GECKO_DEV_INIT - thunderboard_init_clocks(); -#endif static struct gpio_dt_spec wake_up_gpio_dev = GPIO_DT_SPEC_GET(DT_NODELABEL(wake_up_trigger), gpios); @@ -40,25 +30,5 @@ static int thunderboard_init(void) return 0; } -#ifdef CONFIG_SOC_GECKO_DEV_INIT -static int thunderboard_init_clocks(void) -{ - CMU_ClockSelectSet(cmuClock_SYSCLK, cmuSelect_HFRCODPLL); -#if defined(_CMU_EM01GRPACLKCTRL_MASK) - CMU_ClockSelectSet(cmuClock_EM01GRPACLK, cmuSelect_HFRCODPLL); -#endif -#if defined(_CMU_EM01GRPBCLKCTRL_MASK) - CMU_ClockSelectSet(cmuClock_EM01GRPBCLK, cmuSelect_HFRCODPLL); -#endif - CMU_ClockSelectSet(cmuClock_EM23GRPACLK, cmuSelect_LFRCO); -#if defined(RTCC_PRESENT) - CMU_ClockSelectSet(cmuClock_RTCC, cmuSelect_LFRCO); -#endif - CMU_ClockSelectSet(cmuClock_WDOG0, cmuSelect_LFRCO); - - return 0; -} -#endif - /* needs to be done after GPIO driver init */ SYS_INIT(thunderboard_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/silabs/dev_kits/xg24_dk2601b/board.c b/boards/silabs/dev_kits/xg24_dk2601b/board.c index 601b759b6ca..52c2e02e44a 100644 --- a/boards/silabs/dev_kits/xg24_dk2601b/board.c +++ b/boards/silabs/dev_kits/xg24_dk2601b/board.c @@ -9,21 +9,12 @@ #include #include -#ifdef CONFIG_SOC_GECKO_DEV_INIT -#include "em_cmu.h" -#endif - LOG_MODULE_REGISTER(efr32xg24_dk2601b, CONFIG_BOARD_EFR32MG24_LOG_LEVEL); -static int efr32xg24_dk2601b_init_clocks(void); - static int efr32xg24_dk2601b_init(void) { int ret; -#ifdef CONFIG_SOC_GECKO_DEV_INIT - efr32xg24_dk2601b_init_clocks(); -#endif static struct gpio_dt_spec wake_up_gpio_dev = GPIO_DT_SPEC_GET(DT_NODELABEL(wake_up_trigger), gpios); @@ -40,32 +31,5 @@ static int efr32xg24_dk2601b_init(void) return 0; } -#ifdef CONFIG_SOC_GECKO_DEV_INIT -static int efr32xg24_dk2601b_init_clocks(void) -{ - CMU_ClockSelectSet(cmuClock_SYSCLK, cmuSelect_HFRCODPLL); -#if defined(_CMU_EM01GRPACLKCTRL_MASK) - CMU_ClockSelectSet(cmuClock_EM01GRPACLK, cmuSelect_HFRCODPLL); -#endif -#if defined(_CMU_EM01GRPBCLKCTRL_MASK) - CMU_ClockSelectSet(cmuClock_EM01GRPBCLK, cmuSelect_HFRCODPLL); -#endif - CMU_ClockSelectSet(cmuClock_EM23GRPACLK, cmuSelect_LFRCO); - CMU_ClockSelectSet(cmuClock_EM4GRPACLK, cmuSelect_LFRCO); -#if defined(RTCC_PRESENT) - CMU_ClockSelectSet(cmuClock_RTCC, cmuSelect_LFRCO); -#endif -#if defined(SYSRTC_PRESENT) - CMU_ClockSelectSet(cmuClock_SYSRTC, cmuSelect_LFRCO); -#endif - CMU_ClockSelectSet(cmuClock_WDOG0, cmuSelect_LFRCO); -#if WDOG_COUNT > 1 - CMU_ClockSelectSet(cmuClock_WDOG1, cmuSelect_LFRCO); -#endif - - return 0; -} -#endif - /* needs to be done after GPIO driver init */ SYS_INIT(efr32xg24_dk2601b_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/silabs/dev_kits/xg24_dk2601b/xg24_dk2601b_defconfig b/boards/silabs/dev_kits/xg24_dk2601b/xg24_dk2601b_defconfig index c1fa5ece855..b7dbc036d0c 100644 --- a/boards/silabs/dev_kits/xg24_dk2601b/xg24_dk2601b_defconfig +++ b/boards/silabs/dev_kits/xg24_dk2601b/xg24_dk2601b_defconfig @@ -7,8 +7,6 @@ CONFIG_UART_CONSOLE=y CONFIG_SERIAL=y CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y -CONFIG_CMU_HFCLK_HFXO=y -CONFIG_CMU_HFCLK_LFXO=y CONFIG_HW_STACK_PROTECTION=y CONFIG_PINCTRL=y CONFIG_REGULATOR=y diff --git a/boards/silabs/dev_kits/xg27_dk2602a/board.c b/boards/silabs/dev_kits/xg27_dk2602a/board.c index f26befcf508..7c466f6ee74 100644 --- a/boards/silabs/dev_kits/xg27_dk2602a/board.c +++ b/boards/silabs/dev_kits/xg27_dk2602a/board.c @@ -8,22 +8,12 @@ #include #include -#ifdef CONFIG_SOC_GECKO_DEV_INIT -#include "em_cmu.h" -#endif - - LOG_MODULE_REGISTER(dev_kit, CONFIG_BOARD_XG27_DK2602A_LOG_LEVEL); -static int dev_kit_init_clocks(void); - static int dev_kit_init(void) { int ret; -#ifdef CONFIG_SOC_GECKO_DEV_INIT - dev_kit_init_clocks(); -#endif static struct gpio_dt_spec wake_up_gpio_dev = GPIO_DT_SPEC_GET(DT_NODELABEL(wake_up_trigger), gpios); @@ -40,25 +30,5 @@ static int dev_kit_init(void) return 0; } -#ifdef CONFIG_SOC_GECKO_DEV_INIT -static int dev_kit_init_clocks(void) -{ - CMU_ClockSelectSet(cmuClock_SYSCLK, cmuSelect_HFRCODPLL); -#if defined(_CMU_EM01GRPACLKCTRL_MASK) - CMU_ClockSelectSet(cmuClock_EM01GRPACLK, cmuSelect_HFRCODPLL); -#endif -#if defined(_CMU_EM01GRPBCLKCTRL_MASK) - CMU_ClockSelectSet(cmuClock_EM01GRPBCLK, cmuSelect_HFRCODPLL); -#endif - CMU_ClockSelectSet(cmuClock_EM23GRPACLK, cmuSelect_LFRCO); -#if defined(RTCC_PRESENT) - CMU_ClockSelectSet(cmuClock_RTCC, cmuSelect_LFRCO); -#endif - CMU_ClockSelectSet(cmuClock_WDOG0, cmuSelect_LFRCO); - - return 0; -} -#endif - /* needs to be done after GPIO driver init */ SYS_INIT(dev_kit_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/sparkfun/thing_plus_matter_mgm240p/board.c b/boards/sparkfun/thing_plus_matter_mgm240p/board.c index 36735f35276..beb2b540294 100644 --- a/boards/sparkfun/thing_plus_matter_mgm240p/board.c +++ b/boards/sparkfun/thing_plus_matter_mgm240p/board.c @@ -10,22 +10,13 @@ #include #include -#ifdef CONFIG_SOC_GECKO_DEV_INIT -#include "em_cmu.h" -#endif - LOG_MODULE_REGISTER(sparkfun_thing_plus_mgm240p, CONFIG_BOARD_SPARKFUN_THING_PLUS_MATTER_MGM240P_LOG_LEVEL); -static int sparkfun_thing_plus_mgm240p_init_clocks(void); - static int sparkfun_thing_plus_mgm240p_init(void) { int ret; -#ifdef CONFIG_SOC_GECKO_DEV_INIT - sparkfun_thing_plus_mgm240p_init_clocks(); -#endif static struct gpio_dt_spec wake_up_gpio_dev = GPIO_DT_SPEC_GET(DT_NODELABEL(wake_up_trigger), gpios); @@ -42,35 +33,5 @@ static int sparkfun_thing_plus_mgm240p_init(void) return 0; } -#ifdef CONFIG_SOC_GECKO_DEV_INIT -static int sparkfun_thing_plus_mgm240p_init_clocks(void) -{ - CMU_ClockSelectSet(cmuClock_SYSCLK, cmuSelect_HFRCODPLL); -#if defined(_CMU_EM01GRPACLKCTRL_MASK) - CMU_ClockSelectSet(cmuClock_EM01GRPACLK, cmuSelect_HFRCODPLL); -#endif -#if defined(_CMU_EM01GRPBCLKCTRL_MASK) - CMU_ClockSelectSet(cmuClock_EM01GRPBCLK, cmuSelect_HFRCODPLL); -#endif -#if defined(_CMU_EM01GRPCCLKCTRL_MASK) - CMU_ClockSelectSet(cmuClock_EM01GRPCCLK, cmuSelect_HFRCODPLL); -#endif - CMU_ClockSelectSet(cmuClock_EM23GRPACLK, cmuSelect_LFRCO); - CMU_ClockSelectSet(cmuClock_EM4GRPACLK, cmuSelect_LFRCO); -#if defined(RTCC_PRESENT) - CMU_ClockSelectSet(cmuClock_RTCC, cmuSelect_LFRCO); -#endif -#if defined(SYSRTC_PRESENT) - CMU_ClockSelectSet(cmuClock_SYSRTC, cmuSelect_LFRCO); -#endif - CMU_ClockSelectSet(cmuClock_WDOG0, cmuSelect_LFRCO); -#if WDOG_COUNT > 1 - CMU_ClockSelectSet(cmuClock_WDOG1, cmuSelect_LFRCO); -#endif - - return 0; -} -#endif - /* needs to be done after GPIO driver init */ SYS_INIT(sparkfun_thing_plus_mgm240p_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p_defconfig b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p_defconfig index 6ab4ff4cdaa..85bdf41ea99 100644 --- a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p_defconfig +++ b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p_defconfig @@ -9,10 +9,8 @@ CONFIG_SERIAL=y CONFIG_CORTEX_M_SYSTICK=y CONFIG_GPIO=y CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=76800000 -CONFIG_CMU_HFCLK_HFXO=y CONFIG_SOC_GECKO_EMU_DCDC=y CONFIG_SOC_GECKO_EMU_DCDC_MODE_ON=y -CONFIG_CMU_HFCLK_LFXO=y CONFIG_HW_STACK_PROTECTION=y CONFIG_PINCTRL=y CONFIG_REGULATOR=y