diff options
Diffstat (limited to 'arch/arm/mach-omap2/prm_common.c')
-rw-r--r-- | arch/arm/mach-omap2/prm_common.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index dc11841ca334..09180a59b1c9 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c | |||
@@ -66,7 +66,7 @@ static struct irq_chip_generic **prcm_irq_chips; | |||
66 | static struct omap_prcm_irq_setup *prcm_irq_setup; | 66 | static struct omap_prcm_irq_setup *prcm_irq_setup; |
67 | 67 | ||
68 | /* prm_base: base virtual address of the PRM IP block */ | 68 | /* prm_base: base virtual address of the PRM IP block */ |
69 | void __iomem *prm_base; | 69 | struct omap_domain_base prm_base; |
70 | 70 | ||
71 | u16 prm_features; | 71 | u16 prm_features; |
72 | 72 | ||
@@ -267,10 +267,9 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup) | |||
267 | { | 267 | { |
268 | int nr_regs; | 268 | int nr_regs; |
269 | u32 mask[OMAP_PRCM_MAX_NR_PENDING_REG]; | 269 | u32 mask[OMAP_PRCM_MAX_NR_PENDING_REG]; |
270 | int offset, i; | 270 | int offset, i, irq; |
271 | struct irq_chip_generic *gc; | 271 | struct irq_chip_generic *gc; |
272 | struct irq_chip_type *ct; | 272 | struct irq_chip_type *ct; |
273 | unsigned int irq; | ||
274 | 273 | ||
275 | if (!irq_setup) | 274 | if (!irq_setup) |
276 | return -EINVAL; | 275 | return -EINVAL; |
@@ -325,7 +324,7 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup) | |||
325 | 324 | ||
326 | for (i = 0; i < irq_setup->nr_regs; i++) { | 325 | for (i = 0; i < irq_setup->nr_regs; i++) { |
327 | gc = irq_alloc_generic_chip("PRCM", 1, | 326 | gc = irq_alloc_generic_chip("PRCM", 1, |
328 | irq_setup->base_irq + i * 32, prm_base, | 327 | irq_setup->base_irq + i * 32, prm_base.va, |
329 | handle_level_irq); | 328 | handle_level_irq); |
330 | 329 | ||
331 | if (!gc) { | 330 | if (!gc) { |
@@ -344,10 +343,8 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup) | |||
344 | prcm_irq_chips[i] = gc; | 343 | prcm_irq_chips[i] = gc; |
345 | } | 344 | } |
346 | 345 | ||
347 | if (of_have_populated_dt()) { | 346 | irq = omap_prcm_event_to_irq("io"); |
348 | int irq = omap_prcm_event_to_irq("io"); | 347 | omap_pcs_legacy_init(irq, irq_setup->reconfigure_io_chain); |
349 | omap_pcs_legacy_init(irq, irq_setup->reconfigure_io_chain); | ||
350 | } | ||
351 | 348 | ||
352 | return 0; | 349 | return 0; |
353 | 350 | ||
@@ -364,7 +361,7 @@ err: | |||
364 | */ | 361 | */ |
365 | void __init omap2_set_globals_prm(void __iomem *prm) | 362 | void __init omap2_set_globals_prm(void __iomem *prm) |
366 | { | 363 | { |
367 | prm_base = prm; | 364 | prm_base.va = prm; |
368 | } | 365 | } |
369 | 366 | ||
370 | /** | 367 | /** |
@@ -755,19 +752,22 @@ int __init omap2_prm_base_init(void) | |||
755 | struct device_node *np; | 752 | struct device_node *np; |
756 | const struct of_device_id *match; | 753 | const struct of_device_id *match; |
757 | struct omap_prcm_init_data *data; | 754 | struct omap_prcm_init_data *data; |
758 | void __iomem *mem; | 755 | struct resource res; |
756 | int ret; | ||
759 | 757 | ||
760 | for_each_matching_node_and_match(np, omap_prcm_dt_match_table, &match) { | 758 | for_each_matching_node_and_match(np, omap_prcm_dt_match_table, &match) { |
761 | data = (struct omap_prcm_init_data *)match->data; | 759 | data = (struct omap_prcm_init_data *)match->data; |
762 | 760 | ||
763 | mem = of_iomap(np, 0); | 761 | ret = of_address_to_resource(np, 0, &res); |
764 | if (!mem) | 762 | if (ret) |
765 | return -ENOMEM; | 763 | return ret; |
766 | 764 | ||
767 | if (data->index == TI_CLKM_PRM) | 765 | data->mem = ioremap(res.start, resource_size(&res)); |
768 | prm_base = mem + data->offset; | ||
769 | 766 | ||
770 | data->mem = mem; | 767 | if (data->index == TI_CLKM_PRM) { |
768 | prm_base.va = data->mem + data->offset; | ||
769 | prm_base.pa = res.start + data->offset; | ||
770 | } | ||
771 | 771 | ||
772 | data->np = np; | 772 | data->np = np; |
773 | 773 | ||