[U-Boot] [PATCH 2/3] arm: i.MX6: fix nand boot device slection

Jagan Teki jagan at amarulasolutions.com
Fri Jan 5 07:05:51 UTC 2018


from i.MX6QDRM.pdf, Table 8-7 nand boot device selection
on i.MX6QDL not only depends on bit 7 of BOOT_CFG1 but other
three bits are don't care like BOOT_CFG1[7:4] should be 1xxx

So, check BOOT_CFG1[7:4] values from 8 to 0xf for nand boot
device selection in spl_boot_device

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 arch/arm/include/asm/mach-imx/sys_proto.h | 1 +
 arch/arm/mach-imx/spl.c                   | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
index 5184e00..92c953b 100644
--- a/arch/arm/include/asm/mach-imx/sys_proto.h
+++ b/arch/arm/include/asm/mach-imx/sys_proto.h
@@ -82,6 +82,7 @@ enum imx6_bmode {
 	IMX6_BMODE_MMC,
 	IMX6_BMODE_EMMC,
 	IMX6_BMODE_NAND,
+	IMX6_BMODE_NANDxxx	= 0xf,
 };
 
 static inline u8 imx6_is_bmode_from_gpr9(void)
diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index d0d1b73..2bd9048 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -90,8 +90,8 @@ u32 spl_boot_device(void)
 	case IMX6_BMODE_MMC:
 	case IMX6_BMODE_EMMC:
 		return BOOT_DEVICE_MMC1;
-	/* NAND Flash: 8.5.2, Table 8-10 */
-	case IMX6_BMODE_NAND:
+	/* NAND Flash: 8.5.2, Table 8-10, Table 8-7 CFG1[7:4] = 1xxx */
+	case IMX6_BMODE_NAND ... IMX6_BMODE_NANDxxx:
 		return BOOT_DEVICE_NAND;
 	}
 	return BOOT_DEVICE_NONE;
-- 
2.7.4



More information about the U-Boot mailing list