On Fri, Jul 31, 2026 at 9:11 PM Alexey Charkov <[email protected]> wrote:
>
> Common code calls into a platform specific function to determine whether
> to attempt OS boot in Falcon mode.
>
> There is currently no platform logic to drive that decision on Rockchip,
> so attempt Falcon mode boot whenever it is enabled in the configuration.
>
> This can be overridden by board code if needed with appropriate logic, such
> as checking for a button state to skip Falcon mode boot when pressed.
>
> Signed-off-by: Alexey Charkov <[email protected]>
> ---
>  arch/arm/mach-rockchip/spl.c | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
> index e989c148079a..54dec06737e1 100644
> --- a/arch/arm/mach-rockchip/spl.c
> +++ b/arch/arm/mach-rockchip/spl.c
> @@ -153,6 +153,35 @@ void spl_board_prepare_for_boot(void)
>         cleanup_before_linux();
>  }
>
> +#if CONFIG_IS_ENABLED(OS_BOOT)
> +/**
> + * board_spl_start_uboot() - decides whether to boot the OS or U-Boot proper
> + *
> + * If Falcon mode (direct Linux boot via TF-A from SPL) is selected via 
> config,
> + * try booting to Linux first, with automatic fallback to U-Boot if it fails 
> to
> + * load. Boards that want to implement conditional U-Boot/Linux selection 
> logic
> + * override this, for instance to look at a button.
> + *
> + * Returns
> + *   0 to boot the OS directly
> + *   1 to boot U-Boot proper
> + */
> +__weak int board_spl_start_uboot(void)
> +{
> +       return 0;
> +}
> +
> +/*
> + * This overrides the weak default in common/spl/spl.c, so it must not itself
> + * be weak: two weak definitions of the same symbol would leave the choice
> + * between them up to archive link order.
> + */
> +int spl_start_uboot(void)
> +{
> +       return board_spl_start_uboot();
> +}
> +#endif

CI world build highlighted [1] that some older Rockchip boards such as
amarula/vyasa-rk3288 already define this function [2] for their
"classic" Falcon (non-TF-A), causing double definition and failing
link.

I will fix it up in v3. Review of the other parts of this series would
still be appreciated.

[1] 
https://git.u-boot-project.org/u-boot/contributors/alchark/u-boot/-/jobs/57280
[2] 
https://git.u-boot-project.org/u-boot/u-boot/-/blob/main/board/amarula/vyasa-rk3288/vyasa-rk3288.c?ref_type=heads#L10

Best regards,
Alexey

Reply via email to