Skip to contentSkip to conversation

ARM: dts: imx7d: enable snvs rtc, onoffkey and power off

PATCH Superseded Frank.Li at freescale.com 3 participants 5 messages Jul 8, 2015 – Jul 14, 2015

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: dts: imx7d: enable snvs rtc, onoffkey and power off

From: Frank Li <[email protected]>

Change SNVS rtc to syscon interface.
Enable onoff key and power off function.

---
 arch/arm/boot/dts/imx7d-sdb.dts |  4 ++++
 arch/arm/boot/dts/imx7d.dtsi    | 27 +++++++++++++++++++++------
 2 files changed, 25 insertions(+), 6 deletions(-)
arch/arm/boot/dts/imx7d-sdb.dts +4 -0
index 4d1a4b9..214eba9 100644
@@ -223,6 +223,10 @@
 	};
 };
 
+&snvs_poweroff {
+	status = "okay";
+};
+
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1>;
arch/arm/boot/dts/imx7d.dtsi +21 -6
index b4cd8fd..308ad1b 100644
@@ -322,17 +322,32 @@
 			};
 
 			snvs: snvs at 30370000 {
-				compatible = "fsl,sec-v4.0-mon", "simple-bus";
-				#address-cells = <1>;
-				#size-cells = <1>;
-				ranges = <0 0x30370000 0x10000>;
+				compatible = "fsl,sec-v4.0-mon", "syscon", "simple-mfd";
+				reg = <0x30370000 0x10000>;
 
-				snvs-rtc-lp at 34 {
+				snvs_rtc: snvs-rtc-lp {
 					compatible = "fsl,sec-v4.0-mon-rtc-lp";
-					reg = <0x34 0x58>;
+					regmap = <&snvs>;
+					offset = <0x34>;
 					interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
 						     <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
 				};
+
+				snvs_poweroff: snvs-poweroff {
+					compatible = "syscon-poweroff";
+					regmap = <&snvs>;
+					offset = <0x38>;
+					mask = <0x60>;
+					status = "disabled";
+				};
+
+				snvs_pwrkey: snvs-powerkey {
+					compatible = "fsl,sec-v4.0-pwrkey";
+					regmap = <&snvs>;
+					interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+					linux,keycode = <KEY_POWER>;
+					wakeup;
+				};
 			};
 
 			clks: ccm at 30380000 {
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 ARM: imx_v6_v7_defconfig: enable powerkey and syscon power off

From: Frank Li <[email protected]>

build in snvs powerkey
build in syscon power off support

---
 arch/arm/configs/imx_v6_v7_defconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/configs/imx_v6_v7_defconfig +2 -0
index 4458554..5303eda 100644
@@ -151,6 +151,7 @@ CONFIG_WLCORE_SDIO=m
 CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_EVBUG=m
 CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_SNVS_PWRKEY=y
 CONFIG_KEYBOARD_IMX=y
 CONFIG_MOUSE_PS2=m
 CONFIG_MOUSE_PS2_ELANTECH=y
@@ -186,6 +187,7 @@ CONFIG_POWER_SUPPLY=y
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_IMX=y
 CONFIG_POWER_RESET_SYSCON=y
+CONFIG_POWER_RESET_SYSCON_POWEROFF=y
 CONFIG_SENSORS_GPIO_FAN=y
 CONFIG_THERMAL=y
 CONFIG_CPU_THERMAL=y
Signature · 1 line
1.9.1
#3 lore raw

PATCH 1/2 ARM: dts: imx7d: enable snvs rtc, onoffkey and power off

In reply to Frank.Li at freescale.com
Quoted 48 lines · Frank.Li at freescale.com

From: Frank Li <[email protected]>

Change SNVS rtc to syscon interface.
Enable onoff key and power off function.

---
 arch/arm/boot/dts/imx7d-sdb.dts |  4 ++++
 arch/arm/boot/dts/imx7d.dtsi    | 27 +++++++++++++++++++++------
 2 files changed, 25 insertions(+), 6 deletions(-)
arch/arm/boot/dts/imx7d-sdb.dts +4 -0
index 4d1a4b9..214eba9 100644
@@ -223,6 +223,10 @@
 	};
 };
 
+&snvs_poweroff {
+	status = "okay";
+};
+
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1>;
arch/arm/boot/dts/imx7d.dtsi +5 -6
index b4cd8fd..308ad1b 100644
@@ -322,17 +322,32 @@
 			};
 
 			snvs: snvs at 30370000 {
-				compatible = "fsl,sec-v4.0-mon", "simple-bus";
-				#address-cells = <1>;
-				#size-cells = <1>;
-				ranges = <0 0x30370000 0x10000>;
+				compatible = "fsl,sec-v4.0-mon", "syscon", "simple-mfd";
+				reg = <0x30370000 0x10000>;
 
-				snvs-rtc-lp at 34 {
+				snvs_rtc: snvs-rtc-lp {
 					compatible = "fsl,sec-v4.0-mon-rtc-lp";
-					reg = <0x34 0x58>;
+					regmap = <&snvs>;
+					offset = <0x34>;
 					interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,

arch/arm/boot/dts/imx7d.dtsi line 342

Quoted 10 lines
arch/arm/boot/dts/imx7d.dtsi +8 -0
 						     <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
 				};
+
+				snvs_poweroff: snvs-poweroff {
+					compatible = "syscon-poweroff";
+					regmap = <&snvs>;
+					offset = <0x38>;
+					mask = <0x60>;
+					status = "disabled";
+				};

For such completely internal device without any board level configuration and pin-out, we should probably just leave it enabled by default, i.e. drop status = "disabled" and save status = "okay" in board level dts?

Shawn

Quoted 20 lines
arch/arm/boot/dts/imx7d.dtsi +8 -0
+
+				snvs_pwrkey: snvs-powerkey {
+					compatible = "fsl,sec-v4.0-pwrkey";
+					regmap = <&snvs>;
+					interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+					linux,keycode = <KEY_POWER>;
+					wakeup;
+				};
 			};
 
 			clks: ccm at 30380000 {
Signature · 7 lines
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#4 lore raw

PATCH 1/2 ARM: dts: imx7d: enable snvs rtc, onoffkey and power off

Quoted 4 lines · Shawn Guo

without any board level
configuration and pin-out, we should probably just leave it enabled by default, i.e. drop status = "disabled" and save status = "okay" in board level dts?

Okay, Did you need me send new version? or you can change it?

best regards
Frank Li