All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
@ 2014-08-26 14:10 ` Tomasz Figa
  0 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-kernel, linux-arm-kernel, Russell King - ARM Linux,
	Kukjin Kim, Arnd Bergmann, swarren, acourbot, Marek Szyprowski,
	Tomasz Figa, Olof Johansson, drake, tomeu, Tomasz Figa

On Exynos-based boards running secure firmware the sequence of low level
operations to enter and leave system-wide sleep mode is different than
on those without the firmware. Namely:
 - CP15 power control and diagnostic registers cannot be written directly,
 - the way of setting boot address and boot flag is different,
 - different resume handler needs to be used,
 - dedicated SMC call needs to be performed instead of letting the CPU enter
   WFI.

This series introduces .suspend() and .resume() firmware operations to
perform low level firmware-specific suspend and resume and then leverages
them to provide suspend-resume path meeting the above requirements. Three
additional patches extend device tree sources of Trats2 board with necessary
setup to enable suspend/resume support.

This series has been tested on Exynos4412-based Trats2 board, without any
additional patches. Unfortunately v3.17-rc1 regressed ODROID support and
suspend stopped working on those boards, due to unknown reasons still being
investigated. It does not seem to be related to anything in this series,
though, so I would not consider this as a stopper.

Changes since v2:
(https://lkml.org/lkml/2014/7/17/431)
 - added board-specific fixes for device tree sources of Trats2 board,
 - rebased on next-20140826 of linux-next tree.

Changes since v1:
 - dropped outer_resume() - will be handled in assembly in further patches,
   as support for L2C in non-secure mode gets added,
 - moved CP15 resume to assembly as it needs to be done before MMU is enabled,
 - surrounded CP15 save with a check for cpuid part, because it is valid only
   on Cortex A9,
 - rebased on next-20140717 tag of linux-next tree.

Tomasz Figa (5):
  ARM: firmware: Introduce suspend and resume operations
  ARM: EXYNOS: Add support for firmware-assisted suspend/resume
  ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
  ARM: dts: exynos4x12: Add utility macro to define pin sleep states
  ARM: dts: exynos4412-trats2: Add sleep mode pin configuration

 Documentation/arm/firmware.txt            |  28 +--
 arch/arm/boot/dts/exynos4412-trats2.dts   | 320 +++++++++++++++++++++++++++++-
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
 arch/arm/include/asm/firmware.h           |   8 +
 arch/arm/mach-exynos/Makefile             |   1 +
 arch/arm/mach-exynos/common.h             |   4 +
 arch/arm/mach-exynos/firmware.c           |  45 +++++
 arch/arm/mach-exynos/pm.c                 |  16 +-
 arch/arm/mach-exynos/sleep.S              |  28 +++
 arch/arm/mach-exynos/smc.h                |   4 +
 10 files changed, 438 insertions(+), 32 deletions(-)

-- 
2.0.4


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
@ 2014-08-26 14:10 ` Tomasz Figa
  0 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Kukjin Kim, Russell King - ARM Linux, Arnd Bergmann, Tomasz Figa,
	linux-kernel, Tomasz Figa, acourbot, tomeu, Olof Johansson,
	swarren, drake, linux-arm-kernel, Marek Szyprowski

On Exynos-based boards running secure firmware the sequence of low level
operations to enter and leave system-wide sleep mode is different than
on those without the firmware. Namely:
 - CP15 power control and diagnostic registers cannot be written directly,
 - the way of setting boot address and boot flag is different,
 - different resume handler needs to be used,
 - dedicated SMC call needs to be performed instead of letting the CPU enter
   WFI.

This series introduces .suspend() and .resume() firmware operations to
perform low level firmware-specific suspend and resume and then leverages
them to provide suspend-resume path meeting the above requirements. Three
additional patches extend device tree sources of Trats2 board with necessary
setup to enable suspend/resume support.

This series has been tested on Exynos4412-based Trats2 board, without any
additional patches. Unfortunately v3.17-rc1 regressed ODROID support and
suspend stopped working on those boards, due to unknown reasons still being
investigated. It does not seem to be related to anything in this series,
though, so I would not consider this as a stopper.

Changes since v2:
(https://lkml.org/lkml/2014/7/17/431)
 - added board-specific fixes for device tree sources of Trats2 board,
 - rebased on next-20140826 of linux-next tree.

Changes since v1:
 - dropped outer_resume() - will be handled in assembly in further patches,
   as support for L2C in non-secure mode gets added,
 - moved CP15 resume to assembly as it needs to be done before MMU is enabled,
 - surrounded CP15 save with a check for cpuid part, because it is valid only
   on Cortex A9,
 - rebased on next-20140717 tag of linux-next tree.

Tomasz Figa (5):
  ARM: firmware: Introduce suspend and resume operations
  ARM: EXYNOS: Add support for firmware-assisted suspend/resume
  ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
  ARM: dts: exynos4x12: Add utility macro to define pin sleep states
  ARM: dts: exynos4412-trats2: Add sleep mode pin configuration

 Documentation/arm/firmware.txt            |  28 +--
 arch/arm/boot/dts/exynos4412-trats2.dts   | 320 +++++++++++++++++++++++++++++-
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
 arch/arm/include/asm/firmware.h           |   8 +
 arch/arm/mach-exynos/Makefile             |   1 +
 arch/arm/mach-exynos/common.h             |   4 +
 arch/arm/mach-exynos/firmware.c           |  45 +++++
 arch/arm/mach-exynos/pm.c                 |  16 +-
 arch/arm/mach-exynos/sleep.S              |  28 +++
 arch/arm/mach-exynos/smc.h                |   4 +
 10 files changed, 438 insertions(+), 32 deletions(-)

-- 
2.0.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
@ 2014-08-26 14:10 ` Tomasz Figa
  0 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Exynos-based boards running secure firmware the sequence of low level
operations to enter and leave system-wide sleep mode is different than
on those without the firmware. Namely:
 - CP15 power control and diagnostic registers cannot be written directly,
 - the way of setting boot address and boot flag is different,
 - different resume handler needs to be used,
 - dedicated SMC call needs to be performed instead of letting the CPU enter
   WFI.

This series introduces .suspend() and .resume() firmware operations to
perform low level firmware-specific suspend and resume and then leverages
them to provide suspend-resume path meeting the above requirements. Three
additional patches extend device tree sources of Trats2 board with necessary
setup to enable suspend/resume support.

This series has been tested on Exynos4412-based Trats2 board, without any
additional patches. Unfortunately v3.17-rc1 regressed ODROID support and
suspend stopped working on those boards, due to unknown reasons still being
investigated. It does not seem to be related to anything in this series,
though, so I would not consider this as a stopper.

Changes since v2:
(https://lkml.org/lkml/2014/7/17/431)
 - added board-specific fixes for device tree sources of Trats2 board,
 - rebased on next-20140826 of linux-next tree.

Changes since v1:
 - dropped outer_resume() - will be handled in assembly in further patches,
   as support for L2C in non-secure mode gets added,
 - moved CP15 resume to assembly as it needs to be done before MMU is enabled,
 - surrounded CP15 save with a check for cpuid part, because it is valid only
   on Cortex A9,
 - rebased on next-20140717 tag of linux-next tree.

Tomasz Figa (5):
  ARM: firmware: Introduce suspend and resume operations
  ARM: EXYNOS: Add support for firmware-assisted suspend/resume
  ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
  ARM: dts: exynos4x12: Add utility macro to define pin sleep states
  ARM: dts: exynos4412-trats2: Add sleep mode pin configuration

 Documentation/arm/firmware.txt            |  28 +--
 arch/arm/boot/dts/exynos4412-trats2.dts   | 320 +++++++++++++++++++++++++++++-
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
 arch/arm/include/asm/firmware.h           |   8 +
 arch/arm/mach-exynos/Makefile             |   1 +
 arch/arm/mach-exynos/common.h             |   4 +
 arch/arm/mach-exynos/firmware.c           |  45 +++++
 arch/arm/mach-exynos/pm.c                 |  16 +-
 arch/arm/mach-exynos/sleep.S              |  28 +++
 arch/arm/mach-exynos/smc.h                |   4 +
 10 files changed, 438 insertions(+), 32 deletions(-)

-- 
2.0.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v3 1/5] ARM: firmware: Introduce suspend and resume operations
  2014-08-26 14:10 ` Tomasz Figa
@ 2014-08-26 14:10   ` Tomasz Figa
  -1 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-kernel, linux-arm-kernel, Russell King - ARM Linux,
	Kukjin Kim, Arnd Bergmann, swarren, acourbot, Marek Szyprowski,
	Tomasz Figa, Olof Johansson, drake, tomeu, Tomasz Figa

This patch extends the firmware_ops structure with two new callbacks:
.suspend() and .resume(). The former is intended to ask the firmware to
save all its volatile state and suspend the system, without returning
back to the kernel in between. The latter is to be called early by
very low level platform suspend code after waking up to restore low
level hardware state, which can't be restored in non-secure mode.

While at it, outdated version of the structure is removed from the
documentation and replaced with a reference to the header file.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
---
 Documentation/arm/firmware.txt  | 28 +++++-----------------------
 arch/arm/include/asm/firmware.h |  8 ++++++++
 2 files changed, 13 insertions(+), 23 deletions(-)

diff --git a/Documentation/arm/firmware.txt b/Documentation/arm/firmware.txt
index c2e468f..da6713a 100644
--- a/Documentation/arm/firmware.txt
+++ b/Documentation/arm/firmware.txt
@@ -7,32 +7,14 @@ world, which changes the way some things have to be initialized. This makes
 a need to provide an interface for such platforms to specify available firmware
 operations and call them when needed.
 
-Firmware operations can be specified using struct firmware_ops
-
-	struct firmware_ops {
-		/*
-		* Enters CPU idle mode
-		*/
-		int (*do_idle)(void);
-		/*
-		* Sets boot address of specified physical CPU
-		*/
-		int (*set_cpu_boot_addr)(int cpu, unsigned long boot_addr);
-		/*
-		* Boots specified physical CPU
-		*/
-		int (*cpu_boot)(int cpu);
-		/*
-		* Initializes L2 cache
-		*/
-		int (*l2x0_init)(void);
-	};
-
-and then registered with register_firmware_ops function
+Firmware operations can be specified by filling in a struct firmware_ops
+with appropriate callbacks and then registering it with register_firmware_ops()
+function.
 
 	void register_firmware_ops(const struct firmware_ops *ops)
 
-the ops pointer must be non-NULL.
+The ops pointer must be non-NULL. More information about struct firmware_ops
+and its members can be found in arch/arm/include/asm/firmware.h header.
 
 There is a default, empty set of operations provided, so there is no need to
 set anything if platform does not require firmware operations.
diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h
index 2c9f10d..5904f59 100644
--- a/arch/arm/include/asm/firmware.h
+++ b/arch/arm/include/asm/firmware.h
@@ -41,6 +41,14 @@ struct firmware_ops {
 	 * Initializes L2 cache
 	 */
 	int (*l2x0_init)(void);
+	/*
+	 * Enter system-wide suspend.
+	 */
+	int (*suspend)(void);
+	/*
+	 * Restore state of privileged hardware after system-wide suspend.
+	 */
+	int (*resume)(void);
 };
 
 /* Global pointer for current firmware_ops structure, can't be NULL. */
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 1/5] ARM: firmware: Introduce suspend and resume operations
@ 2014-08-26 14:10   ` Tomasz Figa
  0 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

This patch extends the firmware_ops structure with two new callbacks:
.suspend() and .resume(). The former is intended to ask the firmware to
save all its volatile state and suspend the system, without returning
back to the kernel in between. The latter is to be called early by
very low level platform suspend code after waking up to restore low
level hardware state, which can't be restored in non-secure mode.

While at it, outdated version of the structure is removed from the
documentation and replaced with a reference to the header file.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
---
 Documentation/arm/firmware.txt  | 28 +++++-----------------------
 arch/arm/include/asm/firmware.h |  8 ++++++++
 2 files changed, 13 insertions(+), 23 deletions(-)

diff --git a/Documentation/arm/firmware.txt b/Documentation/arm/firmware.txt
index c2e468f..da6713a 100644
--- a/Documentation/arm/firmware.txt
+++ b/Documentation/arm/firmware.txt
@@ -7,32 +7,14 @@ world, which changes the way some things have to be initialized. This makes
 a need to provide an interface for such platforms to specify available firmware
 operations and call them when needed.
 
-Firmware operations can be specified using struct firmware_ops
-
-	struct firmware_ops {
-		/*
-		* Enters CPU idle mode
-		*/
-		int (*do_idle)(void);
-		/*
-		* Sets boot address of specified physical CPU
-		*/
-		int (*set_cpu_boot_addr)(int cpu, unsigned long boot_addr);
-		/*
-		* Boots specified physical CPU
-		*/
-		int (*cpu_boot)(int cpu);
-		/*
-		* Initializes L2 cache
-		*/
-		int (*l2x0_init)(void);
-	};
-
-and then registered with register_firmware_ops function
+Firmware operations can be specified by filling in a struct firmware_ops
+with appropriate callbacks and then registering it with register_firmware_ops()
+function.
 
 	void register_firmware_ops(const struct firmware_ops *ops)
 
-the ops pointer must be non-NULL.
+The ops pointer must be non-NULL. More information about struct firmware_ops
+and its members can be found in arch/arm/include/asm/firmware.h header.
 
 There is a default, empty set of operations provided, so there is no need to
 set anything if platform does not require firmware operations.
diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h
index 2c9f10d..5904f59 100644
--- a/arch/arm/include/asm/firmware.h
+++ b/arch/arm/include/asm/firmware.h
@@ -41,6 +41,14 @@ struct firmware_ops {
 	 * Initializes L2 cache
 	 */
 	int (*l2x0_init)(void);
+	/*
+	 * Enter system-wide suspend.
+	 */
+	int (*suspend)(void);
+	/*
+	 * Restore state of privileged hardware after system-wide suspend.
+	 */
+	int (*resume)(void);
 };
 
 /* Global pointer for current firmware_ops structure, can't be NULL. */
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 2/5] ARM: EXYNOS: Add support for firmware-assisted suspend/resume
  2014-08-26 14:10 ` Tomasz Figa
  (?)
@ 2014-08-26 14:10   ` Tomasz Figa
  -1 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-kernel, linux-arm-kernel, Russell King - ARM Linux,
	Kukjin Kim, Arnd Bergmann, swarren, acourbot, Marek Szyprowski,
	Tomasz Figa, Olof Johansson, drake, tomeu, Tomasz Figa

On a numer of Exynos-based boards Linux kernel is running in non-secure
mode under a secure firmware. This means that certain operations need to
be handled in special way, with firmware assistance. System-wide
suspend/resume is an example of such operations.

This patch adds support for firmware-assisted suspend/resume by
leveraging recently introduced suspend and resume firmware operations
and modifying existing suspend/resume paths to account for presence of
secure firmware.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/Makefile   |  1 +
 arch/arm/mach-exynos/common.h   |  4 ++++
 arch/arm/mach-exynos/firmware.c | 45 +++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-exynos/pm.c       | 16 ++++++++++-----
 arch/arm/mach-exynos/sleep.S    | 28 +++++++++++++++++++++++++
 arch/arm/mach-exynos/smc.h      |  4 ++++
 6 files changed, 93 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 788f26d..e7d1774 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -26,6 +26,7 @@ CFLAGS_hotplug.o		+= -march=armv7-a
 
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_exynos-smc.o		:=-Wa,-march=armv7-a$(plus_sec)
+AFLAGS_sleep.o			:=-Wa,-march=armv7-a$(plus_sec)
 
 obj-$(CONFIG_EXYNOS5420_MCPM)	+= mcpm-exynos.o
 CFLAGS_mcpm-exynos.o		+= -march=armv7-a
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 47b904b..c218200 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -111,6 +111,9 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
 #define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \
 			  soc_is_exynos5420() || soc_is_exynos5800())
 
+extern u32 cp15_save_diag;
+extern u32 cp15_save_power;
+
 extern void __iomem *sysram_ns_base_addr;
 extern void __iomem *sysram_base_addr;
 extern void __iomem *pmu_base_addr;
@@ -127,6 +130,7 @@ static inline void exynos_pm_init(void) {}
 #endif
 
 extern void exynos_cpu_resume(void);
+extern void exynos_cpu_resume_ns(void);
 
 extern struct smp_operations exynos_smp_ops;
 
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
index e8797bb..f5e626d 100644
--- a/arch/arm/mach-exynos/firmware.c
+++ b/arch/arm/mach-exynos/firmware.c
@@ -14,13 +14,20 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 
+#include <asm/cacheflush.h>
+#include <asm/cputype.h>
 #include <asm/firmware.h>
+#include <asm/suspend.h>
 
 #include <mach/map.h>
 
 #include "common.h"
 #include "smc.h"
 
+#define EXYNOS_SLEEP_MAGIC	0x00000bad
+#define EXYNOS_BOOT_ADDR	0x8
+#define EXYNOS_BOOT_FLAG	0xc
+
 static int exynos_do_idle(void)
 {
 	exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
@@ -69,10 +76,48 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
 	return 0;
 }
 
