]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
rockchip: rk3588: Fix boot from SPI flash
authorJonas Karlman <jonas@kwiboo.se>
Fri, 17 Nov 2023 23:24:34 +0000 (23:24 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 19 Jan 2024 02:57:36 +0000 (10:57 +0800)
The commit fd6e425be243 ("rockchip: rk3588-rock-5b: Enable boot from SPI
NOR flash") added a new BROM_BOOTSOURCE_SPINOR_RK3588 with value 6.

At the time the reason for this new bootsource id value 6 was unknown.

We now know that the BootRom on RK3588 use different bootsource id
values depending on the iomux used by the flash spi controller, and not
by the type of spi nor or spi nand flash used.

Add the following enum values and use them for RK3588 boot_devices.

- BROM_BOOTSOURCE_FSPI_M0 = 3
- BROM_BOOTSOURCE_FSPI_M1 = 4
- BROM_BOOTSOURCE_FSPI_M2 = 6

Fixes: fd6e425be243 ("rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Tested-by: Slawomir Stepien <sst@poczta.fm>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/include/asm/arch-rockchip/bootrom.h
arch/arm/mach-rockchip/rk3588/rk3588.c

index 7dab18fbc3fb53bc0da2c64cdb9c6afba6d5a204..4276a0f6811a24ff285ecc1bdd964753a2fc37fb 100644 (file)
@@ -48,7 +48,6 @@ enum {
        BROM_BOOTSOURCE_SPINOR = 3,
        BROM_BOOTSOURCE_SPINAND = 4,
        BROM_BOOTSOURCE_SD = 5,
-       BROM_BOOTSOURCE_SPINOR_RK3588 = 6,
        BROM_BOOTSOURCE_USB = 10,
        BROM_LAST_BOOTSOURCE = BROM_BOOTSOURCE_USB
 };
index b1f535fad505e5b89bc1acd88dc7c12337ec7960..91c9d32e496cd9548e67dd2f4dbd5d52d44ec0a3 100644 (file)
@@ -37,11 +37,23 @@ DECLARE_GLOBAL_DATA_PTR;
 #define BUS_IOC_GPIO2D_IOMUX_SEL_H     0x5c
 #define BUS_IOC_GPIO3A_IOMUX_SEL_L     0x60
 
+/**
+ * Boot-device identifiers used by the BROM on RK3588 when device is booted
+ * from SPI flash. IOMUX used for SPI flash affect the value used by the BROM
+ * and not the type of SPI flash used.
+ */
+enum {
+       BROM_BOOTSOURCE_FSPI_M0 = 3,
+       BROM_BOOTSOURCE_FSPI_M1 = 4,
+       BROM_BOOTSOURCE_FSPI_M2 = 6,
+};
+
 const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
        [BROM_BOOTSOURCE_EMMC] = "/mmc@fe2e0000",
-       [BROM_BOOTSOURCE_SPINOR] = "/spi@fe2b0000/flash@0",
+       [BROM_BOOTSOURCE_FSPI_M0] = "/spi@fe2b0000/flash@0",
+       [BROM_BOOTSOURCE_FSPI_M1] = "/spi@fe2b0000/flash@0",
+       [BROM_BOOTSOURCE_FSPI_M2] = "/spi@fe2b0000/flash@0",
        [BROM_BOOTSOURCE_SD] = "/mmc@fe2c0000",
-       [BROM_BOOTSOURCE_SPINOR_RK3588] = "/spi@fe2b0000/flash@0",
 };
 
 static struct mm_region rk3588_mem_map[] = {