Skip to contentSkip to conversation

ARM: tegra: add platform suspend support

PATCH Superseded Joseph Lo 4 participants 25 messages Apr 2, 2013 – Apr 3, 2013

Subsystems (5)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Joseph Lo

author
#0 lore raw

v5 cover ARM: tegra: add platform suspend support

This series introduces a basic functionality for Tegra to support the platform suspend and resume.

Note: This series only adds the support for Tegra20 and Tegra30. The Tegra114 will be supported later.

Verified on Seaboard and Cardhu.

V5:
* some fixes from V4's review comments

V4:
* add tegra_pm_validate_suspend_mode() to validate the suspend mode config from DT
* squash the patch below into [4/9] to avoid churn after this series [2/3] ARM: tegra: refactor the pmc_pm_set function

V3:
* fix the PMC DT configurations for paz00 board
* add a protection for only support LP2 suspend mode

V2:
* re-order the patch sequence to make sure the suspend function can be enabled well after the last patch be merged
* squash the patches that defined the PM bindings for PMC and the implementation

Joseph Lo (9):
gpio: tegra: add gpio wakeup source handling
ARM: tegra: irq: add wake up handling
ARM: dt: tegra: add bindings of power management configurations for
PMC
ARM: tegra: pm: add platform suspend support
ARM: dts: tegra: add power gpio keys to DT
ARM: dts: tegra: whistler: add wakeup source for KBC
ARM: dts: tegra: add non-removable and keep-power-in-suspend property
for MMC
ARM: tegra: config: defconfig update
ARM: dts: tegra: add the PM configurations of PMC

 .../bindings/arm/tegra/nvidia,tegra20-pmc.txt      |  42 ++++++-
 arch/arm/boot/dts/tegra20-harmony.dts              |  17 +++
 arch/arm/boot/dts/tegra20-paz00.dts                |   7 ++
 arch/arm/boot/dts/tegra20-seaboard.dts             |   8 ++
 arch/arm/boot/dts/tegra20-trimslice.dts            |  20 +++
 arch/arm/boot/dts/tegra20-ventana.dts              |  19 +++
 arch/arm/boot/dts/tegra20-whistler.dts             |  10 ++
 arch/arm/boot/dts/tegra30-beaver.dts               |   8 ++
 arch/arm/boot/dts/tegra30-cardhu-a02.dts           |   1 +
 arch/arm/boot/dts/tegra30-cardhu-a04.dts           |   1 +
 arch/arm/boot/dts/tegra30-cardhu.dtsi              |   8 ++
 arch/arm/configs/tegra_defconfig                   |   1 +
 arch/arm/mach-tegra/common.c                       |   3 +
 arch/arm/mach-tegra/irq.c                          |  96 ++++++++++++++-
 arch/arm/mach-tegra/irq.h                          |   6 +
 arch/arm/mach-tegra/pm.c                           |  93 ++++++++++++--
 arch/arm/mach-tegra/pm.h                           |  15 +++
 arch/arm/mach-tegra/pmc.c                          | 134 ++++++++++++++++++++-
 arch/arm/mach-tegra/pmc.h                          |  12 +-
 drivers/gpio/gpio-tegra.c                          |  21 +++-
 20 files changed, 500 insertions(+), 22 deletions(-)
Signature · 1 line
1.8.2
author
#1 lore raw

PATCH v5 1/9 gpio: tegra: add gpio wakeup source handling

This patch add the gpio wakeup source handling for the Tegra platform. It was be done by enabling the irq for the gpio in the gpio controller and enabling the bank irq of the gpio in the Tegra legacy irq controller when the system going to suspend.

Based on the work by:
Varun Wadekar <[email protected]>

---
V5:
* no change
V4:
* no change
V3:
* no change
V2:
* no change

---
 drivers/gpio/gpio-tegra.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
drivers/gpio/gpio-tegra.c +19 -2
index a78a81f..2f1b265 100644
@@ -72,6 +72,7 @@ struct tegra_gpio_bank {
 	u32 oe[4];
 	u32 int_enb[4];
 	u32 int_lvl[4];
+	u32 wake_enb[4];
 #endif
 };
 
@@ -333,15 +334,31 @@ static int tegra_gpio_suspend(struct device *dev)
 			bank->oe[p] = tegra_gpio_readl(GPIO_OE(gpio));
 			bank->int_enb[p] = tegra_gpio_readl(GPIO_INT_ENB(gpio));
 			bank->int_lvl[p] = tegra_gpio_readl(GPIO_INT_LVL(gpio));
+
+			/* Enable gpio irq for wake up source */
+			tegra_gpio_writel(bank->wake_enb[p],
+					  GPIO_INT_ENB(gpio));
 		}
 	}
 	local_irq_restore(flags);
 	return 0;
 }
 
-static int tegra_gpio_wake_enable(struct irq_data *d, unsigned int enable)
+static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
 {
 	struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d);
+	int gpio = d->hwirq;
+	u32 port, bit, mask;
+
+	port = GPIO_PORT(gpio);
+	bit = GPIO_BIT(gpio);
+	mask = BIT(bit);
+
+	if (enable)
+		bank->wake_enb[port] |= mask;
+	else
+		bank->wake_enb[port] &= ~mask;
+
 	return irq_set_irq_wake(bank->irq, enable);
 }
 #endif
@@ -353,7 +370,7 @@ static struct irq_chip tegra_gpio_irq_chip = {
 	.irq_unmask	= tegra_gpio_irq_unmask,
 	.irq_set_type	= tegra_gpio_irq_set_type,
 #ifdef CONFIG_PM_SLEEP
-	.irq_set_wake	= tegra_gpio_wake_enable,
+	.irq_set_wake	= tegra_gpio_irq_set_wake,
 #endif
 };
 
Signature · 1 line
1.8.2
#2 lore raw

PATCH v5 1/9 gpio: tegra: add gpio wakeup source handling

Quoted 1 line · Joseph Lo

This patch ad

d the gpio wakeup source handling for the Tegra platform. It

Quoted 11 lines

was be done by enabling the irq for the gpio in the gpio controller and enabling the bank irq of the gpio in the Tegra legacy irq controller when the system going to suspend.

Based on the work by:
Varun Wadekar <[email protected]>

Quoted 9 lines

---
V5:
* no change
V4:
* no change
V3:
* no change
V2:
* no change

Shall I just apply this to the GPIO tree to stop these repetitive mails from coming?

Yours,
Linus Walleij

#3 lore raw

PATCH v5 1/9 gpio: tegra: add gpio wakeup source handling

Quoted 24 lines · Linus Walleij
Quoted 1 line · Joseph Lo

This patch ad

d the gpio wakeup source handling for the Tegra platform. It

Quoted 11 lines