+static int exynos_cpu_suspend(unsigned long arg)
+{
+	flush_cache_all();
+	outer_flush_all();
+
+	exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
+
+	pr_info("Failed to suspend the system\n");
+	writel(0, sysram_ns_base_addr + EXYNOS_BOOT_FLAG);
+	return 1;
+}
+
+static int exynos_suspend(void)
+{
+	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
+		/* Save Power control and Diagnostic registers */
+		asm ("mrc p15, 0, %0, c15, c0, 0\n"
+			"mrc p15, 0, %1, c15, c0, 1\n"
+			: "=r" (cp15_save_power), "=r" (cp15_save_diag)
+			: : "cc");
+	}
+
+	writel(EXYNOS_SLEEP_MAGIC, sysram_ns_base_addr + EXYNOS_BOOT_FLAG);
+	writel(virt_to_phys(exynos_cpu_resume_ns),
+		sysram_ns_base_addr + EXYNOS_BOOT_ADDR);
+
+	return cpu_suspend(0, exynos_cpu_suspend);
+}
+
+static int exynos_resume(void)
+{
+	writel(0, sysram_ns_base_addr + EXYNOS_BOOT_FLAG);
+
+	return 0;
+}
+
 static const struct firmware_ops exynos_firmware_ops = {
 	.do_idle		= exynos_do_idle,
 	.set_cpu_boot_addr	= exynos_set_cpu_boot_addr,
 	.cpu_boot		= exynos_cpu_boot,
+	.suspend		= exynos_suspend,
+	.resume			= exynos_resume,
 };
 
 void __init exynos_firmware_init(void)
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index abefacb..454c1cc 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -23,6 +23,7 @@
 #include <linux/clk.h>
 
 #include <asm/cacheflush.h>
+#include <asm/firmware.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/smp_scu.h>
 #include <asm/suspend.h>
@@ -292,12 +293,11 @@ static int exynos_pm_suspend(void)
 
 static void exynos_pm_resume(void)
 {
+	u32 cpuid = read_cpuid_part();
+
 	if (exynos_pm_central_resume())
 		goto early_wakeup;
 
-	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9)
-		exynos_cpu_restore_register();
-
 	/* For release retention */
 
 	pmu_raw_writel((1 << 28), S5P_PAD_RET_MAUDIO_OPTION);
@@ -314,9 +314,13 @@ static void exynos_pm_resume(void)
 
 	s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save));
 
-	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9)
+	if (cpuid == ARM_CPU_PART_CORTEX_A9)
 		scu_enable(S5P_VA_SCU);
 
+	if (call_firmware_op(resume) == -ENOSYS
+	    && cpuid == ARM_CPU_PART_CORTEX_A9)
+		exynos_cpu_restore_register();
+
 early_wakeup:
 
 	/* Clear SLEEP mode set in INFORM1 */
@@ -357,7 +361,9 @@ static int exynos_suspend_enter(suspend_state_t state)
 	flush_cache_all();
 	s3c_pm_check_store();
 
-	ret = cpu_suspend(0, exynos_cpu_suspend);
+	ret = call_firmware_op(suspend);
+	if (ret == -ENOSYS)
+		ret = cpu_suspend(0, exynos_cpu_suspend);
 	if (ret)
 		return ret;
 
diff --git a/arch/arm/mach-exynos/sleep.S b/arch/arm/mach-exynos/sleep.S
index 108a45f..e3c3730 100644
--- a/arch/arm/mach-exynos/sleep.S
+++ b/arch/arm/mach-exynos/sleep.S
@@ -16,6 +16,7 @@
  */
 
 #include <linux/linkage.h>
+#include "smc.h"
 
 #define CPU_MASK	0xff0ffff0
 #define CPU_CORTEX_A9	0x410fc090
@@ -55,3 +56,30 @@ ENTRY(exynos_cpu_resume)
 #endif
 	b	cpu_resume
 ENDPROC(exynos_cpu_resume)
+
+	.align
+
+ENTRY(exynos_cpu_resume_ns)
+	mrc	p15, 0, r0, c0, c0, 0
+	ldr	r1, =CPU_MASK
+	and	r0, r0, r1
+	ldr	r1, =CPU_CORTEX_A9
+	cmp	r0, r1
+	bne	skip_cp15
+
+	adr	r0, cp15_save_power
+	ldr	r1, [r0]
+	adr	r0, cp15_save_diag
+	ldr	r2, [r0]
+	mov	r0, #SMC_CMD_C15RESUME
+	dsb
+	smc	#0
+skip_cp15:
+	b	cpu_resume
+ENDPROC(exynos_cpu_resume_ns)
+	.globl cp15_save_diag
+cp15_save_diag:
+	.long	0	@ cp15 diagnostic
+	.globl cp15_save_power
+cp15_save_power:
+	.long	0	@ cp15 power control
diff --git a/arch/arm/mach-exynos/smc.h b/arch/arm/mach-exynos/smc.h
index 13a1dc8..f7b82f9 100644
--- a/arch/arm/mach-exynos/smc.h
+++ b/arch/arm/mach-exynos/smc.h
@@ -26,6 +26,10 @@
 #define SMC_CMD_L2X0INVALL	(-24)
 #define SMC_CMD_L2X0DEBUG	(-25)
 
+#ifndef __ASSEMBLY__
+
 extern void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3);
 
+#endif /* __ASSEMBLY__ */
+
 #endif
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 2/5] ARM: EXYNOS: Add support for firmware-assisted suspend/resume
@ 2014-08-26 14:10   ` Tomasz Figa
  0 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Kukjin Kim, Russell King - ARM Linux, Arnd Bergmann, Tomasz Figa,
	linux-kernel, Tomasz Figa, acourbot, tomeu, Olof Johansson,
	swarren, drake, linux-arm-kernel, Marek Szyprowski

On a numer of Exynos-based boards Linux kernel is running in non-secure
mode under a secure firmware. This means that certain operations need to
be handled in special way, with firmware assistance. System-wide
suspend/resume is an example of such operations.

This patch adds support for firmware-assisted suspend/resume by
leveraging recently introduced suspend and resume firmware operations
and modifying existing suspend/resume paths to account for presence of
secure firmware.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/Makefile   |  1 +
 arch/arm/mach-exynos/common.h   |  4 ++++
 arch/arm/mach-exynos/firmware.c | 45 +++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-exynos/pm.c       | 16 ++++++++++-----
 arch/arm/mach-exynos/sleep.S    | 28 +++++++++++++++++++++++++
 arch/arm/mach-exynos/smc.h      |  4 ++++
 6 files changed, 93 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 788f26d..e7d1774 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -26,6 +26,7 @@ CFLAGS_hotplug.o		+= -march=armv7-a
 
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_exynos-smc.o		:=-Wa,-march=armv7-a$(plus_sec)
+AFLAGS_sleep.o			:=-Wa,-march=armv7-a$(plus_sec)
 
 obj-$(CONFIG_EXYNOS5420_MCPM)	+= mcpm-exynos.o
 CFLAGS_mcpm-exynos.o		+= -march=armv7-a
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 47b904b..c218200 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -111,6 +111,9 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
 #define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \
 			  soc_is_exynos5420() || soc_is_exynos5800())
 
+extern u32 cp15_save_diag;
+extern u32 cp15_save_power;
+
 extern void __iomem *sysram_ns_base_addr;
 extern void __iomem *sysram_base_addr;
 extern void __iomem *pmu_base_addr;
@@ -127,6 +130,7 @@ static inline void exynos_pm_init(void) {}
 #endif
 
 extern void exynos_cpu_resume(void);
+extern void exynos_cpu_resume_ns(void);
 
 extern struct smp_operations exynos_smp_ops;
 
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
index e8797bb..f5e626d 100644
--- a/arch/arm/mach-exynos/firmware.c
+++ b/arch/arm/mach-exynos/firmware.c
@@ -14,13 +14,20 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 
+#include <asm/cacheflush.h>
+#include <asm/cputype.h>
 #include <asm/firmware.h>
+#include <asm/suspend.h>
 
 #include <mach/map.h>
 
 #include "common.h"
 #include "smc.h"
 
+#define EXYNOS_SLEEP_MAGIC	0x00000bad
+#define EXYNOS_BOOT_ADDR	0x8
+#define EXYNOS_BOOT_FLAG	0xc
+
 static int exynos_do_idle(void)
 {
 	exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
@@ -69,10 +76,48 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
 	return 0;
 }
 
+static int exynos_cpu_suspend(unsigned long arg)
+{
+	flush_cache_all();
+	outer_flush_all();
+
+	exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
+
+	pr_info("Failed to suspend the system\n");
+	writel(0, sysram_ns_base_addr + EXYNOS_BOOT_FLAG);
+	return 1;
+}
+
+static int exynos_suspend(void)
+{
+	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
+		/* Save Power control and Diagnostic registers */
+		asm ("mrc p15, 0, %0, c15, c0, 0\n"
+			"mrc p15, 0, %1, c15, c0, 1\n"
+			: "=r" (cp15_save_power), "=r" (cp15_save_diag)
+			: : "cc");
+	}
+
+	writel(EXYNOS_SLEEP_MAGIC, sysram_ns_base_addr + EXYNOS_BOOT_FLAG);
+	writel(virt_to_phys(exynos_cpu_resume_ns),
+		sysram_ns_base_addr + EXYNOS_BOOT_ADDR);
+
+	return cpu_suspend(0, exynos_cpu_suspend);
+}
+
+static int exynos_resume(void)
+{
+	writel(0, sysram_ns_base_addr + EXYNOS_BOOT_FLAG);
+
+	return 0;
+}
+
 static const struct firmware_ops exynos_firmware_ops = {
 	.do_idle		= exynos_do_idle,
 	.set_cpu_boot_addr	= exynos_set_cpu_boot_addr,
 	.cpu_boot		= exynos_cpu_boot,
+	.suspend		= exynos_suspend,
+	.resume			= exynos_resume,
 };
 
 void __init exynos_firmware_init(void)
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index abefacb..454c1cc 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -23,6 +23,7 @@
 #include <linux/clk.h>
 
 #include <asm/cacheflush.h>
+#include <asm/firmware.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/smp_scu.h>
 #include <asm/suspend.h>
@@ -292,12 +293,11 @@ static int exynos_pm_suspend(void)
 
 static void exynos_pm_resume(void)
 {
+	u32 cpuid = read_cpuid_part();
+
 	if (exynos_pm_central_resume())
 		goto early_wakeup;
 
-	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9)
-		exynos_cpu_restore_register();
-
 	/* For release retention */
 
 	pmu_raw_writel((1 << 28), S5P_PAD_RET_MAUDIO_OPTION);
@@ -314,9 +314,13 @@ static void exynos_pm_resume(void)
 
 	s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save));
 
-	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9)
+	if (cpuid == ARM_CPU_PART_CORTEX_A9)
 		scu_enable(S5P_VA_SCU);
 
+	if (call_firmware_op(resume) == -ENOSYS
+	    && cpuid == ARM_CPU_PART_CORTEX_A9)
+		exynos_cpu_restore_register();
+
 early_wakeup:
 
 	/* Clear SLEEP mode set in INFORM1 */
@@ -357,7 +361,9 @@ static int exynos_suspend_enter(suspend_state_t state)
 	flush_cache_all();
 	s3c_pm_check_store();
 
-	ret = cpu_suspend(0, exynos_cpu_suspend);
+	ret = call_firmware_op(suspend);
+	if (ret == -ENOSYS)
+		ret = cpu_suspend(0, exynos_cpu_suspend);
 	if (ret)
 		return ret;
 
diff --git a/arch/arm/mach-exynos/sleep.S b/arch/arm/mach-exynos/sleep.S
index 108a45f..e3c3730 100644
--- a/arch/arm/mach-exynos/sleep.S
+++ b/arch/arm/mach-exynos/sleep.S
@@ -16,6 +16,7 @@
  */
 
 #include <linux/linkage.h>
+#include "smc.h"
 
 #define CPU_MASK	0xff0ffff0
 #define CPU_CORTEX_A9	0x410fc090
@@ -55,3 +56,30 @@ ENTRY(exynos_cpu_resume)
 #endif
 	b	cpu_resume
 ENDPROC(exynos_cpu_resume)
+
+	.align
+
+ENTRY(exynos_cpu_resume_ns)
+	mrc	p15, 0, r0, c0, c0, 0
+	ldr	r1, =CPU_MASK
+	and	r0, r0, r1
+	ldr	r1, =CPU_CORTEX_A9
+	cmp	r0, r1
+	bne	skip_cp15
+
+	adr	r0, cp15_save_power
+	ldr	r1, [r0]
+	adr	r0, cp15_save_diag
+	ldr	r2, [r0]
+	mov	r0, #SMC_CMD_C15RESUME
+	dsb
+	smc	#0
+skip_cp15:
+	b	cpu_resume
+ENDPROC(exynos_cpu_resume_ns)
+	.globl cp15_save_diag
+cp15_save_diag:
+	.long	0	@ cp15 diagnostic
+	.globl cp15_save_power
+cp15_save_power:
+	.long	0	@ cp15 power control
diff --git a/arch/arm/mach-exynos/smc.h b/arch/arm/mach-exynos/smc.h
index 13a1dc8..f7b82f9 100644
--- a/arch/arm/mach-exynos/smc.h
+++ b/arch/arm/mach-exynos/smc.h
@@ -26,6 +26,10 @@
 #define SMC_CMD_L2X0INVALL	(-24)
 #define SMC_CMD_L2X0DEBUG	(-25)
 
+#ifndef __ASSEMBLY__
+
 extern void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3);
 
+#endif /* __ASSEMBLY__ */
+
 #endif
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 2/5] ARM: EXYNOS: Add support for firmware-assisted suspend/resume
@ 2014-08-26 14:10   ` Tomasz Figa
  0 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

On a numer of Exynos-based boards Linux kernel is running in non-secure
mode under a secure firmware. This means that certain operations need to
be handled in special way, with firmware assistance. System-wide
suspend/resume is an example of such operations.

This patch adds support for firmware-assisted suspend/resume by
leveraging recently introduced suspend and resume firmware operations
and modifying existing suspend/resume paths to account for presence of
secure firmware.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/mach-exynos/Makefile   |  1 +
 arch/arm/mach-exynos/common.h   |  4 ++++
 arch/arm/mach-exynos/firmware.c | 45 +++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-exynos/pm.c       | 16 ++++++++++-----
 arch/arm/mach-exynos/sleep.S    | 28 +++++++++++++++++++++++++
 arch/arm/mach-exynos/smc.h      |  4 ++++
 6 files changed, 93 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 788f26d..e7d1774 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -26,6 +26,7 @@ CFLAGS_hotplug.o		+= -march=armv7-a
 
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_exynos-smc.o		:=-Wa,-march=armv7-a$(plus_sec)
+AFLAGS_sleep.o			:=-Wa,-march=armv7-a$(plus_sec)
 
 obj-$(CONFIG_EXYNOS5420_MCPM)	+= mcpm-exynos.o
 CFLAGS_mcpm-exynos.o		+= -march=armv7-a
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 47b904b..c218200 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -111,6 +111,9 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
 #define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \
 			  soc_is_exynos5420() || soc_is_exynos5800())
 
+extern u32 cp15_save_diag;
+extern u32 cp15_save_power;
+
 extern void __iomem *sysram_ns_base_addr;
 extern void __iomem *sysram_base_addr;
 extern void __iomem *pmu_base_addr;
@@ -127,6 +130,7 @@ static inline void exynos_pm_init(void) {}
 #endif
 
 extern void exynos_cpu_resume(void);
+extern void exynos_cpu_resume_ns(void);
 
 extern struct smp_operations exynos_smp_ops;
 
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
index e8797bb..f5e626d 100644
--- a/arch/arm/mach-exynos/firmware.c
+++ b/arch/arm/mach-exynos/firmware.c
@@ -14,13 +14,20 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 
+#include <asm/cacheflush.h>
+#include <asm/cputype.h>
 #include <asm/firmware.h>
+#include <asm/suspend.h>
 
 #include <mach/map.h>
 
 #include "common.h"
 #include "smc.h"
 
+#define EXYNOS_SLEEP_MAGIC	0x00000bad
+#define EXYNOS_BOOT_ADDR	0x8
+#define EXYNOS_BOOT_FLAG	0xc
+
 static int exynos_do_idle(void)
 {
 	exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
@@ -69,10 +76,48 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
 	return 0;
 }
 
+static int exynos_cpu_suspend(unsigned long arg)
+{
+	flush_cache_all();
+	outer_flush_all();
+
+	exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
+
+	pr_info("Failed to suspend the system\n");
+	writel(0, sysram_ns_base_addr + EXYNOS_BOOT_FLAG);
+	return 1;
+}
+
+static int exynos_suspend(void)
+{
+	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
+		/* Save Power control and Diagnostic registers */
+		asm ("mrc p15, 0, %0, c15, c0, 0\n"
+			"mrc p15, 0, %1, c15, c0, 1\n"
+			: "=r" (cp15_save_power), "=r" (cp15_save_diag)
+			: : "cc");
+	}
+
+	writel(EXYNOS_SLEEP_MAGIC, sysram_ns_base_addr + EXYNOS_BOOT_FLAG);
+	writel(virt_to_phys(exynos_cpu_resume_ns),
+		sysram_ns_base_addr + EXYNOS_BOOT_ADDR);
+
+	return cpu_suspend(0, exynos_cpu_suspend);
+}
+
+static int exynos_resume(void)
+{
+	writel(0, sysram_ns_base_addr + EXYNOS_BOOT_FLAG);
+
+	return 0;
+}
+
 static const struct firmware_ops exynos_firmware_ops = {
 	.do_idle		= exynos_do_idle,
 	.set_cpu_boot_addr	= exynos_set_cpu_boot_addr,
 	.cpu_boot		= exynos_cpu_boot,
+	.suspend		= exynos_suspend,
+	.resume			= exynos_resume,
 };
 
 void __init exynos_firmware_init(void)
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index abefacb..454c1cc 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -23,6 +23,7 @@
 #include <linux/clk.h>
 
 #include <asm/cacheflush.h>
+#include <asm/firmware.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/smp_scu.h>
 #include <asm/suspend.h>
@@ -292,12 +293,11 @@ static int exynos_pm_suspend(void)
 
 static void exynos_pm_resume(void)
 {
+	u32 cpuid = read_cpuid_part();
+
 	if (exynos_pm_central_resume())
 		goto early_wakeup;
 
-	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9)
-		exynos_cpu_restore_register();
-
 	/* For release retention */
 
 	pmu_raw_writel((1 << 28), S5P_PAD_RET_MAUDIO_OPTION);
@@ -314,9 +314,13 @@ static void exynos_pm_resume(void)
 
 	s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save));
 
-	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9)
+	if (cpuid == ARM_CPU_PART_CORTEX_A9)
 		scu_enable(S5P_VA_SCU);
 
+	if (call_firmware_op(resume) == -ENOSYS
+	    && cpuid == ARM_CPU_PART_CORTEX_A9)
+		exynos_cpu_restore_register();
+
 early_wakeup:
 
 	/* Clear SLEEP mode set in INFORM1 */
@@ -357,7 +361,9 @@ static int exynos_suspend_enter(suspend_state_t state)
 	flush_cache_all();
 	s3c_pm_check_store();
 
-	ret = cpu_suspend(0, exynos_cpu_suspend);
+	ret = call_firmware_op(suspend);
+	if (ret == -ENOSYS)
+		ret = cpu_suspend(0, exynos_cpu_suspend);
 	if (ret)
 		return ret;
 
diff --git a/arch/arm/mach-exynos/sleep.S b/arch/arm/mach-exynos/sleep.S
index 108a45f..e3c3730 100644
--- a/arch/arm/mach-exynos/sleep.S
+++ b/arch/arm/mach-exynos/sleep.S
@@ -16,6 +16,7 @@
  */
 
 #include <linux/linkage.h>
+#include "smc.h"
 
 #define CPU_MASK	0xff0ffff0
 #define CPU_CORTEX_A9	0x410fc090
@@ -55,3 +56,30 @@ ENTRY(exynos_cpu_resume)
 #endif
 	b	cpu_resume
 ENDPROC(exynos_cpu_resume)
+
+	.align
+
+ENTRY(exynos_cpu_resume_ns)
+	mrc	p15, 0, r0, c0, c0, 0
+	ldr	r1, =CPU_MASK
+	and	r0, r0, r1
+	ldr	r1, =CPU_CORTEX_A9
+	cmp	r0, r1
+	bne	skip_cp15
+
+	adr	r0, cp15_save_power
+	ldr	r1, [r0]
+	adr	r0, cp15_save_diag
+	ldr	r2, [r0]
+	mov	r0, #SMC_CMD_C15RESUME
+	dsb
+	smc	#0
+skip_cp15:
+	b	cpu_resume
+ENDPROC(exynos_cpu_resume_ns)
+	.globl cp15_save_diag
+cp15_save_diag:
+	.long	0	@ cp15 diagnostic
+	.globl cp15_save_power
+cp15_save_power:
+	.long	0	@ cp15 power control
diff --git a/arch/arm/mach-exynos/smc.h b/arch/arm/mach-exynos/smc.h
index 13a1dc8..f7b82f9 100644
--- a/arch/arm/mach-exynos/smc.h
+++ b/arch/arm/mach-exynos/smc.h
@@ -26,6 +26,10 @@
 #define SMC_CMD_L2X0INVALL	(-24)
 #define SMC_CMD_L2X0DEBUG	(-25)
 
+#ifndef __ASSEMBLY__
+
 extern void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3);
 
+#endif /* __ASSEMBLY__ */
+
 #endif
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 3/5] ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
  2014-08-26 14:10 ` Tomasz Figa
@ 2014-08-26 14:10   ` Tomasz Figa
  -1 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-kernel, linux-arm-kernel, Russell King - ARM Linux,
	Kukjin Kim, Arnd Bergmann, swarren, acourbot, Marek Szyprowski,
	Tomasz Figa, Olof Johansson, drake, tomeu, Tomasz Figa

In MAX77686 PMIC two regulators dedicated for eMMC memory can be
controlled both by I2C interface and a GPIO pin, with the resulting
regulator state being a logical OR of both. Since the GPIO control is
used both by the kernel and the lowest level bootloader at reset, the
regulator should be disabled by I2C control to allow it to be turned off
by GPIO control.

This patch removes regulator-always-on properties from both regulators
and, while at it, also unsupported regulator-mem-off.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 5e066cd..a75034c 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -399,8 +399,6 @@
 					regulator-name = "VMEM_VDD_2.8V";
 					regulator-min-microvolt = <2800000>;
 					regulator-max-microvolt = <2800000>;
-					regulator-always-on;
-					regulator-mem-off;
 				};
 
 				ldo23_reg: ldo23 {
@@ -503,8 +501,6 @@
 					regulator-name = "VMEM_VDDF_3.0V";
 					regulator-min-microvolt = <2850000>;
 					regulator-max-microvolt = <2850000>;
-					regulator-always-on;
-					regulator-mem-off;
 				};
 
 				buck9_reg: buck9 {
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 3/5] ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
@ 2014-08-26 14:10   ` Tomasz Figa
  0 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

In MAX77686 PMIC two regulators dedicated for eMMC memory can be
controlled both by I2C interface and a GPIO pin, with the resulting
regulator state being a logical OR of both. Since the GPIO control is
used both by the kernel and the lowest level bootloader at reset, the
regulator should be disabled by I2C control to allow it to be turned off
by GPIO control.

This patch removes regulator-always-on properties from both regulators
and, while at it, also unsupported regulator-mem-off.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 5e066cd..a75034c 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -399,8 +399,6 @@
 					regulator-name = "VMEM_VDD_2.8V";
 					regulator-min-microvolt = <2800000>;
 					regulator-max-microvolt = <2800000>;
-					regulator-always-on;
-					regulator-mem-off;
 				};
 
 				ldo23_reg: ldo23 {
@@ -503,8 +501,6 @@
 					regulator-name = "VMEM_VDDF_3.0V";
 					regulator-min-microvolt = <2850000>;
 					regulator-max-microvolt = <2850000>;
-					regulator-always-on;
-					regulator-mem-off;
 				};
 
 				buck9_reg: buck9 {
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 4/5] ARM: dts: exynos4x12: Add utility macro to define pin sleep states
  2014-08-26 14:10 ` Tomasz Figa
@ 2014-08-26 14:10   ` Tomasz Figa
  -1 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-kernel, linux-arm-kernel, Russell King - ARM Linux,
	Kukjin Kim, Arnd Bergmann, swarren, acourbot, Marek Szyprowski,
	Tomasz Figa, Olof Johansson, drake, tomeu, Tomasz Figa

This patch adds a convenient macro which constructs an Exynos pinctrl
pinconf node containing properties needed to configure sleep state of
given pin with given parameters. It will be used by further patch which
adds a large number of sleep states for pins that need such
configuration on certain boards.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
index 99b26df..927fec6 100644
--- a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
@@ -12,6 +12,22 @@
  * published by the Free Software Foundation.
 */
 
+#define PIN_PULL_NONE		0
+#define PIN_PULL_DOWN		1
+#define PIN_PULL_UP		3
+
+#define PIN_PDN_OUT0		0
+#define PIN_PDN_OUT1		1
+#define PIN_PDN_INPUT		2
+#define PIN_PDN_PREV		3
+
+#define PIN_SLP(_pin, _mode, _pull)				\
+	_pin {							\
+		samsung,pins = #_pin;				\
+		samsung,pin-con-pdn = <PIN_PDN_ ##_mode>;	\
+		samsung,pin-pud-pdn = <PIN_PULL_ ##_pull>;	\
+	}
+
 / {
 	pinctrl@11400000 {
 		gpa0: gpa0 {
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 4/5] ARM: dts: exynos4x12: Add utility macro to define pin sleep states
@ 2014-08-26 14:10   ` Tomasz Figa
  0 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds a convenient macro which constructs an Exynos pinctrl
pinconf node containing properties needed to configure sleep state of
given pin with given parameters. It will be used by further patch which
adds a large number of sleep states for pins that need such
configuration on certain boards.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
index 99b26df..927fec6 100644
--- a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
@@ -12,6 +12,22 @@
  * published by the Free Software Foundation.
 */
 
+#define PIN_PULL_NONE		0
+#define PIN_PULL_DOWN		1
+#define PIN_PULL_UP		3
+
+#define PIN_PDN_OUT0		0
+#define PIN_PDN_OUT1		1
+#define PIN_PDN_INPUT		2
+#define PIN_PDN_PREV		3
+
+#define PIN_SLP(_pin, _mode, _pull)				\
+	_pin {							\
+		samsung,pins = #_pin;				\
+		samsung,pin-con-pdn = <PIN_PDN_ ##_mode>;	\
+		samsung,pin-pud-pdn = <PIN_PULL_ ##_pull>;	\
+	}
+
 / {
 	pinctrl at 11400000 {
 		gpa0: gpa0 {
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 5/5] ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
  2014-08-26 14:10 ` Tomasz Figa
@ 2014-08-26 14:10   ` Tomasz Figa
  -1 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: linux-kernel, linux-arm-kernel, Russell King - ARM Linux,
	Kukjin Kim, Arnd Bergmann, swarren, acourbot, Marek Szyprowski,
	Tomasz Figa, Olof Johansson, drake, tomeu, Tomasz Figa

This patch adds sleep mode pin configuration using pin control hog
mechanism to configure states of GPIO pins in sleep mode. This is
required to reduce leakage current in sleep mode and prevent glitching
of components on the board.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 316 ++++++++++++++++++++++++++++++++
 1 file changed, 316 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index a75034c..61e59eb 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -778,3 +778,319 @@
 		io-channels = <&adc 2>;  /* Battery temperature */
 	};
 };
