From e05589df6f18d6417ae2463f1bd9d07daf661ffc Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 8 Aug 2017 14:41:49 -0700 Subject: 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 Acked-by: Marcel Ziswiler --- arch/arm/cpu/armv7/mx7/soc.c | 3 +++ arch/arm/include/asm/arch-mx7/imx-regs.h | 1 + arch/arm/include/asm/imx-common/boot_mode.h | 1 + 3 files changed, 5 insertions(+) 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, }; -- cgit v1.2.3