summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJonas Karlman <[email protected]>2023-05-17 18:26:35 +0000
committerKever Yang <[email protected]>2023-05-18 08:44:05 +0800
commit64f79f88a751e763b73aa31d96da9d0e06f79feb (patch)
tree56ea0e8036d8aab1324d38ceba9b835fd1f98eff /arch
parent674803fe869761997c43b6e2c99b63a3444ac6fa (diff)
rockchip: rk3568-rock-3a: Enable boot from SPI NOR flash
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 Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/dts/rk3568-rock-3a-u-boot.dtsi25
-rw-r--r--arch/arm/dts/rk356x-u-boot.dtsi11
2 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi
index 8cccd7e2265..bbf54f888fa 100644
--- a/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi
+++ b/arch/arm/dts/rk3568-rock-3a-u-boot.dtsi
@@ -7,6 +7,10 @@
#include "rk356x-u-boot.dtsi"
/ {
+ aliases {
+ spi0 = &sfc;
+ };
+
chosen {
stdout-path = &uart2;
};
@@ -28,6 +32,10 @@
bootph-all;
};
+&fspi_pins {
+ bootph-all;
+};
+
&pinctrl {
bootph-all;
};
@@ -68,6 +76,23 @@
mmc-hs400-enhanced-strobe;
};
+&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>;
+ };
+};
+
&sdmmc2 {
status = "disabled";
};
diff --git a/arch/arm/dts/rk356x-u-boot.dtsi b/arch/arm/dts/rk356x-u-boot.dtsi
index a1c2d03c52f..c340c2bba6f 100644
--- a/arch/arm/dts/rk356x-u-boot.dtsi
+++ b/arch/arm/dts/rk356x-u-boot.dtsi
@@ -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