summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2017-08-08 14:41:49 -0700
committerStefan Agner <stefan.agner@toradex.com>2017-08-31 19:57:37 -0700
commite05589df6f18d6417ae2463f1bd9d07daf661ffc (patch)
treedd929480571f7a303f46140cab1946ccce0a550d
parent3f4cddb4c46dae818ae7fffc5b692128b2b73e67 (diff)
imx: imx7: detect USB serial download protocol boot mode
The i.MX 7 boot ROM provides a structure with boot information. The reference manual (chapter 6.6.14 Boot Information for Software in the RM) only lists 6 boot devices, but tests have shown that the boot device type is consistently 0xf in case the SoC has been booted through USB Serial Downloader. Create a new boot mode for the USB Serial Download Protocol (SDP). Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--arch/arm/cpu/armv7/mx7/soc.c3
-rw-r--r--arch/arm/include/asm/arch-mx7/imx-regs.h1
-rw-r--r--arch/arm/include/asm/imx-common/boot_mode.h1
3 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/mx7/soc.c b/arch/arm/cpu/armv7/mx7/soc.c
index 5ea03a3d2b..f2d0937aa8 100644
--- a/arch/arm/cpu/armv7/mx7/soc.c
+++ b/arch/arm/cpu/armv7/mx7/soc.c
@@ -432,6 +432,9 @@ enum boot_device get_boot_device(void)
case BOOT_TYPE_SPINOR:
boot_dev = SPI_NOR_BOOT;
break;
+ case BOOT_TYPE_USB_SDP:
+ boot_dev = USB_SDP_BOOT;
+ break;
default:
break;
}
diff --git a/arch/arm/include/asm/arch-mx7/imx-regs.h b/arch/arm/include/asm/arch-mx7/imx-regs.h
index d33be313c6..a97a2f420f 100644
--- a/arch/arm/include/asm/arch-mx7/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx7/imx-regs.h
@@ -1213,6 +1213,7 @@ extern void pcie_power_off(void);
#define BOOT_TYPE_QSPI 0x4
#define BOOT_TYPE_WEIM 0x5
#define BOOT_TYPE_SPINOR 0x6
+#define BOOT_TYPE_USB_SDP 0xf
struct bootrom_sw_info {
u8 reserved_1;
diff --git a/arch/arm/include/asm/imx-common/boot_mode.h b/arch/arm/include/asm/imx-common/boot_mode.h
index a8239f2f7a..896a129c7a 100644
--- a/arch/arm/include/asm/imx-common/boot_mode.h
+++ b/arch/arm/include/asm/imx-common/boot_mode.h
@@ -26,6 +26,7 @@ enum boot_device {
MMC4_BOOT,
NAND_BOOT,
QSPI_BOOT,
+ USB_SDP_BOOT,
UNKNOWN_BOOT,
BOOT_DEV_NUM = UNKNOWN_BOOT,
};