[PATCH] arm: dts: orangepi: Fix Orange Pi R1 and Plus LTS boot issue

Слава Иванов islavaivanov76 at gmail.com
Tue Jul 30 22:55:01 CEST 2024


Orange Pi R1 Plus and LTS don't have eMMC
(default mmc0 in rk3328-u-boot.dtsi).
The device is equipped with SPI flash memory, which U-Boot tries to use for
reading configuration. However, the manufacturer has not provided any means
to utilize SPI flash memory. There is no documentation,
or software available for this purpose.

As a result, during OpenWRT sysupgrade, the board fails to boot because the
script that switches the boot_device to an available one does not trigger.

This patch changes the alias of mmc0 from &emmc to &sdmmc,
ensuring the board boots correctly,
and sysupgrade completes successfully.
Additionally, this allows saving the U-Boot environment
by using saveenv with uboot-envtool.

Signed-off-by: Pugemon <islavaivanov76 at gmail.com>
Cc: Tianling Shen <cnsztl at gmail.com>
---
 arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi | 12 ++++++++++++
 arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi     | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi
b/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi
index b50c1332b8..7063b188f2 100644
--- a/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi
+++ b/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi
@@ -2,11 +2,23 @@
 /*
  * (C) Copyright 2018-2019 Rockchip Electronics Co., Ltd
  * (C) Copyright 2020 David Bauer
+ * (C) Copyright 2024 Pugemon
  */

 #include "rk3328-u-boot.dtsi"
 #include "rk3328-sdram-lpddr3-666.dtsi"

+/ {
+       aliases {
+               mmc0 = &sdmmc;
+               spi0 = &spi0;
+       };
+
+       chosen {
+               u-boot,spl-boot-order = "same-as-spl", &sdmmc;
+       };
+};
+
 &spi0 {
        flash at 0 {
                bootph-pre-ram;
diff --git a/arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi
b/arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi
index 8ae003bbef..0374172527 100644
--- a/arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi
+++ b/arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi
@@ -2,11 +2,23 @@
 /*
  * (C) Copyright 2018-2019 Rockchip Electronics Co., Ltd
  * (C) Copyright 2020 David Bauer
+ * (C) Copyright 2024 Pugemon
  */

 #include "rk3328-u-boot.dtsi"
 #include "rk3328-sdram-ddr4-666.dtsi"

+/ {
+       aliases {
+               mmc0 = &sdmmc;
+               spi0 = &spi0;
+       };
+
+       chosen {
+               u-boot,spl-boot-order = "same-as-spl", &sdmmc;
+       };
+};
+
 &spi0 {
        flash at 0 {
                bootph-pre-ram;


More information about the U-Boot mailing list