Skip to contentSkip to conversation

rockchip: rk35xx: Update defconfigs and enable boot from SPI NOR flash

PATCH Superseded Jonas Karlman 3 participants 40 messages Apr 22, 2023 – May 17, 2023

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover rockchip: rk35xx: Update defconfigs and enable boot from SPI NOR flash

This series sync some defconfig options across the different rk35xx boards and enables boot from SPI NOR flash on rk3568-rock-3a and rk3588-rock-5b.

Patch 1 fixes use of sfc-no-dma prop in rockchip sfc driver. Patch 2-7 updates defconfig for rk356x boards. Patch 8 enables boot from SPI NOR flash on rk3568-rock-3a. Patch 9-12 updates defconfig for rk3588 boards. Patch 13 enables boot from SPI NOR flash on rk3588-rock-5b. Patch 14 reverts addition of regulator-boot-on props.

Please note that patches related to rk3588 depend on [1] and [2], they may not apply clean. The final patch revert a workaround to fix usb that is not needed after series [1] and [3].

This series can also be found at [4].

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[3] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[4] https://github.com/Kwiboo/u-boot-rockchip/commits/rk35xx-defconfig-spi-v1

Jonas Karlman (14):
spi: rockchip_sfc: Use linux rockchip,sfc-no-dma prop
rockchip: rk356x-u-boot: Add xin24m clock node to SPL
rockchip: rk3566-radxa-cm3-io: Update defconfig
rockchip: rk3566-radxa-cm3-io: Use pinctrl for sdmmc and sdhci in SPL
rockchip: rk3568-evb: Update defconfig
rockchip: rk3568-rock-3a: Update defconfig
rockchip: rk3568-rock-3a: Use pinctrl for sdmmc and sdhci in SPL
rockchip: rk3568-rock-3a: Enable boot from SPI NOR flash
rockchip: rk3588: Select DM_RESET and DM_REGULATOR_FIXED in arch
Kconfig
rockchip: rk3588-evb: Update defconfig
rockchip: rk3588-rock-5b: Update defconfig
rockchip: rk3588-rock-5b: Add bootph prop to pinctrl for uart2 and
sdhci
rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash Revert "arm: dts: rockchip: radxa-cm3-io, rock-3a: enable regulators
for usb"

 arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 65 ++++++++++++++-
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi      | 85 ++++++++++++++++++--
 arch/arm/dts/rk356x-u-boot.dtsi              | 16 ++++
 arch/arm/dts/rk3588-rock-5b-u-boot.dtsi      | 52 ++++++++++++
 arch/arm/dts/rk3588s-u-boot.dtsi             | 20 +++++
 arch/arm/mach-rockchip/Kconfig               |  2 +
 arch/arm/mach-rockchip/rk3588/rk3588.c       |  1 +
 configs/evb-rk3568_defconfig                 | 15 ++--
 configs/evb-rk3588_defconfig                 | 11 +--
 configs/neu6a-io-rk3588_defconfig            |  1 -
 configs/radxa-cm3-io-rk3566_defconfig        | 10 ++-
 configs/rock-3a-rk3568_defconfig             | 20 +++--
 configs/rock5b-rk3588_defconfig              | 19 +++--
 drivers/spi/rockchip_sfc.c                   | 10 ++-
 14 files changed, 285 insertions(+), 42 deletions(-)
Signature · 1 line
2.40.0
#1 lore raw

PATCH 1/14 spi: rockchip_sfc: Use linux rockchip,sfc-no-dma prop

Use the same prop as linux to control the use of fifo or dma mode. Also add a u-boot,spl-sfc-no-dma prop to control the same in SPL.

---
 drivers/spi/rockchip_sfc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/spi/rockchip_sfc.c +6 -4
index 851a6482985b..1c26802c618e 100644
@@ -227,10 +227,12 @@ static int rockchip_sfc_ofdata_to_platdata(struct udevice *bus)
 	struct rockchip_sfc *sfc = dev_get_plat(bus);
 
 	sfc->regbase = dev_read_addr_ptr(bus);
-	if (ofnode_read_bool(dev_ofnode(bus), "sfc-no-dma"))
-		sfc->use_dma = false;
-	else
-		sfc->use_dma = true;
+	sfc->use_dma = !dev_read_bool(bus, "rockchip,sfc-no-dma");
+
+#ifdef CONFIG_SPL_BUILD
+	if (sfc->use_dma)
+		sfc->use_dma = !dev_read_bool(bus, "u-boot,spl-sfc-no-dma");
+#endif
 
 #if CONFIG_IS_ENABLED(CLK)
 	int ret;
Signature · 1 line
2.40.0
Reviewed-by on v1 1/14
#2 lore raw

Re: [PATCH 01/14] spi: rockchip_sfc: Use linux rockchip,sfc-no-dma prop

Quoted 4 lines · Jonas Karlman

Use the same prop as linux to control the use of fifo or dma mode. Also add a u-boot,spl-sfc-no-dma prop to control the same in SPL.

Thanks,
- Kever

Quoted 25 lines
---
  drivers/spi/rockchip_sfc.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)
drivers/spi/rockchip_sfc.c +6 -4
index 851a6482985b..1c26802c618e 100644
@@ -227,10 +227,12 @@ static int rockchip_sfc_ofdata_to_platdata(struct udevice *bus)
  	struct rockchip_sfc *sfc = dev_get_plat(bus);
 
  	sfc->regbase = dev_read_addr_ptr(bus);
-	if (ofnode_read_bool(dev_ofnode(bus), "sfc-no-dma"))
-		sfc->use_dma = false;
-	else
-		sfc->use_dma = true;
+	sfc->use_dma = !dev_read_bool(bus, "rockchip,sfc-no-dma");
+
+#ifdef CONFIG_SPL_BUILD
+	if (sfc->use_dma)
+		sfc->use_dma = !dev_read_bool(bus, "u-boot,spl-sfc-no-dma");
+#endif
 
  #if CONFIG_IS_ENABLED(CLK)
  	int ret;
#3 lore raw

PATCH 2/14 rockchip: rk356x-u-boot: Add xin24m clock node to SPL

In reply to Jonas Karlman

Add bootph-all prop to xin24m clock node, it is referenced by cru node.

---
 arch/arm/dts/rk356x-u-boot.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/dts/rk356x-u-boot.dtsi +5 -0
index 0a764ce5119c..a1c2d03c52f0 100644
@@ -34,6 +34,11 @@
 	};
 };
 
+&xin24m {
+	bootph-all;
+	status = "okay";
+};
+
 &cru {
 	bootph-all;
 	status = "okay";
Signature · 1 line
2.40.0
Reviewed-by on v1 2/14
#4 lore raw

Re: [PATCH 02/14] rockchip: rk356x-u-boot: Add xin24m clock node to SPL

Quoted 3 lines · Jonas Karlman

Add bootph-all prop to xin24m clock node, it is referenced by cru node.

Thanks,
- Kever

Quoted 20 lines
---
  arch/arm/dts/rk356x-u-boot.dtsi | 5 +++++
  1 file changed, 5 insertions(+)
arch/arm/dts/rk356x-u-boot.dtsi +5 -0
index 0a764ce5119c..a1c2d03c52f0 100644
@@ -34,6 +34,11 @@
  	};
  };
 
+&xin24m {
+	bootph-all;
+	status = "okay";
+};
+
  &cru {
  	bootph-all;
  	status = "okay";
#5 lore raw

PATCH 3/14 rockchip: rk3566-radxa-cm3-io: Update defconfig

In reply to Jonas Karlman

Update defconfig for rk3566-radxa-cm3-io with new defaults. Also add missing supported mmc modes to sdhci node.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load next stage from a FIT image and then jump to next stage not back to BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash of FIT images. This help indicate if there is an issue loading any of the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set based on cpuid read from OTP.

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS, U-Boot proper will read and configure assigned-clock props.

Add CONFIG_SYS_NS16550_MEM32=y to use 32bit access of serial register.

---
 arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 5 +++++
 configs/radxa-cm3-io-rk3566_defconfig        | 9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +5 -0
index d183e935754d..a8c31fecafd8 100644
@@ -11,6 +11,11 @@
 	};
 };
 
+&sdhci {
+	cap-mmc-highspeed;
+	mmc-ddr-1_8v;
+};
+
 &uart2 {
 	clock-frequency = <24000000>;
 	bootph-all;
configs/radxa-cm3-io-rk3566_defconfig +5 -4
index 1df9cab79d51..dfaacbc8839e 100644
@@ -10,9 +10,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
 CONFIG_DEFAULT_DEVICE_TREE="rk3566-radxa-cm3-io"
 CONFIG_ROCKCHIP_RK3568=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_STACK_R_ADDR=0x600000
 CONFIG_TARGET_EVB_RK3568=y
@@ -23,11 +21,12 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-radxa-cm3-io.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
 CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
@@ -36,6 +35,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -46,7 +46,7 @@ CONFIG_CMD_REGULATOR=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -70,6 +70,7 @@ CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
Signature · 1 line
2.40.0
Reviewed-by on v1 3/14
#6 lore raw

Re: [PATCH 03/14] rockchip: rk3566-radxa-cm3-io: Update defconfig

Quoted 19 lines · Jonas Karlman

Update defconfig for rk3566-radxa-cm3-io with new defaults. Also add missing supported mmc modes to sdhci node.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load next stage from a FIT image and then jump to next stage not back to BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash of FIT images. This help indicate if there is an issue loading any of the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set based on cpuid read from OTP.

Quoted 6 lines

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS, U-Boot proper will read and configure assigned-clock props.

Add CONFIG_SYS_NS16550_MEM32=y to use 32bit access of serial register.

Thanks,
- Kever

Quoted 74 lines
---
  arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 5 +++++
  configs/radxa-cm3-io-rk3566_defconfig        | 9 +++++----
  2 files changed, 10 insertions(+), 4 deletions(-)
arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +5 -0
index d183e935754d..a8c31fecafd8 100644
@@ -11,6 +11,11 @@
  	};
  };
 
+&sdhci {
+	cap-mmc-highspeed;
+	mmc-ddr-1_8v;
+};
+
  &uart2 {
  	clock-frequency = <24000000>;
  	bootph-all;
configs/radxa-cm3-io-rk3566_defconfig +5 -4
index 1df9cab79d51..dfaacbc8839e 100644
@@ -10,9 +10,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
  CONFIG_DEFAULT_DEVICE_TREE="rk3566-radxa-cm3-io"
  CONFIG_ROCKCHIP_RK3568=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_SPL_MMC=y
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_STACK_R_ADDR=0x600000
  CONFIG_TARGET_EVB_RK3568=y
@@ -23,11 +21,12 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
  CONFIG_DEBUG_UART=y
  CONFIG_FIT=y
  CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-radxa-cm3-io.dtb"
  # CONFIG_DISPLAY_CPUINFO is not set
  CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
  CONFIG_SPL_PAD_TO=0x7f8000
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
  CONFIG_SPL_BSS_START_ADDR=0x4000000
@@ -36,6 +35,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
  CONFIG_SPL_STACK_R=y
  CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y
  CONFIG_CMD_I2C=y
  CONFIG_CMD_MMC=y
@@ -46,7 +46,7 @@ CONFIG_CMD_REGULATOR=y
  # CONFIG_SPL_DOS_PARTITION is not set
  CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_LIVE=y
-CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
  CONFIG_SPL_REGMAP=y
  CONFIG_SPL_SYSCON=y
  CONFIG_SPL_CLK=y
@@ -70,6 +70,7 @@ CONFIG_PWM_ROCKCHIP=y
  CONFIG_SPL_RAM=y
  CONFIG_BAUDRATE=1500000
  CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
  CONFIG_SYSRESET=y
  CONFIG_USB=y
  CONFIG_USB_XHCI_HCD=y
#7 lore raw

PATCH 4/14 rockchip: rk3566-radxa-cm3-io: Use pinctrl for sdmmc and sdhci in SPL

In reply to Jonas Karlman

Enable pinctrl for sdmmc and sdhci in SPL to support loading of FIT image from SD and eMMC storage when booting from SPI NOR flash.

---
 arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 56 ++++++++++++++++++++
 configs/radxa-cm3-io-rk3566_defconfig        |  3 +-
 2 files changed, 58 insertions(+), 1 deletion(-)
arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +56 -0
index a8c31fecafd8..d2ee19aaa8d5 100644
@@ -11,6 +11,62 @@
 	};
 };
 