was be done by enabling the irq for the gpio in the gpio controller and enabling the bank irq of the gpio in the Tegra legacy irq controller when the system going to suspend.

Based on the work by:
Varun Wadekar <[email protected]>

Quoted 9 lines

---
V5:
* no change
V4:
* no change
V3:
* no change
V2:
* no change

Quoted 2 lines

Shall I just apply this to the GPIO tree to stop these repetitive mails from coming?

It's part of a series where other patches are being rev'd. I'll apply it to the Tegra tree with the series once it's final.

#4 lore raw

PATCH v5 1/9 gpio: tegra: add gpio wakeup source handling

Quoted 25 lines · Stephen Warren
Quoted 24 lines · Linus Walleij
Quoted 1 line · Joseph Lo

This patch ad

d the gpio wakeup source handling for the Tegra platform. It

Quoted 20 lines

was be done by enabling the irq for the gpio in the gpio controller and enabling the bank irq of the gpio in the Tegra legacy irq controller when the system going to suspend.

Based on the work by:
Varun Wadekar <[email protected]>

---
V5:
* no change
V4:
* no change
V3:
* no change
V2:
* no change

Quoted 5 lines
Quoted 2 lines

Shall I just apply this to the GPIO tree to stop these repetitive mails from coming?

It's part of a series where other patches are being rev'd. I'll apply it to the Tegra tree with the series once it's final.

By the way, it's checked in now, so there won't be any more versions posted.

I guess I should have just applied this patch in an earlier iteration since it was ack'd and only later patches in the series needed changes.

author
#5 lore raw

PATCH v5 2/9 ARM: tegra: irq: add wake up handling

In reply to Joseph Lo

Add the wake up handling for legacy irq controller, and using IRQCHIP_MASK_ON_SUSPEND for wake irq handling.

Based on the work by:
Varun Wadekar <[email protected]>

---
V5:
* don't use BUG_ON when irq_nr is not correct in set_wake function V4:
* no change
V3:
* no change
V2:
* no change

---
 arch/arm/mach-tegra/common.c |  2 +
 arch/arm/mach-tegra/irq.c    | 96 +++++++++++++++++++++++++++++++++++++++++++-
 arch/arm/mach-tegra/irq.h    |  6 +++
 3 files changed, 103 insertions(+), 1 deletion(-)
arch/arm/mach-tegra/common.c +2 -0
index b02ebe7..c84505c 100644
@@ -33,6 +33,7 @@
 #include "common.h"
 #include "fuse.h"
 #include "iomap.h"
+#include "irq.h"
 #include "pmc.h"
 #include "apbio.h"
 #include "sleep.h"
@@ -64,6 +65,7 @@ void __init tegra_dt_init_irq(void)
 	tegra_pmc_init();
 	tegra_init_irq();
 	irqchip_init();
+	tegra_legacy_irq_syscore_init();
 }
 #endif
 
arch/arm/mach-tegra/irq.c +95 -1

132 lines not on this page · raw message

arch/arm/mach-tegra/irq.h +6 -0
index 5142649..bc05ce5 100644
@@ -19,4 +19,10 @@
 
 bool tegra_pending_sgi(void);
 
+#ifdef CONFIG_PM_SLEEP
+int tegra_legacy_irq_syscore_init(void);
+#else
+static inline int tegra_legacy_irq_syscore_init(void) { return 0; }
+#endif
+
 #endif
Signature · 1 line
1.8.2
author
#6 lore raw

PATCH v5 3/9 ARM: dt: tegra: add bindings of power management configurations for PMC

In reply to Joseph Lo

The PMC mostly controls the entry and exit of the system from different sleep modes. Different platform or system may have different configurations. The power management configurations of PMC is represented as some properties. The system needs to define the properties when the system supports deep sleep mode (i.e. suspend).

Cc Grant Likely <[email protected]>
Cc Rob Herring <[email protected]>
Cc devicetree-discuss at lists.ozlabs.org

---
V5:
* fix typos
V4:
* no change
V3:
* fix typos
V2:
* squash the patches that defined the PM bindings for PMC and the implementation
* replace the "unsigned long" with "u32" for the variables that are parsed from DT

---
 .../bindings/arm/tegra/nvidia,tegra20-pmc.txt      | 42 ++++++++++-
 arch/arm/mach-tegra/pmc.c                          | 83 ++++++++++++++++++++++
 arch/arm/mach-tegra/pmc.h                          |  8 +++
 3 files changed, 132 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt +41 -1
index 1cb8f6b..79b8390 100644
@@ -1,9 +1,15 @@
 NVIDIA Tegra Power Management Controller (PMC)
 
-Properties:
+The PMC block interacts with an external Power Management Unit. The PMC
+mostly controls the entry and exit of the system from different sleep
+modes. It provides power-gating controllers for SoC and CPU power-islands.
+
+Required properties:
 - name : Should be pmc
 - compatible : Should contain "nvidia,tegra<chip>-pmc".
 - reg : Offset and length of the register set for the device
+
+Optional properties:
 - nvidia,invert-interrupt : If present, inverts the PMU interrupt signal.
   The PMU is an external Power Management Unit, whose interrupt output
   signal is fed into the PMC. This signal is optionally inverted, and then
@@ -11,6 +17,32 @@ Properties:
   handling of this interrupt signal, merely its inversion.
 - clocks : the source clock of PMC
 - clock-names : the name of source clock of PMC
+- nvidia,suspend-mode : The suspend mode that the platform should use.
+  Valid values are 0, 1 and 2:
+  0 (LP0): CPU + Core voltage off and DRAM in self-refresh
+  1 (LP1): CPU voltage off and DRAM in self-refresh
+  2 (LP2): CPU voltage off
+- nvidia,core-power-req-active-high : Boolean, core power request active-high
+- nvidia,sys-clock-req-active-high : Boolean, system clock request active-high
+- nvidia,combined-power-req : Boolean, combined power request for CPU & Core
+- nvidia,cpu-pwr-good-en : Boolean, CPU power good signal (from PMIC to PMC)
+			   is enabled.
+
+Required properties when nvidia,suspend-mode is specified:
+- nvidia,cpu-pwr-good-time : CPU power good time in uS.
+- nvidia,cpu-pwr-off-time : CPU power off time in uS.
+- nvidia,core-pwr-good-time : <Oscillator-stable-time Power-stable-time>
+			      Core power good time in uS.
+- nvidia,core-pwr-off-time : Core power off time in uS.
+
+Required properties when nvidia,suspend-mode=<0>:
+- nvidia,lp0-vec : <start length> Starting address and length of LP0 vector
+  The LP0 vector contains the warm boot code that is executed by AVP when
+  resuming from the LP0 state. The AVP (Audio-Video Processor) is an ARM7
+  processor and always being the first boot processor when chip is power on
+  or resume from deep sleep mode. When the system is resumed from the deep
+  sleep mode, the warm boot code will restore some PLLs, clocks and then
+  bring up CPU0 for resuming the system.
 
 Example:
 
