diff options
author | Ye Li <ye.li@nxp.com> | 2019-02-19 00:07:33 -0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2020-04-26 23:24:12 -0700 |
commit | 6e103c5b9279588052346601abc8c10e310f9b5d (patch) | |
tree | 629490795c087fff43abcac3c5fb10ee31b11619 | |
parent | d73e32581a2826a08642cbb2a476566a6611c2dc (diff) |
MLK-20945-5 imx8: Select boot device dynamically
For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 675cc6031033fbe5e7d8cfe01ebe1dedfd6c1b96)
(cherry picked from commit 4758cf21988496ac9ad0eb19045cece970f626ff)
-rw-r--r-- | arch/arm/mach-imx/imx8/cpu.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index 4f54f14018d..65740c65e6d 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -27,6 +27,7 @@ #include <asm/setup.h> #include <asm/mach-imx/boot_mode.h> #include <asm/mach-imx/imx_vservice.h> +#include <spl.h> DECLARE_GLOBAL_DATA_PTR; @@ -1024,3 +1025,14 @@ int board_imx_lpi2c_bind(struct udevice *dev) return -ENODEV; } + +void board_boot_order(u32 *spl_boot_list) +{ + spl_boot_list[0] = spl_boot_device(); + + if (spl_boot_list[0] == BOOT_DEVICE_SPI) { + /* Check whether we own the flexspi0, if not, use NOR boot */ + if (!sc_rm_is_resource_owned(-1, SC_R_FSPI_0)) + spl_boot_list[0] = BOOT_DEVICE_NOR; + } +} |