]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
rockchip: spl: Add common handling of USB bootsource_id 0x81
authorJonas Karlman <jonas@kwiboo.se>
Sat, 31 Jan 2026 23:38:12 +0000 (23:38 +0000)
committerTom Rini <trini@konsulko.com>
Tue, 10 Mar 2026 16:07:02 +0000 (10:07 -0600)
Multiple newer Rockchip SoCs report 0x81 instead of 0xa when booting
from USB, i.e. on RK3576, RK3528, RK3506 and RV1106.

Move the bootsource_id 0x81 handling currently only used for RK3528 to
the common read_brom_bootsource_id() to reduce the need to override this
function when support for newer SoCs is introduced.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/mach-rockchip/rk3528/rk3528.c
arch/arm/mach-rockchip/spl.c

index 57ead0006f1f058ab085defeea920327444191ee..f9bfc445b8571dd66e4048af537e47b483f3b9ce 100644 (file)
@@ -49,21 +49,6 @@ void board_debug_uart_init(void)
 {
 }
 
-u32 read_brom_bootsource_id(void)
-{
-       u32 bootsource_id = readl(BROM_BOOTSOURCE_ID_ADDR);
-
-       /* Re-map the raw value read from reg to an existing BROM_BOOTSOURCE
-        * enum value to avoid having to create a larger boot_devices table.
-        */
-       if (bootsource_id == 0x81)
-               return BROM_BOOTSOURCE_USB;
-       else if (bootsource_id > BROM_LAST_BOOTSOURCE)
-               log_debug("Unknown bootsource %x\n", bootsource_id);
-
-       return bootsource_id;
-}
-
 int arch_cpu_init(void)
 {
        u32 val;
index 1ce3a3b0554709549d3df7396a61df032f8c1d41..b9e7302d3b209eb2537309fdae6aefbc4734daaa 100644 (file)
@@ -33,7 +33,17 @@ __weak const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
 
 __weak u32 read_brom_bootsource_id(void)
 {
-       return readl(BROM_BOOTSOURCE_ID_ADDR);
+       u32 bootsource_id = readl(BROM_BOOTSOURCE_ID_ADDR);
+
+       /* Re-map the raw value read from reg to an existing BROM_BOOTSOURCE
+        * enum value to avoid having to create a larger boot_devices table.
+        */
+       if (bootsource_id == 0x81)
+               return BROM_BOOTSOURCE_USB;
+       else if (bootsource_id > BROM_LAST_BOOTSOURCE)
+               log_debug("Unknown bootsource %x\n", bootsource_id);
+
+       return bootsource_id;
 }
 
 const char *board_spl_was_booted_from(void)