[U-Boot] [PATCH] mx6: Fix SPL boot device detection

Jiri Luznicky jiri at luznicky.cz
Wed Nov 29 18:13:02 UTC 2017


The boot device is selected according to BOOT_CFG1[7:4] fuse.
Any value equal or higher then 0x8 is used for nand.

Currently, only values up to 0x8 are handled by the switch.
Add rest of the values up to 0xf to cover all nand cases.

Signed-off-by: Jiri Luznicky <jiri at luznicky.cz>
Cc: Stefano Babic <sbabic at denx.de>
---
 arch/arm/include/asm/mach-imx/sys_proto.h | 9 ++++++++-
 arch/arm/mach-imx/spl.c                   | 9 ++++++++-
 board/engicam/common/board.c              | 9 ++++++++-
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
index a80a392a73..455d5e291d 100644
--- a/arch/arm/include/asm/mach-imx/sys_proto.h
+++ b/arch/arm/include/asm/mach-imx/sys_proto.h
@@ -81,7 +81,14 @@ enum imx6_bmode {
 	IMX6_BMODE_ESD,
 	IMX6_BMODE_MMC,
 	IMX6_BMODE_EMMC,
-	IMX6_BMODE_NAND,
+	IMX6_BMODE_NAND1,
+	IMX6_BMODE_NAND2,
+	IMX6_BMODE_NAND3,
+	IMX6_BMODE_NAND4,
+	IMX6_BMODE_NAND5,
+	IMX6_BMODE_NAND6,
+	IMX6_BMODE_NAND7,
+	IMX6_BMODE_NAND8,
 };
 
 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 d0d1b73aa6..a91fffad93 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -91,7 +91,14 @@ u32 spl_boot_device(void)
 	case IMX6_BMODE_EMMC:
 		return BOOT_DEVICE_MMC1;
 	/* NAND Flash: 8.5.2, Table 8-10 */
-	case IMX6_BMODE_NAND:
+	case IMX6_BMODE_NAND1:
+	case IMX6_BMODE_NAND2:
+	case IMX6_BMODE_NAND3:
+	case IMX6_BMODE_NAND4:
+	case IMX6_BMODE_NAND5:
+	case IMX6_BMODE_NAND6:
+	case IMX6_BMODE_NAND7:
+	case IMX6_BMODE_NAND8:
 		return BOOT_DEVICE_NAND;
 	}
 	return BOOT_DEVICE_NONE;
diff --git a/board/engicam/common/board.c b/board/engicam/common/board.c
index f633c71916..b70ce0b8ad 100644
--- a/board/engicam/common/board.c
+++ b/board/engicam/common/board.c
@@ -69,7 +69,14 @@ int board_late_init(void)
 #endif
 		env_set("modeboot", "mmcboot");
 		break;
-	case IMX6_BMODE_NAND:
+	case IMX6_BMODE_NAND1:
+	case IMX6_BMODE_NAND2:
+	case IMX6_BMODE_NAND3:
+	case IMX6_BMODE_NAND4:
+	case IMX6_BMODE_NAND5:
+	case IMX6_BMODE_NAND6:
+	case IMX6_BMODE_NAND7:
+	case IMX6_BMODE_NAND8:
 		env_set("modeboot", "nandboot");
 		break;
 	default:
-- 
2.11.0



More information about the U-Boot mailing list