ARM: imx: Add bmode support for iMX7

Add the basic differentiation between i.MX6 and i.MX7 into the bmode
command, the mechanism really works almost the same on both platforms.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
diff --git a/arch/arm/mach-imx/init.c b/arch/arm/mach-imx/init.c
index 693b724..e30d63b 100644
--- a/arch/arm/mach-imx/init.c
+++ b/arch/arm/mach-imx/init.c
@@ -103,14 +103,20 @@
 #ifdef CONFIG_CMD_BMODE
 void boot_mode_apply(unsigned cfg_val)
 {
-	unsigned reg;
+#ifdef CONFIG_MX6
+	const u32 bmode = IMX6_SRC_GPR10_BMODE;
+#elif CONFIG_MX7
+	const u32 bmode = IMX7_SRC_GPR10_BMODE;
+#endif
 	struct src *psrc = (struct src *)SRC_BASE_ADDR;
+	unsigned reg;
+
 	writel(cfg_val, &psrc->gpr9);
 	reg = readl(&psrc->gpr10);
 	if (cfg_val)
-		reg |= IMX6_SRC_GPR10_BMODE;
+		reg |= bmode;
 	else
-		reg &= ~IMX6_SRC_GPR10_BMODE;
+		reg &= ~bmode;
 	writel(reg, &psrc->gpr10);
 }
 #endif