From d711d224c24db4922e4a5d12806b8165ea49b81d Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Mon, 18 Oct 2021 09:40:03 +0200 Subject: [PATCH] drivers: serial: neorv32: use shared serial driver init priority Use the shared CONFIG_SERIAL_INIT_PRIORITY for driver initialization priority. Override the default value for the NEORV32 SoC to ensure the serial driver is initialized after the syscon driver by default. Signed-off-by: Henrik Brix Andersen --- drivers/serial/Kconfig.neorv32 | 8 -------- drivers/serial/uart_neorv32.c | 2 +- .../riscv-privilege/neorv32/Kconfig.defconfig.series | 4 ++++ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/serial/Kconfig.neorv32 b/drivers/serial/Kconfig.neorv32 index 5ab1f86977..101b2e0188 100644 --- a/drivers/serial/Kconfig.neorv32 +++ b/drivers/serial/Kconfig.neorv32 @@ -11,11 +11,3 @@ config UART_NEORV32 select SERIAL_SUPPORT_INTERRUPT help This option enables the UART driver for the NEORV32. - -config UART_NEORV32_INIT_PRIORITY - int "Driver inititalization priority" - default 55 - depends on UART_NEORV32 - help - Device driver initialization priority. This driver must be - initialized after the syscon driver. diff --git a/drivers/serial/uart_neorv32.c b/drivers/serial/uart_neorv32.c index 40967af0bc..f255f7a4c5 100644 --- a/drivers/serial/uart_neorv32.c +++ b/drivers/serial/uart_neorv32.c @@ -540,7 +540,7 @@ static const struct uart_driver_api neorv32_uart_driver_api = { &neorv32_uart_##n##_data, \ &neorv32_uart_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_UART_NEORV32_INIT_PRIORITY, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &neorv32_uart_driver_api) #if DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(uart0), DT_DRV_COMPAT, okay) diff --git a/soc/riscv/riscv-privilege/neorv32/Kconfig.defconfig.series b/soc/riscv/riscv-privilege/neorv32/Kconfig.defconfig.series index dc022ea1d1..4a93142a14 100644 --- a/soc/riscv/riscv-privilege/neorv32/Kconfig.defconfig.series +++ b/soc/riscv/riscv-privilege/neorv32/Kconfig.defconfig.series @@ -21,4 +21,8 @@ config RISCV_GP config SYSCON default y +config SERIAL_INIT_PRIORITY + default 55 + depends on SERIAL + endif # SOC_SERIES_NEORV32