public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Emanuele Ghidoli <ghidoliemanuele@gmail.com>
To: "Simona Toaca (OSS)" <simona.toaca@oss.nxp.com>,
	uboot-imx@nxp.com, u-boot@lists.denx.de
Cc: Stefano Babic <sbabic@nabladev.com>,
	festevam@gmail.com, peng.fan@nxp.com, alice.guo@nxp.com,
	ye.li@nxp.com, simona.toaca@nxp.com, viorel.suman@nxp.com,
	marex@nabladev.com, ravi@prevas.dk, fedor.ross@ifm.com,
	sebastien.szymanski@armadeus.com, joao.goncalves@toradex.com,
	ji.luo@nxp.com, semen.protsenko@linaro.org, sjg@chromium.org,
	tharvey@gateworks.com, ping.bai@nxp.com, qijian.guo@nxp.com
Subject: Re: [PATCH 4/5] board: nxp: imx9{4,5}_evk: Add qb save option in SPL
Date: Tue, 10 Mar 2026 16:04:19 +0100	[thread overview]
Message-ID: <34d4475a-8353-47c9-86fe-36e67ceecb69@gmail.com> (raw)
In-Reply-To: <bd23b79dc06f39a9f19ee3da956de450aad03aaf.1773137310.git.simona.toaca@nxp.com>



On 3/10/26 12:54, Simona Toaca (OSS) wrote:
> From: Simona Toaca <simona.toaca@nxp.com>
> 
> Call qb save automatically in the board-specific
> spl_board_init(), if SPL_QB option is enabled. This
> makes sure qb_save is called before any image loading
> is done by the SPL.
> 
> Signed-off-by: Simona Toaca <simona.toaca@nxp.com>
> ---
>  arch/arm/include/asm/mach-imx/qb.h | 2 ++
>  arch/arm/mach-imx/Kconfig          | 7 +++++++
>  arch/arm/mach-imx/imx9/Makefile    | 4 +++-
>  arch/arm/mach-imx/imx9/qb.c        | 9 +++++++++
>  board/nxp/imx94_evk/spl.c          | 6 +++++-
>  board/nxp/imx95_evk/spl.c          | 6 +++++-
>  6 files changed, 31 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/include/asm/mach-imx/qb.h b/arch/arm/include/asm/mach-imx/qb.h
> index 5efe68f0a60..4f923d79e7a 100644
> --- a/arch/arm/include/asm/mach-imx/qb.h
> +++ b/arch/arm/include/asm/mach-imx/qb.h
> @@ -10,4 +10,6 @@
>  
>  bool qb_check(void);
>  int  qb(int qb_dev, int qb_bootdev, bool save);
> +void spl_qb_save(void);
> +
>  #endif
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index 17aad696648..069b25c6241 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -71,6 +71,13 @@ config CSF_SIZE
>  	  Define the maximum size for Command Sequence File (CSF) binary
>  	  this information is used to define the image boot data.
>  
> +config SPL_IMX_QB
> +	bool "Run qb save during SPL"
> +	default n
> +	depends on SPL && IMX_SNPS_DDR_PHY_QB_GEN && (IMX95 || IMX94)
> +	help
> +	  Run qb save on bootdev automatically during SPL.
> +
>  config CMD_IMX_QB
>  	bool "Support the 'qb' command"
>  	default y
> diff --git a/arch/arm/mach-imx/imx9/Makefile b/arch/arm/mach-imx/imx9/Makefile
> index 7dee144e0f4..3207013812a 100644
> --- a/arch/arm/mach-imx/imx9/Makefile
> +++ b/arch/arm/mach-imx/imx9/Makefile
> @@ -15,7 +15,9 @@ obj-y += imx_bootaux.o
>  endif
>  
>  ifeq ($(CONFIG_IMX_SNPS_DDR_PHY_QB_GEN),y)
> -ifneq ($(CONFIG_XPL_BUILD),y)
> +ifeq ($(CONFIG_XPL_BUILD),y)
> +obj-$(CONFIG_SPL_IMX_QB) += qb.o
> +else
>  obj-$(CONFIG_CMD_IMX_QB) += qb.o
>  endif
>  endif
> diff --git a/arch/arm/mach-imx/imx9/qb.c b/arch/arm/mach-imx/imx9/qb.c
> index fc01d8e22e9..79573741d39 100644
> --- a/arch/arm/mach-imx/imx9/qb.c
> +++ b/arch/arm/mach-imx/imx9/qb.c
> @@ -428,3 +428,12 @@ int qb(int qb_dev, int qb_bootdev, bool save)
>  
>  	return 0;
>  }
> +
> +void spl_qb_save(void)
> +{
> +	int dev = spl_boot_device();
> +
> +	/** Save QB data on current boot device */
> +	if (qb(dev, dev, true))
> +		printf("QB save failed\n");
> +}
> diff --git a/board/nxp/imx94_evk/spl.c b/board/nxp/imx94_evk/spl.c
> index cc5b7f9ef0f..1d25795eb17 100644
> --- a/board/nxp/imx94_evk/spl.c
> +++ b/board/nxp/imx94_evk/spl.c
> @@ -1,6 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0+
>  /*
> - * Copyright 2025 NXP
> + * Copyright 2025-2026 NXP
>   */
>  
>  #include <hang.h>
> @@ -14,6 +14,7 @@
>  #include <asm/arch/sys_proto.h>
>  #include <asm/mach-imx/boot_mode.h>
>  #include <asm/mach-imx/ele_api.h>
> +#include <asm/mach-imx/qb.h>
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -44,6 +45,9 @@ void spl_board_init(void)
>  	ret = ele_start_rng();
>  	if (ret)
>  		printf("Fail to start RNG: %d\n", ret);
> +
> +	if (IS_ENABLED(CONFIG_SPL_IMX_QB))
> +		spl_qb_save();
Does it write to MMC/NOR/SD at every boot? Is that necessary if a quick boot
was performed and the data has not changed?
>  }
>  
>  /* SCMI support by default */
> diff --git a/board/nxp/imx95_evk/spl.c b/board/nxp/imx95_evk/spl.c
> index 761a1a4a0f6..35e4458f2b7 100644
> --- a/board/nxp/imx95_evk/spl.c
> +++ b/board/nxp/imx95_evk/spl.c
> @@ -1,6 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0+
>  /*
> - * Copyright 2025 NXP
> + * Copyright 2025-2026 NXP
>   */
>  
>  #include <hang.h>
> @@ -13,6 +13,7 @@
>  #include <asm/arch/sys_proto.h>
>  #include <asm/mach-imx/boot_mode.h>
>  #include <asm/mach-imx/ele_api.h>
> +#include <asm/mach-imx/qb.h>
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -41,6 +42,9 @@ void spl_board_init(void)
>  	ret = ele_start_rng();
>  	if (ret)
>  		printf("Fail to start RNG: %d\n", ret);
> +
> +	if (IS_ENABLED(CONFIG_SPL_IMX_QB))
> +		spl_qb_save();
>  }
>  
>  void board_init_f(ulong dummy)

