ARM: OMAP4+: PRM: get rid of cpu_is_omap44xx calls from interrupt init
The compatible DT node is now passed with the prm init, so there is no need to do node matching here again. Added a new flag to the init data also, to detect default IRQ support for OMAP4. Also, any booting omap4 DT setup always has a PRM node, so there is no need to check against the special case where it would be missing. Signed-off-by: Tero Kristo <t-kristo@ti.com>
This commit is contained in:
parent
8b5b9a22b5
commit
219595b6ee
|
@ -29,9 +29,11 @@ int omap2_prcm_base_init(void);
|
||||||
*
|
*
|
||||||
* PRM_HAS_IO_WAKEUP: has IO wakeup capability
|
* PRM_HAS_IO_WAKEUP: has IO wakeup capability
|
||||||
* PRM_HAS_VOLTAGE: has voltage domains
|
* PRM_HAS_VOLTAGE: has voltage domains
|
||||||
|
* PRM_IRQ_DEFAULT: use default irq number for PRM irq
|
||||||
*/
|
*/
|
||||||
#define PRM_HAS_IO_WAKEUP (1 << 0)
|
#define PRM_HAS_IO_WAKEUP BIT(0)
|
||||||
#define PRM_HAS_VOLTAGE (1 << 1)
|
#define PRM_HAS_VOLTAGE BIT(1)
|
||||||
|
#define PRM_IRQ_DEFAULT BIT(2)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP
|
* MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP
|
||||||
|
|
|
@ -703,10 +703,14 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
|
||||||
.vp_clear_txdone = omap4_prm_vp_clear_txdone,
|
.vp_clear_txdone = omap4_prm_vp_clear_txdone,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct omap_prcm_init_data *prm_init_data;
|
||||||
|
|
||||||
int __init omap44xx_prm_init(const struct omap_prcm_init_data *data)
|
int __init omap44xx_prm_init(const struct omap_prcm_init_data *data)
|
||||||
{
|
{
|
||||||
omap_prm_base_init();
|
omap_prm_base_init();
|
||||||
|
|
||||||
|
prm_init_data = data;
|
||||||
|
|
||||||
if (data->flags & PRM_HAS_IO_WAKEUP)
|
if (data->flags & PRM_HAS_IO_WAKEUP)
|
||||||
prm_features |= PRM_HAS_IO_WAKEUP;
|
prm_features |= PRM_HAS_IO_WAKEUP;
|
||||||
|
|
||||||
|
@ -718,16 +722,8 @@ int __init omap44xx_prm_init(const struct omap_prcm_init_data *data)
|
||||||
return prm_register(&omap44xx_prm_ll_data);
|
return prm_register(&omap44xx_prm_ll_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct of_device_id omap_prm_dt_match_table[] = {
|
|
||||||
{ .compatible = "ti,omap4-prm" },
|
|
||||||
{ .compatible = "ti,omap5-prm" },
|
|
||||||
{ .compatible = "ti,dra7-prm" },
|
|
||||||
{ }
|
|
||||||
};
|
|
||||||
|
|
||||||
static int omap44xx_prm_late_init(void)
|
static int omap44xx_prm_late_init(void)
|
||||||
{
|
{
|
||||||
struct device_node *np;
|
|
||||||
int irq_num;
|
int irq_num;
|
||||||
|
|
||||||
if (!(prm_features & PRM_HAS_IO_WAKEUP))
|
if (!(prm_features & PRM_HAS_IO_WAKEUP))
|
||||||
|
@ -737,19 +733,12 @@ static int omap44xx_prm_late_init(void)
|
||||||
if (!of_have_populated_dt())
|
if (!of_have_populated_dt())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
np = of_find_matching_node(NULL, omap_prm_dt_match_table);
|
irq_num = of_irq_get(prm_init_data->np, 0);
|
||||||
|
|
||||||
if (!np) {
|
|
||||||
/* Default loaded up with OMAP4 values */
|
|
||||||
if (!cpu_is_omap44xx())
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
irq_num = of_irq_get(np, 0);
|
|
||||||
/*
|
/*
|
||||||
* Already have OMAP4 IRQ num. For all other platforms, we need
|
* Already have OMAP4 IRQ num. For all other platforms, we need
|
||||||
* IRQ numbers from DT
|
* IRQ numbers from DT
|
||||||
*/
|
*/
|
||||||
if (irq_num < 0 && !cpu_is_omap44xx()) {
|
if (irq_num < 0 && !(prm_init_data->flags & PRM_IRQ_DEFAULT)) {
|
||||||
if (irq_num == -EPROBE_DEFER)
|
if (irq_num == -EPROBE_DEFER)
|
||||||
return irq_num;
|
return irq_num;
|
||||||
|
|
||||||
|
@ -762,7 +751,6 @@ static int omap44xx_prm_late_init(void)
|
||||||
omap4_prcm_irq_setup.irq = irq_num;
|
omap4_prcm_irq_setup.irq = irq_num;
|
||||||
omap4_prcm_irq_setup.xlate_irq = NULL;
|
omap4_prcm_irq_setup.xlate_irq = NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
omap44xx_prm_enable_io_wakeup();
|
omap44xx_prm_enable_io_wakeup();
|
||||||
|
|
||||||
|
|
|
@ -669,7 +669,7 @@ static struct omap_prcm_init_data omap4_prm_data __initdata = {
|
||||||
.index = TI_CLKM_PRM,
|
.index = TI_CLKM_PRM,
|
||||||
.init = omap44xx_prm_init,
|
.init = omap44xx_prm_init,
|
||||||
.device_inst_offset = OMAP4430_PRM_DEVICE_INST,
|
.device_inst_offset = OMAP4430_PRM_DEVICE_INST,
|
||||||
.flags = PRM_HAS_IO_WAKEUP | PRM_HAS_VOLTAGE,
|
.flags = PRM_HAS_IO_WAKEUP | PRM_HAS_VOLTAGE | PRM_IRQ_DEFAULT,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue