Skip to contentSkip to conversation

ARM: dts: am33xx/am4372: Add suspend-resume support

PATCH New Dave Gerlach 2 participants 11 messages Feb 19, 2018 – Feb 27, 2018 Device tree bindings

lore
Share & tools
lore
#0 lore raw

cover ARM: dts: am33xx/am4372: Add suspend-resume support

Hi,
This series is the last needed to enable suspend/resume on am335x/am437x along with [1]. It adds required dt nodes for the emif and core PM code to find the needed sram nodes and marks key devices with ti,no-idle so that the kernel does not idle them. With this suspend to mem can be achieved by following the steps described in [1].

Branch containing all patches needed for suspend/resume is here [2].

Regards,
Dave

[1] https://www.spinics.net/lists/linux-omap/msg141652.html
[2] https://github.com/dgerlach/linux-pm/tree/upstream/v4.16/amx3-suspend-v4

Dave Gerlach (9):
ARM: dts: am33xx: Reserve pm code and data regions in ocmcram sram
node
ARM: dts: am4372: Reserve pm code and data regions in ocmcram sram
node
ARM: dts: am33xx: Update emif node
ARM: dts: am4372: Update emif node
ARM: dts: am33xx: Add pm-sram phandle to soc node
ARM: dts: am4372: Add soc node
ARM: dts: am33xx: Mark emif with ti,no-idle
ARM: dts: am4372: Mark emif with ti,no-idle
ARM: dts: am4372: Mark omap_l3_noc with ti,no-idle

 arch/arm/boot/dts/am33xx.dtsi | 20 ++++++++++++++++++++
 arch/arm/boot/dts/am4372.dtsi | 29 +++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)
Signature · 1 line
2.16.1
#1 lore raw

PATCH 1/9 ARM: dts: am33xx: Reserve pm code and data regions in ocmcram sram node

Add a 'pm_sram_code' reserved region to the ocmcram node to be exposed by the mmio-sram driver as a pool but also mark it protect-exec so that it can run code copied to it using sram_exec_copy.

Add another 'pm_sram_data' reserved region to the ocmcram node to act as the data space for any code running from the 'pm_sram_code' region that is exposed as a regular pool.

---
 arch/arm/boot/dts/am33xx.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/am33xx.dtsi +15 -0
index 628c77b0b386..a9bbf68db077 100644
@@ -905,6 +905,21 @@
 		ocmcram: ocmcram at 40300000 {
 			compatible = "mmio-sram";
 			reg = <0x40300000 0x10000>; /* 64k */
+			ranges = <0x0 0x40300000 0x10000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			pm_sram_code: pm-sram-code at 0 {
+				compatible = "ti,sram";
+				reg = <0x0 0x1000>;
+				protect-exec;
+			};
+
+			pm_sram_data: pm-sram-data at 1000 {
+				compatible = "ti,sram";
+				reg = <0x1000 0x1000>;
+				pool;
+			};
 		};
 
 		elm: elm at 48080000 {
Signature · 1 line
2.16.1
#2 lore raw

PATCH 2/9 ARM: dts: am4372: Reserve pm code and data regions in ocmcram sram node

In reply to Dave Gerlach

Add a 'pm_sram_code' reserved region to the ocmcram node to be exposed by the mmio-sram driver as a pool but also mark it protect-exec so that it can run code copied to it using sram_exec_copy.

Add another 'pm_sram_data' reserved region to the ocmcram node to act as the data space for any code running from the 'pm_sram_code' region that is exposed as a regular pool.

---
 arch/arm/boot/dts/am4372.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/am4372.dtsi +15 -0
index 964f3ef79728..81a03c1ad770 100644
@@ -1141,6 +1141,21 @@
 		ocmcram: ocmcram at 40300000 {
 			compatible = "mmio-sram";
 			reg = <0x40300000 0x40000>; /* 256k */
+			ranges = <0x0 0x40300000 0x40000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			pm_sram_code: pm-sram-code at 0 {
+				compatible = "ti,sram";
+				reg = <0x0 0x1000>;
+				protect-exec;
+			};
+
+			pm_sram_data: pm-sram-data at 1000 {
+				compatible = "ti,sram";
+				reg = <0x1000 0x1000>;
+				pool;
+			};
 		};
 
 		dcan0: can at 481cc000 {
Signature · 1 line
2.16.1
#3 lore raw

PATCH 3/9 ARM: dts: am33xx: Update emif node

In reply to Dave Gerlach

Now that we will use ti-emif-sram driver for am335x PM, update the emif DT node with the required sram property.

---
 arch/arm/boot/dts/am33xx.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/am33xx.dtsi +2 -0
index a9bbf68db077..c27ef2cac394 100644
@@ -960,6 +960,8 @@
 			compatible = "ti,emif-am3352";
 			reg = <0x4c000000 0x1000000>;
 			ti,hwmods = "emif";
+			sram = <&pm_sram_code
+				&pm_sram_data>;
 		};
 
 		gpmc: gpmc at 50000000 {
Signature · 1 line
2.16.1
#4 lore raw

PATCH 4/9 ARM: dts: am4372: Update emif node

In reply to Dave Gerlach

Now that we will use ti-emif-sram driver for am4372 PM, update the emif DT node with the required sram property.

---
 arch/arm/boot/dts/am4372.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/am4372.dtsi +2 -0
index 81a03c1ad770..10dc52a07b32 100644
@@ -237,6 +237,8 @@
 			compatible = "ti,emif-am4372";
 			reg = <0x4c000000 0x1000000>;
 			ti,hwmods = "emif";
+			sram = <&pm_sram_code
+				&pm_sram_data>;
 		};
 
 		edma: edma at 49000000 {
Signature · 1 line
2.16.1
#5 lore raw

PATCH 5/9 ARM: dts: am33xx: Add pm-sram phandle to soc node

In reply to Dave Gerlach

Add a phandle to point to both the pm-sram-code and pm-sram-data nodes so that the pm code can locate the sram regions needed to copy low level PM code.

---
 arch/arm/boot/dts/am33xx.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/am33xx.dtsi +2 -0
index c27ef2cac394..842e726b944e 100644
@@ -147,6 +147,8 @@
 		mpu {
 			compatible = "ti,omap3-mpu";
 			ti,hwmods = "mpu";
+			pm-sram = <&pm_sram_code
+				   &pm_sram_data>;
 		};
 	};
 
Signature · 1 line
2.16.1
#6 lore raw

PATCH 6/9 ARM: dts: am4372: Add soc node

In reply to Dave Gerlach

Add soc node for am4372 with pm-sram phandle to both pm-sram-code and pm-sram-data regions.

---
 arch/arm/boot/dts/am4372.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/am4372.dtsi +10 -0
index 10dc52a07b32..b136c401879f 100644
@@ -92,6 +92,16 @@
 		};
 	};
 
