Skip to contentSkip to conversation

sh: Use RSMEM for sh7724 sleep modes

PATCH New Magnus Damm 1 participant 1 message Oct 14, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 2/7 sh: Use RSMEM for sh7724 sleep modes

From: Magnus Damm <[email protected]>

Store sleep code in RSMEM on sh7724.

---

 arch/sh/kernel/cpu/shmobile/pm.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
arch/sh/kernel/cpu/shmobile/pm.c +9 -5
@@ -34,18 +34,22 @@
  * U-standby mode is low priority since it needs bootloader hacks
  */
 
-#define ILRAM_BASE 0xe5200000
+#ifdef CONFIG_CPU_SUBTYPE_SH7724
+#define RAM_BASE 0xfd800000 /* RSMEM */
+#else
+#define RAM_BASE 0xe5200000 /* ILRAM */
+#endif
 
 extern const unsigned char sh_mobile_standby[];
 extern const unsigned int sh_mobile_standby_size;
 
 void sh_mobile_call_standby(unsigned long mode)
 {
-	void *onchip_mem = (void *)ILRAM_BASE;
+	void *onchip_mem = (void *)RAM_BASE;
 	void (*standby_onchip_mem)(unsigned long, unsigned long) = onchip_mem;
 
 	/* Let assembly snippet in on-chip memory handle the rest */
-	standby_onchip_mem(mode, ILRAM_BASE);
+	standby_onchip_mem(mode, RAM_BASE);
 }
 
 static int sh_pm_enter(suspend_state_t state)
@@ -65,9 +69,9 @@ static struct platform_suspend_ops sh_pm
 
 static int __init sh_pm_init(void)
 {
-	void *onchip_mem = (void *)ILRAM_BASE;
+	void *onchip_mem = (void *)RAM_BASE;
 
-	/* Copy the assembly snippet to the otherwise ununsed ILRAM */
+	/* Copy the assembly snippet to the otherwise ununsed on-chip RAM */
 	memcpy(onchip_mem, sh_mobile_standby, sh_mobile_standby_size);
 	wmb();
 	ctrl_barrier();