drivers: interrupt_controller: Refactor drivers to use shared init prio

Refactors interrupt controller drivers to use the shared driver class
initialization priority configuration, CONFIG_INTC_INIT_PRIORITY, to
allow configuring interrupt controller drivers separately from other
devices. This is similar to other driver classes.

The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEFAULT to preserve
the existing default initialization priority for most drivers.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
This commit is contained in:
Maureen Helm 2022-03-11 16:25:41 -06:00 committed by Carles Cufí
commit 41634c82cc
16 changed files with 22 additions and 16 deletions

View file

@ -45,6 +45,12 @@ config LEON_IRQMP
help
GRLIB IRQMP and IRQAMP
config INTC_INIT_PRIORITY
int "Interrupt controller init priority"
default KERNEL_INIT_PRIORITY_DEFAULT
help
Interrupt controller device initialization priority.
source "drivers/interrupt_controller/Kconfig.multilevel"
source "drivers/interrupt_controller/Kconfig.loapic"

View file

@ -423,7 +423,7 @@ static struct stm32_exti_data exti_data;
DEVICE_DT_DEFINE(EXTI_NODE, &stm32_exti_init,
NULL,
&exti_data, NULL,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY,
NULL);
/**

View file

@ -191,4 +191,4 @@ static int gd32_exti_init(const struct device *dev)
static struct gd32_exti_data data;
DEVICE_DT_INST_DEFINE(0, gd32_exti_init, NULL, &data, NULL, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, NULL);
CONFIG_INTC_INIT_PRIORITY, NULL);

View file

@ -239,7 +239,7 @@ int arm_gic_init(const struct device *unused)
return 0;
}
SYS_INIT(arm_gic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(arm_gic_init, PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY);
#ifdef CONFIG_SMP
void arm_gic_secondary_init(void)

View file

@ -487,7 +487,7 @@ int arm_gic_init(const struct device *unused)
return 0;
}
SYS_INIT(arm_gic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(arm_gic_init, PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY);
#ifdef CONFIG_SMP
void arm_gic_secondary_init(void)

View file

@ -667,7 +667,7 @@ struct its_driver_api gicv3_its_api = {
&gicv3_its_data##n, \
&gicv3_its_config##n, \
POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
CONFIG_INTC_INIT_PRIORITY, \
&gicv3_its_api);
DT_INST_FOREACH_STATUS_OKAY(GICV3_ITS_INIT)

View file

@ -545,4 +545,4 @@ static void IoApicRedUpdateLo(unsigned int irq,
PM_DEVICE_DEFINE(ioapic, ioapic_pm_action);
DEVICE_DEFINE(ioapic, "ioapic", ioapic_init, PM_DEVICE_GET(ioapic), NULL, NULL,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY, NULL);

View file

@ -122,4 +122,4 @@ static int irqmp_init(const struct device *dev)
return 0;
}
SYS_INIT(irqmp_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(irqmp_init, PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY);

View file

@ -422,7 +422,7 @@ static int loapic_pm_action(const struct device *dev,
PM_DEVICE_DEFINE(loapic, loapic_pm_action);
DEVICE_DEFINE(loapic, "loapic", loapic_init, PM_DEVICE_GET(loapic), NULL, NULL,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY, NULL);
#if CONFIG_LOAPIC_SPURIOUS_VECTOR
extern void z_loapic_spurious_handler(void);

View file

@ -568,7 +568,7 @@ static int xec_ecia_init(const struct device *dev)
\
DEVICE_DT_DEFINE(n, xec_girq_init_##n, \
NULL, &xec_data_girq_##n, &xec_config_girq_##n, \
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY, \
NULL); \
\
static int xec_girq_init_##n(const struct device *dev) \
@ -606,7 +606,7 @@ static const struct xec_ecia_config xec_config_ecia = {
DEVICE_DT_DEFINE(DT_NODELABEL(ecia), xec_ecia_init,
NULL, NULL, &xec_config_ecia,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY,
NULL);
/* look up GIRQ node handle from ECIA configuration */

View file

@ -382,7 +382,7 @@ int npcx_miwu_manage_dev_callback(struct miwu_dev_callback *cb, bool set)
NULL, \
NULL, &miwu_config_##inst, \
PRE_KERNEL_1, \
CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, NULL); \
CONFIG_INTC_INIT_PRIORITY, NULL); \
\
NPCX_MIWU_ISR_FUNC_IMPL(inst) \
\

View file

@ -181,4 +181,4 @@ static int nuclei_eclic_init(const struct device *dev)
return 0;
}
SYS_INIT(nuclei_eclic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(nuclei_eclic_init, PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY);

View file

@ -208,4 +208,4 @@ static int plic_init(const struct device *dev)
return 0;
}
SYS_INIT(plic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(plic_init, PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY);

View file

@ -409,5 +409,5 @@ static int sam0_eic_init(const struct device *dev)
static struct sam0_eic_data eic_data;
DEVICE_DT_INST_DEFINE(0, sam0_eic_init,
NULL, &eic_data, NULL,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY,
NULL);

View file

@ -235,4 +235,4 @@ int arch_irq_is_enabled(unsigned int irq)
return !!(mie & (1 << irq));
}
SYS_INIT(swerv_pic_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(swerv_pic_init, PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY);

View file

@ -135,4 +135,4 @@ static int vexriscv_litex_irq_init(const struct device *dev)
}
SYS_INIT(vexriscv_litex_irq_init, PRE_KERNEL_2,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
CONFIG_INTC_INIT_PRIORITY);