mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] ARM: dts: rk356x: describe serial reboot mode
Date: Mon, 15 Apr 2024 07:32:53 +0200	[thread overview]
Message-ID: <20240415053253.369354-1-a.fatoum@pengutronix.de> (raw)

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@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@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




             reply	other threads:[~2024-04-15  5:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15  5:32 Ahmad Fatoum [this message]
2024-04-16 10:22 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240415053253.369354-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox