summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Boie <andrew.p.boie@intel.com>2016-11-08 11:06:55 -0800
committerAndrew Boie <andrew.p.boie@intel.com>2016-11-09 17:59:44 +0000
commit0b474eef9c1f4af586a019dd556c90e15f51f113 (patch)
tree180d169307f37b89192fca5af09923bed9c35d59
parent183a79cf6ee0078bfc42c071140c39e2c8892af2 (diff)
kernel: deprecate old init levels
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now deprecated. New init levels introduced: PRE_KERNEL_1, PRE_KERNEL_2, POST_KERNEL to replace them. Most existing code has instances of PRIMARY replaced with PRE_KERNEL_1, SECONDARY with POST_KERNEL as SECONDARY has had a longstanding bug where the documentation specified SECONDARY ran before the kernel started up, but actually ran afterwards. Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
-rw-r--r--arch/arc/core/cache.c2
-rw-r--r--arch/arc/soc/em11d/soc.c2
-rw-r--r--arch/arc/soc/em11d/soc_config.c2
-rw-r--r--arch/arc/soc/em7d/soc.c2
-rw-r--r--arch/arc/soc/em7d/soc_config.c2
-rw-r--r--arch/arc/soc/em9d/soc.c2
-rw-r--r--arch/arc/soc/em9d/soc_config.c2
-rw-r--r--arch/arc/soc/quark_se_c1000_ss/soc.c2
-rw-r--r--arch/arc/soc/quark_se_c1000_ss/soc_config.c6
-rw-r--r--arch/arm/soc/atmel_sam3/soc.c2
-rw-r--r--arch/arm/soc/nordic_nrf5/nrf51/soc.c2
-rw-r--r--arch/arm/soc/nordic_nrf5/nrf52/soc.c2
-rw-r--r--arch/arm/soc/nxp_kinetis/k6x/soc.c2
-rw-r--r--arch/arm/soc/nxp_kinetis/k6x/soc_config.c2
-rw-r--r--arch/arm/soc/st_stm32/stm32f1/soc.c2
-rw-r--r--arch/arm/soc/st_stm32/stm32f4/soc.c2
-rw-r--r--arch/arm/soc/ti_lm3s6965/soc.c2
-rw-r--r--arch/arm/soc/ti_lm3s6965/soc_config.c2
-rw-r--r--arch/arm/soc/ti_simplelink/cc32xx/soc.c2
-rw-r--r--arch/x86/core/cache.c2
-rw-r--r--arch/x86/soc/intel_quark/quark_se/soc.c2
-rw-r--r--arch/x86/soc/intel_quark/quark_se/soc_config.c4
-rw-r--r--arch/x86/soc/intel_quark/quark_x1000/soc.c2
-rw-r--r--boards/arm/arduino_due/pinmux.c2
-rw-r--r--boards/arm/cc3200_launchxl/pinmux.c2
-rw-r--r--boards/x86/arduino_101/pinmux.c2
-rw-r--r--boards/x86/galileo/pinmux.c2
-rw-r--r--boards/x86/galileo/pinmux_dev.c2
-rw-r--r--boards/x86/quark_d2000_crb/pinmux.c2
-rw-r--r--boards/x86/quark_se_c1000_devboard/pinmux.c2
-rw-r--r--doc/drivers/drivers.rst21
-rw-r--r--drivers/adc/adc_dw.c2
-rw-r--r--drivers/adc/adc_qmsi.c2
-rw-r--r--drivers/adc/adc_qmsi_ss.c2
-rw-r--r--drivers/adc/adc_ti_adc108s102.c2
-rw-r--r--drivers/aio/aio_comparator_qmsi.c2
-rw-r--r--drivers/clock_control/nrf5_power_clock.c4
-rw-r--r--drivers/clock_control/quark_se_clock_control.c6
-rw-r--r--drivers/clock_control/stm32f10x_clock.c2
-rw-r--r--drivers/clock_control/stm32f4x_clock.c2
-rw-r--r--drivers/console/ram_console.c2
-rw-r--r--drivers/console/uart_console.c4
-rw-r--r--drivers/counter/counter_qmsi_aon.c2
-rw-r--r--drivers/counter/counter_qmsi_aonpt.c2
-rw-r--r--drivers/dma/dma_qmsi.c2
-rw-r--r--drivers/ethernet/eth_enc28j60.c2
-rw-r--r--drivers/flash/soc_flash_ksdk.c2
-rw-r--r--drivers/flash/soc_flash_nrf5.c2
-rw-r--r--drivers/flash/soc_flash_qmsi.c2
-rw-r--r--drivers/flash/spi_flash_w25qxxdv.c2
-rw-r--r--drivers/gpio/gpio_atmel_sam3.c8
-rw-r--r--drivers/gpio/gpio_dw.c16
-rw-r--r--drivers/gpio/gpio_k64.c10
-rw-r--r--drivers/gpio/gpio_nrf5.c2
-rw-r--r--drivers/gpio/gpio_pcal9535a.c8
-rw-r--r--drivers/gpio/gpio_qmsi.c4
-rw-r--r--drivers/gpio/gpio_qmsi_ss.c4
-rw-r--r--drivers/gpio/gpio_sch.c4
-rw-r--r--drivers/gpio/gpio_stm32.c4
-rw-r--r--drivers/grove/light_sensor.c2
-rw-r--r--drivers/grove/temperature_sensor.c2
-rw-r--r--drivers/i2c/i2c_atmel_sam3.c4
-rw-r--r--drivers/i2c/i2c_dw.c4
-rw-r--r--drivers/i2c/i2c_ksdk.c4
-rw-r--r--drivers/i2c/i2c_qmsi.c4
-rw-r--r--drivers/i2c/i2c_qmsi_ss.c4
-rw-r--r--drivers/interrupt_controller/exti_stm32.c2
-rw-r--r--drivers/interrupt_controller/i8259.c2
-rw-r--r--drivers/interrupt_controller/ioapic_intr.c4
-rw-r--r--drivers/interrupt_controller/loapic_intr.c4
-rw-r--r--drivers/interrupt_controller/mvic.c2
-rw-r--r--drivers/ipm/ipm_quark_se.h2
-rw-r--r--drivers/pinmux/dev/pinmux_dev_atmel_sam3x.c2
-rw-r--r--drivers/pinmux/dev/pinmux_dev_k64.c2
-rw-r--r--drivers/pinmux/dev/pinmux_dev_qmsi.c2
-rw-r--r--drivers/pinmux/dev/pinmux_dev_stm32.c2
-rw-r--r--drivers/pinmux/k64/pinmux_board_frdm_k64f.c2
-rw-r--r--drivers/pinmux/k64/pinmux_board_hexiwear.c2
-rw-r--r--drivers/pinmux/stm32/pinmux_board_carbon.c2
-rw-r--r--drivers/pinmux/stm32/pinmux_board_nucleo_f103rb.c2
-rw-r--r--drivers/pinmux/stm32/pinmux_board_nucleo_f401re.c2
-rw-r--r--drivers/pinmux/stm32/pinmux_board_olimexino_stm32.c2
-rw-r--r--drivers/pinmux/stm32/pinmux_board_stm32_mini_a15.c2
-rw-r--r--drivers/pwm/pwm_dw.c2
-rw-r--r--drivers/pwm/pwm_k64_ftm.c8
-rw-r--r--drivers/pwm/pwm_pca9685.c2
-rw-r--r--drivers/pwm/pwm_qmsi.c2
-rw-r--r--drivers/rtc/rtc_qmsi.c2
-rw-r--r--drivers/sensor/ak8975/ak8975.c2
-rw-r--r--drivers/sensor/bma280/bma280.c2
-rw-r--r--drivers/sensor/bme280/bme280.c2
-rw-r--r--drivers/sensor/bmg160/bmg160.c2
-rw-r--r--drivers/sensor/dht/dht.c2
-rw-r--r--drivers/sensor/fxos8700/fxos8700.c2
-rw-r--r--drivers/sensor/hdc1008/hdc1008.c2
-rw-r--r--drivers/sensor/hmc5883l/hmc5883l.c2
-rw-r--r--drivers/sensor/hts221/hts221.c2
-rw-r--r--drivers/sensor/isl29035/isl29035.c2
-rw-r--r--drivers/sensor/lis3dh/lis3dh.c2
-rw-r--r--drivers/sensor/lis3mdl/lis3mdl.c2
-rw-r--r--drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c2
-rw-r--r--drivers/sensor/max44009/max44009.c2
-rw-r--r--drivers/sensor/mcp9808/mcp9808.c2
-rw-r--r--drivers/sensor/mpu6050/mpu6050.c2
-rw-r--r--drivers/sensor/sht3xd/sht3xd.c2
-rw-r--r--drivers/sensor/sx9500/sx9500.c2
-rw-r--r--drivers/sensor/th02/th02.c2
-rw-r--r--drivers/sensor/tmp007/tmp007.c2
-rw-r--r--drivers/sensor/tmp112/tmp112.c2
-rw-r--r--drivers/serial/uart_altera_jtag.c2
-rw-r--r--drivers/serial/uart_atmel_sam3.c2
-rw-r--r--drivers/serial/uart_cc32xx.c2
-rw-r--r--drivers/serial/uart_k20.c10
-rw-r--r--drivers/serial/uart_nrf5.c2
-rw-r--r--drivers/serial/uart_ns16550.c4
-rw-r--r--drivers/serial/uart_nsim.c2
-rw-r--r--drivers/serial/uart_qmsi.c4
-rw-r--r--drivers/serial/uart_stellaris.c6
-rw-r--r--drivers/serial/uart_stm32.c6
-rw-r--r--drivers/shared_irq/Kconfig2
-rw-r--r--drivers/shared_irq/shared_irq.c4
-rw-r--r--drivers/spi/spi_dw.c4
-rw-r--r--drivers/spi/spi_intel.c4
-rw-r--r--drivers/spi/spi_k64.c6
-rw-r--r--drivers/spi/spi_qmsi.c4
-rw-r--r--drivers/spi/spi_qmsi_ss.c4
-rw-r--r--drivers/timer/sys_clock_init.c2
-rw-r--r--drivers/watchdog/iwdg_stm32.c2
-rw-r--r--drivers/watchdog/wdt_qmsi.c2
-rw-r--r--include/device.h37
-rw-r--r--include/init.h24
-rw-r--r--include/linker-defs.h9
-rw-r--r--kernel/unified/alert.c2
-rw-r--r--kernel/unified/device.c17
-rw-r--r--kernel/unified/fifo.c2
-rw-r--r--kernel/unified/init.c12
-rw-r--r--kernel/unified/legacy_offload.c2
-rw-r--r--kernel/unified/legacy_timer.c2
-rw-r--r--kernel/unified/lifo.c2
-rw-r--r--kernel/unified/mailbox.c2
-rw-r--r--kernel/unified/mem_pool.c2
-rw-r--r--kernel/unified/mem_slab.c3
-rw-r--r--kernel/unified/msg_q.c2
-rw-r--r--kernel/unified/mutex.c2
-rw-r--r--kernel/unified/pipes.c2
-rw-r--r--kernel/unified/sem.c2
-rw-r--r--kernel/unified/stack.c2
-rw-r--r--kernel/unified/system_work_q.c2
-rw-r--r--kernel/unified/timer.c2
-rw-r--r--misc/debug/mem_safe_check_boundaries.c2
150 files changed, 281 insertions, 238 deletions
diff --git a/arch/arc/core/cache.c b/arch/arc/core/cache.c
index c289c060f..af8a3f12c 100644
--- a/arch/arc/core/cache.c
+++ b/arch/arc/core/cache.c
@@ -178,7 +178,7 @@ static int init_dcache(struct device *unused)
return 0;
}
-SYS_INIT(init_dcache, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(init_dcache, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_CACHE_FLUSHING */
diff --git a/arch/arc/soc/em11d/soc.c b/arch/arc/soc/em11d/soc.c
index 891815615..36067c0b1 100644
--- a/arch/arc/soc/em11d/soc.c
+++ b/arch/arc/soc/em11d/soc.c
@@ -43,4 +43,4 @@ static int em11d_arc_init(struct device *arg)
return 0;
}
-SYS_INIT(em11d_arc_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(em11d_arc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/arch/arc/soc/em11d/soc_config.c b/arch/arc/soc/em11d/soc_config.c
index 0dac33d46..9b8a5ab36 100644
--- a/arch/arc/soc/em11d/soc_config.c
+++ b/arch/arc/soc/em11d/soc_config.c
@@ -40,6 +40,6 @@ static int uart_ns16550_init(struct device *dev)
return 0;
}
-SYS_INIT(uart_ns16550_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(uart_ns16550_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_UART_NS16550 */
diff --git a/arch/arc/soc/em7d/soc.c b/arch/arc/soc/em7d/soc.c
index 36d78dd1e..ce334bbba 100644
--- a/arch/arc/soc/em7d/soc.c
+++ b/arch/arc/soc/em7d/soc.c
@@ -43,4 +43,4 @@ static int em7d_arc_init(struct device *arg)
return 0;
}
-SYS_INIT(em7d_arc_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(em7d_arc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/arch/arc/soc/em7d/soc_config.c b/arch/arc/soc/em7d/soc_config.c
index 0dac33d46..9b8a5ab36 100644
--- a/arch/arc/soc/em7d/soc_config.c
+++ b/arch/arc/soc/em7d/soc_config.c
@@ -40,6 +40,6 @@ static int uart_ns16550_init(struct device *dev)
return 0;
}
-SYS_INIT(uart_ns16550_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(uart_ns16550_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_UART_NS16550 */
diff --git a/arch/arc/soc/em9d/soc.c b/arch/arc/soc/em9d/soc.c
index 1ff05cea6..4581b630b 100644
--- a/arch/arc/soc/em9d/soc.c
+++ b/arch/arc/soc/em9d/soc.c
@@ -43,4 +43,4 @@ static int em9d_arc_init(struct device *arg)
return 0;
}
-SYS_INIT(em9d_arc_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(em9d_arc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/arch/arc/soc/em9d/soc_config.c b/arch/arc/soc/em9d/soc_config.c
index 0dac33d46..9b8a5ab36 100644
--- a/arch/arc/soc/em9d/soc_config.c
+++ b/arch/arc/soc/em9d/soc_config.c
@@ -40,6 +40,6 @@ static int uart_ns16550_init(struct device *dev)
return 0;
}
-SYS_INIT(uart_ns16550_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(uart_ns16550_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_UART_NS16550 */
diff --git a/arch/arc/soc/quark_se_c1000_ss/soc.c b/arch/arc/soc/quark_se_c1000_ss/soc.c
index beda1a9ef..7bab27143 100644
--- a/arch/arc/soc/quark_se_c1000_ss/soc.c
+++ b/arch/arc/soc/quark_se_c1000_ss/soc.c
@@ -45,4 +45,4 @@ static int quark_se_arc_init(struct device *arg)
return 0;
}
-SYS_INIT(quark_se_arc_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(quark_se_arc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/arch/arc/soc/quark_se_c1000_ss/soc_config.c b/arch/arc/soc/quark_se_c1000_ss/soc_config.c
index 38a8d9f4d..685c8c7ce 100644
--- a/arch/arc/soc/quark_se_c1000_ss/soc_config.c
+++ b/arch/arc/soc/quark_se_c1000_ss/soc_config.c
@@ -35,7 +35,7 @@ static struct quark_se_ipm_controller_config_info ipm_controller_config = {
};
DEVICE_AND_API_INIT(quark_se_ipm, "", quark_se_ipm_controller_initialize,
NULL, &ipm_controller_config,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&ipm_quark_se_api_funcs);
#if CONFIG_IPM_CONSOLE_SENDER
@@ -48,7 +48,7 @@ static struct ipm_console_sender_config_info quark_se_ipm_sender_config = {
};
DEVICE_INIT(ipm_console, "ipm_console", ipm_console_sender_init,
NULL, &quark_se_ipm_sender_config,
- SECONDARY, CONFIG_IPM_CONSOLE_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_IPM_CONSOLE_INIT_PRIORITY);
#endif /* CONFIG_IPM_CONSOLE_SENDER */
#endif /* CONFIG_IPM_QUARK_SE */
@@ -72,6 +72,6 @@ static int uart_ns16550_init(struct device *dev)
return 0;
}
-SYS_INIT(uart_ns16550_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(uart_ns16550_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_UART_NS16550 */
diff --git a/arch/arm/soc/atmel_sam3/soc.c b/arch/arm/soc/atmel_sam3/soc.c
index 35c495326..bdd572f1b 100644
--- a/arch/arm/soc/atmel_sam3/soc.c
+++ b/arch/arm/soc/atmel_sam3/soc.c
@@ -200,4 +200,4 @@ static int atmel_sam3_init(struct device *arg)
return 0;
}
-SYS_INIT(atmel_sam3_init, PRIMARY, 0);
+SYS_INIT(atmel_sam3_init, PRE_KERNEL_1, 0);
diff --git a/arch/arm/soc/nordic_nrf5/nrf51/soc.c b/arch/arm/soc/nordic_nrf5/nrf51/soc.c
index 6c5c7a557..10dd7e98e 100644
--- a/arch/arm/soc/nordic_nrf5/nrf51/soc.c
+++ b/arch/arm/soc/nordic_nrf5/nrf51/soc.c
@@ -126,4 +126,4 @@ static bool ftpan_59(void)
return false;
}
-SYS_INIT(nordicsemi_nrf51_init, PRIMARY, 0);
+SYS_INIT(nordicsemi_nrf51_init, PRE_KERNEL_1, 0);
diff --git a/arch/arm/soc/nordic_nrf5/nrf52/soc.c b/arch/arm/soc/nordic_nrf5/nrf52/soc.c
index c28233dad..b8fc981cd 100644
--- a/arch/arm/soc/nordic_nrf5/nrf52/soc.c
+++ b/arch/arm/soc/nordic_nrf5/nrf52/soc.c
@@ -247,4 +247,4 @@ static bool ftpan_36(void)
return false;
}
-SYS_INIT(nordicsemi_nrf52_init, PRIMARY, 0);
+SYS_INIT(nordicsemi_nrf52_init, PRE_KERNEL_1, 0);
diff --git a/arch/arm/soc/nxp_kinetis/k6x/soc.c b/arch/arm/soc/nxp_kinetis/k6x/soc.c
index ecb86b443..af93bf814 100644
--- a/arch/arm/soc/nxp_kinetis/k6x/soc.c
+++ b/arch/arm/soc/nxp_kinetis/k6x/soc.c
@@ -209,4 +209,4 @@ static int fsl_frdm_k64f_init(struct device *arg)
return 0;
}
-SYS_INIT(fsl_frdm_k64f_init, PRIMARY, 0);
+SYS_INIT(fsl_frdm_k64f_init, PRE_KERNEL_1, 0);
diff --git a/arch/arm/soc/nxp_kinetis/k6x/soc_config.c b/arch/arm/soc/nxp_kinetis/k6x/soc_config.c
index 21bb66c9d..de7754759 100644
--- a/arch/arm/soc/nxp_kinetis/k6x/soc_config.c
+++ b/arch/arm/soc/nxp_kinetis/k6x/soc_config.c
@@ -119,6 +119,6 @@ static int uart_k20_init(struct device *dev)
DEVICE_INIT(_uart_k20_init, "", uart_k20_init,
NULL, NULL,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_UART_K20 */
diff --git a/arch/arm/soc/st_stm32/stm32f1/soc.c b/arch/arm/soc/st_stm32/stm32f1/soc.c
index 6c29507e7..421ebf414 100644
--- a/arch/arm/soc/st_stm32/stm32f1/soc.c
+++ b/arch/arm/soc/st_stm32/stm32f1/soc.c
@@ -63,4 +63,4 @@ static int stm32f1_init(struct device *arg)
return 0;
}
-SYS_INIT(stm32f1_init, PRIMARY, 0);
+SYS_INIT(stm32f1_init, PRE_KERNEL_1, 0);
diff --git a/arch/arm/soc/st_stm32/stm32f4/soc.c b/arch/arm/soc/st_stm32/stm32f4/soc.c
index a6b453d35..579ebfc77 100644
--- a/arch/arm/soc/st_stm32/stm32f4/soc.c
+++ b/arch/arm/soc/st_stm32/stm32f4/soc.c
@@ -64,4 +64,4 @@ static int st_stm32f4_init(struct device *arg)
return 0;
}
-SYS_INIT(st_stm32f4_init, PRIMARY, 0);
+SYS_INIT(st_stm32f4_init, PRE_KERNEL_1, 0);
diff --git a/arch/arm/soc/ti_lm3s6965/soc.c b/arch/arm/soc/ti_lm3s6965/soc.c
index b3d7e5c08..d55017eff 100644
--- a/arch/arm/soc/ti_lm3s6965/soc.c
+++ b/arch/arm/soc/ti_lm3s6965/soc.c
@@ -51,4 +51,4 @@ static int ti_lm3s6965_init(struct device *arg)
return 0;
}
-SYS_INIT(ti_lm3s6965_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(ti_lm3s6965_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/arch/arm/soc/ti_lm3s6965/soc_config.c b/arch/arm/soc/ti_lm3s6965/soc_config.c
index 73ad3b623..3b1ce5691 100644
--- a/arch/arm/soc/ti_lm3s6965/soc_config.c
+++ b/arch/arm/soc/ti_lm3s6965/soc_config.c
@@ -51,6 +51,6 @@ static int uart_stellaris_init(struct device *dev)
return 0;
}
-SYS_INIT(uart_stellaris_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+SYS_INIT(uart_stellaris_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
#endif /* CONFIG_UART_STELLARIS */
diff --git a/arch/arm/soc/ti_simplelink/cc32xx/soc.c b/arch/arm/soc/ti_simplelink/cc32xx/soc.c
index 893d1670e..2c80feda9 100644
--- a/arch/arm/soc/ti_simplelink/cc32xx/soc.c
+++ b/arch/arm/soc/ti_simplelink/cc32xx/soc.c
@@ -28,4 +28,4 @@ static int ti_cc3200_init(struct device *arg)
return 0;
}
-SYS_INIT(ti_cc3200_init, PRIMARY, 0);
+SYS_INIT(ti_cc3200_init, PRE_KERNEL_1, 0);
diff --git a/arch/x86/core/cache.c b/arch/x86/core/cache.c
index eecd873e8..f5dfce0ba 100644
--- a/arch/x86/core/cache.c
+++ b/arch/x86/core/cache.c
@@ -108,6 +108,6 @@ static int init_cache(struct device *unused)
return 0;
}
-SYS_INIT(init_cache, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(init_cache, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_CLFLUSH_DETECT || CONFIG_CACHE_LINE_SIZE_DETECT */
diff --git a/arch/x86/soc/intel_quark/quark_se/soc.c b/arch/x86/soc/intel_quark/quark_se/soc.c
index a3c1ea028..abe4b30d3 100644
--- a/arch/x86/soc/intel_quark/quark_se/soc.c
+++ b/arch/x86/soc/intel_quark/quark_se/soc.c
@@ -93,7 +93,7 @@ skip_arc_init:
return 0;
}
-SYS_INIT(arc_init, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(arc_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /*CONFIG_ARC_INIT*/
diff --git a/arch/x86/soc/intel_quark/quark_se/soc_config.c b/arch/x86/soc/intel_quark/quark_se/soc_config.c
index e7c7ffff3..c45993458 100644
--- a/arch/x86/soc/intel_quark/quark_se/soc_config.c
+++ b/arch/x86/soc/intel_quark/quark_se/soc_config.c
@@ -40,7 +40,7 @@ static struct quark_se_ipm_controller_config_info ipm_controller_config = {
};
DEVICE_AND_API_INIT(quark_se_ipm, "", quark_se_ipm_controller_initialize,
NULL, &ipm_controller_config,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&ipm_quark_se_api_funcs);
#if defined(CONFIG_IPM_CONSOLE_RECEIVER) && defined(CONFIG_PRINTK)
@@ -66,7 +66,7 @@ static struct ipm_console_receiver_config_info quark_se_ipm_receiver_config = {
struct ipm_console_receiver_runtime_data quark_se_ipm_receiver_driver_data;
DEVICE_INIT(ipm_console0, "ipm_console0", ipm_console_receiver_init,
&quark_se_ipm_receiver_driver_data, &quark_se_ipm_receiver_config,
- SECONDARY, CONFIG_IPM_CONSOLE_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_IPM_CONSOLE_INIT_PRIORITY);
#endif /* CONFIG_PRINTK && CONFIG_IPM_CONSOLE_RECEIVER */
#endif /* CONFIG_IPM_QUARK_SE */
diff --git a/arch/x86/soc/intel_quark/quark_x1000/soc.c b/arch/x86/soc/intel_quark/quark_x1000/soc.c
index f7f05ba0c..bfce3c734 100644
--- a/arch/x86/soc/intel_quark/quark_x1000/soc.c
+++ b/arch/x86/soc/intel_quark/quark_x1000/soc.c
@@ -72,5 +72,5 @@ static int pci_legacy_bridge_irq_config(struct device *unused)
}
SYS_INIT(pci_legacy_bridge_irq_config,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
#endif /* CONFIG_PCI_LEGACY_BRIDGE */
diff --git a/boards/arm/arduino_due/pinmux.c b/boards/arm/arduino_due/pinmux.c
index 88b2116a8..a58e066a1 100644
--- a/boards/arm/arduino_due/pinmux.c
+++ b/boards/arm/arduino_due/pinmux.c
@@ -301,4 +301,4 @@ static int pinmux_init(struct device *port)
return 0;
}
-SYS_INIT(pinmux_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(pinmux_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/boards/arm/cc3200_launchxl/pinmux.c b/boards/arm/cc3200_launchxl/pinmux.c
index 951e37bfc..ee5eb9ef8 100644
--- a/boards/arm/cc3200_launchxl/pinmux.c
+++ b/boards/arm/cc3200_launchxl/pinmux.c
@@ -86,4 +86,4 @@ int pinmux_initialize(struct device *port)
return 0;
}
-SYS_INIT(pinmux_initialize, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(pinmux_initialize, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/boards/x86/arduino_101/pinmux.c b/boards/x86/arduino_101/pinmux.c
index 86febae2b..93b54c3c2 100644
--- a/boards/x86/arduino_101/pinmux.c
+++ b/boards/x86/arduino_101/pinmux.c
@@ -173,4 +173,4 @@ static int pinmux_initialize(struct device *port)
return 0;
}
-SYS_INIT(pinmux_initialize, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(pinmux_initialize, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/boards/x86/galileo/pinmux.c b/boards/x86/galileo/pinmux.c
index 76fc3013c..40fa4179d 100644
--- a/boards/x86/galileo/pinmux.c
+++ b/boards/x86/galileo/pinmux.c
@@ -697,4 +697,4 @@ static int pinmux_galileo_initialize(struct device *port)
*/
DEVICE_INIT(pmux, CONFIG_PINMUX_NAME, &pinmux_galileo_initialize,
&galileo_pinmux_driver, NULL,
- SECONDARY, CONFIG_PINMUX_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_PINMUX_INIT_PRIORITY);
diff --git a/boards/x86/galileo/pinmux_dev.c b/boards/x86/galileo/pinmux_dev.c
index 7a519c3ca..04580f8af 100644
--- a/boards/x86/galileo/pinmux_dev.c
+++ b/boards/x86/galileo/pinmux_dev.c
@@ -106,5 +106,5 @@ static int pinmux_dev_galileo_initialize(struct device *port)
DEVICE_AND_API_INIT(pmux_dev, CONFIG_PINMUX_DEV_NAME,
&pinmux_dev_galileo_initialize,
&galileo_pinmux_driver, NULL,
- SECONDARY, CONFIG_PINMUX_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_PINMUX_INIT_PRIORITY,
&api_funcs);
diff --git a/boards/x86/quark_d2000_crb/pinmux.c b/boards/x86/quark_d2000_crb/pinmux.c
index 479b571db..6e7f2032a 100644
--- a/boards/x86/quark_d2000_crb/pinmux.c
+++ b/boards/x86/quark_d2000_crb/pinmux.c
@@ -109,4 +109,4 @@ static int pinmux_initialize(struct device *port)
return 0;
}
-SYS_INIT(pinmux_initialize, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(pinmux_initialize, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/boards/x86/quark_se_c1000_devboard/pinmux.c b/boards/x86/quark_se_c1000_devboard/pinmux.c
index 5550381fe..de69db7eb 100644
--- a/boards/x86/quark_se_c1000_devboard/pinmux.c
+++ b/boards/x86/quark_se_c1000_devboard/pinmux.c
@@ -152,4 +152,4 @@ static int pinmux_initialize(struct device *port)
return 0;
}
-SYS_INIT(pinmux_initialize, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(pinmux_initialize, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/doc/drivers/drivers.rst b/doc/drivers/drivers.rst
index e63a58226..d90951b1a 100644
--- a/doc/drivers/drivers.rst
+++ b/doc/drivers/drivers.rst
@@ -306,7 +306,7 @@ require the use of kernel services. The DEVICE_INIT() APIs allow the user to
specify at what time during the boot sequence the init function will be
executed. Any driver will specify one of five initialization levels:
-`PRIMARY`
+`PRE_KERNEL_1`
Used for devices that have no dependencies, such as those that rely
solely on hardware present in the processor/SOC. These devices cannot
use any kernel services during configuration, since the services are
@@ -314,30 +314,21 @@ executed. Any driver will specify one of five initialization levels:
so it's OK to set up interrupts. Init functions at this level run on the
interrupt stack.
-`SECONDARY`
+`PRE_KERNEL_2`
Used for devices that rely on the initialization of devices initialized
as part of the PRIMARY level. These devices cannot use any kernel
services during configuration, since the kerne services are not yet
available. Init functions at this level run on the interrupt stack.
-`NANOKERNEL`
- Used for devices that require nanokernel services during configuration.
- Init functions at this level run in context of the nanokernel
- background task or microkernel idle task depending on kernel
- configuration.
-
-`MICROKERNEL`
- Used for devices that require microkernel services during
- configuration. Init functions at this level run in context of the
- microkernel idle task. This init level is skipped if the microkernel is
- not enabled.
+`POST_KERNEL`
+ Used for devices that require kernel services during configuration.
+ Init functions at this level run in context of the kernel main task.
`APPLICATION`
Used for application components (i.e. non-kernel components) that need
automatic configuration. These devices can use all services provided by
the kernel during configuration. Init functions at this level run on
- either the nanokernel background task or microkernel idle task
- depending on kernel configuration.
+ the kernel main task.
Within each initialization level you may specify a priority level, relative to
other devices in the same initialization level. The priority level is specified
diff --git a/drivers/adc/adc_dw.c b/drivers/adc/adc_dw.c
index f3885120f..da09e1924 100644
--- a/drivers/adc/adc_dw.c
+++ b/drivers/adc/adc_dw.c
@@ -499,7 +499,7 @@ static struct adc_config adc_config_dev = {
DEVICE_AND_API_INIT(adc_dw, CONFIG_ADC_0_NAME, &adc_dw_init,
&adc_info_dev, &adc_config_dev,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&api_funcs);
static void adc_config_irq(void)
diff --git a/drivers/adc/adc_qmsi.c b/drivers/adc/adc_qmsi.c
index 699dd5676..3c0de5119 100644
--- a/drivers/adc/adc_qmsi.c
+++ b/drivers/adc/adc_qmsi.c
@@ -263,7 +263,7 @@ struct adc_info adc_info_dev;
DEVICE_AND_API_INIT(adc_qmsi, CONFIG_ADC_0_NAME, &adc_qmsi_init,
&adc_info_dev, NULL,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
(void *)&api_funcs);
static void adc_config_irq(void)
diff --git a/drivers/adc/adc_qmsi_ss.c b/drivers/adc/adc_qmsi_ss.c
index 36ae7435a..047ebf9f2 100644
--- a/drivers/adc/adc_qmsi_ss.c
+++ b/drivers/adc/adc_qmsi_ss.c
@@ -274,7 +274,7 @@ struct adc_info adc_info_dev;
DEVICE_INIT(adc_qmsi_ss, CONFIG_ADC_0_NAME, &adc_qmsi_ss_init,
&adc_info_dev, NULL,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
static void adc_config_irq(void)
{
diff --git a/drivers/adc/adc_ti_adc108s102.c b/drivers/adc/adc_ti_adc108s102.c
index 25f0c1814..c2517df7f 100644
--- a/drivers/adc/adc_ti_adc108s102.c
+++ b/drivers/adc/adc_ti_adc108s102.c
@@ -238,6 +238,6 @@ static const struct ti_adc108s102_config adc108s102_config = {
DEVICE_INIT(adc108s102, CONFIG_ADC_0_NAME,
ti_adc108s102_init,
&adc108s102_data, &adc108s102_config,
- SECONDARY, CONFIG_ADC_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_ADC_INIT_PRIORITY);
#endif /* CONFIG_ADC_TI_ADC108S102 */
diff --git a/drivers/aio/aio_comparator_qmsi.c b/drivers/aio/aio_comparator_qmsi.c
index 84c06f188..245fb7d9b 100644
--- a/drivers/aio/aio_comparator_qmsi.c
+++ b/drivers/aio/aio_comparator_qmsi.c
@@ -188,7 +188,7 @@ struct aio_qmsi_cmp_dev_data_t aio_qmsi_cmp_dev_data = {
DEVICE_AND_API_INIT(aio_qmsi_cmp, CONFIG_AIO_COMPARATOR_0_NAME,
&aio_qmsi_cmp_init, &aio_qmsi_cmp_dev_data, NULL,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
(void *)&aio_cmp_funcs);
static int aio_cmp_config(struct device *dev)
diff --git a/drivers/clock_control/nrf5_power_clock.c b/drivers/clock_control/nrf5_power_clock.c
index 4729c6535..ba8df0891 100644
--- a/drivers/clock_control/nrf5_power_clock.c
+++ b/drivers/clock_control/nrf5_power_clock.c
@@ -325,7 +325,7 @@ static const struct clock_control_driver_api _m16src_clock_control_api = {
DEVICE_AND_API_INIT(clock_nrf5_m16src,
CONFIG_CLOCK_CONTROL_NRF5_M16SRC_DRV_NAME,
- _clock_control_init, NULL, NULL, PRIMARY,
+ _clock_control_init, NULL, NULL, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&_m16src_clock_control_api);
@@ -337,6 +337,6 @@ static const struct clock_control_driver_api _k32src_clock_control_api = {
DEVICE_AND_API_INIT(clock_nrf5_k32src,
CONFIG_CLOCK_CONTROL_NRF5_K32SRC_DRV_NAME,
- _clock_control_init, NULL, NULL, PRIMARY,
+ _clock_control_init, NULL, NULL, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&_k32src_clock_control_api);
diff --git a/drivers/clock_control/quark_se_clock_control.c b/drivers/clock_control/quark_se_clock_control.c
index 3eec8270f..abc4d34d5 100644
--- a/drivers/clock_control/quark_se_clock_control.c
+++ b/drivers/clock_control/quark_se_clock_control.c
@@ -95,7 +95,7 @@ DEVICE_AND_API_INIT(clock_quark_se_peripheral,
CONFIG_CLOCK_CONTROL_QUARK_SE_PERIPHERAL_DRV_NAME,
&quark_se_clock_control_init,
NULL, &clock_quark_se_peripheral_config,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&quark_se_clock_control_api);
#endif /* CONFIG_CLOCK_CONTROL_QUARK_SE_PERIPHERAL */
@@ -109,7 +109,7 @@ DEVICE_AND_API_INIT(clock_quark_se_external,
CONFIG_CLOCK_CONTROL_QUARK_SE_EXTERNAL_DRV_NAME,
&quark_se_clock_control_init,
NULL, &clock_quark_se_external_config,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&quark_se_clock_control_api);
#endif /* CONFIG_CLOCK_CONTROL_QUARK_SE_EXTERNAL */
@@ -123,7 +123,7 @@ DEVICE_AND_API_INIT(clock_quark_se_sensor,
CONFIG_CLOCK_CONTROL_QUARK_SE_SENSOR_DRV_NAME,
&quark_se_clock_control_init,
NULL, &clock_quark_se_sensor_config,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&quark_se_clock_control_api);
#endif /* CONFIG_CLOCK_CONTROL_QUARK_SE_SENSOR */
diff --git a/drivers/clock_control/stm32f10x_clock.c b/drivers/clock_control/stm32f10x_clock.c
index 8e09bf3ef..ae4c65800 100644
--- a/drivers/clock_control/stm32f10x_clock.c
+++ b/drivers/clock_control/stm32f10x_clock.c
@@ -325,6 +325,6 @@ static struct stm32f10x_rcc_data stm32f10x_rcc_data = {
DEVICE_AND_API_INIT(rcc_stm32f10x, STM32_CLOCK_CONTROL_NAME,
&stm32f10x_clock_control_init,
&stm32f10x_rcc_data, NULL,
- PRIMARY,
+ PRE_KERNEL_1,
CONFIG_CLOCK_CONTROL_STM32F10X_DEVICE_INIT_PRIORITY,
&stm32f10x_clock_control_api);
diff --git a/drivers/clock_control/stm32f4x_clock.c b/drivers/clock_control/stm32f4x_clock.c
index 458a7b300..00c037ba4 100644
--- a/drivers/clock_control/stm32f4x_clock.c
+++ b/drivers/clock_control/stm32f4x_clock.c
@@ -355,6 +355,6 @@ static struct stm32f4x_rcc_data stm32f4x_rcc_data = {
DEVICE_AND_API_INIT(rcc_stm32f4x, STM32_CLOCK_CONTROL_NAME,
&stm32f4x_clock_control_init,
&stm32f4x_rcc_data, NULL,
- PRIMARY,
+ PRE_KERNEL_1,
CONFIG_CLOCK_CONTROL_STM32F4X_DEVICE_INIT_PRIORITY,
&stm32f4x_clock_control_api);
diff --git a/drivers/console/ram_console.c b/drivers/console/ram_console.c
index 90b1f858d..ca6e36ef4 100644
--- a/drivers/console/ram_console.c
+++ b/drivers/console/ram_console.c
@@ -45,4 +45,4 @@ static int ram_console_init(struct device *d)
return 0;
}
-SYS_INIT(ram_console_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(ram_console_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/drivers/console/uart_console.c b/drivers/console/uart_console.c
index 54fb54988..800c040e5 100644
--- a/drivers/console/uart_console.c
+++ b/drivers/console/uart_console.c
@@ -505,8 +505,8 @@ static int uart_console_init(struct device *arg)
/* UART console initializes after the UART device itself */
SYS_INIT(uart_console_init,
#if defined(CONFIG_EARLY_CONSOLE)
- PRIMARY,
+ PRE_KERNEL_1,
#else
- SECONDARY,
+ POST_KERNEL,
#endif
CONFIG_UART_CONSOLE_INIT_PRIORITY);
diff --git a/drivers/counter/counter_qmsi_aon.c b/drivers/counter/counter_qmsi_aon.c
index 3f4901171..e8aeea2c5 100644
--- a/drivers/counter/counter_qmsi_aon.c
+++ b/drivers/counter/counter_qmsi_aon.c
@@ -68,6 +68,6 @@ static int aon_counter_init(struct device *dev)
}
DEVICE_AND_API_INIT(aon_counter, CONFIG_AON_COUNTER_QMSI_DEV_NAME,
- aon_counter_init, NULL, NULL, SECONDARY,
+ aon_counter_init, NULL, NULL, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&aon_counter_qmsi_api);
diff --git a/drivers/counter/counter_qmsi_aonpt.c b/drivers/counter/counter_qmsi_aonpt.c
index d9574bcc2..6d8da5dbe 100644
--- a/drivers/counter/counter_qmsi_aonpt.c
+++ b/drivers/counter/counter_qmsi_aonpt.c
@@ -271,7 +271,7 @@ static int aon_timer_init(struct device *dev)
DEVICE_DEFINE(aon_timer, CONFIG_AON_TIMER_QMSI_DEV_NAME, aon_timer_init,
- aonpt_qmsi_device_ctrl, AONPT_CONTEXT, NULL, SECONDARY,
+ aonpt_qmsi_device_ctrl, AONPT_CONTEXT, NULL, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&aon_timer_qmsi_api);
diff --git a/drivers/dma/dma_qmsi.c b/drivers/dma/dma_qmsi.c
index 33fa31768..4f822e50b 100644
--- a/drivers/dma/dma_qmsi.c
+++ b/drivers/dma/dma_qmsi.c
@@ -217,7 +217,7 @@ static int dma_qmsi_device_ctrl(struct device *dev, uint32_t ctrl_command,
#endif
DEVICE_DEFINE(dma_qmsi, CONFIG_DMA_0_NAME, &dma_qmsi_init, dma_qmsi_device_ctrl,
- &dma_qmsi_dev_data, &dma_qmsi_config_data, SECONDARY,
+ &dma_qmsi_dev_data, &dma_qmsi_config_data, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, (void *)&dma_funcs);
static void dma_qmsi_config(struct device *dev)
diff --git a/drivers/ethernet/eth_enc28j60.c b/drivers/ethernet/eth_enc28j60.c
index 84136afb0..a2259971e 100644
--- a/drivers/ethernet/eth_enc28j60.c
+++ b/drivers/ethernet/eth_enc28j60.c
@@ -627,7 +627,7 @@ static const struct eth_enc28j60_config eth_enc28j60_0_config = {
DEVICE_AND_API_INIT(eth_enc28j60_0, CONFIG_ETH_ENC28J60_0_NAME,
&eth_enc28j60_init, &eth_enc28j60_0_runtime,
- &eth_enc28j60_0_config, SECONDARY,
+ &eth_enc28j60_0_config, POST_KERNEL,
CONFIG_ETH_ENC28J60_0_INIT_PRIORITY, &api_funcs);
static int eth_net_tx(struct net_buf *buf)
diff --git a/drivers/flash/soc_flash_ksdk.c b/drivers/flash/soc_flash_ksdk.c
index 7673cf151..b7a642d81 100644
--- a/drivers/flash/soc_flash_ksdk.c
+++ b/drivers/flash/soc_flash_ksdk.c
@@ -115,6 +115,6 @@ static int flash_ksdk_init(struct device *dev)
}
DEVICE_AND_API_INIT(flash_ksdk, CONFIG_SOC_FLASH_KSDK_DEV_NAME,
- flash_ksdk_init, &flash_data, NULL, SECONDARY,
+ flash_ksdk_init, &flash_data, NULL, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &flash_ksdk_api);
diff --git a/drivers/flash/soc_flash_nrf5.c b/drivers/flash/soc_flash_nrf5.c
index c2d0b15cd..71c89b688 100644
--- a/drivers/flash/soc_flash_nrf5.c
+++ b/drivers/flash/soc_flash_nrf5.c
@@ -168,4 +168,4 @@ static int nrf5_flash_init(struct device *dev)
}
DEVICE_INIT(nrf5_flash, CONFIG_SOC_FLASH_NRF5_DEV_NAME, nrf5_flash_init,
- NULL, NULL, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+ NULL, NULL, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
diff --git a/drivers/flash/soc_flash_qmsi.c b/drivers/flash/soc_flash_qmsi.c
index a5e47b607..b699771c5 100644
--- a/drivers/flash/soc_flash_qmsi.c
+++ b/drivers/flash/soc_flash_qmsi.c
@@ -364,5 +364,5 @@ static int quark_flash_init(struct device *dev)
}
DEVICE_DEFINE(quark_flash, CONFIG_SOC_FLASH_QMSI_DEV_NAME, quark_flash_init,
- flash_qmsi_device_ctrl, FLASH_CONTEXT, NULL, SECONDARY,
+ flash_qmsi_device_ctrl, FLASH_CONTEXT, NULL, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, (void *)&flash_qmsi_api);
diff --git a/drivers/flash/spi_flash_w25qxxdv.c b/drivers/flash/spi_flash_w25qxxdv.c
index 615c0e98e..b7732822e 100644
--- a/drivers/flash/spi_flash_w25qxxdv.c
+++ b/drivers/flash/spi_flash_w25qxxdv.c
@@ -383,5 +383,5 @@ static int spi_flash_init(struct device *dev)
static struct spi_flash_data spi_flash_memory_data;
DEVICE_INIT(spi_flash_memory, CONFIG_SPI_FLASH_W25QXXDV_DRV_NAME, spi_flash_init,
- &spi_flash_memory_data, NULL, SECONDARY,
+ &spi_flash_memory_data, NULL, POST_KERNEL,
CONFIG_SPI_FLASH_W25QXXDV_INIT_PRIORITY);
diff --git a/drivers/gpio/gpio_atmel_sam3.c b/drivers/gpio/gpio_atmel_sam3.c
index ad6b6f7dc..d789dcfe2 100644
--- a/drivers/gpio/gpio_atmel_sam3.c
+++ b/drivers/gpio/gpio_atmel_sam3.c
@@ -307,7 +307,7 @@ static struct gpio_sam3_runtime gpio_sam3_a_runtime;
DEVICE_AND_API_INIT(gpio_sam3_a, CONFIG_GPIO_ATMEL_SAM3_PORTA_DEV_NAME,
gpio_sam3_init, &gpio_sam3_a_runtime, &gpio_sam3_a_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&gpio_sam3_drv_api_funcs);
static void gpio_sam3_config_a(struct device *dev)
@@ -335,7 +335,7 @@ static struct gpio_sam3_runtime gpio_sam3_b_runtime;
DEVICE_AND_API_INIT(gpio_sam3_b, CONFIG_GPIO_ATMEL_SAM3_PORTB_DEV_NAME,
gpio_sam3_init, &gpio_sam3_b_runtime, &gpio_sam3_b_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&gpio_sam3_drv_api_funcs);
static void gpio_sam3_config_b(struct device *dev)
@@ -363,7 +363,7 @@ static struct gpio_sam3_runtime gpio_sam3_c_runtime;
DEVICE_AND_API_INIT(gpio_sam3_c, CONFIG_GPIO_ATMEL_SAM3_PORTC_DEV_NAME,
gpio_sam3_init, &gpio_sam3_c_runtime, &gpio_sam3_c_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&gpio_sam3_drv_api_funcs);
static void gpio_sam3_config_c(struct device *dev)
@@ -391,7 +391,7 @@ static struct gpio_sam3_runtime gpio_sam3_d_runtime;
DEVICE_AND_API_INIT(gpio_sam3_d, CONFIG_GPIO_ATMEL_SAM3_PORTD_DEV_NAME,
gpio_sam3_init, &gpio_sam3_d_runtime, &gpio_sam3_d_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&gpio_sam3_drv_api_funcs);
static void gpio_sam3_config_d(struct device *dev)
diff --git a/drivers/gpio/gpio_dw.c b/drivers/gpio/gpio_dw.c
index 7ce0705a3..4b6428cc7 100644
--- a/drivers/gpio/gpio_dw.c
+++ b/drivers/gpio/gpio_dw.c
@@ -537,12 +537,12 @@ static struct gpio_dw_runtime gpio_0_runtime = {
DEVICE_DEFINE(gpio_dw_0, CONFIG_GPIO_DW_0_NAME, gpio_dw_initialize,
gpio_dw_device_ctrl, &gpio_0_runtime, &gpio_config_0,
- SECONDARY, CONFIG_GPIO_DW_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY,
&api_funcs);
#else
DEVICE_AND_API_INIT(gpio_dw_0, CONFIG_GPIO_DW_0_NAME, gpio_dw_initialize,
&gpio_0_runtime, &gpio_config_0,
- SECONDARY, CONFIG_GPIO_DW_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY,
&api_funcs);
#endif
@@ -605,12 +605,12 @@ static struct gpio_dw_runtime gpio_1_runtime = {
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
DEVICE_DEFINE(gpio_dw_1, CONFIG_GPIO_DW_1_NAME, gpio_dw_initialize,
gpio_dw_device_ctrl, &gpio_1_runtime, &gpio_dw_config_1,
- SECONDARY, CONFIG_GPIO_DW_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY,
&api_funcs);
#else
DEVICE_AND_API_INIT(gpio_dw_1, CONFIG_GPIO_DW_1_NAME, gpio_dw_initialize,
&gpio_1_runtime, &gpio_dw_config_1,
- SECONDARY, CONFIG_GPIO_DW_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY,
&api_funcs);
#endif
@@ -672,12 +672,12 @@ static struct gpio_dw_runtime gpio_2_runtime = {
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
DEVICE_DEFINE(gpio_dw_2, CONFIG_GPIO_DW_2_NAME, gpio_dw_initialize,
gpio_dw_device_ctrl, &gpio_2_runtime, &gpio_dw_config_2,
- SECONDARY, CONFIG_GPIO_DW_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY,
&api_funcs);
#else
DEVICE_AND_API_INIT(gpio_dw_2, CONFIG_GPIO_DW_2_NAME, gpio_dw_initialize,
&gpio_2_runtime, &gpio_dw_config_2,
- SECONDARY, CONFIG_GPIO_DW_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY,
&api_funcs);
#endif
@@ -739,12 +739,12 @@ static struct gpio_dw_runtime gpio_3_runtime = {
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
DEVICE_DEFINE(gpio_dw_3, CONFIG_GPIO_DW_3_NAME, gpio_dw_initialize,
gpio_dw_device_ctrl, &gpio_3_runtime, &gpio_dw_config_3,
- SECONDARY, CONFIG_GPIO_DW_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY,
&api_funcs);
#else
DEVICE_AND_API_INIT(gpio_dw_3, CONFIG_GPIO_DW_3_NAME, gpio_dw_initialize,
&gpio_3_runtime, &gpio_dw_config_3,
- SECONDARY, CONFIG_GPIO_DW_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_GPIO_DW_INIT_PRIORITY,
&api_funcs);
#endif
diff --git a/drivers/gpio/gpio_k64.c b/drivers/gpio/gpio_k64.c
index b702c9006..cc67607f1 100644
--- a/drivers/gpio/gpio_k64.c
+++ b/drivers/gpio/gpio_k64.c
@@ -274,7 +274,7 @@ static struct gpio_k64_data gpio_data_A;
DEVICE_AND_API_INIT(gpio_k64_A, CONFIG_GPIO_K64_A_DEV_NAME, gpio_k64_A_init,
&gpio_data_A, &gpio_k64_A_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&gpio_k64_drv_api_funcs);
static int gpio_k64_A_init(struct device *dev)
@@ -303,7 +303,7 @@ static struct gpio_k64_data gpio_data_B;
DEVICE_AND_API_INIT(gpio_k64_B, CONFIG_GPIO_K64_B_DEV_NAME, gpio_k64_B_init,
&gpio_data_B, &gpio_k64_B_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&gpio_k64_drv_api_funcs);
static int gpio_k64_B_init(struct device *dev)
@@ -332,7 +332,7 @@ static struct gpio_k64_data gpio_data_C;
DEVICE_AND_API_INIT(gpio_k64_C, CONFIG_GPIO_K64_C_DEV_NAME, gpio_k64_C_init,
&gpio_data_C, &gpio_k64_C_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&gpio_k64_drv_api_funcs);
static int gpio_k64_C_init(struct device *dev)
@@ -361,7 +361,7 @@ static struct gpio_k64_data gpio_data_D;
DEVICE_AND_API_INIT(gpio_k64_D, CONFIG_GPIO_K64_D_DEV_NAME, gpio_k64_D_init,
&gpio_data_D, &gpio_k64_D_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&gpio_k64_drv_api_funcs);
static int gpio_k64_D_init(struct device *dev)
@@ -390,7 +390,7 @@ static struct gpio_k64_data gpio_data_E;
DEVICE_AND_API_INIT(gpio_k64_E, CONFIG_GPIO_K64_E_DEV_NAME, gpio_k64_E_init,
&gpio_data_E, &gpio_k64_E_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&gpio_k64_drv_api_funcs);
static int gpio_k64_E_init(struct device *dev)
diff --git a/drivers/gpio/gpio_nrf5.c b/drivers/gpio/gpio_nrf5.c
index 9f6e4a8fe..45660a013 100644
--- a/drivers/gpio/gpio_nrf5.c
+++ b/drivers/gpio/gpio_nrf5.c
@@ -213,7 +213,7 @@ static struct gpio_nrf5_data gpio_data_P0;
DEVICE_AND_API_INIT(gpio_nrf5_P0, CONFIG_GPIO_NRF5_P0_DEV_NAME, gpio_nrf5_P0_init,
&gpio_data_P0, &gpio_nrf5_P0_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&gpio_nrf5_drv_api_funcs);
static int gpio_nrf5_P0_init(struct device *dev)
diff --git a/drivers/gpio/gpio_pcal9535a.c b/drivers/gpio/gpio_pcal9535a.c
index e3fef2698..fa61527af 100644
--- a/drivers/gpio/gpio_pcal9535a.c
+++ b/drivers/gpio/gpio_pcal9535a.c
@@ -587,7 +587,7 @@ static struct gpio_pcal9535a_drv_data gpio_pcal9535a_0_drvdata = {
DEVICE_INIT(gpio_pcal9535a_0, CONFIG_GPIO_PCAL9535A_0_DEV_NAME,
gpio_pcal9535a_init,
&gpio_pcal9535a_0_drvdata, &gpio_pcal9535a_0_cfg,
- SECONDARY, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
#endif /* CONFIG_GPIO_PCAL9535A_0 */
@@ -614,7 +614,7 @@ static struct gpio_pcal9535a_drv_data gpio_pcal9535a_1_drvdata = {
DEVICE_INIT(gpio_pcal9535a_1, CONFIG_GPIO_PCAL9535A_1_DEV_NAME,
gpio_pcal9535a_init,
&gpio_pcal9535a_1_drvdata, &gpio_pcal9535a_1_cfg,
- SECONDARY, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
#endif /* CONFIG_GPIO_PCAL9535A_1 */
@@ -641,7 +641,7 @@ static struct gpio_pcal9535a_drv_data gpio_pcal9535a_2_drvdata = {
DEVICE_INIT(gpio_pcal9535a_2, CONFIG_GPIO_PCAL9535A_2_DEV_NAME,
gpio_pcal9535a_init,
&gpio_pcal9535a_2_drvdata, &gpio_pcal9535a_2_cfg,
- SECONDARY, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
#endif /* CONFIG_GPIO_PCAL9535A_2 */
@@ -668,6 +668,6 @@ static struct gpio_pcal9535a_drv_data gpio_pcal9535a_3_drvdata = {
DEVICE_INIT(gpio_pcal9535a_3, CONFIG_GPIO_PCAL9535A_3_DEV_NAME,
gpio_pcal9535a_init,
&gpio_pcal9535a_3_drvdata, &gpio_pcal9535a_3_cfg,
- SECONDARY, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
#endif /* CONFIG_GPIO_PCAL9535A_3 */
diff --git a/drivers/gpio/gpio_qmsi.c b/drivers/gpio/gpio_qmsi.c
index 30c6fbcb5..e2e671809 100644
--- a/drivers/gpio/gpio_qmsi.c
+++ b/drivers/gpio/gpio_qmsi.c
@@ -163,7 +163,7 @@ static int gpio_qmsi_device_ctrl(struct device *port, uint32_t ctrl_command,
DEVICE_DEFINE(gpio_0, CONFIG_GPIO_QMSI_0_NAME, &gpio_qmsi_init,
gpio_qmsi_device_ctrl, &gpio_0_runtime, &gpio_0_config,
- SECONDARY, CONFIG_GPIO_QMSI_INIT_PRIORITY, NULL);
+ POST_KERNEL, CONFIG_GPIO_QMSI_INIT_PRIORITY, NULL);
#endif /* CONFIG_GPIO_QMSI_0 */
@@ -202,7 +202,7 @@ static int gpio_aon_device_ctrl(struct device *port, uint32_t ctrl_command,
DEVICE_DEFINE(gpio_aon, CONFIG_GPIO_QMSI_1_NAME, &gpio_qmsi_init,
gpio_aon_device_ctrl, &gpio_aon_runtime, &gpio_aon_config,
- SECONDARY, CONFIG_GPIO_QMSI_INIT_PRIORITY, NULL);
+ POST_KERNEL, CONFIG_GPIO_QMSI_INIT_PRIORITY, NULL);
#endif /* CONFIG_GPIO_QMSI_1 */
diff --git a/drivers/gpio/gpio_qmsi_ss.c b/drivers/gpio/gpio_qmsi_ss.c
index 4e7d1a645..26d5c0389 100644
--- a/drivers/gpio/gpio_qmsi_ss.c
+++ b/drivers/gpio/gpio_qmsi_ss.c
@@ -86,7 +86,7 @@ static struct ss_gpio_qmsi_runtime ss_gpio_0_runtime;
DEVICE_INIT(ss_gpio_0, CONFIG_GPIO_QMSI_SS_0_NAME, &ss_gpio_qmsi_init,
&ss_gpio_0_runtime, &ss_gpio_0_config,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
#endif /* CONFIG_GPIO_QMSI_SS_0 */
@@ -100,7 +100,7 @@ static struct ss_gpio_qmsi_runtime gpio_1_runtime;
DEVICE_INIT(ss_gpio_1, CONFIG_GPIO_QMSI_SS_1_NAME, &ss_gpio_qmsi_init,
&gpio_1_runtime, &ss_gpio_1_config,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
#endif /* CONFIG_GPIO_QMSI_SS_1 */
diff --git a/drivers/gpio/gpio_sch.c b/drivers/gpio/gpio_sch.c
index ca1ead465..a5164fa0b 100644
--- a/drivers/gpio/gpio_sch.c
+++ b/drivers/gpio/gpio_sch.c
@@ -338,7 +338,7 @@ static struct gpio_sch_data gpio_data_0;
DEVICE_INIT(gpio_0, CONFIG_GPIO_SCH_0_DEV_NAME, gpio_sch_init,
&gpio_data_0, &gpio_sch_0_config,
- SECONDARY, CONFIG_GPIO_SCH_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_GPIO_SCH_INIT_PRIORITY);
#endif /* CONFIG_GPIO_SCH_0 */
#if CONFIG_GPIO_SCH_1
@@ -352,6 +352,6 @@ static struct gpio_sch_data gpio_data_1;
DEVICE_INIT(gpio_1, CONFIG_GPIO_SCH_1_DEV_NAME, gpio_sch_init,
&gpio_data_1, &gpio_sch_1_config,
- SECONDARY, CONFIG_GPIO_SCH_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_GPIO_SCH_INIT_PRIORITY);
#endif /* CONFIG_GPIO_SCH_1 */
diff --git a/drivers/gpio/gpio_stm32.c b/drivers/gpio/gpio_stm32.c
index e9e930186..1437c2f30 100644
--- a/drivers/gpio/gpio_stm32.c
+++ b/drivers/gpio/gpio_stm32.c
@@ -222,7 +222,7 @@ DEVICE_AND_API_INIT(gpio_stm32_## __suffix, \
gpio_stm32_init, \
&gpio_stm32_data_## __suffix, \
&gpio_stm32_cfg_## __suffix, \
- SECONDARY, \
+ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
&gpio_stm32_driver);
@@ -240,7 +240,7 @@ DEVICE_AND_API_INIT(gpio_stm32_## __suffix, \
gpio_stm32_init, \
&gpio_stm32_data_## __suffix, \
&gpio_stm32_cfg_## __suffix, \
- SECONDARY, \
+ POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
&gpio_stm32_driver);
#endif
diff --git a/drivers/grove/light_sensor.c b/drivers/grove/light_sensor.c
index d31e5295a..95bc64945 100644
--- a/drivers/grove/light_sensor.c
+++ b/drivers/grove/light_sensor.c
@@ -97,4 +97,4 @@ static int gls_init(struct device *dev)
static struct gls_data gls_data;
DEVICE_INIT(gls_dev, CONFIG_GROVE_LIGHT_SENSOR_NAME, &gls_init, &gls_data,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/grove/temperature_sensor.c b/drivers/grove/temperature_sensor.c
index 4d0fd7fff..4b7b481e6 100644
--- a/drivers/grove/temperature_sensor.c
+++ b/drivers/grove/temperature_sensor.c
@@ -104,4 +104,4 @@ static int gts_init(struct device *dev)
static struct gts_data gts_data;
DEVICE_INIT(gts_dev, CONFIG_GROVE_TEMPERATURE_SENSOR_NAME, &gts_init, &gts_data,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/i2c/i2c_atmel_sam3.c b/drivers/i2c/i2c_atmel_sam3.c
index 3403b274a..356932513 100644
--- a/drivers/i2c/i2c_atmel_sam3.c
+++ b/drivers/i2c/i2c_atmel_sam3.c
@@ -623,7 +623,7 @@ static struct i2c_sam3_dev_data dev_data_0 = {
DEVICE_AND_API_INIT(i2c_sam3_0, CONFIG_I2C_0_NAME, &i2c_sam3_init,
&dev_data_0, &dev_config_0,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&api_funcs);
static void config_func_0(struct device *dev)
@@ -653,7 +653,7 @@ static struct i2c_sam3_dev_data dev_data_1 = {
DEVICE_AND_API_INIT(i2c_sam3_1, CONFIG_I2C_1_NAME, &i2c_sam3_init,
&dev_data_1, &dev_config_1,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&api_funcs);
static void config_func_1(struct device *dev)
diff --git a/drivers/i2c/i2c_dw.c b/drivers/i2c/i2c_dw.c
index 41f167753..70497a702 100644
--- a/drivers/i2c/i2c_dw.c
+++ b/drivers/i2c/i2c_dw.c
@@ -741,7 +741,7 @@ static struct i2c_dw_dev_config i2c_0_runtime = {
DEVICE_AND_API_INIT(i2c_0, CONFIG_I2C_0_NAME, &i2c_dw_initialize,
&i2c_0_runtime, &i2c_config_dw_0,
- SECONDARY, CONFIG_I2C_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_I2C_INIT_PRIORITY,
&funcs);
static void i2c_config_0(struct device *port)
@@ -793,7 +793,7 @@ static struct i2c_dw_dev_config i2c_1_runtime = {
DEVICE_AND_API_INIT(i2c_1, CONFIG_I2C_1_NAME, &i2c_dw_initialize,
&i2c_1_runtime, &i2c_config_dw_1,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&funcs);
static void i2c_config_1(struct device *port)
diff --git a/drivers/i2c/i2c_ksdk.c b/drivers/i2c/i2c_ksdk.c
index 8cd3daa40..e77de5a8e 100644
--- a/drivers/i2c/i2c_ksdk.c
+++ b/drivers/i2c/i2c_ksdk.c
@@ -207,7 +207,7 @@ static struct i2c_ksdk_data i2c_ksdk_data_0;
DEVICE_AND_API_INIT(i2c_ksdk_0, CONFIG_I2C_0_NAME, &i2c_ksdk_init,
&i2c_ksdk_data_0, &i2c_ksdk_config_0,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&i2c_ksdk_driver_api);
static void i2c_ksdk_config_func_0(struct device *dev)
@@ -233,7 +233,7 @@ static struct i2c_ksdk_data i2c_ksdk_data_1;
DEVICE_AND_API_INIT(i2c_ksdk_1, CONFIG_I2C_1_NAME, &i2c_ksdk_init,
&i2c_ksdk_data_1, &i2c_ksdk_config_1,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&i2c_ksdk_driver_api);
static void i2c_ksdk_config_func_1(struct device *dev)
diff --git a/drivers/i2c/i2c_qmsi.c b/drivers/i2c/i2c_qmsi.c
index 14ab088d5..133b5eff3 100644
--- a/drivers/i2c/i2c_qmsi.c
+++ b/drivers/i2c/i2c_qmsi.c
@@ -133,7 +133,7 @@ static const struct i2c_qmsi_config_info config_info_0 = {
};
DEVICE_DEFINE(i2c_0, CONFIG_I2C_0_NAME, &i2c_qmsi_init,
- i2c_device_ctrl, &driver_data_0, &config_info_0, SECONDARY,
+ i2c_device_ctrl, &driver_data_0, &config_info_0, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, NULL);
#endif /* CONFIG_I2C_0 */
@@ -149,7 +149,7 @@ static const struct i2c_qmsi_config_info config_info_1 = {
};
DEVICE_DEFINE(i2c_1, CONFIG_I2C_1_NAME, &i2c_qmsi_init,
- i2c_device_ctrl, &driver_data_1, &config_info_1, SECONDARY,
+ i2c_device_ctrl, &driver_data_1, &config_info_1, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, NULL);
#endif /* CONFIG_I2C_1 */
diff --git a/drivers/i2c/i2c_qmsi_ss.c b/drivers/i2c/i2c_qmsi_ss.c
index 8ef5d7a2f..b2d1111e6 100644
--- a/drivers/i2c/i2c_qmsi_ss.c
+++ b/drivers/i2c/i2c_qmsi_ss.c
@@ -69,7 +69,7 @@ static const struct i2c_qmsi_ss_config_info config_info_0 = {
};
DEVICE_INIT(i2c_ss_0, CONFIG_I2C_0_NAME, i2c_qmsi_ss_init, &driver_data_0,
- &config_info_0, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+ &config_info_0, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
static void i2c_qmsi_ss_config_irq_0(void)
{
@@ -125,7 +125,7 @@ static const struct i2c_qmsi_ss_config_info config_info_1 = {
};
DEVICE_INIT(i2c_ss_1, CONFIG_I2C_1_NAME, i2c_qmsi_ss_init, &driver_data_1,
- &config_info_1, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+ &config_info_1, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
static void i2c_qmsi_ss_config_irq_1(void)
{
diff --git a/drivers/interrupt_controller/exti_stm32.c b/drivers/interrupt_controller/exti_stm32.c
index a806e4194..a75c7a3e6 100644
--- a/drivers/interrupt_controller/exti_stm32.c
+++ b/drivers/interrupt_controller/exti_stm32.c
@@ -287,7 +287,7 @@ static int stm32_exti_init(struct device *dev)
static struct stm32_exti_data exti_data;
DEVICE_INIT(exti_stm32, STM32_EXTI_NAME, stm32_exti_init,
&exti_data, NULL,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
/**
* @brief set & unset for the interrupt callbacks
diff --git a/drivers/interrupt_controller/i8259.c b/drivers/interrupt_controller/i8259.c
index f0860044d..175d6ed9e 100644
--- a/drivers/interrupt_controller/i8259.c
+++ b/drivers/interrupt_controller/i8259.c
@@ -62,4 +62,4 @@ int _i8259_init(struct device *unused)
return 0;
}
-SYS_INIT(_i8259_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(_i8259_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/drivers/interrupt_controller/ioapic_intr.c b/drivers/interrupt_controller/ioapic_intr.c
index 438c3a0d7..d7d11d2a5 100644
--- a/drivers/interrupt_controller/ioapic_intr.c
+++ b/drivers/interrupt_controller/ioapic_intr.c
@@ -443,8 +443,8 @@ static void _IoApicRedUpdateLo(unsigned int irq,
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
-SYS_DEVICE_DEFINE("ioapic", _ioapic_init, ioapic_device_ctrl, PRIMARY,
+SYS_DEVICE_DEFINE("ioapic", _ioapic_init, ioapic_device_ctrl, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#else
-SYS_INIT(_ioapic_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(_ioapic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif
diff --git a/drivers/interrupt_controller/loapic_intr.c b/drivers/interrupt_controller/loapic_intr.c
index b2f4b7894..2d552a06a 100644
--- a/drivers/interrupt_controller/loapic_intr.c
+++ b/drivers/interrupt_controller/loapic_intr.c
@@ -506,10 +506,10 @@ static int loapic_device_ctrl(struct device *port, uint32_t ctrl_command,
return 0;
}
-SYS_DEVICE_DEFINE("loapic", _loapic_init, loapic_device_ctrl, PRIMARY,
+SYS_DEVICE_DEFINE("loapic", _loapic_init, loapic_device_ctrl, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#else
-SYS_INIT(_loapic_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(_loapic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
diff --git a/drivers/interrupt_controller/mvic.c b/drivers/interrupt_controller/mvic.c
index 86e13c54a..e0628b6d0 100644
--- a/drivers/interrupt_controller/mvic.c
+++ b/drivers/interrupt_controller/mvic.c
@@ -161,7 +161,7 @@ static int _mvic_init(struct device *unused)
return 0;
}
-SYS_INIT(_mvic_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(_mvic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
void _arch_irq_enable(unsigned int irq)
diff --git a/drivers/ipm/ipm_quark_se.h b/drivers/ipm/ipm_quark_se.h
index adfeb27c3..f73433a3f 100644
--- a/drivers/ipm/ipm_quark_se.h
+++ b/drivers/ipm/ipm_quark_se.h
@@ -136,7 +136,7 @@ int quark_se_ipm_controller_initialize(struct device *d);
DEVICE_AND_API_INIT(name, _STRINGIFY(name), quark_se_ipm_initialize, \
&quark_se_ipm_runtime_##name, \
&quark_se_ipm_config_##name, \
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
&ipm_quark_se_api_funcs)
#ifdef __cplusplus
diff --git a/drivers/pinmux/dev/pinmux_dev_atmel_sam3x.c b/drivers/pinmux/dev/pinmux_dev_atmel_sam3x.c
index acbf18b03..6ef48087d 100644
--- a/drivers/pinmux/dev/pinmux_dev_atmel_sam3x.c
+++ b/drivers/pinmux/dev/pinmux_dev_atmel_sam3x.c
@@ -130,5 +130,5 @@ static int pinmux_dev_init(struct device *port)
DEVICE_AND_API_INIT(pmux_dev, CONFIG_PINMUX_DEV_NAME,
&pinmux_dev_init, NULL, NULL,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&api_funcs);
diff --git a/drivers/pinmux/dev/pinmux_dev_k64.c b/drivers/pinmux/dev/pinmux_dev_k64.c
index db85c219a..ae64da34f 100644
--- a/drivers/pinmux/dev/pinmux_dev_k64.c
+++ b/drivers/pinmux/dev/pinmux_dev_k64.c
@@ -53,5 +53,5 @@ int pinmux_fsl_k64_initialize(struct device *port)
/* must be initialized after GPIO */
DEVICE_AND_API_INIT(pmux, CONFIG_PINMUX_DEV_NAME, &pinmux_fsl_k64_initialize,
NULL, NULL,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&api_funcs);
diff --git a/drivers/pinmux/dev/pinmux_dev_qmsi.c b/drivers/pinmux/dev/pinmux_dev_qmsi.c
index 7926c05f7..092215e96 100644
--- a/drivers/pinmux/dev/pinmux_dev_qmsi.c
+++ b/drivers/pinmux/dev/pinmux_dev_qmsi.c
@@ -95,5 +95,5 @@ static int pinmux_dev_initialize(struct device *port)
DEVICE_AND_API_INIT(pmux_dev, CONFIG_PINMUX_DEV_NAME,
&pinmux_dev_initialize, NULL, NULL,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&api_funcs);
diff --git a/drivers/pinmux/dev/pinmux_dev_stm32.c b/drivers/pinmux/dev/pinmux_dev_stm32.c
index 80e32dfc7..c7b3fab4b 100644
--- a/drivers/pinmux/dev/pinmux_dev_stm32.c
+++ b/drivers/pinmux/dev/pinmux_dev_stm32.c
@@ -84,6 +84,6 @@ static int pinmux_stm32_init(struct device *port)
DEVICE_AND_API_INIT(pmux_dev, CONFIG_PINMUX_DEV_NAME, &pinmux_stm32_init,
NULL, NULL,
- PRIMARY,
+ PRE_KERNEL_1,
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY,
&pinmux_stm32_api);
diff --git a/drivers/pinmux/k64/pinmux_board_frdm_k64f.c b/drivers/pinmux/k64/pinmux_board_frdm_k64f.c
index 870b5383a..e8d33a36c 100644
--- a/drivers/pinmux/k64/pinmux_board_frdm_k64f.c
+++ b/drivers/pinmux/k64/pinmux_board_frdm_k64f.c
@@ -114,4 +114,4 @@ static int fsl_frdm_k64f_pin_init(struct device *arg)
return 0;
}
-SYS_INIT(fsl_frdm_k64f_pin_init, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+SYS_INIT(fsl_frdm_k64f_pin_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
diff --git a/drivers/pinmux/k64/pinmux_board_hexiwear.c b/drivers/pinmux/k64/pinmux_board_hexiwear.c
index 663258bec..2f37e603b 100644
--- a/drivers/pinmux/k64/pinmux_board_hexiwear.c
+++ b/drivers/pinmux/k64/pinmux_board_hexiwear.c
@@ -66,4 +66,4 @@ static int hexiwear_pin_init(struct device *arg)
return 0;
}
-SYS_INIT(hexiwear_pin_init, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+SYS_INIT(hexiwear_pin_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
diff --git a/drivers/pinmux/stm32/pinmux_board_carbon.c b/drivers/pinmux/stm32/pinmux_board_carbon.c
index fe4a62e14..5b901ceb5 100644
--- a/drivers/pinmux/stm32/pinmux_board_carbon.c
+++ b/drivers/pinmux/stm32/pinmux_board_carbon.c
@@ -44,5 +44,5 @@ static int pinmux_stm32_init(struct device *port)
return 0;
}
-SYS_INIT(pinmux_stm32_init, PRIMARY,
+SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1,
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
diff --git a/drivers/pinmux/stm32/pinmux_board_nucleo_f103rb.c b/drivers/pinmux/stm32/pinmux_board_nucleo_f103rb.c
index 5f9a612d8..79091d8ad 100644
--- a/drivers/pinmux/stm32/pinmux_board_nucleo_f103rb.c
+++ b/drivers/pinmux/stm32/pinmux_board_nucleo_f103rb.c
@@ -48,4 +48,4 @@ static int pinmux_stm32_init(struct device *port)
return 0;
}
-SYS_INIT(pinmux_stm32_init, PRIMARY, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
+SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
diff --git a/drivers/pinmux/stm32/pinmux_board_nucleo_f401re.c b/drivers/pinmux/stm32/pinmux_board_nucleo_f401re.c
index 673f0cadd..084101a96 100644
--- a/drivers/pinmux/stm32/pinmux_board_nucleo_f401re.c
+++ b/drivers/pinmux/stm32/pinmux_board_nucleo_f401re.c
@@ -44,5 +44,5 @@ static int pinmux_stm32_init(struct device *port)
return 0;
}
-SYS_INIT(pinmux_stm32_init, PRIMARY,
+SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1,
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
diff --git a/drivers/pinmux/stm32/pinmux_board_olimexino_stm32.c b/drivers/pinmux/stm32/pinmux_board_olimexino_stm32.c
index 5f9a612d8..79091d8ad 100644
--- a/drivers/pinmux/stm32/pinmux_board_olimexino_stm32.c
+++ b/drivers/pinmux/stm32/pinmux_board_olimexino_stm32.c
@@ -48,4 +48,4 @@ static int pinmux_stm32_init(struct device *port)
return 0;
}
-SYS_INIT(pinmux_stm32_init, PRIMARY, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
+SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
diff --git a/drivers/pinmux/stm32/pinmux_board_stm32_mini_a15.c b/drivers/pinmux/stm32/pinmux_board_stm32_mini_a15.c
index 2bc7a64f0..58fc1ed21 100644
--- a/drivers/pinmux/stm32/pinmux_board_stm32_mini_a15.c
+++ b/drivers/pinmux/stm32/pinmux_board_stm32_mini_a15.c
@@ -48,4 +48,4 @@ static int pinmux_stm32_init(struct device *port)
return 0;
}
-SYS_INIT(pinmux_stm32_init, PRIMARY, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
+SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1, CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
diff --git a/drivers/pwm/pwm_dw.c b/drivers/pwm/pwm_dw.c
index 616a29f79..e67d2d9fa 100644
--- a/drivers/pwm/pwm_dw.c
+++ b/drivers/pwm/pwm_dw.c
@@ -232,7 +232,7 @@ static struct pwm_dw_config pwm_dw_cfg = {
DEVICE_AND_API_INIT(pwm_dw_0, CONFIG_PWM_DW_0_DRV_NAME, pwm_dw_init,
NULL, &pwm_dw_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&pwm_dw_drv_api_funcs);
#endif /* CONFIG_PWM_DW */
diff --git a/drivers/pwm/pwm_k64_ftm.c b/drivers/pwm/pwm_k64_ftm.c
index 2c2acec1a..54f288649 100644
--- a/drivers/pwm/pwm_k64_ftm.c
+++ b/drivers/pwm/pwm_k64_ftm.c
@@ -815,7 +815,7 @@ static struct pwm_ftm_drv_data pwm_ftm_0_drvdata;
DEVICE_DEFINE(pwm_ftm_0, CONFIG_PWM_K64_FTM_0_DEV_NAME, pwm_ftm_init,
pwm_ftm_device_ctrl, &pwm_ftm_0_drvdata, &pwm_ftm_0_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&pwm_ftm_drv_api_funcs);
#endif /* CONFIG_PWM_K64_FTM_0 */
@@ -861,7 +861,7 @@ static struct pwm_ftm_drv_data pwm_ftm_1_drvdata;
DEVICE_DEFINE(pwm_ftm_1, CONFIG_PWM_K64_FTM_1_DEV_NAME, pwm_ftm_init,
pwm_ftm_device_ctrl, &pwm_ftm_1_drvdata, &pwm_ftm_1_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&pwm_ftm_drv_api_funcs);
#endif /* CONFIG_PWM_K64_FTM_1 */
@@ -908,7 +908,7 @@ static struct pwm_ftm_drv_data pwm_ftm_2_drvdata;
DEVICE_DEFINE(pwm_ftm_2, CONFIG_PWM_K64_FTM_2_DEV_NAME, pwm_ftm_init,
pwm_ftm_device_ctrl, &pwm_ftm_2_drvdata, &pwm_ftm_2_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&pwm_ftm_drv_api_funcs);
#endif /* CONFIG_PWM_K64_FTM_2 */
@@ -955,7 +955,7 @@ static struct pwm_ftm_drv_data pwm_ftm_3_drvdata;
DEVICE_DEFINE(pwm_ftm_3, CONFIG_PWM_K64_FTM_3_DEV_NAME, pwm_ftm_init,
pwm_ftm_device_ctrl, &pwm_ftm_3_drvdata, &pwm_ftm_3_cfg,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&pwm_ftm_drv_api_funcs);
#endif /* CONFIG_PWM_K64_FTM_3 */
diff --git a/drivers/pwm/pwm_pca9685.c b/drivers/pwm/pwm_pca9685.c
index eaf6844e8..e80bea02c 100644
--- a/drivers/pwm/pwm_pca9685.c
+++ b/drivers/pwm/pwm_pca9685.c
@@ -216,6 +216,6 @@ static struct pwm_pca9685_drv_data pwm_pca9685_0_drvdata;
DEVICE_INIT(pwm_pca9685_0, CONFIG_PWM_PCA9685_0_DEV_NAME,
pwm_pca9685_init,
&pwm_pca9685_0_drvdata, &pwm_pca9685_0_cfg,
- SECONDARY, CONFIG_PWM_PCA9685_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_PWM_PCA9685_INIT_PRIORITY);
#endif /* CONFIG_PWM_PCA9685_0 */
diff --git a/drivers/pwm/pwm_qmsi.c b/drivers/pwm/pwm_qmsi.c
index 99875a07f..db3f69665 100644
--- a/drivers/pwm/pwm_qmsi.c
+++ b/drivers/pwm/pwm_qmsi.c
@@ -502,5 +502,5 @@ static int pwm_qmsi_device_ctrl(struct device *dev, uint32_t ctrl_command,
DEVICE_DEFINE(pwm_qmsi_0, CONFIG_PWM_QMSI_DEV_NAME, pwm_qmsi_init,
pwm_qmsi_device_ctrl, &pwm_context, NULL,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&pwm_qmsi_drv_api_funcs);
diff --git a/drivers/rtc/rtc_qmsi.c b/drivers/rtc/rtc_qmsi.c
index 8e7a3ae23..1105bb1bb 100644
--- a/drivers/rtc/rtc_qmsi.c
+++ b/drivers/rtc/rtc_qmsi.c
@@ -248,5 +248,5 @@ static int rtc_qmsi_device_ctrl(struct device *dev, uint32_t ctrl_command,
#endif
DEVICE_DEFINE(rtc, CONFIG_RTC_0_NAME, &rtc_qmsi_init, rtc_qmsi_device_ctrl,
- RTC_CONTEXT, NULL, SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ RTC_CONTEXT, NULL, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&api);
diff --git a/drivers/sensor/ak8975/ak8975.c b/drivers/sensor/ak8975/ak8975.c
index fbe1247da..2bcaecd48 100644
--- a/drivers/sensor/ak8975/ak8975.c
+++ b/drivers/sensor/ak8975/ak8975.c
@@ -170,4 +170,4 @@ int ak8975_init(struct device *dev)
struct ak8975_data ak8975_data;
DEVICE_INIT(ak8975, CONFIG_AK8975_NAME, ak8975_init, &ak8975_data,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/bma280/bma280.c b/drivers/sensor/bma280/bma280.c
index 954a69b0b..921dfd12e 100644
--- a/drivers/sensor/bma280/bma280.c
+++ b/drivers/sensor/bma280/bma280.c
@@ -172,4 +172,4 @@ int bma280_init(struct device *dev)
struct bma280_data bma280_driver;
DEVICE_INIT(bma280, CONFIG_BMA280_NAME, bma280_init, &bma280_driver,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/bme280/bme280.c b/drivers/sensor/bme280/bme280.c
index 7f7064b6e..aa9a29a83 100644
--- a/drivers/sensor/bme280/bme280.c
+++ b/drivers/sensor/bme280/bme280.c
@@ -266,4 +266,4 @@ int bme280_init(struct device *dev)
static struct bme280_data bme280_data;
DEVICE_INIT(bme280, CONFIG_BME280_DEV_NAME, bme280_init, &bme280_data,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/bmg160/bmg160.c b/drivers/sensor/bmg160/bmg160.c
index 8d89ce829..ef44abe3a 100644
--- a/drivers/sensor/bmg160/bmg160.c
+++ b/drivers/sensor/bmg160/bmg160.c
@@ -360,4 +360,4 @@ const struct bmg160_device_config bmg160_config = {
};
DEVICE_INIT(bmg160, CONFIG_BMG160_DRV_NAME, bmg160_init, &bmg160_data,
- &bmg160_config, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ &bmg160_config, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/dht/dht.c b/drivers/sensor/dht/dht.c
index 1b1a93447..a99d5560a 100644
--- a/drivers/sensor/dht/dht.c
+++ b/drivers/sensor/dht/dht.c
@@ -245,4 +245,4 @@ static int dht_init(struct device *dev)
struct dht_data dht_data;
DEVICE_INIT(dht_dev, CONFIG_DHT_NAME, &dht_init, &dht_data,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/fxos8700/fxos8700.c b/drivers/sensor/fxos8700/fxos8700.c
index 99bea741b..0cb657c33 100644
--- a/drivers/sensor/fxos8700/fxos8700.c
+++ b/drivers/sensor/fxos8700/fxos8700.c
@@ -340,5 +340,5 @@ static struct fxos8700_data fxos8700_data;
DEVICE_AND_API_INIT(fxos8700, CONFIG_FXOS8700_NAME, fxos8700_init,
&fxos8700_data, &fxos8700_config,
- SECONDARY, CONFIG_SENSOR_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY,
&fxos8700_driver_api);
diff --git a/drivers/sensor/hdc1008/hdc1008.c b/drivers/sensor/hdc1008/hdc1008.c
index 4d1049384..ffabcd0e2 100644
--- a/drivers/sensor/hdc1008/hdc1008.c
+++ b/drivers/sensor/hdc1008/hdc1008.c
@@ -161,4 +161,4 @@ static int hdc1008_init(struct device *dev)
static struct hdc1008_data hdc1008_data;
DEVICE_INIT(hdc1008, CONFIG_HDC1008_NAME, hdc1008_init, &hdc1008_data,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/hmc5883l/hmc5883l.c b/drivers/sensor/hmc5883l/hmc5883l.c
index 7336c3eae..7968d5743 100644
--- a/drivers/sensor/hmc5883l/hmc5883l.c
+++ b/drivers/sensor/hmc5883l/hmc5883l.c
@@ -165,4 +165,4 @@ int hmc5883l_init(struct device *dev)
struct hmc5883l_data hmc5883l_driver;
DEVICE_INIT(hmc5883l, CONFIG_HMC5883L_NAME, hmc5883l_init, &hmc5883l_driver,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/hts221/hts221.c b/drivers/sensor/hts221/hts221.c
index 9e10917d0..dc1d86c85 100644
--- a/drivers/sensor/hts221/hts221.c
+++ b/drivers/sensor/hts221/hts221.c
@@ -176,4 +176,4 @@ int hts221_init(struct device *dev)
struct hts221_data hts221_driver;
DEVICE_INIT(hts221, CONFIG_HTS221_NAME, hts221_init, &hts221_driver,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/isl29035/isl29035.c b/drivers/sensor/isl29035/isl29035.c
index f6228a631..573313532 100644
--- a/drivers/sensor/isl29035/isl29035.c
+++ b/drivers/sensor/isl29035/isl29035.c
@@ -152,4 +152,4 @@ static int isl29035_init(struct device *dev)
struct isl29035_driver_data isl29035_data;
DEVICE_INIT(isl29035_dev, CONFIG_ISL29035_NAME, &isl29035_init,
- &isl29035_data, NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ &isl29035_data, NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/lis3dh/lis3dh.c b/drivers/sensor/lis3dh/lis3dh.c
index d2de4b13d..de6fe1e98 100644
--- a/drivers/sensor/lis3dh/lis3dh.c
+++ b/drivers/sensor/lis3dh/lis3dh.c
@@ -131,4 +131,4 @@ int lis3dh_init(struct device *dev)
struct lis3dh_data lis3dh_driver;
DEVICE_INIT(lis3dh, CONFIG_LIS3DH_NAME, lis3dh_init, &lis3dh_driver,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/lis3mdl/lis3mdl.c b/drivers/sensor/lis3mdl/lis3mdl.c
index def5e542f..c3c628bd4 100644
--- a/drivers/sensor/lis3mdl/lis3mdl.c
+++ b/drivers/sensor/lis3mdl/lis3mdl.c
@@ -173,4 +173,4 @@ int lis3mdl_init(struct device *dev)
struct lis3mdl_data lis3mdl_driver;
DEVICE_INIT(lis3mdl, CONFIG_LIS3MDL_NAME, lis3mdl_init, &lis3mdl_driver,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c b/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c
index fe691496f..ec2b5762b 100644
--- a/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c
+++ b/drivers/sensor/lsm9ds0_gyro/lsm9ds0_gyro.c
@@ -369,5 +369,5 @@ static const struct lsm9ds0_gyro_config lsm9ds0_gyro_config = {
struct lsm9ds0_gyro_data lsm9ds0_gyro_data;
DEVICE_INIT(lsm9ds0_gyro, CONFIG_LSM9DS0_GYRO_DEV_NAME, lsm9ds0_gyro_init,
- &lsm9ds0_gyro_data, &lsm9ds0_gyro_config, SECONDARY,
+ &lsm9ds0_gyro_data, &lsm9ds0_gyro_config, POST_KERNEL,
CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/max44009/max44009.c b/drivers/sensor/max44009/max44009.c
index 080f2086a..c4e524afb 100644
--- a/drivers/sensor/max44009/max44009.c
+++ b/drivers/sensor/max44009/max44009.c
@@ -196,5 +196,5 @@ int max44009_init(struct device *dev)
static struct max44009_data max44009_drv_data;
DEVICE_INIT(max44009, CONFIG_MAX44009_DRV_NAME, max44009_init,
- &max44009_drv_data, NULL, SECONDARY,
+ &max44009_drv_data, NULL, POST_KERNEL,
CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/mcp9808/mcp9808.c b/drivers/sensor/mcp9808/mcp9808.c
index 27bc9ede1..dd17fc4a7 100644
--- a/drivers/sensor/mcp9808/mcp9808.c
+++ b/drivers/sensor/mcp9808/mcp9808.c
@@ -112,4 +112,4 @@ int mcp9808_init(struct device *dev)
struct mcp9808_data mcp9808_data;
DEVICE_INIT(mcp9808, CONFIG_MCP9808_DEV_NAME, mcp9808_init, &mcp9808_data,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/mpu6050/mpu6050.c b/drivers/sensor/mpu6050/mpu6050.c
index 0a1e29bf8..1c2dcbd9e 100644
--- a/drivers/sensor/mpu6050/mpu6050.c
+++ b/drivers/sensor/mpu6050/mpu6050.c
@@ -236,4 +236,4 @@ int mpu6050_init(struct device *dev)
struct mpu6050_data mpu6050_driver;
DEVICE_INIT(mpu6050, CONFIG_MPU6050_NAME, mpu6050_init, &mpu6050_driver,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/sht3xd/sht3xd.c b/drivers/sensor/sht3xd/sht3xd.c
index c7dfdd1c8..2b05cf2bc 100644
--- a/drivers/sensor/sht3xd/sht3xd.c
+++ b/drivers/sensor/sht3xd/sht3xd.c
@@ -202,4 +202,4 @@ static int sht3xd_init(struct device *dev)
struct sht3xd_data sht3xd_driver;
DEVICE_INIT(sht3xd, CONFIG_SHT3XD_NAME, sht3xd_init, &sht3xd_driver,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/sx9500/sx9500.c b/drivers/sensor/sx9500/sx9500.c
index ec5af8c6b..76e168eb4 100644
--- a/drivers/sensor/sx9500/sx9500.c
+++ b/drivers/sensor/sx9500/sx9500.c
@@ -144,4 +144,4 @@ int sx9500_init(struct device *dev)
struct sx9500_data sx9500_data;
DEVICE_INIT(sx9500, CONFIG_SX9500_DEV_NAME, sx9500_init, &sx9500_data,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/th02/th02.c b/drivers/sensor/th02/th02.c
index fdcfa53cf..3955ae06f 100644
--- a/drivers/sensor/th02/th02.c
+++ b/drivers/sensor/th02/th02.c
@@ -148,4 +148,4 @@ static int th02_init(struct device *dev)
static struct th02_data th02_driver;
DEVICE_INIT(th02, CONFIG_TH02_NAME, th02_init, &th02_driver,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/tmp007/tmp007.c b/drivers/sensor/tmp007/tmp007.c
index 5080ce1fa..412f5f637 100644
--- a/drivers/sensor/tmp007/tmp007.c
+++ b/drivers/sensor/tmp007/tmp007.c
@@ -147,4 +147,4 @@ int tmp007_init(struct device *dev)
struct tmp007_data tmp007_driver;
DEVICE_INIT(tmp007, CONFIG_TMP007_NAME, tmp007_init, &tmp007_driver,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/sensor/tmp112/tmp112.c b/drivers/sensor/tmp112/tmp112.c
index 1fab78839..aed8e0671 100644
--- a/drivers/sensor/tmp112/tmp112.c
+++ b/drivers/sensor/tmp112/tmp112.c
@@ -244,4 +244,4 @@ int tmp112_init(struct device *dev)
static struct tmp112_data tmp112_driver;
DEVICE_INIT(tmp112, CONFIG_TMP112_NAME, tmp112_init, &tmp112_driver,
- NULL, SECONDARY, CONFIG_SENSOR_INIT_PRIORITY);
+ NULL, POST_KERNEL, CONFIG_SENSOR_INIT_PRIORITY);
diff --git a/drivers/serial/uart_altera_jtag.c b/drivers/serial/uart_altera_jtag.c
index 3a07fb767..c16956d85 100644
--- a/drivers/serial/uart_altera_jtag.c
+++ b/drivers/serial/uart_altera_jtag.c
@@ -110,5 +110,5 @@ static const struct uart_device_config uart_altera_jtag_dev_cfg_0 = {
DEVICE_AND_API_INIT(uart_altera_jtag_0, "jtag_uart0",
uart_altera_jtag_init, NULL,
&uart_altera_jtag_dev_cfg_0,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_altera_jtag_driver_api);
diff --git a/drivers/serial/uart_atmel_sam3.c b/drivers/serial/uart_atmel_sam3.c
index 216f2e3db..4821dd3de 100644
--- a/drivers/serial/uart_atmel_sam3.c
+++ b/drivers/serial/uart_atmel_sam3.c
@@ -259,5 +259,5 @@ static struct uart_sam3_dev_data_t uart_sam3_dev_data_0 = {
DEVICE_AND_API_INIT(uart_sam3_0, CONFIG_UART_ATMEL_SAM3_NAME, &uart_sam3_init,
&uart_sam3_dev_data_0, &uart_sam3_dev_cfg_0,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_sam3_driver_api);
diff --git a/drivers/serial/uart_cc32xx.c b/drivers/serial/uart_cc32xx.c
index 9e95dd246..bcb14d52b 100644
--- a/drivers/serial/uart_cc32xx.c
+++ b/drivers/serial/uart_cc32xx.c
@@ -324,5 +324,5 @@ static const struct uart_driver_api uart_cc32xx_driver_api = {
DEVICE_AND_API_INIT(uart_cc32xx_0, CONFIG_UART_CONSOLE_ON_DEV_NAME,
uart_cc32xx_init, &uart_cc32xx_dev_data_0,
&uart_cc32xx_dev_cfg_0,
- SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
(void *)&uart_cc32xx_driver_api);
diff --git a/drivers/serial/uart_k20.c b/drivers/serial/uart_k20.c
index 710665bf1..15caf3f6f 100644
--- a/drivers/serial/uart_k20.c
+++ b/drivers/serial/uart_k20.c
@@ -429,7 +429,7 @@ static struct uart_k20_dev_data_t uart_k20_dev_data_0 = {
DEVICE_AND_API_INIT(uart_k20_0, CONFIG_UART_K20_PORT_0_NAME, &uart_k20_init,
&uart_k20_dev_data_0, &uart_k20_dev_cfg_0,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_k20_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@@ -466,7 +466,7 @@ static struct uart_k20_dev_data_t uart_k20_dev_data_1 = {
DEVICE_AND_API_INIT(uart_k20_1, CONFIG_UART_K20_PORT_1_NAME, &uart_k20_init,
&uart_k20_dev_data_1, &uart_k20_dev_cfg_1,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_k20_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@@ -503,7 +503,7 @@ static struct uart_k20_dev_data_t uart_k20_dev_data_2 = {
DEVICE_AND_API_INIT(uart_k20_2, CONFIG_UART_K20_PORT_2_NAME, &uart_k20_init,
&uart_k20_dev_data_2, &uart_k20_dev_cfg_2,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_k20_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@@ -540,7 +540,7 @@ static struct uart_k20_dev_data_t uart_k20_dev_data_3 = {
DEVICE_AND_API_INIT(uart_k20_3, CONFIG_UART_K20_PORT_3_NAME, &uart_k20_init,
&uart_k20_dev_data_3, &uart_k20_dev_cfg_3,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_k20_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@@ -577,7 +577,7 @@ static struct uart_k20_dev_data_t uart_k20_dev_data_4 = {
DEVICE_AND_API_INIT(uart_k20_4, CONFIG_UART_K20_PORT_4_NAME, &uart_k20_init,
&uart_k20_dev_data_4, &uart_k20_dev_cfg_4,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_k20_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
diff --git a/drivers/serial/uart_nrf5.c b/drivers/serial/uart_nrf5.c
index b8848c0a3..43562fe64 100644
--- a/drivers/serial/uart_nrf5.c
+++ b/drivers/serial/uart_nrf5.c
@@ -503,7 +503,7 @@ static struct uart_nrf5_dev_data_t uart_nrf5_dev_data_0 = {
DEVICE_INIT(uart_nrf5_0, CONFIG_UART_NRF5_NAME, &uart_nrf5_init,
&uart_nrf5_dev_data_0, &uart_nrf5_dev_cfg_0,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
diff --git a/drivers/serial/uart_ns16550.c b/drivers/serial/uart_ns16550.c
index fad831dfb..937c047cf 100644
--- a/drivers/serial/uart_ns16550.c
+++ b/drivers/serial/uart_ns16550.c
@@ -778,7 +778,7 @@ static struct uart_ns16550_dev_data_t uart_ns16550_dev_data_0 = {
DEVICE_AND_API_INIT(uart_ns16550_0, CONFIG_UART_NS16550_PORT_0_NAME, &uart_ns16550_init,
&uart_ns16550_dev_data_0, &uart_ns16550_dev_cfg_0,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_ns16550_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@@ -830,7 +830,7 @@ static struct uart_ns16550_dev_data_t uart_ns16550_dev_data_1 = {
DEVICE_AND_API_INIT(uart_ns16550_1, CONFIG_UART_NS16550_PORT_1_NAME, &uart_ns16550_init,
&uart_ns16550_dev_data_1, &uart_ns16550_dev_cfg_1,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_ns16550_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
diff --git a/drivers/serial/uart_nsim.c b/drivers/serial/uart_nsim.c
index 21cafc160..dcd999215 100644
--- a/drivers/serial/uart_nsim.c
+++ b/drivers/serial/uart_nsim.c
@@ -89,4 +89,4 @@ static struct uart_device_config uart_nsim_dev_cfg_0 = {
DEVICE_INIT(uart_nsim0, CONFIG_UART_NSIM_PORT_0_NAME, &uart_nsim_init,
NULL, &uart_nsim_dev_cfg_0,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
diff --git a/drivers/serial/uart_qmsi.c b/drivers/serial/uart_qmsi.c
index 557881161..163bc59ce 100644
--- a/drivers/serial/uart_qmsi.c
+++ b/drivers/serial/uart_qmsi.c
@@ -165,7 +165,7 @@ static const struct uart_qmsi_config_info config_info_0 = {
static struct uart_qmsi_drv_data drv_data_0;
DEVICE_DEFINE(uart_0, CONFIG_UART_QMSI_0_NAME, &uart_qmsi_init,
- uart_qmsi_device_ctrl, &drv_data_0, &config_info_0, PRIMARY,
+ uart_qmsi_device_ctrl, &drv_data_0, &config_info_0, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, NULL);
#endif /* CONFIG_UART_QMSI_0 */
@@ -193,7 +193,7 @@ static const struct uart_qmsi_config_info config_info_1 = {
static struct uart_qmsi_drv_data drv_data_1;
DEVICE_DEFINE(uart_1, CONFIG_UART_QMSI_1_NAME, &uart_qmsi_init,
- uart_qmsi_device_ctrl, &drv_data_1, &config_info_1, PRIMARY,
+ uart_qmsi_device_ctrl, &drv_data_1, &config_info_1, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, NULL);
#endif /* CONFIG_UART_QMSI_1 */
diff --git a/drivers/serial/uart_stellaris.c b/drivers/serial/uart_stellaris.c
index 7bab9bf95..2441e618d 100644
--- a/drivers/serial/uart_stellaris.c
+++ b/drivers/serial/uart_stellaris.c
@@ -656,7 +656,7 @@ static struct uart_stellaris_dev_data_t uart_stellaris_dev_data_0 = {
DEVICE_AND_API_INIT(uart_stellaris0, CONFIG_UART_STELLARIS_PORT_0_NAME, &uart_stellaris_init,
&uart_stellaris_dev_data_0, &uart_stellaris_dev_cfg_0,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_stellaris_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@@ -693,7 +693,7 @@ static struct uart_stellaris_dev_data_t uart_stellaris_dev_data_1 = {
DEVICE_AND_API_INIT(uart_stellaris1, CONFIG_UART_STELLARIS_PORT_1_NAME, &uart_stellaris_init,
&uart_stellaris_dev_data_1, &uart_stellaris_dev_cfg_1,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_stellaris_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@@ -730,7 +730,7 @@ static struct uart_stellaris_dev_data_t uart_stellaris_dev_data_2 = {
DEVICE_AND_API_INIT(uart_stellaris2, CONFIG_UART_STELLARIS_PORT_2_NAME, &uart_stellaris_init,
&uart_stellaris_dev_data_2, &uart_stellaris_dev_cfg_2,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_stellaris_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c
index 3c2e89fdd..cde74d14f 100644
--- a/drivers/serial/uart_stm32.c
+++ b/drivers/serial/uart_stm32.c
@@ -352,7 +352,7 @@ static struct uart_stm32_data uart_stm32_dev_data_0 = {
DEVICE_AND_API_INIT(uart_stm32_0, CONFIG_UART_STM32_PORT_0_NAME,
&uart_stm32_init,
&uart_stm32_dev_data_0, &uart_stm32_dev_cfg_0,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_stm32_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@@ -401,7 +401,7 @@ static struct uart_stm32_data uart_stm32_dev_data_1 = {
DEVICE_AND_API_INIT(uart_stm32_1, CONFIG_UART_STM32_PORT_1_NAME,
&uart_stm32_init,
&uart_stm32_dev_data_1, &uart_stm32_dev_cfg_1,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_stm32_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@@ -449,7 +449,7 @@ static struct uart_stm32_data uart_stm32_dev_data_2 = {
DEVICE_AND_API_INIT(uart_stm32_2, CONFIG_UART_STM32_PORT_2_NAME,
&uart_stm32_init,
&uart_stm32_dev_data_2, &uart_stm32_dev_cfg_2,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&uart_stm32_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
diff --git a/drivers/shared_irq/Kconfig b/drivers/shared_irq/Kconfig
index 116396261..ad5b24de0 100644
--- a/drivers/shared_irq/Kconfig
+++ b/drivers/shared_irq/Kconfig
@@ -40,7 +40,7 @@ config SHARED_IRQ_INIT_PRIORITY
default 45
prompt "Shared IRQ init priority"
help
- Shared IRQ are initialized on SECONDARY init level. They
+ Shared IRQ are initialized on POST_KERNEL init level. They
have to be initialized before any device that uses them.
config SHARED_IRQ_0
diff --git a/drivers/shared_irq/shared_irq.c b/drivers/shared_irq/shared_irq.c
index 6705e4a37..b9ca77b5c 100644
--- a/drivers/shared_irq/shared_irq.c
+++ b/drivers/shared_irq/shared_irq.c
@@ -148,7 +148,7 @@ struct shared_irq_runtime shared_irq_0_runtime;
DEVICE_INIT(shared_irq_0, CONFIG_SHARED_IRQ_0_NAME, shared_irq_initialize,
&shared_irq_0_runtime, &shared_irq_config_0,
- SECONDARY, CONFIG_SHARED_IRQ_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_SHARED_IRQ_INIT_PRIORITY);
#if defined(CONFIG_IOAPIC)
#if defined(CONFIG_SHARED_IRQ_0_FALLING_EDGE)
@@ -186,7 +186,7 @@ struct shared_irq_runtime shared_irq_1_runtime;
DEVICE_INIT(shared_irq_1, CONFIG_SHARED_IRQ_1_NAME, shared_irq_initialize,
&shared_irq_1_runtime, &shared_irq_config_1,
- SECONDARY, CONFIG_SHARED_IRQ_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_SHARED_IRQ_INIT_PRIORITY);
#if defined(CONFIG_IOAPIC)
#if defined(CONFIG_SHARED_IRQ_1_FALLING_EDGE)
diff --git a/drivers/spi/spi_dw.c b/drivers/spi/spi_dw.c
index b201e2130..9110028e7 100644
--- a/drivers/spi/spi_dw.c
+++ b/drivers/spi/spi_dw.c
@@ -460,7 +460,7 @@ const struct spi_dw_config spi_dw_config_0 = {
DEVICE_AND_API_INIT(spi_dw_port_0, CONFIG_SPI_0_NAME, spi_dw_init,
&spi_dw_data_port_0, &spi_dw_config_0,
- SECONDARY, CONFIG_SPI_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_SPI_INIT_PRIORITY,
&dw_spi_api);
void spi_config_0_irq(void)
@@ -507,7 +507,7 @@ static const struct spi_dw_config spi_dw_config_1 = {
DEVICE_AND_API_INIT(spi_dw_port_1, CONFIG_SPI_1_NAME, spi_dw_init,
&spi_dw_data_port_1, &spi_dw_config_1,
- SECONDARY, CONFIG_SPI_INIT_PRIORITY,
+ POST_KERNEL, CONFIG_SPI_INIT_PRIORITY,
&dw_spi_api);
void spi_config_1_irq(void)
diff --git a/drivers/spi/spi_intel.c b/drivers/spi/spi_intel.c
index 7d8ca42dc..77daecb6c 100644
--- a/drivers/spi/spi_intel.c
+++ b/drivers/spi/spi_intel.c
@@ -490,7 +490,7 @@ const struct spi_intel_config spi_intel_config_0 = {
/* SPI may use GPIO pin for CS, thus it needs to be initialized after GPIO */
DEVICE_DEFINE(spi_intel_port_0, CONFIG_SPI_0_NAME, spi_intel_init,
spi_intel_device_ctrl, &spi_intel_data_port_0,
- &spi_intel_config_0, SECONDARY, CONFIG_SPI_INIT_PRIORITY, NULL);
+ &spi_intel_config_0, POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, NULL);
void spi_config_0_irq(void)
{
@@ -528,7 +528,7 @@ const struct spi_intel_config spi_intel_config_1 = {
/* SPI may use GPIO pin for CS, thus it needs to be initialized after GPIO */
DEVICE_DEFINE(spi_intel_port_1, CONFIG_SPI_1_NAME, spi_intel_init,
spi_intel_device_ctrl, &spi_intel_data_port_1,
- &spi_intel_config_1, SECONDARY, CONFIG_SPI_INIT_PRIORITY, NULL);
+ &spi_intel_config_1, POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, NULL);
void spi_config_1_irq(void)
{
diff --git a/drivers/spi/spi_k64.c b/drivers/spi/spi_k64.c
index 66b908e1d..35dc3c9a4 100644
--- a/drivers/spi/spi_k64.c
+++ b/drivers/spi/spi_k64.c
@@ -1101,7 +1101,7 @@ static const struct spi_k64_config spi_k64_config_0 = {
DEVICE_DEFINE(spi_k64_port_0, CONFIG_SPI_0_NAME, spi_k64_init,
spi_k64_device_ctrl, &spi_k64_data_port_0,
- &spi_k64_config_0, PRIMARY,
+ &spi_k64_config_0, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &k64_spi_api);
@@ -1130,7 +1130,7 @@ static const struct spi_k64_config spi_k64_config_1 = {
DEVICE_DEFINE(spi_k64_port_1, CONFIG_SPI_1_NAME, spi_k64_init,
spi_k64_device_ctrl, &spi_k64_data_port_1,
- &spi_k64_config_1, PRIMARY,
+ &spi_k64_config_1, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &k64_spi_api);
@@ -1159,7 +1159,7 @@ static const struct spi_k64_config spi_k64_config_2 = {
DEVICE_DEFINE(spi_k64_port_2, CONFIG_SPI_2_NAME, spi_k64_init,
spi_k64_device_ctrl, &spi_k64_data_port_2,
- &spi_k64_config_2, PRIMARY,
+ &spi_k64_config_2, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &k64_spi_api);
diff --git a/drivers/spi/spi_qmsi.c b/drivers/spi/spi_qmsi.c
index 6f8c4b021..84804eb2a 100644
--- a/drivers/spi/spi_qmsi.c
+++ b/drivers/spi/spi_qmsi.c
@@ -361,7 +361,7 @@ static struct spi_qmsi_runtime spi_qmsi_mst_0_runtime;
DEVICE_DEFINE(spi_master_0, CONFIG_SPI_0_NAME, spi_qmsi_init,
spi_master_qmsi_device_ctrl, &spi_qmsi_mst_0_runtime,
- &spi_qmsi_mst_0_config, SECONDARY, CONFIG_SPI_INIT_PRIORITY,
+ &spi_qmsi_mst_0_config, POST_KERNEL, CONFIG_SPI_INIT_PRIORITY,
NULL);
#endif /* CONFIG_SPI_0 */
@@ -378,6 +378,6 @@ static struct spi_qmsi_runtime spi_qmsi_mst_1_runtime;
DEVICE_DEFINE(spi_master_1, CONFIG_SPI_1_NAME, spi_qmsi_init,
spi_master_qmsi_device_ctrl, &spi_qmsi_mst_1_runtime,
- &spi_qmsi_mst_1_config, SECONDARY, CONFIG_SPI_INIT_PRIORITY,
+ &spi_qmsi_mst_1_config, POST_KERNEL, CONFIG_SPI_INIT_PRIORITY,
NULL);
#endif /* CONFIG_SPI_1 */
diff --git a/drivers/spi/spi_qmsi_ss.c b/drivers/spi/spi_qmsi_ss.c
index f1c9b415e..e094ca740 100644
--- a/drivers/spi/spi_qmsi_ss.c
+++ b/drivers/spi/spi_qmsi_ss.c
@@ -260,7 +260,7 @@ static struct ss_spi_qmsi_runtime spi_qmsi_mst_0_runtime;
DEVICE_INIT(ss_spi_master_0, CONFIG_SPI_0_NAME,
ss_spi_qmsi_init, &spi_qmsi_mst_0_runtime, &spi_qmsi_mst_0_config,
- SECONDARY, CONFIG_SPI_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_SPI_INIT_PRIORITY);
#endif /* CONFIG_SPI_0 */
@@ -278,7 +278,7 @@ static struct ss_spi_qmsi_runtime spi_qmsi_mst_1_runtime;
DEVICE_INIT(ss_spi_master_1, CONFIG_SPI_1_NAME,
ss_spi_qmsi_init, &spi_qmsi_mst_1_runtime, &spi_qmsi_mst_1_config,
- SECONDARY, CONFIG_SPI_INIT_PRIORITY);
+ POST_KERNEL, CONFIG_SPI_INIT_PRIORITY);
#endif /* CONFIG_SPI_1 */
diff --git a/drivers/timer/sys_clock_init.c b/drivers/timer/sys_clock_init.c
index 871d1a5ff..5b08ff689 100644
--- a/drivers/timer/sys_clock_init.c
+++ b/drivers/timer/sys_clock_init.c
@@ -33,5 +33,5 @@
#include <drivers/system_timer.h>
SYS_DEVICE_DEFINE("sys_clock", _sys_clock_driver_init,
- sys_clock_device_ctrl, SECONDARY,
+ sys_clock_device_ctrl, POST_KERNEL,
CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);
diff --git a/drivers/watchdog/iwdg_stm32.c b/drivers/watchdog/iwdg_stm32.c
index 2b6ff2ba7..3d4e0859d 100644
--- a/drivers/watchdog/iwdg_stm32.c
+++ b/drivers/watchdog/iwdg_stm32.c
@@ -122,5 +122,5 @@ static int iwdg_stm32_init(struct device *dev)
DEVICE_AND_API_INIT(iwdg_stm32, CONFIG_IWDG_STM32_DEVICE_NAME, iwdg_stm32_init,
NULL, NULL,
- PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
+ PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&iwdg_stm32_api);
diff --git a/drivers/watchdog/wdt_qmsi.c b/drivers/watchdog/wdt_qmsi.c
index 0a674c52b..d91137919 100644
--- a/drivers/watchdog/wdt_qmsi.c
+++ b/drivers/watchdog/wdt_qmsi.c
@@ -224,4 +224,4 @@ static int init(struct device *dev)
}
DEVICE_DEFINE(wdt, CONFIG_WDT_0_NAME, init, wdt_qmsi_device_ctrl, WDT_CONTEXT,
- 0, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &api);
+ 0, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &api);
diff --git a/include/device.h b/include/device.h
index ab013dcf4..6f1a34f56 100644
--- a/include/device.h
+++ b/include/device.h
@@ -39,6 +39,28 @@
extern "C" {
#endif
+/* XXX the easiest way to trigger a warning on a preprocessor macro
+ * is to use _Pragma("GCC warning \"...\"), however it's impossible to filter
+ * those out of -Werror, needed for sanitycheck. So we do this nastiness
+ * instead. These functions get compiled but don't take up extra space in
+ * the binary..
+ */
+static __deprecated const int _INIT_LEVEL_PRIMARY = 1;
+static __deprecated const int _INIT_LEVEL_SECONDARY = 1;
+static __deprecated const int _INIT_LEVEL_NANOKERNEL = 1;
+static __deprecated const int _INIT_LEVEL_MICROKERNEL = 1;
+static const int _INIT_LEVEL_PRE_KERNEL_1 = 1;
+static const int _INIT_LEVEL_PRE_KERNEL_2 = 1;
+static const int _INIT_LEVEL_POST_KERNEL = 1;
+static const int _INIT_LEVEL_APPLICATION = 1;
+
+#define _DEPRECATION_CHECK(dev_name, level) \
+ static inline void _CONCAT(_deprecation_check_, dev_name)() \
+ { \
+ int foo = _CONCAT(_INIT_LEVEL_, level); \
+ (void)foo; \
+ }
+
/**
* @def DEVICE_INIT
*
@@ -63,19 +85,16 @@ extern "C" {
* Must be one of the following symbols, which are listed in the order
* they are performed by the kernel:
* \n
- * \li PRIMARY: Used for devices that have no dependencies, such as those
+ * \li PRE_KERNEL_1: Used for devices that have no dependencies, such as those
* that rely solely on hardware present in the processor/SOC. These devices
* cannot use any kernel services during configuration, since they are not
* yet available.
* \n
- * \li SECONDARY: Used for devices that rely on the initialization of devices
+ * \li PRE_KERNEL_2: Used for devices that rely on the initialization of devices
* initialized as part of the PRIMARY level. These devices cannot use any
* kernel services during configuration, since they are not yet available.
* \n
- * \li NANOKERNEL: Used for devices that require nanokernel services during
- * configuration.
- * \n
- * \li MICROKERNEL: Used for devices that require microkernel services during
+ * \li POST_KERNEL: Used for devices that require kernel services during
* configuration.
* \n
* \li APPLICATION: Used for application components (i.e. non-kernel components)
@@ -113,7 +132,7 @@ extern "C" {
.name = drv_name, .init = (init_fn), \
.config_info = (cfg_info) \
}; \
- \
+ _DEPRECATION_CHECK(dev_name, level) \
static struct device _CONCAT(__device_, dev_name) __used \
__attribute__((__section__(".init_" #level STRINGIFY(prio)))) = { \
.config = &_CONCAT(__config_, dev_name), \
@@ -168,7 +187,7 @@ extern "C" {
.dev_pm_ops = (device_pm_ops), \
.config_info = (cfg_info) \
}; \
- \
+ _DEPRECATION_CHECK(dev_name, level) \
static struct device _CONCAT(__device_, dev_name) __used \
__attribute__((__section__(".init_" #level STRINGIFY(prio)))) = { \
.config = &_CONCAT(__config_, dev_name), \
@@ -197,7 +216,7 @@ extern struct device_pm_ops device_pm_ops_nop;
.dev_pm_ops = (&device_pm_ops_nop), \
.config_info = (cfg_info) \
}; \
- \
+ _DEPRECATION_CHECK(dev_name, level) \
static struct device _CONCAT(__device_, dev_name) __used \
__attribute__((__section__(".init_" #level STRINGIFY(prio)))) = { \
.config = &_CONCAT(__config_, dev_name), \
diff --git a/include/init.h b/include/init.h
index 405bb1a46..e0c66dcb8 100644
--- a/include/init.h
+++ b/include/init.h
@@ -26,17 +26,25 @@ extern "C" {
#endif
/*
- * System initialization levels. The PRIMARY and SECONDARY levels are
+ * System initialization levels. The PRE_KERNEL_1 and PRE_KERNEL_2 levels are
* executed in the kernel's initialization context, which uses the interrupt
- * stack. The remaining levels are executed in the kernel's main task
- * (i.e. the nanokernel's background task or the microkernel's idle task).
+ * stack. The remaining levels are executed in the kernel's main task.
+ *
+ * PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL levels are currently deprecated
+ * and will be removed in the future.
*/
-#define _SYS_INIT_LEVEL_PRIMARY 0
-#define _SYS_INIT_LEVEL_SECONDARY 1
-#define _SYS_INIT_LEVEL_NANOKERNEL 2
-#define _SYS_INIT_LEVEL_MICROKERNEL 3
-#define _SYS_INIT_LEVEL_APPLICATION 4
+#define _SYS_INIT_LEVEL_PRE_KERNEL_1 0
+#define _SYS_INIT_LEVEL_PRE_KERNEL_2 1
+#define _SYS_INIT_LEVEL_POST_KERNEL 2
+#define _SYS_INIT_LEVEL_APPLICATION 3
+
+/* Deprecated, remove eventually */
+#define _SYS_INIT_LEVEL_PRIMARY 4
+#define _SYS_INIT_LEVEL_SECONDARY 5
+#define _SYS_INIT_LEVEL_NANOKERNEL 6
+#define _SYS_INIT_LEVEL_MICROKERNEL 7
+
/* Counter use to avoid issues if two or more system devices are declared
* in the same C file with the same init function
diff --git a/include/linker-defs.h b/include/linker-defs.h
index 0d8d58e60..5d7fe4e8b 100644
--- a/include/linker-defs.h
+++ b/include/linker-defs.h
@@ -83,12 +83,15 @@
*/
#define DEVICE_INIT_SECTIONS() \
- __device_init_start = .; \
- DEVICE_INIT_LEVEL(PRIMARY) \
+ __device_init_start = .; \
+ DEVICE_INIT_LEVEL(PRE_KERNEL_1) \
+ DEVICE_INIT_LEVEL(PRE_KERNEL_2) \
+ DEVICE_INIT_LEVEL(POST_KERNEL) \
+ DEVICE_INIT_LEVEL(APPLICATION) \
+ DEVICE_INIT_LEVEL(PRIMARY) \
DEVICE_INIT_LEVEL(SECONDARY) \
DEVICE_INIT_LEVEL(NANOKERNEL) \
DEVICE_INIT_LEVEL(MICROKERNEL) \
- DEVICE_INIT_LEVEL(APPLICATION) \
__device_init_end = .; \
DEVICE_BUSY_BITFIELD() \
diff --git a/kernel/unified/alert.c b/kernel/unified/alert.c
index 9128db2bd..cb7088ea7 100644
--- a/kernel/unified/alert.c
+++ b/kernel/unified/alert.c
@@ -49,7 +49,7 @@ static int init_alert_module(struct device *dev)
return 0;
}
-SYS_INIT(init_alert_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_alert_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
#endif /* CONFIG_DEBUG_TRACING_KERNEL_OBJECTS */
diff --git a/kernel/unified/device.c b/kernel/unified/device.c
index ab04ca275..24763a316 100644
--- a/kernel/unified/device.c
+++ b/kernel/unified/device.c
@@ -21,19 +21,32 @@
#include <atomic.h>
extern struct device __device_init_start[];
+extern struct device __device_PRE_KERNEL_1_start[];
+extern struct device __device_PRE_KERNEL_2_start[];
+extern struct device __device_POST_KERNEL_start[];
+extern struct device __device_APPLICATION_start[];
+
+/* Deprecated */
extern struct device __device_PRIMARY_start[];
extern struct device __device_SECONDARY_start[];
extern struct device __device_NANOKERNEL_start[];
extern struct device __device_MICROKERNEL_start[];
-extern struct device __device_APPLICATION_start[];
+
extern struct device __device_init_end[];
static struct device *config_levels[] = {
+ __device_PRE_KERNEL_1_start,
+ __device_PRE_KERNEL_2_start,
+ __device_POST_KERNEL_start,
+ __device_APPLICATION_start,
+
+ /* Deprecated levels */
__device_PRIMARY_start,
__device_SECONDARY_start,
__device_NANOKERNEL_start,
__device_MICROKERNEL_start,
- __device_APPLICATION_start,
+
+ /* End marker */
__device_init_end,
};
diff --git a/kernel/unified/fifo.c b/kernel/unified/fifo.c
index 1de6e9f71..8afa595b6 100644
--- a/kernel/unified/fifo.c
+++ b/kernel/unified/fifo.c
@@ -53,7 +53,7 @@ static int init_fifo_module(struct device *dev)
return 0;
}
-SYS_INIT(init_fifo_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_fifo_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
#endif /* CONFIG_DEBUG_TRACING_KERNEL_OBJECTS */
diff --git a/kernel/unified/init.c b/kernel/unified/init.c
index 9d129d2eb..e8458874d 100644
--- a/kernel/unified/init.c
+++ b/kernel/unified/init.c
@@ -180,9 +180,14 @@ static void _main(void *unused1, void *unused2, void *unused3)
ARG_UNUSED(unused2);
ARG_UNUSED(unused3);
+ _sys_device_do_config_level(_SYS_INIT_LEVEL_POST_KERNEL);
+
+ /* These 3 are deprecated */
_sys_device_do_config_level(_SYS_INIT_LEVEL_SECONDARY);
_sys_device_do_config_level(_SYS_INIT_LEVEL_NANOKERNEL);
_sys_device_do_config_level(_SYS_INIT_LEVEL_MICROKERNEL);
+
+ /* Final init level before app starts */
_sys_device_do_config_level(_SYS_INIT_LEVEL_APPLICATION);
#ifdef CONFIG_CPLUSPLUS
@@ -363,10 +368,13 @@ FUNC_NORETURN void _Cstart(void)
prepare_multithreading((struct k_thread *)&dummy_thread);
- /* perform basic hardware initialization */
-
+ /* Deprecated */
_sys_device_do_config_level(_SYS_INIT_LEVEL_PRIMARY);
+ /* perform basic hardware initialization */
+ _sys_device_do_config_level(_SYS_INIT_LEVEL_PRE_KERNEL_1);
+ _sys_device_do_config_level(_SYS_INIT_LEVEL_PRE_KERNEL_2);
+
/*
* Initialize random number generator
* As a platform may implement it in hardware, it has to be
diff --git a/kernel/unified/legacy_offload.c b/kernel/unified/legacy_offload.c
index 73e1dfa28..f65299467 100644
--- a/kernel/unified/legacy_offload.c
+++ b/kernel/unified/legacy_offload.c
@@ -85,5 +85,5 @@ static int k_offload_work_q_init(struct device *dev)
return 0;
}
-SYS_INIT(k_offload_work_q_init, NANOKERNEL,
+SYS_INIT(k_offload_work_q_init, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/kernel/unified/legacy_timer.c b/kernel/unified/legacy_timer.c
index 1e61f93bf..5021fb108 100644
--- a/kernel/unified/legacy_timer.c
+++ b/kernel/unified/legacy_timer.c
@@ -66,7 +66,7 @@ static int init_dyamic_timers(struct device *dev)
return 0;
}
-SYS_INIT(init_dyamic_timers, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_dyamic_timers, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
ktimer_t task_timer_alloc(void)
{
diff --git a/kernel/unified/lifo.c b/kernel/unified/lifo.c
index e6c2f2575..bd662dc5b 100644
--- a/kernel/unified/lifo.c
+++ b/kernel/unified/lifo.c
@@ -50,7 +50,7 @@ static int init_lifo_module(struct device *dev)
return 0;
}
-SYS_INIT(init_lifo_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_lifo_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
#endif /* CONFIG_DEBUG_TRACING_KERNEL_OBJECTS */
diff --git a/kernel/unified/mailbox.c b/kernel/unified/mailbox.c
index c97290cdd..5fd7b14f2 100644
--- a/kernel/unified/mailbox.c
+++ b/kernel/unified/mailbox.c
@@ -106,7 +106,7 @@ static int init_mbox_module(struct device *dev)
return 0;
}
-SYS_INIT(init_mbox_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_mbox_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
#endif /* CONFIG_NUM_MBOX_ASYNC_MSGS or CONFIG_DEBUG_TRACING_KERNEL_OBJECTS */
diff --git a/kernel/unified/mem_pool.c b/kernel/unified/mem_pool.c
index cc9d80b54..c5ef31c33 100644
--- a/kernel/unified/mem_pool.c
+++ b/kernel/unified/mem_pool.c
@@ -60,7 +60,7 @@ static int init_static_pools(struct device *unused)
return 0;
}
-SYS_INIT(init_static_pools, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_static_pools, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
/**
*
diff --git a/kernel/unified/mem_slab.c b/kernel/unified/mem_slab.c
index 7dee32b99..3402303ea 100644
--- a/kernel/unified/mem_slab.c
+++ b/kernel/unified/mem_slab.c
@@ -74,7 +74,8 @@ static int init_mem_slab_module(struct device *dev)
return 0;
}
-SYS_INIT(init_mem_slab_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_mem_slab_module, PRE_KERNEL_1,
+ CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
void k_mem_slab_init(struct k_mem_slab *slab, void *buffer,
size_t block_size, uint32_t num_blocks)
diff --git a/kernel/unified/msg_q.c b/kernel/unified/msg_q.c
index 6db34e8e8..7536872c3 100644
--- a/kernel/unified/msg_q.c
+++ b/kernel/unified/msg_q.c
@@ -52,7 +52,7 @@ static int init_msgq_module(struct device *dev)
return 0;
}
-SYS_INIT(init_msgq_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_msgq_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
#endif /* CONFIG_DEBUG_TRACING_KERNEL_OBJECTS */
diff --git a/kernel/unified/mutex.c b/kernel/unified/mutex.c
index 5e567ac74..8ef9f5ae8 100644
--- a/kernel/unified/mutex.c
+++ b/kernel/unified/mutex.c
@@ -87,7 +87,7 @@ static int init_mutex_module(struct device *dev)
return 0;
}
-SYS_INIT(init_mutex_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_mutex_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
#endif /* CONFIG_DEBUG_TRACING_KERNEL_OBJECTS */
diff --git a/kernel/unified/pipes.c b/kernel/unified/pipes.c
index 5bbb51cf0..bd8a7027d 100644
--- a/kernel/unified/pipes.c
+++ b/kernel/unified/pipes.c
@@ -130,7 +130,7 @@ static int init_pipes_module(struct device *dev)
return 0;
}
-SYS_INIT(init_pipes_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_pipes_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
#endif /* CONFIG_NUM_PIPE_ASYNC_MSGS or CONFIG_DEBUG_TRACING_KERNEL_OBJECTS */
diff --git a/kernel/unified/sem.c b/kernel/unified/sem.c
index c21a8f6d6..c3baaa596 100644
--- a/kernel/unified/sem.c
+++ b/kernel/unified/sem.c
@@ -71,7 +71,7 @@ static int init_sem_module(struct device *dev)
return 0;
}
-SYS_INIT(init_sem_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_sem_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
#endif /* CONFIG_DEBUG_TRACING_KERNEL_OBJECTS */
diff --git a/kernel/unified/stack.c b/kernel/unified/stack.c
index 86288422d..c5729dcba 100644
--- a/kernel/unified/stack.c
+++ b/kernel/unified/stack.c
@@ -50,7 +50,7 @@ static int init_stack_module(struct device *dev)
return 0;
}
-SYS_INIT(init_stack_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_stack_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
#endif /* CONFIG_DEBUG_TRACING_KERNEL_OBJECTS */
diff --git a/kernel/unified/system_work_q.c b/kernel/unified/system_work_q.c
index c724150c3..6c18e26c8 100644
--- a/kernel/unified/system_work_q.c
+++ b/kernel/unified/system_work_q.c
@@ -40,4 +40,4 @@ static int k_sys_work_q_init(struct device *dev)
return 0;
}
-SYS_INIT(k_sys_work_q_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(k_sys_work_q_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
diff --git a/kernel/unified/timer.c b/kernel/unified/timer.c
index 736ae779a..988a6001a 100644
--- a/kernel/unified/timer.c
+++ b/kernel/unified/timer.c
@@ -41,7 +41,7 @@ static int init_timer_module(struct device *dev)
return 0;
}
-SYS_INIT(init_timer_module, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
+SYS_INIT(init_timer_module, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS);
#endif /* CONFIG_DEBUG_TRACING_KERNEL_OBJECTS */
diff --git a/misc/debug/mem_safe_check_boundaries.c b/misc/debug/mem_safe_check_boundaries.c
index 962356ef9..a5440228d 100644
--- a/misc/debug/mem_safe_check_boundaries.c
+++ b/misc/debug/mem_safe_check_boundaries.c
@@ -290,4 +290,4 @@ static int init(struct device *unused)
return 0;
}
-SYS_INIT(init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
+SYS_INIT(init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);