[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.
Signed-off-by: Peter Robinson pbrobinson@gmail.com --- configs/rock64-rk3328_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 5e36612bb80..1da9b0545a5 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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

Enable the rockchip efuse driver on the Rock64 to provide a stable ethernet address on the device.
Signed-off-by: Peter Robinson pbrobinson@gmail.com ---
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(+)
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 1da9b0545a5..97ac8734d1b 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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

On 2023/6/14 20:43, Peter Robinson wrote:
Enable the rockchip efuse driver on the Rock64 to provide a stable ethernet address on the device.
Signed-off-by: Peter Robinson pbrobinson@gmail.com
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
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(+)
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 1da9b0545a5..97ac8734d1b 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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

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.
Signed-off-by: Peter Robinson pbrobinson@gmail.com ---
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(+)
diff --git a/arch/arm/dts/rk3328-u-boot.dtsi b/arch/arm/dts/rk3328-u-boot.dtsi index ce96ce40a73..a9f2536de2a 100644 --- a/arch/arm/dts/rk3328-u-boot.dtsi +++ b/arch/arm/dts/rk3328-u-boot.dtsi @@ -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 { diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 97ac8734d1b..1820deee373 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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

Hi Peter,
On 2023/6/14 20:43, Peter Robinson wrote:
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
Signed-off-by: Peter Robinson pbrobinson@gmail.com
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(+)
diff --git a/arch/arm/dts/rk3328-u-boot.dtsi b/arch/arm/dts/rk3328-u-boot.dtsi index ce96ce40a73..a9f2536de2a 100644 --- a/arch/arm/dts/rk3328-u-boot.dtsi +++ b/arch/arm/dts/rk3328-u-boot.dtsi @@ -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 {
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 97ac8734d1b..1820deee373 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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

Align the SPI flash entry with upstream. There's no need to diverge here.
Signed-off-by: Peter Robinson pbrobinson@gmail.com --- arch/arm/dts/rk3328-rock64-u-boot.dtsi | 2 +- arch/arm/dts/rk3328-rock64.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/rk3328-rock64-u-boot.dtsi b/arch/arm/dts/rk3328-rock64-u-boot.dtsi index 849854302ee..6904515b969 100644 --- a/arch/arm/dts/rk3328-rock64-u-boot.dtsi +++ b/arch/arm/dts/rk3328-rock64-u-boot.dtsi @@ -54,7 +54,7 @@ };
&spi0 { - spi_flash: spiflash@0 { + spi_flash: flash@0 { bootph-all; }; }; diff --git a/arch/arm/dts/rk3328-rock64.dts b/arch/arm/dts/rk3328-rock64.dts index 1b0f7e4551e..f69a38f42d2 100644 --- a/arch/arm/dts/rk3328-rock64.dts +++ b/arch/arm/dts/rk3328-rock64.dts @@ -345,7 +345,7 @@ &spi0 { status = "okay";
- spiflash@0 { + flash@0 { compatible = "jedec,spi-nor"; reg = <0>;

On 2023/6/14 20:43, Peter Robinson wrote:
Align the SPI flash entry with upstream. There's no need to diverge here.
Signed-off-by: Peter Robinson pbrobinson@gmail.com
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
arch/arm/dts/rk3328-rock64-u-boot.dtsi | 2 +- arch/arm/dts/rk3328-rock64.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/rk3328-rock64-u-boot.dtsi b/arch/arm/dts/rk3328-rock64-u-boot.dtsi index 849854302ee..6904515b969 100644 --- a/arch/arm/dts/rk3328-rock64-u-boot.dtsi +++ b/arch/arm/dts/rk3328-rock64-u-boot.dtsi @@ -54,7 +54,7 @@ };
&spi0 {
- spi_flash: spiflash@0 {
- spi_flash: flash@0 { bootph-all; }; };
diff --git a/arch/arm/dts/rk3328-rock64.dts b/arch/arm/dts/rk3328-rock64.dts index 1b0f7e4551e..f69a38f42d2 100644 --- a/arch/arm/dts/rk3328-rock64.dts +++ b/arch/arm/dts/rk3328-rock64.dts @@ -345,7 +345,7 @@ &spi0 { status = "okay";
- spiflash@0 {
- flash@0 { compatible = "jedec,spi-nor"; reg = <0>;

Hi Peter,
On 2023-06-14 14:43, Peter Robinson wrote:
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
Signed-off-by: Peter Robinson pbrobinson@gmail.com
configs/rock64-rk3328_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 5e36612bb80..1da9b0545a5 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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

Hi Peter,
On 2023/6/14 23:03, Jonas Karlman wrote:
Hi Peter,
On 2023-06-14 14:43, Peter Robinson wrote:
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"
Jonas is correct for usb boot, maybe you don't need this patch for usb scan.
Thanks,
- Kever
You can change boot_targets env if you want to start from usb before mmc.
Regards, Jonas
Signed-off-by: Peter Robinson pbrobinson@gmail.com
configs/rock64-rk3328_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 5e36612bb80..1da9b0545a5 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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

Hi Peter,
Could you update the patchset with patches you still want to send?
Thanks,
- Kever
On 2023/6/14 20:43, Peter Robinson wrote:
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.
Signed-off-by: Peter Robinson pbrobinson@gmail.com
configs/rock64-rk3328_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 5e36612bb80..1da9b0545a5 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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

On Tue, Aug 1, 2023 at 4:17 AM Kever Yang kever.yang@rock-chips.com wrote:
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?
Thanks,
- Kever
On 2023/6/14 20:43, Peter Robinson wrote:
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.
Signed-off-by: Peter Robinson pbrobinson@gmail.com
configs/rock64-rk3328_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 5e36612bb80..1da9b0545a5 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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

Hi Peter,
On 2023/8/3 15:44, Peter Robinson wrote:
On Tue, Aug 1, 2023 at 4:17 AM Kever Yang kever.yang@rock-chips.com wrote:
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
Thanks,
- Kever
On 2023/6/14 20:43, Peter Robinson wrote:
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.
Signed-off-by: Peter Robinson pbrobinson@gmail.com
configs/rock64-rk3328_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 5e36612bb80..1da9b0545a5 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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

On Fri, Aug 4, 2023 at 2:25 AM Kever Yang kever.yang@rock-chips.com wrote:
Hi Peter,
On 2023/8/3 15:44, Peter Robinson wrote:
On Tue, Aug 1, 2023 at 4:17 AM Kever Yang kever.yang@rock-chips.com wrote:
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
Thanks,
- Kever
Thanks,
- Kever
On 2023/6/14 20:43, Peter Robinson wrote:
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.
Signed-off-by: Peter Robinson pbrobinson@gmail.com
configs/rock64-rk3328_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index 5e36612bb80..1da9b0545a5 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -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
participants (3)
-
Jonas Karlman
-
Kever Yang
-
Peter Robinson