]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
imx: spl: Fix NAND bootmode detection
authorEran Matityahu <eran.m@variscite.com>
Thu, 14 Dec 2017 18:20:02 +0000 (20:20 +0200)
committerStefano Babic <sbabic@denx.de>
Wed, 3 Jan 2018 13:01:38 +0000 (14:01 +0100)
commit 20f14714169 ("imx: spl: Update NAND bootmode detection bit")
broke the NAND bootmode detection by checking if
BOOT_CFG1[7:4] == 0x8 for NAND boot mode.
This commit essentially reverts it, while using the IMX6_BMODE_*
macros that were introduced since.

Tables 8-7 & 8-10 from IMX6DQRM say the NAND boot mode selection
is done when BOOT_CFG1[7] is 1, but BOOT_CFG1[6:4] is not
necessarily 0x0 in this case.
Actually, NAND boot mode is when 0x8 <= BOOT_CFG1[7:4] <= 0xf,
like it was in the code before.

Signed-off-by: Eran Matityahu <eran.m@variscite.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Jagan Teki <jagan@openedev.com>
Cc: Tim Harvey <tharvey@gateworks.com>
arch/arm/include/asm/mach-imx/sys_proto.h
arch/arm/mach-imx/spl.c
board/engicam/common/board.c

index 5184e0097231ca842033ab315424b23fadca5975..d518e038091ade05aeb8cdac0ee7670ab1620294 100644 (file)
@@ -81,7 +81,8 @@ enum imx6_bmode {
        IMX6_BMODE_ESD,
        IMX6_BMODE_MMC,
        IMX6_BMODE_EMMC,
-       IMX6_BMODE_NAND,
+       IMX6_BMODE_NAND_MIN,
+       IMX6_BMODE_NAND_MAX = 0xf,
 };
 
 static inline u8 imx6_is_bmode_from_gpr9(void)
index d0d1b73aa638bd12130e380b47a086e6ccaf8d55..723f51fad3d8cd99ce019d39919fdf867888453d 100644 (file)
@@ -91,7 +91,7 @@ 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_NAND_MIN ... IMX6_BMODE_NAND_MAX:
                return BOOT_DEVICE_NAND;
        }
        return BOOT_DEVICE_NONE;
index f633c719163e726c59b07d4eeac212dc882fac9e..1bdd833196739a2cc297742bf3b9457f5454813c 100644 (file)
@@ -69,7 +69,7 @@ int board_late_init(void)
 #endif
                env_set("modeboot", "mmcboot");
                break;
-       case IMX6_BMODE_NAND:
+       case IMX6_BMODE_NAND_MIN ... IMX6_BMODE_NAND_MAX:
                env_set("modeboot", "nandboot");
                break;
        default: