aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/prm.h6
-rw-r--r--arch/arm/mach-omap2/prm44xx.c54
-rw-r--r--arch/arm/mach-omap2/prm_common.c2
3 files changed, 26 insertions, 36 deletions
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 3936e6c38cea..233bc84fbc0e 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -29,9 +29,11 @@ int omap2_prcm_base_init(void);
29 * 29 *
30 * PRM_HAS_IO_WAKEUP: has IO wakeup capability 30 * PRM_HAS_IO_WAKEUP: has IO wakeup capability
31 * PRM_HAS_VOLTAGE: has voltage domains 31 * PRM_HAS_VOLTAGE: has voltage domains
32 * PRM_IRQ_DEFAULT: use default irq number for PRM irq
32 */ 33 */
33#define PRM_HAS_IO_WAKEUP (1 << 0) 34#define PRM_HAS_IO_WAKEUP BIT(0)
34#define PRM_HAS_VOLTAGE (1 << 1) 35#define PRM_HAS_VOLTAGE BIT(1)
36#define PRM_IRQ_DEFAULT BIT(2)
35 37
36/* 38/*
37 * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP 39 * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 243133c4bf0d..c35ad0bedf81 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -703,10 +703,14 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
703 .vp_clear_txdone = omap4_prm_vp_clear_txdone, 703 .vp_clear_txdone = omap4_prm_vp_clear_txdone,
704}; 704};
705 705
706static const struct omap_prcm_init_data *prm_init_data;
707
706int __init omap44xx_prm_init(const struct omap_prcm_init_data *data) 708int __init omap44xx_prm_init(const struct omap_prcm_init_data *data)
707{ 709{
708 omap_prm_base_init(); 710 omap_prm_base_init();
709 711
712 prm_init_data = data;
713
710 if (data->flags & PRM_HAS_IO_WAKEUP) 714 if (data->flags & PRM_HAS_IO_WAKEUP)
711 prm_features |= PRM_HAS_IO_WAKEUP; 715 prm_features |= PRM_HAS_IO_WAKEUP;
712 716
@@ -718,16 +722,8 @@ int __init omap44xx_prm_init(const struct omap_prcm_init_data *data)
718 return prm_register(&omap44xx_prm_ll_data); 722 return prm_register(&omap44xx_prm_ll_data);
719} 723}
720 724
721static const struct of_device_id omap_prm_dt_match_table[] = {
722 { .compatible = "ti,omap4-prm" },
723 { .compatible = "ti,omap5-prm" },
724 { .compatible = "ti,dra7-prm" },
725 { }
726};
727
728static int omap44xx_prm_late_init(void) 725static int omap44xx_prm_late_init(void)
729{ 726{
730 struct device_node *np;
731 int irq_num; 727 int irq_num;
732 728
733 if (!(prm_features & PRM_HAS_IO_WAKEUP)) 729 if (!(prm_features & PRM_HAS_IO_WAKEUP))
@@ -737,31 +733,23 @@ static int omap44xx_prm_late_init(void)
737 if (!of_have_populated_dt()) 733 if (!of_have_populated_dt())
738 return 0; 734 return 0;
739 735
740 np = of_find_matching_node(NULL, omap_prm_dt_match_table); 736 irq_num = of_irq_get(prm_init_data->np, 0);
741 737 /*
742 if (!np) { 738 * Already have OMAP4 IRQ num. For all other platforms, we need
743 /* Default loaded up with OMAP4 values */ 739 * IRQ numbers from DT
744 if (!cpu_is_omap44xx()) 740 */
745 return 0; 741 if (irq_num < 0 && !(prm_init_data->flags & PRM_IRQ_DEFAULT)) {
746 } else { 742 if (irq_num == -EPROBE_DEFER)
747 irq_num = of_irq_get(np, 0); 743 return irq_num;
748 /* 744
749 * Already have OMAP4 IRQ num. For all other platforms, we need 745 /* Have nothing to do */
750 * IRQ numbers from DT 746 return 0;
751 */ 747 }
752 if (irq_num < 0 && !cpu_is_omap44xx()) { 748
753 if (irq_num == -EPROBE_DEFER) 749 /* Once OMAP4 DT is filled as well */
754 return irq_num; 750 if (irq_num >= 0) {
755 751 omap4_prcm_irq_setup.irq = irq_num;
756 /* Have nothing to do */ 752 omap4_prcm_irq_setup.xlate_irq = NULL;
757 return 0;
758 }
759
760 /* Once OMAP4 DT is filled as well */
761 if (irq_num >= 0) {
762 omap4_prcm_irq_setup.irq = irq_num;
763 omap4_prcm_irq_setup.xlate_irq = NULL;
764 }
765 } 753 }
766 754
767 omap44xx_prm_enable_io_wakeup(); 755 omap44xx_prm_enable_io_wakeup();
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 04dfe8f844c9..6832a31e9a70 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -669,7 +669,7 @@ static struct omap_prcm_init_data omap4_prm_data __initdata = {
669 .index = TI_CLKM_PRM, 669 .index = TI_CLKM_PRM,
670 .init = omap44xx_prm_init, 670 .init = omap44xx_prm_init,
671 .device_inst_offset = OMAP4430_PRM_DEVICE_INST, 671 .device_inst_offset = OMAP4430_PRM_DEVICE_INST,
672 .flags = PRM_HAS_IO_WAKEUP | PRM_HAS_VOLTAGE, 672 .flags = PRM_HAS_IO_WAKEUP | PRM_HAS_VOLTAGE | PRM_IRQ_DEFAULT,
673}; 673};
674#endif 674#endif
675 675