+
+&pinctrl_0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&sleep0>;
+
+	sleep0: sleep-states {
+		PIN_SLP(gpa0-0, INPUT, NONE);
+		PIN_SLP(gpa0-1, OUT0, NONE);
+		PIN_SLP(gpa0-2, INPUT, NONE);
+		PIN_SLP(gpa0-3, INPUT, UP);
+		PIN_SLP(gpa0-4, INPUT, NONE);
+		PIN_SLP(gpa0-5, INPUT, DOWN);
+		PIN_SLP(gpa0-6, INPUT, DOWN);
+		PIN_SLP(gpa0-7, INPUT, UP);
+
+		PIN_SLP(gpa1-0, INPUT, DOWN);
+		PIN_SLP(gpa1-1, INPUT, DOWN);
+		PIN_SLP(gpa1-2, INPUT, DOWN);
+		PIN_SLP(gpa1-3, INPUT, DOWN);
+		PIN_SLP(gpa1-4, INPUT, DOWN);
+		PIN_SLP(gpa1-5, INPUT, DOWN);
+
+		PIN_SLP(gpb-0, INPUT, NONE);
+		PIN_SLP(gpb-1, INPUT, NONE);
+		PIN_SLP(gpb-2, INPUT, NONE);
+		PIN_SLP(gpb-3, INPUT, NONE);
+		PIN_SLP(gpb-4, INPUT, DOWN);
+		PIN_SLP(gpb-5, INPUT, UP);
+		PIN_SLP(gpb-6, INPUT, DOWN);
+		PIN_SLP(gpb-7, INPUT, DOWN);
+
+		PIN_SLP(gpc0-0, INPUT, DOWN);
+		PIN_SLP(gpc0-1, INPUT, DOWN);
+		PIN_SLP(gpc0-2, INPUT, DOWN);
+		PIN_SLP(gpc0-3, INPUT, DOWN);
+		PIN_SLP(gpc0-4, INPUT, DOWN);
+
+		PIN_SLP(gpc1-0, INPUT, NONE);
+		PIN_SLP(gpc1-1, PREV, NONE);
+		PIN_SLP(gpc1-2, INPUT, NONE);
+		PIN_SLP(gpc1-3, INPUT, NONE);
+		PIN_SLP(gpc1-4, INPUT, NONE);
+
+		PIN_SLP(gpd0-0, INPUT, DOWN);
+		PIN_SLP(gpd0-1, INPUT, DOWN);
+		PIN_SLP(gpd0-2, INPUT, NONE);
+		PIN_SLP(gpd0-3, INPUT, NONE);
+
+		PIN_SLP(gpd1-0, INPUT, DOWN);
+		PIN_SLP(gpd1-1, INPUT, DOWN);
+		PIN_SLP(gpd1-2, INPUT, NONE);
+		PIN_SLP(gpd1-3, INPUT, NONE);
+
+		PIN_SLP(gpf0-0, INPUT, NONE);
+		PIN_SLP(gpf0-1, INPUT, NONE);
+		PIN_SLP(gpf0-2, INPUT, DOWN);
+		PIN_SLP(gpf0-3, INPUT, DOWN);
+		PIN_SLP(gpf0-4, INPUT, NONE);
+		PIN_SLP(gpf0-5, INPUT, DOWN);
+		PIN_SLP(gpf0-6, INPUT, NONE);
+		PIN_SLP(gpf0-7, INPUT, DOWN);
+
+		PIN_SLP(gpf1-0, INPUT, DOWN);
+		PIN_SLP(gpf1-1, INPUT, DOWN);
+		PIN_SLP(gpf1-2, INPUT, DOWN);
+		PIN_SLP(gpf1-3, INPUT, DOWN);
+		PIN_SLP(gpf1-4, INPUT, NONE);
+		PIN_SLP(gpf1-5, INPUT, NONE);
+		PIN_SLP(gpf1-6, INPUT, DOWN);
+		PIN_SLP(gpf1-7, PREV, NONE);
+
+		PIN_SLP(gpf2-0, PREV, NONE);
+		PIN_SLP(gpf2-1, INPUT, DOWN);
+		PIN_SLP(gpf2-2, INPUT, DOWN);
+		PIN_SLP(gpf2-3, INPUT, DOWN);
+		PIN_SLP(gpf2-4, INPUT, DOWN);
+		PIN_SLP(gpf2-5, INPUT, DOWN);
+		PIN_SLP(gpf2-6, INPUT, NONE);
+		PIN_SLP(gpf2-7, INPUT, NONE);
+
+		PIN_SLP(gpf3-0, INPUT, NONE);
+		PIN_SLP(gpf3-1, PREV, NONE);
+		PIN_SLP(gpf3-2, PREV, NONE);
+		PIN_SLP(gpf3-3, PREV, NONE);
+		PIN_SLP(gpf3-4, OUT1, NONE);
+		PIN_SLP(gpf3-5, INPUT, DOWN);
+
+		PIN_SLP(gpj0-0, PREV, NONE);
+		PIN_SLP(gpj0-1, PREV, NONE);
+		PIN_SLP(gpj0-2, PREV, NONE);
+		PIN_SLP(gpj0-3, INPUT, DOWN);
+		PIN_SLP(gpj0-4, PREV, NONE);
+		PIN_SLP(gpj0-5, PREV, NONE);
+		PIN_SLP(gpj0-6, INPUT, DOWN);
+		PIN_SLP(gpj0-7, INPUT, DOWN);
+
+		PIN_SLP(gpj1-0, INPUT, DOWN);
+		PIN_SLP(gpj1-1, PREV, NONE);
+		PIN_SLP(gpj1-2, PREV, NONE);
+		PIN_SLP(gpj1-3, INPUT, DOWN);
+		PIN_SLP(gpj1-4, INPUT, DOWN);
+	};
+};
+
+&pinctrl_1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&sleep1>;
+
+	sleep1: sleep-states {
+		PIN_SLP(gpk0-0, PREV, NONE);
+		PIN_SLP(gpk0-1, PREV, NONE);
+		PIN_SLP(gpk0-2, OUT0, NONE);
+		PIN_SLP(gpk0-3, PREV, NONE);
+		PIN_SLP(gpk0-4, PREV, NONE);
+		PIN_SLP(gpk0-5, PREV, NONE);
+		PIN_SLP(gpk0-6, PREV, NONE);
+
+		PIN_SLP(gpk1-0, INPUT, DOWN);
+		PIN_SLP(gpk1-1, INPUT, DOWN);
+		PIN_SLP(gpk1-2, INPUT, DOWN);
+		PIN_SLP(gpk1-3, PREV, NONE);
+		PIN_SLP(gpk1-4, PREV, NONE);
+		PIN_SLP(gpk1-5, PREV, NONE);
+		PIN_SLP(gpk1-6, PREV, NONE);
+
+		PIN_SLP(gpk2-0, INPUT, DOWN);
+		PIN_SLP(gpk2-1, INPUT, DOWN);
+		PIN_SLP(gpk2-2, INPUT, DOWN);
+		PIN_SLP(gpk2-3, INPUT, DOWN);
+		PIN_SLP(gpk2-4, INPUT, DOWN);
+		PIN_SLP(gpk2-5, INPUT, DOWN);
+		PIN_SLP(gpk2-6, INPUT, DOWN);
+
+		PIN_SLP(gpk3-0, OUT0, NONE);
+		PIN_SLP(gpk3-1, INPUT, NONE);
+		PIN_SLP(gpk3-2, INPUT, DOWN);
+		PIN_SLP(gpk3-3, INPUT, NONE);
+		PIN_SLP(gpk3-4, INPUT, NONE);
+		PIN_SLP(gpk3-5, INPUT, NONE);
+		PIN_SLP(gpk3-6, INPUT, NONE);
+
+		PIN_SLP(gpl0-0, INPUT, DOWN);
+		PIN_SLP(gpl0-1, INPUT, DOWN);
+		PIN_SLP(gpl0-2, INPUT, DOWN);
+		PIN_SLP(gpl0-3, INPUT, DOWN);
+		PIN_SLP(gpl0-4, PREV, NONE);
+		PIN_SLP(gpl0-6, PREV, NONE);
+
+		PIN_SLP(gpl1-0, INPUT, DOWN);
+		PIN_SLP(gpl1-1, INPUT, DOWN);
+		PIN_SLP(gpl2-0, INPUT, DOWN);
+		PIN_SLP(gpl2-1, INPUT, DOWN);
+		PIN_SLP(gpl2-2, INPUT, DOWN);
+		PIN_SLP(gpl2-3, INPUT, DOWN);
+		PIN_SLP(gpl2-4, INPUT, DOWN);
+		PIN_SLP(gpl2-5, INPUT, DOWN);
+		PIN_SLP(gpl2-6, PREV, NONE);
+		PIN_SLP(gpl2-7, INPUT, DOWN);
+
+		PIN_SLP(gpm0-0, INPUT, DOWN);
+		PIN_SLP(gpm0-1, INPUT, DOWN);
+		PIN_SLP(gpm0-2, INPUT, DOWN);
+		PIN_SLP(gpm0-3, INPUT, DOWN);
+		PIN_SLP(gpm0-4, INPUT, DOWN);
+		PIN_SLP(gpm0-5, INPUT, DOWN);
+		PIN_SLP(gpm0-6, INPUT, DOWN);
+		PIN_SLP(gpm0-7, INPUT, DOWN);
+
+		PIN_SLP(gpm1-0, INPUT, DOWN);
+		PIN_SLP(gpm1-1, INPUT, DOWN);
+		PIN_SLP(gpm1-2, INPUT, NONE);
+		PIN_SLP(gpm1-3, INPUT, NONE);
+		PIN_SLP(gpm1-4, INPUT, NONE);
+		PIN_SLP(gpm1-5, INPUT, NONE);
+		PIN_SLP(gpm1-6, INPUT, DOWN);
+
+		PIN_SLP(gpm2-0, INPUT, NONE);
+		PIN_SLP(gpm2-1, INPUT, NONE);
+		PIN_SLP(gpm2-2, INPUT, DOWN);
+		PIN_SLP(gpm2-3, INPUT, DOWN);
+		PIN_SLP(gpm2-4, INPUT, DOWN);
+
+		PIN_SLP(gpm3-0, PREV, NONE);
+		PIN_SLP(gpm3-1, PREV, NONE);
+		PIN_SLP(gpm3-2, PREV, NONE);
+		PIN_SLP(gpm3-3, OUT1, NONE);
+		PIN_SLP(gpm3-4, INPUT, DOWN);
+		PIN_SLP(gpm3-5, INPUT, DOWN);
+		PIN_SLP(gpm3-6, INPUT, DOWN);
+		PIN_SLP(gpm3-7, INPUT, DOWN);
+
+		PIN_SLP(gpm4-0, INPUT, DOWN);
+		PIN_SLP(gpm4-1, INPUT, DOWN);
+		PIN_SLP(gpm4-2, INPUT, DOWN);
+		PIN_SLP(gpm4-3, INPUT, DOWN);
+		PIN_SLP(gpm4-4, INPUT, DOWN);
+		PIN_SLP(gpm4-5, INPUT, DOWN);
+		PIN_SLP(gpm4-6, INPUT, DOWN);
+		PIN_SLP(gpm4-7, INPUT, DOWN);
+
+		PIN_SLP(gpy0-0, INPUT, DOWN);
+		PIN_SLP(gpy0-1, INPUT, DOWN);
+		PIN_SLP(gpy0-2, INPUT, DOWN);
+		PIN_SLP(gpy0-3, INPUT, DOWN);
+		PIN_SLP(gpy0-4, INPUT, DOWN);
+		PIN_SLP(gpy0-5, INPUT, DOWN);
+
+		PIN_SLP(gpy1-0, INPUT, DOWN);
+		PIN_SLP(gpy1-1, INPUT, DOWN);
+		PIN_SLP(gpy1-2, INPUT, DOWN);
+		PIN_SLP(gpy1-3, INPUT, DOWN);
+
+		PIN_SLP(gpy2-0, PREV, NONE);
+		PIN_SLP(gpy2-1, INPUT, DOWN);
+		PIN_SLP(gpy2-2, INPUT, NONE);
+		PIN_SLP(gpy2-3, INPUT, NONE);
+		PIN_SLP(gpy2-4, INPUT, NONE);
+		PIN_SLP(gpy2-5, INPUT, NONE);
+
+		PIN_SLP(gpy3-0, INPUT, DOWN);
+		PIN_SLP(gpy3-1, INPUT, DOWN);
+		PIN_SLP(gpy3-2, INPUT, DOWN);
+		PIN_SLP(gpy3-3, INPUT, DOWN);
+		PIN_SLP(gpy3-4, INPUT, DOWN);
+		PIN_SLP(gpy3-5, INPUT, DOWN);
+		PIN_SLP(gpy3-6, INPUT, DOWN);
+		PIN_SLP(gpy3-7, INPUT, DOWN);
+
+		PIN_SLP(gpy4-0, INPUT, DOWN);
+		PIN_SLP(gpy4-1, INPUT, DOWN);
+		PIN_SLP(gpy4-2, INPUT, DOWN);
+		PIN_SLP(gpy4-3, INPUT, DOWN);
+		PIN_SLP(gpy4-4, INPUT, DOWN);
+		PIN_SLP(gpy4-5, INPUT, DOWN);
+		PIN_SLP(gpy4-6, INPUT, DOWN);
+		PIN_SLP(gpy4-7, INPUT, DOWN);
+
+		PIN_SLP(gpy5-0, INPUT, DOWN);
+		PIN_SLP(gpy5-1, INPUT, DOWN);
+		PIN_SLP(gpy5-2, INPUT, DOWN);
+		PIN_SLP(gpy5-3, INPUT, DOWN);
+		PIN_SLP(gpy5-4, INPUT, DOWN);
+		PIN_SLP(gpy5-5, INPUT, DOWN);
+		PIN_SLP(gpy5-6, INPUT, DOWN);
+		PIN_SLP(gpy5-7, INPUT, DOWN);
+
+		PIN_SLP(gpy6-0, INPUT, DOWN);
+		PIN_SLP(gpy6-1, INPUT, DOWN);
+		PIN_SLP(gpy6-2, INPUT, DOWN);
+		PIN_SLP(gpy6-3, INPUT, DOWN);
+		PIN_SLP(gpy6-4, INPUT, DOWN);
+		PIN_SLP(gpy6-5, INPUT, DOWN);
+		PIN_SLP(gpy6-6, INPUT, DOWN);
+		PIN_SLP(gpy6-7, INPUT, DOWN);
+	};
+};
+
+&pinctrl_2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&sleep2>;
+
+	sleep2: sleep-states {
+		PIN_SLP(gpz-0, INPUT, DOWN);
+		PIN_SLP(gpz-1, INPUT, DOWN);
+		PIN_SLP(gpz-2, INPUT, DOWN);
+		PIN_SLP(gpz-3, INPUT, DOWN);
+		PIN_SLP(gpz-4, INPUT, DOWN);
+		PIN_SLP(gpz-5, INPUT, DOWN);
+		PIN_SLP(gpz-6, INPUT, DOWN);
+	};
+};
+
+&pinctrl_3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&sleep3>;
+
+	sleep3: sleep-states {
+		PIN_SLP(gpv0-0, INPUT, DOWN);
+		PIN_SLP(gpv0-1, INPUT, DOWN);
+		PIN_SLP(gpv0-2, INPUT, DOWN);
+		PIN_SLP(gpv0-3, INPUT, DOWN);
+		PIN_SLP(gpv0-4, INPUT, DOWN);
+		PIN_SLP(gpv0-5, INPUT, DOWN);
+		PIN_SLP(gpv0-6, INPUT, DOWN);
+		PIN_SLP(gpv0-7, INPUT, DOWN);
+
+		PIN_SLP(gpv1-0, INPUT, DOWN);
+		PIN_SLP(gpv1-1, INPUT, DOWN);
+		PIN_SLP(gpv1-2, INPUT, DOWN);
+		PIN_SLP(gpv1-3, INPUT, DOWN);
+		PIN_SLP(gpv1-4, INPUT, DOWN);
+		PIN_SLP(gpv1-5, INPUT, DOWN);
+		PIN_SLP(gpv1-6, INPUT, DOWN);
+		PIN_SLP(gpv1-7, INPUT, DOWN);
+
+		PIN_SLP(gpv2-0, INPUT, DOWN);
+		PIN_SLP(gpv2-1, INPUT, DOWN);
+		PIN_SLP(gpv2-2, INPUT, DOWN);
+		PIN_SLP(gpv2-3, INPUT, DOWN);
+		PIN_SLP(gpv2-4, INPUT, DOWN);
+		PIN_SLP(gpv2-5, INPUT, DOWN);
+		PIN_SLP(gpv2-6, INPUT, DOWN);
+		PIN_SLP(gpv2-7, INPUT, DOWN);
+
+		PIN_SLP(gpv3-0, INPUT, DOWN);
+		PIN_SLP(gpv3-1, INPUT, DOWN);
+		PIN_SLP(gpv3-2, INPUT, DOWN);
+		PIN_SLP(gpv3-3, INPUT, DOWN);
+		PIN_SLP(gpv3-4, INPUT, DOWN);
+		PIN_SLP(gpv3-5, INPUT, DOWN);
+		PIN_SLP(gpv3-6, INPUT, DOWN);
+		PIN_SLP(gpv3-7, INPUT, DOWN);
+
+		PIN_SLP(gpv4-0, INPUT, DOWN);
+	};
+};
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH v3 5/5] ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
@ 2014-08-26 14:10   ` Tomasz Figa
  0 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-08-26 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds sleep mode pin configuration using pin control hog
mechanism to configure states of GPIO pins in sleep mode. This is
required to reduce leakage current in sleep mode and prevent glitching
of components on the board.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 316 ++++++++++++++++++++++++++++++++
 1 file changed, 316 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index a75034c..61e59eb 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -778,3 +778,319 @@
 		io-channels = <&adc 2>;  /* Battery temperature */
 	};
 };
+
+&pinctrl_0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&sleep0>;
+
+	sleep0: sleep-states {
+		PIN_SLP(gpa0-0, INPUT, NONE);
+		PIN_SLP(gpa0-1, OUT0, NONE);
+		PIN_SLP(gpa0-2, INPUT, NONE);
+		PIN_SLP(gpa0-3, INPUT, UP);
+		PIN_SLP(gpa0-4, INPUT, NONE);
+		PIN_SLP(gpa0-5, INPUT, DOWN);
+		PIN_SLP(gpa0-6, INPUT, DOWN);
+		PIN_SLP(gpa0-7, INPUT, UP);
+
+		PIN_SLP(gpa1-0, INPUT, DOWN);
+		PIN_SLP(gpa1-1, INPUT, DOWN);
+		PIN_SLP(gpa1-2, INPUT, DOWN);
+		PIN_SLP(gpa1-3, INPUT, DOWN);
+		PIN_SLP(gpa1-4, INPUT, DOWN);
+		PIN_SLP(gpa1-5, INPUT, DOWN);
+
+		PIN_SLP(gpb-0, INPUT, NONE);
+		PIN_SLP(gpb-1, INPUT, NONE);
+		PIN_SLP(gpb-2, INPUT, NONE);
+		PIN_SLP(gpb-3, INPUT, NONE);
+		PIN_SLP(gpb-4, INPUT, DOWN);
+		PIN_SLP(gpb-5, INPUT, UP);
+		PIN_SLP(gpb-6, INPUT, DOWN);
+		PIN_SLP(gpb-7, INPUT, DOWN);
+
+		PIN_SLP(gpc0-0, INPUT, DOWN);
+		PIN_SLP(gpc0-1, INPUT, DOWN);
+		PIN_SLP(gpc0-2, INPUT, DOWN);
+		PIN_SLP(gpc0-3, INPUT, DOWN);
+		PIN_SLP(gpc0-4, INPUT, DOWN);
+
+		PIN_SLP(gpc1-0, INPUT, NONE);
+		PIN_SLP(gpc1-1, PREV, NONE);
+		PIN_SLP(gpc1-2, INPUT, NONE);
+		PIN_SLP(gpc1-3, INPUT, NONE);
+		PIN_SLP(gpc1-4, INPUT, NONE);
+
+		PIN_SLP(gpd0-0, INPUT, DOWN);
+		PIN_SLP(gpd0-1, INPUT, DOWN);
+		PIN_SLP(gpd0-2, INPUT, NONE);
+		PIN_SLP(gpd0-3, INPUT, NONE);
+
+		PIN_SLP(gpd1-0, INPUT, DOWN);
+		PIN_SLP(gpd1-1, INPUT, DOWN);
+		PIN_SLP(gpd1-2, INPUT, NONE);
+		PIN_SLP(gpd1-3, INPUT, NONE);
+
+		PIN_SLP(gpf0-0, INPUT, NONE);
+		PIN_SLP(gpf0-1, INPUT, NONE);
+		PIN_SLP(gpf0-2, INPUT, DOWN);
+		PIN_SLP(gpf0-3, INPUT, DOWN);
+		PIN_SLP(gpf0-4, INPUT, NONE);
+		PIN_SLP(gpf0-5, INPUT, DOWN);
+		PIN_SLP(gpf0-6, INPUT, NONE);
+		PIN_SLP(gpf0-7, INPUT, DOWN);
+
+		PIN_SLP(gpf1-0, INPUT, DOWN);
+		PIN_SLP(gpf1-1, INPUT, DOWN);
+		PIN_SLP(gpf1-2, INPUT, DOWN);
+		PIN_SLP(gpf1-3, INPUT, DOWN);
+		PIN_SLP(gpf1-4, INPUT, NONE);
+		PIN_SLP(gpf1-5, INPUT, NONE);
+		PIN_SLP(gpf1-6, INPUT, DOWN);
+		PIN_SLP(gpf1-7, PREV, NONE);
+
+		PIN_SLP(gpf2-0, PREV, NONE);
+		PIN_SLP(gpf2-1, INPUT, DOWN);
+		PIN_SLP(gpf2-2, INPUT, DOWN);
+		PIN_SLP(gpf2-3, INPUT, DOWN);
+		PIN_SLP(gpf2-4, INPUT, DOWN);
+		PIN_SLP(gpf2-5, INPUT, DOWN);
+		PIN_SLP(gpf2-6, INPUT, NONE);
+		PIN_SLP(gpf2-7, INPUT, NONE);
+
+		PIN_SLP(gpf3-0, INPUT, NONE);
+		PIN_SLP(gpf3-1, PREV, NONE);
+		PIN_SLP(gpf3-2, PREV, NONE);
+		PIN_SLP(gpf3-3, PREV, NONE);
+		PIN_SLP(gpf3-4, OUT1, NONE);
+		PIN_SLP(gpf3-5, INPUT, DOWN);
+
+		PIN_SLP(gpj0-0, PREV, NONE);
+		PIN_SLP(gpj0-1, PREV, NONE);
+		PIN_SLP(gpj0-2, PREV, NONE);
+		PIN_SLP(gpj0-3, INPUT, DOWN);
+		PIN_SLP(gpj0-4, PREV, NONE);
+		PIN_SLP(gpj0-5, PREV, NONE);
+		PIN_SLP(gpj0-6, INPUT, DOWN);
+		PIN_SLP(gpj0-7, INPUT, DOWN);
+
+		PIN_SLP(gpj1-0, INPUT, DOWN);
+		PIN_SLP(gpj1-1, PREV, NONE);
+		PIN_SLP(gpj1-2, PREV, NONE);
+		PIN_SLP(gpj1-3, INPUT, DOWN);
+		PIN_SLP(gpj1-4, INPUT, DOWN);
+	};
+};
+
+&pinctrl_1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&sleep1>;
+
+	sleep1: sleep-states {
+		PIN_SLP(gpk0-0, PREV, NONE);
+		PIN_SLP(gpk0-1, PREV, NONE);
+		PIN_SLP(gpk0-2, OUT0, NONE);
+		PIN_SLP(gpk0-3, PREV, NONE);
+		PIN_SLP(gpk0-4, PREV, NONE);
+		PIN_SLP(gpk0-5, PREV, NONE);
+		PIN_SLP(gpk0-6, PREV, NONE);
+
+		PIN_SLP(gpk1-0, INPUT, DOWN);
+		PIN_SLP(gpk1-1, INPUT, DOWN);
+		PIN_SLP(gpk1-2, INPUT, DOWN);
+		PIN_SLP(gpk1-3, PREV, NONE);
+		PIN_SLP(gpk1-4, PREV, NONE);
+		PIN_SLP(gpk1-5, PREV, NONE);
+		PIN_SLP(gpk1-6, PREV, NONE);
+
+		PIN_SLP(gpk2-0, INPUT, DOWN);
+		PIN_SLP(gpk2-1, INPUT, DOWN);
+		PIN_SLP(gpk2-2, INPUT, DOWN);
+		PIN_SLP(gpk2-3, INPUT, DOWN);
+		PIN_SLP(gpk2-4, INPUT, DOWN);
+		PIN_SLP(gpk2-5, INPUT, DOWN);
+		PIN_SLP(gpk2-6, INPUT, DOWN);
+
+		PIN_SLP(gpk3-0, OUT0, NONE);
+		PIN_SLP(gpk3-1, INPUT, NONE);
+		PIN_SLP(gpk3-2, INPUT, DOWN);
+		PIN_SLP(gpk3-3, INPUT, NONE);
+		PIN_SLP(gpk3-4, INPUT, NONE);
+		PIN_SLP(gpk3-5, INPUT, NONE);
+		PIN_SLP(gpk3-6, INPUT, NONE);
+
+		PIN_SLP(gpl0-0, INPUT, DOWN);
+		PIN_SLP(gpl0-1, INPUT, DOWN);
+		PIN_SLP(gpl0-2, INPUT, DOWN);
+		PIN_SLP(gpl0-3, INPUT, DOWN);
+		PIN_SLP(gpl0-4, PREV, NONE);
+		PIN_SLP(gpl0-6, PREV, NONE);
+
+		PIN_SLP(gpl1-0, INPUT, DOWN);
+		PIN_SLP(gpl1-1, INPUT, DOWN);
+		PIN_SLP(gpl2-0, INPUT, DOWN);
+		PIN_SLP(gpl2-1, INPUT, DOWN);
+		PIN_SLP(gpl2-2, INPUT, DOWN);
+		PIN_SLP(gpl2-3, INPUT, DOWN);
+		PIN_SLP(gpl2-4, INPUT, DOWN);
+		PIN_SLP(gpl2-5, INPUT, DOWN);
+		PIN_SLP(gpl2-6, PREV, NONE);
+		PIN_SLP(gpl2-7, INPUT, DOWN);
+
+		PIN_SLP(gpm0-0, INPUT, DOWN);
+		PIN_SLP(gpm0-1, INPUT, DOWN);
+		PIN_SLP(gpm0-2, INPUT, DOWN);
+		PIN_SLP(gpm0-3, INPUT, DOWN);
+		PIN_SLP(gpm0-4, INPUT, DOWN);
+		PIN_SLP(gpm0-5, INPUT, DOWN);
+		PIN_SLP(gpm0-6, INPUT, DOWN);
+		PIN_SLP(gpm0-7, INPUT, DOWN);
+
+		PIN_SLP(gpm1-0, INPUT, DOWN);
+		PIN_SLP(gpm1-1, INPUT, DOWN);
+		PIN_SLP(gpm1-2, INPUT, NONE);
+		PIN_SLP(gpm1-3, INPUT, NONE);
+		PIN_SLP(gpm1-4, INPUT, NONE);
+		PIN_SLP(gpm1-5, INPUT, NONE);
+		PIN_SLP(gpm1-6, INPUT, DOWN);
+
+		PIN_SLP(gpm2-0, INPUT, NONE);
+		PIN_SLP(gpm2-1, INPUT, NONE);
+		PIN_SLP(gpm2-2, INPUT, DOWN);
+		PIN_SLP(gpm2-3, INPUT, DOWN);
+		PIN_SLP(gpm2-4, INPUT, DOWN);
+
+		PIN_SLP(gpm3-0, PREV, NONE);
+		PIN_SLP(gpm3-1, PREV, NONE);
+		PIN_SLP(gpm3-2, PREV, NONE);
+		PIN_SLP(gpm3-3, OUT1, NONE);
+		PIN_SLP(gpm3-4, INPUT, DOWN);
+		PIN_SLP(gpm3-5, INPUT, DOWN);
+		PIN_SLP(gpm3-6, INPUT, DOWN);
+		PIN_SLP(gpm3-7, INPUT, DOWN);
+
+		PIN_SLP(gpm4-0, INPUT, DOWN);
+		PIN_SLP(gpm4-1, INPUT, DOWN);
+		PIN_SLP(gpm4-2, INPUT, DOWN);
+		PIN_SLP(gpm4-3, INPUT, DOWN);
+		PIN_SLP(gpm4-4, INPUT, DOWN);
+		PIN_SLP(gpm4-5, INPUT, DOWN);
+		PIN_SLP(gpm4-6, INPUT, DOWN);
+		PIN_SLP(gpm4-7, INPUT, DOWN);
+
+		PIN_SLP(gpy0-0, INPUT, DOWN);
+		PIN_SLP(gpy0-1, INPUT, DOWN);
+		PIN_SLP(gpy0-2, INPUT, DOWN);
+		PIN_SLP(gpy0-3, INPUT, DOWN);
+		PIN_SLP(gpy0-4, INPUT, DOWN);
+		PIN_SLP(gpy0-5, INPUT, DOWN);
+
+		PIN_SLP(gpy1-0, INPUT, DOWN);
+		PIN_SLP(gpy1-1, INPUT, DOWN);
+		PIN_SLP(gpy1-2, INPUT, DOWN);
+		PIN_SLP(gpy1-3, INPUT, DOWN);
+
+		PIN_SLP(gpy2-0, PREV, NONE);
+		PIN_SLP(gpy2-1, INPUT, DOWN);
+		PIN_SLP(gpy2-2, INPUT, NONE);
+		PIN_SLP(gpy2-3, INPUT, NONE);
+		PIN_SLP(gpy2-4, INPUT, NONE);
+		PIN_SLP(gpy2-5, INPUT, NONE);
+
+		PIN_SLP(gpy3-0, INPUT, DOWN);
+		PIN_SLP(gpy3-1, INPUT, DOWN);
+		PIN_SLP(gpy3-2, INPUT, DOWN);
+		PIN_SLP(gpy3-3, INPUT, DOWN);
+		PIN_SLP(gpy3-4, INPUT, DOWN);
+		PIN_SLP(gpy3-5, INPUT, DOWN);
+		PIN_SLP(gpy3-6, INPUT, DOWN);
+		PIN_SLP(gpy3-7, INPUT, DOWN);
+
+		PIN_SLP(gpy4-0, INPUT, DOWN);
+		PIN_SLP(gpy4-1, INPUT, DOWN);
+		PIN_SLP(gpy4-2, INPUT, DOWN);
+		PIN_SLP(gpy4-3, INPUT, DOWN);
+		PIN_SLP(gpy4-4, INPUT, DOWN);
+		PIN_SLP(gpy4-5, INPUT, DOWN);
+		PIN_SLP(gpy4-6, INPUT, DOWN);
+		PIN_SLP(gpy4-7, INPUT, DOWN);
+
+		PIN_SLP(gpy5-0, INPUT, DOWN);
+		PIN_SLP(gpy5-1, INPUT, DOWN);
+		PIN_SLP(gpy5-2, INPUT, DOWN);
+		PIN_SLP(gpy5-3, INPUT, DOWN);
+		PIN_SLP(gpy5-4, INPUT, DOWN);
+		PIN_SLP(gpy5-5, INPUT, DOWN);
+		PIN_SLP(gpy5-6, INPUT, DOWN);
+		PIN_SLP(gpy5-7, INPUT, DOWN);
+
+		PIN_SLP(gpy6-0, INPUT, DOWN);
+		PIN_SLP(gpy6-1, INPUT, DOWN);
+		PIN_SLP(gpy6-2, INPUT, DOWN);
+		PIN_SLP(gpy6-3, INPUT, DOWN);
+		PIN_SLP(gpy6-4, INPUT, DOWN);
+		PIN_SLP(gpy6-5, INPUT, DOWN);
+		PIN_SLP(gpy6-6, INPUT, DOWN);
+		PIN_SLP(gpy6-7, INPUT, DOWN);
+	};
+};
+
+&pinctrl_2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&sleep2>;
+
+	sleep2: sleep-states {
+		PIN_SLP(gpz-0, INPUT, DOWN);
+		PIN_SLP(gpz-1, INPUT, DOWN);
+		PIN_SLP(gpz-2, INPUT, DOWN);
+		PIN_SLP(gpz-3, INPUT, DOWN);
+		PIN_SLP(gpz-4, INPUT, DOWN);
+		PIN_SLP(gpz-5, INPUT, DOWN);
+		PIN_SLP(gpz-6, INPUT, DOWN);
+	};
+};
+
+&pinctrl_3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&sleep3>;
+
+	sleep3: sleep-states {
+		PIN_SLP(gpv0-0, INPUT, DOWN);
+		PIN_SLP(gpv0-1, INPUT, DOWN);
+		PIN_SLP(gpv0-2, INPUT, DOWN);
+		PIN_SLP(gpv0-3, INPUT, DOWN);
+		PIN_SLP(gpv0-4, INPUT, DOWN);
+		PIN_SLP(gpv0-5, INPUT, DOWN);
+		PIN_SLP(gpv0-6, INPUT, DOWN);
+		PIN_SLP(gpv0-7, INPUT, DOWN);
+
+		PIN_SLP(gpv1-0, INPUT, DOWN);
+		PIN_SLP(gpv1-1, INPUT, DOWN);
+		PIN_SLP(gpv1-2, INPUT, DOWN);
+		PIN_SLP(gpv1-3, INPUT, DOWN);
+		PIN_SLP(gpv1-4, INPUT, DOWN);
+		PIN_SLP(gpv1-5, INPUT, DOWN);
+		PIN_SLP(gpv1-6, INPUT, DOWN);
+		PIN_SLP(gpv1-7, INPUT, DOWN);
+
+		PIN_SLP(gpv2-0, INPUT, DOWN);
+		PIN_SLP(gpv2-1, INPUT, DOWN);
+		PIN_SLP(gpv2-2, INPUT, DOWN);
+		PIN_SLP(gpv2-3, INPUT, DOWN);
+		PIN_SLP(gpv2-4, INPUT, DOWN);
+		PIN_SLP(gpv2-5, INPUT, DOWN);
+		PIN_SLP(gpv2-6, INPUT, DOWN);
+		PIN_SLP(gpv2-7, INPUT, DOWN);
+
+		PIN_SLP(gpv3-0, INPUT, DOWN);
+		PIN_SLP(gpv3-1, INPUT, DOWN);
+		PIN_SLP(gpv3-2, INPUT, DOWN);
+		PIN_SLP(gpv3-3, INPUT, DOWN);
+		PIN_SLP(gpv3-4, INPUT, DOWN);
+		PIN_SLP(gpv3-5, INPUT, DOWN);
+		PIN_SLP(gpv3-6, INPUT, DOWN);
+		PIN_SLP(gpv3-7, INPUT, DOWN);
+
+		PIN_SLP(gpv4-0, INPUT, DOWN);
+	};
+};
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
  2014-08-26 14:10 ` Tomasz Figa
