[PATCH 4/5] arm64: dts: rockchip: add reboot-mode node to RK3576
Alexey Charkov
alchark at flipper.net
Mon Sep 28 10:18:19 PDT 2026
The RK3576 boot ROM chooses its boot device order from PMU1_GRF OS_REG0
when that register holds one of its magic values: 0xef08a53c selects USB
download (maskrom) mode, 0xef085a3X selects boot mode X, overriding what
OTP or the SARADC strap would otherwise give.
OS_REG0 cannot be written ahead of a reset, as it is cleared by NPOR.
Instead TF-A takes a request from PMU0_GRF OS_REG16, forwards it to
OS_REG0 and masks the reset outputs so that it reaches the boot ROM.
That register is the one U-Boot uses for its own boot modes as well.
Describe it as a syscon-reboot-mode node, so that a reboot can carry a
request for maskrom or for a particular boot device. Under Linux, for
example:
systemctl reboot --reboot-argument=maskrom
Requesting anything other than maskrom needs a TF-A containing commit
2a97ba20e901 ("feat(rk3576): forward any boot ROM boot mode request on
reset"); older builds ignore those requests and boot normally.
Link: https://docs.flipper.net/one/hardware/rk3576/boot-rom
Signed-off-by: Alexey Charkov <alchark at flipper.net>
---
arch/arm64/boot/dts/rockchip/rk3576.dtsi | 36 ++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3576.dtsi b/arch/arm64/boot/dts/rockchip/rk3576.dtsi
index e87ace5d05e6..c938dbcad712 100644
--- a/arch/arm64/boot/dts/rockchip/rk3576.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3576.dtsi
@@ -881,6 +881,42 @@ php_grf: syscon at 26020000 {
pmu0_grf: syscon at 26024000 {
compatible = "rockchip,rk3576-pmu0-grf", "syscon", "simple-mfd";
reg = <0x0 0x26024000 0x0 0x1000>;
+
+ /*
+ * OS_REG16 carries a boot mode request across a reset.
+ * TF-A picks it up while resetting the system, forwards
+ * it to the boot ROM through PMU1_GRF OS_REG0 and masks
+ * the reset outputs, so that the request survives NPOR.
+ * The modes below are listed in boot mode order, each
+ * naming the devices the boot ROM tries in turn.
+ */
+ reboot_mode: reboot-mode {
+ compatible = "syscon-reboot-mode";
+ offset = <0x40>;
+ mode-normal = <BOOT_NORMAL>;
+ /* 1: USB */
+ mode-maskrom = <BOOT_BROM_DOWNLOAD>;
+ /* 2: SPI NOR, SPI NAND, USB */
+ mode-spi = <0xef085a32>;
+ /* 3: SPI NOR/NAND M1, eMMC, USB */
+ mode-spi-m1 = <0xef085a33>;
+ /* 4: SPI NOR/NAND M2, eMMC, USB */
+ mode-spi-m2 = <0xef085a34>;
+ /* 5: SPI NOR, SPI NAND, UFS, USB */
+ mode-spi-ufs = <0xef085a35>;
+ /* 6: SPI NOR/NAND M1, UFS, USB */
+ mode-spi-m1-ufs = <0xef085a36>;
+ /* 7: UFS, USB */
+ mode-ufs = <0xef085a37>;
+ /* 8: UFS, SD, USB */
+ mode-ufs-sd = <0xef085a38>;
+ /* 9: every SPI iomux, eMMC, SD, USB */
+ mode-spi-all = <0xef085a39>;
+ /* 10: eMMC, SD, USB */
+ mode-emmc-sd = <0xef085a3a>;
+ /* 11: eMMC, USB */
+ mode-emmc = <0xef085a3b>;
+ };
};
pmu1_grf: syscon at 26026000 {
--
2.55.0
More information about the Linux-rockchip
mailing list