+	soc {
+		compatible = "ti,omap-infra";
+		mpu {
+			compatible = "ti,omap4-mpu";
+			ti,hwmods = "mpu";
+			pm-sram = <&pm_sram_code
+				   &pm_sram_data>;
+		};
+	};
+
 	gic: interrupt-controller at 48241000 {
 		compatible = "arm,cortex-a9-gic";
 		interrupt-controller;
Signature · 1 line
2.16.1
#7 lore raw

PATCH 7/9 ARM: dts: am33xx: Mark emif with ti,no-idle

In reply to Dave Gerlach

We can never idle the emif hwmod from within the HLOS so mark the emif node with ti,no-idle.

---
 arch/arm/boot/dts/am33xx.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/am33xx.dtsi +1 -0
index 842e726b944e..77c618829734 100644
@@ -964,6 +964,7 @@
 			ti,hwmods = "emif";
 			sram = <&pm_sram_code
 				&pm_sram_data>;
+			ti,no-idle;
 		};
 
 		gpmc: gpmc at 50000000 {
Signature · 1 line
2.16.1
#8 lore raw

PATCH 8/9 ARM: dts: am4372: Mark emif with ti,no-idle

In reply to Dave Gerlach

We can never idle the emif hwmod from within the HLOS so mark the emif node with ti,no-idle.

---
 arch/arm/boot/dts/am4372.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/am4372.dtsi +1 -0
index b136c401879f..1ec8bdb00183 100644
@@ -247,6 +247,7 @@
 			compatible = "ti,emif-am4372";
 			reg = <0x4c000000 0x1000000>;
 			ti,hwmods = "emif";
+			ti,no-idle;
 			sram = <&pm_sram_code
 				&pm_sram_data>;
 		};
Signature · 1 line
2.16.1
#9 lore raw

PATCH 9/9 ARM: dts: am4372: Mark omap_l3_noc with ti,no-idle

In reply to Dave Gerlach

We can never idle the l3_main hwmod so mark the omap_l3_noc node with ti,no-idle.

---
 arch/arm/boot/dts/am4372.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/am4372.dtsi +1 -0
index 1ec8bdb00183..9a541cd12e0a 100644
@@ -153,6 +153,7 @@
 		#size-cells = <1>;
 		ranges;
 		ti,hwmods = "l3_main";
+		ti,no-idle;
 		reg = <0x44000000 0x400000
 		       0x44800000 0x400000>;
 		interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.16.1
#10 lore raw

cover ARM: dts: am33xx/am4372: Add suspend-resume support

In reply to Dave Gerlach
Quoted 6 lines · Dave Gerlach

Hi,
This series is the last needed to enable suspend/resume on am335x/am437x along with [1]. It adds required dt nodes for the emif and core PM code to find the needed sram nodes and marks key devices with ti,no-idle so that the kernel does not idle them. With this suspend to mem can be achieved by following the steps described in [1].

Applying all these into omap-for-v4.17/dt thanks.

Tony