[PATCH 1/2] imx: Add SPI NOR A/B switching support
Ye Li
ye.li at oss.nxp.com
Tue Apr 28 04:05:10 CEST 2026
On 4/23/2026 7:54 PM, fedor.ross at ifm.com wrote:
> From: Marek Vasut <marex at nabladev.com>
>
> Query the SM via SCMI, obtain rom_passover_t->img_set_sel and based on
> that, add 0 or 0x400000 offset (A or B copy offset) to boot container
> read address.
>
> Signed-off-by: Marek Vasut <marex at nabladev.com>
> Signed-off-by: Fedor Ross <fedor.ross at ifm.com>
> ---
> arch/arm/mach-imx/image-container.c | 10 ++++++++++
> arch/arm/mach-imx/imx9/scmi/soc.c | 13 +++++++++++++
> 2 files changed, 23 insertions(+)
>
> diff --git a/arch/arm/mach-imx/image-container.c b/arch/arm/mach-imx/image-container.c
> index 7bfcc9d7e9d..eeea0b80b39 100644
> --- a/arch/arm/mach-imx/image-container.c
> +++ b/arch/arm/mach-imx/image-container.c
> @@ -204,6 +204,8 @@ static int get_dev_container_size(void *dev, int dev_type, unsigned long offset,
> return ret;
> }
>
> +extern u8 imx95_detect_secondary_image_boot(void);
> +
> static bool check_secondary_cnt_set(unsigned long *set_off)
> {
> #if IS_ENABLED(CONFIG_ARCH_IMX8)
> @@ -227,6 +229,14 @@ static bool check_secondary_cnt_set(unsigned long *set_off)
> }
> #endif
>
> +#if IS_ENABLED(CONFIG_IMX95)
> + u8 img_set_sel = imx95_detect_secondary_image_boot();
> +
> + *set_off = img_set_sel ? 0x400000 : 0;
> +
> + return !!img_set_sel;
> +#endif
Using 4MB offset is not correct for secondary boot.
1. This offset is configurable by fuse
2. Different device may vary
So better method is using the img offset from rom passover data.
Also this change should not apply to IMX95 only, but include IMX9
platforms like 943 and 952 which are enabling SCMI.
I plan to upstream the secondary boot support from NXP downstream. Do
you mind wait my patches?
Best regards,
Ye Li
> +
> return false;
> }
>
> diff --git a/arch/arm/mach-imx/imx9/scmi/soc.c b/arch/arm/mach-imx/imx9/scmi/soc.c
> index fbee435786c..330b276b23a 100644
> --- a/arch/arm/mach-imx/imx9/scmi/soc.c
> +++ b/arch/arm/mach-imx/imx9/scmi/soc.c
> @@ -745,6 +745,19 @@ void build_info(void)
> puts("\n");
> }
>
> +#if IS_ENABLED(CONFIG_IMX95)
> +u8 imx95_detect_secondary_image_boot(void)
> +{
> + rom_passover_t rdata = { 0 };
> + int ret = scmi_get_rom_data(&rdata);
> +
> + if (!ret)
> + return rdata.img_set_sel;
> +
> + return 0;
> +}
> +#endif
> +
> int arch_misc_init(void)
> {
> build_info();
>
More information about the U-Boot
mailing list