* [PATCH v3 0/2] Kirkwood standby
@ 2013-08-22 15:49 Ezequiel Garcia
2013-08-22 15:49 ` [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation Ezequiel Garcia
2013-08-22 15:49 ` [PATCH v3 2/2] ARM: kirkwood: Add standby support Ezequiel Garcia
0 siblings, 2 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2013-08-22 15:49 UTC (permalink / raw)
To: linux-arm-kernel
This patchset implements a very basic suspend/resume support on
Kirkwood SoC's, based on the work of Simon Guinot.
Given the CPU itself is not stopped on suspend, but just sits
waiting for interruption, this is more similar to a standby-mode,
than to a real suspend-to-RAM. Therefore, I've chosen to use the
'standby' power state.
The first patch implements suspend/resume procedures in Feroceon CPU
and it's already applied in Russell's. I'm only adding it here for
series consistency.
The second patch implements the 'standby' state by disabling SoC
memory units and put the CPU in idle state. Additional power savings
must be enhanced on each driver by implementing proper suspend/resume support.
This is based in v3.11-rc6 and tested on Openblocks A6.
By simple instrumentation I found (see the table below) that this 'standby'
state has *no power savings* compared to a CPUIdle-enabled platform.
Therefore, it's not clear to me the real advantage of this support.
However, and hopefully, by implementing proper suspend/resume in relevant
peripherals, the power savings of the standby might get improved.
CONFIG_CPU_IDLE=y
State Current (mA)
------------------------------
Normal (system idle) 360
Normal (system busy 440
Standby 360
!CONFIG_CPU_IDLE
State Current (mA)
------------------------------
Normal (system idle) 440
Normal (system busy 440
Standby 360
(The above are sketchy measurements but useful to compare CPUIdle vs. Standby)
Changes from v2:
* In order to remain multiplatform-ready, I reworked the kirkwood_pm_init
by having it explicitly called from mach-kirkwood/. Requested by
Andrew Lunn.
Changes from v1:
* Removed clock gating. Each peripheral is in charge of implementing
a proper suspend/resume path, including gateable clock handling.
Ezequiel Garcia (2):
ARM: feroceon: Add suspend/resume operation
ARM: kirkwood: Add standby support
arch/arm/Kconfig | 2 +-
arch/arm/mach-kirkwood/Makefile | 2 +
arch/arm/mach-kirkwood/board-dt.c | 1 +
arch/arm/mach-kirkwood/common.c | 1 +
arch/arm/mach-kirkwood/common.h | 6 ++
arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 2 +
arch/arm/mach-kirkwood/pm.c | 73 +++++++++++++++++++++++
arch/arm/mm/proc-feroceon.S | 26 ++++++++
8 files changed, 112 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/mach-kirkwood/pm.c
--
1.8.1.5
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation
2013-08-22 15:49 [PATCH v3 0/2] Kirkwood standby Ezequiel Garcia
@ 2013-08-22 15:49 ` Ezequiel Garcia
2013-10-01 13:35 ` Jason Cooper
2013-10-01 13:38 ` Jason Cooper
2013-08-22 15:49 ` [PATCH v3 2/2] ARM: kirkwood: Add standby support Ezequiel Garcia
1 sibling, 2 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2013-08-22 15:49 UTC (permalink / raw)
To: linux-arm-kernel
Add support for suspend/resume operations. The implemented procedures
are identical to the ones for ARM926.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
arch/arm/Kconfig | 2 +-
arch/arm/mm/proc-feroceon.S | 26 ++++++++++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 43594d5..a5111ec 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2199,7 +2199,7 @@ source "kernel/power/Kconfig"
config ARCH_SUSPEND_POSSIBLE
depends on !ARCH_S5PC100
- depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
+ depends on CPU_ARM920T || CPU_ARM926T || CPU_FEROCEON || CPU_SA1100 || \
CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK
def_bool y
diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
index d5146b9..db79b62 100644
--- a/arch/arm/mm/proc-feroceon.S
+++ b/arch/arm/mm/proc-feroceon.S
@@ -514,6 +514,32 @@ ENTRY(cpu_feroceon_set_pte_ext)
#endif
mov pc, lr
+/* Suspend/resume support: taken from arch/arm/mm/proc-arm926.S */
+.globl cpu_feroceon_suspend_size
+.equ cpu_feroceon_suspend_size, 4 * 3
+#ifdef CONFIG_ARM_CPU_SUSPEND
+ENTRY(cpu_feroceon_do_suspend)
+ stmfd sp!, {r4 - r6, lr}
+ mrc p15, 0, r4, c13, c0, 0 @ PID
+ mrc p15, 0, r5, c3, c0, 0 @ Domain ID
+ mrc p15, 0, r6, c1, c0, 0 @ Control register
+ stmia r0, {r4 - r6}
+ ldmfd sp!, {r4 - r6, pc}
+ENDPROC(cpu_feroceon_do_suspend)
+
+ENTRY(cpu_feroceon_do_resume)
+ mov ip, #0
+ mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
+ mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
+ ldmia r0, {r4 - r6}
+ mcr p15, 0, r4, c13, c0, 0 @ PID
+ mcr p15, 0, r5, c3, c0, 0 @ Domain ID
+ mcr p15, 0, r1, c2, c0, 0 @ TTB address
+ mov r0, r6 @ control register
+ b cpu_resume_mmu
+ENDPROC(cpu_feroceon_do_resume)
+#endif
+
.type __feroceon_setup, #function
__feroceon_setup:
mov r0, #0
--
1.8.1.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v3 2/2] ARM: kirkwood: Add standby support
2013-08-22 15:49 [PATCH v3 0/2] Kirkwood standby Ezequiel Garcia
2013-08-22 15:49 ` [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation Ezequiel Garcia
@ 2013-08-22 15:49 ` Ezequiel Garcia
2013-08-30 23:10 ` Ezequiel Garcia
2013-10-01 15:33 ` Jason Cooper
1 sibling, 2 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2013-08-22 15:49 UTC (permalink / raw)
To: linux-arm-kernel
Implements standby support for Kirkwood SoC. When the SoC enters
standby state the memory PM units are disabled, the DDR is set
in self-refresh mode, and the CPU is set in WFI.
At this point there's no clock gating, as that is considered each
driver's task.
Signed-off-by: Simon Guinot <sguinot@lacie.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
arch/arm/mach-kirkwood/Makefile | 2 +
arch/arm/mach-kirkwood/board-dt.c | 1 +
arch/arm/mach-kirkwood/common.c | 1 +
arch/arm/mach-kirkwood/common.h | 6 ++
arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 2 +
arch/arm/mach-kirkwood/pm.c | 73 +++++++++++++++++++++++
6 files changed, 85 insertions(+)
create mode 100644 arch/arm/mach-kirkwood/pm.c
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index ac4cd75..ac78dcc 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -1,4 +1,6 @@
obj-y += common.o irq.o pcie.o mpp.o
+obj-$(CONFIG_PM) += pm.o
+
obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o
obj-$(CONFIG_MACH_DOCKSTAR) += dockstar-setup.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 6e122ed..2d4a4aa 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -96,6 +96,7 @@ static void __init kirkwood_dt_init(void)
/* Setup root of clk tree */
kirkwood_of_clk_init();
+ kirkwood_pm_init();
kirkwood_cpuidle_init();
#ifdef CONFIG_KEXEC
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index e9238b5..aceb68a 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -717,6 +717,7 @@ void __init kirkwood_init(void)
kirkwood_xor1_init();
kirkwood_crypto_init();
+ kirkwood_pm_init();
kirkwood_cpuidle_init();
#ifdef CONFIG_KEXEC
kexec_reinit = kirkwood_enable_pcie;
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index fcf3ba6..2be1226 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -58,6 +58,12 @@ void kirkwood_cpufreq_init(void);
void kirkwood_restart(enum reboot_mode, const char *);
void kirkwood_clk_init(void);
+#ifdef CONFIG_PM
+void kirkwood_pm_init(void);
+#else
+static inline void kirkwood_pm_init(void) {};
+#endif
+
/* board init functions for boards not fully converted to fdt */
#ifdef CONFIG_MACH_DREAMPLUG_DT
void dreamplug_init(void);
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index 91242c9..8b9d1c9 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -78,4 +78,6 @@
#define CGC_TDM (1 << 20)
#define CGC_RESERVED (0x6 << 21)
+#define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118)
+
#endif
diff --git a/arch/arm/mach-kirkwood/pm.c b/arch/arm/mach-kirkwood/pm.c
new file mode 100644
index 0000000..8783a71
--- /dev/null
+++ b/arch/arm/mach-kirkwood/pm.c
@@ -0,0 +1,73 @@
+/*
+ * Power Management driver for Marvell Kirkwood SoCs
+ *
+ * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
+ * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License,
+ * version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/suspend.h>
+#include <linux/io.h>
+#include <mach/bridge-regs.h>
+
+static void __iomem *ddr_operation_base;
+
+static void kirkwood_low_power(void)
+{
+ u32 mem_pm_ctrl;
+
+ mem_pm_ctrl = readl(MEMORY_PM_CTRL);
+
+ /* Set peripherals to low-power mode */
+ writel_relaxed(~0, MEMORY_PM_CTRL);
+
+ /* Set DDR in self-refresh */
+ writel_relaxed(0x7, ddr_operation_base);
+
+ /*
+ * Set CPU in wait-for-interrupt state.
+ * This disables the CPU core clocks,
+ * the array clocks, and also the L2 controller.
+ */
+ cpu_do_idle();
+
+ writel_relaxed(mem_pm_ctrl, MEMORY_PM_CTRL);
+}
+
+static int kirkwood_suspend_enter(suspend_state_t state)
+{
+ switch (state) {
+ case PM_SUSPEND_STANDBY:
+ kirkwood_low_power();
+ break;
+ default:
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static int kirkwood_pm_valid_standby(suspend_state_t state)
+{
+ return state == PM_SUSPEND_STANDBY;
+}
+
+static const struct platform_suspend_ops kirkwood_suspend_ops = {
+ .enter = kirkwood_suspend_enter,
+ .valid = kirkwood_pm_valid_standby,
+};
+
+int __init kirkwood_pm_init(void)
+{
+ ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4);
+ suspend_set_ops(&kirkwood_suspend_ops);
+ return 0;
+}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v3 2/2] ARM: kirkwood: Add standby support
2013-08-22 15:49 ` [PATCH v3 2/2] ARM: kirkwood: Add standby support Ezequiel Garcia
@ 2013-08-30 23:10 ` Ezequiel Garcia
2013-08-31 15:51 ` Jason Cooper
2013-10-01 15:33 ` Jason Cooper
1 sibling, 1 reply; 15+ messages in thread
From: Ezequiel Garcia @ 2013-08-30 23:10 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Aug 22, 2013 at 12:49:07PM -0300, Ezequiel Garcia wrote:
> Implements standby support for Kirkwood SoC. When the SoC enters
> standby state the memory PM units are disabled, the DDR is set
> in self-refresh mode, and the CPU is set in WFI.
>
> At this point there's no clock gating, as that is considered each
> driver's task.
>
> Signed-off-by: Simon Guinot <sguinot@lacie.com>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
> arch/arm/mach-kirkwood/Makefile | 2 +
> arch/arm/mach-kirkwood/board-dt.c | 1 +
> arch/arm/mach-kirkwood/common.c | 1 +
> arch/arm/mach-kirkwood/common.h | 6 ++
> arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 2 +
> arch/arm/mach-kirkwood/pm.c | 73 +++++++++++++++++++++++
> 6 files changed, 85 insertions(+)
> create mode 100644 arch/arm/mach-kirkwood/pm.c
>
> diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
> index ac4cd75..ac78dcc 100644
> --- a/arch/arm/mach-kirkwood/Makefile
> +++ b/arch/arm/mach-kirkwood/Makefile
> @@ -1,4 +1,6 @@
> obj-y += common.o irq.o pcie.o mpp.o
> +obj-$(CONFIG_PM) += pm.o
> +
>
> obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o
> obj-$(CONFIG_MACH_DOCKSTAR) += dockstar-setup.o
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 6e122ed..2d4a4aa 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -96,6 +96,7 @@ static void __init kirkwood_dt_init(void)
> /* Setup root of clk tree */
> kirkwood_of_clk_init();
>
> + kirkwood_pm_init();
> kirkwood_cpuidle_init();
>
> #ifdef CONFIG_KEXEC
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index e9238b5..aceb68a 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -717,6 +717,7 @@ void __init kirkwood_init(void)
> kirkwood_xor1_init();
> kirkwood_crypto_init();
>
> + kirkwood_pm_init();
> kirkwood_cpuidle_init();
> #ifdef CONFIG_KEXEC
> kexec_reinit = kirkwood_enable_pcie;
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index fcf3ba6..2be1226 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -58,6 +58,12 @@ void kirkwood_cpufreq_init(void);
> void kirkwood_restart(enum reboot_mode, const char *);
> void kirkwood_clk_init(void);
>
> +#ifdef CONFIG_PM
> +void kirkwood_pm_init(void);
> +#else
> +static inline void kirkwood_pm_init(void) {};
> +#endif
> +
> /* board init functions for boards not fully converted to fdt */
> #ifdef CONFIG_MACH_DREAMPLUG_DT
> void dreamplug_init(void);
> diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> index 91242c9..8b9d1c9 100644
> --- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> +++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
> @@ -78,4 +78,6 @@
> #define CGC_TDM (1 << 20)
> #define CGC_RESERVED (0x6 << 21)
>
> +#define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118)
> +
> #endif
> diff --git a/arch/arm/mach-kirkwood/pm.c b/arch/arm/mach-kirkwood/pm.c
> new file mode 100644
> index 0000000..8783a71
> --- /dev/null
> +++ b/arch/arm/mach-kirkwood/pm.c
> @@ -0,0 +1,73 @@
> +/*
> + * Power Management driver for Marvell Kirkwood SoCs
> + *
> + * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
> + * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License,
> + * version 2 of the License.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/suspend.h>
> +#include <linux/io.h>
> +#include <mach/bridge-regs.h>
> +
> +static void __iomem *ddr_operation_base;
> +
> +static void kirkwood_low_power(void)
> +{
> + u32 mem_pm_ctrl;
> +
> + mem_pm_ctrl = readl(MEMORY_PM_CTRL);
> +
> + /* Set peripherals to low-power mode */
> + writel_relaxed(~0, MEMORY_PM_CTRL);
> +
> + /* Set DDR in self-refresh */
> + writel_relaxed(0x7, ddr_operation_base);
> +
> + /*
> + * Set CPU in wait-for-interrupt state.
> + * This disables the CPU core clocks,
> + * the array clocks, and also the L2 controller.
> + */
> + cpu_do_idle();
> +
> + writel_relaxed(mem_pm_ctrl, MEMORY_PM_CTRL);
> +}
> +
> +static int kirkwood_suspend_enter(suspend_state_t state)
> +{
> + switch (state) {
> + case PM_SUSPEND_STANDBY:
> + kirkwood_low_power();
> + break;
> + default:
> + return -EINVAL;
> + }
> + return 0;
> +}
> +
> +static int kirkwood_pm_valid_standby(suspend_state_t state)
> +{
> + return state == PM_SUSPEND_STANDBY;
> +}
> +
> +static const struct platform_suspend_ops kirkwood_suspend_ops = {
> + .enter = kirkwood_suspend_enter,
> + .valid = kirkwood_pm_valid_standby,
> +};
> +
> +int __init kirkwood_pm_init(void)
> +{
> + ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4);
> + suspend_set_ops(&kirkwood_suspend_ops);
> + return 0;
> +}
> --
> 1.8.1.5
>
Any comments on this?
--
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 2/2] ARM: kirkwood: Add standby support
2013-08-30 23:10 ` Ezequiel Garcia
@ 2013-08-31 15:51 ` Jason Cooper
2013-08-31 16:19 ` Ezequiel Garcia
0 siblings, 1 reply; 15+ messages in thread
From: Jason Cooper @ 2013-08-31 15:51 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Aug 30, 2013 at 08:10:04PM -0300, Ezequiel Garcia wrote:
> On Thu, Aug 22, 2013 at 12:49:07PM -0300, Ezequiel Garcia wrote:
> > Implements standby support for Kirkwood SoC. When the SoC enters
> > standby state the memory PM units are disabled, the DDR is set
> > in self-refresh mode, and the CPU is set in WFI.
> >
> > At this point there's no clock gating, as that is considered each
> > driver's task.
> >
> > Signed-off-by: Simon Guinot <sguinot@lacie.com>
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > ---
> > arch/arm/mach-kirkwood/Makefile | 2 +
> > arch/arm/mach-kirkwood/board-dt.c | 1 +
> > arch/arm/mach-kirkwood/common.c | 1 +
> > arch/arm/mach-kirkwood/common.h | 6 ++
> > arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 2 +
> > arch/arm/mach-kirkwood/pm.c | 73 +++++++++++++++++++++++
> > 6 files changed, 85 insertions(+)
> > create mode 100644 arch/arm/mach-kirkwood/pm.c
>
> Any comments on this?
Well, I was sitting on this for the next merge window, since it came in
late and honestly, isn't complete. You stated yourself in the
coverletter that it offered no real power savings.
How about expanding the series to add proper suspend/resume support to
some of the more power hungry drivers (yes, this might re-awaken the
mv643xx_eth mac address issue), and resubmit?
thx,
Jason.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 2/2] ARM: kirkwood: Add standby support
2013-08-31 15:51 ` Jason Cooper
@ 2013-08-31 16:19 ` Ezequiel Garcia
2013-10-01 13:37 ` Jason Cooper
0 siblings, 1 reply; 15+ messages in thread
From: Ezequiel Garcia @ 2013-08-31 16:19 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Aug 31, 2013 at 11:51:25AM -0400, Jason Cooper wrote:
> On Fri, Aug 30, 2013 at 08:10:04PM -0300, Ezequiel Garcia wrote:
> > On Thu, Aug 22, 2013 at 12:49:07PM -0300, Ezequiel Garcia wrote:
> > > Implements standby support for Kirkwood SoC. When the SoC enters
> > > standby state the memory PM units are disabled, the DDR is set
> > > in self-refresh mode, and the CPU is set in WFI.
> > >
> > > At this point there's no clock gating, as that is considered each
> > > driver's task.
> > >
> > > Signed-off-by: Simon Guinot <sguinot@lacie.com>
> > > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > > ---
> > > arch/arm/mach-kirkwood/Makefile | 2 +
> > > arch/arm/mach-kirkwood/board-dt.c | 1 +
> > > arch/arm/mach-kirkwood/common.c | 1 +
> > > arch/arm/mach-kirkwood/common.h | 6 ++
> > > arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 2 +
> > > arch/arm/mach-kirkwood/pm.c | 73 +++++++++++++++++++++++
> > > 6 files changed, 85 insertions(+)
> > > create mode 100644 arch/arm/mach-kirkwood/pm.c
> >
> > Any comments on this?
>
> Well, I was sitting on this for the next merge window,
Of course, this isn't intended for this merge window.
We need first the feroceon suspend/resume patch that is already
queued for v3.12.
So, first of all: sorry if I'm making noise; just wanted
to check nobody had any major comments.
> since it came in late and honestly, isn't complete. You stated yourself in the
> coverletter that it offered no real power savings.
>
Discussing about this with Simon Guinot on IRC (the original author of
this) we agreed the patch was a nice thing to have, and that follow-up
patches might add better power savings on a per-device basis.
Maybe it's foolish, but notice this doesn't provide additional power saving
in comparison with a cpuidled-kernel (I know, most of users will select
it).
> How about expanding the series to add proper suspend/resume support to
> some of the more power hungry drivers
So -just to check- you definitely prefer not to take the stand-by
support until we have some more suspend/resume support in other drivers?
If the stand-by is ready and it's working, I'd say we're ready to
include it, disregarding the drivers, but it's completely your call.
> (yes, this might re-awaken the
> mv643xx_eth mac address issue), and resubmit?
>
I'm not entirely familiar with the eth mac issue, but currently we're
enabling the eth clock in mach-kirkwood, so those clocks are
*impossible* to disable from the driver (due to refcounting-like clock
disable). Not sure what's the right thing to do.
Thanks!
--
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation
2013-08-22 15:49 ` [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation Ezequiel Garcia
@ 2013-10-01 13:35 ` Jason Cooper
2013-10-01 13:38 ` Jason Cooper
1 sibling, 0 replies; 15+ messages in thread
From: Jason Cooper @ 2013-10-01 13:35 UTC (permalink / raw)
To: linux-arm-kernel
+rmk
On Thu, Aug 22, 2013 at 12:49:06PM -0300, Ezequiel Garcia wrote:
> Add support for suspend/resume operations. The implemented procedures
> are identical to the ones for ARM926.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
> arch/arm/Kconfig | 2 +-
> arch/arm/mm/proc-feroceon.S | 26 ++++++++++++++++++++++++++
> 2 files changed, 27 insertions(+), 1 deletion(-)
Russell,
This is pretty isolated, and the next patch in the series depends on it
for building (it's changes are all in mach-kirkwood/). Should Ezequiel
push this into your patch tracker (and then could you create a public,
non-rebasable branch containing it?), or can I take it with your Ack?
thx,
Jason.
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 43594d5..a5111ec 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -2199,7 +2199,7 @@ source "kernel/power/Kconfig"
>
> config ARCH_SUSPEND_POSSIBLE
> depends on !ARCH_S5PC100
> - depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
> + depends on CPU_ARM920T || CPU_ARM926T || CPU_FEROCEON || CPU_SA1100 || \
> CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK
> def_bool y
>
> diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
> index d5146b9..db79b62 100644
> --- a/arch/arm/mm/proc-feroceon.S
> +++ b/arch/arm/mm/proc-feroceon.S
> @@ -514,6 +514,32 @@ ENTRY(cpu_feroceon_set_pte_ext)
> #endif
> mov pc, lr
>
> +/* Suspend/resume support: taken from arch/arm/mm/proc-arm926.S */
> +.globl cpu_feroceon_suspend_size
> +.equ cpu_feroceon_suspend_size, 4 * 3
> +#ifdef CONFIG_ARM_CPU_SUSPEND
> +ENTRY(cpu_feroceon_do_suspend)
> + stmfd sp!, {r4 - r6, lr}
> + mrc p15, 0, r4, c13, c0, 0 @ PID
> + mrc p15, 0, r5, c3, c0, 0 @ Domain ID
> + mrc p15, 0, r6, c1, c0, 0 @ Control register
> + stmia r0, {r4 - r6}
> + ldmfd sp!, {r4 - r6, pc}
> +ENDPROC(cpu_feroceon_do_suspend)
> +
> +ENTRY(cpu_feroceon_do_resume)
> + mov ip, #0
> + mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
> + mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
> + ldmia r0, {r4 - r6}
> + mcr p15, 0, r4, c13, c0, 0 @ PID
> + mcr p15, 0, r5, c3, c0, 0 @ Domain ID
> + mcr p15, 0, r1, c2, c0, 0 @ TTB address
> + mov r0, r6 @ control register
> + b cpu_resume_mmu
> +ENDPROC(cpu_feroceon_do_resume)
> +#endif
> +
> .type __feroceon_setup, #function
> __feroceon_setup:
> mov r0, #0
> --
> 1.8.1.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 2/2] ARM: kirkwood: Add standby support
2013-08-31 16:19 ` Ezequiel Garcia
@ 2013-10-01 13:37 ` Jason Cooper
0 siblings, 0 replies; 15+ messages in thread
From: Jason Cooper @ 2013-10-01 13:37 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Aug 31, 2013 at 01:19:19PM -0300, Ezequiel Garcia wrote:
> On Sat, Aug 31, 2013 at 11:51:25AM -0400, Jason Cooper wrote:
...
> > How about expanding the series to add proper suspend/resume support to
> > some of the more power hungry drivers
>
> So -just to check- you definitely prefer not to take the stand-by
> support until we have some more suspend/resume support in other drivers?
>
> If the stand-by is ready and it's working, I'd say we're ready to
> include it, disregarding the drivers, but it's completely your call.
Looking things over, most drivers we care about are missing
suspend/resume. At some point I think it's reasonable to assume that
we'll do a sweep. So I drop my objection to this.
Let's see how rmk wants to handle #1 and go from there.
thx,
Jason.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation
2013-08-22 15:49 ` [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation Ezequiel Garcia
2013-10-01 13:35 ` Jason Cooper
@ 2013-10-01 13:38 ` Jason Cooper
2013-10-01 13:44 ` Ezequiel Garcia
2013-10-02 21:03 ` Russell King - ARM Linux
1 sibling, 2 replies; 15+ messages in thread
From: Jason Cooper @ 2013-10-01 13:38 UTC (permalink / raw)
To: linux-arm-kernel
+rmk (oops, forgot to add you the first time around)
On Thu, Aug 22, 2013 at 12:49:06PM -0300, Ezequiel Garcia wrote:
> Add support for suspend/resume operations. The implemented procedures
> are identical to the ones for ARM926.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
> arch/arm/Kconfig | 2 +-
> arch/arm/mm/proc-feroceon.S | 26 ++++++++++++++++++++++++++
> 2 files changed, 27 insertions(+), 1 deletion(-)
Russell,
This is pretty isolated, and the next patch in the series depends on it
for building (it's changes are all in mach-kirkwood/). Should Ezequiel
push this into your patch tracker (and then could you create a public,
non-rebasable branch containing it?), or can I take it with your Ack?
thx,
Jason.
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 43594d5..a5111ec 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -2199,7 +2199,7 @@ source "kernel/power/Kconfig"
>
> config ARCH_SUSPEND_POSSIBLE
> depends on !ARCH_S5PC100
> - depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
> + depends on CPU_ARM920T || CPU_ARM926T || CPU_FEROCEON || CPU_SA1100 || \
> CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK
> def_bool y
>
> diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
> index d5146b9..db79b62 100644
> --- a/arch/arm/mm/proc-feroceon.S
> +++ b/arch/arm/mm/proc-feroceon.S
> @@ -514,6 +514,32 @@ ENTRY(cpu_feroceon_set_pte_ext)
> #endif
> mov pc, lr
>
> +/* Suspend/resume support: taken from arch/arm/mm/proc-arm926.S */
> +.globl cpu_feroceon_suspend_size
> +.equ cpu_feroceon_suspend_size, 4 * 3
> +#ifdef CONFIG_ARM_CPU_SUSPEND
> +ENTRY(cpu_feroceon_do_suspend)
> + stmfd sp!, {r4 - r6, lr}
> + mrc p15, 0, r4, c13, c0, 0 @ PID
> + mrc p15, 0, r5, c3, c0, 0 @ Domain ID
> + mrc p15, 0, r6, c1, c0, 0 @ Control register
> + stmia r0, {r4 - r6}
> + ldmfd sp!, {r4 - r6, pc}
> +ENDPROC(cpu_feroceon_do_suspend)
> +
> +ENTRY(cpu_feroceon_do_resume)
> + mov ip, #0
> + mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
> + mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
> + ldmia r0, {r4 - r6}
> + mcr p15, 0, r4, c13, c0, 0 @ PID
> + mcr p15, 0, r5, c3, c0, 0 @ Domain ID
> + mcr p15, 0, r1, c2, c0, 0 @ TTB address
> + mov r0, r6 @ control register
> + b cpu_resume_mmu
> +ENDPROC(cpu_feroceon_do_resume)
> +#endif
> +
> .type __feroceon_setup, #function
> __feroceon_setup:
> mov r0, #0
> --
> 1.8.1.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation
2013-10-01 13:38 ` Jason Cooper
@ 2013-10-01 13:44 ` Ezequiel Garcia
2013-10-01 15:03 ` Jason Cooper
2013-10-02 21:04 ` Russell King - ARM Linux
2013-10-02 21:03 ` Russell King - ARM Linux
1 sibling, 2 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2013-10-01 13:44 UTC (permalink / raw)
To: linux-arm-kernel
Jason,
On Tue, Oct 01, 2013 at 09:38:50AM -0400, Jason Cooper wrote:
> +rmk (oops, forgot to add you the first time around)
>
> On Thu, Aug 22, 2013 at 12:49:06PM -0300, Ezequiel Garcia wrote:
> > Add support for suspend/resume operations. The implemented procedures
> > are identical to the ones for ARM926.
> >
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > ---
> > arch/arm/Kconfig | 2 +-
> > arch/arm/mm/proc-feroceon.S | 26 ++++++++++++++++++++++++++
> > 2 files changed, 27 insertions(+), 1 deletion(-)
>
> Russell,
>
> This is pretty isolated, and the next patch in the series depends on it
> for building (it's changes are all in mach-kirkwood/). Should Ezequiel
> push this into your patch tracker (and then could you create a public,
> non-rebasable branch containing it?), or can I take it with your Ack?
>
This one is already sitting happy in Linus' :-)
--
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation
2013-10-01 13:44 ` Ezequiel Garcia
@ 2013-10-01 15:03 ` Jason Cooper
2013-10-01 15:13 ` Ezequiel Garcia
2013-10-02 21:04 ` Russell King - ARM Linux
1 sibling, 1 reply; 15+ messages in thread
From: Jason Cooper @ 2013-10-01 15:03 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 01, 2013 at 10:44:29AM -0300, Ezequiel Garcia wrote:
> Jason,
>
> On Tue, Oct 01, 2013 at 09:38:50AM -0400, Jason Cooper wrote:
> > +rmk (oops, forgot to add you the first time around)
> >
> > On Thu, Aug 22, 2013 at 12:49:06PM -0300, Ezequiel Garcia wrote:
> > > Add support for suspend/resume operations. The implemented procedures
> > > are identical to the ones for ARM926.
> > >
> > > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > > ---
> > > arch/arm/Kconfig | 2 +-
> > > arch/arm/mm/proc-feroceon.S | 26 ++++++++++++++++++++++++++
> > > 2 files changed, 27 insertions(+), 1 deletion(-)
> >
> > Russell,
> >
> > This is pretty isolated, and the next patch in the series depends on it
> > for building (it's changes are all in mach-kirkwood/). Should Ezequiel
> > push this into your patch tracker (and then could you create a public,
> > non-rebasable branch containing it?), or can I take it with your Ack?
> >
>
> This one is already sitting happy in Linus' :-)
Ah, very well then. I'll queue up the other one.
thx,
Jason.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation
2013-10-01 15:03 ` Jason Cooper
@ 2013-10-01 15:13 ` Ezequiel Garcia
0 siblings, 0 replies; 15+ messages in thread
From: Ezequiel Garcia @ 2013-10-01 15:13 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 01, 2013 at 11:03:52AM -0400, Jason Cooper wrote:
> On Tue, Oct 01, 2013 at 10:44:29AM -0300, Ezequiel Garcia wrote:
> > Jason,
> >
> > On Tue, Oct 01, 2013 at 09:38:50AM -0400, Jason Cooper wrote:
> > > +rmk (oops, forgot to add you the first time around)
> > >
> > > On Thu, Aug 22, 2013 at 12:49:06PM -0300, Ezequiel Garcia wrote:
> > > > Add support for suspend/resume operations. The implemented procedures
> > > > are identical to the ones for ARM926.
> > > >
> > > > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > > > ---
> > > > arch/arm/Kconfig | 2 +-
> > > > arch/arm/mm/proc-feroceon.S | 26 ++++++++++++++++++++++++++
> > > > 2 files changed, 27 insertions(+), 1 deletion(-)
> > >
> > > Russell,
> > >
> > > This is pretty isolated, and the next patch in the series depends on it
> > > for building (it's changes are all in mach-kirkwood/). Should Ezequiel
> > > push this into your patch tracker (and then could you create a public,
> > > non-rebasable branch containing it?), or can I take it with your Ack?
> > >
> >
> > This one is already sitting happy in Linus' :-)
>
> Ah, very well then. I'll queue up the other one.
>
Awesome.
Thanks,
--
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 2/2] ARM: kirkwood: Add standby support
2013-08-22 15:49 ` [PATCH v3 2/2] ARM: kirkwood: Add standby support Ezequiel Garcia
2013-08-30 23:10 ` Ezequiel Garcia
@ 2013-10-01 15:33 ` Jason Cooper
1 sibling, 0 replies; 15+ messages in thread
From: Jason Cooper @ 2013-10-01 15:33 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Aug 22, 2013 at 12:49:07PM -0300, Ezequiel Garcia wrote:
> Implements standby support for Kirkwood SoC. When the SoC enters
> standby state the memory PM units are disabled, the DDR is set
> in self-refresh mode, and the CPU is set in WFI.
>
> At this point there's no clock gating, as that is considered each
> driver's task.
>
> Signed-off-by: Simon Guinot <sguinot@lacie.com>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
> arch/arm/mach-kirkwood/Makefile | 2 +
> arch/arm/mach-kirkwood/board-dt.c | 1 +
> arch/arm/mach-kirkwood/common.c | 1 +
> arch/arm/mach-kirkwood/common.h | 6 ++
> arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 2 +
> arch/arm/mach-kirkwood/pm.c | 73 +++++++++++++++++++++++
> 6 files changed, 85 insertions(+)
> create mode 100644 arch/arm/mach-kirkwood/pm.c
Applied to mvebu/soc
thx,
Jason.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation
2013-10-01 13:38 ` Jason Cooper
2013-10-01 13:44 ` Ezequiel Garcia
@ 2013-10-02 21:03 ` Russell King - ARM Linux
1 sibling, 0 replies; 15+ messages in thread
From: Russell King - ARM Linux @ 2013-10-02 21:03 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 01, 2013 at 09:38:50AM -0400, Jason Cooper wrote:
> +rmk (oops, forgot to add you the first time around)
>
> On Thu, Aug 22, 2013 at 12:49:06PM -0300, Ezequiel Garcia wrote:
> > Add support for suspend/resume operations. The implemented procedures
> > are identical to the ones for ARM926.
> >
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > ---
> > arch/arm/Kconfig | 2 +-
> > arch/arm/mm/proc-feroceon.S | 26 ++++++++++++++++++++++++++
> > 2 files changed, 27 insertions(+), 1 deletion(-)
>
> Russell,
>
> This is pretty isolated, and the next patch in the series depends on it
> for building (it's changes are all in mach-kirkwood/). Should Ezequiel
> push this into your patch tracker (and then could you create a public,
> non-rebasable branch containing it?), or can I take it with your Ack?
It looks fine, but it should cone via my tree in case of any conflicts
in core code.
Thanks.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation
2013-10-01 13:44 ` Ezequiel Garcia
2013-10-01 15:03 ` Jason Cooper
@ 2013-10-02 21:04 ` Russell King - ARM Linux
1 sibling, 0 replies; 15+ messages in thread
From: Russell King - ARM Linux @ 2013-10-02 21:04 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 01, 2013 at 10:44:29AM -0300, Ezequiel Garcia wrote:
> Jason,
>
> On Tue, Oct 01, 2013 at 09:38:50AM -0400, Jason Cooper wrote:
> > +rmk (oops, forgot to add you the first time around)
> >
> > On Thu, Aug 22, 2013 at 12:49:06PM -0300, Ezequiel Garcia wrote:
> > > Add support for suspend/resume operations. The implemented procedures
> > > are identical to the ones for ARM926.
> > >
> > > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > > ---
> > > arch/arm/Kconfig | 2 +-
> > > arch/arm/mm/proc-feroceon.S | 26 ++++++++++++++++++++++++++
> > > 2 files changed, 27 insertions(+), 1 deletion(-)
> >
> > Russell,
> >
> > This is pretty isolated, and the next patch in the series depends on it
> > for building (it's changes are all in mach-kirkwood/). Should Ezequiel
> > push this into your patch tracker (and then could you create a public,
> > non-rebasable branch containing it?), or can I take it with your Ack?
> >
>
> This one is already sitting happy in Linus' :-)
Ah yes, and I see it already came via me. :)
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2013-10-02 21:04 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 15:49 [PATCH v3 0/2] Kirkwood standby Ezequiel Garcia
2013-08-22 15:49 ` [PATCH v3 1/2] ARM: feroceon: Add suspend/resume operation Ezequiel Garcia
2013-10-01 13:35 ` Jason Cooper
2013-10-01 13:38 ` Jason Cooper
2013-10-01 13:44 ` Ezequiel Garcia
2013-10-01 15:03 ` Jason Cooper
2013-10-01 15:13 ` Ezequiel Garcia
2013-10-02 21:04 ` Russell King - ARM Linux
2013-10-02 21:03 ` Russell King - ARM Linux
2013-08-22 15:49 ` [PATCH v3 2/2] ARM: kirkwood: Add standby support Ezequiel Garcia
2013-08-30 23:10 ` Ezequiel Garcia
2013-08-31 15:51 ` Jason Cooper
2013-08-31 16:19 ` Ezequiel Garcia
2013-10-01 13:37 ` Jason Cooper
2013-10-01 15:33 ` Jason Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).