@ 2014-09-14 17:47   ` Tomasz Figa
  -1 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-09-14 17:47 UTC (permalink / raw)
  To: linux-samsung-soc, Kukjin Kim
  Cc: linux-kernel, linux-arm-kernel, Russell King - ARM Linux,
	Arnd Bergmann, swarren, acourbot, Marek Szyprowski,
	Olof Johansson, drake, tomeu

Hi Kukjin,

On 26.08.2014 16:10, Tomasz Figa wrote:
> On Exynos-based boards running secure firmware the sequence of low level
> operations to enter and leave system-wide sleep mode is different than
> on those without the firmware. Namely:
>  - CP15 power control and diagnostic registers cannot be written directly,
>  - the way of setting boot address and boot flag is different,
>  - different resume handler needs to be used,
>  - dedicated SMC call needs to be performed instead of letting the CPU enter
>    WFI.
> 
> This series introduces .suspend() and .resume() firmware operations to
> perform low level firmware-specific suspend and resume and then leverages
> them to provide suspend-resume path meeting the above requirements. Three
> additional patches extend device tree sources of Trats2 board with necessary
> setup to enable suspend/resume support.
> 
> This series has been tested on Exynos4412-based Trats2 board, without any
> additional patches. Unfortunately v3.17-rc1 regressed ODROID support and
> suspend stopped working on those boards, due to unknown reasons still being
> investigated. It does not seem to be related to anything in this series,
> though, so I would not consider this as a stopper.
> 
> Changes since v2:
> (https://lkml.org/lkml/2014/7/17/431)
>  - added board-specific fixes for device tree sources of Trats2 board,
>  - rebased on next-20140826 of linux-next tree.
> 
> Changes since v1:
>  - dropped outer_resume() - will be handled in assembly in further patches,
>    as support for L2C in non-secure mode gets added,
>  - moved CP15 resume to assembly as it needs to be done before MMU is enabled,
>  - surrounded CP15 save with a check for cpuid part, because it is valid only
>    on Cortex A9,
>  - rebased on next-20140717 tag of linux-next tree.
> 
> Tomasz Figa (5):
>   ARM: firmware: Introduce suspend and resume operations
>   ARM: EXYNOS: Add support for firmware-assisted suspend/resume
>   ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
>   ARM: dts: exynos4x12: Add utility macro to define pin sleep states
>   ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
> 
>  Documentation/arm/firmware.txt            |  28 +--
>  arch/arm/boot/dts/exynos4412-trats2.dts   | 320 +++++++++++++++++++++++++++++-
>  arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
>  arch/arm/include/asm/firmware.h           |   8 +
>  arch/arm/mach-exynos/Makefile             |   1 +
>  arch/arm/mach-exynos/common.h             |   4 +
>  arch/arm/mach-exynos/firmware.c           |  45 +++++
>  arch/arm/mach-exynos/pm.c                 |  16 +-
>  arch/arm/mach-exynos/sleep.S              |  28 +++
>  arch/arm/mach-exynos/smc.h                |   4 +
>  10 files changed, 438 insertions(+), 32 deletions(-)
> 

Would you consider applying this series? It has been waiting on the ML
long enough (note no changes in core patches since last revision, just
few more board specific patches). Thanks in advance.

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
@ 2014-09-14 17:47   ` Tomasz Figa
  0 siblings, 0 replies; 27+ messages in thread
From: Tomasz Figa @ 2014-09-14 17:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kukjin,

