@@ -458,6 +458,15 @@ void __init omap2430_init_late(void)
* same machine_id for 34xx and 36xx beagle.. Will get fixed with DT.
*/
#ifdef CONFIG_ARCH_OMAP3
+static inline u16 omap3_prm_type(void)
+{
+ if (cpu_is_omap3430())
+ return PRM_OMAP3430;
+ if (cpu_is_omap3630())
+ return PRM_OMAP3630;
+ return PRM_OMAP3_OTHER;
+}
+
void __init omap3_init_early(void)
{
omap2_set_globals_tap(OMAP343X_CLASS, OMAP2_L4_IO_ADDRESS(0x4830A000));
@@ -469,7 +478,7 @@ void __init omap3_init_early(void)
omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE), NULL);
omap3xxx_check_revision();
omap3xxx_check_features();
- omap3xxx_prm_init();
+ omap3xxx_prm_init(omap3_prm_type());
omap3xxx_cm_init();
omap3xxx_voltagedomains_init();
omap3xxx_powerdomains_init();
@@ -636,7 +645,7 @@ void __init omap4430_init_early(void)
omap4xxx_check_revision();
omap4xxx_check_features();
omap4_pm_init_early();
- omap44xx_prm_init();
+ omap44xx_prm_init(PRM_OMAP4);
omap44xx_voltagedomains_init();
omap44xx_powerdomains_init();
omap44xx_clockdomains_init();
@@ -666,7 +675,7 @@ void __init omap5_init_early(void)
omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
omap_prm_base_init();
omap_cm_base_init();
- omap44xx_prm_init();
+ omap44xx_prm_init(PRM_OMAP5);
omap5xxx_check_revision();
omap54xx_voltagedomains_init();
omap54xx_powerdomains_init();
@@ -694,7 +703,7 @@ void __init dra7xx_init_early(void)
omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
omap_prm_base_init();
omap_cm_base_init();
- omap44xx_prm_init();
+ omap44xx_prm_init(PRM_DRA7);
dra7xx_powerdomains_init();
dra7xx_clockdomains_init();
dra7xx_hwmod_init();
@@ -30,6 +30,17 @@ int of_prcm_init(void);
*/
#define PRM_HAS_IO_WAKEUP (1 << 0)
+#ifndef __ASSEMBLER__
+enum {
+ PRM_OMAP3430 = 0,
+ PRM_OMAP3630,
+ PRM_OMAP3_OTHER,
+ PRM_OMAP4,
+ PRM_OMAP5,
+ PRM_DRA7,
+};
+#endif
+
/*
* MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP
* module to softreset
@@ -641,9 +641,9 @@ static struct prm_ll_data omap3xxx_prm_ll_data = {
.late_init = &omap3xxx_prm_late_init,
};
-int __init omap3xxx_prm_init(void)
+int __init omap3xxx_prm_init(u16 cpu_type)
{
- if (omap3_has_io_wakeup())
+ if (cpu_type == PRM_OMAP3430 || cpu_type == PRM_OMAP3630)
prm_features |= PRM_HAS_IO_WAKEUP;
return prm_register(&omap3xxx_prm_ll_data);
@@ -160,7 +160,7 @@ extern void omap3xxx_prm_restore_irqen(u32 *saved_mask);
extern void omap3xxx_prm_dpll3_reset(void);
-extern int __init omap3xxx_prm_init(void);
+int __init omap3xxx_prm_init(u16 cpu_type);
extern u32 omap3xxx_prm_get_reset_sources(void);
int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 ignore_bits);
void omap3xxx_prm_iva_idle(void);
@@ -662,9 +662,9 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
.late_init = &omap44xx_prm_late_init,
};
-int __init omap44xx_prm_init(void)
+int __init omap44xx_prm_init(u16 cpu_type)
{
- if (cpu_is_omap44xx())
+ if (cpu_type == PRM_OMAP4)
prm_features |= PRM_HAS_IO_WAKEUP;
return prm_register(&omap44xx_prm_ll_data);
@@ -57,7 +57,7 @@ extern void omap44xx_prm_ocp_barrier(void);
extern void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask);
extern void omap44xx_prm_restore_irqen(u32 *saved_mask);
-extern int __init omap44xx_prm_init(void);
+int __init omap44xx_prm_init(u16 cpu_type);
extern u32 omap44xx_prm_get_reset_sources(void);
#endif
This helps to get rid of cpu_is_X checks from within the PRM driver. Done in preparation to make PRM a separate driver. Signed-off-by: Tero Kristo <t-kristo@ti.com> --- arch/arm/mach-omap2/io.c | 17 +++++++++++++---- arch/arm/mach-omap2/prm.h | 11 +++++++++++ arch/arm/mach-omap2/prm3xxx.c | 4 ++-- arch/arm/mach-omap2/prm3xxx.h | 2 +- arch/arm/mach-omap2/prm44xx.c | 4 ++-- arch/arm/mach-omap2/prm44xx_54xx.h | 2 +- 6 files changed, 30 insertions(+), 10 deletions(-)