Skip to contentSkip to conversation

imx_common: check for Serial Downloader in spl_boot_device

PATCH New Stefano Babic 1 participant 1 message Dec 11, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 imx_common: check for Serial Downloader in spl_boot_device

Check for bmode before reading the boot device to check if a serial downloader is started, and returns UART if the serial downloader is set, letting SPL to wait for an image if CONFIG_SPL_YMODEM_SUPPORT is set.

This allows to load again a SPL based board with imx_usb_loader together with a tool such as kermit.

---

Changes in v3:
- fix (1 == reg)
- rephrase some documentation (E.Nelson)

Changes in v2:
- Add documentation (S. Roese)
- Check just bits 24-25 because reserved bits are set on some variants (E. Nelson)
- Set boot device to UART if USB is set to let bmode working as suggested by Eric

 arch/arm/imx-common/spl.c |  8 ++++++++
 doc/README.imx6           | 51 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
arch/arm/imx-common/spl.c +8 -0
index ac6e40e..caa45cf 100644
@@ -20,7 +20,15 @@ u32 spl_boot_device(void)
 	struct src *psrc = (struct src *)SRC_BASE_ADDR;
 	unsigned int gpr10_boot = readl(&psrc->gpr10) & (1 << 28);
 	unsigned reg = gpr10_boot ? readl(&psrc->gpr9) : readl(&psrc->sbmr1);
+	unsigned int bmode = readl(&psrc->sbmr2);
 
+	/*
+	 * Check for BMODE if serial downloader is enabled
+	 * BOOT_MODE - see IMX6DQRM Table 8-1
+	 */
+	if ((((bmode >> 24) & 0x03)  == 0x01) || /* Serial Downloader */
+		(gpr10_boot && (reg == 1)))
+		return BOOT_DEVICE_UART;
 	/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
 	switch ((reg & 0x000000FF) >> 4) {
 	 /* EIM: See 8.5.1, Table 8-9 */
doc/README.imx6 +51 -0

54 lines not on this page · raw message

Signature · 1 line
1.9.1