diff options
| author | Jonas Karlman <[email protected]> | 2025-10-19 15:47:17 +0000 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-02 12:14:09 -0600 |
| commit | dfe242921ef3796b32d9b68fff599d997c42a81a (patch) | |
| tree | a50f90c5b4eec8046720f3bfa86ea476103826d2 | |
| parent | 99a9b6ba6cf1c2f376e6f0ac3e6a2ced6c6addd4 (diff) | |
rockchip: rk3528: Implement read_brom_bootsource_id()
The bootsource ids reported by BootROM of RK3528 for e.g. USB differs
compared to prior SoCs:
- Booting from USB report a new bootsource id 0x81.
Add a RK3528 specific read_brom_bootsource_id() function to help decode
this new bootsource id value to help support booting from USB on RK3528.
Signed-off-by: Jonas Karlman <[email protected]>
Reviewed-by: Kever Yang <[email protected]>
| -rw-r--r-- | arch/arm/mach-rockchip/rk3528/rk3528.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/rk3528/rk3528.c b/arch/arm/mach-rockchip/rk3528/rk3528.c index f9bfc445b85..57ead0006f1 100644 --- a/arch/arm/mach-rockchip/rk3528/rk3528.c +++ b/arch/arm/mach-rockchip/rk3528/rk3528.c @@ -49,6 +49,21 @@ 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; |
