summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/imx8
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2020-05-05 20:28:42 +0800
committerStefano Babic <sbabic@denx.de>2020-05-10 20:55:20 +0200
commit42b26ddc80266cbe9d56526b198afed0b433bfb2 (patch)
treecaa9bf24574343f2f6a29d03fb93786a0c310a8e /arch/arm/mach-imx/imx8
parent6aead23323bee1d780fd0b9696f512194458e379 (diff)
downloadu-boot-42b26ddc80266cbe9d56526b198afed0b433bfb2.tar.gz
u-boot-42b26ddc80266cbe9d56526b198afed0b433bfb2.tar.bz2
u-boot-42b26ddc80266cbe9d56526b198afed0b433bfb2.zip
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> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch/arm/mach-imx/imx8')
-rw-r--r--arch/arm/mach-imx/imx8/cpu.c12
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 e03193cb4c..103a29746a 100644
--- a/arch/arm/mach-imx/imx8/cpu.c
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -22,6 +22,7 @@
#include <asm/armv8/mmu.h>
#include <asm/setup.h>
#include <asm/mach-imx/boot_mode.h>
+#include <spl.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -573,3 +574,14 @@ u32 get_cpu_rev(void)
return (id << 12) | rev;
}
+
+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;
+ }
+}