+&pinctrl {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_up {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_none {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_up_drv_level_2 {
+	bootph-pre-ram;
+};
+
+&uart2m0_xfer {
+	bootph-pre-ram;
+};
+
+&sdmmc0_bus4 {
+	bootph-pre-ram;
+};
+
+&sdmmc0_clk {
+	bootph-pre-ram;
+};
+
+&sdmmc0_cmd {
+	bootph-pre-ram;
+};
+
+&sdmmc0_det {
+	bootph-pre-ram;
+};
+
+&sdmmc0_pwren {
+	bootph-pre-ram;
+};
+
+&emmc_bus8 {
+	bootph-pre-ram;
+};
+
+&emmc_clk {
+	bootph-pre-ram;
+};
+
+&emmc_cmd {
+	bootph-pre-ram;
+};
+
+&emmc_datastrobe {
+	bootph-pre-ram;
+};
+
 &sdhci {
 	cap-mmc-highspeed;
 	mmc-ddr-1_8v;
configs/radxa-cm3-io-rk3566_defconfig +2 -1
index dfaacbc8839e..dd1dd36a59b7 100644
@@ -46,7 +46,7 @@ CONFIG_CMD_REGULATOR=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -63,6 +63,7 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_SPL_PINCTRL=y
 CONFIG_DM_PMIC=y
 CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_RK8XX=y
Signature · 1 line
2.40.0
Reviewed-by on v1 4/14
#8 lore raw

Re: [PATCH 04/14] rockchip: rk3566-radxa-cm3-io: Use pinctrl for sdmmc and sdhci in SPL

Quoted 4 lines · Jonas Karlman

Enable pinctrl for sdmmc and sdhci in SPL to support loading of FIT image from SD and eMMC storage when booting from SPI NOR flash.

Thanks,
- Kever

Quoted 93 lines
---
  arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 56 ++++++++++++++++++++
  configs/radxa-cm3-io-rk3566_defconfig        |  3 +-
  2 files changed, 58 insertions(+), 1 deletion(-)
arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +56 -0
index a8c31fecafd8..d2ee19aaa8d5 100644
@@ -11,6 +11,62 @@
  	};
  };
 
+&pinctrl {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_up {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_none {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_up_drv_level_2 {
+	bootph-pre-ram;
+};
+
+&uart2m0_xfer {
+	bootph-pre-ram;
+};
+
+&sdmmc0_bus4 {
+	bootph-pre-ram;
+};
+
+&sdmmc0_clk {
+	bootph-pre-ram;
+};
+
+&sdmmc0_cmd {
+	bootph-pre-ram;
+};
+
+&sdmmc0_det {
+	bootph-pre-ram;
+};
+
+&sdmmc0_pwren {
+	bootph-pre-ram;
+};
+
+&emmc_bus8 {
+	bootph-pre-ram;
+};
+
+&emmc_clk {
+	bootph-pre-ram;
+};
+
+&emmc_cmd {
+	bootph-pre-ram;
+};
+
+&emmc_datastrobe {
+	bootph-pre-ram;
+};
+
  &sdhci {
  	cap-mmc-highspeed;
  	mmc-ddr-1_8v;
configs/radxa-cm3-io-rk3566_defconfig +2 -1
index dfaacbc8839e..dd1dd36a59b7 100644
@@ -46,7 +46,7 @@ CONFIG_CMD_REGULATOR=y
  # CONFIG_SPL_DOS_PARTITION is not set
  CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_LIVE=y
-CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
  CONFIG_SPL_REGMAP=y
  CONFIG_SPL_SYSCON=y
  CONFIG_SPL_CLK=y
@@ -63,6 +63,7 @@ CONFIG_ETH_DESIGNWARE=y
  CONFIG_GMAC_ROCKCHIP=y
  CONFIG_PHY_ROCKCHIP_INNO_USB2=y
  CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_SPL_PINCTRL=y
  CONFIG_DM_PMIC=y
  CONFIG_PMIC_RK8XX=y
  CONFIG_REGULATOR_RK8XX=y
#9 lore raw

PATCH 5/14 rockchip: rk3568-evb: Update defconfig

In reply to Jonas Karlman

Update defconfig for rk3568-evb with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load next stage from a FIT image and then jump to next stage not back to BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash of FIT images. This help indicate if there is an issue loading any of the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config options to include useful gpio, i2c, pmic and regulator cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set based on cpuid read from OTP.

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS, U-Boot proper will read and configure assigned-clock props.

Add config options to enable support for the RK809 PMIC.

---
 configs/evb-rk3568_defconfig | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
configs/evb-rk3568_defconfig +10 -5
index c929bac509c0..0b4fc52e263d 100644
@@ -10,9 +10,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
 CONFIG_DEFAULT_DEVICE_TREE="rk3568-evb"
 CONFIG_ROCKCHIP_RK3568=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_STACK_R_ADDR=0x600000
 CONFIG_TARGET_EVB_RK3568=y
@@ -23,11 +21,12 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
 CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
@@ -36,13 +35,17 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -57,7 +60,9 @@ CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
-CONFIG_REGULATOR_PWM=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
Signature · 1 line
2.40.0
Reviewed-by on v1 5/14
#10 lore raw

Re: [PATCH 05/14] rockchip: rk3568-evb: Update defconfig

Quoted 18 lines · Jonas Karlman

Update defconfig for rk3568-evb with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load next stage from a FIT image and then jump to next stage not back to BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash of FIT images. This help indicate if there is an issue loading any of the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config options to include useful gpio, i2c, pmic and regulator cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set based on cpuid read from OTP.

Quoted 6 lines

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS, U-Boot proper will read and configure assigned-clock props.

Add config options to enable support for the RK809 PMIC.

Thanks,
- Kever

Quoted 62 lines
---
  configs/evb-rk3568_defconfig | 15 ++++++++++-----
  1 file changed, 10 insertions(+), 5 deletions(-)
configs/evb-rk3568_defconfig +10 -5
index c929bac509c0..0b4fc52e263d 100644
@@ -10,9 +10,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
  CONFIG_DEFAULT_DEVICE_TREE="rk3568-evb"
  CONFIG_ROCKCHIP_RK3568=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_SPL_MMC=y
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_STACK_R_ADDR=0x600000
  CONFIG_TARGET_EVB_RK3568=y
@@ -23,11 +21,12 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
  CONFIG_DEBUG_UART=y
  CONFIG_FIT=y
  CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-evb.dtb"
  # CONFIG_DISPLAY_CPUINFO is not set
  CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
  CONFIG_SPL_PAD_TO=0x7f8000
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
  CONFIG_SPL_BSS_START_ADDR=0x4000000
@@ -36,13 +35,17 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
  CONFIG_SPL_STACK_R=y
  CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
  CONFIG_CMD_MMC=y
  # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
  # CONFIG_SPL_DOS_PARTITION is not set
  CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_LIVE=y
-CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
  CONFIG_SPL_REGMAP=y
  CONFIG_SPL_SYSCON=y
  CONFIG_SPL_CLK=y
@@ -57,7 +60,9 @@ CONFIG_MMC_SDHCI_SDMA=y
  CONFIG_MMC_SDHCI_ROCKCHIP=y
  CONFIG_ETH_DESIGNWARE=y
  CONFIG_GMAC_ROCKCHIP=y
-CONFIG_REGULATOR_PWM=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_REGULATOR_RK8XX=y
  CONFIG_PWM_ROCKCHIP=y
  CONFIG_SPL_RAM=y
  CONFIG_BAUDRATE=1500000
#11 lore raw

PATCH 6/14 rockchip: rk3568-rock-3a: Update defconfig

In reply to Jonas Karlman

Update defconfig for rk3568-rock-3a with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load next stage from a FIT image and then jump to next stage not back to BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash of FIT images. This help indicate if there is an issue loading any of the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set based on cpuid read from OTP.

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS, U-Boot proper will read and configure assigned-clock props.

Remove the CONFIG_SPL_PMIC_RK8XX=y option, the pmic is not used in SPL.

---
 configs/rock-3a-rk3568_defconfig | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
configs/rock-3a-rk3568_defconfig +4 -5
index f0db15baa30e..5126feb6b11d 100644
@@ -10,9 +10,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
 CONFIG_DEFAULT_DEVICE_TREE="rk3568-rock-3a"
 CONFIG_ROCKCHIP_RK3568=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_STACK_R_ADDR=0x600000
 CONFIG_TARGET_EVB_RK3568=y
@@ -23,11 +21,12 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-rock-3a.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
 CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
@@ -36,6 +35,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -46,7 +46,7 @@ CONFIG_CMD_REGULATOR=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -65,7 +65,6 @@ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
 CONFIG_DM_PMIC=y
 CONFIG_PMIC_RK8XX=y
-CONFIG_SPL_PMIC_RK8XX=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
Signature · 1 line
2.40.0
Reviewed-by on v1 6/14
#12 lore raw

Re: [PATCH 06/14] rockchip: rk3568-rock-3a: Update defconfig

Quoted 18 lines · Jonas Karlman

Update defconfig for rk3568-rock-3a with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load next stage from a FIT image and then jump to next stage not back to BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash of FIT images. This help indicate if there is an issue loading any of the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set based on cpuid read from OTP.

Quoted 6 lines

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS, U-Boot proper will read and configure assigned-clock props.

Remove the CONFIG_SPL_PMIC_RK8XX=y option, the pmic is not used in SPL.

Thanks,
- Kever

Quoted 57 lines
---
  configs/rock-3a-rk3568_defconfig | 9 ++++-----
  1 file changed, 4 insertions(+), 5 deletions(-)
configs/rock-3a-rk3568_defconfig +4 -5
index f0db15baa30e..5126feb6b11d 100644
@@ -10,9 +10,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
  CONFIG_DEFAULT_DEVICE_TREE="rk3568-rock-3a"
  CONFIG_ROCKCHIP_RK3568=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_SPL_MMC=y
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_STACK_R_ADDR=0x600000
  CONFIG_TARGET_EVB_RK3568=y
@@ -23,11 +21,12 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
  CONFIG_DEBUG_UART=y
  CONFIG_FIT=y
  CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-rock-3a.dtb"
  # CONFIG_DISPLAY_CPUINFO is not set
  CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
  CONFIG_SPL_PAD_TO=0x7f8000
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
  CONFIG_SPL_BSS_START_ADDR=0x4000000
@@ -36,6 +35,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
  CONFIG_SPL_STACK_R=y
  CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y
  CONFIG_CMD_I2C=y
  CONFIG_CMD_MMC=y
@@ -46,7 +46,7 @@ CONFIG_CMD_REGULATOR=y
  # CONFIG_SPL_DOS_PARTITION is not set
  CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_LIVE=y
-CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
  CONFIG_SPL_REGMAP=y
  CONFIG_SPL_SYSCON=y
  CONFIG_SPL_CLK=y
@@ -65,7 +65,6 @@ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
  CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
  CONFIG_DM_PMIC=y
  CONFIG_PMIC_RK8XX=y
-CONFIG_SPL_PMIC_RK8XX=y
  CONFIG_REGULATOR_RK8XX=y
  CONFIG_PWM_ROCKCHIP=y
  CONFIG_SPL_RAM=y
#13 lore raw

PATCH 7/14 rockchip: rk3568-rock-3a: Use pinctrl for sdmmc and sdhci in SPL

In reply to Jonas Karlman

Enable pinctrl for sdmmc and sdhci in SPL to support loading of FIT image from SD and eMMC storage when booting from SPI NOR flash.

---
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi | 52 +++++++++++++++++++++++++
 configs/rock-3a-rk3568_defconfig        |  3 +-
 2 files changed, 54 insertions(+), 1 deletion(-)
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +52 -0
index 801c91af5b41..b2af3b1dbed6 100644
@@ -13,6 +13,58 @@
 	};
 };
 
+&pinctrl {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_up {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_none {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_up_drv_level_2 {
+	bootph-pre-ram;
+};
+
+&uart2m0_xfer {
+	bootph-pre-ram;
+};
+
+&sdmmc0_bus4 {
+	bootph-pre-ram;
+};
+
+&sdmmc0_clk {
+	bootph-pre-ram;
+};
+
+&sdmmc0_cmd {
+	bootph-pre-ram;
+};
+
+&sdmmc0_det {
+	bootph-pre-ram;
+};
+
+&emmc_bus8 {
+	bootph-pre-ram;
+};
+
+&emmc_clk {
+	bootph-pre-ram;
+};
+
+&emmc_cmd {
+	bootph-pre-ram;
+};
+
+&emmc_datastrobe {
+	bootph-pre-ram;
+};
+
 &sdhci {
 	cap-mmc-highspeed;
 	mmc-ddr-1_8v;
configs/rock-3a-rk3568_defconfig +2 -1
index 5126feb6b11d..2e556dc2c1a2 100644
@@ -46,7 +46,7 @@ CONFIG_CMD_REGULATOR=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
-CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -63,6 +63,7 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_SPL_PINCTRL=y
 CONFIG_DM_PMIC=y
 CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_RK8XX=y
Signature · 1 line
2.40.0
Reviewed-by on v1 7/14
#14 lore raw

Re: [PATCH 07/14] rockchip: rk3568-rock-3a: Use pinctrl for sdmmc and sdhci in SPL

Quoted 4 lines · Jonas Karlman

Enable pinctrl for sdmmc and sdhci in SPL to support loading of FIT image from SD and eMMC storage when booting from SPI NOR flash.

Thanks,
- Kever

Quoted 89 lines
---
  arch/arm/dts/rk3568-rock-3a-u-boot.dtsi | 52 +++++++++++++++++++++++++
  configs/rock-3a-rk3568_defconfig        |  3 +-
  2 files changed, 54 insertions(+), 1 deletion(-)
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +52 -0
index 801c91af5b41..b2af3b1dbed6 100644
@@ -13,6 +13,58 @@
  	};
  };
 
+&pinctrl {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_up {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_none {
+	bootph-pre-ram;
+};
+
+&pcfg_pull_up_drv_level_2 {
+	bootph-pre-ram;
+};
+
+&uart2m0_xfer {
+	bootph-pre-ram;
+};
+
+&sdmmc0_bus4 {
+	bootph-pre-ram;
+};
+
+&sdmmc0_clk {
+	bootph-pre-ram;
+};
+
+&sdmmc0_cmd {
+	bootph-pre-ram;
+};
+
+&sdmmc0_det {
+	bootph-pre-ram;
+};
+
+&emmc_bus8 {
+	bootph-pre-ram;
+};
+
+&emmc_clk {
+	bootph-pre-ram;
+};
+
+&emmc_cmd {
+	bootph-pre-ram;
+};
+
+&emmc_datastrobe {
+	bootph-pre-ram;
+};
+
  &sdhci {
  	cap-mmc-highspeed;
  	mmc-ddr-1_8v;
configs/rock-3a-rk3568_defconfig +2 -1
index 5126feb6b11d..2e556dc2c1a2 100644
@@ -46,7 +46,7 @@ CONFIG_CMD_REGULATOR=y
  # CONFIG_SPL_DOS_PARTITION is not set
  CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_LIVE=y
-CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
  CONFIG_SPL_REGMAP=y
  CONFIG_SPL_SYSCON=y
  CONFIG_SPL_CLK=y
@@ -63,6 +63,7 @@ CONFIG_ETH_DESIGNWARE=y
  CONFIG_GMAC_ROCKCHIP=y
  CONFIG_PHY_ROCKCHIP_INNO_USB2=y
  CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_SPL_PINCTRL=y
  CONFIG_DM_PMIC=y
  CONFIG_PMIC_RK8XX=y
  CONFIG_REGULATOR_RK8XX=y
#15 lore raw

PATCH 8/14 rockchip: rk3568-rock-3a: Enable boot from SPI NOR flash

In reply to Jonas Karlman

Add sfc and flash node to device tree and config options to enable support for booting from SPI NOR flash on Radxa ROCK 3 Model A.

Unlike prior generation SoCs the BootRom in RK3568 can read all data and look for idbloader at 0x8000, same as on SD and eMMC.

Use the rksd format and modify the mkimage offset to generate a bootable u-boot-rockchip-spi.bin that can be written to 0x0 of SPI NOR flash. The FIT image is loaded from 0x60000.

=> sf probe
SF: Detected mx25u12835f with page size 256 Bytes, erase size 4 KiB, total 16 MiB

=> load mmc 1:1 10000000 u-boot-rockchip-spi.bin 1384448 bytes read in 119 ms (11.1 MiB/s)

=> sf update $fileaddr 0 $filesize
device 0 offset 0x0, size 0x152000
1179648 bytes written, 204800 bytes skipped in 9.901s, speed 143185 B/s

---
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi | 25 +++++++++++++++++++++++++
 arch/arm/dts/rk356x-u-boot.dtsi         | 11 +++++++++++
 configs/rock-3a-rk3568_defconfig        | 10 ++++++++++
 3 files changed, 46 insertions(+)
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +25 -0
index b2af3b1dbed6..7cd2dc80c317 100644
@@ -7,6 +7,10 @@
 #include "rk356x-u-boot.dtsi"
 
 / {
+	aliases {
+		spi0 = &sfc;
+	};
+
 	chosen {
 		stdout-path = &uart2;
 		u-boot,spl-boot-order = "same-as-spl", &sdmmc0, &sdhci;
@@ -33,6 +37,10 @@
 	bootph-pre-ram;
 };
 
+&fspi_pins {
+	bootph-pre-ram;
+};
+
 &sdmmc0_bus4 {
 	bootph-pre-ram;
 };
@@ -65,6 +73,23 @@
 	bootph-pre-ram;
 };
 
+&sfc {
+	bootph-pre-ram;
+	u-boot,spl-sfc-no-dma;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	flash@0 {
+		bootph-pre-ram;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <24000000>;
+		spi-rx-bus-width = <4>;
+		spi-tx-bus-width = <1>;
+	};
+};
+
 &sdhci {
 	cap-mmc-highspeed;
 	mmc-ddr-1_8v;
arch/arm/dts/rk356x-u-boot.dtsi +11 -0
index a1c2d03c52f0..c340c2bba6ff 100644
@@ -68,3 +68,14 @@
 	bootph-pre-ram;
 	status = "okay";
 };
+
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+&binman {
+	simple-bin-spi {
+		mkimage {
+			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+			offset = <0x8000>;
+		};
+	};
+};
+#endif
configs/rock-3a-rk3568_defconfig +10 -0
index 2e556dc2c1a2..64864a300153 100644
@@ -8,15 +8,20 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
+CONFIG_SF_DEFAULT_SPEED=24000000
+CONFIG_SF_DEFAULT_MODE=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="rk3568-rock-3a"
 CONFIG_ROCKCHIP_RK3568=y
 CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_STACK_R_ADDR=0x600000
 CONFIG_TARGET_EVB_RK3568=y
 CONFIG_SPL_STACK=0x400000
 CONFIG_DEBUG_UART_BASE=0xFE660000
 CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
 CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
@@ -34,6 +39,8 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK_R=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
 CONFIG_SPL_ATF=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
@@ -59,6 +66,8 @@ CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_XTX=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PHY_ROCKCHIP_INNO_USB2=y
@@ -72,6 +81,7 @@ CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
+CONFIG_ROCKCHIP_SFC=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
Signature · 1 line
2.40.0
Reviewed-by on v1 8/14
#16 lore raw

Re: [PATCH 08/14] rockchip: rk3568-rock-3a: Enable boot from SPI NOR flash

Quoted 20 lines · Jonas Karlman

Add sfc and flash node to device tree and config options to enable support for booting from SPI NOR flash on Radxa ROCK 3 Model A.

Unlike prior generation SoCs the BootRom in RK3568 can read all data and look for idbloader at 0x8000, same as on SD and eMMC.

Use the rksd format and modify the mkimage offset to generate a bootable u-boot-rockchip-spi.bin that can be written to 0x0 of SPI NOR flash. The FIT image is loaded from 0x60000.

   => sf probe
   SF: Detected mx25u12835f with page size 256 Bytes, erase size 4 KiB, total 16 MiB

   => load mmc 1:1 10000000 u-boot-rockchip-spi.bin
   1384448 bytes read in 119 ms (11.1 MiB/s)

   => sf update $fileaddr 0 $filesize
   device 0 offset 0x0, size 0x152000
   1179648 bytes written, 204800 bytes skipped in 9.901s, speed 143185 B/s
Quoted 1 line

Thanks,
- Kever

Quoted 126 lines
---
  arch/arm/dts/rk3568-rock-3a-u-boot.dtsi | 25 +++++++++++++++++++++++++
  arch/arm/dts/rk356x-u-boot.dtsi         | 11 +++++++++++
  configs/rock-3a-rk3568_defconfig        | 10 ++++++++++
  3 files changed, 46 insertions(+)
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +25 -0
index b2af3b1dbed6..7cd2dc80c317 100644
@@ -7,6 +7,10 @@
  #include "rk356x-u-boot.dtsi"
 
  / {
+	aliases {
+		spi0 = &sfc;
+	};
+
  	chosen {
  		stdout-path = &uart2;
  		u-boot,spl-boot-order = "same-as-spl", &sdmmc0, &sdhci;
@@ -33,6 +37,10 @@
  	bootph-pre-ram;
  };
 
+&fspi_pins {
+	bootph-pre-ram;
+};
+
  &sdmmc0_bus4 {
  	bootph-pre-ram;
  };
@@ -65,6 +73,23 @@
  	bootph-pre-ram;
  };
 
+&sfc {
+	bootph-pre-ram;
+	u-boot,spl-sfc-no-dma;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	flash@0 {
+		bootph-pre-ram;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <24000000>;
+		spi-rx-bus-width = <4>;
+		spi-tx-bus-width = <1>;
+	};
+};
+
  &sdhci {
  	cap-mmc-highspeed;
  	mmc-ddr-1_8v;
arch/arm/dts/rk356x-u-boot.dtsi +11 -0
index a1c2d03c52f0..c340c2bba6ff 100644
@@ -68,3 +68,14 @@
  	bootph-pre-ram;
  	status = "okay";
  };
+
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+&binman {
+	simple-bin-spi {
+		mkimage {
+			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+			offset = <0x8000>;
+		};
+	};
+};
+#endif
configs/rock-3a-rk3568_defconfig +10 -0
index 2e556dc2c1a2..64864a300153 100644
@@ -8,15 +8,20 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
  CONFIG_NR_DRAM_BANKS=2
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
+CONFIG_SF_DEFAULT_SPEED=24000000
+CONFIG_SF_DEFAULT_MODE=0x2000
  CONFIG_DEFAULT_DEVICE_TREE="rk3568-rock-3a"
  CONFIG_ROCKCHIP_RK3568=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_STACK_R_ADDR=0x600000
  CONFIG_TARGET_EVB_RK3568=y
  CONFIG_SPL_STACK=0x400000
  CONFIG_DEBUG_UART_BASE=0xFE660000
  CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
  CONFIG_SYS_LOAD_ADDR=0xc00800
  CONFIG_DEBUG_UART=y
  CONFIG_FIT=y
@@ -34,6 +39,8 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
  # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
  CONFIG_SPL_STACK_R=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
  CONFIG_SPL_ATF=y
  CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y
@@ -59,6 +66,8 @@ CONFIG_MMC_DW_ROCKCHIP=y
  CONFIG_MMC_SDHCI=y
  CONFIG_MMC_SDHCI_SDMA=y
  CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_XTX=y
  CONFIG_ETH_DESIGNWARE=y
  CONFIG_GMAC_ROCKCHIP=y
  CONFIG_PHY_ROCKCHIP_INNO_USB2=y
@@ -72,6 +81,7 @@ CONFIG_SPL_RAM=y
  CONFIG_BAUDRATE=1500000
  CONFIG_DEBUG_UART_SHIFT=2
  CONFIG_SYS_NS16550_MEM32=y
+CONFIG_ROCKCHIP_SFC=y
  CONFIG_SYSRESET=y
  CONFIG_USB=y
  CONFIG_USB_XHCI_HCD=y
#17 lore raw

PATCH 9/14 rockchip: rk3588: Select DM_RESET and DM_REGULATOR_FIXED in arch Kconfig

In reply to Jonas Karlman

Like other Rockchip SoCs, DM_RESET and DM_REGULATOR_FIXED is useful across RK3588 platform. Select them from arch Kconfig.

---
 arch/arm/mach-rockchip/Kconfig    | 2 ++
 configs/evb-rk3588_defconfig      | 2 --
 configs/neu6a-io-rk3588_defconfig | 1 -
 configs/rock5b-rk3588_defconfig   | 2 --
 4 files changed, 2 insertions(+), 5 deletions(-)
arch/arm/mach-rockchip/Kconfig +2 -0
index 327779a79818..9d6d20bf8ed6 100644
@@ -311,6 +311,8 @@ config ROCKCHIP_RK3588
 	select REGMAP
 	select SYSCON
 	select BOARD_LATE_INIT
+	select DM_REGULATOR_FIXED
+	select DM_RESET
 	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
 	imply ROCKCHIP_COMMON_BOARD
 	imply OF_LIBFDT_OVERLAY
configs/evb-rk3588_defconfig +0 -2
index ddeadb8a760f..8760671a1772 100644
@@ -9,10 +9,8 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
 CONFIG_DEFAULT_DEVICE_TREE="rk3588-evb1-v10"
-CONFIG_DM_RESET=y
 CONFIG_ROCKCHIP_RK3588=y
 CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_STACK_R_ADDR=0x600000
 CONFIG_TARGET_EVB_RK3588=y
configs/neu6a-io-rk3588_defconfig +0 -1
index fb1ce4c1746f..09729a0ea429 100644
@@ -9,7 +9,6 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
 CONFIG_DEFAULT_DEVICE_TREE="rk3588-edgeble-neu6a-io"
-CONFIG_DM_RESET=y
 CONFIG_ROCKCHIP_RK3588=y
 CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
 CONFIG_SPL_SERIAL=y
configs/rock5b-rk3588_defconfig +0 -2
index c57de5a5be02..2e034b724cc9 100644
@@ -9,7 +9,6 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
 CONFIG_DEFAULT_DEVICE_TREE="rk3588-rock-5b"
-CONFIG_DM_RESET=y
 CONFIG_ROCKCHIP_RK3588=y
 CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
@@ -67,7 +66,6 @@ CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PHY_ROCKCHIP_INNO_USB2=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_REGULATOR_PWM=y
-CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
Signature · 1 line
2.40.0
Reviewed-by on v1 9/14
#18 lore raw

Re: [PATCH 09/14] rockchip: rk3588: Select DM_RESET and DM_REGULATOR_FIXED in arch Kconfig

Quoted 4 lines · Jonas Karlman

Like other Rockchip SoCs, DM_RESET and DM_REGULATOR_FIXED is useful across RK3588 platform. Select them from arch Kconfig.

Thanks,
- Kever

Quoted 67 lines
---
  arch/arm/mach-rockchip/Kconfig    | 2 ++
  configs/evb-rk3588_defconfig      | 2 --
  configs/neu6a-io-rk3588_defconfig | 1 -
  configs/rock5b-rk3588_defconfig   | 2 --
  4 files changed, 2 insertions(+), 5 deletions(-)
arch/arm/mach-rockchip/Kconfig +2 -0
index 327779a79818..9d6d20bf8ed6 100644
@@ -311,6 +311,8 @@ config ROCKCHIP_RK3588
  	select REGMAP
  	select SYSCON
  	select BOARD_LATE_INIT
+	select DM_REGULATOR_FIXED
+	select DM_RESET
  	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
  	imply ROCKCHIP_COMMON_BOARD
  	imply OF_LIBFDT_OVERLAY
configs/evb-rk3588_defconfig +0 -2
index ddeadb8a760f..8760671a1772 100644
@@ -9,10 +9,8 @@ CONFIG_NR_DRAM_BANKS=2
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
  CONFIG_DEFAULT_DEVICE_TREE="rk3588-evb1-v10"
-CONFIG_DM_RESET=y
  CONFIG_ROCKCHIP_RK3588=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_SPL_MMC=y
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_STACK_R_ADDR=0x600000
  CONFIG_TARGET_EVB_RK3588=y
configs/neu6a-io-rk3588_defconfig +0 -1
index fb1ce4c1746f..09729a0ea429 100644
@@ -9,7 +9,6 @@ CONFIG_NR_DRAM_BANKS=2
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
  CONFIG_DEFAULT_DEVICE_TREE="rk3588-edgeble-neu6a-io"
-CONFIG_DM_RESET=y
  CONFIG_ROCKCHIP_RK3588=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
  CONFIG_SPL_SERIAL=y
configs/rock5b-rk3588_defconfig +0 -2
index c57de5a5be02..2e034b724cc9 100644
@@ -9,7 +9,6 @@ CONFIG_NR_DRAM_BANKS=2
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
  CONFIG_DEFAULT_DEVICE_TREE="rk3588-rock-5b"
-CONFIG_DM_RESET=y
  CONFIG_ROCKCHIP_RK3588=y
  CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
@@ -67,7 +66,6 @@ CONFIG_GMAC_ROCKCHIP=y
  CONFIG_PHY_ROCKCHIP_INNO_USB2=y
  CONFIG_SPL_PINCTRL=y
  CONFIG_REGULATOR_PWM=y
-CONFIG_DM_REGULATOR_FIXED=y
  CONFIG_PWM_ROCKCHIP=y
  CONFIG_SPL_RAM=y
  CONFIG_BAUDRATE=1500000
#19 lore raw

PATCH 10/14 rockchip: rk3588-evb: Update defconfig

In reply to Jonas Karlman

Update defconfig for rk3588-evb with new defaults.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash of FIT images. This help indicate if there is an issue loading any of the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config options to include useful gpio and regulator cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set based on cpuid read from OTP.

Disable CONFIG_SPL_MMC_SDHCI_SDMA option to use PIO to load TF-A into DRAM and SRAM.

Remove CONFIG_DEBUG_UART_ANNOUNCE=y to remove debug messages.

Add CONFIG_SYS_NS16550_MEM32=y to use 32bit access of serial register.

---
 configs/evb-rk3588_defconfig | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
configs/evb-rk3588_defconfig +6 -3
index 8760671a1772..70e435b1f745 100644
@@ -21,12 +21,13 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-evb1-v10.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
 CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
@@ -35,14 +36,15 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_REGULATOR=y
 # CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -54,6 +56,7 @@ CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
+# CONFIG_SPL_MMC_SDHCI_SDMA is not set
 CONFIG_MMC_SDHCI_ROCKCHIP=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
@@ -62,6 +65,6 @@ CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
-CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SYSRESET=y
 CONFIG_ERRNO_STR=y
Signature · 1 line
2.40.0
Reviewed-by on v1 10/14
#20 lore raw

Re: [PATCH 10/14] rockchip: rk3588-evb: Update defconfig

Quoted 14 lines · Jonas Karlman

Update defconfig for rk3588-evb with new defaults.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash of FIT images. This help indicate if there is an issue loading any of the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config options to include useful gpio and regulator cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set based on cpuid read from OTP.

Quoted 8 lines

Disable CONFIG_SPL_MMC_SDHCI_SDMA option to use PIO to load TF-A into DRAM and SRAM.

Remove CONFIG_DEBUG_UART_ANNOUNCE=y to remove debug messages.

Add CONFIG_SYS_NS16550_MEM32=y to use 32bit access of serial register.

Thanks,
- Kever

Quoted 56 lines
---
  configs/evb-rk3588_defconfig | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
configs/evb-rk3588_defconfig +6 -3
index 8760671a1772..70e435b1f745 100644
@@ -21,12 +21,13 @@ CONFIG_SYS_LOAD_ADDR=0xc00800
  CONFIG_DEBUG_UART=y
  CONFIG_FIT=y
  CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
  CONFIG_SPL_LOAD_FIT=y
  CONFIG_OF_BOARD_SETUP=y
  CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-evb1-v10.dtb"
  # CONFIG_DISPLAY_CPUINFO is not set
  CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
  CONFIG_SPL_PAD_TO=0x7f8000
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
  CONFIG_SPL_BSS_START_ADDR=0x4000000
@@ -35,14 +36,15 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
  CONFIG_SPL_STACK_R=y
  CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y
  CONFIG_CMD_MMC=y
  # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_REGULATOR=y
  # CONFIG_SPL_DOS_PARTITION is not set
  CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_LIVE=y
  CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_NET_RANDOM_ETHADDR=y
  CONFIG_SPL_REGMAP=y
  CONFIG_SPL_SYSCON=y
  CONFIG_SPL_CLK=y
@@ -54,6 +56,7 @@ CONFIG_MMC_DW=y
  CONFIG_MMC_DW_ROCKCHIP=y
  CONFIG_MMC_SDHCI=y
  CONFIG_MMC_SDHCI_SDMA=y
+# CONFIG_SPL_MMC_SDHCI_SDMA is not set
  CONFIG_MMC_SDHCI_ROCKCHIP=y
  CONFIG_ETH_DESIGNWARE=y
  CONFIG_GMAC_ROCKCHIP=y
@@ -62,6 +65,6 @@ CONFIG_PWM_ROCKCHIP=y
  CONFIG_SPL_RAM=y
  CONFIG_BAUDRATE=1500000
  CONFIG_DEBUG_UART_SHIFT=2
-CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_SYS_NS16550_MEM32=y
  CONFIG_SYSRESET=y
  CONFIG_ERRNO_STR=y
#21 lore raw

PATCH 11/14 rockchip: rk3588-rock-5b: Update defconfig

In reply to Jonas Karlman

Update defconfig for rk3588-rock-5b with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load next stage from a FIT image and then jump to next stage not back to BootRom.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set based on cpuid read from OTP.

Add CONFIG_SYS_NS16550_MEM32=y to use 32bit access of serial register.

---
 configs/rock5b-rk3588_defconfig | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
configs/rock5b-rk3588_defconfig +3 -4
index 2e034b724cc9..2f0a74ee5559 100644
@@ -10,9 +10,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
 CONFIG_DEFAULT_DEVICE_TREE="rk3588-rock-5b"
 CONFIG_ROCKCHIP_RK3588=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_STACK_R_ADDR=0x600000
 CONFIG_TARGET_ROCK5B_RK3588=y
@@ -29,7 +27,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-rock-5b.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
 CONFIG_SPL_PAD_TO=0x7f8000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x4000000
@@ -38,6 +36,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -47,7 +46,6 @@ CONFIG_CMD_REGULATOR=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIVE=y
 CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_CLK=y
@@ -70,6 +68,7 @@ CONFIG_PWM_ROCKCHIP=y
 CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
Signature · 1 line
2.40.0
Reviewed-by on v1 11/14
#22 lore raw

Re: [PATCH 11/14] rockchip: rk3588-rock-5b: Update defconfig

Quoted 9 lines · Jonas Karlman

Update defconfig for rk3588-rock-5b with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load next stage from a FIT image and then jump to next stage not back to BootRom.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded to 0x40000, use the space in between as SPL_MAX_SIZE.

Quoted 8 lines

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set based on cpuid read from OTP.

Add CONFIG_SYS_NS16550_MEM32=y to use 32bit access of serial register.

Thanks,
- Kever

Quoted 51 lines
---
  configs/rock5b-rk3588_defconfig | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
configs/rock5b-rk3588_defconfig +3 -4
index 2e034b724cc9..2f0a74ee5559 100644
@@ -10,9 +10,7 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
  CONFIG_DEFAULT_DEVICE_TREE="rk3588-rock-5b"
  CONFIG_ROCKCHIP_RK3588=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_SPL_MMC=y
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_STACK_R_ADDR=0x600000
  CONFIG_TARGET_ROCK5B_RK3588=y
@@ -29,7 +27,7 @@ CONFIG_OF_BOARD_SETUP=y
  CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-rock-5b.dtb"
  # CONFIG_DISPLAY_CPUINFO is not set
  CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_MAX_SIZE=0x40000
  CONFIG_SPL_PAD_TO=0x7f8000
  CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
  CONFIG_SPL_BSS_START_ADDR=0x4000000
@@ -38,6 +36,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
  CONFIG_SPL_STACK_R=y
  CONFIG_SPL_ATF=y
+CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y
  CONFIG_CMD_MMC=y
  CONFIG_CMD_USB=y
@@ -47,7 +46,6 @@ CONFIG_CMD_REGULATOR=y
  CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_LIVE=y
  CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_NET_RANDOM_ETHADDR=y
  CONFIG_SPL_REGMAP=y
  CONFIG_SPL_SYSCON=y
  CONFIG_SPL_CLK=y
@@ -70,6 +68,7 @@ CONFIG_PWM_ROCKCHIP=y
  CONFIG_SPL_RAM=y
  CONFIG_BAUDRATE=1500000
  CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
  CONFIG_SYSRESET=y
  CONFIG_USB=y
  CONFIG_USB_EHCI_HCD=y
#23 lore raw

PATCH 12/14 rockchip: rk3588-rock-5b: Add bootph prop to pinctrl for uart2 and sdhci

In reply to Jonas Karlman

Enable pinctrl for sdhci in SPL to support loading of FIT image from SD and eMMC storage when booting from SPI NOR flash.

---
 arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 28 +++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +28 -0
index 715328d204c2..4bbc19058c90 100644
@@ -61,6 +61,14 @@
 	bootph-all;
 };
 
+&pcfg_pull_none {
+	bootph-all;
+};
+
+&uart2m0_xfer {
+	bootph-all;
+};
+
 &sdmmc_bus4 {
 	bootph-all;
 };
@@ -77,6 +85,26 @@
 	bootph-all;
 };
 
+&emmc_bus8 {
+	bootph-all;
+};
+
+&emmc_clk {
+	bootph-all;
+};
+
+&emmc_cmd {
+	bootph-all;
+};
+
+&emmc_data_strobe {
+	bootph-all;
+};
+
+&emmc_rstnout {
+	bootph-all;
+};
+
 &usb_host0_ehci {
 	companion = <&usb_host0_ohci>;
 	phys = <&u2phy2_host>;
Signature · 1 line
2.40.0
Reviewed-by on v1 12/14
#24 lore raw

Re: [PATCH 12/14] rockchip: rk3588-rock-5b: Add bootph prop to pinctrl for uart2 and sdhci

Quoted 4 lines · Jonas Karlman

Enable pinctrl for sdhci in SPL to support loading of FIT image from SD and eMMC storage when booting from SPI NOR flash.

Thanks,
- Kever

Quoted 50 lines
---
  arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 28 +++++++++++++++++++++++++
  1 file changed, 28 insertions(+)
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +28 -0
index 715328d204c2..4bbc19058c90 100644
@@ -61,6 +61,14 @@
  	bootph-all;
  };
 
+&pcfg_pull_none {
+	bootph-all;
+};
+
+&uart2m0_xfer {
+	bootph-all;
+};
+
  &sdmmc_bus4 {
  	bootph-all;
  };
@@ -77,6 +85,26 @@
  	bootph-all;
  };
 
+&emmc_bus8 {
+	bootph-all;
+};
+
+&emmc_clk {
+	bootph-all;
+};
+
+&emmc_cmd {
+	bootph-all;
+};
+
+&emmc_data_strobe {
+	bootph-all;
+};
+
+&emmc_rstnout {
+	bootph-all;
+};
+
  &usb_host0_ehci {
  	companion = <&usb_host0_ohci>;
  	phys = <&u2phy2_host>;
#25 lore raw

PATCH 13/14 rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash

In reply to Jonas Karlman

Add sfc and flash node to device tree and config options to enable support for booting from SPI NOR flash on Radxa ROCK 5 Model B.

---
 arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 24 ++++++++++++++++++++++++
 arch/arm/dts/rk3588s-u-boot.dtsi        | 20 ++++++++++++++++++++
 arch/arm/mach-rockchip/rk3588/rk3588.c  |  1 +
 configs/rock5b-rk3588_defconfig         | 10 ++++++++++
 4 files changed, 55 insertions(+)
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +24 -0
index 4bbc19058c90..b63dd40deb6d 100644
@@ -11,6 +11,7 @@
 / {
 	aliases {
 		mmc1 = &sdmmc;
+		spi0 = &sfc;
 	};
 
 	chosen {
@@ -43,6 +44,25 @@
 	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_data_strobe &emmc_rstnout>;
 };
 
+&sfc {
+	bootph-pre-ram;
+	u-boot,spl-sfc-no-dma;
+	pinctrl-names = "default";
+	pinctrl-0 = <&fspim2_pins>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	flash@0 {
+		bootph-pre-ram;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <24000000>;
+		spi-rx-bus-width = <4>;
+		spi-tx-bus-width = <1>;
+	};
+};
+
 &pinctrl {
 	bootph-all;
 
@@ -69,6 +89,10 @@
 	bootph-all;
 };
 
+&fspim2_pins {
+	bootph-all;
+};
+
 &sdmmc_bus4 {
 	bootph-all;
 };
arch/arm/dts/rk3588s-u-boot.dtsi +20 -0
index cd7e6cb50ee2..d8a471a37fd1 100644
@@ -104,6 +104,15 @@
 		};
 	};
 
+	sfc: spi@fe2b0000 {
+		compatible = "rockchip,sfc";
+		reg = <0x0 0xfe2b0000 0x0 0x4000>;
+		interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>;
+		clock-names = "clk_sfc", "hclk_sfc";
+		status = "disabled";
+	};
+
 	otp: nvmem@fecc0000 {
 		compatible = "rockchip,rk3588-otp";
 		reg = <0x0 0xfecc0000 0x0 0x400>;
@@ -164,3 +173,14 @@
 &ioc {
 	bootph-pre-ram;
 };
+
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+&binman {
+	simple-bin-spi {
+		mkimage {
+			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+			offset = <0x8000>;
+		};
+	};
+};
+#endif
arch/arm/mach-rockchip/rk3588/rk3588.c +1 -0
index 18e67b5ca9b2..0e85893e0096 100644
@@ -41,6 +41,7 @@ const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
 	[BROM_BOOTSOURCE_EMMC] = "/mmc@fe2e0000",
 	[BROM_BOOTSOURCE_SPINOR] = "/spi@fe2b0000/flash@0",
 	[BROM_BOOTSOURCE_SD] = "/mmc@fe2c0000",
+	[6] = "/spi@fe2b0000/flash@0",
 };
 
 static struct mm_region rk3588_mem_map[] = {
configs/rock5b-rk3588_defconfig +10 -0
index 2f0a74ee5559..e6a903853fb7 100644
@@ -8,15 +8,20 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
+CONFIG_SF_DEFAULT_SPEED=24000000
+CONFIG_SF_DEFAULT_MODE=0x2000
 CONFIG_DEFAULT_DEVICE_TREE="rk3588-rock-5b"
 CONFIG_ROCKCHIP_RK3588=y
 CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_STACK_R_ADDR=0x600000
 CONFIG_TARGET_ROCK5B_RK3588=y
 CONFIG_SPL_STACK=0x400000
 CONFIG_DEBUG_UART_BASE=0xFEB50000
 CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
 CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
@@ -35,6 +40,8 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_STACK_R=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
 CONFIG_SPL_ATF=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
@@ -59,6 +66,8 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 # CONFIG_SPL_MMC_SDHCI_SDMA is not set
 CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_XTX=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
 CONFIG_PHY_ROCKCHIP_INNO_USB2=y
@@ -69,6 +78,7 @@ CONFIG_SPL_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550_MEM32=y
+CONFIG_ROCKCHIP_SFC=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
Signature · 1 line
2.40.0
Reviewed-by on v1 13/14
#26 lore raw

Re: [PATCH 13/14] rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash

Quoted 4 lines · Jonas Karlman

Add sfc and flash node to device tree and config options to enable support for booting from SPI NOR flash on Radxa ROCK 5 Model B.

Thanks,
- Kever

Quoted 154 lines
---
  arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 24 ++++++++++++++++++++++++
  arch/arm/dts/rk3588s-u-boot.dtsi        | 20 ++++++++++++++++++++
  arch/arm/mach-rockchip/rk3588/rk3588.c  |  1 +
  configs/rock5b-rk3588_defconfig         | 10 ++++++++++
  4 files changed, 55 insertions(+)
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +24 -0
index 4bbc19058c90..b63dd40deb6d 100644
@@ -11,6 +11,7 @@
  / {
  	aliases {
  		mmc1 = &sdmmc;
+		spi0 = &sfc;
  	};
 
  	chosen {
@@ -43,6 +44,25 @@
  	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_data_strobe &emmc_rstnout>;
  };
 
+&sfc {
+	bootph-pre-ram;
+	u-boot,spl-sfc-no-dma;
+	pinctrl-names = "default";
+	pinctrl-0 = <&fspim2_pins>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	flash@0 {
+		bootph-pre-ram;
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <24000000>;
+		spi-rx-bus-width = <4>;
+		spi-tx-bus-width = <1>;
+	};
+};
+
  &pinctrl {
  	bootph-all;
 
@@ -69,6 +89,10 @@
  	bootph-all;
  };
 
+&fspim2_pins {
+	bootph-all;
+};
+
  &sdmmc_bus4 {
  	bootph-all;
  };
arch/arm/dts/rk3588s-u-boot.dtsi +20 -0
index cd7e6cb50ee2..d8a471a37fd1 100644
@@ -104,6 +104,15 @@
  		};
  	};
 
+	sfc: spi@fe2b0000 {
+		compatible = "rockchip,sfc";
+		reg = <0x0 0xfe2b0000 0x0 0x4000>;
+		interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH 0>;
+		clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>;
+		clock-names = "clk_sfc", "hclk_sfc";
+		status = "disabled";
+	};
+
  	otp: nvmem@fecc0000 {
  		compatible = "rockchip,rk3588-otp";
  		reg = <0x0 0xfecc0000 0x0 0x400>;
@@ -164,3 +173,14 @@
  &ioc {
  	bootph-pre-ram;
  };
+
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+&binman {
+	simple-bin-spi {
+		mkimage {
+			args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+			offset = <0x8000>;
+		};
+	};
+};
+#endif
arch/arm/mach-rockchip/rk3588/rk3588.c +1 -0
index 18e67b5ca9b2..0e85893e0096 100644
@@ -41,6 +41,7 @@ const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
  	[BROM_BOOTSOURCE_EMMC] = "/mmc@fe2e0000",
  	[BROM_BOOTSOURCE_SPINOR] = "/spi@fe2b0000/flash@0",
  	[BROM_BOOTSOURCE_SD] = "/mmc@fe2c0000",
+	[6] = "/spi@fe2b0000/flash@0",
  };
 
  static struct mm_region rk3588_mem_map[] = {
configs/rock5b-rk3588_defconfig +10 -0
index 2f0a74ee5559..e6a903853fb7 100644
@@ -8,15 +8,20 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
  CONFIG_NR_DRAM_BANKS=2
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
+CONFIG_SF_DEFAULT_SPEED=24000000
+CONFIG_SF_DEFAULT_MODE=0x2000
  CONFIG_DEFAULT_DEVICE_TREE="rk3588-rock-5b"
  CONFIG_ROCKCHIP_RK3588=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_STACK_R_ADDR=0x600000
  CONFIG_TARGET_ROCK5B_RK3588=y
  CONFIG_SPL_STACK=0x400000
  CONFIG_DEBUG_UART_BASE=0xFEB50000
  CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
  CONFIG_SYS_LOAD_ADDR=0xc00800
  CONFIG_DEBUG_UART=y
  CONFIG_FIT=y
@@ -35,6 +40,8 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
  # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
  # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
  CONFIG_SPL_STACK_R=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000
  CONFIG_SPL_ATF=y
  CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y
@@ -59,6 +66,8 @@ CONFIG_MMC_SDHCI=y
  CONFIG_MMC_SDHCI_SDMA=y
  # CONFIG_SPL_MMC_SDHCI_SDMA is not set
  CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_XTX=y
  CONFIG_ETH_DESIGNWARE=y
  CONFIG_GMAC_ROCKCHIP=y
  CONFIG_PHY_ROCKCHIP_INNO_USB2=y
@@ -69,6 +78,7 @@ CONFIG_SPL_RAM=y
  CONFIG_BAUDRATE=1500000
  CONFIG_DEBUG_UART_SHIFT=2
  CONFIG_SYS_NS16550_MEM32=y
+CONFIG_ROCKCHIP_SFC=y
  CONFIG_SYSRESET=y
  CONFIG_USB=y
  CONFIG_USB_EHCI_HCD=y
#27 lore raw

Re: [PATCH 13/14] rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash

Hi Jonas,

Quoted 17 lines · Kever Yang
Quoted 4 lines · Jonas Karlman

Add sfc and flash node to device tree and config options to enable support for booting from SPI NOR flash on Radxa ROCK 5 Model B.

Thanks,
- Kever

Quoted 7 lines

---
  arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 24 ++++++++++++++++++++++++ arch/arm/dts/rk3588s-u-boot.dtsi        | 20 ++++++++++++++++++++ arch/arm/mach-rockchip/rk3588/rk3588.c  |  1 + configs/rock5b-rk3588_defconfig         | 10 ++++++++++

  4 files changed, 55 insertions(+)
Quoted 16 lines
Quoted 12 lines
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +1 -0
index 4bbc19058c90..b63dd40deb6d 100644
@@ -11,6 +11,7 @@
   / {
       aliases {
           mmc1 = &sdmmc;
+        spi0 = &sfc;
       };
       chosen {

arch/arm/dts/rk3588-rock-5b-u-boot.dtsi line 47

Quoted 4 lines
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +2 -0
@@ -43,6 +44,25 @@
       pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_data_strobe &emmc_rstnout>;
   };
+&sfc {
+    bootph-pre-ram;

Any reason why the sfc and flash are pre-ram and the pins bootph-all ?

Quoted 51 lines
Quoted 51 lines
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +21 -0
+    u-boot,spl-sfc-no-dma;
+    pinctrl-names = "default";
+    pinctrl-0 = <&fspim2_pins>;
+    #address-cells = <1>;
+    #size-cells = <0>;
+    status = "okay";
+
+    flash@0 {
+        bootph-pre-ram;
+        compatible = "jedec,spi-nor";
+        reg = <0>;
+        spi-max-frequency = <24000000>;
+        spi-rx-bus-width = <4>;
+        spi-tx-bus-width = <1>;
+    };
+};
+
   &pinctrl {
       bootph-all;
@@ -69,6 +89,10 @@
       bootph-all;
   };
+&fspim2_pins {
+    bootph-all;
+};
+
   &sdmmc_bus4 {
       bootph-all;
   };
arch/arm/dts/rk3588s-u-boot.dtsi +9 -0
index cd7e6cb50ee2..d8a471a37fd1 100644
@@ -104,6 +104,15 @@
           };
       };
+    sfc: spi@fe2b0000 {
+        compatible = "rockchip,sfc";
+        reg = <0x0 0xfe2b0000 0x0 0x4000>;
+        interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH 0>;
+        clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>;
+        clock-names = "clk_sfc", "hclk_sfc";
+        status = "disabled";
+    };
+
       otp: nvmem@fecc0000 {
           compatible = "rockchip,rk3588-otp";
           reg = <0x0 0xfecc0000 0x0 0x400>;
@@ -164,3 +173,14 @@
   &ioc {
       bootph-pre-ram;
Quoted 8 lines

arch/arm/dts/rk3588s-u-boot.dtsi line 182

Quoted 8 lines
arch/arm/dts/rk3588s-u-boot.dtsi +7 -0
   };
+
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+&binman {
+    simple-bin-spi {
+        mkimage {
+            args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+            offset = <0x8000>;

What is this offset referring to ?

Quoted 6 lines
Quoted 6 lines
arch/arm/dts/rk3588s-u-boot.dtsi +4 -0
+        };
+    };
+};
+#endif
arch/arm/mach-rockchip/rk3588/rk3588.c +0 -0
index 18e67b5ca9b2..0e85893e0096 100644
Quoted 8 lines

arch/arm/mach-rockchip/rk3588/rk3588.c const char * const boot_devices[BROM_LAST_BOOTSOURCE · line 45

Quoted 8 lines
arch/arm/mach-rockchip/rk3588/rk3588.c +2 -0
@@ -41,6 +41,7 @@ const char * const boot_devices[BROM_LAST_BOOTSOURCE 
+ 1] = {
       [BROM_BOOTSOURCE_EMMC] = "/mmc@fe2e0000",
       [BROM_BOOTSOURCE_SPINOR] = "/spi@fe2b0000/flash@0",
       [BROM_BOOTSOURCE_SD] = "/mmc@fe2c0000",
+    [6] = "/spi@fe2b0000/flash@0",

Is this '6' meaning something in particular ? or just the next number in line ?

Quoted 4 lines
Quoted 4 lines
arch/arm/mach-rockchip/rk3588/rk3588.c +0 -0
   };
   static struct mm_region rk3588_mem_map[] = {
configs/rock5b-rk3588_defconfig +0 -0
index 2f0a74ee5559..e6a903853fb7 100644
Quoted 8 lines

configs/rock5b-rk3588_defconfig CONFIG_SPL_LIBGENERIC_SUPPORT=y · line 12

Quoted 8 lines
configs/rock5b-rk3588_defconfig +0 -0
@@ -8,15 +8,20 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y

  CONFIG_NR_DRAM_BANKS=2
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000

configs/rock5b-rk3588_defconfig +2 -0
+CONFIG_SF_DEFAULT_SPEED=24000000
+CONFIG_SF_DEFAULT_MODE=0x2000

Any reason for changing the default mode ?

Quoted 13 lines
Quoted 13 lines

  CONFIG_DEFAULT_DEVICE_TREE="rk3588-rock-5b"
  CONFIG_ROCKCHIP_RK3588=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_STACK_R_ADDR=0x600000
  CONFIG_TARGET_ROCK5B_RK3588=y
  CONFIG_SPL_STACK=0x400000
  CONFIG_DEBUG_UART_BASE=0xFEB50000
  CONFIG_DEBUG_UART_CLOCK=24000000

configs/rock5b-rk3588_defconfig +2 -0
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y

  CONFIG_SYS_LOAD_ADDR=0xc00800

Quoted 8 lines

configs/rock5b-rk3588_defconfig CONFIG_SPL_BSS_MAX_SIZE=0x4000 · line 44

Quoted 8 lines

  CONFIG_DEBUG_UART=y
  CONFIG_FIT=y

configs/rock5b-rk3588_defconfig +0 -0
@@ -35,6 +40,8 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
   # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
   # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set

  CONFIG_SPL_STACK_R=y

configs/rock5b-rk3588_defconfig +2 -0
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000

I have a feeling the default is 0x80000, do you have any reason for the change to 0x60000 ?

Quoted 20 lines
Quoted 20 lines

  CONFIG_SPL_ATF=y
  CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y

configs/rock5b-rk3588_defconfig +0 -0
@@ -59,6 +66,8 @@ CONFIG_MMC_SDHCI=y

  CONFIG_MMC_SDHCI_SDMA=y
  # CONFIG_SPL_MMC_SDHCI_SDMA is not set
  CONFIG_MMC_SDHCI_ROCKCHIP=y

configs/rock5b-rk3588_defconfig +2 -0
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_XTX=y

  CONFIG_ETH_DESIGNWARE=y
  CONFIG_GMAC_ROCKCHIP=y
  CONFIG_PHY_ROCKCHIP_INNO_USB2=y

configs/rock5b-rk3588_defconfig +0 -0
@@ -69,6 +78,7 @@ CONFIG_SPL_RAM=y

  CONFIG_BAUDRATE=1500000
  CONFIG_DEBUG_UART_SHIFT=2
  CONFIG_SYS_NS16550_MEM32=y
+CONFIG_ROCKCHIP_SFC=y
  CONFIG_SYSRESET=y
  CONFIG_USB=y
  CONFIG_USB_EHCI_HCD=y

#28 lore raw

Re: [PATCH 13/14] rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash

Hi Eugen,

Quoted 32 lines · Eugen Hristev

Hi Jonas,

Quoted 29 lines · Kever Yang
Quoted 4 lines · Jonas Karlman

Add sfc and flash node to device tree and config options to enable support for booting from SPI NOR flash on Radxa ROCK 5 Model B.

Thanks,
- Kever

Quoted 19 lines

---
  arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 24 ++++++++++++++++++++++++ arch/arm/dts/rk3588s-u-boot.dtsi        | 20 ++++++++++++++++++++ arch/arm/mach-rockchip/rk3588/rk3588.c  |  1 + configs/rock5b-rk3588_defconfig         | 10 ++++++++++

  4 files changed, 55 insertions(+)
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +1 -0
index 4bbc19058c90..b63dd40deb6d 100644
@@ -11,6 +11,7 @@
   / {
       aliases {
           mmc1 = &sdmmc;
+        spi0 = &sfc;
       };
       chosen {
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +0 -0
@@ -43,6 +44,25 @@

      pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_data_strobe &emmc_rstnout>;
  };
+&sfc {
+    bootph-pre-ram;

Any reason why the sfc and flash are pre-ram and the pins bootph-all ?

This used to be u-boot,dm-spl and was later replaced with bootph-pre-ram.

For fspim2_pins I used the same bootph as the other pins. Not sure why the pins use bootph-all to begin with, sdmmc and sdhci use bootph-pre-ram in rk3588s-u-boot.dtsi.

Quoted 55 lines
Quoted 55 lines
Quoted 55 lines

+    u-boot,spl-sfc-no-dma;
+    pinctrl-names = "default";
+    pinctrl-0 = <&fspim2_pins>;
+    #address-cells = <1>;
+    #size-cells = <0>;
+    status = "okay";

arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +11 -0
+
+    flash@0 {
+        bootph-pre-ram;
+        compatible = "jedec,spi-nor";
+        reg = <0>;
+        spi-max-frequency = <24000000>;
+        spi-rx-bus-width = <4>;
+        spi-tx-bus-width = <1>;
+    };
+};
+

  &pinctrl {
      bootph-all;

arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +4 -0
@@ -69,6 +89,10 @@
       bootph-all;
   };
+&fspim2_pins {
+    bootph-all;
+};
+
   &sdmmc_bus4 {
       bootph-all;
   };
arch/arm/dts/rk3588s-u-boot.dtsi +10 -0
index cd7e6cb50ee2..d8a471a37fd1 100644
@@ -104,6 +104,15 @@
           };
       };
+    sfc: spi@fe2b0000 {
+        compatible = "rockchip,sfc";
+        reg = <0x0 0xfe2b0000 0x0 0x4000>;
+        interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH 0>;
+        clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>;
+        clock-names = "clk_sfc", "hclk_sfc";
+        status = "disabled";
+    };
+
       otp: nvmem@fecc0000 {
           compatible = "rockchip,rk3588-otp";
           reg = <0x0 0xfecc0000 0x0 0x400>;
@@ -164,3 +173,14 @@
   &ioc {
       bootph-pre-ram;
   };
+
Quoted 8 lines
Quoted 6 lines

arch/arm/dts/rk3588s-u-boot.dtsi line 182

Quoted 6 lines
arch/arm/dts/rk3588s-u-boot.dtsi +6 -0
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+&binman {
+    simple-bin-spi {
+        mkimage {
+            args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+            offset = <0x8000>;

What is this offset referring to ?

This offset is referring to the normal mmc 32 KiB offset that idbloader is normally written to. I used the offset prop so that the u-boot-rockchip-spi.bin can be written to offset 0 of spi similar as is currently done for rk3399.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
arch/arm/dts/rk3588s-u-boot.dtsi +4 -0
+        };
+    };
+};
+#endif
arch/arm/mach-rockchip/rk3588/rk3588.c +0 -0
index 18e67b5ca9b2..0e85893e0096 100644
@@ -41,6 +41,7 @@ const char * const boot_devices[BROM_LAST_BOOTSOURCE 
Quoted 8 lines
Quoted 5 lines

arch/arm/mach-rockchip/rk3588/rk3588.c const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { · line 44

Quoted 5 lines
arch/arm/mach-rockchip/rk3588/rk3588.c +2 -0
+ 1] = {
       [BROM_BOOTSOURCE_EMMC] = "/mmc@fe2e0000",
       [BROM_BOOTSOURCE_SPINOR] = "/spi@fe2b0000/flash@0",
       [BROM_BOOTSOURCE_SD] = "/mmc@fe2c0000",
+    [6] = "/spi@fe2b0000/flash@0",

Is this '6' meaning something in particular ? or just the next number in line ?

The bootrom on rk3588 use value 6 when booting from the spi flash on my ROCK 5B, normally bootrom have used value 3 (BROM_BOOTSOURCE_SPINOR) on rk356x and earlier socs.

I have no idea what we should call this BOOTSOURCE, could not find any define in vendor u-boot to help give this a proper name.

Kever: Any insights into what this value should be called?

Quoted 16 lines
Quoted 14 lines
Quoted 12 lines
arch/arm/mach-rockchip/rk3588/rk3588.c +0 -0
   };
   static struct mm_region rk3588_mem_map[] = {
configs/rock5b-rk3588_defconfig +0 -0
index 2f0a74ee5559..e6a903853fb7 100644
@@ -8,15 +8,20 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y

  CONFIG_NR_DRAM_BANKS=2
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000

configs/rock5b-rk3588_defconfig CONFIG_SPL_LIBGENERIC_SUPPORT=y · line 12

Quoted 2 lines
configs/rock5b-rk3588_defconfig +2 -0
+CONFIG_SF_DEFAULT_SPEED=24000000
+CONFIG_SF_DEFAULT_MODE=0x2000

Any reason for changing the default mode ?

Default speed and mode is changed to match the speed and mode used in the device tree. SPL use these Kconfig instead of reading the speed and mode from fdt blob.

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

  CONFIG_DEFAULT_DEVICE_TREE="rk3588-rock-5b"
  CONFIG_ROCKCHIP_RK3588=y
  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
  CONFIG_SPL_SERIAL=y
  CONFIG_SPL_STACK_R_ADDR=0x600000
  CONFIG_TARGET_ROCK5B_RK3588=y
  CONFIG_SPL_STACK=0x400000
  CONFIG_DEBUG_UART_BASE=0xFEB50000
  CONFIG_DEBUG_UART_CLOCK=24000000

configs/rock5b-rk3588_defconfig +2 -0
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y

  CONFIG_SYS_LOAD_ADDR=0xc00800
  CONFIG_DEBUG_UART=y
  CONFIG_FIT=y

configs/rock5b-rk3588_defconfig +0 -0
@@ -35,6 +40,8 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
Quoted 8 lines
Quoted 5 lines

configs/rock5b-rk3588_defconfig CONFIG_SPL_BSS_MAX_SIZE=0x4000 · line 44

Quoted 5 lines
configs/rock5b-rk3588_defconfig +0 -0
   # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
   # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set

  CONFIG_SPL_STACK_R=y

configs/rock5b-rk3588_defconfig +2 -0
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000

I have a feeling the default is 0x80000, do you have any reason for the change to 0x60000 ?

The default is probably set for rk3399 that requires double space for idbloader because bootrom only read first 2 KiB of every 4 KiB page. To not waste usable space I used the same offset that was used by multiple rk3399 configs:

u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */

SPI flash layout would look something like:

idbloader: @ 32 KiB
- TPL: current ddr init blob use around 54 KiB
- SPL: max 256 KiB
FIT payload: @ 384 KiB

Should mean we have at least 96 KiB for TPL.

Regards,
Jonas

Quoted 22 lines
Quoted 21 lines
Quoted 21 lines

  CONFIG_SPL_ATF=y
  CONFIG_CMD_GPIO=y
  CONFIG_CMD_GPT=y

configs/rock5b-rk3588_defconfig +0 -0
@@ -59,6 +66,8 @@ CONFIG_MMC_SDHCI=y

  CONFIG_MMC_SDHCI_SDMA=y
  # CONFIG_SPL_MMC_SDHCI_SDMA is not set
  CONFIG_MMC_SDHCI_ROCKCHIP=y

configs/rock5b-rk3588_defconfig +2 -0
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_XTX=y

  CONFIG_ETH_DESIGNWARE=y
  CONFIG_GMAC_ROCKCHIP=y
  CONFIG_PHY_ROCKCHIP_INNO_USB2=y

configs/rock5b-rk3588_defconfig +0 -0
@@ -69,6 +78,7 @@ CONFIG_SPL_RAM=y

  CONFIG_BAUDRATE=1500000
  CONFIG_DEBUG_UART_SHIFT=2
  CONFIG_SYS_NS16550_MEM32=y
+CONFIG_ROCKCHIP_SFC=y
  CONFIG_SYSRESET=y
  CONFIG_USB=y
  CONFIG_USB_EHCI_HCD=y

#29 lore raw

Re: [PATCH 13/14] rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash

Quoted 44 lines · Jonas Karlman

Hi Eugen,

Quoted 32 lines · Eugen Hristev

Hi Jonas,

Quoted 29 lines · Kever Yang
Quoted 4 lines · Jonas Karlman

Add sfc and flash node to device tree and config options to enable support for booting from SPI NOR flash on Radxa ROCK 5 Model B.

Thanks,
- Kever

Quoted 19 lines
---
   arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 24 ++++++++++++++++++++++++
   arch/arm/dts/rk3588s-u-boot.dtsi        | 20 ++++++++++++++++++++
   arch/arm/mach-rockchip/rk3588/rk3588.c  |  1 +
   configs/rock5b-rk3588_defconfig         | 10 ++++++++++
   4 files changed, 55 insertions(+)
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +1 -0
index 4bbc19058c90..b63dd40deb6d 100644
@@ -11,6 +11,7 @@
   / {
       aliases {
           mmc1 = &sdmmc;
+        spi0 = &sfc;
       };
       chosen {
Quoted 8 lines
Quoted 6 lines

arch/arm/dts/rk3588-rock-5b-u-boot.dtsi line 48

Quoted 6 lines
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +2 -0
@@ -43,6 +44,25 @@
       pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_data_strobe
 &emmc_rstnout>;
   };
+&sfc {
+    bootph-pre-ram;

Any reason why the sfc and flash are pre-ram and the pins bootph-all ?

Quoted 2 lines

This used to be u-boot,dm-spl and was later replaced with bootph-pre-ram.

Right... but bootph-pre-ram means that the node is available in SPL right ? But it will not be available 'post-ram' ?

Quoted 4 lines

For fspim2_pins I used the same bootph as the other pins. Not sure why the pins use bootph-all to begin with, sdmmc and sdhci use bootph-pre-ram in rk3588s-u-boot.dtsi.

Because out of my understanding, the pins should be available in all bootstages, hence 'bootph-all' , they are needed all the time.

Please correct me if I am wrong, I am not very familiar with these new names yet.

But 'pre-ram' suggests (at least to me) availability only in the initial stage (SPL)

Otherwise what's the difference between bootph-all and bootph-pre-ram ? Maybe that difference would enlighten me

Sorry for the long noise

Quoted 64 lines
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +21 -0
+    u-boot,spl-sfc-no-dma;
+    pinctrl-names = "default";
+    pinctrl-0 = <&fspim2_pins>;
+    #address-cells = <1>;
+    #size-cells = <0>;
+    status = "okay";
+
+    flash@0 {
+        bootph-pre-ram;
+        compatible = "jedec,spi-nor";
+        reg = <0>;
+        spi-max-frequency = <24000000>;
+        spi-rx-bus-width = <4>;
+        spi-tx-bus-width = <1>;
+    };
+};
+
   &pinctrl {
       bootph-all;
@@ -69,6 +89,10 @@
       bootph-all;
   };
+&fspim2_pins {
+    bootph-all;
+};
+
   &sdmmc_bus4 {
       bootph-all;
   };
arch/arm/dts/rk3588s-u-boot.dtsi +10 -0
index cd7e6cb50ee2..d8a471a37fd1 100644
@@ -104,6 +104,15 @@
           };
       };
+    sfc: spi@fe2b0000 {
+        compatible = "rockchip,sfc";
+        reg = <0x0 0xfe2b0000 0x0 0x4000>;
+        interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH 0>;
+        clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>;
+        clock-names = "clk_sfc", "hclk_sfc";
+        status = "disabled";
+    };
+
       otp: nvmem@fecc0000 {
           compatible = "rockchip,rk3588-otp";
           reg = <0x0 0xfecc0000 0x0 0x400>;
@@ -164,3 +173,14 @@
   &ioc {
       bootph-pre-ram;
   };
+
Quoted 8 lines
Quoted 6 lines

arch/arm/dts/rk3588s-u-boot.dtsi line 182

Quoted 6 lines
arch/arm/dts/rk3588s-u-boot.dtsi +6 -0
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+&binman {
+    simple-bin-spi {
+        mkimage {
+            args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+            offset = <0x8000>;

What is this offset referring to ?

Quoted 4 lines

This offset is referring to the normal mmc 32 KiB offset that idbloader is normally written to. I used the offset prop so that the u-boot-rockchip-spi.bin can be written to offset 0 of spi similar as is currently done for rk3399.

Oh. I get it. thanks !
So it's the offset of 64 sectors that the rockchip tool needs.

I tried to write the u-boot-rockchip-spi.bin at offset 64 sectors, and it boots into the SPL, but cannot read the FIT. I tried to write it at offset 0, and then it boots correctly.
Interesting behavior.

Do you have to specify here the offset for the FIT, in binman ? Or is it taken from CONFIG_SYS_SPI_U_BOOT_OFFS automatically ?

Quoted 21 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
arch/arm/dts/rk3588s-u-boot.dtsi +4 -0
+        };
+    };
+};
+#endif
arch/arm/mach-rockchip/rk3588/rk3588.c +0 -0
index 18e67b5ca9b2..0e85893e0096 100644
@@ -41,6 +41,7 @@ const char * const boot_devices[BROM_LAST_BOOTSOURCE
Quoted 8 lines
Quoted 5 lines

arch/arm/mach-rockchip/rk3588/rk3588.c const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { · line 44

Quoted 5 lines
arch/arm/mach-rockchip/rk3588/rk3588.c +2 -0
+ 1] = {
       [BROM_BOOTSOURCE_EMMC] = "/mmc@fe2e0000",
       [BROM_BOOTSOURCE_SPINOR] = "/spi@fe2b0000/flash@0",
       [BROM_BOOTSOURCE_SD] = "/mmc@fe2c0000",
+    [6] = "/spi@fe2b0000/flash@0",

Is this '6' meaning something in particular ? or just the next number in line ?

Quoted 6 lines

The bootrom on rk3588 use value 6 when booting from the spi flash on my ROCK 5B, normally bootrom have used value 3 (BROM_BOOTSOURCE_SPINOR) on rk356x and earlier socs.

I have no idea what we should call this BOOTSOURCE, could not find any define in vendor u-boot to help give this a proper name.

Either this is a BOOTSOURCE_SPINOR_RK3588 specific, or the RK3588 calls some other device SPINOR, and this one (the sfc) something else. I remember seeing some other flash controllers in the dtsi of the SoC, maybe those are also bootable ?

Quoted 20 lines

Kever: Any insights into what this value should be called?

Quoted 16 lines
Quoted 14 lines
Quoted 9 lines
arch/arm/mach-rockchip/rk3588/rk3588.c +0 -0
   };
   static struct mm_region rk3588_mem_map[] = {
configs/rock5b-rk3588_defconfig +0 -0
index 2f0a74ee5559..e6a903853fb7 100644

configs/rock5b-rk3588_defconfig CONFIG_SPL_LIBGENERIC_SUPPORT=y · line 12

Quoted 5 lines
configs/rock5b-rk3588_defconfig +2 -0
@@ -8,15 +8,20 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
   CONFIG_NR_DRAM_BANKS=2
   CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
   CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
+CONFIG_SF_DEFAULT_SPEED=24000000
+CONFIG_SF_DEFAULT_MODE=0x2000

Any reason for changing the default mode ?

Quoted 3 lines

Default speed and mode is changed to match the speed and mode used in the device tree. SPL use these Kconfig instead of reading the speed and mode from fdt blob.

SPL should have its own blob, is the read from fdt not yet implemented ?

Quoted 34 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
configs/rock5b-rk3588_defconfig +3 -0
   CONFIG_DEFAULT_DEVICE_TREE="rk3588-rock-5b"
   CONFIG_ROCKCHIP_RK3588=y
   CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
   CONFIG_SPL_SERIAL=y
   CONFIG_SPL_STACK_R_ADDR=0x600000
   CONFIG_TARGET_ROCK5B_RK3588=y
   CONFIG_SPL_STACK=0x400000
   CONFIG_DEBUG_UART_BASE=0xFEB50000
   CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
   CONFIG_SYS_LOAD_ADDR=0xc00800
   CONFIG_DEBUG_UART=y
   CONFIG_FIT=y
@@ -35,6 +40,8 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
Quoted 8 lines
Quoted 5 lines

configs/rock5b-rk3588_defconfig CONFIG_SPL_BSS_MAX_SIZE=0x4000 · line 44

Quoted 5 lines
configs/rock5b-rk3588_defconfig +2 -0
   # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
   # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
   CONFIG_SPL_STACK_R=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000

I have a feeling the default is 0x80000, do you have any reason for the change to 0x60000 ?

The default is probably set for rk3399 that requires double space for idbloader because bootrom only read first 2 KiB of every 4 KiB page. To not waste usable space I used the same offset that was used by multiple rk3399 configs:

   u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */
Quoted 8 lines

SPI flash layout would look something like:

idbloader: @ 32 KiB
- TPL: current ddr init blob use around 54 KiB
- SPL: max 256 KiB
FIT payload: @ 384 KiB

Should mean we have at least 96 KiB for TPL.

Looks good.
I am only interested if this is different than from other devices, such that we keep a similar layout, and not diverge.

Quoted 27 lines

Regards,
Jonas

Quoted 22 lines
Quoted 21 lines
Quoted 21 lines
configs/rock5b-rk3588_defconfig +3 -0
   CONFIG_SPL_ATF=y
   CONFIG_CMD_GPIO=y
   CONFIG_CMD_GPT=y
@@ -59,6 +66,8 @@ CONFIG_MMC_SDHCI=y
   CONFIG_MMC_SDHCI_SDMA=y
   # CONFIG_SPL_MMC_SDHCI_SDMA is not set
   CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_XTX=y
   CONFIG_ETH_DESIGNWARE=y
   CONFIG_GMAC_ROCKCHIP=y
   CONFIG_PHY_ROCKCHIP_INNO_USB2=y
@@ -69,6 +78,7 @@ CONFIG_SPL_RAM=y
   CONFIG_BAUDRATE=1500000
   CONFIG_DEBUG_UART_SHIFT=2
   CONFIG_SYS_NS16550_MEM32=y
+CONFIG_ROCKCHIP_SFC=y
   CONFIG_SYSRESET=y
   CONFIG_USB=y
   CONFIG_USB_EHCI_HCD=y
#30 lore raw

Re: [PATCH 13/14] rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash

Quoted 45 lines · Eugen Hristev
Quoted 44 lines · Jonas Karlman

Hi Eugen,

Quoted 40 lines · Eugen Hristev

Hi Jonas,

Quoted 27 lines · Kever Yang
Quoted 4 lines · Jonas Karlman

Add sfc and flash node to device tree and config options to enable support for booting from SPI NOR flash on Radxa ROCK 5 Model B.

Thanks,
- Kever

Quoted 17 lines
---
   arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 24 ++++++++++++++++++++++++
   arch/arm/dts/rk3588s-u-boot.dtsi        | 20 ++++++++++++++++++++
   arch/arm/mach-rockchip/rk3588/rk3588.c  |  1 +
   configs/rock5b-rk3588_defconfig         | 10 ++++++++++
   4 files changed, 55 insertions(+)
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +1 -0
index 4bbc19058c90..b63dd40deb6d 100644
@@ -11,6 +11,7 @@
   / {
       aliases {
           mmc1 = &sdmmc;
+        spi0 = &sfc;
Quoted 8 lines

arch/arm/dts/rk3588-rock-5b-u-boot.dtsi line 48

Quoted 8 lines
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +2 -0
       };
       chosen {
@@ -43,6 +44,25 @@
       pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_data_strobe
 &emmc_rstnout>;
   };
+&sfc {
+    bootph-pre-ram;

Any reason why the sfc and flash are pre-ram and the pins bootph-all ?

Quoted 5 lines
Quoted 2 lines

This used to be u-boot,dm-spl and was later replaced with bootph-pre-ram.

Right... but bootph-pre-ram means that the node is available in SPL right ? But it will not be available 'post-ram' ?

I was under the assumption that a node would be available at any later stage, re-reading the dt-schema and checking Makefile I can now see that nodes will only be available in:

TPL: nodes having bootph-all or bootph-pre-sram
SPL: nodes having bootph-all or bootph-pre-ram U-Boot proper: all nodes regardless of any bootph prop

Quoted 8 lines
Quoted 5 lines

For fspim2_pins I used the same bootph as the other pins. Not sure why the pins use bootph-all to begin with, sdmmc and sdhci use bootph-pre-ram in rk3588s-u-boot.dtsi.

Because out of my understanding, the pins should be available in all bootstages, hence 'bootph-all' , they are needed all the time.

Fully agree and will have to change a few to bootph-all for RK3568 in a v2 series.

Quoted 9 lines

Please correct me if I am wrong, I am not very familiar with these new names yet.

But 'pre-ram' suggests (at least to me) availability only in the initial stage (SPL)

Otherwise what's the difference between bootph-all and bootph-pre-ram ? Maybe that difference would enlighten me

After reading up on the bootph props I think the following could be good use for the Rockchip platform, where TPL main purpose is to init DRAM and SPL main purpose is to load U-Boot proper/TF-A from storage:

- bootph-all for e.g. clock, ram, pinctrl and debug uart related nodes.
- bootph-pre-ram for any remaining node related to where U-Boot proper/TF-A could be loaded from.

Quoted 73 lines

Sorry for the long noise

Quoted 64 lines
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
arch/arm/dts/rk3588-rock-5b-u-boot.dtsi +21 -0
+    u-boot,spl-sfc-no-dma;
+    pinctrl-names = "default";
+    pinctrl-0 = <&fspim2_pins>;
+    #address-cells = <1>;
+    #size-cells = <0>;
+    status = "okay";
+
+    flash@0 {
+        bootph-pre-ram;
+        compatible = "jedec,spi-nor";
+        reg = <0>;
+        spi-max-frequency = <24000000>;
+        spi-rx-bus-width = <4>;
+        spi-tx-bus-width = <1>;
+    };
+};
+
   &pinctrl {
       bootph-all;
@@ -69,6 +89,10 @@
       bootph-all;
   };
+&fspim2_pins {
+    bootph-all;
+};
+
   &sdmmc_bus4 {
       bootph-all;
   };
arch/arm/dts/rk3588s-u-boot.dtsi +10 -0
index cd7e6cb50ee2..d8a471a37fd1 100644
@@ -104,6 +104,15 @@
           };
       };
+    sfc: spi@fe2b0000 {
+        compatible = "rockchip,sfc";
+        reg = <0x0 0xfe2b0000 0x0 0x4000>;
+        interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH 0>;
+        clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>;
+        clock-names = "clk_sfc", "hclk_sfc";
+        status = "disabled";
+    };
+
       otp: nvmem@fecc0000 {
           compatible = "rockchip,rk3588-otp";
           reg = <0x0 0xfecc0000 0x0 0x400>;
@@ -164,3 +173,14 @@
   &ioc {
       bootph-pre-ram;
   };
+
Quoted 8 lines
Quoted 6 lines

arch/arm/dts/rk3588s-u-boot.dtsi line 182

Quoted 6 lines
arch/arm/dts/rk3588s-u-boot.dtsi +6 -0
+#ifdef CONFIG_ROCKCHIP_SPI_IMAGE
+&binman {
+    simple-bin-spi {
+        mkimage {
+            args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+            offset = <0x8000>;

What is this offset referring to ?

Quoted 4 lines

This offset is referring to the normal mmc 32 KiB offset that idbloader is normally written to. I used the offset prop so that the u-boot-rockchip-spi.bin can be written to offset 0 of spi similar as is currently done for rk3399.

Quoted 7 lines

Oh. I get it. thanks !
So it's the offset of 64 sectors that the rockchip tool needs.

I tried to write the u-boot-rockchip-spi.bin at offset 64 sectors, and it boots into the SPL, but cannot read the FIT.
I tried to write it at offset 0, and then it boots correctly. Interesting behavior.

Possible other offsets then 64 sectors could be used, having idbloader at sector 0 did not seem to work on RK3568 but matching the mmc offset seemed to get my rk3568 device booting :-)

I think bootrom look for the idbloader header at multiple different offsets. So with u-boot-rockchip-spi.bin written at 64 sector offset bootrom will find and load TPL+SPL but SPL will not find FIT at the configured offset, CONFIG_SYS_SPI_U_BOOT_OFFS.

Quoted 3 lines

Do you have to specify here the offset for the FIT, in binman ? Or is it taken from CONFIG_SYS_SPI_U_BOOT_OFFS automatically ?

Correct, binman fit/u-boot-img node is using CONFIG_SYS_SPI_U_BOOT_OFFS for the offset in u-boot-rockchip-spi.bin.

arch/arm/dts/rockchip-u-boot.dtsi:
offset = <CONFIG_SYS_SPI_U_BOOT_OFFS>;

Quoted 25 lines
Quoted 25 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
arch/arm/dts/rk3588s-u-boot.dtsi +4 -0
+        };
+    };
+};
+#endif
arch/arm/mach-rockchip/rk3588/rk3588.c +0 -0
index 18e67b5ca9b2..0e85893e0096 100644
@@ -41,6 +41,7 @@ const char * const boot_devices[BROM_LAST_BOOTSOURCE
Quoted 8 lines
Quoted 5 lines

arch/arm/mach-rockchip/rk3588/rk3588.c const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { · line 44

Quoted 5 lines
arch/arm/mach-rockchip/rk3588/rk3588.c +2 -0
+ 1] = {
       [BROM_BOOTSOURCE_EMMC] = "/mmc@fe2e0000",
       [BROM_BOOTSOURCE_SPINOR] = "/spi@fe2b0000/flash@0",
       [BROM_BOOTSOURCE_SD] = "/mmc@fe2c0000",
+    [6] = "/spi@fe2b0000/flash@0",

Is this '6' meaning something in particular ? or just the next number in line ?

The bootrom on rk3588 use value 6 when booting from the spi flash on my ROCK 5B, normally bootrom have used value 3 (BROM_BOOTSOURCE_SPINOR) on rk356x and earlier socs.

Quoted 7 lines
Quoted 2 lines

I have no idea what we should call this BOOTSOURCE, could not find any define in vendor u-boot to help give this a proper name.

Either this is a BOOTSOURCE_SPINOR_RK3588 specific, or the RK3588 calls some other device SPINOR, and this one (the sfc) something else. I remember seeing some other flash controllers in the dtsi of the SoC, maybe those are also bootable ?

True, could be that there are some more bootable devices on RK3588, will add and use BROM_BOOTSOURCE_SPINOR_RK3588 for v2.

Quoted 21 lines
Quoted 21 lines

Kever: Any insights into what this value should be called?

Quoted 16 lines
Quoted 14 lines
Quoted 9 lines
arch/arm/mach-rockchip/rk3588/rk3588.c +0 -0
   };
   static struct mm_region rk3588_mem_map[] = {
configs/rock5b-rk3588_defconfig +0 -0
index 2f0a74ee5559..e6a903853fb7 100644

configs/rock5b-rk3588_defconfig CONFIG_SPL_LIBGENERIC_SUPPORT=y · line 12

Quoted 5 lines
configs/rock5b-rk3588_defconfig +2 -0
@@ -8,15 +8,20 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
   CONFIG_NR_DRAM_BANKS=2
   CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
   CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
+CONFIG_SF_DEFAULT_SPEED=24000000
+CONFIG_SF_DEFAULT_MODE=0x2000

Any reason for changing the default mode ?

Quoted 5 lines
Quoted 3 lines

Default speed and mode is changed to match the speed and mode used in the device tree. SPL use these Kconfig instead of reading the speed and mode from fdt blob.

SPL should have its own blob, is the read from fdt not yet implemented ?

I had an issue on RK3568 where clk driver need an exact clock rate to configure fspi clock. Noticed that fspi was probed with Kconfig values instead of the values used in device tree. With default speed configured booting from spi flash started working on RK3568. Setting the default mode that would be used by U-Boot proper also seem appropriate.

Did same for RK3588 even if it may not strictly be needed.

common/spl/spl_spi.c:
spi_flash_probe(sf_bus, sf_cs, CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE);

Quoted 42 lines
Quoted 42 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
configs/rock5b-rk3588_defconfig +3 -0
   CONFIG_DEFAULT_DEVICE_TREE="rk3588-rock-5b"
   CONFIG_ROCKCHIP_RK3588=y
   CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
+CONFIG_ROCKCHIP_SPI_IMAGE=y
   CONFIG_SPL_SERIAL=y
   CONFIG_SPL_STACK_R_ADDR=0x600000
   CONFIG_TARGET_ROCK5B_RK3588=y
   CONFIG_SPL_STACK=0x400000
   CONFIG_DEBUG_UART_BASE=0xFEB50000
   CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI=y
   CONFIG_SYS_LOAD_ADDR=0xc00800
   CONFIG_DEBUG_UART=y
   CONFIG_FIT=y
@@ -35,6 +40,8 @@ CONFIG_SPL_BSS_MAX_SIZE=0x4000
Quoted 8 lines
Quoted 5 lines

configs/rock5b-rk3588_defconfig CONFIG_SPL_BSS_MAX_SIZE=0x4000 · line 44

Quoted 5 lines
configs/rock5b-rk3588_defconfig +2 -0
   # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
   # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
   CONFIG_SPL_STACK_R=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x60000

I have a feeling the default is 0x80000, do you have any reason for the change to 0x60000 ?

The default is probably set for rk3399 that requires double space for idbloader because bootrom only read first 2 KiB of every 4 KiB page. To not waste usable space I used the same offset that was used by multiple rk3399 configs:

   u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */

SPI flash layout would look something like:

idbloader: @ 32 KiB
- TPL: current ddr init blob use around 54 KiB
- SPL: max 256 KiB
FIT payload: @ 384 KiB

Quoted 5 lines
Quoted 1 line

Should mean we have at least 96 KiB for TPL.

Looks good.
I am only interested if this is different than from other devices, such that we keep a similar layout, and not diverge.

From what I could tell this is matching at least some rk3399 devices, it is also matching a few rk356x devices I have prepared in my tree.

Regards,
Jonas

Quoted 29 lines
Quoted 28 lines

Regards,
Jonas

Quoted 22 lines
Quoted 21 lines
Quoted 21 lines
configs/rock5b-rk3588_defconfig +3 -0
   CONFIG_SPL_ATF=y
   CONFIG_CMD_GPIO=y
   CONFIG_CMD_GPT=y
@@ -59,6 +66,8 @@ CONFIG_MMC_SDHCI=y
   CONFIG_MMC_SDHCI_SDMA=y
   # CONFIG_SPL_MMC_SDHCI_SDMA is not set
   CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_XTX=y
   CONFIG_ETH_DESIGNWARE=y
   CONFIG_GMAC_ROCKCHIP=y
   CONFIG_PHY_ROCKCHIP_INNO_USB2=y
@@ -69,6 +78,7 @@ CONFIG_SPL_RAM=y
   CONFIG_BAUDRATE=1500000
   CONFIG_DEBUG_UART_SHIFT=2
   CONFIG_SYS_NS16550_MEM32=y
+CONFIG_ROCKCHIP_SFC=y
   CONFIG_SYSRESET=y
   CONFIG_USB=y
   CONFIG_USB_EHCI_HCD=y
#31 lore raw

PATCH 14/14 Revert "arm: dts: rockchip: radxa-cm3-io, rock-3a: enable regulators for usb"

In reply to Jonas Karlman

Remove regulator-boot-on prop from regulators now that the phy core has support for phy-supply after commit "phy: add support for phy-supply" and regulators support a basic reference counter after commit "regulator: implement basic reference counter".

This reverts commit 7911f409ff20dce5995cc1b703a6e30c94022f6b.

---
After [1] and [2] these regulator-boot-on props can be removed.

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

 arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 4 ----
 arch/arm/dts/rk3568-rock-3a-u-boot.dtsi      | 8 --------
 2 files changed, 12 deletions(-)
arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +0 -4
index d2ee19aaa8d5..332f81b3bc7e 100644
@@ -77,7 +77,3 @@
 	bootph-all;
 	status = "okay";
 };
-
-&vcc5v0_usb30 {
-	regulator-boot-on;
-};
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +0 -8
index 7cd2dc80c317..8abee24c02c3 100644
@@ -111,11 +111,3 @@
 	bootph-all;
 	status = "okay";
 };
-
-&vcc5v0_usb_host {
-	regulator-boot-on;
-};
-
-&vcc5v0_usb_hub {
-	regulator-boot-on;
-};
Signature · 1 line
2.40.0
Reviewed-by on v1 14/14
#32 lore raw

Re: [PATCH 14/14] Revert "arm: dts: rockchip: radxa-cm3-io, rock-3a: enable regulators for usb"

Quoted 8 lines · Jonas Karlman

Remove regulator-boot-on prop from regulators now that the phy core has support for phy-supply after commit "phy: add support for phy-supply" and regulators support a basic reference counter after commit "regulator: implement basic reference counter".

This reverts commit 7911f409ff20dce5995cc1b703a6e30c94022f6b.

Thanks,
- Kever

Quoted 38 lines

---
After [1] and [2] these regulator-boot-on props can be removed.

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

  arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 4 ----
  arch/arm/dts/rk3568-rock-3a-u-boot.dtsi      | 8 --------
  2 files changed, 12 deletions(-)
arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi +0 -4
index d2ee19aaa8d5..332f81b3bc7e 100644
@@ -77,7 +77,3 @@
  	bootph-all;
  	status = "okay";
  };
-
-&vcc5v0_usb30 {
-	regulator-boot-on;
-};
arch/arm/dts/rk3568-rock-3a-u-boot.dtsi +0 -8
index 7cd2dc80c317..8abee24c02c3 100644
@@ -111,11 +111,3 @@
  	bootph-all;
  	status = "okay";
  };
-
-&vcc5v0_usb_host {
-	regulator-boot-on;
-};
-
-&vcc5v0_usb_hub {
-	regulator-boot-on;
-};
#33 lore raw
In reply to Jonas Karlman

Hi Jonas and Eugen,

Quoted 11 lines · Jonas Karlman

This series sync some defconfig options across the different rk35xx boards and enables boot from SPI NOR flash on rk3568-rock-3a and rk3588-rock-5b.

Patch 1 fixes use of sfc-no-dma prop in rockchip sfc driver. Patch 2-7 updates defconfig for rk356x boards. Patch 8 enables boot from SPI NOR flash on rk3568-rock-3a. Patch 9-12 updates defconfig for rk3588 boards. Patch 13 enables boot from SPI NOR flash on rk3588-rock-5b. Patch 14 reverts addition of regulator-boot-on props.

Quoted 8 lines

Please note that patches related to rk3588 depend on [1] and [2], they may not apply clean. The final patch revert a workaround to fix usb that is not needed after series [1] and [3].

This series can also be found at [4].

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

I'm not able to apply these two patchset and also this patchset, maybe the conflict with latest code or the dependency is not correct, could you help to send a rebase for below patches?
- rk3588 rst,
- rock-5b pinctrl for sdmmc,
- usb2.0 for rock5b
- dw_pcie_rockchip for rk3588

Thanks,

- Kever

Quoted 38 lines

[3] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[4] https://github.com/Kwiboo/u-boot-rockchip/commits/rk35xx-defconfig-spi-v1

Jonas Karlman (14):
spi: rockchip_sfc: Use linux rockchip,sfc-no-dma prop
rockchip: rk356x-u-boot: Add xin24m clock node to SPL
rockchip: rk3566-radxa-cm3-io: Update defconfig
rockchip: rk3566-radxa-cm3-io: Use pinctrl for sdmmc and sdhci in SPL
rockchip: rk3568-evb: Update defconfig
rockchip: rk3568-rock-3a: Update defconfig
rockchip: rk3568-rock-3a: Use pinctrl for sdmmc and sdhci in SPL
rockchip: rk3568-rock-3a: Enable boot from SPI NOR flash
rockchip: rk3588: Select DM_RESET and DM_REGULATOR_FIXED in arch
Kconfig
rockchip: rk3588-evb: Update defconfig
rockchip: rk3588-rock-5b: Update defconfig
rockchip: rk3588-rock-5b: Add bootph prop to pinctrl for uart2 and
sdhci
rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash Revert "arm: dts: rockchip: radxa-cm3-io, rock-3a: enable regulators
for usb"

  arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 65 ++++++++++++++-
  arch/arm/dts/rk3568-rock-3a-u-boot.dtsi      | 85 ++++++++++++++++++--
  arch/arm/dts/rk356x-u-boot.dtsi              | 16 ++++
  arch/arm/dts/rk3588-rock-5b-u-boot.dtsi      | 52 ++++++++++++
  arch/arm/dts/rk3588s-u-boot.dtsi             | 20 +++++
  arch/arm/mach-rockchip/Kconfig               |  2 +
  arch/arm/mach-rockchip/rk3588/rk3588.c       |  1 +
  configs/evb-rk3568_defconfig                 | 15 ++--
  configs/evb-rk3588_defconfig                 | 11 +--
  configs/neu6a-io-rk3588_defconfig            |  1 -
  configs/radxa-cm3-io-rk3566_defconfig        | 10 ++-
  configs/rock-3a-rk3568_defconfig             | 20 +++--
  configs/rock5b-rk3588_defconfig              | 19 +++--
  drivers/spi/rockchip_sfc.c                   | 10 ++-
  14 files changed, 285 insertions(+), 42 deletions(-)
#34 lore raw

Hi Eugen,

Quoted 23 lines · Kever Yang

Hi Jonas and Eugen,

Quoted 11 lines · Jonas Karlman

This series sync some defconfig options across the different rk35xx boards and enables boot from SPI NOR flash on rk3568-rock-3a and rk3588-rock-5b.

Patch 1 fixes use of sfc-no-dma prop in rockchip sfc driver. Patch 2-7 updates defconfig for rk356x boards. Patch 8 enables boot from SPI NOR flash on rk3568-rock-3a. Patch 9-12 updates defconfig for rk3588 boards. Patch 13 enables boot from SPI NOR flash on rk3588-rock-5b. Patch 14 reverts addition of regulator-boot-on props.

Quoted 8 lines

Please note that patches related to rk3588 depend on [1] and [2], they may not apply clean. The final patch revert a workaround to fix usb that is not needed after series [1] and [3].

This series can also be found at [4].

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 7 lines

I'm not able to apply these two patchset and also this patchset, maybe the conflict with latest code or the dependency is not correct, could you help to send a rebase for below patches?
- rk3588 rst,
- rock-5b pinctrl for sdmmc,
- usb2.0 for rock5b
- dw_pcie_rockchip for rk3588

Looks like the following two commits in your enablement efforts tree may be a source of some of these dependency conflicts.

- rockchip: rk3588-rock-5b: Add spi nor flash node
- ARM: dts: rockchip: rk3588-rock-5b-u-boot: enable SPI flash in SPL

Those commits should come after all your pending series, same/similar commits are included in this defconfig/spinor series, series that I have tried to base on top of your series :-)

I will rebase my series on top of rockchip U-Boot Custodian Tree master and Eugen's series.

Regards,
Jonas

Quoted 43 lines

Thanks,

- Kever

Quoted 38 lines

[3] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[4] https://github.com/Kwiboo/u-boot-rockchip/commits/rk35xx-defconfig-spi-v1

Jonas Karlman (14):
spi: rockchip_sfc: Use linux rockchip,sfc-no-dma prop
rockchip: rk356x-u-boot: Add xin24m clock node to SPL
rockchip: rk3566-radxa-cm3-io: Update defconfig
rockchip: rk3566-radxa-cm3-io: Use pinctrl for sdmmc and sdhci in SPL
rockchip: rk3568-evb: Update defconfig
rockchip: rk3568-rock-3a: Update defconfig
rockchip: rk3568-rock-3a: Use pinctrl for sdmmc and sdhci in SPL
rockchip: rk3568-rock-3a: Enable boot from SPI NOR flash
rockchip: rk3588: Select DM_RESET and DM_REGULATOR_FIXED in arch
Kconfig
rockchip: rk3588-evb: Update defconfig
rockchip: rk3588-rock-5b: Update defconfig
rockchip: rk3588-rock-5b: Add bootph prop to pinctrl for uart2 and
sdhci
rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash Revert "arm: dts: rockchip: radxa-cm3-io, rock-3a: enable regulators
for usb"

  arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 65 ++++++++++++++-
  arch/arm/dts/rk3568-rock-3a-u-boot.dtsi      | 85 ++++++++++++++++++--
  arch/arm/dts/rk356x-u-boot.dtsi              | 16 ++++
  arch/arm/dts/rk3588-rock-5b-u-boot.dtsi      | 52 ++++++++++++
  arch/arm/dts/rk3588s-u-boot.dtsi             | 20 +++++
  arch/arm/mach-rockchip/Kconfig               |  2 +
  arch/arm/mach-rockchip/rk3588/rk3588.c       |  1 +
  configs/evb-rk3568_defconfig                 | 15 ++--
  configs/evb-rk3588_defconfig                 | 11 +--
  configs/neu6a-io-rk3588_defconfig            |  1 -
  configs/radxa-cm3-io-rk3566_defconfig        | 10 ++-
  configs/rock-3a-rk3568_defconfig             | 20 +++--
  configs/rock5b-rk3588_defconfig              | 19 +++--
  drivers/spi/rockchip_sfc.c                   | 10 ++-
  14 files changed, 285 insertions(+), 42 deletions(-)
#35 lore raw

Hi again,

Quoted 40 lines · Jonas Karlman

Hi Eugen,

Quoted 23 lines · Kever Yang

Hi Jonas and Eugen,

Quoted 11 lines · Jonas Karlman

This series sync some defconfig options across the different rk35xx boards and enables boot from SPI NOR flash on rk3568-rock-3a and rk3588-rock-5b.

Patch 1 fixes use of sfc-no-dma prop in rockchip sfc driver. Patch 2-7 updates defconfig for rk356x boards. Patch 8 enables boot from SPI NOR flash on rk3568-rock-3a. Patch 9-12 updates defconfig for rk3588 boards. Patch 13 enables boot from SPI NOR flash on rk3588-rock-5b. Patch 14 reverts addition of regulator-boot-on props.

Quoted 8 lines

Please note that patches related to rk3588 depend on [1] and [2], they may not apply clean. The final patch revert a workaround to fix usb that is not needed after series [1] and [3].

This series can also be found at [4].

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 7 lines

I'm not able to apply these two patchset and also this patchset, maybe the conflict with latest code or the dependency is not correct, could you help to send a rebase for below patches?
- rk3588 rst,
- rock-5b pinctrl for sdmmc,
- usb2.0 for rock5b
- dw_pcie_rockchip for rk3588

Looks like the following two commits in your enablement efforts tree may be a source of some of these dependency conflicts.

- rockchip: rk3588-rock-5b: Add spi nor flash node
- ARM: dts: rockchip: rk3588-rock-5b-u-boot: enable SPI flash in SPL

Quoted 6 lines

Those commits should come after all your pending series, same/similar commits are included in this defconfig/spinor series, series that I have tried to base on top of your series :-)

I will rebase my series on top of rockchip U-Boot Custodian Tree master and Eugen's series.

I had some time over and prepared a rebase branch with the following series from Eugen:

[2/2] reset: rockchip: implement rk3588 lookup table
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

[v5,1/6] ARM: dts: rockchip: rk3588-rock-5b-u-boot: add USB 2.0 host
https://patchwork.ozlabs.org/project/uboot/list/?series=351534

[v3,1/2] ARM: dts: rk3588-rock-5b-u-boot: add bootph-all to pinctrl for sdmmc
https://patchwork.ozlabs.org/project/uboot/list/?series=351078

[v3,1/7] pci: pcie_dw_rockchip: Add rk3588 compatible
https://patchwork.ozlabs.org/project/uboot/list/?series=352596

And on top of those my series:

rockchip: rk35xx: Update defconfigs and enable boot from SPI NOR flash
https://patchwork.ozlabs.org/project/uboot/list/?series=351973

rockchip: Fix eMMC performance regression
https://patchwork.ozlabs.org/project/uboot/list/?series=353826

I think that should be the correct apply order.

The rebase branch can be found at:
https://github.com/Kwiboo/u-boot-rockchip/commits/rebase-20230510a

I will hold off on sending out my v2 series until Eugen have had a chance to finalize and send out his series :-)

Regards,
Jonas

Quoted 48 lines

Regards,
Jonas

Quoted 43 lines

Thanks,

- Kever

Quoted 38 lines

[3] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[4] https://github.com/Kwiboo/u-boot-rockchip/commits/rk35xx-defconfig-spi-v1

Jonas Karlman (14):
spi: rockchip_sfc: Use linux rockchip,sfc-no-dma prop
rockchip: rk356x-u-boot: Add xin24m clock node to SPL
rockchip: rk3566-radxa-cm3-io: Update defconfig
rockchip: rk3566-radxa-cm3-io: Use pinctrl for sdmmc and sdhci in SPL
rockchip: rk3568-evb: Update defconfig
rockchip: rk3568-rock-3a: Update defconfig
rockchip: rk3568-rock-3a: Use pinctrl for sdmmc and sdhci in SPL
rockchip: rk3568-rock-3a: Enable boot from SPI NOR flash
rockchip: rk3588: Select DM_RESET and DM_REGULATOR_FIXED in arch
Kconfig
rockchip: rk3588-evb: Update defconfig
rockchip: rk3588-rock-5b: Update defconfig
rockchip: rk3588-rock-5b: Add bootph prop to pinctrl for uart2 and
sdhci
rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash Revert "arm: dts: rockchip: radxa-cm3-io, rock-3a: enable regulators
for usb"

  arch/arm/dts/rk3566-radxa-cm3-io-u-boot.dtsi | 65 ++++++++++++++-
  arch/arm/dts/rk3568-rock-3a-u-boot.dtsi      | 85 ++++++++++++++++++--
  arch/arm/dts/rk356x-u-boot.dtsi              | 16 ++++
  arch/arm/dts/rk3588-rock-5b-u-boot.dtsi      | 52 ++++++++++++
  arch/arm/dts/rk3588s-u-boot.dtsi             | 20 +++++
  arch/arm/mach-rockchip/Kconfig               |  2 +
  arch/arm/mach-rockchip/rk3588/rk3588.c       |  1 +
  configs/evb-rk3568_defconfig                 | 15 ++--
  configs/evb-rk3588_defconfig                 | 11 +--
  configs/neu6a-io-rk3588_defconfig            |  1 -
  configs/radxa-cm3-io-rk3566_defconfig        | 10 ++-
  configs/rock-3a-rk3568_defconfig             | 20 +++--
  configs/rock5b-rk3588_defconfig              | 19 +++--
  drivers/spi/rockchip_sfc.c                   | 10 ++-
  14 files changed, 285 insertions(+), 42 deletions(-)
#36 lore raw

Hi Jonas,

Quoted 18 lines · Jonas Karlman
Quoted 6 lines

Looks like the following two commits in your enablement efforts tree may be a source of some of these dependency conflicts.

- rockchip: rk3588-rock-5b: Add spi nor flash node
- ARM: dts: rockchip: rk3588-rock-5b-u-boot: enable SPI flash in SPL

Quoted 6 lines

Those commits should come after all your pending series, same/similar commits are included in this defconfig/spinor series, series that I have tried to base on top of your series 😄

I will rebase my series on top of rockchip U-Boot Custodian Tree master and Eugen's series.

I had some time over and prepared a rebase branch with the following series from Eugen:

[2/2] reset: rockchip: implement rk3588 lookup table
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 8 lines

[v5,1/6] ARM: dts: rockchip: rk3588-rock-5b-u-boot: add USB 2.0 host
https://patchwork.ozlabs.org/project/uboot/list/?series=351534

[v3,1/2] ARM: dts: rk3588-rock-5b-u-boot: add bootph-all to pinctrl for sdmmc
https://patchwork.ozlabs.org/project/uboot/list/?series=351078

[v3,1/7] pci: pcie_dw_rockchip: Add rk3588 compatible
https://patchwork.ozlabs.org/project/uboot/list/?series=352596

This patch set will need a rebase due to conflict since 0005.

Quoted 5 lines

And on top of those my series:

rockchip: rk35xx: Update defconfigs and enable boot from SPI NOR flash
https://patchwork.ozlabs.org/project/uboot/list/?series=351973

Conflict since 0008 rockchip: rk3568-rock-3a: Enable boot from SPI NOR flash

Quoted 3 lines

rockchip: Fix eMMC performance regression
https://patchwork.ozlabs.org/project/uboot/list/?series=353826

Conflict for configs/rock-pi-4-rk3399_defconfig in 0004 rockchip: rock-pi-4: Use SDMA to boost eMMC performance

Please send the update, maybe after new version "pci: pcie_dw_rockchip: Add rk3588 compatible" from Eugen.

I have apply part of these patches for the driver is fine and conflict only happen in dts level. Will apply new version

if available.

Thanks,

- Kever

Quoted 8 lines

I think that should be the correct apply order.

The rebase branch can be found at:
https://github.com/Kwiboo/u-boot-rockchip/commits/rebase-20230510a

I will hold off on sending out my v2 series until Eugen have had a chance to finalize and send out his series 😄

#37 lore raw
Quoted 40 lines · Kever Yang

Hi Jonas,

Quoted 18 lines · Jonas Karlman
Quoted 6 lines

Looks like the following two commits in your enablement efforts tree may be a source of some of these dependency conflicts.

- rockchip: rk3588-rock-5b: Add spi nor flash node
- ARM: dts: rockchip: rk3588-rock-5b-u-boot: enable SPI flash in SPL

Quoted 6 lines

Those commits should come after all your pending series, same/similar commits are included in this defconfig/spinor series, series that I have tried to base on top of your series 😄

I will rebase my series on top of rockchip U-Boot Custodian Tree master and Eugen's series.

I had some time over and prepared a rebase branch with the following series from Eugen:

[2/2] reset: rockchip: implement rk3588 lookup table
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 8 lines

[v5,1/6] ARM: dts: rockchip: rk3588-rock-5b-u-boot: add USB 2.0 host
https://patchwork.ozlabs.org/project/uboot/list/?series=351534

[v3,1/2] ARM: dts: rk3588-rock-5b-u-boot: add bootph-all to pinctrl for sdmmc
https://patchwork.ozlabs.org/project/uboot/list/?series=351078

[v3,1/7] pci: pcie_dw_rockchip: Add rk3588 compatible
https://patchwork.ozlabs.org/project/uboot/list/?series=352596

This patch set will need a rebase due to conflict since 0005.

Quoted 5 lines

And on top of those my series:

rockchip: rk35xx: Update defconfigs and enable boot from SPI NOR flash
https://patchwork.ozlabs.org/project/uboot/list/?series=351973

Conflict since 0008 rockchip: rk3568-rock-3a: Enable boot from SPI NOR flash

Quoted 3 lines

rockchip: Fix eMMC performance regression
https://patchwork.ozlabs.org/project/uboot/list/?series=353826

Quoted 8 lines

Conflict for configs/rock-pi-4-rk3399_defconfig in 0004 rockchip: rock-pi-4: Use SDMA to boost eMMC performance

Please send the update, maybe after new version "pci: pcie_dw_rockchip: Add rk3588 compatible" from Eugen.

I have apply part of these patches for the driver is fine and conflict only happen in dts level. Will apply new version

if available.

Hi Kever,

I looked in your branch, and have a few updates:

Can you replace patch configs: rockchip: rock5b-rk3588: enable USB and regulators with this new patch I sent (v6), because Jonas pointed out a line that was added wrongly. Patch available here:

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

I am also rebasing the pci express patches on top of your branch and resending .

Thanks !

Quoted 14 lines

Thanks,

- Kever

Quoted 8 lines

I think that should be the correct apply order.

The rebase branch can be found at:
https://github.com/Kwiboo/u-boot-rockchip/commits/rebase-20230510a

I will hold off on sending out my v2 series until Eugen have had a chance to finalize and send out his series 😄

#39 lore raw
Quoted 8 lines · Kever Yang

Hi Jonas,

Quoted 1 line · Kever Yang

[3] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Thanks for figure out all the dependency.

Quoted 9 lines

This patch is on my list, I'm not sure when it will be merged, so if you have patch depends on this patch,

please don't gather it in the same patch set so I can apply those all the dependent patches has merged.

Thanks,

- Kever

Hi,

I am sorry for the confusion.
I was away last week, but I will resend all the patches today.

The regulator reference counter patch fixes the issue of usb being blocked on usb stop , but the usb still works . I think you can apply the USB series by then without any problems.

Eugen