Skip to contentSkip to conversation

imx_common: check for bmode Serial Downloader

PATCH New Stefan Agner 2 participants 2 messages Dec 27, 2016 – Jan 27, 2017

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

PATCH 1/1 imx_common: check for bmode Serial Downloader

From: Stefan Agner <[email protected]>

Before commit 81c4eccb55cc ("imx: mx6: fix USB bmode to use reserved value") a non-reserved value has been used to trigger Serial Downloader using bmode, which translated to a GPR9 value of 0x10. However, on some boards the non-reserved value lead to unreliable bmode command. With the above mentioned commit, U-boot switched to use [7:4] b0001, which translates to GPR9 0x10 for Serial Downloader mode. Check for the new value and classify it as Serial Downloader mode.

CC Stefano Babic <[email protected]>
CC Tim Harvey <[email protected]>
CC Fabio Estevam <[email protected]>
CC Eric Nelson <[email protected]>

---

 arch/arm/imx-common/spl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/imx-common/spl.c +4 -2
index bdcda7de93..098953dce1 100644
@@ -26,8 +26,7 @@ u32 spl_boot_device(void)
 	 * 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)))
+	if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */
 		return BOOT_DEVICE_UART;
 	/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
 	switch ((reg & 0x000000FF) >> 4) {
@@ -39,6 +38,9 @@ u32 spl_boot_device(void)
 		else
 			return BOOT_DEVICE_NOR;
 		break;
+	/* Reserved: Used to force Serial Downloader */
+	case 0x1:
+		return BOOT_DEVICE_UART;
 	/* SATA: See 8.5.4, Table 8-20 */
 	case 0x2:
 		return BOOT_DEVICE_SATA;
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 imx_common: check for bmode Serial Downloader

Quoted 37 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Before commit 81c4eccb55cc ("imx: mx6: fix USB bmode to use reserved value") a non-reserved value has been used to trigger Serial Downloader using bmode, which translated to a GPR9 value of 0x10. However, on some boards the non-reserved value lead to unreliable bmode command. With the above mentioned commit, U-boot switched to use [7:4] b0001, which translates to GPR9 0x10 for Serial Downloader mode. Check for the new value and classify it as Serial Downloader mode.

CC Stefano Babic <[email protected]>
CC Tim Harvey <[email protected]>
CC Fabio Estevam <[email protected]>
CC Eric Nelson <[email protected]>

---

 arch/arm/imx-common/spl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/imx-common/spl.c +1 -2
index bdcda7de93..098953dce1 100644
@@ -26,8 +26,7 @@ u32 spl_boot_device(void)
 	 * 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)))
+	if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */
 		return BOOT_DEVICE_UART;
 	/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
 	switch ((reg & 0x000000FF) >> 4) {

arch/arm/imx-common/spl.c u32 spl_boot_device(void) · line 46

Quoted 9 lines
arch/arm/imx-common/spl.c +3 -0
@@ -39,6 +38,9 @@ u32 spl_boot_device(void)
 		else
 			return BOOT_DEVICE_NOR;
 		break;
+	/* Reserved: Used to force Serial Downloader */
+	case 0x1:
+		return BOOT_DEVICE_UART;
 	/* SATA: See 8.5.4, Table 8-20 */
 	case 0x2:
 		return BOOT_DEVICE_SATA;

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================