Skip to contentSkip to conversation

Core Standby Mode and caches

PATCH New Bastian Hecht 3 participants 5 messages Mar 4, 2013 – Mar 19, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Core Standby Mode and caches

Hello,

here a patch that adds Core Standby Mode.
The code as it is works fine, but still I've got a question:

The datasheet of the r8a7740 states that caches are kept in a standby state. Still I have to issue a outer_flush_all() to flush the L2 before sleeping. If I don't do it the SoC hangs or sometimes jumps to the boot code Booting Linux on physical CPU 0x0...

Do we have an explanation for that? Do we want one? Do we need one?

Further this is the dozenth incarnation of v7_invalidate_l1. I don't want to compile in headsmp.S as this is a uniprocessor system. On the other hand I'm a bit reluctant to be the one moving it into the general ARM code base - doing something wrong there would raise eternal hatred of many people.

The patch is based on topic/all+next (a9043db17d02119bcda8a33414e7526961a7cee5)

Cheers,

Bastian

Bastian Hecht (1):
ARM: shmobile: r8a7740: Add CPU Core Standby Mode

 arch/arm/mach-shmobile/Makefile              |    2 +-
 arch/arm/mach-shmobile/include/mach/common.h |    1 +
 arch/arm/mach-shmobile/pm-r8a7740.c          |   63 +++++++++++++++++++++-
 arch/arm/mach-shmobile/sleep-r8a7740.S       |   75 ++++++++++++++++++++++++++
 4 files changed, 138 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-shmobile/sleep-r8a7740.S
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 ARM: shmobile: r8a7740: Add CPU Core Standby Mode

In system CPU core standby mode, the cache in the system CPU enters RAM standby state and the power supply to the system CPU logic is turned off. The on-chip peripheral modules in the system block continue to operate in sleep mode.

We use this mode as the suspend-to-memory mechanism.

---
 arch/arm/mach-shmobile/Makefile              |    2 +-
 arch/arm/mach-shmobile/include/mach/common.h |    1 +
 arch/arm/mach-shmobile/pm-r8a7740.c          |   63 ++++++++++++++++++-
 arch/arm/mach-shmobile/sleep-r8a7740.S       |   83 ++++++++++++++++++++++++++
 4 files changed, 146 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-shmobile/sleep-r8a7740.S
arch/arm/mach-shmobile/Makefile +1 -1
index c621edf..1206a6d 100644
@@ -27,7 +27,7 @@ obj-$(CONFIG_SUSPEND)		+= suspend.o
 obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
 obj-$(CONFIG_ARCH_SHMOBILE)	+= pm-rmobile.o
 obj-$(CONFIG_ARCH_SH7372)	+= pm-sh7372.o sleep-sh7372.o
-obj-$(CONFIG_ARCH_R8A7740)	+= pm-r8a7740.o
+obj-$(CONFIG_ARCH_R8A7740)	+= pm-r8a7740.o sleep-r8a7740.o
 obj-$(CONFIG_ARCH_R8A7779)	+= pm-r8a7779.o
 obj-$(CONFIG_ARCH_SH73A0)	+= pm-sh73a0.o
 
arch/arm/mach-shmobile/include/mach/common.h +1 -0
index c401c8d..b8960a2 100644
@@ -57,6 +57,7 @@ extern void r8a7740_add_standard_devices(void);
 extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
+extern void r8a7740_resume_core_standby(void);
 
 extern void r8a7779_init_delay(void);
 extern void r8a7779_init_irq(void);
arch/arm/mach-shmobile/pm-r8a7740.c +61 -2

85 lines not on this page · raw message

arch/arm/mach-shmobile/sleep-r8a7740.S new file +83 -0

83 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/1 ARM: shmobile: r8a7740: Add CPU Core Standby Mode

arch/arm/mach-shmobile/pm-r8a7740.c line 13

Quoted 9 lines · Bastian Hecht
arch/arm/mach-shmobile/pm-r8a7740.c +1 -0
index 40b87aa..ee3d713 100644
@@ -10,9 +10,29 @@
  */
 #include <linux/console.h>
 #include <linux/suspend.h>
+#include <asm/io.h>

It's spelled linux/io.h, not asm/io.h

#3 lore raw

PATCH 1/1 ARM: shmobile: r8a7740: Add CPU Core Standby Mode

Quoted 12 lines · Russell King - ARM Linux

arch/arm/mach-shmobile/pm-r8a7740.c line 13

Quoted 9 lines · Bastian Hecht
arch/arm/mach-shmobile/pm-r8a7740.c +1 -0
index 40b87aa..ee3d713 100644
@@ -10,9 +10,29 @@
  */
 #include <linux/console.h>
 #include <linux/suspend.h>
+#include <asm/io.h>

It's spelled linux/io.h, not asm/io.h

Bastian, other than the requested change above, what is the status of this patch?

Also, please CC me on shmobile patches.

#4 lore raw

PATCH 1/1 ARM: shmobile: r8a7740: Add CPU Core Standby Mode

Hello!

2013/3/19 Simon Horman <[email protected]>:

Quoted 14 lines · Russell King - ARM Linux
Quoted 12 lines · Bastian Hecht

arch/arm/mach-shmobile/pm-r8a7740.c line 13

Quoted 9 lines
arch/arm/mach-shmobile/pm-r8a7740.c +1 -0
index 40b87aa..ee3d713 100644
@@ -10,9 +10,29 @@
  */
 #include <linux/console.h>
 #include <linux/suspend.h>
+#include <asm/io.h>

It's spelled linux/io.h, not asm/io.h

Quoted 2 lines

Bastian, other than the requested change above, what is the status of this patch?

Yep thanks Russell, will fix it in upcoming versions.

Simon, I'm still tinkering with the L2 - it shouldn't be needed to be flushed, but I found out that at some point it gets disabled (ROM boot loader?). Further I've got additional sleep modes ready. I will post a v2 when the L2 issue is clear. Maybe early next week.

Thanks,

Bastian

Quoted 1 line

Also, please CC me on shmobile patches.