init: Implement fine-grained initialization policy

Put initialization priorities as device driver Kconfig
parameter.

Initialization priority value for each platform is defined
in the platform Kconfig file.

Drivers and platform code use SYS_DEFINE_DEVICE to add
and initialization function.

Change-Id: I2f4f3c7370dac02408a1b50a0a1bade8b427a282
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Dmitriy Korovkin 2015-10-26 15:56:02 -04:00 committed by Anas Nashif
commit 57f2741e4f
66 changed files with 447 additions and 115 deletions

View file

@ -26,6 +26,13 @@ menuconfig I2C
help
Enable I2C Driver Configuration
config I2C_INIT_PRIORITY
int
depends on I2C
prompt "Init priority"
help
I2C device driver initialization priority.
config I2C_DW
bool "Design Ware I2C support"
depends on I2C

View file

@ -837,7 +837,7 @@ DECLARE_DEVICE_INIT_CONFIG(i2c_0,
&i2c_dw_initialize,
&i2c_config_dw_0);
pre_kernel_late_init(i2c_0, &i2c_0_runtime);
SYS_DEFINE_DEVICE(i2c_0, &i2c_0_runtime, SECONDARY, CONFIG_I2C_INIT_PRIORITY);
struct device *i2c_dw_isr_0_device = SYS_GET_DEVICE(i2c_0);
#ifdef CONFIG_I2C_DW_0_IRQ_DIRECT
@ -889,7 +889,8 @@ DECLARE_DEVICE_INIT_CONFIG(i2c_1,
&i2c_dw_initialize,
&i2c_config_dw_1);
pre_kernel_late_init(i2c_1, &i2c_1_runtime);
SYS_DEFINE_DEVICE(i2c_1, &i2c_1_runtime, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
struct device *i2c_dw_isr_1_device = SYS_GET_DEVICE(i2c_1);
IRQ_CONNECT_STATIC(i2c_dw_1,

View file

@ -751,7 +751,8 @@ DECLARE_DEVICE_INIT_CONFIG(i2c_ss_0,
&i2c_qse_ss_initialize,
&i2c_config_ss_0);
pre_kernel_late_init(i2c_ss_0, &i2c_ss_0_runtime);
SYS_DEFINE_DEVICE(i2c_ss_0, &i2c_ss_0_runtime,
SECONDARY, CONFIG_I2C_INIT_PRIORITY);
#endif /* CONFIG_I2C_QUARK_SE_SS_0 */
@ -785,6 +786,7 @@ DECLARE_DEVICE_INIT_CONFIG(i2c_ss_1,
&i2c_qse_ss_initialize,
&i2c_config_ss_1);
pre_kernel_late_init(i2c_ss_1, &i2c_qse_ss_1_runtime);
SYS_DEFINE_DEVICE(i2c_ss_1, &i2c_qse_ss_1_runtime,
SECONDARY, CONFIG_I2C_INIT_PRIORITY);
#endif /* CONFIG_I2C_QUARK_SE_SS_1 */