From 0c6ccc0941d9fb548e8e7ad4fbcabfda2065e756 Mon Sep 17 00:00:00 2001 From: Christian Taedcke Date: Wed, 24 Mar 2021 12:09:43 +0100 Subject: [PATCH] boards: silabs: Fix board controller init priority Before this fix the board init function were called too early, before the gpio driver was initialized. Because of the the board controller for the serial port was not enabled properly. This commit fixes this issue. Signed-off-by: Christian Taedcke --- boards/arm/efm32gg_stk3701a/Kconfig | 13 ------------- boards/arm/efm32gg_stk3701a/board.c | 3 ++- boards/arm/efm32hg_slstk3400a/Kconfig | 14 -------------- boards/arm/efm32hg_slstk3400a/board.c | 3 ++- boards/arm/efm32pg_stk3401a/Kconfig | 13 ------------- boards/arm/efm32pg_stk3401a/board.c | 3 ++- boards/arm/efm32pg_stk3402a/Kconfig | 13 ------------- boards/arm/efm32pg_stk3402a/board.c | 3 ++- boards/arm/efm32wg_stk3800/Kconfig | 13 ------------- boards/arm/efm32wg_stk3800/board.c | 2 +- boards/arm/efr32_radio/Kconfig | 8 -------- boards/arm/efr32_radio/board.c | 2 +- boards/arm/efr32mg_sltb004a/Kconfig | 12 ------------ boards/arm/efr32mg_sltb004a/board.c | 3 ++- 14 files changed, 12 insertions(+), 93 deletions(-) delete mode 100644 boards/arm/efm32gg_stk3701a/Kconfig delete mode 100644 boards/arm/efm32hg_slstk3400a/Kconfig delete mode 100644 boards/arm/efm32pg_stk3401a/Kconfig delete mode 100644 boards/arm/efm32pg_stk3402a/Kconfig delete mode 100644 boards/arm/efm32wg_stk3800/Kconfig delete mode 100644 boards/arm/efr32mg_sltb004a/Kconfig diff --git a/boards/arm/efm32gg_stk3701a/Kconfig b/boards/arm/efm32gg_stk3701a/Kconfig deleted file mode 100644 index 9b3e4836501..00000000000 --- a/boards/arm/efm32gg_stk3701a/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -# EFM32GG STK3701A board configuration -# Copyright (c) 2019 Interay Solutions B.V. -# Copyright (c) 2019 Oane Kingma -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_INIT_PRIORITY - int - default KERNEL_INIT_PRIORITY_DEFAULT - depends on BOARD_EFM32GG_STK3701A - depends on GPIO - help - Board initialization priority. This must be bigger than - GPIO_GECKO_COMMON_INIT_PRIORITY. diff --git a/boards/arm/efm32gg_stk3701a/board.c b/boards/arm/efm32gg_stk3701a/board.c index 6f31d4a49ef..619008d88f5 100644 --- a/boards/arm/efm32gg_stk3701a/board.c +++ b/boards/arm/efm32gg_stk3701a/board.c @@ -71,4 +71,5 @@ static int efm32gg_stk3701a_init(const struct device *dev) } /* needs to be done after GPIO driver init */ -SYS_INIT(efm32gg_stk3701a_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY); +SYS_INIT(efm32gg_stk3701a_init, POST_KERNEL, + CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arm/efm32hg_slstk3400a/Kconfig b/boards/arm/efm32hg_slstk3400a/Kconfig deleted file mode 100644 index 2b966bbeeeb..00000000000 --- a/boards/arm/efm32hg_slstk3400a/Kconfig +++ /dev/null @@ -1,14 +0,0 @@ -# EFM32WG SLSTK3400A board configuration - -# Copyright (c) 2017 Christian Taedcke -# Copyright (c) 2018 Marcio Montenegro -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_INIT_PRIORITY - int - default KERNEL_INIT_PRIORITY_DEFAULT - depends on BOARD_EFM32HG_SLSTK3400A - depends on GPIO - help - Board initialization priority. This must be bigger than - GPIO_GECKO_COMMON_INIT_PRIORITY. diff --git a/boards/arm/efm32hg_slstk3400a/board.c b/boards/arm/efm32hg_slstk3400a/board.c index e6b5bc5d423..5fe53b0587b 100644 --- a/boards/arm/efm32hg_slstk3400a/board.c +++ b/boards/arm/efm32hg_slstk3400a/board.c @@ -29,4 +29,5 @@ static int efm32hg_slstk3400a_init(const struct device *dev) } /* needs to be done after GPIO driver init */ -SYS_INIT(efm32hg_slstk3400a_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY); +SYS_INIT(efm32hg_slstk3400a_init, POST_KERNEL, + CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arm/efm32pg_stk3401a/Kconfig b/boards/arm/efm32pg_stk3401a/Kconfig deleted file mode 100644 index 68a921b705b..00000000000 --- a/boards/arm/efm32pg_stk3401a/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -# EFM32PG STK3401A board configuration - -# Copyright (c) 2020 Rafael Dias Menezes -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_INIT_PRIORITY - int - default KERNEL_INIT_PRIORITY_DEFAULT - depends on BOARD_EFM32PG_STK3401A - depends on GPIO - help - Board initialization priority. This must be bigger than - GPIO_GECKO_COMMON_INIT_PRIORITY. diff --git a/boards/arm/efm32pg_stk3401a/board.c b/boards/arm/efm32pg_stk3401a/board.c index 83f1013396f..fd7ebe6a67f 100644 --- a/boards/arm/efm32pg_stk3401a/board.c +++ b/boards/arm/efm32pg_stk3401a/board.c @@ -29,4 +29,5 @@ static int efm32pg_stk3401a_init(const struct device *dev) } /* needs to be done after GPIO driver init */ -SYS_INIT(efm32pg_stk3401a_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY); +SYS_INIT(efm32pg_stk3401a_init, POST_KERNEL, + CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arm/efm32pg_stk3402a/Kconfig b/boards/arm/efm32pg_stk3402a/Kconfig deleted file mode 100644 index 2b781110dc2..00000000000 --- a/boards/arm/efm32pg_stk3402a/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -# EFM32PG STK3402A board configuration - -# Copyright (c) 2018 Christian Taedcke -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_INIT_PRIORITY - int - default KERNEL_INIT_PRIORITY_DEFAULT - depends on BOARD_EFM32PG_STK3402A || BOARD_EFM32PG_STK3402A_JG - depends on GPIO - help - Board initialization priority. This must be bigger than - GPIO_GECKO_COMMON_INIT_PRIORITY. diff --git a/boards/arm/efm32pg_stk3402a/board.c b/boards/arm/efm32pg_stk3402a/board.c index 99eea511e2a..2084359aea1 100644 --- a/boards/arm/efm32pg_stk3402a/board.c +++ b/boards/arm/efm32pg_stk3402a/board.c @@ -29,4 +29,5 @@ static int efm32pg_stk3402a_init(const struct device *dev) } /* needs to be done after GPIO driver init */ -SYS_INIT(efm32pg_stk3402a_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY); +SYS_INIT(efm32pg_stk3402a_init, POST_KERNEL, + CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arm/efm32wg_stk3800/Kconfig b/boards/arm/efm32wg_stk3800/Kconfig deleted file mode 100644 index 9da29bc06ca..00000000000 --- a/boards/arm/efm32wg_stk3800/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -# EFM32WG STK3800 board configuration - -# Copyright (c) 2017 Christian Taedcke -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_INIT_PRIORITY - int - default KERNEL_INIT_PRIORITY_DEFAULT - depends on BOARD_EFM32WG_STK3800 - depends on GPIO - help - Board initialization priority. This must be bigger than - GPIO_GECKO_COMMON_INIT_PRIORITY. diff --git a/boards/arm/efm32wg_stk3800/board.c b/boards/arm/efm32wg_stk3800/board.c index de6960a7ad3..080d20f376d 100644 --- a/boards/arm/efm32wg_stk3800/board.c +++ b/boards/arm/efm32wg_stk3800/board.c @@ -29,4 +29,4 @@ static int efm32wg_stk3800_init(const struct device *dev) } /* needs to be done after GPIO driver init */ -SYS_INIT(efm32wg_stk3800_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY); +SYS_INIT(efm32wg_stk3800_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arm/efr32_radio/Kconfig b/boards/arm/efr32_radio/Kconfig index 5bbe58fba84..9de639f91bd 100644 --- a/boards/arm/efr32_radio/Kconfig +++ b/boards/arm/efr32_radio/Kconfig @@ -5,11 +5,3 @@ config BOARD_EFR32_RADIO bool - -config BOARD_INIT_PRIORITY - int - default KERNEL_INIT_PRIORITY_DEFAULT - depends on BOARD_EFR32_RADIO - help - Board initialization priority. This must be bigger than - GPIO_GECKO_COMMON_INIT_PRIORITY. diff --git a/boards/arm/efr32_radio/board.c b/boards/arm/efr32_radio/board.c index 7b9f6833aa7..174ca406ff8 100644 --- a/boards/arm/efr32_radio/board.c +++ b/boards/arm/efr32_radio/board.c @@ -36,4 +36,4 @@ static int efr32_radio_init(const struct device *dev) } /* needs to be done after GPIO driver init */ -SYS_INIT(efr32_radio_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY); +SYS_INIT(efr32_radio_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/boards/arm/efr32mg_sltb004a/Kconfig b/boards/arm/efr32mg_sltb004a/Kconfig deleted file mode 100644 index 8ea8ee8abd9..00000000000 --- a/boards/arm/efr32mg_sltb004a/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -# EFR32MG SLTB004A board configuration - -# Copyright (c) 2018 Christian Taedcke, Diego Sueiro -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_INIT_PRIORITY - int - default KERNEL_INIT_PRIORITY_DEFAULT - depends on BOARD_EFR32MG_SLTB004A - help - Board initialization priority. This must be bigger than - GPIO_GECKO_COMMON_INIT_PRIORITY. diff --git a/boards/arm/efr32mg_sltb004a/board.c b/boards/arm/efr32mg_sltb004a/board.c index 69468376aa1..0d2b10d2b03 100644 --- a/boards/arm/efr32mg_sltb004a/board.c +++ b/boards/arm/efr32mg_sltb004a/board.c @@ -56,4 +56,5 @@ static int efr32mg_sltb004a_init(const struct device *dev) } /* needs to be done after GPIO driver init */ -SYS_INIT(efr32mg_sltb004a_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY); +SYS_INIT(efr32mg_sltb004a_init, POST_KERNEL, + CONFIG_KERNEL_INIT_PRIORITY_DEVICE);