~martijnbraam/pmos-upstream

ARM: dts: msm8974-FP2: add reboot-mode node v1 NEEDS REVISION

Luca Weiss: 1
 ARM: dts: msm8974-FP2: add reboot-mode node

 1 files changed, 14 insertions(+), 0 deletions(-)
Hi Brian,
how about something like that (formatting is surely broken because I'm not 
sending this with git-send-email^^)?

I'd says this should be work fine with all devices as all modes are defined in 
the device-specific dts but the reg and offset values are in the board dts. 
Should I also add a status = "disabled" to the reboot-mode node in the board 
dts?

diff --git a/arch/arm/boot/dts/qcom-msm8974-fairphone-fp2.dts b/arch/arm/boot/
dts/qcom-msm8974-fairphone-fp2.dts
index 643c57f84818..ff4a3e0aa746 100644
--- a/arch/arm/boot/dts/qcom-msm8974-fairphone-fp2.dts
+++ b/arch/arm/boot/dts/qcom-msm8974-fairphone-fp2.dts
@@ -338,6 +338,16 @@
 			};
 		};
 	};
+
+	imem@fe805000 {
+		status = "okay";
+
+		reboot-mode {
+			mode-normal	= <0x77665501>;
+			mode-bootloader	= <0x77665500>;
+			mode-recovery	= <0x77665502>;
+		};
+	};
 };
 
 &spmi_bus {
diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-
msm8974.dtsi
index 45b5c8ef0374..1927430bded7 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -1085,6 +1085,17 @@
 				};
 			};
 		};
+
+		imem@fe805000 {
+			status = "disabled";
+			compatible = "syscon", "simple-mfd";
+			reg = <0xfe805000 0x1000>;
+
+			reboot-mode {
+				compatible = "syscon-reboot-mode";
+				offset = <0x65c>;
+			};
+		};
 	};
 
 	smd {

Regards,
Luca
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~martijnbraam/pmos-upstream/patches/6292/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] ARM: dts: msm8974-FP2: add reboot-mode node Export this patch

This enables userspace to signal the bootloader to go into the
bootloader or recovery mode.

The magic values can be found in both the downstream kernel and the LK
kernel (bootloader).

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
Sidenote: Why are there no userspace tools to be found that support
this? Anyways, we have one now in postmarketOS :)

 arch/arm/boot/dts/qcom-msm8974-fairphone-fp2.dts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8974-fairphone-fp2.dts b/arch/arm/boot/dts/qcom-msm8974-fairphone-fp2.dts
index 643c57f84818..f86736a6d77e 100644
--- a/arch/arm/boot/dts/qcom-msm8974-fairphone-fp2.dts
+++ b/arch/arm/boot/dts/qcom-msm8974-fairphone-fp2.dts
@@ -338,6 +338,20 @@
			};
		};
	};

	imem@fe805000 {
		compatible = "syscon", "simple-mfd";
		reg = <0xfe805000 0x1000>;

		reboot-mode {
			compatible = "syscon-reboot-mode";
			offset = <0x65c>;

			mode-normal	= <0x77665501>;
			mode-bootloader	= <0x77665500>;
			mode-recovery	= <0x77665502>;
		};
	};
};

&spmi_bus {
-- 
2.22.0
Brian Masney
Hi Luca,

On Fri, Jun 21, 2019 at 12:58:24AM +0200, Luca Weiss wrote: