[PATCH] colibri-imx8x: Fix sc_misc_otp_fuse_read() error check

Marcel Ziswiler marcel.ziswiler at toradex.com
Wed Mar 13 09:09:17 CET 2024


Hi Fabio

Thanks!

On Tue, 2024-03-12 at 21:36 -0300, Fabio Estevam wrote:
> Commit aa6e698a7acd ("imx: toradex/colibri-imx8x: correct SCU API usage")
> made an incorrect logic change in the error code check of
> sc_misc_otp_fuse_read():
> 
> -       if (sc_err == SC_ERR_NONE) {
> +       if (sc_err) {
>                 /* DX has two A35 cores disabled */
>                 return (val & 0xf) != 0x0;
>         }
> 
> The other changes in this commit are correct.
> 
> sc_misc_otp_fuse_read() returns 0 on a successful fuse read.
> 
> This inversion causes board_mem_get_layout() to report incorrect RAM size.
> 
> Go back the original error check logic to fix the problem.
> 
> Fixes: aa6e698a7acd ("imx: toradex/colibri-imx8x: correct SCU API usage")
> Reported-by: Hiago De Franco <hiago.franco at toradex.com>
> Signed-off-by: Fabio Estevam <festevam at gmail.com>

Acked-by: Marcel Ziswiler <marcel.ziswiler at toradex.com>

> diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c
> index 2c673a4a6b06..6fc8076163c6 100644
> --- a/board/toradex/colibri-imx8x/colibri-imx8x.c
> +++ b/board/toradex/colibri-imx8x/colibri-imx8x.c
> @@ -46,7 +46,7 @@ static int is_imx8dx(void)
>  	u32 val = 0;
>  	int sc_err = sc_misc_otp_fuse_read(-1, 6, &val);
>  
> -	if (sc_err) {
> +	if (!sc_err) {
>  		/* DX has two A35 cores disabled */
>  		return (val & 0xf) != 0x0;
>  	}

Cheers

Marcel


More information about the U-Boot mailing list