[PATCH v2 2/2] ARM: i.MX: riotboard: switch to imx6q_barebox_entry

Ahmad Fatoum a.fatoum at pengutronix.de
Mon May 11 06:48:58 PDT 2026


Hi,

On 5/11/26 3:32 PM, Fabian Pflug wrote:
> Make use of the imx6q_barebox_entry instead of calling
> barebox_arm_entry directly, which allows us to profit from optional
> OP-TEE loading in this function.
> Always setup UART, in case OP-TEE gets integrated, which will crash if
> the UART is not configured correctly and debug is enabled.
> Since now a bit more functions are called, we use
> relocate_to_current_adr instead of get_runtime_offset.
> 
> This should not change behaviour of current implementations, but makes
> way for OP-TEE implementations.
> 
> Signed-off-by: Fabian Pflug <f.pflug at pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>

Minor comment below:

> -ENTRY_FUNCTION(start_imx6s_riotboard, r0, r1, r2)
> +static noinline void continue_imx6s_riotboard(void)
>  {
> -	void *fdt;
> +	void __iomem *iomuxbase = IOMEM(MX6_IOMUXC_BASE_ADDR);
>  
> -	imx6_cpu_lowlevel_init();
> +	writel(0x4, iomuxbase + 0x016c);
> +
> +	imx6_ungate_all_peripherals();
> +	// if uart ist not set-up, then OP-TEE will fail if debugging is enabled.
> +	imx6_uart_setup(IOMEM(MX6_UART2_BASE_ADDR));
>  
>  	if (IS_ENABLED(CONFIG_DEBUG_LL)) {

This if claude can be removed.

> -		/*
> -		 * CONFIG_DEBUG_IMX6Q_UART=y
> -		 * CONFIG_DEBUG_IMX_UART_PORT=2
> -		 */
> -		writel(0x4, 0x020e016c);
> -		imx6_ungate_all_peripherals();
> -		imx6_uart_setup_ll();
> -		putc_ll('a');
> +		pbl_set_putc(imx_uart_putc, IOMEM(MX6_UART2_BASE_ADDR));

This is useful to have independently of DEBUG_LL

> +		putc_ll('>');

This is already a no-op if !IS_ENABLED(CONFIG_DEBUG_LL)

Cheers,
Ahmad

>  	}
>  
> -	fdt = __dtb_imx6s_riotboard_start + get_runtime_offset();
> -	barebox_arm_entry(0x10000000, SZ_1G, fdt);
> +	imx6q_barebox_entry(__dtb_imx6s_riotboard_start);
> +}
> +
> +ENTRY_FUNCTION(start_imx6s_riotboard, r0, r1, r2)
> +{
> +	imx6_cpu_lowlevel_init();
> +
> +	relocate_to_current_adr();
> +	setup_c();
> +
> +	continue_imx6s_riotboard();
>  }
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list