On 26.08.2014 16:10, Tomasz Figa wrote:
> On Exynos-based boards running secure firmware the sequence of low level
> operations to enter and leave system-wide sleep mode is different than
> on those without the firmware. Namely:
>  - CP15 power control and diagnostic registers cannot be written directly,
>  - the way of setting boot address and boot flag is different,
>  - different resume handler needs to be used,
>  - dedicated SMC call needs to be performed instead of letting the CPU enter
>    WFI.
> 
> This series introduces .suspend() and .resume() firmware operations to
> perform low level firmware-specific suspend and resume and then leverages
> them to provide suspend-resume path meeting the above requirements. Three
> additional patches extend device tree sources of Trats2 board with necessary
> setup to enable suspend/resume support.
> 
> This series has been tested on Exynos4412-based Trats2 board, without any
> additional patches. Unfortunately v3.17-rc1 regressed ODROID support and
> suspend stopped working on those boards, due to unknown reasons still being
> investigated. It does not seem to be related to anything in this series,
> though, so I would not consider this as a stopper.
> 
> Changes since v2:
> (https://lkml.org/lkml/2014/7/17/431)
>  - added board-specific fixes for device tree sources of Trats2 board,
>  - rebased on next-20140826 of linux-next tree.
> 
> Changes since v1:
>  - dropped outer_resume() - will be handled in assembly in further patches,
>    as support for L2C in non-secure mode gets added,
>  - moved CP15 resume to assembly as it needs to be done before MMU is enabled,
>  - surrounded CP15 save with a check for cpuid part, because it is valid only
>    on Cortex A9,
>  - rebased on next-20140717 tag of linux-next tree.
> 
> Tomasz Figa (5):
>   ARM: firmware: Introduce suspend and resume operations
>   ARM: EXYNOS: Add support for firmware-assisted suspend/resume
>   ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
>   ARM: dts: exynos4x12: Add utility macro to define pin sleep states
>   ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
> 
>  Documentation/arm/firmware.txt            |  28 +--
>  arch/arm/boot/dts/exynos4412-trats2.dts   | 320 +++++++++++++++++++++++++++++-
>  arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
>  arch/arm/include/asm/firmware.h           |   8 +
>  arch/arm/mach-exynos/Makefile             |   1 +
>  arch/arm/mach-exynos/common.h             |   4 +
>  arch/arm/mach-exynos/firmware.c           |  45 +++++
>  arch/arm/mach-exynos/pm.c                 |  16 +-
>  arch/arm/mach-exynos/sleep.S              |  28 +++
>  arch/arm/mach-exynos/smc.h                |   4 +
>  10 files changed, 438 insertions(+), 32 deletions(-)
> 

Would you consider applying this series? It has been waiting on the ML
long enough (note no changes in core patches since last revision, just
few more board specific patches). Thanks in advance.

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
  2014-09-14 17:47   ` Tomasz Figa
@ 2014-09-15  0:21     ` Kukjin Kim
  -1 siblings, 0 replies; 27+ messages in thread
From: Kukjin Kim @ 2014-09-15  0:21 UTC (permalink / raw)
  To: 'Tomasz Figa', linux-samsung-soc
  Cc: linux-kernel, linux-arm-kernel,
	'Russell King - ARM Linux', 'Arnd Bergmann',
	swarren, acourbot, 'Marek Szyprowski',
	'Olof Johansson',
	drake, tomeu

Tomasz Figa wrote:
> 
> Hi Kukjin,
> 
Hi,

> On 26.08.2014 16:10, Tomasz Figa wrote:
> > On Exynos-based boards running secure firmware the sequence of low level
> > operations to enter and leave system-wide sleep mode is different than
> > on those without the firmware. Namely:
> >  - CP15 power control and diagnostic registers cannot be written directly,
> >  - the way of setting boot address and boot flag is different,
> >  - different resume handler needs to be used,
> >  - dedicated SMC call needs to be performed instead of letting the CPU enter
> >    WFI.
> >
> > This series introduces .suspend() and .resume() firmware operations to
> > perform low level firmware-specific suspend and resume and then leverages
> > them to provide suspend-resume path meeting the above requirements. Three
> > additional patches extend device tree sources of Trats2 board with necessary
> > setup to enable suspend/resume support.
> >
> > This series has been tested on Exynos4412-based Trats2 board, without any
> > additional patches. Unfortunately v3.17-rc1 regressed ODROID support and
> > suspend stopped working on those boards, due to unknown reasons still being
> > investigated. It does not seem to be related to anything in this series,
> > though, so I would not consider this as a stopper.
> >
> > Changes since v2:
> > (https://lkml.org/lkml/2014/7/17/431)
> >  - added board-specific fixes for device tree sources of Trats2 board,
> >  - rebased on next-20140826 of linux-next tree.
> >
> > Changes since v1:
> >  - dropped outer_resume() - will be handled in assembly in further patches,
> >    as support for L2C in non-secure mode gets added,
> >  - moved CP15 resume to assembly as it needs to be done before MMU is enabled,
> >  - surrounded CP15 save with a check for cpuid part, because it is valid only
> >    on Cortex A9,
> >  - rebased on next-20140717 tag of linux-next tree.
> >
> > Tomasz Figa (5):
> >   ARM: firmware: Introduce suspend and resume operations
> >   ARM: EXYNOS: Add support for firmware-assisted suspend/resume
> >   ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
> >   ARM: dts: exynos4x12: Add utility macro to define pin sleep states
> >   ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
> >
> >  Documentation/arm/firmware.txt            |  28 +--
> >  arch/arm/boot/dts/exynos4412-trats2.dts   | 320 +++++++++++++++++++++++++++++-
> >  arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
> >  arch/arm/include/asm/firmware.h           |   8 +
> >  arch/arm/mach-exynos/Makefile             |   1 +
> >  arch/arm/mach-exynos/common.h             |   4 +
> >  arch/arm/mach-exynos/firmware.c           |  45 +++++
> >  arch/arm/mach-exynos/pm.c                 |  16 +-
> >  arch/arm/mach-exynos/sleep.S              |  28 +++
> >  arch/arm/mach-exynos/smc.h                |   4 +
> >  10 files changed, 438 insertions(+), 32 deletions(-)
> >
> 
> Would you consider applying this series? It has been waiting on the ML
> long enough (note no changes in core patches since last revision, just
> few more board specific patches). Thanks in advance.
> 
Sure, I will. Thanks for your gentle reminder.

- Kukjin


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
@ 2014-09-15  0:21     ` Kukjin Kim
  0 siblings, 0 replies; 27+ messages in thread
From: Kukjin Kim @ 2014-09-15  0:21 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz Figa wrote:
> 
> Hi Kukjin,
> 
Hi,

> On 26.08.2014 16:10, Tomasz Figa wrote:
> > On Exynos-based boards running secure firmware the sequence of low level
> > operations to enter and leave system-wide sleep mode is different than
> > on those without the firmware. Namely:
> >  - CP15 power control and diagnostic registers cannot be written directly,
> >  - the way of setting boot address and boot flag is different,
> >  - different resume handler needs to be used,
> >  - dedicated SMC call needs to be performed instead of letting the CPU enter
> >    WFI.
> >
> > This series introduces .suspend() and .resume() firmware operations to
> > perform low level firmware-specific suspend and resume and then leverages
> > them to provide suspend-resume path meeting the above requirements. Three
> > additional patches extend device tree sources of Trats2 board with necessary
> > setup to enable suspend/resume support.
> >
> > This series has been tested on Exynos4412-based Trats2 board, without any
> > additional patches. Unfortunately v3.17-rc1 regressed ODROID support and
> > suspend stopped working on those boards, due to unknown reasons still being
> > investigated. It does not seem to be related to anything in this series,
> > though, so I would not consider this as a stopper.
> >
> > Changes since v2:
> > (https://lkml.org/lkml/2014/7/17/431)
> >  - added board-specific fixes for device tree sources of Trats2 board,
> >  - rebased on next-20140826 of linux-next tree.
> >
> > Changes since v1:
> >  - dropped outer_resume() - will be handled in assembly in further patches,
> >    as support for L2C in non-secure mode gets added,
> >  - moved CP15 resume to assembly as it needs to be done before MMU is enabled,
> >  - surrounded CP15 save with a check for cpuid part, because it is valid only
> >    on Cortex A9,
> >  - rebased on next-20140717 tag of linux-next tree.
> >
> > Tomasz Figa (5):
> >   ARM: firmware: Introduce suspend and resume operations
> >   ARM: EXYNOS: Add support for firmware-assisted suspend/resume
> >   ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
> >   ARM: dts: exynos4x12: Add utility macro to define pin sleep states
> >   ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
> >
> >  Documentation/arm/firmware.txt            |  28 +--
> >  arch/arm/boot/dts/exynos4412-trats2.dts   | 320 +++++++++++++++++++++++++++++-
> >  arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
> >  arch/arm/include/asm/firmware.h           |   8 +
> >  arch/arm/mach-exynos/Makefile             |   1 +
> >  arch/arm/mach-exynos/common.h             |   4 +
> >  arch/arm/mach-exynos/firmware.c           |  45 +++++
> >  arch/arm/mach-exynos/pm.c                 |  16 +-
> >  arch/arm/mach-exynos/sleep.S              |  28 +++
> >  arch/arm/mach-exynos/smc.h                |   4 +
> >  10 files changed, 438 insertions(+), 32 deletions(-)
> >
> 
> Would you consider applying this series? It has been waiting on the ML
> long enough (note no changes in core patches since last revision, just
> few more board specific patches). Thanks in advance.
> 
Sure, I will. Thanks for your gentle reminder.

- Kukjin

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 1/5] ARM: firmware: Introduce suspend and resume operations
  2014-08-26 14:10   ` Tomasz Figa
  (?)
@ 2014-09-23 16:31     ` Kukjin Kim
  -1 siblings, 0 replies; 27+ messages in thread
From: Kukjin Kim @ 2014-09-23 16:31 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: linux-samsung-soc, Kukjin Kim, Russell King - ARM Linux,
	Arnd Bergmann, linux-kernel, Tomasz Figa, acourbot, tomeu,
	Olof Johansson, swarren, drake, linux-arm-kernel,
	Marek Szyprowski, Tomasz Figa

On 08/26/14 23:10, Tomasz Figa wrote:
> This patch extends the firmware_ops structure with two new callbacks:
> .suspend() and .resume(). The former is intended to ask the firmware to
> save all its volatile state and suspend the system, without returning
> back to the kernel in between. The latter is to be called early by
> very low level platform suspend code after waking up to restore low
> level hardware state, which can't be restored in non-secure mode.
>
> While at it, outdated version of the structure is removed from the
> documentation and replaced with a reference to the header file.
>
> Signed-off-by: Tomasz Figa<t.figa@samsung.com>
> Acked-by: Alexandre Courbot<acourbot@nvidia.com>
> ---
>   Documentation/arm/firmware.txt  | 28 +++++-----------------------
>   arch/arm/include/asm/firmware.h |  8 ++++++++
>   2 files changed, 13 insertions(+), 23 deletions(-)
>
> diff --git a/Documentation/arm/firmware.txt b/Documentation/arm/firmware.txt
> index c2e468f..da6713a 100644
> --- a/Documentation/arm/firmware.txt
> +++ b/Documentation/arm/firmware.txt
> @@ -7,32 +7,14 @@ world, which changes the way some things have to be initialized. This makes
>   a need to provide an interface for such platforms to specify available firmware
>   operations and call them when needed.
>
> -Firmware operations can be specified using struct firmware_ops
> -
> -	struct firmware_ops {
> -		/*
> -		* Enters CPU idle mode
> -		*/
> -		int (*do_idle)(void);
> -		/*
> -		* Sets boot address of specified physical CPU
> -		*/
> -		int (*set_cpu_boot_addr)(int cpu, unsigned long boot_addr);
> -		/*
> -		* Boots specified physical CPU
> -		*/
> -		int (*cpu_boot)(int cpu);
> -		/*
> -		* Initializes L2 cache
> -		*/
> -		int (*l2x0_init)(void);
> -	};
> -
> -and then registered with register_firmware_ops function
> +Firmware operations can be specified by filling in a struct firmware_ops
> +with appropriate callbacks and then registering it with register_firmware_ops()
> +function.
>
>   	void register_firmware_ops(const struct firmware_ops *ops)
>
> -the ops pointer must be non-NULL.
> +The ops pointer must be non-NULL. More information about struct firmware_ops
> +and its members can be found in arch/arm/include/asm/firmware.h header.
>
>   There is a default, empty set of operations provided, so there is no need to
>   set anything if platform does not require firmware operations.
> diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h
> index 2c9f10d..5904f59 100644
> --- a/arch/arm/include/asm/firmware.h
> +++ b/arch/arm/include/asm/firmware.h
> @@ -41,6 +41,14 @@ struct firmware_ops {
>   	 * Initializes L2 cache
>   	 */
>   	int (*l2x0_init)(void);
> +	/*
> +	 * Enter system-wide suspend.
> +	 */
> +	int (*suspend)(void);
> +	/*
> +	 * Restore state of privileged hardware after system-wide suspend.
> +	 */
> +	int (*resume)(void);
>   };
>
>   /* Global pointer for current firmware_ops structure, can't be NULL. */

Hi Russell,

I've applied this in samsung tree for exynos stuff, if you have any 
objection, please kindly let me know.

Thanks,
Kukjin

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 1/5] ARM: firmware: Introduce suspend and resume operations
@ 2014-09-23 16:31     ` Kukjin Kim
  0 siblings, 0 replies; 27+ messages in thread
From: Kukjin Kim @ 2014-09-23 16:31 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: linux-samsung-soc, Kukjin Kim, Russell King - ARM Linux,
	Arnd Bergmann, linux-kernel, Tomasz Figa, acourbot, tomeu,
	Olof Johansson, swarren, drake, linux-arm-kernel,
	Marek Szyprowski

On 08/26/14 23:10, Tomasz Figa wrote:
> This patch extends the firmware_ops structure with two new callbacks:
> .suspend() and .resume(). The former is intended to ask the firmware to
> save all its volatile state and suspend the system, without returning
> back to the kernel in between. The latter is to be called early by
> very low level platform suspend code after waking up to restore low
> level hardware state, which can't be restored in non-secure mode.
>
> While at it, outdated version of the structure is removed from the
> documentation and replaced with a reference to the header file.
>
> Signed-off-by: Tomasz Figa<t.figa@samsung.com>
> Acked-by: Alexandre Courbot<acourbot@nvidia.com>
> ---
>   Documentation/arm/firmware.txt  | 28 +++++-----------------------
>   arch/arm/include/asm/firmware.h |  8 ++++++++
>   2 files changed, 13 insertions(+), 23 deletions(-)
>
> diff --git a/Documentation/arm/firmware.txt b/Documentation/arm/firmware.txt
> index c2e468f..da6713a 100644
> --- a/Documentation/arm/firmware.txt
> +++ b/Documentation/arm/firmware.txt
> @@ -7,32 +7,14 @@ world, which changes the way some things have to be initialized. This makes
>   a need to provide an interface for such platforms to specify available firmware
>   operations and call them when needed.
>
> -Firmware operations can be specified using struct firmware_ops
> -
> -	struct firmware_ops {
> -		/*
> -		* Enters CPU idle mode
> -		*/
> -		int (*do_idle)(void);
> -		/*
> -		* Sets boot address of specified physical CPU
> -		*/
> -		int (*set_cpu_boot_addr)(int cpu, unsigned long boot_addr);
> -		/*
> -		* Boots specified physical CPU
> -		*/
> -		int (*cpu_boot)(int cpu);
> -		/*
> -		* Initializes L2 cache
> -		*/
> -		int (*l2x0_init)(void);
> -	};
> -
> -and then registered with register_firmware_ops function
> +Firmware operations can be specified by filling in a struct firmware_ops
> +with appropriate callbacks and then registering it with register_firmware_ops()
> +function.
>
>   	void register_firmware_ops(const struct firmware_ops *ops)
>
> -the ops pointer must be non-NULL.
> +The ops pointer must be non-NULL. More information about struct firmware_ops
> +and its members can be found in arch/arm/include/asm/firmware.h header.
>
>   There is a default, empty set of operations provided, so there is no need to
>   set anything if platform does not require firmware operations.
> diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h
> index 2c9f10d..5904f59 100644
> --- a/arch/arm/include/asm/firmware.h
> +++ b/arch/arm/include/asm/firmware.h
> @@ -41,6 +41,14 @@ struct firmware_ops {
>   	 * Initializes L2 cache
>   	 */
>   	int (*l2x0_init)(void);
> +	/*
> +	 * Enter system-wide suspend.
> +	 */
> +	int (*suspend)(void);
> +	/*
> +	 * Restore state of privileged hardware after system-wide suspend.
> +	 */
> +	int (*resume)(void);
>   };
>
>   /* Global pointer for current firmware_ops structure, can't be NULL. */

Hi Russell,

I've applied this in samsung tree for exynos stuff, if you have any 
objection, please kindly let me know.

Thanks,
Kukjin

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v3 1/5] ARM: firmware: Introduce suspend and resume operations
@ 2014-09-23 16:31     ` Kukjin Kim
  0 siblings, 0 replies; 27+ messages in thread
From: Kukjin Kim @ 2014-09-23 16:31 UTC (permalink / raw)
  To: linux-arm-kernel

On 08/26/14 23:10, Tomasz Figa wrote:
> This patch extends the firmware_ops structure with two new callbacks:
> .suspend() and .resume(). The former is intended to ask the firmware to
> save all its volatile state and suspend the system, without returning
> back to the kernel in between. The latter is to be called early by
> very low level platform suspend code after waking up to restore low
> level hardware state, which can't be restored in non-secure mode.
>
> While at it, outdated version of the structure is removed from the
> documentation and replaced with a reference to the header file.
>
> Signed-off-by: Tomasz Figa<t.figa@samsung.com>
> Acked-by: Alexandre Courbot<acourbot@nvidia.com>
> ---
>   Documentation/arm/firmware.txt  | 28 +++++-----------------------
>   arch/arm/include/asm/firmware.h |  8 ++++++++
>   2 files changed, 13 insertions(+), 23 deletions(-)
>
> diff --git a/Documentation/arm/firmware.txt b/Documentation/arm/firmware.txt
> index c2e468f..da6713a 100644
> --- a/Documentation/arm/firmware.txt
> +++ b/Documentation/arm/firmware.txt
> @@ -7,32 +7,14 @@ world, which changes the way some things have to be initialized. This makes
>   a need to provide an interface for such platforms to specify available firmware
>   operations and call them when needed.
>
> -Firmware operations can be specified using struct firmware_ops
> -
> -	struct firmware_ops {
> -		/*
> -		* Enters CPU idle mode
> -		*/
> -		int (*do_idle)(void);
> -		/*
> -		* Sets boot address of specified physical CPU
> -		*/
> -		int (*set_cpu_boot_addr)(int cpu, unsigned long boot_addr);
> -		/*
> -		* Boots specified physical CPU
> -		*/
> -		int (*cpu_boot)(int cpu);
> -		/*
> -		* Initializes L2 cache
> -		*/
> -		int (*l2x0_init)(void);
> -	};
> -
> -and then registered with register_firmware_ops function
> +Firmware operations can be specified by filling in a struct firmware_ops
> +with appropriate callbacks and then registering it with register_firmware_ops()
> +function.
>
>   	void register_firmware_ops(const struct firmware_ops *ops)
>
> -the ops pointer must be non-NULL.
> +The ops pointer must be non-NULL. More information about struct firmware_ops
> +and its members can be found in arch/arm/include/asm/firmware.h header.
>
>   There is a default, empty set of operations provided, so there is no need to
>   set anything if platform does not require firmware operations.
> diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h
> index 2c9f10d..5904f59 100644
> --- a/arch/arm/include/asm/firmware.h
> +++ b/arch/arm/include/asm/firmware.h
> @@ -41,6 +41,14 @@ struct firmware_ops {
>   	 * Initializes L2 cache
>   	 */
>   	int (*l2x0_init)(void);
> +	/*
> +	 * Enter system-wide suspend.
> +	 */
> +	int (*suspend)(void);
> +	/*
> +	 * Restore state of privileged hardware after system-wide suspend.
> +	 */
> +	int (*resume)(void);
>   };
>
>   /* Global pointer for current firmware_ops structure, can't be NULL. */

Hi Russell,

I've applied this in samsung tree for exynos stuff, if you have any 
objection, please kindly let me know.

Thanks,
Kukjin

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
  2014-09-15  0:21     ` Kukjin Kim
@ 2014-09-24  7:53       ` Kukjin Kim
  -1 siblings, 0 replies; 27+ messages in thread
From: Kukjin Kim @ 2014-09-24  7:53 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: 'Tomasz Figa',
	linux-samsung-soc, linux-kernel, linux-arm-kernel,
	'Russell King - ARM Linux', 'Arnd Bergmann',
	swarren, acourbot, 'Marek Szyprowski',
	'Olof Johansson',
	drake, tomeu



On 09/15/14 09:21, Kukjin Kim wrote:
> Tomasz Figa wrote:
>>
>> Hi Kukjin,
>>
> Hi,
>
>> On 26.08.2014 16:10, Tomasz Figa wrote:
>>> On Exynos-based boards running secure firmware the sequence of low level
>>> operations to enter and leave system-wide sleep mode is different than
>>> on those without the firmware. Namely:
>>>   - CP15 power control and diagnostic registers cannot be written directly,
>>>   - the way of setting boot address and boot flag is different,
>>>   - different resume handler needs to be used,
>>>   - dedicated SMC call needs to be performed instead of letting the CPU enter
>>>     WFI.
>>>
>>> This series introduces .suspend() and .resume() firmware operations to
>>> perform low level firmware-specific suspend and resume and then leverages
>>> them to provide suspend-resume path meeting the above requirements. Three
>>> additional patches extend device tree sources of Trats2 board with necessary
>>> setup to enable suspend/resume support.
>>>
>>> This series has been tested on Exynos4412-based Trats2 board, without any
>>> additional patches. Unfortunately v3.17-rc1 regressed ODROID support and
>>> suspend stopped working on those boards, due to unknown reasons still being
>>> investigated. It does not seem to be related to anything in this series,
>>> though, so I would not consider this as a stopper.
>>>
>>> Changes since v2:
>>> (https://lkml.org/lkml/2014/7/17/431)
>>>   - added board-specific fixes for device tree sources of Trats2 board,
>>>   - rebased on next-20140826 of linux-next tree.
>>>
>>> Changes since v1:
>>>   - dropped outer_resume() - will be handled in assembly in further patches,
>>>     as support for L2C in non-secure mode gets added,
>>>   - moved CP15 resume to assembly as it needs to be done before MMU is enabled,
>>>   - surrounded CP15 save with a check for cpuid part, because it is valid only
>>>     on Cortex A9,
>>>   - rebased on next-20140717 tag of linux-next tree.
>>>
>>> Tomasz Figa (5):
>>>    ARM: firmware: Introduce suspend and resume operations
>>>    ARM: EXYNOS: Add support for firmware-assisted suspend/resume
>>>    ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
>>>    ARM: dts: exynos4x12: Add utility macro to define pin sleep states
>>>    ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
>>>
>>>   Documentation/arm/firmware.txt            |  28 +--
>>>   arch/arm/boot/dts/exynos4412-trats2.dts   | 320 +++++++++++++++++++++++++++++-
>>>   arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
>>>   arch/arm/include/asm/firmware.h           |   8 +
>>>   arch/arm/mach-exynos/Makefile             |   1 +
>>>   arch/arm/mach-exynos/common.h             |   4 +
>>>   arch/arm/mach-exynos/firmware.c           |  45 +++++
>>>   arch/arm/mach-exynos/pm.c                 |  16 +-
>>>   arch/arm/mach-exynos/sleep.S              |  28 +++
>>>   arch/arm/mach-exynos/smc.h                |   4 +
>>>   10 files changed, 438 insertions(+), 32 deletions(-)
>>>
>>
>> Would you consider applying this series? It has been waiting on the ML
>> long enough (note no changes in core patches since last revision, just
>> few more board specific patches). Thanks in advance.
>>
> Sure, I will. Thanks for your gentle reminder.
>
I've reverted this series because of following.

In file included from arch/arm/mach-tegra/cpuidle-tegra114.c:17:0:
arch/arm/mach-tegra/cpuidle-tegra114.c: In function 
'tegra114_idle_power_down':
arch/arm/include/asm/firmware.h:64:24: error: too few arguments to 
function 'firmware_ops->do_idle'
   ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
                         ^
arch/arm/mach-tegra/cpuidle-tegra114.c:52:6: note: in expansion of macro 
'call_firmware_op'
   if (call_firmware_op(do_idle) == -ENOSYS)
       ^

Caused by commit f5217f3b9332 ("ARM: EXYNOS: add AFTR mode support to
firmware do_idle method").

Need to fix...

- Kukjin

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
@ 2014-09-24  7:53       ` Kukjin Kim
  0 siblings, 0 replies; 27+ messages in thread
From: Kukjin Kim @ 2014-09-24  7:53 UTC (permalink / raw)
  To: linux-arm-kernel



On 09/15/14 09:21, Kukjin Kim wrote:
> Tomasz Figa wrote:
>>
>> Hi Kukjin,
>>
> Hi,
>
>> On 26.08.2014 16:10, Tomasz Figa wrote:
>>> On Exynos-based boards running secure firmware the sequence of low level
>>> operations to enter and leave system-wide sleep mode is different than
>>> on those without the firmware. Namely:
>>>   - CP15 power control and diagnostic registers cannot be written directly,
>>>   - the way of setting boot address and boot flag is different,
>>>   - different resume handler needs to be used,
>>>   - dedicated SMC call needs to be performed instead of letting the CPU enter
>>>     WFI.
>>>
>>> This series introduces .suspend() and .resume() firmware operations to
>>> perform low level firmware-specific suspend and resume and then leverages
>>> them to provide suspend-resume path meeting the above requirements. Three
>>> additional patches extend device tree sources of Trats2 board with necessary
>>> setup to enable suspend/resume support.
>>>
>>> This series has been tested on Exynos4412-based Trats2 board, without any
>>> additional patches. Unfortunately v3.17-rc1 regressed ODROID support and
>>> suspend stopped working on those boards, due to unknown reasons still being
>>> investigated. It does not seem to be related to anything in this series,
>>> though, so I would not consider this as a stopper.
>>>
>>> Changes since v2:
>>> (https://lkml.org/lkml/2014/7/17/431)
>>>   - added board-specific fixes for device tree sources of Trats2 board,
>>>   - rebased on next-20140826 of linux-next tree.
>>>
>>> Changes since v1:
>>>   - dropped outer_resume() - will be handled in assembly in further patches,
>>>     as support for L2C in non-secure mode gets added,
>>>   - moved CP15 resume to assembly as it needs to be done before MMU is enabled,
>>>   - surrounded CP15 save with a check for cpuid part, because it is valid only
>>>     on Cortex A9,
>>>   - rebased on next-20140717 tag of linux-next tree.
>>>
>>> Tomasz Figa (5):
>>>    ARM: firmware: Introduce suspend and resume operations
>>>    ARM: EXYNOS: Add support for firmware-assisted suspend/resume
>>>    ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
>>>    ARM: dts: exynos4x12: Add utility macro to define pin sleep states
>>>    ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
>>>
>>>   Documentation/arm/firmware.txt            |  28 +--
>>>   arch/arm/boot/dts/exynos4412-trats2.dts   | 320 +++++++++++++++++++++++++++++-
>>>   arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
>>>   arch/arm/include/asm/firmware.h           |   8 +
>>>   arch/arm/mach-exynos/Makefile             |   1 +
>>>   arch/arm/mach-exynos/common.h             |   4 +
>>>   arch/arm/mach-exynos/firmware.c           |  45 +++++
>>>   arch/arm/mach-exynos/pm.c                 |  16 +-
>>>   arch/arm/mach-exynos/sleep.S              |  28 +++
>>>   arch/arm/mach-exynos/smc.h                |   4 +
>>>   10 files changed, 438 insertions(+), 32 deletions(-)
>>>
>>
>> Would you consider applying this series? It has been waiting on the ML
>> long enough (note no changes in core patches since last revision, just
>> few more board specific patches). Thanks in advance.
>>
> Sure, I will. Thanks for your gentle reminder.
>
I've reverted this series because of following.

In file included from arch/arm/mach-tegra/cpuidle-tegra114.c:17:0:
arch/arm/mach-tegra/cpuidle-tegra114.c: In function 
'tegra114_idle_power_down':
arch/arm/include/asm/firmware.h:64:24: error: too few arguments to 
function 'firmware_ops->do_idle'
   ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
                         ^
arch/arm/mach-tegra/cpuidle-tegra114.c:52:6: note: in expansion of macro 
'call_firmware_op'
   if (call_firmware_op(do_idle) == -ENOSYS)
       ^

Caused by commit f5217f3b9332 ("ARM: EXYNOS: add AFTR mode support to
firmware do_idle method").

Need to fix...

- Kukjin

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
  2014-09-24  7:53       ` Kukjin Kim
@ 2014-09-24  8:23         ` Marek Szyprowski
  -1 siblings, 0 replies; 27+ messages in thread
From: Marek Szyprowski @ 2014-09-24  8:23 UTC (permalink / raw)
  To: Kukjin Kim, Kukjin Kim
  Cc: 'Tomasz Figa',
	linux-samsung-soc, linux-kernel, linux-arm-kernel,
	'Russell King - ARM Linux', 'Arnd Bergmann',
	swarren, acourbot, 'Olof Johansson',
	drake, tomeu

Hi Kukjin,

On 2014-09-24 09:53, Kukjin Kim wrote:
>
> On 09/15/14 09:21, Kukjin Kim wrote:
>>
>>> On 26.08.2014 16:10, Tomasz Figa wrote:
>>>> On Exynos-based boards running secure firmware the sequence of low 
>>>> level
>>>> operations to enter and leave system-wide sleep mode is different than
>>>> on those without the firmware. Namely:
>>>>   - CP15 power control and diagnostic registers cannot be written 
>>>> directly,
>>>>   - the way of setting boot address and boot flag is different,
>>>>   - different resume handler needs to be used,
>>>>   - dedicated SMC call needs to be performed instead of letting the 
>>>> CPU enter
>>>>     WFI.
>>>>
>>>> This series introduces .suspend() and .resume() firmware operations to
>>>> perform low level firmware-specific suspend and resume and then 
>>>> leverages
>>>> them to provide suspend-resume path meeting the above requirements. 
>>>> Three
>>>> additional patches extend device tree sources of Trats2 board with 
>>>> necessary
>>>> setup to enable suspend/resume support.
>>>>
>>>> This series has been tested on Exynos4412-based Trats2 board, 
>>>> without any
>>>> additional patches. Unfortunately v3.17-rc1 regressed ODROID 
>>>> support and
>>>> suspend stopped working on those boards, due to unknown reasons 
>>>> still being
>>>> investigated. It does not seem to be related to anything in this 
>>>> series,
>>>> though, so I would not consider this as a stopper.
>>>>
>>>> Changes since v2:
>>>> (https://lkml.org/lkml/2014/7/17/431)
>>>>   - added board-specific fixes for device tree sources of Trats2 
>>>> board,
>>>>   - rebased on next-20140826 of linux-next tree.
>>>>
>>>> Changes since v1:
>>>>   - dropped outer_resume() - will be handled in assembly in further 
>>>> patches,
>>>>     as support for L2C in non-secure mode gets added,
>>>>   - moved CP15 resume to assembly as it needs to be done before MMU 
>>>> is enabled,
>>>>   - surrounded CP15 save with a check for cpuid part, because it is 
>>>> valid only
>>>>     on Cortex A9,
>>>>   - rebased on next-20140717 tag of linux-next tree.
>>>>
>>>> Tomasz Figa (5):
>>>>    ARM: firmware: Introduce suspend and resume operations
>>>>    ARM: EXYNOS: Add support for firmware-assisted suspend/resume
>>>>    ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
>>>>    ARM: dts: exynos4x12: Add utility macro to define pin sleep states
>>>>    ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
>>>>
>>>>   Documentation/arm/firmware.txt            |  28 +--
>>>>   arch/arm/boot/dts/exynos4412-trats2.dts   | 320 
>>>> +++++++++++++++++++++++++++++-
>>>>   arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
>>>>   arch/arm/include/asm/firmware.h           |   8 +
>>>>   arch/arm/mach-exynos/Makefile             |   1 +
>>>>   arch/arm/mach-exynos/common.h             |   4 +
>>>>   arch/arm/mach-exynos/firmware.c           |  45 +++++
>>>>   arch/arm/mach-exynos/pm.c                 |  16 +-
>>>>   arch/arm/mach-exynos/sleep.S              |  28 +++
>>>>   arch/arm/mach-exynos/smc.h                |   4 +
>>>>   10 files changed, 438 insertions(+), 32 deletions(-)
>>>>
>>>
>>> Would you consider applying this series? It has been waiting on the ML
>>> long enough (note no changes in core patches since last revision, just
>>> few more board specific patches). Thanks in advance.
>>>
>> Sure, I will. Thanks for your gentle reminder.
>>
> I've reverted this series because of following.
>
> In file included from arch/arm/mach-tegra/cpuidle-tegra114.c:17:0:
> arch/arm/mach-tegra/cpuidle-tegra114.c: In function 
> 'tegra114_idle_power_down':
> arch/arm/include/asm/firmware.h:64:24: error: too few arguments to 
> function 'firmware_ops->do_idle'
>   ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
>                         ^
> arch/arm/mach-tegra/cpuidle-tegra114.c:52:6: note: in expansion of 
> macro 'call_firmware_op'
>   if (call_firmware_op(do_idle) == -ENOSYS)
>       ^
>
> Caused by commit f5217f3b9332 ("ARM: EXYNOS: add AFTR mode support to
> firmware do_idle method").
>
> Need to fix...

I don't get why you have reverted the main feature of "Firmware-assisted 
suspend/resume
of Exynos SoCs" because of an issue on the completely independent 
patchset which adds
AFTR idle mode support. Could you please keep the "ARM: firmware: 
Introduce suspend
and resume operations" and "ARM: EXYNOS: Add support for firmware-assisted
suspend/resume" patches?

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
@ 2014-09-24  8:23         ` Marek Szyprowski
  0 siblings, 0 replies; 27+ messages in thread
From: Marek Szyprowski @ 2014-09-24  8:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kukjin,

On 2014-09-24 09:53, Kukjin Kim wrote:
>
> On 09/15/14 09:21, Kukjin Kim wrote:
>>
>>> On 26.08.2014 16:10, Tomasz Figa wrote:
>>>> On Exynos-based boards running secure firmware the sequence of low 
>>>> level
>>>> operations to enter and leave system-wide sleep mode is different than
>>>> on those without the firmware. Namely:
>>>>   - CP15 power control and diagnostic registers cannot be written 
>>>> directly,
>>>>   - the way of setting boot address and boot flag is different,
>>>>   - different resume handler needs to be used,
>>>>   - dedicated SMC call needs to be performed instead of letting the 
>>>> CPU enter
>>>>     WFI.
>>>>
>>>> This series introduces .suspend() and .resume() firmware operations to
>>>> perform low level firmware-specific suspend and resume and then 
>>>> leverages
>>>> them to provide suspend-resume path meeting the above requirements. 
>>>> Three
>>>> additional patches extend device tree sources of Trats2 board with 
>>>> necessary
>>>> setup to enable suspend/resume support.
>>>>
>>>> This series has been tested on Exynos4412-based Trats2 board, 
>>>> without any
>>>> additional patches. Unfortunately v3.17-rc1 regressed ODROID 
>>>> support and
>>>> suspend stopped working on those boards, due to unknown reasons 
>>>> still being
>>>> investigated. It does not seem to be related to anything in this 
>>>> series,
>>>> though, so I would not consider this as a stopper.
>>>>
>>>> Changes since v2:
>>>> (https://lkml.org/lkml/2014/7/17/431)
>>>>   - added board-specific fixes for device tree sources of Trats2 
>>>> board,
>>>>   - rebased on next-20140826 of linux-next tree.
>>>>
>>>> Changes since v1:
>>>>   - dropped outer_resume() - will be handled in assembly in further 
>>>> patches,
>>>>     as support for L2C in non-secure mode gets added,
>>>>   - moved CP15 resume to assembly as it needs to be done before MMU 
>>>> is enabled,
>>>>   - surrounded CP15 save with a check for cpuid part, because it is 
>>>> valid only
>>>>     on Cortex A9,
>>>>   - rebased on next-20140717 tag of linux-next tree.
>>>>
>>>> Tomasz Figa (5):
>>>>    ARM: firmware: Introduce suspend and resume operations
>>>>    ARM: EXYNOS: Add support for firmware-assisted suspend/resume
>>>>    ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
>>>>    ARM: dts: exynos4x12: Add utility macro to define pin sleep states
>>>>    ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
>>>>
>>>>   Documentation/arm/firmware.txt            |  28 +--
>>>>   arch/arm/boot/dts/exynos4412-trats2.dts   | 320 
>>>> +++++++++++++++++++++++++++++-
>>>>   arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |  16 ++
>>>>   arch/arm/include/asm/firmware.h           |   8 +
>>>>   arch/arm/mach-exynos/Makefile             |   1 +
>>>>   arch/arm/mach-exynos/common.h             |   4 +
>>>>   arch/arm/mach-exynos/firmware.c           |  45 +++++
>>>>   arch/arm/mach-exynos/pm.c                 |  16 +-
>>>>   arch/arm/mach-exynos/sleep.S              |  28 +++
>>>>   arch/arm/mach-exynos/smc.h                |   4 +
>>>>   10 files changed, 438 insertions(+), 32 deletions(-)
>>>>
>>>
>>> Would you consider applying this series? It has been waiting on the ML
>>> long enough (note no changes in core patches since last revision, just
>>> few more board specific patches). Thanks in advance.
>>>
>> Sure, I will. Thanks for your gentle reminder.
>>
> I've reverted this series because of following.
>
> In file included from arch/arm/mach-tegra/cpuidle-tegra114.c:17:0:
> arch/arm/mach-tegra/cpuidle-tegra114.c: In function 
> 'tegra114_idle_power_down':
> arch/arm/include/asm/firmware.h:64:24: error: too few arguments to 
> function 'firmware_ops->do_idle'
>   ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
>                         ^
> arch/arm/mach-tegra/cpuidle-tegra114.c:52:6: note: in expansion of 
> macro 'call_firmware_op'
>   if (call_firmware_op(do_idle) == -ENOSYS)
>       ^
>
> Caused by commit f5217f3b9332 ("ARM: EXYNOS: add AFTR mode support to
> firmware do_idle method").
>
> Need to fix...

I don't get why you have reverted the main feature of "Firmware-assisted 
suspend/resume
of Exynos SoCs" because of an issue on the completely independent 
patchset which adds
AFTR idle mode support. Could you please keep the "ARM: firmware: 
Introduce suspend
and resume operations" and "ARM: EXYNOS: Add support for firmware-assisted
suspend/resume" patches?

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
  2014-09-24  8:23         ` Marek Szyprowski
@ 2014-09-24  8:42           ` Kukjin Kim
  -1 siblings, 0 replies; 27+ messages in thread
From: Kukjin Kim @ 2014-09-24  8:42 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Kukjin Kim, Kukjin Kim, linux-samsung-soc,
	'Russell King - ARM Linux', 'Arnd Bergmann',
	'Tomasz Figa',
	linux-kernel, acourbot, tomeu, 'Olof Johansson',
	swarren, drake, linux-arm-kernel

On 09/24/14 17:23, Marek Szyprowski wrote:
> Hi Kukjin,
>
> On 2014-09-24 09:53, Kukjin Kim wrote:
>>
>> On 09/15/14 09:21, Kukjin Kim wrote:
>>>
>>>> On 26.08.2014 16:10, Tomasz Figa wrote:
>>>>> On Exynos-based boards running secure firmware the sequence of low
>>>>> level
>>>>> operations to enter and leave system-wide sleep mode is different than
>>>>> on those without the firmware. Namely:
>>>>> - CP15 power control and diagnostic registers cannot be written
>>>>> directly,
>>>>> - the way of setting boot address and boot flag is different,
>>>>> - different resume handler needs to be used,
>>>>> - dedicated SMC call needs to be performed instead of letting the
>>>>> CPU enter
>>>>> WFI.
>>>>>
>>>>> This series introduces .suspend() and .resume() firmware operations to
>>>>> perform low level firmware-specific suspend and resume and then
>>>>> leverages
>>>>> them to provide suspend-resume path meeting the above requirements.
>>>>> Three
>>>>> additional patches extend device tree sources of Trats2 board with
>>>>> necessary
>>>>> setup to enable suspend/resume support.
>>>>>
>>>>> This series has been tested on Exynos4412-based Trats2 board,
>>>>> without any
>>>>> additional patches. Unfortunately v3.17-rc1 regressed ODROID
>>>>> support and
>>>>> suspend stopped working on those boards, due to unknown reasons
>>>>> still being
>>>>> investigated. It does not seem to be related to anything in this
>>>>> series,
>>>>> though, so I would not consider this as a stopper.
>>>>>
>>>>> Changes since v2:
>>>>> (https://lkml.org/lkml/2014/7/17/431)
>>>>> - added board-specific fixes for device tree sources of Trats2 board,
>>>>> - rebased on next-20140826 of linux-next tree.
>>>>>
>>>>> Changes since v1:
>>>>> - dropped outer_resume() - will be handled in assembly in further
>>>>> patches,
>>>>> as support for L2C in non-secure mode gets added,
>>>>> - moved CP15 resume to assembly as it needs to be done before MMU
>>>>> is enabled,
>>>>> - surrounded CP15 save with a check for cpuid part, because it is
>>>>> valid only
>>>>> on Cortex A9,
>>>>> - rebased on next-20140717 tag of linux-next tree.
>>>>>
>>>>> Tomasz Figa (5):
>>>>> ARM: firmware: Introduce suspend and resume operations
>>>>> ARM: EXYNOS: Add support for firmware-assisted suspend/resume
>>>>> ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
>>>>> ARM: dts: exynos4x12: Add utility macro to define pin sleep states
>>>>> ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
>>>>>
>>>>> Documentation/arm/firmware.txt | 28 +--
>>>>> arch/arm/boot/dts/exynos4412-trats2.dts | 320
>>>>> +++++++++++++++++++++++++++++-
>>>>> arch/arm/boot/dts/exynos4x12-pinctrl.dtsi | 16 ++
>>>>> arch/arm/include/asm/firmware.h | 8 +
>>>>> arch/arm/mach-exynos/Makefile | 1 +
>>>>> arch/arm/mach-exynos/common.h | 4 +
>>>>> arch/arm/mach-exynos/firmware.c | 45 +++++
>>>>> arch/arm/mach-exynos/pm.c | 16 +-
>>>>> arch/arm/mach-exynos/sleep.S | 28 +++
>>>>> arch/arm/mach-exynos/smc.h | 4 +
>>>>> 10 files changed, 438 insertions(+), 32 deletions(-)
>>>>>
>>>>
>>>> Would you consider applying this series? It has been waiting on the ML
>>>> long enough (note no changes in core patches since last revision, just
>>>> few more board specific patches). Thanks in advance.
>>>>
>>> Sure, I will. Thanks for your gentle reminder.
>>>
>> I've reverted this series because of following.
>>
>> In file included from arch/arm/mach-tegra/cpuidle-tegra114.c:17:0:
>> arch/arm/mach-tegra/cpuidle-tegra114.c: In function
>> 'tegra114_idle_power_down':
>> arch/arm/include/asm/firmware.h:64:24: error: too few arguments to
>> function 'firmware_ops->do_idle'
>> ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
>> ^
>> arch/arm/mach-tegra/cpuidle-tegra114.c:52:6: note: in expansion of
>> macro 'call_firmware_op'
>> if (call_firmware_op(do_idle) == -ENOSYS)
>> ^
>>
>> Caused by commit f5217f3b9332 ("ARM: EXYNOS: add AFTR mode support to
>> firmware do_idle method").
>>
>> Need to fix...
>
> I don't get why you have reverted the main feature of "Firmware-assisted
> suspend/resume
> of Exynos SoCs" because of an issue on the completely independent
> patchset which adds
> AFTR idle mode support. Could you please keep the "ARM: firmware:
> Introduce suspend
> and resume operations" and "ARM: EXYNOS: Add support for firmware-assisted
> suspend/resume" patches?
>
Hi Marek,

Yeah, as you said this series has no dependency and Bart's patches need 
to be fixed. I thought both should be handled together, so I reverted 
just the branch from my -next tree but the topic branch is there in my 
tree. Once it fixed, I will re-merge them.

Thanks,
Kukjin

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs
@ 2014-09-24  8:42           ` Kukjin Kim
  0 siblings, 0 replies; 27+ messages in thread
From: Kukjin Kim @ 2014-09-24  8:42 UTC (permalink / raw)
  To: linux-arm-kernel

On 09/24/14 17:23, Marek Szyprowski wrote:
> Hi Kukjin,
>
> On 2014-09-24 09:53, Kukjin Kim wrote:
>>
>> On 09/15/14 09:21, Kukjin Kim wrote:
>>>
>>>> On 26.08.2014 16:10, Tomasz Figa wrote:
>>>>> On Exynos-based boards running secure firmware the sequence of low
>>>>> level
>>>>> operations to enter and leave system-wide sleep mode is different than
>>>>> on those without the firmware. Namely:
>>>>> - CP15 power control and diagnostic registers cannot be written
>>>>> directly,
>>>>> - the way of setting boot address and boot flag is different,
>>>>> - different resume handler needs to be used,
>>>>> - dedicated SMC call needs to be performed instead of letting the
>>>>> CPU enter
>>>>> WFI.
>>>>>
>>>>> This series introduces .suspend() and .resume() firmware operations to
>>>>> perform low level firmware-specific suspend and resume and then
>>>>> leverages
>>>>> them to provide suspend-resume path meeting the above requirements.
>>>>> Three
>>>>> additional patches extend device tree sources of Trats2 board with
>>>>> necessary
>>>>> setup to enable suspend/resume support.
>>>>>
>>>>> This series has been tested on Exynos4412-based Trats2 board,
>>>>> without any
>>>>> additional patches. Unfortunately v3.17-rc1 regressed ODROID
>>>>> support and
>>>>> suspend stopped working on those boards, due to unknown reasons
>>>>> still being
>>>>> investigated. It does not seem to be related to anything in this
>>>>> series,
>>>>> though, so I would not consider this as a stopper.
>>>>>
>>>>> Changes since v2:
>>>>> (https://lkml.org/lkml/2014/7/17/431)
>>>>> - added board-specific fixes for device tree sources of Trats2 board,
>>>>> - rebased on next-20140826 of linux-next tree.
>>>>>
>>>>> Changes since v1:
>>>>> - dropped outer_resume() - will be handled in assembly in further
>>>>> patches,
>>>>> as support for L2C in non-secure mode gets added,
>>>>> - moved CP15 resume to assembly as it needs to be done before MMU
>>>>> is enabled,
>>>>> - surrounded CP15 save with a check for cpuid part, because it is
>>>>> valid only
>>>>> on Cortex A9,
>>>>> - rebased on next-20140717 tag of linux-next tree.
>>>>>
>>>>> Tomasz Figa (5):
>>>>> ARM: firmware: Introduce suspend and resume operations
>>>>> ARM: EXYNOS: Add support for firmware-assisted suspend/resume
>>>>> ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled
>>>>> ARM: dts: exynos4x12: Add utility macro to define pin sleep states
>>>>> ARM: dts: exynos4412-trats2: Add sleep mode pin configuration
>>>>>
>>>>> Documentation/arm/firmware.txt | 28 +--
>>>>> arch/arm/boot/dts/exynos4412-trats2.dts | 320
>>>>> +++++++++++++++++++++++++++++-
>>>>> arch/arm/boot/dts/exynos4x12-pinctrl.dtsi | 16 ++
>>>>> arch/arm/include/asm/firmware.h | 8 +
>>>>> arch/arm/mach-exynos/Makefile | 1 +
>>>>> arch/arm/mach-exynos/common.h | 4 +
>>>>> arch/arm/mach-exynos/firmware.c | 45 +++++
>>>>> arch/arm/mach-exynos/pm.c | 16 +-
>>>>> arch/arm/mach-exynos/sleep.S | 28 +++
>>>>> arch/arm/mach-exynos/smc.h | 4 +
>>>>> 10 files changed, 438 insertions(+), 32 deletions(-)
>>>>>
>>>>
>>>> Would you consider applying this series? It has been waiting on the ML
>>>> long enough (note no changes in core patches since last revision, just
>>>> few more board specific patches). Thanks in advance.
>>>>
>>> Sure, I will. Thanks for your gentle reminder.
>>>
>> I've reverted this series because of following.
>>
>> In file included from arch/arm/mach-tegra/cpuidle-tegra114.c:17:0:
>> arch/arm/mach-tegra/cpuidle-tegra114.c: In function
>> 'tegra114_idle_power_down':
>> arch/arm/include/asm/firmware.h:64:24: error: too few arguments to
>> function 'firmware_ops->do_idle'
>> ((firmware_ops->op) ? firmware_ops->op(__VA_ARGS__) : (-ENOSYS))
>> ^
>> arch/arm/mach-tegra/cpuidle-tegra114.c:52:6: note: in expansion of
>> macro 'call_firmware_op'
>> if (call_firmware_op(do_idle) == -ENOSYS)
>> ^
>>
>> Caused by commit f5217f3b9332 ("ARM: EXYNOS: add AFTR mode support to
>> firmware do_idle method").
>>
>> Need to fix...
>
> I don't get why you have reverted the main feature of "Firmware-assisted
> suspend/resume
> of Exynos SoCs" because of an issue on the completely independent
> patchset which adds
> AFTR idle mode support. Could you please keep the "ARM: firmware:
> Introduce suspend
> and resume operations" and "ARM: EXYNOS: Add support for firmware-assisted
> suspend/resume" patches?
>
Hi Marek,

Yeah, as you said this series has no dependency and Bart's patches need 
to be fixed. I thought both should be handled together, so I reverted 
just the branch from my -next tree but the topic branch is there in my 
tree. Once it fixed, I will re-merge them.

Thanks,
Kukjin

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2014-09-24  8:42 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-26 14:10 [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs Tomasz Figa
2014-08-26 14:10 ` Tomasz Figa
2014-08-26 14:10 ` Tomasz Figa
2014-08-26 14:10 ` [PATCH v3 1/5] ARM: firmware: Introduce suspend and resume operations Tomasz Figa
2014-08-26 14:10   ` Tomasz Figa
2014-09-23 16:31   ` Kukjin Kim
2014-09-23 16:31     ` Kukjin Kim
2014-09-23 16:31     ` Kukjin Kim
2014-08-26 14:10 ` [PATCH v3 2/5] ARM: EXYNOS: Add support for firmware-assisted suspend/resume Tomasz Figa
2014-08-26 14:10   ` Tomasz Figa
2014-08-26 14:10   ` Tomasz Figa
2014-08-26 14:10 ` [PATCH v3 3/5] ARM: dts: exynos4412-trats2: Keep eMMC regulators soft-disabled Tomasz Figa
2014-08-26 14:10   ` Tomasz Figa
2014-08-26 14:10 ` [PATCH v3 4/5] ARM: dts: exynos4x12: Add utility macro to define pin sleep states Tomasz Figa
2014-08-26 14:10   ` Tomasz Figa
2014-08-26 14:10 ` [PATCH v3 5/5] ARM: dts: exynos4412-trats2: Add sleep mode pin configuration Tomasz Figa
2014-08-26 14:10   ` Tomasz Figa
2014-09-14 17:47 ` [PATCH v3 0/5] Firmware-assisted suspend/resume of Exynos SoCs Tomasz Figa
2014-09-14 17:47   ` Tomasz Figa
2014-09-15  0:21   ` Kukjin Kim
2014-09-15  0:21     ` Kukjin Kim
2014-09-24  7:53     ` Kukjin Kim
2014-09-24  7:53       ` Kukjin Kim
2014-09-24  8:23       ` Marek Szyprowski
2014-09-24  8:23         ` Marek Szyprowski
2014-09-24  8:42         ` Kukjin Kim
2014-09-24  8:42           ` Kukjin Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.