[PATCH 4/5] spl: imx8m: add QSPI boot dev

Peng Fan peng.fan at nxp.com
Tue May 12 11:44:03 CEST 2020


When boot type could not be detected from rom sw info,
read sbmr1 to detect, here we only use it to detect FLEXSPI
boot, because ROM not update it in rom sw info.

Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 arch/arm/mach-imx/cpu.c | 6 ++++--
 arch/arm/mach-imx/spl.c | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c
index 515c1fea40..5305ad9761 100644
--- a/arch/arm/mach-imx/cpu.c
+++ b/arch/arm/mach-imx/cpu.c
@@ -434,12 +434,14 @@ enum boot_device get_boot_device(void)
 	case BOOT_TYPE_SPINOR:
 		boot_dev = SPI_NOR_BOOT;
 		break;
-#ifdef CONFIG_IMX8M
 	case BOOT_TYPE_USB:
 		boot_dev = USB_BOOT;
 		break;
-#endif
 	default:
+#ifdef CONFIG_IMX8M
+		if (((readl(SRC_BASE_ADDR + 0x58) & 0x00007FFF) >> 12) == 0x4)
+			boot_dev = QSPI_BOOT;
+#endif
 		break;
 	}
 
diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index 585a5e8bae..12cb85c2ab 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -170,6 +170,8 @@ u32 spl_boot_device(void)
 		return BOOT_DEVICE_NAND;
 	case SPI_NOR_BOOT:
 		return BOOT_DEVICE_SPI;
+	case QSPI_BOOT:
+		return BOOT_DEVICE_NOR;
 	case USB_BOOT:
 		return BOOT_DEVICE_BOARD;
 	default:
-- 
2.16.4



More information about the U-Boot mailing list