forked from OERV-BSP/u-boot
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 <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user