[PATCH] ARM: dts: rk356x: describe serial reboot mode

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Apr 14 22:32:53 PDT 2024


The PMUGRF (Power Management Unit - General Register File) of the RK3568
has a general purpose register checked by the BootROM on power-on to
decide on whether to drop to recovery mode (rk-usb-loader/rkdeveloptool).

Describe this in the device tree, so it's possible to use, e.g.

  global.system.reboot_mode.next=serial reset

to force falling into serial (USB) boot mode.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/dts/rk356x.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/dts/rk356x.dtsi b/arch/arm/dts/rk356x.dtsi
index 923e18e7ccda..7fd5f72a5918 100644
--- a/arch/arm/dts/rk356x.dtsi
+++ b/arch/arm/dts/rk356x.dtsi
@@ -1,6 +1,12 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 
+#include <dt-bindings/soc/rockchip,boot-mode.h>
+
 / {
+	aliases {
+		pmugrf.reboot_mode = &reboot_mode_pmugrf;
+	};
+
 	chosen {
 		barebox,bootsource-mmc0 = &sdhci;
 		barebox,bootsource-mmc1 = &sdmmc0;
@@ -31,3 +37,12 @@ rng: rng at fe388000 {
 		resets = <&cru SRST_TRNG_NS>;
 	};
 };
+
+&pmugrf {
+	reboot_mode_pmugrf: reboot-mode {
+		compatible = "syscon-reboot-mode";
+		offset = <0x200>;
+		mode-normal = <BOOT_NORMAL>;
+		mode-serial = <0xef08a53c>; /* rk-usb-loader */
+	};
+};
-- 
2.39.2




More information about the barebox mailing list