[PATCH v4 3/5] rockchip: rk3528: Implement read_brom_bootsource_id()

Kever Yang kever.yang at rock-chips.com
Sun Oct 26 16:40:45 CET 2025


On 2025/10/19 23:47, Jonas Karlman wrote:
> 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 at kwiboo.se>
Reviewed-by: Kever Yang <kever.yang at rock-chips.com>

Thanks,
- Kever
> ---
> v4: No change
> v3: New patch to map USB bootsource id on RK3528
> ---
>   arch/arm/mach-rockchip/rk3528/rk3528.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/rk3528/rk3528.c b/arch/arm/mach-rockchip/rk3528/rk3528.c
> index f9bfc445b857..57ead0006f1f 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;

-- 
Thanks & Best regards,
   Kever Yang
**************************************************************************************************
杨凯  市场部             Kever Yang      Marketing Department
瑞芯微电子股份有限公司                Rockchip Electronics Co.,Ltd。
地址:福建省福州市铜盘路软件大道89号软件园A区18号楼 (350003)
Addr : No.18 Building,A District,No.89,Fuzhou Software Boulevard,Fuzhou,Fujian,PRC



More information about the U-Boot mailing list