[PATCH v3 4/6] board: nxp: imx9{4, 5, 52}_evk: Add qb save option in SPL
Simona Toaca (OSS)
simona.toaca at oss.nxp.com
Thu Apr 2 11:40:46 CEST 2026
From: Simona Toaca <simona.toaca at nxp.com>
Call qb save automatically in the board-specific
spl_board_init(), if SPL_IMX_QB option is enabled.
This makes sure qb_save is called before any image
loading is done by the SPL. This option is also
suitable for the case where U-Boot proper is
missing (Falcon mode).
qb save refers to saving DDR training data to NVM,
so that OEI runs Quickboot flow on next reboot,
skipping full training and achieveing a lower boot
time.
Signed-off-by: Simona Toaca <simona.toaca at nxp.com>
---
arch/arm/mach-imx/Kconfig | 8 ++++++++
arch/arm/mach-imx/imx9/Makefile | 4 +++-
board/nxp/imx94_evk/spl.c | 6 +++++-
board/nxp/imx952_evk/spl.c | 4 ++++
board/nxp/imx95_evk/spl.c | 6 +++++-
5 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 48266cfd6e2..3fb8ebb886c 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -71,6 +71,14 @@ 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"
+ depends on SPL && (IMX94 || IMX95 || IMX952)
+ help
+ Automatically save DDR training data (Quickboot data)
+ to current boot device when needed (when OEI runs Training
+ flow and saves qb data to volatile memory).
+
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 3e323a714c1..8b01897b928 100644
--- a/arch/arm/mach-imx/imx9/Makefile
+++ b/arch/arm/mach-imx/imx9/Makefile
@@ -14,6 +14,8 @@ ifneq ($(CONFIG_SPL_BUILD),y)
obj-y += imx_bootaux.o
endif
-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
diff --git a/board/nxp/imx94_evk/spl.c b/board/nxp/imx94_evk/spl.c
index 6eb0fff99f4..df583c9adf0 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();
}
static void xspi_nor_reset(void)
diff --git a/board/nxp/imx952_evk/spl.c b/board/nxp/imx952_evk/spl.c
index de9256dc267..d497597625f 100644
--- a/board/nxp/imx952_evk/spl.c
+++ b/board/nxp/imx952_evk/spl.c
@@ -8,6 +8,7 @@
#include <asm/gpio.h>
#include <asm/mach-imx/boot_mode.h>
#include <asm/mach-imx/ele_api.h>
+#include <asm/mach-imx/qb.h>
#include <asm/sections.h>
#include <hang.h>
#include <init.h>
@@ -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();
}
static void xspi_nor_reset(void)
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)
--
2.43.0
More information about the U-Boot
mailing list