@@ -21,6 +53,14 @@ pmc at 7000f400 {
 	nvidia,invert-interrupt;
 	clocks = <&tegra_car 110>, <&clk32k_in>;
 	clock-names = "pclk", "clk32k_in";
+	nvidia,suspend-mode = <1>;
+	nvidia,cpu-pwr-good-time = <2000>;
+	nvidia,cpu-pwr-off-time = <100>;
+	nvidia,core-pwr-good-time = <3845 3845>;
+	nvidia,core-pwr-off-time = <458>;
+	nvidia,core-power-req-active-high;
+	nvidia,sys-clock-req-active-high;
+	nvidia,lp0-vec = <0xbdffd000 0x2000>;
 };
 
 / Tegra board dts file
arch/arm/mach-tegra/pmc.c +83 -0

107 lines not on this page · raw message

arch/arm/mach-tegra/pmc.h +8 -0
index 22f16c9..6bc0fc09 100644
@@ -18,6 +18,14 @@
 #ifndef __MACH_TEGRA_PMC_H
 #define __MACH_TEGRA_PMC_H
 
+enum tegra_suspend_mode {
+	TEGRA_SUSPEND_NONE = 0,
+	TEGRA_SUSPEND_LP2,	/* CPU voltage off */
+	TEGRA_SUSPEND_LP1,	/* CPU voltage off, DRAM self-refresh */
+	TEGRA_SUSPEND_LP0,      /* CPU + core voltage off, DRAM self-refresh */
+	TEGRA_MAX_SUSPEND_MODE,
+};
+
 #ifdef CONFIG_PM_SLEEP
 void set_power_timers(unsigned long us_on, unsigned long us_off);
 #endif
Signature · 1 line
1.8.2
author
#7 lore raw

PATCH v5 4/9 ARM: tegra: pm: add platform suspend support

In reply to Joseph Lo

Adding suspend to RAM support for Tegra platform. There are three suspend mode for Tegra. The difference were below.

* LP2: CPU voltage off
* LP1: CPU voltage off, DRAM in self-refresh
* LP0: CPU + Core voltage off, DRAM in self-refresh

After this patch, the LP2 suspend mode will be supported.

---
V5:
* move tegra_init_suspend() to tegra_init_late()
* remove useless BUG_ON for the polarity of CPU power request V4:
* add tegra_pm_validate_suspend_mode() to validate the suspend mode config from DT
* squash the patch below that origianl being introduced after this series to clean up some PM related code
[2/3] ARM: tegra: refactor the pmc_pm_set function
V3:
* add a protection for only support LP2 suspend mode
V2:
* add the PM_SLEEP protection for "tegra_init_suspend"
* remove "tegra_suspend_{enter/exit}_lp2"
* refactor the "tegra_pmc_pm_set" for non-used parameter
* replace "unsigned long" with "u32" for tegra_pmc_get_cpu_time

---
 arch/arm/mach-tegra/common.c |  1 +
 arch/arm/mach-tegra/pm.c     | 93 +++++++++++++++++++++++++++++++++++++-------
 arch/arm/mach-tegra/pm.h     | 15 +++++++
 arch/arm/mach-tegra/pmc.c    | 51 ++++++++++++++++++++++--
 arch/arm/mach-tegra/pmc.h    |  4 +-
 5 files changed, 146 insertions(+), 18 deletions(-)
arch/arm/mach-tegra/common.c +1 -0
index c84505c..eb1f3c8 100644
@@ -109,5 +109,6 @@ void __init tegra_init_early(void)
 
 void __init tegra_init_late(void)
 {
+	tegra_init_suspend();
 	tegra_powergate_debugfs_init();
 }
arch/arm/mach-tegra/pm.c +80 -13

118 lines not on this page · raw message

arch/arm/mach-tegra/pm.h +15 -0
index 787335c..73a45f1 100644
@@ -21,6 +21,8 @@
 #ifndef _MACH_TEGRA_PM_H_
 #define _MACH_TEGRA_PM_H_
 
+#include "pmc.h"
+
 extern unsigned long l2x0_saved_regs_addr;
 
 void save_cpu_arch_register(void);
@@ -32,4 +34,17 @@ bool tegra_set_cpu_in_lp2(int phy_cpu_id);
 void tegra_idle_lp2_last(u32 cpu_on_time, u32 cpu_off_time);
 extern void (*tegra_tear_down_cpu)(void);
 
+#ifdef CONFIG_PM_SLEEP
+enum tegra_suspend_mode tegra_pm_validate_suspend_mode(
+				enum tegra_suspend_mode mode);
+void tegra_init_suspend(void);
+#else
+enum tegra_suspend_mode tegra_pm_validate_suspend_mode(
+				enum tegra_suspend_mode mode)
+{
+	return TEGRA_SUSPEND_NONE;
+}
+static inline void tegra_init_suspend(void) {}
+#endif
+
 #endif /* _MACH_TEGRA_PM_H_ */
arch/arm/mach-tegra/pmc.c +47 -4

81 lines not on this page · raw message

arch/arm/mach-tegra/pmc.h +3 -1
index 6bc0fc09..e1c2df2 100644
@@ -27,7 +27,9 @@ enum tegra_suspend_mode {
 };
 
 #ifdef CONFIG_PM_SLEEP
-void set_power_timers(unsigned long us_on, unsigned long us_off);
+enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void);
+void tegra_pmc_pm_set(enum tegra_suspend_mode mode);
+void tegra_pmc_suspend_init(void);
 #endif
 
 bool tegra_pmc_cpu_is_powered(int cpuid);
Signature · 1 line
1.8.2
author
#8 lore raw

PATCH v5 5/9 ARM: dts: tegra: add power gpio keys to DT

In reply to Joseph Lo

This adds the power gpio key to DT and enable the wakeup of the gpio key for the device. The Seaboard and paz00 already had the power gpio key binding and the power key of Whistler was on KBC. So these boards' device tree didn't include in this patch.

---
V5:
* no change
V4:
* no change
V3:
* no change
V2:
* no change

---
 arch/arm/boot/dts/tegra20-harmony.dts   | 11 +++++++++++
 arch/arm/boot/dts/tegra20-trimslice.dts | 11 +++++++++++
 arch/arm/boot/dts/tegra20-ventana.dts   | 11 +++++++++++
 3 files changed, 33 insertions(+)
