rockchip: spl: Add a read_brom_bootsource_id() helper
authorJonas Karlman <jonas@kwiboo.se>
Sun, 19 Oct 2025 15:47:16 +0000 (15:47 +0000)
committerTom Rini <trini@konsulko.com>
Sun, 2 Nov 2025 18:14:09 +0000 (12:14 -0600)
commit99a9b6ba6cf1c2f376e6f0ac3e6a2ced6c6addd4
tree534b295ffc6b85e1a14e7fd44e19d1f4f6ef0e13
parentc769855be2579ceba6c83e03aeccb27fa618655d
rockchip: spl: Add a read_brom_bootsource_id() helper

The bootsource ids reported by BootROM of RK3528 and RK3576 for e.g.
SPI NOR and USB differs slightly compared to prior SoCs:

- Booting from sfc0 (ROCK 4D) report the normal bootsource id 0x3.
- Booting from sfc1 M1 (NanoPi M5) report a new bootsource id 0x23.
- Booting from sfc1 M0 has not been tested (no board using this config).
- Booting from USB report a new bootsource id 0x81 on RK3528 and RK3576.

Add a helper function to read the bootsource id. This helper function
will be used to translate the new values to the common BROM_BOOTSOURCE
enum values on RK3528 and RK3576.

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