Skip to contentSkip to conversation

config: rock64: start USB to make storage usable

PATCH In review Peter Robinson 3 participants 13 messages Jun 14, 2023 – Aug 4, 2023 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 config: rock64: start USB to make storage usable

Start the USB stack so usb storage can be used. Adding the command as usb keyboard isn't enabled as there's not currently display output.

---
 configs/rock64-rk3328_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/rock64-rk3328_defconfig +2 -0
index 5e36612bb80..1da9b0545a5 100644
@@ -23,6 +23,8 @@ CONFIG_DEBUG_UART_BASE=0xFF130000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SYS_LOAD_ADDR=0x800800
 CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
Signature · 1 line
2.41.0
#1 lore raw

PATCH 2/4 config: rock64: enable efuse for stable mac addr

Enable the rockchip efuse driver on the Rock64 to
provide a stable ethernet address on the device.

---

While the rockchip efuse driver currently has issues on rk3328 due to, I believe, it not being properly initialised in ATF, enabling it at least provides a stable MAC adress on the NIC which I think makes it worthwhile

 configs/rock64-rk3328_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/rock64-rk3328_defconfig +1 -0
index 1da9b0545a5..97ac8734d1b 100644
@@ -74,6 +74,7 @@ CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_MISC=y
+CONFIG_ROCKCHIP_EFUSE=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
Signature · 1 line
2.41.0
Reviewed-by on v1 2/4
#2 lore raw

Re: [PATCH 2/4] config: rock64: enable efuse for stable mac addr

Quoted 4 lines · Peter Robinson

Enable the rockchip efuse driver on the Rock64 to
provide a stable ethernet address on the device.

Thanks,
- Kever

Quoted 21 lines

---

While the rockchip efuse driver currently has issues on rk3328 due to, I believe, it not being properly initialised in ATF, enabling it at least provides a stable MAC adress on the NIC which I think makes it worthwhile

  configs/rock64-rk3328_defconfig | 1 +
  1 file changed, 1 insertion(+)
configs/rock64-rk3328_defconfig +1 -0
index 1da9b0545a5..97ac8734d1b 100644
@@ -74,6 +74,7 @@ CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
  CONFIG_ROCKCHIP_GPIO=y
  CONFIG_SYS_I2C_ROCKCHIP=y
  CONFIG_MISC=y
+CONFIG_ROCKCHIP_EFUSE=y
  CONFIG_MMC_DW=y
  CONFIG_MMC_DW_ROCKCHIP=y
  CONFIG_SPI_FLASH_GIGADEVICE=y
#3 lore raw

PATCH 3/4 rockchip: dts: rk3328: Add rng details to u-boot.dtsi

In reply to Peter Robinson

Add the rk3328 rng details to the u-boot.dtsi and enable the RNG on the Rock64 to be able to provide a rnadom seed via UEFI.

---

The DT snippet will allow this to be enabled on other rk3328 devices but I only have the Rock54 to test on.

 arch/arm/dts/rk3328-u-boot.dtsi | 6 ++++++
 configs/rock64-rk3328_defconfig | 2 ++
 2 files changed, 8 insertions(+)
arch/arm/dts/rk3328-u-boot.dtsi +6 -0
index ce96ce40a73..a9f2536de2a 100644
@@ -26,6 +26,12 @@
 		       0x0 0xff720000 0x0 0x1000
 		       0x0 0xff798000 0x0 0x1000>;
 	};
+
+	rng: rng@ff060000 {
+		compatible = "rockchip,cryptov1-rng";
+		reg = <0x0 0xff060000 0x0 0x4000>;
+		status = "okay";
+	};
 };
 
 &cru {
configs/rock64-rk3328_defconfig +2 -0
index 97ac8734d1b..1820deee373 100644
@@ -77,6 +77,8 @@ CONFIG_MISC=y
 CONFIG_ROCKCHIP_EFUSE=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_ROCKCHIP=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
Signature · 1 line
2.41.0
#4 lore raw

Re: [PATCH 3/4] rockchip: dts: rk3328: Add rng details to u-boot.dtsi

Hi Peter,

Quoted 3 lines · Peter Robinson

Add the rk3328 rng details to the u-boot.dtsi and enable the RNG on the Rock64 to be able to provide a rnadom seed via UEFI.

typo: random

Thanks,

- Kever

Quoted 41 lines

---

The DT snippet will allow this to be enabled on other rk3328 devices but I only have the Rock54 to test on.

  arch/arm/dts/rk3328-u-boot.dtsi | 6 ++++++
  configs/rock64-rk3328_defconfig | 2 ++
  2 files changed, 8 insertions(+)
arch/arm/dts/rk3328-u-boot.dtsi +6 -0
index ce96ce40a73..a9f2536de2a 100644
@@ -26,6 +26,12 @@
  		       0x0 0xff720000 0x0 0x1000
  		       0x0 0xff798000 0x0 0x1000>;
  	};
+
+	rng: rng@ff060000 {
+		compatible = "rockchip,cryptov1-rng";
+		reg = <0x0 0xff060000 0x0 0x4000>;
+		status = "okay";
+	};
  };
 
  &cru {
configs/rock64-rk3328_defconfig +2 -0
index 97ac8734d1b..1820deee373 100644
@@ -77,6 +77,8 @@ CONFIG_MISC=y
  CONFIG_ROCKCHIP_EFUSE=y
  CONFIG_MMC_DW=y
  CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_ROCKCHIP=y
  CONFIG_SPI_FLASH_GIGADEVICE=y
  CONFIG_ETH_DESIGNWARE=y
  CONFIG_GMAC_ROCKCHIP=y
#5 lore raw

PATCH 4/4 rockchip: dts: rk3328: rock64: Align spi flash entry

In reply to Peter Robinson

Align the SPI flash entry with upstream. There's no need to diverge here.

---
 arch/arm/dts/rk3328-rock64-u-boot.dtsi | 2 +-
 arch/arm/dts/rk3328-rock64.dts         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/dts/rk3328-rock64-u-boot.dtsi +1 -1
index 849854302ee..6904515b969 100644
@@ -54,7 +54,7 @@
 };
 
 &spi0 {
-	spi_flash: spiflash@0 {
+	spi_flash: flash@0 {
 		bootph-all;
 	};
 };
arch/arm/dts/rk3328-rock64.dts +1 -1
index 1b0f7e4551e..f69a38f42d2 100644
@@ -345,7 +345,7 @@
 &spi0 {
 	status = "okay";
 
-	spiflash@0 {
+	flash@0 {
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 
Signature · 1 line
2.41.0
Reviewed-by on v1 4/4
#6 lore raw

Re: [PATCH 4/4] rockchip: dts: rk3328: rock64: Align spi flash entry

Quoted 4 lines · Peter Robinson

Align the SPI flash entry with upstream. There's no need to diverge here.

Thanks,
- Kever

Quoted 31 lines
---
  arch/arm/dts/rk3328-rock64-u-boot.dtsi | 2 +-
  arch/arm/dts/rk3328-rock64.dts         | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/dts/rk3328-rock64-u-boot.dtsi +1 -1
index 849854302ee..6904515b969 100644
@@ -54,7 +54,7 @@
  };
 
  &spi0 {
-	spi_flash: spiflash@0 {
+	spi_flash: flash@0 {
  		bootph-all;
  	};
  };
arch/arm/dts/rk3328-rock64.dts +1 -1
index 1b0f7e4551e..f69a38f42d2 100644
@@ -345,7 +345,7 @@
  &spi0 {
  	status = "okay";
 
-	spiflash@0 {
+	flash@0 {
  		compatible = "jedec,spi-nor";
  		reg = <0>;
 
#7 lore raw
In reply to Peter Robinson

Hi Peter,

Quoted 2 lines · Peter Robinson

Start the USB stack so usb storage can be used. Adding the command as usb keyboard isn't enabled as there's not currently display output.

This is not needed for autoboot from usb to work and slows down boot from sd/emmc by forcing usb to start.

bootstd will init usb once it reaches usb in boot_targets and nothing can boot before it.

boot_targets="mmc1 mmc0 nvme scsi usb pxe dhcp spi"

You can change boot_targets env if you want to start from usb before mmc.

Regards,
Jonas

Quoted 19 lines
---
 configs/rock64-rk3328_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/rock64-rk3328_defconfig +2 -0
index 5e36612bb80..1da9b0545a5 100644
@@ -23,6 +23,8 @@ CONFIG_DEBUG_UART_BASE=0xFF130000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SYS_LOAD_ADDR=0x800800
 CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
#8 lore raw

Hi Peter,

Quoted 5 lines · Jonas Karlman

Hi Peter,

Quoted 2 lines · Peter Robinson

Start the USB stack so usb storage can be used. Adding the command as usb keyboard isn't enabled as there's not currently display output.

Quoted 7 lines

This is not needed for autoboot from usb to work and slows down boot from sd/emmc by forcing usb to start.

bootstd will init usb once it reaches usb in boot_targets and nothing can boot before it.

boot_targets="mmc1 mmc0 nvme scsi usb pxe dhcp spi"

    Jonas is correct for usb boot, maybe you don't need this patch for usb scan.

Thanks,

- Kever

Quoted 24 lines

You can change boot_targets env if you want to start from usb before mmc.

Regards,
Jonas

Quoted 18 lines
---
  configs/rock64-rk3328_defconfig | 2 ++
  1 file changed, 2 insertions(+)
configs/rock64-rk3328_defconfig +2 -0
index 5e36612bb80..1da9b0545a5 100644
@@ -23,6 +23,8 @@ CONFIG_DEBUG_UART_BASE=0xFF130000
  CONFIG_DEBUG_UART_CLOCK=24000000
  CONFIG_SYS_LOAD_ADDR=0x800800
  CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"
  # CONFIG_ANDROID_BOOT_IMAGE is not set
  CONFIG_FIT=y
  CONFIG_FIT_VERBOSE=y
#9 lore raw
In reply to Peter Robinson

Hi Peter,

    Could you update the patchset with patches you still want to send?

Thanks,

- Kever

Quoted 21 lines · Peter Robinson

Start the USB stack so usb storage can be used. Adding the command as usb keyboard isn't enabled as there's not currently display output.

---
  configs/rock64-rk3328_defconfig | 2 ++
  1 file changed, 2 insertions(+)
configs/rock64-rk3328_defconfig +2 -0
index 5e36612bb80..1da9b0545a5 100644
@@ -23,6 +23,8 @@ CONFIG_DEBUG_UART_BASE=0xFF130000
  CONFIG_DEBUG_UART_CLOCK=24000000
  CONFIG_SYS_LOAD_ADDR=0x800800
  CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"
  # CONFIG_ANDROID_BOOT_IMAGE is not set
  CONFIG_FIT=y
  CONFIG_FIT_VERBOSE=y
#10 lore raw
Quoted 4 lines · Kever Yang

Hi Peter,

Could you update the patchset with patches you still want to send?

Can you just drop this patch and take the rest from the set?

Quoted 27 lines

Thanks,

- Kever

Quoted 21 lines · Peter Robinson

Start the USB stack so usb storage can be used. Adding the command as usb keyboard isn't enabled as there's not currently display output.

---
  configs/rock64-rk3328_defconfig | 2 ++
  1 file changed, 2 insertions(+)
configs/rock64-rk3328_defconfig +2 -0
index 5e36612bb80..1da9b0545a5 100644
@@ -23,6 +23,8 @@ CONFIG_DEBUG_UART_BASE=0xFF130000
  CONFIG_DEBUG_UART_CLOCK=24000000
  CONFIG_SYS_LOAD_ADDR=0x800800
  CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"
  # CONFIG_ANDROID_BOOT_IMAGE is not set
  CONFIG_FIT=y
  CONFIG_FIT_VERBOSE=y
#11 lore raw

Hi Peter,

Quoted 5 lines · Peter Robinson
Quoted 3 lines · Kever Yang

Hi Peter,

Could you update the patchset with patches you still want to send?

Can you just drop this patch and take the rest from the set?

Yes, it's OK if there no other change, I can fix the typo in 3/4.

Thanks,

- Kever

Quoted 28 lines
Quoted 28 lines

Thanks,

- Kever

Quoted 21 lines · Peter Robinson

Start the USB stack so usb storage can be used. Adding the command as usb keyboard isn't enabled as there's not currently display output.

---
   configs/rock64-rk3328_defconfig | 2 ++
   1 file changed, 2 insertions(+)
configs/rock64-rk3328_defconfig +2 -0
index 5e36612bb80..1da9b0545a5 100644
@@ -23,6 +23,8 @@ CONFIG_DEBUG_UART_BASE=0xFF130000
   CONFIG_DEBUG_UART_CLOCK=24000000
   CONFIG_SYS_LOAD_ADDR=0x800800
   CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"
   # CONFIG_ANDROID_BOOT_IMAGE is not set
   CONFIG_FIT=y
   CONFIG_FIT_VERBOSE=y
#12 lore raw
Quoted 11 lines · Kever Yang

Hi Peter,

Quoted 5 lines · Peter Robinson
Quoted 3 lines · Kever Yang

Hi Peter,

Could you update the patchset with patches you still want to send?

Can you just drop this patch and take the rest from the set?

Yes, it's OK if there no other change, I can fix the typo in 3/4.

Awesome, thanks

Quoted 33 lines

Thanks,

- Kever

Quoted 28 lines
Quoted 28 lines

Thanks,

- Kever

Quoted 21 lines · Peter Robinson

Start the USB stack so usb storage can be used. Adding the command as usb keyboard isn't enabled as there's not currently display output.

---
   configs/rock64-rk3328_defconfig | 2 ++
   1 file changed, 2 insertions(+)
configs/rock64-rk3328_defconfig +2 -0
index 5e36612bb80..1da9b0545a5 100644
@@ -23,6 +23,8 @@ CONFIG_DEBUG_UART_BASE=0xFF130000
   CONFIG_DEBUG_UART_CLOCK=24000000
   CONFIG_SYS_LOAD_ADDR=0x800800
   CONFIG_DEBUG_UART=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"
   # CONFIG_ANDROID_BOOT_IMAGE is not set
   CONFIG_FIT=y
   CONFIG_FIT_VERBOSE=y