arch/arm/boot/dts/tegra20-harmony.dts +11 -0
index 6e6899a..4f08521 100644
@@ -581,6 +581,17 @@
 				0x1F0400D6>;	/* KEY_QUESTION */
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		power {
+			label = "Power";
+			gpios = <&gpio 170 1>; /* gpio PV2, active low */
+			linux,code = <116>; /* KEY_POWER */
+			gpio-key,wakeup;
+		};
+	};
+
 	regulators {
 		compatible = "simple-bus";
 		#address-cells = <1>;
arch/arm/boot/dts/tegra20-trimslice.dts +11 -0
index b265ebd..8e8d4f6 100644
@@ -348,6 +348,17 @@
 		gpios = <&gpio 191 1>; /* gpio PX7, active low */
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		power {
+			label = "Power";
+			gpios = <&gpio 190 1>; /* gpio PX6, active low */
+			linux,code = <116>; /* KEY_POWER */
+			gpio-key,wakeup;
+		};
+	};
+
 	regulators {
 		compatible = "simple-bus";
 		#address-cells = <1>;
arch/arm/boot/dts/tegra20-ventana.dts +11 -0
index 157a2cd..112ef5c 100644
@@ -544,6 +544,17 @@
 		bus-width = <8>;
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		power {
+			label = "Power";
+			gpios = <&gpio 170 1>; /* gpio PV2, active low */
+			linux,code = <116>; /* KEY_POWER */
+			gpio-key,wakeup;
+		};
+	};
+
 	regulators {
 		compatible = "simple-bus";
 		#address-cells = <1>;
Signature · 1 line
1.8.2
author
#9 lore raw

PATCH v5 6/9 ARM: dts: tegra: whistler: add wakeup source for KBC

In reply to Joseph Lo

Adding KBC as a wakeup source for Whistler board.

---
V5:
* no change
V4:
* no change
V3:
* no change
V2:
* no change

---
 arch/arm/boot/dts/tegra20-whistler.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/tegra20-whistler.dts +1 -0
index 87632df..0b04262 100644
@@ -539,6 +539,7 @@
 		nvidia,repeat-delay-ms = <160>;
 		nvidia,kbc-row-pins = <0 1 2>;
 		nvidia,kbc-col-pins = <16 17>;
+		nvidia,wakeup-source;
 		linux,keymap = <0x00000074	/* KEY_POWER */
 				0x01000066	/* KEY_HOME */
 				0x0101009E	/* KEY_BACK */
Signature · 1 line
1.8.2
author
#10 lore raw

PATCH v5 7/9 ARM: dts: tegra: add non-removable and keep-power-in-suspend property for MMC

In reply to Joseph Lo

This patch adds "non-removable" property of MMC host where the eMMC device is for Tegra platform.

And the "keep-power-in-suspend" property was used for the SDIO device that need this to go into suspend mode (e.g. BRCM43xx series).

---
V5:
* no change
V4:
* no change
V3:
* no change
V2:
* no change

---
 arch/arm/boot/dts/tegra20-paz00.dts      | 1 +
 arch/arm/boot/dts/tegra20-seaboard.dts   | 2 ++
 arch/arm/boot/dts/tegra20-ventana.dts    | 2 ++
 arch/arm/boot/dts/tegra20-whistler.dts   | 1 +
 arch/arm/boot/dts/tegra30-beaver.dts     | 1 +
 arch/arm/boot/dts/tegra30-cardhu-a02.dts | 1 +
 arch/arm/boot/dts/tegra30-cardhu-a04.dts | 1 +
 arch/arm/boot/dts/tegra30-cardhu.dtsi    | 1 +
 8 files changed, 10 insertions(+)
arch/arm/boot/dts/tegra20-paz00.dts +1 -0
index 54b05b2..c55e062 100644
@@ -458,6 +458,7 @@
 	sdhci at c8000600 {
 		status = "okay";
 		bus-width = <8>;
+		non-removable;
 	};
 
 	gpio-keys {
arch/arm/boot/dts/tegra20-seaboard.dts +2 -0
index 3b347b8..5572ee7 100644
@@ -593,6 +593,7 @@
 		status = "okay";
 		power-gpios = <&gpio 86 0>; /* gpio PK6 */
 		bus-width = <4>;
+		keep-power-in-suspend;
 	};
 
 	sdhci at c8000400 {
@@ -606,6 +607,7 @@
 	sdhci at c8000600 {
 		status = "okay";
 		bus-width = <8>;
+		non-removable;
 	};
 
 	gpio-keys {
arch/arm/boot/dts/tegra20-ventana.dts +2 -0
index 112ef5c..4363764 100644
@@ -529,6 +529,7 @@
 		status = "okay";
 		power-gpios = <&gpio 86 0>; /* gpio PK6 */
 		bus-width = <4>;
+		keep-power-in-suspend;
 	};
 
 	sdhci at c8000400 {
@@ -542,6 +543,7 @@
 	sdhci at c8000600 {
 		status = "okay";
 		bus-width = <8>;
+		non-removable;
 	};
 
 	gpio-keys {
arch/arm/boot/dts/tegra20-whistler.dts +1 -0
index 0b04262..878790e 100644
@@ -531,6 +531,7 @@
 	sdhci at c8000600 {
 		status = "okay";
 		bus-width = <8>;
+		non-removable;
 	};
 
 	kbc {
arch/arm/boot/dts/tegra30-beaver.dts +1 -0
index c3e0f25..772e6cf 100644
@@ -279,6 +279,7 @@
 	sdhci at 78000600 {
 		status = "okay";
 		bus-width = <8>;
+		non-removable;
 	};
 
 	regulators {
arch/arm/boot/dts/tegra30-cardhu-a02.dts +1 -0
index adc88aa..e392bd2 100644
@@ -88,6 +88,7 @@
 		status = "okay";
 		power-gpios = <&gpio 28 0>; /* gpio PD4 */
 		bus-width = <4>;
+		keep-power-in-suspend;
 	};
 };
 
arch/arm/boot/dts/tegra30-cardhu-a04.dts +1 -0
index 08163e1..d0db6c7 100644
@@ -100,5 +100,6 @@
 		status = "okay";
 		power-gpios = <&gpio 27 0>; /* gpio PD3 */
 		bus-width = <4>;
+		keep-power-in-suspend;
 	};
 };
arch/arm/boot/dts/tegra30-cardhu.dtsi +1 -0
index eeea511..053913f 100644
@@ -333,6 +333,7 @@
 	sdhci at 78000600 {
 		status = "okay";
 		bus-width = <8>;
+		non-removable;
 	};
 
 	regulators {
Signature · 1 line
1.8.2
#11 lore raw

PATCH v5 7/9 ARM: dts: tegra: add non-removable and keep-power-in-suspend property for MMC

Quoted 6 lines · Joseph Lo

This patch adds "non-removable" property of MMC host where the eMMC device is for Tegra platform.

And the "keep-power-in-suspend" property was used for the SDIO device that need this to go into suspend mode (e.g. BRCM43xx series).

Quoted 8 lines
 arch/arm/boot/dts/tegra20-paz00.dts      | 1 +
 arch/arm/boot/dts/tegra20-seaboard.dts   | 2 ++
 arch/arm/boot/dts/tegra20-ventana.dts    | 2 ++
 arch/arm/boot/dts/tegra20-whistler.dts   | 1 +
 arch/arm/boot/dts/tegra30-beaver.dts     | 1 +
 arch/arm/boot/dts/tegra30-cardhu-a02.dts | 1 +
 arch/arm/boot/dts/tegra30-cardhu-a04.dts | 1 +
 arch/arm/boot/dts/tegra30-cardhu.dtsi    | 1 +

I think there are a bunch of other boards that need a similar change, right? There are certainly eMMC devices on other boards, and shouldn't they be marked with non-removable? In particular, Beaver, Dalmore, and Pluto, and likely some/all of the Colibri and Avionic Design boards. I think it should be obvious which SDHCI devices need this, since there won't be any cd-gpios property and the bus-width will likely be 8.

#12 lore raw

PATCH v5 7/9 ARM: dts: tegra: add non-removable and keep-power-in-suspend property for MMC

Quoted 16 lines · Stephen Warren
Quoted 6 lines · Joseph Lo

This patch adds "non-removable" property of MMC host where the eMMC device is for Tegra platform.

And the "keep-power-in-suspend" property was used for the SDIO device that need this to go into suspend mode (e.g. BRCM43xx series).

Quoted 8 lines
 arch/arm/boot/dts/tegra20-paz00.dts      | 1 +
 arch/arm/boot/dts/tegra20-seaboard.dts   | 2 ++
 arch/arm/boot/dts/tegra20-ventana.dts    | 2 ++
 arch/arm/boot/dts/tegra20-whistler.dts   | 1 +
 arch/arm/boot/dts/tegra30-beaver.dts     | 1 +
 arch/arm/boot/dts/tegra30-cardhu-a02.dts | 1 +
 arch/arm/boot/dts/tegra30-cardhu-a04.dts | 1 +
 arch/arm/boot/dts/tegra30-cardhu.dtsi    | 1 +
Quoted 6 lines

I think there are a bunch of other boards that need a similar change, right? There are certainly eMMC devices on other boards, and shouldn't they be marked with non-removable? In particular, Beaver, Dalmore, and Pluto, and likely some/all of the Colibri and Avionic Design boards. I think it should be obvious which SDHCI devices need this, since there won't be any cd-gpios property and the bus-width will likely be 8.

For Tegra20 Tamonten we don't use eMMC. Ideally we'd be using NAND to boot from but that doesn't have mainline support. I have a semi-working patch and will probably spend some more time getting it ready. The MMC cards are all removable, though I guess since they are the boot device they still should remain powered in suspend?

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130403/9e82f9be/attachment.sig>

author
#13 lore raw

PATCH v5 7/9 ARM: dts: tegra: add non-removable and keep-power-in-suspend property for MMC

Quoted 26 lines · Thierry Reding

* PGP Signed by an unknown key

Quoted 16 lines · Stephen Warren
Quoted 6 lines · Joseph Lo

This patch adds "non-removable" property of MMC host where the eMMC device is for Tegra platform.

And the "keep-power-in-suspend" property was used for the SDIO device that need this to go into suspend mode (e.g. BRCM43xx series).

Quoted 8 lines
 arch/arm/boot/dts/tegra20-paz00.dts      | 1 +
 arch/arm/boot/dts/tegra20-seaboard.dts   | 2 ++
 arch/arm/boot/dts/tegra20-ventana.dts    | 2 ++
 arch/arm/boot/dts/tegra20-whistler.dts   | 1 +
 arch/arm/boot/dts/tegra30-beaver.dts     | 1 +
 arch/arm/boot/dts/tegra30-cardhu-a02.dts | 1 +
 arch/arm/boot/dts/tegra30-cardhu-a04.dts | 1 +
 arch/arm/boot/dts/tegra30-cardhu.dtsi    | 1 +
Quoted 6 lines

I think there are a bunch of other boards that need a similar change, right? There are certainly eMMC devices on other boards, and shouldn't they be marked with non-removable? In particular, Beaver, Dalmore, and Pluto, and likely some/all of the Colibri and Avionic Design boards. I think it should be obvious which SDHCI devices need this, since there won't be any cd-gpios property and the bus-width will likely be 8.

Quoted 6 lines

For Tegra20 Tamonten we don't use eMMC. Ideally we'd be using NAND to boot from but that doesn't have mainline support. I have a semi-working patch and will probably spend some more time getting it ready. The MMC cards are all removable, though I guess since they are the boot device they still should remain powered in suspend?

The "non-removable" property is a specific property to avoid the risk of writing back data to a different card after resume. If you just want to test the suspend function, you can add "mmc_core.removable=0" in your boot arg.

The "keep-power-in-suspend" is used for the BRCM43xx series SDIO device. Without this, it can't go into suspend mode.

author
#14 lore raw

PATCH v5 7/9 ARM: dts: tegra: add non-removable and keep-power-in-suspend property for MMC

In reply to Stephen Warren
Quoted 16 lines · Stephen Warren
Quoted 6 lines · Joseph Lo

This patch adds "non-removable" property of MMC host where the eMMC device is for Tegra platform.

And the "keep-power-in-suspend" property was used for the SDIO device that need this to go into suspend mode (e.g. BRCM43xx series).

Quoted 8 lines
 arch/arm/boot/dts/tegra20-paz00.dts      | 1 +
 arch/arm/boot/dts/tegra20-seaboard.dts   | 2 ++
 arch/arm/boot/dts/tegra20-ventana.dts    | 2 ++
 arch/arm/boot/dts/tegra20-whistler.dts   | 1 +
 arch/arm/boot/dts/tegra30-beaver.dts     | 1 +
 arch/arm/boot/dts/tegra30-cardhu-a02.dts | 1 +
 arch/arm/boot/dts/tegra30-cardhu-a04.dts | 1 +
 arch/arm/boot/dts/tegra30-cardhu.dtsi    | 1 +
Quoted 6 lines

I think there are a bunch of other boards that need a similar change, right? There are certainly eMMC devices on other boards, and shouldn't they be marked with non-removable? In particular, Beaver, Dalmore, and Pluto, and likely some/all of the Colibri and Avionic Design boards. I think it should be obvious which SDHCI devices need this, since there won't be any cd-gpios property and the bus-width will likely be 8.

OK, I already added the property for Beaver. I will add one more support for Dalmore in this patch. For Pluto, it didn't add any SDCHI node in DT yet. We need another patch to enable SDHCI on Pluto first and add the properties there.

Thanks,
Joseph

author
#15 lore raw

PATCH v5 8/9 ARM: tegra: config: defconfig update

In reply to Joseph Lo

KEYBOARD_GPIO:
* Enable gpio-key driver

---
V5:
* no change
V4:
* no change
V3:
* no change
V2:
* no change

---
 arch/arm/configs/tegra_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/tegra_defconfig +1 -0
index 2b42a2c..a5f0485 100644
@@ -106,6 +106,7 @@ CONFIG_RT2X00=y
 CONFIG_RT2800USB=m
 CONFIG_INPUT_EVDEV=y
 CONFIG_KEYBOARD_TEGRA=y
+CONFIG_KEYBOARD_GPIO=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_MPU3050=y
 # CONFIG_LEGACY_PTYS is not set
Signature · 1 line
1.8.2
author
#16 lore raw

PATCH v5 9/9 ARM: dts: tegra: add the PM configurations of PMC

In reply to Joseph Lo

Adding the PM configuration of PMC when the platform support suspend function.

---
V5:
* no change
V4:
* no change
V3:
* fix the configuration for paz00 board
V2:
* no change

---
 arch/arm/boot/dts/tegra20-harmony.dts   | 6 ++++++
 arch/arm/boot/dts/tegra20-paz00.dts     | 6 ++++++
 arch/arm/boot/dts/tegra20-seaboard.dts  | 6 ++++++
 arch/arm/boot/dts/tegra20-trimslice.dts | 9 +++++++++
 arch/arm/boot/dts/tegra20-ventana.dts   | 6 ++++++
 arch/arm/boot/dts/tegra20-whistler.dts  | 8 ++++++++
 arch/arm/boot/dts/tegra30-beaver.dts    | 7 +++++++
 arch/arm/boot/dts/tegra30-cardhu.dtsi   | 7 +++++++
 8 files changed, 55 insertions(+)
arch/arm/boot/dts/tegra20-harmony.dts +6 -0
index 4f08521..7904eb4 100644
@@ -429,6 +429,12 @@
 
 	pmc {
 		nvidia,invert-interrupt;
+		nvidia,suspend-mode = <2>;
+		nvidia,cpu-pwr-good-time = <5000>;
+		nvidia,cpu-pwr-off-time = <5000>;
+		nvidia,core-pwr-good-time = <3845 3845>;
+		nvidia,core-pwr-off-time = <3875>;
+		nvidia,sys-clock-req-active-high;
 	};
 
 	usb at c5000000 {
arch/arm/boot/dts/tegra20-paz00.dts +6 -0
index c55e062..680eeeb 100644
@@ -428,6 +428,12 @@
 
 	pmc {
 		nvidia,invert-interrupt;
+		nvidia,suspend-mode = <2>;
+		nvidia,cpu-pwr-good-time = <2000>;
+		nvidia,cpu-pwr-off-time = <0>;
+		nvidia,core-pwr-good-time = <3845 3845>;
+		nvidia,core-pwr-off-time = <0>;
+		nvidia,sys-clock-req-active-high;
 	};
 
 	usb at c5000000 {
arch/arm/boot/dts/tegra20-seaboard.dts +6 -0
index 5572ee7..2ff92c9 100644
@@ -530,6 +530,12 @@
 
 	pmc {
 		nvidia,invert-interrupt;
+		nvidia,suspend-mode = <2>;
+		nvidia,cpu-pwr-good-time = <5000>;
+		nvidia,cpu-pwr-off-time = <5000>;
+		nvidia,core-pwr-good-time = <3845 3845>;
+		nvidia,core-pwr-off-time = <3875>;
+		nvidia,sys-clock-req-active-high;
 	};
 
 	memory-controller at 7000f400 {
arch/arm/boot/dts/tegra20-trimslice.dts +9 -0
index 8e8d4f6..7760b67 100644
@@ -313,6 +313,15 @@
 		};
 	};
 
+	pmc {
+		nvidia,suspend-mode = <2>;
+		nvidia,cpu-pwr-good-time = <5000>;
+		nvidia,cpu-pwr-off-time = <5000>;
+		nvidia,core-pwr-good-time = <3845 3845>;
+		nvidia,core-pwr-off-time = <3875>;
+		nvidia,sys-clock-req-active-high;
+	};
+
 	usb at c5000000 {
 		status = "okay";
 		nvidia,vbus-gpio = <&gpio 170 0>; /* gpio PV2 */
arch/arm/boot/dts/tegra20-ventana.dts +6 -0
index 4363764..98a1eae 100644
@@ -506,6 +506,12 @@
 
 	pmc {
 		nvidia,invert-interrupt;
+		nvidia,suspend-mode = <2>;
+		nvidia,cpu-pwr-good-time = <2000>;
+		nvidia,cpu-pwr-off-time = <100>;
+		nvidia,core-pwr-good-time = <3845 3845>;
+		nvidia,core-pwr-off-time = <458>;
+		nvidia,sys-clock-req-active-high;
 	};
 
 	usb at c5000000 {
arch/arm/boot/dts/tegra20-whistler.dts +8 -0
index 878790e..ff74be7 100644
@@ -509,6 +509,14 @@
 
 	pmc {
 		nvidia,invert-interrupt;
+		nvidia,suspend-mode = <2>;
+		nvidia,cpu-pwr-good-time = <2000>;
+		nvidia,cpu-pwr-off-time = <1000>;
+		nvidia,core-pwr-good-time = <0 3845>;
+		nvidia,core-pwr-off-time = <93727>;
+		nvidia,core-power-req-active-high;
+		nvidia,sys-clock-req-active-high;
+		nvidia,combined-power-req;
 	};
 
 	usb at c5000000 {
arch/arm/boot/dts/tegra30-beaver.dts +7 -0
index 772e6cf..f17deb0 100644
@@ -266,6 +266,13 @@
 	pmc {
 		status = "okay";
 		nvidia,invert-interrupt;
+		nvidia,suspend-mode = <2>;
+		nvidia,cpu-pwr-good-time = <2000>;
+		nvidia,cpu-pwr-off-time = <200>;
+		nvidia,core-pwr-good-time = <3845 3845>;
+		nvidia,core-pwr-off-time = <0>;
+		nvidia,core-power-req-active-high;
+		nvidia,sys-clock-req-active-high;
 	};
 
 	sdhci at 78000000 {
arch/arm/boot/dts/tegra30-cardhu.dtsi +7 -0
index 053913f..9171834 100644
@@ -320,6 +320,13 @@
 	pmc {
 		status = "okay";
 		nvidia,invert-interrupt;
+		nvidia,suspend-mode = <2>;
+		nvidia,cpu-pwr-good-time = <2000>;
+		nvidia,cpu-pwr-off-time = <200>;
+		nvidia,core-pwr-good-time = <3845 3845>;
+		nvidia,core-pwr-off-time = <0>;
+		nvidia,core-power-req-active-high;
+		nvidia,sys-clock-req-active-high;
 	};
 
 	sdhci at 78000000 {
Signature · 1 line
1.8.2
#17 lore raw

PATCH v5 9/9 ARM: dts: tegra: add the PM configurations of PMC

Quoted 2 lines · Joseph Lo

Adding the PM configuration of PMC when the platform support suspend function.

For this patch, some more boards could be supported, but I think we'll have to rely on other people (Lucas, Thierry) to send patches for them, since they know the details of the board. It's fine to leave suspend disabled on those boards until later.

Aside from the 1 other comment I made on this series, I think it's good to go once your previous 3-long series is fixed and reposted per my comments on it.

#18 lore raw

PATCH v5 9/9 ARM: dts: tegra: add the PM configurations of PMC

Quoted 8 lines · Stephen Warren
Quoted 2 lines · Joseph Lo

Adding the PM configuration of PMC when the platform support suspend function.

For this patch, some more boards could be supported, but I think we'll have to rely on other people (Lucas, Thierry) to send patches for them, since they know the details of the board. It's fine to leave suspend disabled on those boards until later.

I'm not sure what would be the best way to get the Tamonten devices out of suspend again. For Plutux and TEC we have a power button that could possibly be reused. There's a WAKEUP pin on the Tamonten connector which goes to GPIO PV2, but the mechanism to trigger it is carrier-board dependent.

For the Medcom-Wide we don't have a power button, but it could possibly use the WAKEUP pin if that's connected. It seems like in all designs it goes to the CPLD, but I need to check with engineering if there's a way to manipulate it.

So yes, I think for now we can leave suspend disabled on Tamonten and I can send patches to enable it once I've clarified with engineering.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130403/573faedf/attachment.sig>

author
#19 lore raw

PATCH v5 9/9 ARM: dts: tegra: add the PM configurations of PMC

Quoted 18 lines · Thierry Reding

* PGP Signed by an unknown key

Quoted 8 lines · Stephen Warren
Quoted 2 lines · Joseph Lo

Adding the PM configuration of PMC when the platform support suspend function.

For this patch, some more boards could be supported, but I think we'll have to rely on other people (Lucas, Thierry) to send patches for them, since they know the details of the board. It's fine to leave suspend disabled on those boards until later.

I'm not sure what would be the best way to get the Tamonten devices out of suspend again. For Plutux and TEC we have a power button that could possibly be reused. There's a WAKEUP pin on the Tamonten connector which goes to GPIO PV2, but the mechanism to trigger it is carrier-board dependent.

Quoted 8 lines

For the Medcom-Wide we don't have a power button, but it could possibly use the WAKEUP pin if that's connected. It seems like in all designs it goes to the CPLD, but I need to check with engineering if there's a way to manipulate it.

So yes, I think for now we can leave suspend disabled on Tamonten and I can send patches to enable it once I've clarified with engineering.

Hi Thierry,

I just recall I still need at least "nvidia,cpu-pwr-good-time" and "nvidia,cpu-pwr-off-time" two properties to make CPU idle power-down mode (same with LP2) work normally after this series.

So can you provide me that or point me out where is your downstream kernel source? There data would be come from DT after this series.

Thanks,
Joseph

#20 lore raw

PATCH v5 9/9 ARM: dts: tegra: add the PM configurations of PMC

Quoted 27 lines · Joseph Lo
Quoted 18 lines · Thierry Reding

* PGP Signed by an unknown key

Quoted 8 lines · Stephen Warren
Quoted 2 lines · Joseph Lo

Adding the PM configuration of PMC when the platform support suspend function.

For this patch, some more boards could be supported, but I think we'll have to rely on other people (Lucas, Thierry) to send patches for them, since they know the details of the board. It's fine to leave suspend disabled on those boards until later.

I'm not sure what would be the best way to get the Tamonten devices out of suspend again. For Plutux and TEC we have a power button that could possibly be reused. There's a WAKEUP pin on the Tamonten connector which goes to GPIO PV2, but the mechanism to trigger it is carrier-board dependent.

Quoted 8 lines

For the Medcom-Wide we don't have a power button, but it could possibly use the WAKEUP pin if that's connected. It seems like in all designs it goes to the CPLD, but I need to check with engineering if there's a way to manipulate it.

So yes, I think for now we can leave suspend disabled on Tamonten and I can send patches to enable it once I've clarified with engineering.

Quoted 8 lines

Hi Thierry,

I just recall I still need at least "nvidia,cpu-pwr-good-time" and "nvidia,cpu-pwr-off-time" two properties to make CPU idle power-down mode (same with LP2) work normally after this series.

So can you provide me that or point me out where is your downstream kernel source? There data would be come from DT after this series.

We don't have suspend support in downstream kernels either. However since the Tamonten was derived from the Harmony reference design I suppose the same values can be reused.

That said, the binding document says that those values are only required if nvidia,suspend-mode is set. So if we don't add it for the Tamonten boards why would you need the cpu-pwr-good-time and cpu-pwr-off-time values. Or maybe the binding document is wrong?

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130403/bc859369/attachment-0001.sig>

author
#21 lore raw

PATCH v5 9/9 ARM: dts: tegra: add the PM configurations of PMC

Quoted 36 lines · Thierry Reding

* PGP Signed by an unknown key

Quoted 33 lines · Joseph Lo
Quoted 18 lines · Thierry Reding
Quoted 1 line

Old Signed by an unknown key

Quoted 8 lines · Stephen Warren
Quoted 2 lines · Joseph Lo

Adding the PM configuration of PMC when the platform support suspend function.

For this patch, some more boards could be supported, but I think we'll have to rely on other people (Lucas, Thierry) to send patches for them, since they know the details of the board. It's fine to leave suspend disabled on those boards until later.

I'm not sure what would be the best way to get the Tamonten devices out of suspend again. For Plutux and TEC we have a power button that could possibly be reused. There's a WAKEUP pin on the Tamonten connector which goes to GPIO PV2, but the mechanism to trigger it is carrier-board dependent.

Quoted 8 lines

For the Medcom-Wide we don't have a power button, but it could possibly use the WAKEUP pin if that's connected. It seems like in all designs it goes to the CPLD, but I need to check with engineering if there's a way to manipulate it.

So yes, I think for now we can leave suspend disabled on Tamonten and I can send patches to enable it once I've clarified with engineering.

Hi Thierry,

I just recall I still need at least "nvidia,cpu-pwr-good-time" and "nvidia,cpu-pwr-off-time" two properties to make CPU idle power-down mode (same with LP2) work normally after this series.

Quoted 7 lines
Quoted 2 lines

So can you provide me that or point me out where is your downstream kernel source? There data would be come from DT after this series.

We don't have suspend support in downstream kernels either. However since the Tamonten was derived from the Harmony reference design I suppose the same values can be reused.

OK. That's enough.

Quoted 4 lines

That said, the binding document says that those values are only required if nvidia,suspend-mode is set. So if we don't add it for the Tamonten boards why would you need the cpu-pwr-good-time and cpu-pwr-off-time values. Or maybe the binding document is wrong?

Actually, when you support CPU idle power-down mode (LP2), you already support suspend function (at least LP2 mode). Just no wake up source define in DT for your boards.

May I add these properties to your boards (same as Harmony)? Then you can figure out your wake up source later, at least the RTC can wake up your device I believe.

Thanks,
Joseph

#22 lore raw

PATCH v5 9/9 ARM: dts: tegra: add the PM configurations of PMC

Quoted 46 lines · Joseph Lo
Quoted 36 lines · Thierry Reding

* PGP Signed by an unknown key

Quoted 33 lines · Joseph Lo
Quoted 18 lines · Thierry Reding
Quoted 1 line

Old Signed by an unknown key

Quoted 8 lines · Stephen Warren
Quoted 2 lines · Joseph Lo

Adding the PM configuration of PMC when the platform support suspend function.

For this patch, some more boards could be supported, but I think we'll have to rely on other people (Lucas, Thierry) to send patches for them, since they know the details of the board. It's fine to leave suspend disabled on those boards until later.

I'm not sure what would be the best way to get the Tamonten devices out of suspend again. For Plutux and TEC we have a power button that could possibly be reused. There's a WAKEUP pin on the Tamonten connector which goes to GPIO PV2, but the mechanism to trigger it is carrier-board dependent.

Quoted 8 lines

For the Medcom-Wide we don't have a power button, but it could possibly use the WAKEUP pin if that's connected. It seems like in all designs it goes to the CPLD, but I need to check with engineering if there's a way to manipulate it.

So yes, I think for now we can leave suspend disabled on Tamonten and I can send patches to enable it once I've clarified with engineering.

Hi Thierry,

I just recall I still need at least "nvidia,cpu-pwr-good-time" and "nvidia,cpu-pwr-off-time" two properties to make CPU idle power-down mode (same with LP2) work normally after this series.

Quoted 7 lines
Quoted 2 lines

So can you provide me that or point me out where is your downstream kernel source? There data would be come from DT after this series.

We don't have suspend support in downstream kernels either. However since the Tamonten was derived from the Harmony reference design I suppose the same values can be reused.

OK. That's enough.

Quoted 8 lines
Quoted 4 lines

That said, the binding document says that those values are only required if nvidia,suspend-mode is set. So if we don't add it for the Tamonten boards why would you need the cpu-pwr-good-time and cpu-pwr-off-time values. Or maybe the binding document is wrong?

Actually, when you support CPU idle power-down mode (LP2), you already support suspend function (at least LP2 mode). Just no wake up source define in DT for your boards.

Okay, but for CPU idle LP2 we don't need a wakeup source, right? I only need the wakeup source if I explicitly suspend the device.

Quoted 5 lines

May I add these properties to your boards (same as Harmony)? Then you can figure out your wake up source later, at least the RTC can wake up your device I believe.

From what I understand there should be no changes in behaviour after

this patch, so it should be fine.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130403/e1baa29f/attachment.sig>

author
#23 lore raw

PATCH v5 9/9 ARM: dts: tegra: add the PM configurations of PMC

Quoted 54 lines · Thierry Reding

* PGP Signed by an unknown key

Quoted 51 lines · Joseph Lo
Quoted 36 lines · Thierry Reding
Quoted 1 line

Old Signed by an unknown key

Quoted 33 lines · Joseph Lo
Quoted 18 lines · Thierry Reding
Quoted 1 line

Old Signed by an unknown key

Quoted 8 lines · Stephen Warren
Quoted 2 lines · Joseph Lo

Adding the PM configuration of PMC when the platform support suspend function.

For this patch, some more boards could be supported, but I think we'll have to rely on other people (Lucas, Thierry) to send patches for them, since they know the details of the board. It's fine to leave suspend disabled on those boards until later.

I'm not sure what would be the best way to get the Tamonten devices out of suspend again. For Plutux and TEC we have a power button that could possibly be reused. There's a WAKEUP pin on the Tamonten connector which goes to GPIO PV2, but the mechanism to trigger it is carrier-board dependent.

Quoted 8 lines

For the Medcom-Wide we don't have a power button, but it could possibly use the WAKEUP pin if that's connected. It seems like in all designs it goes to the CPLD, but I need to check with engineering if there's a way to manipulate it.

So yes, I think for now we can leave suspend disabled on Tamonten and I can send patches to enable it once I've clarified with engineering.

Hi Thierry,

I just recall I still need at least "nvidia,cpu-pwr-good-time" and "nvidia,cpu-pwr-off-time" two properties to make CPU idle power-down mode (same with LP2) work normally after this series.

Quoted 7 lines
Quoted 2 lines

So can you provide me that or point me out where is your downstream kernel source? There data would be come from DT after this series.

We don't have suspend support in downstream kernels either. However since the Tamonten was derived from the Harmony reference design I suppose the same values can be reused.

OK. That's enough.

Quoted 4 lines

That said, the binding document says that those values are only required if nvidia,suspend-mode is set. So if we don't add it for the Tamonten boards why would you need the cpu-pwr-good-time and cpu-pwr-off-time values. Or maybe the binding document is wrong?

Quoted 7 lines
Quoted 3 lines

Actually, when you support CPU idle power-down mode (LP2), you already support suspend function (at least LP2 mode). Just no wake up source define in DT for your boards.

Okay, but for CPU idle LP2 we don't need a wakeup source, right? I only need the wakeup source if I explicitly suspend the device.

Yes. The difference between CPU idle and suspend LP2 is wake up from any interrupt or specific interrupt source (wake up source for suspend).

My approach is adding CPU idle LP2 support first and make it support suspend later. Then reorganize them into PM related code and get the configurations from DT.

Quoted 7 lines
Quoted 3 lines

May I add these properties to your boards (same as Harmony)? Then you can figure out your wake up source later, at least the RTC can wake up your device I believe.

From what I understand there should be no changes in behaviour after this patch, so it should be fine.

OK, thanks.

#24 lore raw

v5 cover ARM: tegra: add platform suspend support

In reply to Joseph Lo
Quoted 7 lines · Joseph Lo

This series introduces a basic functionality for Tegra to support the platform suspend and resume.

Note: This series only adds the support for Tegra20 and Tegra30. The Tegra114 will be supported later.

Verified on Seaboard and Cardhu.

I've also reproduced this on those two boards:-)

It's a pity that the only way to wake up Cardhu is using the RTC's wakealarm though. Still, we can add extra keyboard/GPIO keys/... to the various board DTs after this basic support series is checked in.