diff mbox series

[3/3] arm64: dts: exynos: gs101: add reboot-mode support (SYSIP_DAT0)

Message ID 20250206-gs101-renppt-dts-v1-3-cdfe993fb3c5@linaro.org
State Superseded
Headers show
Series gs101 reboot updates (DT) | expand

Commit Message

André Draszik Feb. 6, 2025, 1:08 p.m. UTC
syscon-reboot-mode can be used to indicate the reboot mode for the
bootloader.

While not sufficient for all boot modes, the boot loader does use
SYSIP_DAT0 (PMU + 0x0810) to determine some of the actions it should
take. This change helps it deciding what to do in those cases.

For complete support, we'll also have to write the boot mode to an
NVMEM storage location, but we have no upstream driver for that yet.
Nevertheless, this patch is a step towards full support for the boot
mode.

Note1: Android also uses 'shutdown,thermal' and
shutdown,thermal,battery', but that can not be described in DT as ','
is used to denote vendor prefixes. I've left them out from here for
that reason.

Note2: downstream / bootloader recognizes one more mode: 'dm-verity
device corrupted' with value 0x50, but we can not describe that in DT
using a property name due to the space, so it's been left out from here
as well. This string appears to come from drivers/md/dm-verity-target.c
and should probably be changed there in a follow-up patch, so that it
can be used in reboot-mode nodes like this one here.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
 arch/arm64/boot/dts/exynos/google/gs101.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Peter Griffin Feb. 9, 2025, 3:49 p.m. UTC | #1
On Thu, 6 Feb 2025 at 13:08, André Draszik <andre.draszik@linaro.org> wrote:
>
> syscon-reboot-mode can be used to indicate the reboot mode for the
> bootloader.
>
> While not sufficient for all boot modes, the boot loader does use
> SYSIP_DAT0 (PMU + 0x0810) to determine some of the actions it should
> take. This change helps it deciding what to do in those cases.
>
> For complete support, we'll also have to write the boot mode to an
> NVMEM storage location, but we have no upstream driver for that yet.
> Nevertheless, this patch is a step towards full support for the boot
> mode.
>
> Note1: Android also uses 'shutdown,thermal' and
> shutdown,thermal,battery', but that can not be described in DT as ','
> is used to denote vendor prefixes. I've left them out from here for
> that reason.
>
> Note2: downstream / bootloader recognizes one more mode: 'dm-verity
> device corrupted' with value 0x50, but we can not describe that in DT
> using a property name due to the space, so it's been left out from here
> as well. This string appears to come from drivers/md/dm-verity-target.c
> and should probably be changed there in a follow-up patch, so that it
> can be used in reboot-mode nodes like this one here.
>
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi
index 4f45bfeb33c0..f4c098ca9fd2 100644
--- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi
+++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi
@@ -1410,6 +1410,19 @@  reboot: syscon-reboot {
 				offset = <0x3a00>; /* SYSTEM_CONFIGURATION */
 				value = <0x2>; /* reset value */
 			};
+
+			reboot-mode {
+				compatible = "syscon-reboot-mode";
+				offset = <0x0810>; /* EXYNOS_PMU_SYSIP_DAT0 */
+				mode-bootloader = <0xfc>;
+				mode-charge = <0x0a>;
+				mode-fastboot = <0xfa>;
+				mode-reboot-ab-update = <0x52>;
+				mode-recovery = <0xff>;
+				mode-rescue = <0xf9>;
+				mode-shutdown-thermal = <0x51>;
+				mode-shutdown-thermal-battery = <0x51>;
+			};
 		};
 
 		pinctrl_gpio_alive: pinctrl@174d0000 {