aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhijit Pagare <abhijitpagare@ti.com>2010-01-26 22:12:51 -0500
committerPaul Walmsley <paul@pwsan.com>2010-01-26 22:12:51 -0500
commit3790300903e6a98ce5f5391f4d435959266f79e7 (patch)
treecd78bf9d180466df0cd5b2f0c5b5c46d6471a54e
parentc6a6e6e203ee9a34fa53f773272f21d48b4e3454 (diff)
ARM: OMAP4: PM: OMAP4 Power Domain Porting Related Clean-up.
Module offsets were same for OMAP2 and OMAP3 while they differ for OMAP4. Hence we need different macros for identifying platform specific offsets. Signed-off-by: Abhijit Pagare <abhijitpagare@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Benoit Cousson <b-cousson@ti.com> Cc: Rajendra Nayak <rnayak@ti.com>
-rw-r--r--arch/arm/mach-omap2/clockdomain.c4
-rw-r--r--arch/arm/mach-omap2/pm-debug.c14
-rw-r--r--arch/arm/mach-omap2/pm24xx.c5
-rw-r--r--arch/arm/mach-omap2/pm34xx.c24
-rw-r--r--arch/arm/mach-omap2/powerdomain.c22
-rw-r--r--arch/arm/mach-omap2/prcm-common.h9
-rw-r--r--arch/arm/mach-omap2/prcm.c17
-rw-r--r--arch/arm/mach-omap2/prm.h17
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S2
9 files changed, 71 insertions, 43 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index dd285f001467..50c8cd7c7126 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -413,7 +413,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
413 if (cpu_is_omap24xx()) { 413 if (cpu_is_omap24xx()) {
414 414
415 cm_set_mod_reg_bits(OMAP24XX_FORCESTATE, 415 cm_set_mod_reg_bits(OMAP24XX_FORCESTATE,
416 clkdm->pwrdm.ptr->prcm_offs, PM_PWSTCTRL); 416 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
417 417
418 } else if (cpu_is_omap34xx()) { 418 } else if (cpu_is_omap34xx()) {
419 419
@@ -455,7 +455,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
455 if (cpu_is_omap24xx()) { 455 if (cpu_is_omap24xx()) {
456 456
457 cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE, 457 cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE,
458 clkdm->pwrdm.ptr->prcm_offs, PM_PWSTCTRL); 458 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
459 459
460 } else if (cpu_is_omap34xx()) { 460 } else if (cpu_is_omap34xx()) {
461 461
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index a0866268aa41..03dc845c82cb 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -68,8 +68,8 @@ void omap2_pm_dump(int mode, int resume, unsigned int us)
68 /* MPU */ 68 /* MPU */
69 DUMP_PRM_MOD_REG(OCP_MOD, OMAP2_PRM_IRQENABLE_MPU_OFFSET); 69 DUMP_PRM_MOD_REG(OCP_MOD, OMAP2_PRM_IRQENABLE_MPU_OFFSET);
70 DUMP_CM_MOD_REG(MPU_MOD, CM_CLKSTCTRL); 70 DUMP_CM_MOD_REG(MPU_MOD, CM_CLKSTCTRL);
71 DUMP_PRM_MOD_REG(MPU_MOD, PM_PWSTCTRL); 71 DUMP_PRM_MOD_REG(MPU_MOD, OMAP2_PM_PWSTCTRL);
72 DUMP_PRM_MOD_REG(MPU_MOD, PM_PWSTST); 72 DUMP_PRM_MOD_REG(MPU_MOD, OMAP2_PM_PWSTST);
73 DUMP_PRM_MOD_REG(MPU_MOD, PM_WKDEP); 73 DUMP_PRM_MOD_REG(MPU_MOD, PM_WKDEP);
74#endif 74#endif
75#if 0 75#if 0
@@ -93,7 +93,7 @@ void omap2_pm_dump(int mode, int resume, unsigned int us)
93 DUMP_CM_MOD_REG(WKUP_MOD, CM_ICLKEN); 93 DUMP_CM_MOD_REG(WKUP_MOD, CM_ICLKEN);
94 DUMP_CM_MOD_REG(PLL_MOD, CM_CLKEN); 94 DUMP_CM_MOD_REG(PLL_MOD, CM_CLKEN);
95 DUMP_CM_MOD_REG(PLL_MOD, CM_AUTOIDLE); 95 DUMP_CM_MOD_REG(PLL_MOD, CM_AUTOIDLE);
96 DUMP_PRM_MOD_REG(CORE_MOD, PM_PWSTST); 96 DUMP_PRM_MOD_REG(CORE_MOD, OMAP2_PM_PWSTST);
97#endif 97#endif
98#if 0 98#if 0
99 /* DSP */ 99 /* DSP */
@@ -104,10 +104,10 @@ void omap2_pm_dump(int mode, int resume, unsigned int us)
104 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_AUTOIDLE); 104 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_AUTOIDLE);
105 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSEL); 105 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSEL);
106 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSTCTRL); 106 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSTCTRL);
107 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, RM_RSTCTRL); 107 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_RM_RSTCTRL);
108 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, RM_RSTST); 108 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_RM_RSTST);
109 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, PM_PWSTCTRL); 109 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_PM_PWSTCTRL);
110 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, PM_PWSTST); 110 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_PM_PWSTST);
111 } 111 }
112#endif 112#endif
113 } else { 113 } else {
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index cba05b9f041f..754381857cb6 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -219,11 +219,12 @@ static void omap2_enter_mpu_retention(void)
219 /* Try to enter MPU retention */ 219 /* Try to enter MPU retention */
220 prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) | 220 prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) |
221 OMAP_LOGICRETSTATE, 221 OMAP_LOGICRETSTATE,
222 MPU_MOD, PM_PWSTCTRL); 222 MPU_MOD, OMAP2_PM_PWSTCTRL);
223 } else { 223 } else {
224 /* Block MPU retention */ 224 /* Block MPU retention */
225 225
226 prm_write_mod_reg(OMAP_LOGICRETSTATE, MPU_MOD, PM_PWSTCTRL); 226 prm_write_mod_reg(OMAP_LOGICRETSTATE, MPU_MOD,
227 OMAP2_PM_PWSTCTRL);
227 only_idle = 1; 228 only_idle = 1;
228 } 229 }
229 230
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 910a7acf542d..f841a6e33611 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -685,7 +685,7 @@ static void __init omap3_iva_idle(void)
685 prm_write_mod_reg(OMAP3430_RST1_IVA2 | 685 prm_write_mod_reg(OMAP3430_RST1_IVA2 |
686 OMAP3430_RST2_IVA2 | 686 OMAP3430_RST2_IVA2 |
687 OMAP3430_RST3_IVA2, 687 OMAP3430_RST3_IVA2,
688 OMAP3430_IVA2_MOD, RM_RSTCTRL); 688 OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
689 689
690 /* Enable IVA2 clock */ 690 /* Enable IVA2 clock */
691 cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2, 691 cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2,
@@ -696,7 +696,7 @@ static void __init omap3_iva_idle(void)
696 OMAP343X_CONTROL_IVA2_BOOTMOD); 696 OMAP343X_CONTROL_IVA2_BOOTMOD);
697 697
698 /* Un-reset IVA2 */ 698 /* Un-reset IVA2 */
699 prm_write_mod_reg(0, OMAP3430_IVA2_MOD, RM_RSTCTRL); 699 prm_write_mod_reg(0, OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
700 700
701 /* Disable IVA2 clock */ 701 /* Disable IVA2 clock */
702 cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN); 702 cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN);
@@ -705,7 +705,7 @@ static void __init omap3_iva_idle(void)
705 prm_write_mod_reg(OMAP3430_RST1_IVA2 | 705 prm_write_mod_reg(OMAP3430_RST1_IVA2 |
706 OMAP3430_RST2_IVA2 | 706 OMAP3430_RST2_IVA2 |
707 OMAP3430_RST3_IVA2, 707 OMAP3430_RST3_IVA2,
708 OMAP3430_IVA2_MOD, RM_RSTCTRL); 708 OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
709} 709}
710 710
711static void __init omap3_d2d_idle(void) 711static void __init omap3_d2d_idle(void)
@@ -728,8 +728,8 @@ static void __init omap3_d2d_idle(void)
728 /* reset modem */ 728 /* reset modem */
729 prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON | 729 prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON |
730 OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST, 730 OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST,
731 CORE_MOD, RM_RSTCTRL); 731 CORE_MOD, OMAP2_RM_RSTCTRL);
732 prm_write_mod_reg(0, CORE_MOD, RM_RSTCTRL); 732 prm_write_mod_reg(0, CORE_MOD, OMAP2_RM_RSTCTRL);
733} 733}
734 734
735static void __init prcm_setup_regs(void) 735static void __init prcm_setup_regs(void)
@@ -916,13 +916,13 @@ static void __init prcm_setup_regs(void)
916 prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL); 916 prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
917 917
918 /* Clear any pending 'reset' flags */ 918 /* Clear any pending 'reset' flags */
919 prm_write_mod_reg(0xffffffff, MPU_MOD, RM_RSTST); 919 prm_write_mod_reg(0xffffffff, MPU_MOD, OMAP2_RM_RSTST);
920 prm_write_mod_reg(0xffffffff, CORE_MOD, RM_RSTST); 920 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP2_RM_RSTST);
921 prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, RM_RSTST); 921 prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, OMAP2_RM_RSTST);
922 prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, RM_RSTST); 922 prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, OMAP2_RM_RSTST);
923 prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, RM_RSTST); 923 prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, OMAP2_RM_RSTST);
924 prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, RM_RSTST); 924 prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, OMAP2_RM_RSTST);
925 prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, RM_RSTST); 925 prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, OMAP2_RM_RSTST);
926 926
927 /* Clear any pending PRCM interrupts */ 927 /* Clear any pending PRCM interrupts */
928 prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 928 prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 26b3f3ee82a3..e503050dda06 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -710,7 +710,7 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
710 710
711 prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, 711 prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
712 (pwrst << OMAP_POWERSTATE_SHIFT), 712 (pwrst << OMAP_POWERSTATE_SHIFT),
713 pwrdm->prcm_offs, PM_PWSTCTRL); 713 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
714 714
715 return 0; 715 return 0;
716} 716}
@@ -728,7 +728,7 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
728 if (!pwrdm) 728 if (!pwrdm)
729 return -EINVAL; 729 return -EINVAL;
730 730
731 return prm_read_mod_bits_shift(pwrdm->prcm_offs, PM_PWSTCTRL, 731 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL,
732 OMAP_POWERSTATE_MASK); 732 OMAP_POWERSTATE_MASK);
733} 733}
734 734
@@ -745,7 +745,7 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
745 if (!pwrdm) 745 if (!pwrdm)
746 return -EINVAL; 746 return -EINVAL;
747 747
748 return prm_read_mod_bits_shift(pwrdm->prcm_offs, PM_PWSTST, 748 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST,
749 OMAP_POWERSTATEST_MASK); 749 OMAP_POWERSTATEST_MASK);
750} 750}
751 751
@@ -796,7 +796,7 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
796 */ 796 */
797 prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE, 797 prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE,
798 (pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE)), 798 (pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE)),
799 pwrdm->prcm_offs, PM_PWSTCTRL); 799 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
800 800
801 return 0; 801 return 0;
802} 802}
@@ -856,7 +856,7 @@ int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
856 } 856 }
857 857
858 prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), 858 prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)),
859 pwrdm->prcm_offs, PM_PWSTCTRL); 859 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
860 860
861 return 0; 861 return 0;
862} 862}
@@ -917,7 +917,7 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
917 } 917 }
918 918
919 prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs, 919 prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
920 PM_PWSTCTRL); 920 OMAP2_PM_PWSTCTRL);
921 921
922 return 0; 922 return 0;
923} 923}
@@ -936,7 +936,7 @@ int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
936 if (!pwrdm) 936 if (!pwrdm)
937 return -EINVAL; 937 return -EINVAL;
938 938
939 return prm_read_mod_bits_shift(pwrdm->prcm_offs, PM_PWSTST, 939 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST,
940 OMAP3430_LOGICSTATEST); 940 OMAP3430_LOGICSTATEST);
941} 941}
942 942
@@ -1010,7 +1010,7 @@ int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
1010 return -EEXIST; 1010 return -EEXIST;
1011 } 1011 }
1012 1012
1013 return prm_read_mod_bits_shift(pwrdm->prcm_offs, PM_PWSTST, m); 1013 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST, m);
1014} 1014}
1015 1015
1016/** 1016/**
@@ -1114,7 +1114,7 @@ int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
1114 pwrdm->name); 1114 pwrdm->name);
1115 1115
1116 prm_rmw_mod_reg_bits(0, 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, 1116 prm_rmw_mod_reg_bits(0, 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
1117 pwrdm->prcm_offs, PM_PWSTCTRL); 1117 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
1118 1118
1119 return 0; 1119 return 0;
1120} 1120}
@@ -1142,7 +1142,7 @@ int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
1142 pwrdm->name); 1142 pwrdm->name);
1143 1143
1144 prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, 0, 1144 prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, 0,
1145 pwrdm->prcm_offs, PM_PWSTCTRL); 1145 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
1146 1146
1147 return 0; 1147 return 0;
1148} 1148}
@@ -1183,7 +1183,7 @@ int pwrdm_wait_transition(struct powerdomain *pwrdm)
1183 */ 1183 */
1184 1184
1185 /* XXX Is this udelay() value meaningful? */ 1185 /* XXX Is this udelay() value meaningful? */
1186 while ((prm_read_mod_reg(pwrdm->prcm_offs, PM_PWSTST) & 1186 while ((prm_read_mod_reg(pwrdm->prcm_offs, OMAP2_PM_PWSTST) &
1187 OMAP_INTRANSITION) && 1187 OMAP_INTRANSITION) &&
1188 (c++ < PWRDM_TRANSITION_BAILOUT)) 1188 (c++ < PWRDM_TRANSITION_BAILOUT))
1189 udelay(1); 1189 udelay(1);
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 61ac2a418bd0..90f603d434c6 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -119,6 +119,15 @@
119#define OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD 0x0400 119#define OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD 0x0400
120#define OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD 0x0800 120#define OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD 0x0800
121 121
122/* Base Addresses for the OMAP4 */
123
124#define OMAP4430_CM1_BASE 0x4a004000
125#define OMAP4430_CM2_BASE 0x4a008000
126#define OMAP4430_PRM_BASE 0x4a306000
127#define OMAP4430_SCRM_BASE 0x4a30a000
128#define OMAP4430_CHIRONSS_BASE 0x48243000
129
130
122/* 24XX register bits shared between CM & PRM registers */ 131/* 24XX register bits shared between CM & PRM registers */
123 132
124/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ 133/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index cf466ea1dffc..b4ba14974b37 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -11,6 +11,7 @@
11 * Rajendra Nayak <rnayak@ti.com> 11 * Rajendra Nayak <rnayak@ti.com>
12 * 12 *
13 * Some pieces of code Copyright (C) 2005 Texas Instruments, Inc. 13 * Some pieces of code Copyright (C) 2005 Texas Instruments, Inc.
14 * Upgraded with OMAP4 support by Abhijit Pagare <abhijitpagare@ti.com>
14 * 15 *
15 * This program is free software; you can redistribute it and/or modify 16 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as 17 * it under the terms of the GNU General Public License version 2 as
@@ -121,7 +122,10 @@ struct omap3_prcm_regs prcm_context;
121u32 omap_prcm_get_reset_sources(void) 122u32 omap_prcm_get_reset_sources(void)
122{ 123{
123 /* XXX This presumably needs modification for 34XX */ 124 /* XXX This presumably needs modification for 34XX */
124 return prm_read_mod_reg(WKUP_MOD, RM_RSTST) & 0x7f; 125 if (cpu_is_omap24xx() | cpu_is_omap34xx())
126 return prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f;
127 if (cpu_is_omap44xx())
128 return prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f;
125} 129}
126EXPORT_SYMBOL(omap_prcm_get_reset_sources); 130EXPORT_SYMBOL(omap_prcm_get_reset_sources);
127 131
@@ -144,10 +148,17 @@ void omap_prcm_arch_reset(char mode)
144 * cf. OMAP34xx TRM, Initialization / Software Booting 148 * cf. OMAP34xx TRM, Initialization / Software Booting
145 * Configuration. */ 149 * Configuration. */
146 omap_writel(l, OMAP343X_SCRATCHPAD + 4); 150 omap_writel(l, OMAP343X_SCRATCHPAD + 4);
147 } else 151 } else if (cpu_is_omap44xx())
152 prcm_offs = OMAP4430_PRM_DEVICE_MOD;
153 else
148 WARN_ON(1); 154 WARN_ON(1);
149 155
150 prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL); 156 if (cpu_is_omap24xx() | cpu_is_omap34xx())
157 prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs,
158 OMAP2_RM_RSTCTRL);
159 if (cpu_is_omap44xx())
160 prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs,
161 OMAP4_RM_RSTCTRL);
151} 162}
152 163
153static inline u32 __omap_prcm_read(void __iomem *base, s16 module, u16 reg) 164static inline u32 __omap_prcm_read(void __iomem *base, s16 module, u16 reg)
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 40f006285163..5fba2aa8932c 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -179,9 +179,11 @@
179 179
180/* Registers appearing on both 24xx and 34xx */ 180/* Registers appearing on both 24xx and 34xx */
181 181
182#define RM_RSTCTRL 0x0050 182#define OMAP2_RM_RSTCTRL 0x0050
183#define RM_RSTTIME 0x0054 183#define OMAP2_RM_RSTTIME 0x0054
184#define RM_RSTST 0x0058 184#define OMAP2_RM_RSTST 0x0058
185#define OMAP2_PM_PWSTCTRL 0x00e0
186#define OMAP2_PM_PWSTST 0x00e4
185 187
186#define PM_WKEN 0x00a0 188#define PM_WKEN 0x00a0
187#define PM_WKEN1 PM_WKEN 189#define PM_WKEN1 PM_WKEN
@@ -191,8 +193,6 @@
191#define PM_EVGENCTRL 0x00d4 193#define PM_EVGENCTRL 0x00d4
192#define PM_EVGENONTIM 0x00d8 194#define PM_EVGENONTIM 0x00d8
193#define PM_EVGENOFFTIM 0x00dc 195#define PM_EVGENOFFTIM 0x00dc
194#define PM_PWSTCTRL 0x00e0
195#define PM_PWSTST 0x00e4
196 196
197/* Omap2 specific registers */ 197/* Omap2 specific registers */
198#define OMAP24XX_PM_WKEN2 0x00a4 198#define OMAP24XX_PM_WKEN2 0x00a4
@@ -220,6 +220,13 @@
220#define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8 220#define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8
221#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc 221#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc
222 222
223/* Omap4 specific registers */
224#define OMAP4_RM_RSTCTRL 0x0000
225#define OMAP4_RM_RSTTIME 0x0004
226#define OMAP4_RM_RSTST 0x0008
227#define OMAP4_PM_PWSTCTRL 0x0000
228#define OMAP4_PM_PWSTST 0x0004
229
223 230
224#ifndef __ASSEMBLER__ 231#ifndef __ASSEMBLER__
225 232
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index c3626ea48143..22fcc14e63be 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -38,7 +38,7 @@
38#define PM_PREPWSTST_CORE_P 0x48306AE8 38#define PM_PREPWSTST_CORE_P 0x48306AE8
39#define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \ 39#define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \
40 OMAP3430_PM_PREPWSTST) 40 OMAP3430_PM_PREPWSTST)
41#define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + PM_PWSTCTRL 41#define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL
42#define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1) 42#define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1)
43#define SRAM_BASE_P 0x40200000 43#define SRAM_BASE_P 0x40200000
44#define CONTROL_STAT 0x480022F0 44#define CONTROL_STAT 0x480022F0