From ad1450510affc29f9a6ea606405f6e5a3ecd85d3 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Thu, 14 Oct 2021 09:38:10 -0500 Subject: [PATCH] drivers: serial: Refactor drivers to use shared init priority Kconfig Refactors all of the serial drivers to use a shared driver class initialization priority configuration, CONFIG_SERIAL_INIT_PRIORITY, to allow configuring serial drivers separately from other devices. This is similar to other driver classes like I2C and SPI. The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to preserve the existing default initialization priority for most drivers. The one exception is uart_lpc11u6x.c which previously used CONFIG_KERNEL_INIT_PRIORITY_OBJECTS. This change was motivated by an issue on the frdm_k64f board where the serial driver was incorrectly initialized before the clock control driver. Signed-off-by: Maureen Helm --- drivers/serial/Kconfig | 6 ++++++ drivers/serial/leuart_gecko.c | 4 ++-- drivers/serial/serial_test.c | 2 +- drivers/serial/uart_altera_jtag_hal.c | 2 +- drivers/serial/uart_apbuart.c | 2 +- drivers/serial/uart_b91.c | 2 +- drivers/serial/uart_cc13xx_cc26xx.c | 2 +- drivers/serial/uart_cc32xx.c | 2 +- drivers/serial/uart_cmsdk_apb.c | 10 +++++----- drivers/serial/uart_esp32.c | 2 +- drivers/serial/uart_gecko.c | 4 ++-- drivers/serial/uart_imx.c | 2 +- drivers/serial/uart_liteuart.c | 2 +- drivers/serial/uart_lpc11u6x.c | 4 ++-- drivers/serial/uart_mchp_xec.c | 2 +- drivers/serial/uart_mcux.c | 2 +- drivers/serial/uart_mcux_flexcomm.c | 2 +- drivers/serial/uart_mcux_iuart.c | 2 +- drivers/serial/uart_mcux_lpsci.c | 2 +- drivers/serial/uart_mcux_lpuart.c | 2 +- drivers/serial/uart_miv.c | 2 +- drivers/serial/uart_msp432p4xx.c | 2 +- drivers/serial/uart_native_posix.c | 4 ++-- drivers/serial/uart_npcx.c | 2 +- drivers/serial/uart_nrfx_uart.c | 2 +- drivers/serial/uart_nrfx_uarte.c | 2 +- drivers/serial/uart_ns16550.c | 2 +- drivers/serial/uart_numicro.c | 2 +- drivers/serial/uart_pl011.c | 6 +++--- drivers/serial/uart_psoc6.c | 2 +- drivers/serial/uart_rcar.c | 2 +- drivers/serial/uart_rom_esp32c3.c | 2 +- drivers/serial/uart_rom_esp32s2.c | 2 +- drivers/serial/uart_rtt.c | 2 +- drivers/serial/uart_rv32m1_lpuart.c | 2 +- drivers/serial/uart_sam.c | 2 +- drivers/serial/uart_sam0.c | 2 +- drivers/serial/uart_sifive.c | 4 ++-- drivers/serial/uart_stellaris.c | 6 +++--- drivers/serial/uart_stm32.c | 2 +- drivers/serial/uart_xlnx_ps.c | 2 +- drivers/serial/uart_xlnx_uartlite.c | 2 +- drivers/serial/uart_xmc4xxx.c | 2 +- drivers/serial/usart_sam.c | 2 +- 44 files changed, 62 insertions(+), 56 deletions(-) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index c1bba4c4ed2641..4cd924c8ebb95a 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -31,6 +31,12 @@ config SERIAL_SUPPORT_INTERRUPT This is an option to be enabled by individual serial driver to signal that the driver and hardware supports interrupts. +config SERIAL_INIT_PRIORITY + int "Serial init priority" + default KERNEL_INIT_PRIORITY_DEVICE + help + Serial driver device initialization priority. + config UART_USE_RUNTIME_CONFIGURE bool "Enable runtime configuration for UART controllers" default y diff --git a/drivers/serial/leuart_gecko.c b/drivers/serial/leuart_gecko.c index ee877b7f40d1ea..62d1478d4b4a33 100644 --- a/drivers/serial/leuart_gecko.c +++ b/drivers/serial/leuart_gecko.c @@ -354,7 +354,7 @@ static struct leuart_gecko_data leuart_gecko_0_data; DEVICE_DT_INST_DEFINE(0, &leuart_gecko_init, NULL, &leuart_gecko_0_data, &leuart_gecko_0_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &leuart_gecko_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -407,7 +407,7 @@ static struct leuart_gecko_data leuart_gecko_1_data; DEVICE_DT_INST_DEFINE(1, &leuart_gecko_init, NULL, &leuart_gecko_1_data, &leuart_gecko_1_config, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &leuart_gecko_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/serial_test.c b/drivers/serial/serial_test.c index d70e110e4b6d5b..13da30d2b06315 100644 --- a/drivers/serial/serial_test.c +++ b/drivers/serial/serial_test.c @@ -61,7 +61,7 @@ static int serial_vnd_init(const struct device *dev) #define VND_SERIAL_INIT(n) \ DEVICE_DT_INST_DEFINE(n, &serial_vnd_init, NULL, \ NULL, NULL, POST_KERNEL, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &serial_vnd_api); DT_INST_FOREACH_STATUS_OKAY(VND_SERIAL_INIT) diff --git a/drivers/serial/uart_altera_jtag_hal.c b/drivers/serial/uart_altera_jtag_hal.c index 98eb2b5f231fee..79d42b3720ed27 100644 --- a/drivers/serial/uart_altera_jtag_hal.c +++ b/drivers/serial/uart_altera_jtag_hal.c @@ -61,5 +61,5 @@ static const struct uart_device_config uart_altera_jtag_dev_cfg_0 = { DEVICE_DT_INST_DEFINE(0, uart_altera_jtag_init, NULL, NULL, &uart_altera_jtag_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &uart_altera_jtag_driver_api); diff --git a/drivers/serial/uart_apbuart.c b/drivers/serial/uart_apbuart.c index 04e85aa31d3ff1..f74ab6648c367f 100644 --- a/drivers/serial/uart_apbuart.c +++ b/drivers/serial/uart_apbuart.c @@ -538,7 +538,7 @@ static const struct uart_driver_api apbuart_driver_api = { &apbuart##index##_data, \ &apbuart##index##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &apbuart_driver_api); DT_INST_FOREACH_STATUS_OKAY(APBUART_INIT) diff --git a/drivers/serial/uart_b91.c b/drivers/serial/uart_b91.c index 8b10a21661503c..78f1f96605fed8 100644 --- a/drivers/serial/uart_b91.c +++ b/drivers/serial/uart_b91.c @@ -559,7 +559,7 @@ static const struct uart_driver_api uart_b91_driver_api = { &uart_b91_data_##n, \ &uart_b91_cfg_##n, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ (void *)&uart_b91_driver_api); \ \ static void uart_b91_irq_connect_##n(void) \ diff --git a/drivers/serial/uart_cc13xx_cc26xx.c b/drivers/serial/uart_cc13xx_cc26xx.c index 50e7aec6fff463..fb5313032dcb44 100644 --- a/drivers/serial/uart_cc13xx_cc26xx.c +++ b/drivers/serial/uart_cc13xx_cc26xx.c @@ -539,7 +539,7 @@ static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = { uart_cc13xx_cc26xx_init_##n, \ uart_cc13xx_cc26xx_pm_control, \ &uart_cc13xx_cc26xx_data_##n, &uart_cc13xx_cc26xx_config_##n,\ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_cc13xx_cc26xx_driver_api) #ifdef CONFIG_PM_DEVICE diff --git a/drivers/serial/uart_cc32xx.c b/drivers/serial/uart_cc32xx.c index 4a0b278604edb7..e84ec87d1c016e 100644 --- a/drivers/serial/uart_cc32xx.c +++ b/drivers/serial/uart_cc32xx.c @@ -331,7 +331,7 @@ static struct uart_cc32xx_dev_data_t uart_cc32xx_dev_data_##idx = { \ DEVICE_DT_INST_DEFINE(idx, uart_cc32xx_init, \ NULL, &uart_cc32xx_dev_data_##idx, \ &uart_cc32xx_dev_cfg_##idx, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ (void *)&uart_cc32xx_driver_api); \ DT_INST_FOREACH_STATUS_OKAY(UART_32XX_DEVICE); diff --git a/drivers/serial/uart_cmsdk_apb.c b/drivers/serial/uart_cmsdk_apb.c index b39428840be188..5688351ec602a5 100644 --- a/drivers/serial/uart_cmsdk_apb.c +++ b/drivers/serial/uart_cmsdk_apb.c @@ -508,7 +508,7 @@ DEVICE_DT_INST_DEFINE(0, NULL, &uart_cmsdk_apb_dev_data_0, &uart_cmsdk_apb_dev_cfg_0, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -573,7 +573,7 @@ DEVICE_DT_INST_DEFINE(1, NULL, &uart_cmsdk_apb_dev_data_1, &uart_cmsdk_apb_dev_cfg_1, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -638,7 +638,7 @@ DEVICE_DT_INST_DEFINE(2, NULL, &uart_cmsdk_apb_dev_data_2, &uart_cmsdk_apb_dev_cfg_2, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -703,7 +703,7 @@ DEVICE_DT_INST_DEFINE(3, NULL, &uart_cmsdk_apb_dev_data_3, &uart_cmsdk_apb_dev_cfg_3, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -768,7 +768,7 @@ DEVICE_DT_INST_DEFINE(4, NULL, &uart_cmsdk_apb_dev_data_4, &uart_cmsdk_apb_dev_cfg_4, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_esp32.c b/drivers/serial/uart_esp32.c index 7dc44207fe134f..5247a005992479 100644 --- a/drivers/serial/uart_esp32.c +++ b/drivers/serial/uart_esp32.c @@ -447,7 +447,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(uart##idx), \ &uart_esp32_data_##idx, \ &uart_esp32_cfg_port_##idx, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_esp32_api); DT_INST_FOREACH_STATUS_OKAY(ESP32_UART_INIT); diff --git a/drivers/serial/uart_gecko.c b/drivers/serial/uart_gecko.c index 1c9be0f96dad77..3f3d6ebc1a0f3b 100644 --- a/drivers/serial/uart_gecko.c +++ b/drivers/serial/uart_gecko.c @@ -550,7 +550,7 @@ static const struct uart_driver_api uart_gecko_driver_api = { DEVICE_DT_INST_DEFINE(idx, &uart_gecko_init, \ NULL, &uart_gecko_data_##idx, \ &uart_gecko_cfg_##idx, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_gecko_driver_api); \ \ \ @@ -608,7 +608,7 @@ DT_INST_FOREACH_STATUS_OKAY(GECKO_UART_INIT) DEVICE_DT_INST_DEFINE(idx, &uart_gecko_init, NULL, \ &usart_gecko_data_##idx, \ &usart_gecko_cfg_##idx, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_gecko_driver_api); \ \ GECKO_USART_IRQ_HANDLER(idx) diff --git a/drivers/serial/uart_imx.c b/drivers/serial/uart_imx.c index 611fdb1939e60f..d120d9329698fc 100644 --- a/drivers/serial/uart_imx.c +++ b/drivers/serial/uart_imx.c @@ -319,7 +319,7 @@ static const struct uart_driver_api uart_imx_driver_api = { DEVICE_DT_INST_DEFINE(n, &uart_imx_init, NULL, \ &imx_uart_##n##_data, &imx_uart_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_imx_driver_api); \ \ UART_IMX_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_liteuart.c b/drivers/serial/uart_liteuart.c index 972852d96f80d7..fc55e2a1843b03 100644 --- a/drivers/serial/uart_liteuart.c +++ b/drivers/serial/uart_liteuart.c @@ -321,7 +321,7 @@ DEVICE_DT_INST_DEFINE(0, uart_liteuart_init, NULL, &uart_liteuart_data_0, &uart_liteuart_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, (void *)&uart_liteuart_driver_api); static int uart_liteuart_init(const struct device *dev) diff --git a/drivers/serial/uart_lpc11u6x.c b/drivers/serial/uart_lpc11u6x.c index f318aac79f71be..8bcd5a2587775f 100644 --- a/drivers/serial/uart_lpc11u6x.c +++ b/drivers/serial/uart_lpc11u6x.c @@ -446,7 +446,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(uart0), &lpc11u6x_uart0_init, NULL, &uart0_data, &uart0_config, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &uart0_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -904,7 +904,7 @@ static struct lpc11u6x_uartx_data uart_data_##idx; \ DEVICE_DT_DEFINE(DT_NODELABEL(uart##idx), \ &lpc11u6x_uartx_init, NULL, \ &uart_data_##idx, &uart_cfg_##idx, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uartx_api) #if DT_NODE_HAS_STATUS(DT_NODELABEL(uart1), okay) diff --git a/drivers/serial/uart_mchp_xec.c b/drivers/serial/uart_mchp_xec.c index 8affdc764bb2d9..0f329580ea23f1 100644 --- a/drivers/serial/uart_mchp_xec.c +++ b/drivers/serial/uart_mchp_xec.c @@ -894,7 +894,7 @@ static const struct uart_driver_api uart_xec_driver_api = { &uart_xec_dev_data_##n, \ &uart_xec_dev_cfg_##n, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_xec_driver_api); \ UART_XEC_IRQ_FUNC_DEFINE(n) diff --git a/drivers/serial/uart_mcux.c b/drivers/serial/uart_mcux.c index 011e85ee2d2de7..0e9ca5c0972916 100644 --- a/drivers/serial/uart_mcux.c +++ b/drivers/serial/uart_mcux.c @@ -414,7 +414,7 @@ static const struct uart_mcux_config uart_mcux_##n##_config = { \ &uart_mcux_##n##_data, \ &uart_mcux_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_mcux_driver_api); \ \ UART_MCUX_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_mcux_flexcomm.c b/drivers/serial/uart_mcux_flexcomm.c index fd442e31001fbd..51d214a1f434b1 100644 --- a/drivers/serial/uart_mcux_flexcomm.c +++ b/drivers/serial/uart_mcux_flexcomm.c @@ -348,7 +348,7 @@ static const struct mcux_flexcomm_config mcux_flexcomm_##n##_config = { \ &mcux_flexcomm_##n##_data, \ &mcux_flexcomm_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &mcux_flexcomm_driver_api); \ \ UART_MCUX_FLEXCOMM_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_mcux_iuart.c b/drivers/serial/uart_mcux_iuart.c index b12a4fe66c1c0e..076fb6e822aad4 100644 --- a/drivers/serial/uart_mcux_iuart.c +++ b/drivers/serial/uart_mcux_iuart.c @@ -317,7 +317,7 @@ static const struct mcux_iuart_config mcux_iuart_##n##_config = { \ &mcux_iuart_##n##_data, \ &mcux_iuart_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &mcux_iuart_driver_api); \ \ IUART_MCUX_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_mcux_lpsci.c b/drivers/serial/uart_mcux_lpsci.c index 254e05d6a8d141..cab60ca1f77c9c 100644 --- a/drivers/serial/uart_mcux_lpsci.c +++ b/drivers/serial/uart_mcux_lpsci.c @@ -321,7 +321,7 @@ static const struct mcux_lpsci_config mcux_lpsci_##n##_config = { \ &mcux_lpsci_##n##_data, \ &mcux_lpsci_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &mcux_lpsci_driver_api); \ \ MCUX_LPSCI_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_mcux_lpuart.c b/drivers/serial/uart_mcux_lpuart.c index 55018c4cd8c300..34b01effa86cf8 100644 --- a/drivers/serial/uart_mcux_lpuart.c +++ b/drivers/serial/uart_mcux_lpuart.c @@ -448,7 +448,7 @@ static const struct mcux_lpuart_config mcux_lpuart_##n##_config = { \ &mcux_lpuart_##n##_data, \ &mcux_lpuart_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &mcux_lpuart_driver_api); \ \ LPUART_MCUX_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_miv.c b/drivers/serial/uart_miv.c index 628351b4a198d8..fe73de4411448b 100644 --- a/drivers/serial/uart_miv.c +++ b/drivers/serial/uart_miv.c @@ -409,7 +409,7 @@ static const struct uart_miv_device_config uart_miv_dev_cfg_0 = { DEVICE_DT_INST_DEFINE(0, uart_miv_init, NULL, &uart_miv_data_0, &uart_miv_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, (void *)&uart_miv_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_msp432p4xx.c b/drivers/serial/uart_msp432p4xx.c index e55c40536e6456..f6f4e4f51a0cad 100644 --- a/drivers/serial/uart_msp432p4xx.c +++ b/drivers/serial/uart_msp432p4xx.c @@ -362,5 +362,5 @@ DEVICE_DT_INST_DEFINE(0, uart_msp432p4xx_init, NULL, &uart_msp432p4xx_dev_data_0, &uart_msp432p4xx_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, (void *)&uart_msp432p4xx_driver_api); diff --git a/drivers/serial/uart_native_posix.c b/drivers/serial/uart_native_posix.c index 42e94312b9cc86..b4fb43fbba64a3 100644 --- a/drivers/serial/uart_native_posix.c +++ b/drivers/serial/uart_native_posix.c @@ -367,14 +367,14 @@ static int np_uart_tty_poll_in(const struct device *dev, DEVICE_DT_INST_DEFINE(0, &np_uart_0_init, NULL, (void *)&native_uart_status_0, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &np_uart_driver_api_0); #if defined(CONFIG_UART_NATIVE_POSIX_PORT_1_ENABLE) DEVICE_DT_INST_DEFINE(1, &np_uart_1_init, NULL, (void *)&native_uart_status_1, NULL, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &np_uart_driver_api_1); #endif /* CONFIG_UART_NATIVE_POSIX_PORT_1_ENABLE */ diff --git a/drivers/serial/uart_npcx.c b/drivers/serial/uart_npcx.c index 7a8c4b75b4cf71..a6448f6505cb7f 100644 --- a/drivers/serial/uart_npcx.c +++ b/drivers/serial/uart_npcx.c @@ -506,7 +506,7 @@ static inline int uart_npcx_pm_control(const struct device *dev, &uart_npcx_init, \ uart_npcx_pm_control, \ &uart_npcx_data_##inst, &uart_npcx_cfg_##inst, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_npcx_driver_api); \ \ NPCX_UART_IRQ_CONFIG_FUNC(inst) diff --git a/drivers/serial/uart_nrfx_uart.c b/drivers/serial/uart_nrfx_uart.c index 32d0afaf85b306..781ea5f7208af7 100644 --- a/drivers/serial/uart_nrfx_uart.c +++ b/drivers/serial/uart_nrfx_uart.c @@ -1188,5 +1188,5 @@ DEVICE_DT_INST_DEFINE(0, NULL, /* Initialize UART device before UART console. */ PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &uart_nrfx_uart_driver_api); diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 9a66e2d442d3b1..bdcf69f2d8067d 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -2003,7 +2003,7 @@ static int uarte_nrfx_pm_control(const struct device *dev, &uarte_##idx##_data, \ &uarte_##idx##z_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_nrfx_uarte_driver_api) #define UARTE_CONFIG(idx) \ diff --git a/drivers/serial/uart_ns16550.c b/drivers/serial/uart_ns16550.c index 1364102be6ee9c..63a5402b9009d0 100644 --- a/drivers/serial/uart_ns16550.c +++ b/drivers/serial/uart_ns16550.c @@ -1108,7 +1108,7 @@ static const struct uart_driver_api uart_ns16550_driver_api = { }; \ DEVICE_DT_INST_DEFINE(n, &uart_ns16550_init, NULL, \ &uart_ns16550_dev_data_##n, &uart_ns16550_dev_cfg_##n, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_ns16550_driver_api); \ UART_NS16550_IRQ_FUNC_DEFINE(n) diff --git a/drivers/serial/uart_numicro.c b/drivers/serial/uart_numicro.c index a522d36ca8c37e..40941304fdc18d 100644 --- a/drivers/serial/uart_numicro.c +++ b/drivers/serial/uart_numicro.c @@ -207,7 +207,7 @@ DEVICE_DT_INST_DEFINE(index, \ NULL, \ &uart_numicro_data_##index, \ &uart_numicro_cfg_##index, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_numicro_driver_api); DT_INST_FOREACH_STATUS_OKAY(NUMICRO_INIT) diff --git a/drivers/serial/uart_pl011.c b/drivers/serial/uart_pl011.c index ed667a51f8319b..f6c9e2e28183cf 100644 --- a/drivers/serial/uart_pl011.c +++ b/drivers/serial/uart_pl011.c @@ -443,7 +443,7 @@ DEVICE_DT_INST_DEFINE(0, NULL, &pl011_data_port_0, &pl011_cfg_port_0, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &pl011_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -506,7 +506,7 @@ DEVICE_DT_INST_DEFINE(1, NULL, &pl011_data_port_1, &pl011_cfg_port_1, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &pl011_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -571,7 +571,7 @@ DEVICE_DT_INST_DEFINE(0, NULL, &pl011_data_sbsa, &pl011_cfg_sbsa, PRE_KERNEL_1, - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + CONFIG_SERIAL_INIT_PRIORITY, &pl011_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_psoc6.c b/drivers/serial/uart_psoc6.c index 223376969a8e34..bf1be63d78412f 100644 --- a/drivers/serial/uart_psoc6.c +++ b/drivers/serial/uart_psoc6.c @@ -361,7 +361,7 @@ static const struct uart_driver_api uart_psoc6_driver_api = { DEVICE_DT_INST_DEFINE(n, &uart_psoc6_init, NULL, \ CY_PSOC6_UART_DECL_DATA_PTR(n), \ &cy_psoc6_uart##n##_config, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_psoc6_driver_api); DT_INST_FOREACH_STATUS_OKAY(CY_PSOC6_UART_INIT) diff --git a/drivers/serial/uart_rcar.c b/drivers/serial/uart_rcar.c index 73f2bcfb9b07c8..2ffc96ffb9592d 100644 --- a/drivers/serial/uart_rcar.c +++ b/drivers/serial/uart_rcar.c @@ -583,7 +583,7 @@ static const struct uart_driver_api uart_rcar_driver_api = { NULL, \ &uart_rcar_data_##n, \ &uart_rcar_cfg_##n, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_rcar_driver_api); \ \ UART_RCAR_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_rom_esp32c3.c b/drivers/serial/uart_rom_esp32c3.c index d2c807da0c3b88..e10930ef8ce298 100644 --- a/drivers/serial/uart_rom_esp32c3.c +++ b/drivers/serial/uart_rom_esp32c3.c @@ -53,7 +53,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(uart##idx), \ NULL, \ NULL, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_rom_esp32c3_api); \ DT_INST_FOREACH_STATUS_OKAY(ESP32C3_ROM_UART_INIT) diff --git a/drivers/serial/uart_rom_esp32s2.c b/drivers/serial/uart_rom_esp32s2.c index 3b8e314858086b..f989ca14d2123d 100644 --- a/drivers/serial/uart_rom_esp32s2.c +++ b/drivers/serial/uart_rom_esp32s2.c @@ -51,7 +51,7 @@ DEVICE_DT_DEFINE(DT_NODELABEL(uart##idx), \ NULL, \ NULL, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_rom_esp32s2_api); \ DT_INST_FOREACH_STATUS_OKAY(ESP32S2_ROM_UART_INIT) diff --git a/drivers/serial/uart_rtt.c b/drivers/serial/uart_rtt.c index a214a1c4d26049..ea94328d493622 100644 --- a/drivers/serial/uart_rtt.c +++ b/drivers/serial/uart_rtt.c @@ -217,7 +217,7 @@ static const struct uart_driver_api uart_rtt_driver_api = { \ DEVICE_DT_DEFINE(UART_RTT(idx), uart_rtt_init, NULL, \ &uart_rtt##idx##_data, config, \ - PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_2, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_rtt_driver_api) #ifdef CONFIG_UART_RTT_0 diff --git a/drivers/serial/uart_rv32m1_lpuart.c b/drivers/serial/uart_rv32m1_lpuart.c index 5f7dc3652d4712..0bc20c5fa2ebb1 100644 --- a/drivers/serial/uart_rv32m1_lpuart.c +++ b/drivers/serial/uart_rv32m1_lpuart.c @@ -334,7 +334,7 @@ static const struct uart_driver_api rv32m1_lpuart_driver_api = { &rv32m1_lpuart_##n##_data, \ &rv32m1_lpuart_##n##_cfg, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &rv32m1_lpuart_driver_api); \ \ RV32M1_LPUART_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_sam.c b/drivers/serial/uart_sam.c index d7250f3bbd3c25..46d85184a59f32 100644 --- a/drivers/serial/uart_sam.c +++ b/drivers/serial/uart_sam.c @@ -364,7 +364,7 @@ static const struct uart_driver_api uart_sam_driver_api = { DEVICE_DT_INST_DEFINE(n, &uart_sam_init, \ NULL, &uart##n##_sam_data, \ &uart##n##_sam_config, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_sam_driver_api); \ \ UART_SAM_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_sam0.c b/drivers/serial/uart_sam0.c index 277e30fc395ab7..bae963a6582431 100644 --- a/drivers/serial/uart_sam0.c +++ b/drivers/serial/uart_sam0.c @@ -1256,7 +1256,7 @@ UART_SAM0_CONFIG_DEFN(n); \ DEVICE_DT_INST_DEFINE(n, uart_sam0_init, NULL, \ &uart_sam0_data_##n, \ &uart_sam0_config_##n, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_sam0_driver_api); \ UART_SAM0_IRQ_HANDLER(n) diff --git a/drivers/serial/uart_sifive.c b/drivers/serial/uart_sifive.c index f7f20d551c72c0..75cc9c464f41fa 100644 --- a/drivers/serial/uart_sifive.c +++ b/drivers/serial/uart_sifive.c @@ -396,7 +396,7 @@ DEVICE_DT_INST_DEFINE(0, uart_sifive_init, NULL, &uart_sifive_data_0, &uart_sifive_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, (void *)&uart_sifive_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -435,7 +435,7 @@ DEVICE_DT_INST_DEFINE(1, uart_sifive_init, NULL, &uart_sifive_data_1, &uart_sifive_dev_cfg_1, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, (void *)&uart_sifive_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_stellaris.c b/drivers/serial/uart_stellaris.c index 722aea504dc9bf..b5c71269e2c3a3 100644 --- a/drivers/serial/uart_stellaris.c +++ b/drivers/serial/uart_stellaris.c @@ -652,7 +652,7 @@ DEVICE_DT_INST_DEFINE(0, &uart_stellaris_init, NULL, &uart_stellaris_dev_data_0, &uart_stellaris_dev_cfg_0, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &uart_stellaris_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -691,7 +691,7 @@ DEVICE_DT_INST_DEFINE(1, &uart_stellaris_init, NULL, &uart_stellaris_dev_data_1, &uart_stellaris_dev_cfg_1, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &uart_stellaris_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN @@ -730,7 +730,7 @@ DEVICE_DT_INST_DEFINE(2, &uart_stellaris_init, NULL, &uart_stellaris_dev_data_2, &uart_stellaris_dev_cfg_2, - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, &uart_stellaris_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index a7b71f255be201..fc06d1ebc43da1 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -1608,7 +1608,7 @@ DEVICE_DT_INST_DEFINE(index, \ &uart_stm32_init, \ NULL, \ &uart_stm32_data_##index, &uart_stm32_cfg_##index, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_stm32_driver_api); \ \ STM32_UART_IRQ_HANDLER(index) diff --git a/drivers/serial/uart_xlnx_ps.c b/drivers/serial/uart_xlnx_ps.c index 628ffbe164e573..57349a681b5a6e 100644 --- a/drivers/serial/uart_xlnx_ps.c +++ b/drivers/serial/uart_xlnx_ps.c @@ -1214,7 +1214,7 @@ DEVICE_DT_INST_DEFINE(port, \ NULL, \ &uart_xlnx_ps_dev_data_##port, \ &uart_xlnx_ps_dev_cfg_##port, \ - PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \ &uart_xlnx_ps_driver_api) #define UART_XLNX_INSTANTIATE(inst) \ diff --git a/drivers/serial/uart_xlnx_uartlite.c b/drivers/serial/uart_xlnx_uartlite.c index 78035acfc6b0d9..2f8ab3053b7dec 100644 --- a/drivers/serial/uart_xlnx_uartlite.c +++ b/drivers/serial/uart_xlnx_uartlite.c @@ -379,7 +379,7 @@ static const struct xlnx_uartlite_config xlnx_uartlite_##n##_config = { \ &xlnx_uartlite_##n##_data, \ &xlnx_uartlite_##n##_config, \ PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &xlnx_uartlite_driver_api); \ \ XLNX_UARTLITE_CONFIG_FUNC(n) \ diff --git a/drivers/serial/uart_xmc4xxx.c b/drivers/serial/uart_xmc4xxx.c index 6fd52a74811f71..991d75b894eb8c 100644 --- a/drivers/serial/uart_xmc4xxx.c +++ b/drivers/serial/uart_xmc4xxx.c @@ -77,7 +77,7 @@ static const struct uart_device_config xmc4xxx_config_##index = { \ NULL, \ &xmc4xxx_data_##index, \ &xmc4xxx_config_##index, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &uart_xmc4xxx_driver_api); DT_INST_FOREACH_STATUS_OKAY(XMC4XXX_INIT) diff --git a/drivers/serial/usart_sam.c b/drivers/serial/usart_sam.c index 63e4267388ba29..2f9f1e871980bf 100644 --- a/drivers/serial/usart_sam.c +++ b/drivers/serial/usart_sam.c @@ -366,7 +366,7 @@ static const struct uart_driver_api usart_sam_driver_api = { &usart_sam_init, NULL, \ &usart##n##_sam_data, \ &usart##n##_sam_config, PRE_KERNEL_1, \ - CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \ + CONFIG_SERIAL_INIT_PRIORITY, \ &usart_sam_driver_api); \ \ USART_SAM_CONFIG_FUNC(n) \