Skip to contentSkip to conversation

rockchip: Fix SPI boot on Pinebook Pro and RK3399-ROC-PC

PATCH Superseded Hugh Cole-Baker 2 participants 4 messages Nov 14, 2020 – Nov 19, 2020 Arm (32-bit)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover rockchip: Fix SPI boot on Pinebook Pro and RK3399-ROC-PC

Commit c4cea2bbf995 ("rockchip: Enable building a SPI ROM image on bob") added an alias spi1 referring to spi at ff1d0000, however in several boards there was already an alias spi0 referring to the same node, and having both aliases present broke booting U-Boot from SPI flash.

This series removes the spi0 alias from the Pinebook Pro and RK3399-ROC-PC and sets the default bus for SPI flash to 1, so that the correct device is used. The Rockpro64 board, which was also affected, has already had the same type of fix applied.

The rk3399 Puma board also has an alias spi0 = &spi1 in its dts, but I haven't touched its configuration as it seems to have a more complex setup where spi1 is already an alias that points to &spi5. I don't have one of these boards to test with, but I suspect it wasn't affected by the addition of the spi1 alias in rk3399-u-boot.dtsi.

Hugh Cole-Baker (2):
rockchip: pinebook-pro: default to SPI bus 1 for SPI-flash
rockchip: rk3399-roc-pc: default to SPI bus 1 for SPI-flash

 arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi | 4 ----
 arch/arm/dts/rk3399-roc-pc-u-boot.dtsi       | 4 ----
 configs/pinebook-pro-rk3399_defconfig        | 2 ++
 configs/roc-pc-mezzanine-rk3399_defconfig    | 1 +
 configs/roc-pc-rk3399_defconfig              | 1 +
 5 files changed, 4 insertions(+), 8 deletions(-)
Signature · 1 line
2.24.3 (Apple Git-128)
#1 lore raw

PATCH 1/2 rockchip: pinebook-pro: default to SPI bus 1 for SPI-flash

SPI flash on this machine is located on bus 1, default to using bus 1 for SPI flash and stop aliasing it to bus 0.

Fixes c4cea2bb ("rockchip: Enable building a SPI ROM image on bob")

---

 arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi | 4 ----
 configs/pinebook-pro-rk3399_defconfig        | 2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)
arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi +0 -4
index ded7db0aeff..ee3b98698e6 100644
@@ -7,10 +7,6 @@
 #include "rk3399-sdram-lpddr4-100.dtsi"
 
 / {
-	aliases {
-		spi0 = &spi1;
-	};
-
 	chosen {
 		u-boot,spl-boot-order = "same-as-spl", &sdhci, &spiflash, &sdmmc;
 	};
configs/pinebook-pro-rk3399_defconfig +2 -0
index 1ed54ad0eda..ef00ad92c45 100644
@@ -37,6 +37,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_DM_KEYBOARD=y
@@ -49,6 +50,7 @@ CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_WINBOND=y
Signature · 1 line
2.24.3 (Apple Git-128)
#2 lore raw

PATCH 2/2 rockchip: rk3399-roc-pc: default to SPI bus 1 for SPI-flash

In reply to Hugh Cole-Baker

SPI flash on this board is located on bus 1, default to using bus 1 for SPI flash on both rk3399-roc-pc and -mezzanine, and stop aliasing it to bus 0.

Fixes c4cea2bb ("rockchip: Enable building a SPI ROM image on bob")

---

 arch/arm/dts/rk3399-roc-pc-u-boot.dtsi    | 4 ----
 configs/roc-pc-mezzanine-rk3399_defconfig | 1 +
 configs/roc-pc-rk3399_defconfig           | 1 +
 3 files changed, 2 insertions(+), 4 deletions(-)
arch/arm/dts/rk3399-roc-pc-u-boot.dtsi +0 -4
index fc155e69036..e3c9364e359 100644
@@ -7,10 +7,6 @@
 #include "rk3399-sdram-lpddr4-100.dtsi"
 
 / {
-	aliases {
-		spi0 = &spi1;
-	};
-
 	chosen {
 		u-boot,spl-boot-order = "same-as-spl", &spi_flash, &sdhci, &sdmmc;
 	};
configs/roc-pc-mezzanine-rk3399_defconfig +1 -0
index ae16f3558a3..8aa5a155180 100644
@@ -42,6 +42,7 @@ CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
configs/roc-pc-rk3399_defconfig +1 -0
index 774707b115b..927b57685d9 100644
@@ -41,6 +41,7 @@ CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
Signature · 1 line
2.24.3 (Apple Git-128)
#3 lore raw

cover rockchip: Fix SPI boot on Pinebook Pro and RK3399-ROC-PC

In reply to Hugh Cole-Baker

Hi Hugh,

??? After this patch set, only one board is still using the "spi0 =
&spi1" alias, could you correct it at the same time?

rk3399-puma-haikou-u-boot.dtsi

Thanks,

- Kever

Quoted 28 lines · Hugh Cole-Baker

Commit c4cea2bbf995 ("rockchip: Enable building a SPI ROM image on bob") added an alias spi1 referring to spi at ff1d0000, however in several boards there was already an alias spi0 referring to the same node, and having both aliases present broke booting U-Boot from SPI flash.

This series removes the spi0 alias from the Pinebook Pro and RK3399-ROC-PC and sets the default bus for SPI flash to 1, so that the correct device is used. The Rockpro64 board, which was also affected, has already had the same type of fix applied.

The rk3399 Puma board also has an alias spi0 = &spi1 in its dts, but I haven't touched its configuration as it seems to have a more complex setup where spi1 is already an alias that points to &spi5. I don't have one of these boards to test with, but I suspect it wasn't affected by the addition of the spi1 alias in rk3399-u-boot.dtsi.

Hugh Cole-Baker (2):
rockchip: pinebook-pro: default to SPI bus 1 for SPI-flash
rockchip: rk3399-roc-pc: default to SPI bus 1 for SPI-flash

  arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi | 4 ----
  arch/arm/dts/rk3399-roc-pc-u-boot.dtsi       | 4 ----
  configs/pinebook-pro-rk3399_defconfig        | 2 ++
  configs/roc-pc-mezzanine-rk3399_defconfig    | 1 +
  configs/roc-pc-rk3399_defconfig              | 1 +
  5 files changed, 4 insertions(+), 8 deletions(-)