diff options
Diffstat (limited to 'arch/arm/mach-omap2/prm44xx.c')
-rw-r--r-- | arch/arm/mach-omap2/prm44xx.c | 70 |
1 files changed, 32 insertions, 38 deletions
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index d6d6bc39e05c..4541700f743a 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c | |||
@@ -138,7 +138,7 @@ static struct omap4_vp omap4_vp[] = { | |||
138 | }, | 138 | }, |
139 | }; | 139 | }; |
140 | 140 | ||
141 | u32 omap4_prm_vp_check_txdone(u8 vp_id) | 141 | static u32 omap4_prm_vp_check_txdone(u8 vp_id) |
142 | { | 142 | { |
143 | struct omap4_vp *vp = &omap4_vp[vp_id]; | 143 | struct omap4_vp *vp = &omap4_vp[vp_id]; |
144 | u32 irqstatus; | 144 | u32 irqstatus; |
@@ -149,7 +149,7 @@ u32 omap4_prm_vp_check_txdone(u8 vp_id) | |||
149 | return irqstatus & vp->tranxdone_status; | 149 | return irqstatus & vp->tranxdone_status; |
150 | } | 150 | } |
151 | 151 | ||
152 | void omap4_prm_vp_clear_txdone(u8 vp_id) | 152 | static void omap4_prm_vp_clear_txdone(u8 vp_id) |
153 | { | 153 | { |
154 | struct omap4_vp *vp = &omap4_vp[vp_id]; | 154 | struct omap4_vp *vp = &omap4_vp[vp_id]; |
155 | 155 | ||
@@ -699,29 +699,31 @@ static struct prm_ll_data omap44xx_prm_ll_data = { | |||
699 | .deassert_hardreset = omap4_prminst_deassert_hardreset, | 699 | .deassert_hardreset = omap4_prminst_deassert_hardreset, |
700 | .is_hardreset_asserted = omap4_prminst_is_hardreset_asserted, | 700 | .is_hardreset_asserted = omap4_prminst_is_hardreset_asserted, |
701 | .reset_system = omap4_prminst_global_warm_sw_reset, | 701 | .reset_system = omap4_prminst_global_warm_sw_reset, |
702 | .vp_check_txdone = omap4_prm_vp_check_txdone, | ||
703 | .vp_clear_txdone = omap4_prm_vp_clear_txdone, | ||
702 | }; | 704 | }; |
703 | 705 | ||
704 | int __init omap44xx_prm_init(void) | 706 | static const struct omap_prcm_init_data *prm_init_data; |
707 | |||
708 | int __init omap44xx_prm_init(const struct omap_prcm_init_data *data) | ||
705 | { | 709 | { |
706 | if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) | 710 | omap_prm_base_init(); |
711 | |||
712 | prm_init_data = data; | ||
713 | |||
714 | if (data->flags & PRM_HAS_IO_WAKEUP) | ||
707 | prm_features |= PRM_HAS_IO_WAKEUP; | 715 | prm_features |= PRM_HAS_IO_WAKEUP; |
708 | 716 | ||
709 | if (!soc_is_dra7xx()) | 717 | if (data->flags & PRM_HAS_VOLTAGE) |
710 | prm_features |= PRM_HAS_VOLTAGE; | 718 | prm_features |= PRM_HAS_VOLTAGE; |
711 | 719 | ||
720 | omap4_prminst_set_prm_dev_inst(data->device_inst_offset); | ||
721 | |||
712 | return prm_register(&omap44xx_prm_ll_data); | 722 | return prm_register(&omap44xx_prm_ll_data); |
713 | } | 723 | } |
714 | 724 | ||
715 | static const struct of_device_id omap_prm_dt_match_table[] = { | ||
716 | { .compatible = "ti,omap4-prm" }, | ||
717 | { .compatible = "ti,omap5-prm" }, | ||
718 | { .compatible = "ti,dra7-prm" }, | ||
719 | { } | ||
720 | }; | ||
721 | |||
722 | static int omap44xx_prm_late_init(void) | 725 | static int omap44xx_prm_late_init(void) |
723 | { | 726 | { |
724 | struct device_node *np; | ||
725 | int irq_num; | 727 | int irq_num; |
726 | 728 | ||
727 | if (!(prm_features & PRM_HAS_IO_WAKEUP)) | 729 | if (!(prm_features & PRM_HAS_IO_WAKEUP)) |
@@ -731,31 +733,23 @@ static int omap44xx_prm_late_init(void) | |||
731 | if (!of_have_populated_dt()) | 733 | if (!of_have_populated_dt()) |
732 | return 0; | 734 | return 0; |
733 | 735 | ||
734 | np = of_find_matching_node(NULL, omap_prm_dt_match_table); | 736 | irq_num = of_irq_get(prm_init_data->np, 0); |
735 | 737 | /* | |
736 | if (!np) { | 738 | * Already have OMAP4 IRQ num. For all other platforms, we need |
737 | /* Default loaded up with OMAP4 values */ | 739 | * IRQ numbers from DT |
738 | if (!cpu_is_omap44xx()) | 740 | */ |
739 | return 0; | 741 | if (irq_num < 0 && !(prm_init_data->flags & PRM_IRQ_DEFAULT)) { |
740 | } else { | 742 | if (irq_num == -EPROBE_DEFER) |
741 | irq_num = of_irq_get(np, 0); | 743 | return irq_num; |
742 | /* | 744 | |
743 | * Already have OMAP4 IRQ num. For all other platforms, we need | 745 | /* Have nothing to do */ |
744 | * IRQ numbers from DT | 746 | return 0; |
745 | */ | 747 | } |
746 | if (irq_num < 0 && !cpu_is_omap44xx()) { | 748 | |
747 | if (irq_num == -EPROBE_DEFER) | 749 | /* Once OMAP4 DT is filled as well */ |
748 | return irq_num; | 750 | if (irq_num >= 0) { |
749 | 751 | omap4_prcm_irq_setup.irq = irq_num; | |
750 | /* Have nothing to do */ | 752 | omap4_prcm_irq_setup.xlate_irq = NULL; |
751 | return 0; | ||
752 | } | ||
753 | |||
754 | /* Once OMAP4 DT is filled as well */ | ||
755 | if (irq_num >= 0) { | ||
756 | omap4_prcm_irq_setup.irq = irq_num; | ||
757 | omap4_prcm_irq_setup.xlate_irq = NULL; | ||
758 | } | ||
759 | } | 753 | } |
760 | 754 | ||
761 | omap44xx_prm_enable_io_wakeup(); | 755 | omap44xx_prm_enable_io_wakeup(); |