]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk3328: Fix loading FIT from SD-card when booting from eMMC
authorJonas Karlman <jonas@kwiboo.se>
Sat, 17 Feb 2024 00:22:34 +0000 (00:22 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Thu, 14 Mar 2024 03:40:48 +0000 (11:40 +0800)
When RK3328 boards run SPL from eMMC and fail to load FIT from eMMC due
to it being missing or checksum validation fails there is a fallback to
read FIT from SD-card. However, without proper pinctrl configuration
reading FIT from SD-card will fail:

  U-Boot SPL 2024.04-rc1 (Feb 05 2024 - 22:18:22 +0000)
  Trying to boot from MMC1
  mmc_load_image_raw_sector: mmc block read error
  Trying to boot from MMC2
  Card did not respond to voltage select! : -110
  spl: mmc init failed with error: -95
  Trying to boot from MMC1
  mmc_load_image_raw_sector: mmc block read error
  SPL: failed to boot from all boot devices
  ### ERROR ### Please RESET the board ###

Fix this by tagging related emmc and sdmmc pinctrl nodes with bootph
props. Also sort and move common nodes shared by all boards to the SoC
u-boot.dtsi.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/dts/rk3328-evb-u-boot.dtsi
arch/arm/dts/rk3328-nanopi-r2s-u-boot.dtsi
arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi
arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi
arch/arm/dts/rk3328-roc-cc-u-boot.dtsi
arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi
arch/arm/dts/rk3328-rock64-u-boot.dtsi
arch/arm/dts/rk3328-u-boot.dtsi

index 12b68df1ac674420b5422165deade16de81651d9..38ad3cc16d098cf55f35f31fa78bcf4d7240646a 100644 (file)
@@ -44,3 +44,7 @@
        /* Integrated PHY unsupported by U-Boot */
        status = "broken";
 };
+
+&vcc_sd {
+       bootph-pre-ram;
+};
index 0a1152e8b52ddd70799a953c2c91393824cbdad0..cca4f06145cfcbc875bc91b57a69138d4a7eeba6 100644 (file)
@@ -7,23 +7,18 @@
 #include "rk3328-u-boot.dtsi"
 #include "rk3328-sdram-ddr4-666.dtsi"
 
-&gpio0 {
+&gpio1 {
        bootph-pre-ram;
 };
 
-&pinctrl {
-       bootph-pre-ram;
-};
-
-&sdmmc0m1_pin {
-       bootph-pre-ram;
+&sdio_vcc_pin {
+       bootph-all;
 };
 
-&pcfg_pull_up_4ma {
+&vcc_io_sdio {
        bootph-pre-ram;
 };
 
-/* Need this and all the pinctrl/gpio stuff above to set pinmux */
 &vcc_sd {
        bootph-pre-ram;
 };
index 8a4189c6f1ccafda21b3e9611501542901260882..7cdf6913795d8b7539856b077c49721be4b156b2 100644 (file)
@@ -7,29 +7,16 @@
 #include "rk3328-u-boot.dtsi"
 #include "rk3328-sdram-lpddr3-666.dtsi"
 
-&gpio0 {
-       bootph-pre-ram;
-};
-
-&pinctrl {
-       bootph-pre-ram;
-};
-
-&sdmmc0m1_pin {
+&spi0 {
        bootph-pre-ram;
-};
+       bootph-some-ram;
 
-&pcfg_pull_up_4ma {
-       bootph-pre-ram;
+       flash@0 {
+               bootph-pre-ram;
+               bootph-some-ram;
+       };
 };
 
-/* Need this and all the pinctrl/gpio stuff above to set pinmux */
 &vcc_sd {
        bootph-pre-ram;
 };
-
-&spi0 {
-       spi_flash: spiflash@0 {
-               bootph-all;
-       };
-};
index 2e3b6a77a2687f49fc9f73d31221e1e3a316e2cf..35baeb2464bcb172f12b78116779981c0b76de92 100644 (file)
@@ -7,29 +7,16 @@
 #include "rk3328-u-boot.dtsi"
 #include "rk3328-sdram-ddr4-666.dtsi"
 
-&gpio0 {
-       bootph-pre-ram;
-};
-
-&pinctrl {
-       bootph-pre-ram;
-};
-
-&sdmmc0m1_pin {
+&spi0 {
        bootph-pre-ram;
-};
+       bootph-some-ram;
 
-&pcfg_pull_up_4ma {
-       bootph-pre-ram;
+       flash@0 {
+               bootph-pre-ram;
+               bootph-some-ram;
+       };
 };
 
-/* Need this and all the pinctrl/gpio stuff above to set pinmux */
 &vcc_sd {
        bootph-pre-ram;
 };
-
-&spi0 {
-       spi_flash: spiflash@0 {
-               bootph-all;
-       };
-};
index 8bc2f134f8f46d192b3360409ca6d89ead3c58bb..47d74964fd0c82b3916961d03ed3e246aded485d 100644 (file)
        };
 };
 
-&gpio0 {
-       bootph-pre-ram;
-};
-
-&pinctrl {
-       bootph-pre-ram;
-};
-
-&sdmmc0m1_pin {
-       bootph-pre-ram;
-};
-
-&pcfg_pull_up_4ma {
-       bootph-pre-ram;
-};
-
-/* Need this and all the pinctrl/gpio stuff above to set pinmux */
 &vcc_sd {
        bootph-pre-ram;
 };
index 1f220c6dcd0f16cf1667fd08043dc4c4b9d7f4a1..9ed0aef1ecc96dbd5d6b257513fd43d1473c0d76 100644 (file)
        };
 };
 
-&gpio0 {
-       bootph-pre-ram;
-};
-
-&pinctrl {
-       bootph-pre-ram;
-};
-
-&sdmmc0m1_pin {
-       bootph-pre-ram;
-};
-
-&pcfg_pull_up_4ma {
-       bootph-pre-ram;
-};
-
-/* Need this and all the pinctrl/gpio stuff above to set pinmux */
 &vcc_sd {
        bootph-pre-ram;
 };
index bfe506fd2249cbb8546617dfab80e2107e7725a4..9de645d8d7abd7bcdd5c3c3fc1709692e79a7f89 100644 (file)
        };
 };
 
-&gpio0 {
-       bootph-pre-ram;
-};
-
-&pinctrl {
-       bootph-pre-ram;
-};
-
-&sdmmc0m1_pin {
+&spi0 {
        bootph-pre-ram;
-};
+       bootph-some-ram;
 
-&pcfg_pull_up_4ma {
-       bootph-pre-ram;
+       flash@0 {
+               bootph-pre-ram;
+               bootph-some-ram;
+       };
 };
 
-/* Need this and all the pinctrl/gpio stuff above to set pinmux */
 &vcc_sd {
        bootph-pre-ram;
 };
-
-&spi0 {
-       spi_flash: flash@0 {
-               bootph-all;
-       };
-};
index a12be7876db046312d7ebb5d7fd71a46fdba538d..687c16da5135a41bb306b133786011ebce90ce18 100644 (file)
        bootph-all;
 };
 
+&emmc {
+       bootph-pre-ram;
+       bootph-some-ram;
+
+       /* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
+       u-boot,spl-fifo-mode;
+};
+
+&emmc_bus8 {
+       bootph-pre-ram;
+};
+
+&emmc_clk {
+       bootph-pre-ram;
+};
+
+&emmc_cmd {
+       bootph-pre-ram;
+};
+
+&gpio0 {
+       bootph-pre-ram;
+};
+
 &grf {
        bootph-all;
 };
 
-&uart2 {
+&pcfg_pull_none {
        bootph-all;
-       clock-frequency = <24000000>;
 };
 
-&emmc {
+&pcfg_pull_none_8ma {
+       bootph-pre-ram;
+};
+
+&pcfg_pull_none_12ma {
+       bootph-pre-ram;
+};
+
+&pcfg_pull_up {
        bootph-all;
+};
 
-       /* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
-       u-boot,spl-fifo-mode;
+&pcfg_pull_up_4ma {
+       bootph-pre-ram;
+};
+
+&pcfg_pull_up_8ma {
+       bootph-pre-ram;
+};
+
+&pcfg_pull_up_12ma {
+       bootph-pre-ram;
+};
+
+&pinctrl {
+       bootph-pre-ram;
+       bootph-some-ram;
 };
 
 &sdmmc {
-       bootph-all;
+       bootph-pre-ram;
+       bootph-some-ram;
 
-       /* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
+       /* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
        u-boot,spl-fifo-mode;
 };
 
-&usb20_otg {
-       hnp-srp-disable;
+&sdmmc0_bus4 {
+       bootph-pre-ram;
+};
+
+&sdmmc0_clk {
+       bootph-pre-ram;
+};
+
+&sdmmc0_cmd {
+       bootph-pre-ram;
+};
+
+&sdmmc0_dectn {
+       bootph-pre-ram;
+};
+
+&sdmmc0m1_pin {
+       bootph-pre-ram;
+};
+
+&uart2 {
+       bootph-all;
+       clock-frequency = <24000000>;
 };
 
-&spi0 {
+&uart2m1_xfer {
        bootph-all;
 };
+
+&usb20_otg {
+       hnp-srp-disable;
+};