]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
board: nxp: imx9{4, 5, 52}_evk: Add qb save option in SPL
authorSimona Toaca <simona.toaca@nxp.com>
Thu, 30 Apr 2026 08:33:32 +0000 (11:33 +0300)
committerFabio Estevam <festevam@gmail.com>
Fri, 15 May 2026 20:31:39 +0000 (17:31 -0300)
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@nxp.com>
arch/arm/mach-imx/Kconfig
board/nxp/imx94_evk/spl.c
board/nxp/imx952_evk/spl.c
board/nxp/imx95_evk/spl.c

index a40baf246314e1af5e0bd16a64a45a0f8c144729..66142a835ce9a22b769a04e404a1491da56e086f 100644 (file)
@@ -80,6 +80,14 @@ config IMX_QB
          memory to non-volatile storage. OEI uses the saved data to
          run Quickboot flow and skip re-training the DDR PHY.
 
+config SPL_IMX_QB
+       bool "Run qb save during SPL"
+       depends on SPL && IMX_QB
+       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
index 6eb0fff99f4690070d89fe25564746ed5579c320..739a5f1f5594cfce8bd1ae900500eada44817ea3 100644 (file)
@@ -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_imx_qb_save();
 }
 
 static void xspi_nor_reset(void)
index de9256dc2674826dc6f6e430a60b51196d0daada..615c3b67fb6642683ad1976fe5c40b0560f60e60 100644 (file)
@@ -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_imx_qb_save();
 }
 
 static void xspi_nor_reset(void)
index 761a1a4a0f6b9f5d72bcbfcc7cd1aac43dd0dae1..2fd69447e1e7cd1f04bca62ecde52769a8dedc75 100644 (file)
@@ -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_imx_qb_save();
 }
 
 void board_init_f(ulong dummy)