ARM: shmobile: sh73a0: Add CPU sleep suspend
Subsystems (5)
PATCH 1/2 ARM: shmobile: sh73a0: Add CPU sleep suspend
From: Bastian Hecht <[email protected]>
Add the lighest possible sleep mode on Cortex-A9 cores: CPU sleep. It is entered by a simple dsb and wfi instruction via cpu_do_idle(). As just clocks are stopped there is no need to save or restore any state of the system.
--- arch/arm/mach-shmobile/Makefile | 1 + arch/arm/mach-shmobile/board-kzm9g.c | 2 ++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/pm-sh73a0.c | 32 ++++++++++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 arch/arm/mach-shmobile/pm-sh73a0.c
arch/arm/mach-shmobile/Makefile +1 -0
@@ -43,6 +43,7 @@ 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_R8A7779) += pm-r8a7779.o +obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o # Board objects obj-$(CONFIG_MACH_G3EVM) += board-g3evm.o
arch/arm/mach-shmobile/board-kzm9g.c +2 -0
@@ -760,6 +760,8 @@ static void __init kzm_init(void)sh73a0_add_standard_devices ();platform_add_devices (kzm_devices,ARRAY_SIZE (kzm_devices)); + +sh73a0_pm_init (); }static void kzm9g_restart (char mode,const char *cmd)
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -54,6 +54,7 @@ extern void sh73a0_add_early_devices(void);extern void sh73a0_add_standard_devices (void );extern void sh73a0_clock_init (void );extern void sh73a0_pinmux_init (void ); +extern void sh73a0_pm_init (void );extern struct clk sh73a0_extal1_clk;extern struct clk sh73a0_extal2_clk;extern struct clk sh73a0_extcki_clk;
arch/arm/mach-shmobile/pm-sh73a0.c new file +32 -0
@@ -0,0 +1,32 @@ +/* +* sh73a0 Power management support +* +* Copyright (C) 2012 Bastian Hecht <[email protected]> +* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +*/ + +#include <linux/suspend.h> +#include <mach/common.h> + +#ifdef CONFIG_SUSPEND +static int sh73a0_enter_suspend (suspend_state_t suspend_state) +{ +cpu_do_idle (); +return 0 ; +} + +static void sh73a0_suspend_init (void ) +{ + shmobile_suspend_ops.enter = sh73a0_enter_suspend; +} +#else +static void sh73a0_suspend_init (void ) {} +#endif + +void __init sh73a0_pm_init (void ) +{ +sh73a0_suspend_init (); +}
Signature · 1 line
1.7.9.5
PATCH 2/2 ARM: shmobile: r8a7740: Add CPU sleep suspend
From: Bastian Hecht <[email protected]>
Add the lighest possible sleep mode on Cortex-A9 cores: CPU sleep. It is entered by a simple dsb and wfi instruction via cpu_do_idle(). As just clocks are stopped there is no need to save or restore any state of the system.
--- arch/arm/mach-shmobile/board-armadillo800eva.c | 2 ++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/pm-r8a7740.c | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+)
arch/arm/mach-shmobile/board-armadillo800eva.c +2 -0
@@ -1213,6 +1213,8 @@ static void __init eva_init(void)rmobile_add_device_to_domain ("A4LC" , &hdmi_lcdc_device);if (usb)rmobile_add_device_to_domain ("A3SP" , usb); + +r8a7740_pm_init (); }static void __init eva_earlytimer_init (void )
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -66,6 +66,7 @@ extern void r8a7740_add_early_devices(void);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 r8a7779_init_irq (void );extern void r8a7779_map_io (void );
arch/arm/mach-shmobile/pm-r8a7740.c +20 -0
@@ -58,3 +58,23 @@ void __init r8a7740_init_pm_domains(void) }#endif /* CONFIG_PM */ + +#ifdef CONFIG_SUSPEND +static int r8a7740_enter_suspend (suspend_state_t suspend_state) +{ +cpu_do_idle (); +return 0 ; +} + +static void r8a7740_suspend_init (void ) +{ + shmobile_suspend_ops.enter = r8a7740_enter_suspend; +} +#else +static void r8a7740_suspend_init (void ) {} +#endif + +void __init r8a7740_pm_init (void ) +{ +r8a7740_suspend_init (); +}
Signature · 1 line
1.7.9.5
Magnus Damm
maintainerPATCH 2/2 ARM: shmobile: r8a7740: Add CPU sleep suspend
Quoted 8 lines · Bastian Hecht
From: Bastian Hecht <[email protected]>
Add the lighest possible sleep mode on Cortex-A9 cores: CPU sleep. It is entered by a simple dsb and wfi instruction via
cpu_do_idle(). As just clocks are stopped there is no need to save or restore any state of the system.Signed-off-by Bastian Hecht <[email protected]>
PATCH 2/2 ARM: shmobile: r8a7740: Add TPU node to the device tree
In reply to Bastian Hecht--- arch/arm/boot/dts/r8a7740.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/boot/dts/r8a7740.dtsi +7 -0
@@ -147,4 +147,11 @@ gpio-controller; #gpio-cells = <2>; }; + + tpu: pwm@e6600000 { + compatible = "renesas,tpu-r8a7740", "renesas,tpu"; + reg = <0xe6600000 0x100>; + status = "disabled"; + #pwm-cells = <3>; + }; };
Signature · 1 line
1.8.1.5
Re: [PATCH 2/2] ARM: shmobile: r8a7740: Add TPU node to the device tree
In reply to Bastian HechtQuoted 11 lines · Laurent Pinchart
Signed-off-by Laurent Pinchart <[email protected]>--- arch/arm/boot/dts/r8a7740.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)arch/arm/boot/dts/r8a7740.dtsi +0
-0@@ -147,4 +147,11 @@ gpio-controller;
arch/arm/boot/dts/r8a7740.dtsi line 157
Quoted 10 lines
arch/arm/boot/dts/r8a7740.dtsi +7
-0#gpio-cells = <2>; }; + + tpu: pwm@e6600000 { + compatible = "renesas,tpu-r8a7740", "renesas,tpu"; + reg = <0xe6600000 0x100>; + status = "disabled"; + #pwm-cells = <3>; + }; };
Thanks, I will queue this up for v3.12 in the tpu-pwm branch.
Magnus Damm
maintainerPATCH 1/2 ARM: shmobile: sh73a0: Add CPU sleep suspend
In reply to Bastian HechtQuoted 8 lines · Bastian Hecht
From: Bastian Hecht <[email protected]>
Add the lighest possible sleep mode on Cortex-A9 cores: CPU sleep. It is entered by a simple dsb and wfi instruction via
cpu_do_idle(). As just clocks are stopped there is no need to save or restore any state of the system.Signed-off-by Bastian Hecht <[email protected]>
PATCH 1/2 ARM: shmobile: sh73a0: Add CPU sleep suspend
Quoted 11 lines · Magnus Damm
Quoted 8 lines · Bastian Hecht
From: Bastian Hecht <[email protected]>
Add the lighest possible sleep mode on Cortex-A9 cores: CPU sleep. It is entered by a simple dsb and wfi instruction via
cpu_do_idle(). As just clocks are stopped there is no need to save or restore any state of the system.Signed-off-by Bastian Hecht <[email protected]>Acked-by Magnus Damm <[email protected]>
Hi Bastian,
could you please re-spin this series on top of the soc5 or next branches of my renesas tree on kernel.org?
Feel free to include Magnus's Ack unless you make any non-trivial changes.
Thanks
PATCH 1/2 ARM: shmobile: sh73a0: Add CPU sleep suspend
Hi Simon
Quoted 13 lines · Simon Horman
Quoted 11 lines · Magnus Damm
Quoted 8 lines · Bastian Hecht
From: Bastian Hecht <[email protected]>
Add the lighest possible sleep mode on Cortex-A9 cores: CPU sleep. It is entered by a simple dsb and wfi instruction via
cpu_do_idle(). As just clocks are stopped there is no need to save or restore any state of the system.Signed-off-by Bastian Hecht <[email protected]>Acked-by Magnus Damm <[email protected]>
Quoted 7 lines
Hi Bastian,
could you please re-spin this series on top of the soc5 or next branches of my renesas tree on kernel.org?
Feel free to include Magnus's Ack unless you make any non-trivial changes.
It looks like this commit in your tree
is broken, am I right?
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
PATCH 1/2 ARM: shmobile: sh73a0: Add CPU sleep suspend
Hi Guennadi, hi Simon,
yes somehow a chunk is missing from my original patch in the patch of the next branch that got merged from soc2. I've prepared a revert of the bad patch and a corrected version, but now I'm unsure if that helps at all. Finally you don't want to get that fixups pulled into the mainline.
It seems to me to be a real mess to correct some patch somewhere in the middle of merged patch stacks. If I can help Simon, please let me know.
Cheers,
Bastian
2013/1/11 Guennadi Liakhovetski <[email protected]>:
Quoted 37 lines
Hi Simon
Quoted 13 lines · Simon Horman
Quoted 11 lines · Magnus Damm
Quoted 8 lines · Bastian Hecht
From: Bastian Hecht <[email protected]>
Add the lighest possible sleep mode on Cortex-A9 cores: CPU sleep. It is entered by a simple dsb and wfi instruction via
cpu_do_idle(). As just clocks are stopped there is no need to save or restore any state of the system.Signed-off-by Bastian Hecht <[email protected]>Acked-by Magnus Damm <[email protected]>Quoted 7 lines
Hi Bastian,
could you please re-spin this series on top of the soc5 or next branches of my renesas tree on kernel.org?
Feel free to include Magnus's Ack unless you make any non-trivial changes.
It looks like this commit in your tree
is broken, am I right?
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
PATCH 1/2 ARM: shmobile: sh73a0: Add CPU sleep suspend
Quoted 11 lines · Bastian Hecht
Hi Guennadi, hi Simon,
yes somehow a chunk is missing from my original patch in the patch of the next branch that got merged from soc2. I've prepared a revert of the bad patch and a corrected version, but now I'm unsure if that helps at all. Finally you don't want to get that fixups pulled into the mainline.
It seems to me to be a real mess to correct some patch somewhere in the middle of merged patch stacks. If I can help Simon, please let me know.
Could you see if the following is correct?
If not could you please prepare whichever of the following makes sense.
* An incremental patch to add the missing hunk
* A revert patch and a new patch
* A revert patch
Quoted 1 line
From
13baf88bd69ed3cf7e2374eec4a7128f62ae9c1fMon Sep 17 00:00:00 2001
From: Bastian Hecht <[email protected]>
Date: Wed, 5 Dec 2012 12:13:06 +0000
Subject: [PATCH] ARM: shmobile: sh73a0: Add CPU sleep suspend
Add the lighest possible sleep mode on Cortex-A9 cores: CPU sleep. It is entered by a simple dsb and wfi instruction via cpu_do_idle(). As just clocks are stopped there is no need to save or restore any state of the system.
--- arch/arm/mach-shmobile/Makefile | 1 + arch/arm/mach-shmobile/board-kzm9g.c | 2 ++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/pm-sh73a0.c | 32 ++++++++++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 arch/arm/mach-shmobile/pm-sh73a0.c
arch/arm/mach-shmobile/Makefile +1 -0
@@ -37,6 +37,7 @@ 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_R8A7779) += pm-r8a7779.o +obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o # Board objects obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o
arch/arm/mach-shmobile/board-kzm9g.c +2 -0
@@ -772,6 +772,8 @@ static void __init kzm_init(void)sh73a0_add_standard_devices ();platform_add_devices (kzm_devices,ARRAY_SIZE (kzm_devices)); + +sh73a0_pm_init (); }static void kzm9g_restart (char mode,const char *cmd)
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -40,6 +40,7 @@ extern void sh73a0_add_early_devices(void);extern void sh73a0_add_standard_devices (void );extern void sh73a0_clock_init (void );extern void sh73a0_pinmux_init (void ); +extern void sh73a0_pm_init (void );extern struct clk sh73a0_extal1_clk;extern struct clk sh73a0_extal2_clk;extern struct clk sh73a0_extcki_clk;
arch/arm/mach-shmobile/pm-sh73a0.c new file +32 -0
@@ -0,0 +1,32 @@ +/* +* sh73a0 Power management support +* +* Copyright (C) 2012 Bastian Hecht <[email protected]> +* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +*/ + +#include <linux/suspend.h> +#include <mach/common.h> + +#ifdef CONFIG_SUSPEND +static int sh73a0_enter_suspend (suspend_state_t suspend_state) +{ +cpu_do_idle (); +return 0 ; +} + +static void sh73a0_suspend_init (void ) +{ + shmobile_suspend_ops.enter = sh73a0_enter_suspend; +} +#else +static void sh73a0_suspend_init (void ) {} +#endif + +void __init sh73a0_pm_init (void ) +{ +sh73a0_suspend_init (); +}
Signature · 1 line
1.7.10.4
PATCH 1/2 ARM: shmobile: sh73a0: Add CPU sleep suspend
Looks perfect, thanks!
2013/1/30 Simon Horman <[email protected]>:
Quoted 124 lines · Bastian Hecht
Quoted 11 lines
Hi Guennadi, hi Simon,
yes somehow a chunk is missing from my original patch in the patch of the next branch that got merged from soc2. I've prepared a revert of the bad patch and a corrected version, but now I'm unsure if that helps at all. Finally you don't want to get that fixups pulled into the mainline.
It seems to me to be a real mess to correct some patch somewhere in the middle of merged patch stacks. If I can help Simon, please let me know.
Could you see if the following is correct?
If not could you please prepare whichever of the following makes sense.* An incremental patch to add the missing hunk
* A revert patch and a new patch
* A revert patch
From
13baf88bd69ed3cf7e2374eec4a7128f62ae9c1fMon Sep 17 00:00:00 2001
From: Bastian Hecht <[email protected]>
Date: Wed, 5 Dec 2012 12:13:06 +0000
Subject: [PATCH] ARM: shmobile: sh73a0: Add CPU sleep suspendAdd the lighest possible sleep mode on Cortex-A9 cores: CPU sleep. It is entered by a simple dsb and wfi instruction via
cpu_do_idle(). As just clocks are stopped there is no need to save or restore any state of the system.Signed-off-by Bastian Hecht <[email protected]>Acked-by Magnus Damm <[email protected]>Signed-off-by Simon Horman <[email protected]>--- arch/arm/mach-shmobile/Makefile | 1 + arch/arm/mach-shmobile/board-kzm9g.c | 2 ++ arch/arm/mach-shmobile/include/mach/common.h | 1 + arch/arm/mach-shmobile/pm-sh73a0.c | 32 ++++++++++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 arch/arm/mach-shmobile/pm-sh73a0.carch/arm/mach-shmobile/Makefile +1
-0@@ -37,6 +37,7 @@ 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_R8A7779) += pm-r8a7779.o +obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o # Board objects obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.oarch/arm/mach-shmobile/board-kzm9g.c +2
-0@@ -772,6 +772,8 @@ static void __init kzm_init(void)sh73a0_add_standard_devices ();platform_add_devices (kzm_devices,ARRAY_SIZE (kzm_devices)); + +sh73a0_pm_init (); }static void kzm9g_restart (char mode,const char *cmd)arch/arm/mach-shmobile/include/mach/common.h +1
-0@@ -40,6 +40,7 @@ extern void sh73a0_add_early_devices(void);extern void sh73a0_add_standard_devices (void );extern void sh73a0_clock_init (void );extern void sh73a0_pinmux_init (void ); +extern void sh73a0_pm_init (void );extern struct clk sh73a0_extal1_clk;extern struct clk sh73a0_extal2_clk;extern struct clk sh73a0_extcki_clk;arch/arm/mach-shmobile/pm-sh73a0.c new file +32
-1@@ -0,0 +1,32 @@ +/* +* sh73a0 Power management support +* +* Copyright (C) 2012 Bastian Hecht <[email protected]> +* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +*/ + +#include <linux/suspend.h> +#include <mach/common.h> + +#ifdef CONFIG_SUSPEND +static int sh73a0_enter_suspend (suspend_state_t suspend_state) +{ +cpu_do_idle (); +return 0 ; +} + +static void sh73a0_suspend_init (void ) +{ + shmobile_suspend_ops.enter = sh73a0_enter_suspend; +} +#else +static void sh73a0_suspend_init (void ) {} +#endif + +void __init sh73a0_pm_init (void ) +{ +sh73a0_suspend_init (); +} --1.7.10.4
PATCH 1/2 ARM: shmobile: sh73a0: Add CPU sleep suspend
Quoted 1 line · Bastian Hecht
Looks perfect, thanks!
Great, thanks.