Kind regards,
Emanuele


  reply	other threads:[~2026-03-10 15:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 11:54 [PATCH 0/5] imx9{4,5}: Add Quickboot support Simona Toaca (OSS)
2026-03-10 11:54 ` [PATCH 1/5] imx9: Add support for saving DDR training data to NVM Simona Toaca (OSS)
2026-03-10 11:54 ` [PATCH 2/5] arm: mach-imx: Add command to expose QB functionality Simona Toaca (OSS)
2026-03-10 11:54 ` [PATCH 3/5] imx9: Enable QB data saving for iMX9{4,5} EVK Simona Toaca (OSS)
2026-03-10 11:54 ` [PATCH 4/5] board: nxp: imx9{4,5}_evk: Add qb save option in SPL Simona Toaca (OSS)
2026-03-10 15:04   ` Emanuele Ghidoli [this message]
2026-03-10 15:27     ` Simona Toaca
2026-03-11  9:14       ` Francesco Dolcini
2026-03-11 14:58         ` Simona Toaca
2026-03-10 16:12   ` Fabio Estevam
2026-03-11  7:54     ` Simona Toaca
2026-03-10 11:54 ` [PATCH 5/5] doc: board: nxp: Add Quickboot documentation Simona Toaca (OSS)
2026-03-11 15:42 ` [PATCH 0/5] imx9{4,5}: Add Quickboot support Marek Vasut
2026-03-12 11:47   ` Simona Toaca
2026-03-12 13:20     ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34d4475a-8353-47c9-86fe-36e67ceecb69@gmail.com \
    --to=ghidoliemanuele@gmail.com \
    --cc=alice.guo@nxp.com \
    --cc=fedor.ross@ifm.com \
    --cc=festevam@gmail.com \
    --cc=ji.luo@nxp.com \
    --cc=joao.goncalves@toradex.com \
    --cc=marex@nabladev.com \
    --cc=peng.fan@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=qijian.guo@nxp.com \
    --cc=ravi@prevas.dk \
    --cc=sbabic@nabladev.com \
    --cc=sebastien.szymanski@armadeus.com \
    --cc=semen.protsenko@linaro.org \
    --cc=simona.toaca@nxp.com \
    --cc=simona.toaca@oss.nxp.com \
    --cc=sjg@chromium.org \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=viorel.suman@nxp.com \
    --cc=ye.li@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox