From: Ye Li Date: Tue, 19 Feb 2019 08:07:33 +0000 (-0800) Subject: MLK-20945-5 imx8: Select boot device dynamically X-Git-Tag: rel_imx_4.19.35_1.1.0~573 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=4758cf21988496ac9ad0eb19045cece970f626ff;p=u-boot.git 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 (cherry picked from commit 675cc6031033fbe5e7d8cfe01ebe1dedfd6c1b96) --- diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index 2c5ba8eb0f..b0260c522f 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -30,6 +30,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -1862,3 +1863,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 (!check_owned_resource(SC_R_FSPI_0)) + spl_boot_list[0] = BOOT_DEVICE_NOR; + } +}