From d34f48bb69f50309abe452f23c7bb4371635eb4f Mon Sep 17 00:00:00 2001
From: Anish Trivedi <anish@freescale.com>
Date: Thu, 3 Nov 2011 11:56:01 -0500
Subject: ENGR00161354 MX6Q ARM2 U_BOOT: "mmc dev 0" or "mmc dev 1" cmds will
 hang

Ungate the clocks to SD1 and SD2 ports (on baseboard of ARM2 system)
so that the above cmds do not hang waiting for cmd to complete or
timeout.

Signed-off-by: Anish Trivedi <anish@freescale.com>
---
 board/freescale/mx6q_arm2/lowlevel_init.S |  2 +-
 board/freescale/mx6q_arm2/mx6q_arm2.c     | 14 +++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

(limited to 'board/freescale')

diff --git a/board/freescale/mx6q_arm2/lowlevel_init.S b/board/freescale/mx6q_arm2/lowlevel_init.S
index 2ac77b9..882f62a 100644
--- a/board/freescale/mx6q_arm2/lowlevel_init.S
+++ b/board/freescale/mx6q_arm2/lowlevel_init.S
@@ -143,7 +143,7 @@ d_inv_loop:
 	str r1, [r0, #CLKCTL_CCGR4]
 	ldr r1, =0xF0000C3
 	str r1, [r0, #CLKCTL_CCGR5]
-	ldr r1, =0x3C0
+	ldr r1, =0x3FC
 	str r1, [r0, #CLKCTL_CCGR6]
 .endm
 
diff --git a/board/freescale/mx6q_arm2/mx6q_arm2.c b/board/freescale/mx6q_arm2/mx6q_arm2.c
index bbc5ea8..d97f7b8 100644
--- a/board/freescale/mx6q_arm2/mx6q_arm2.c
+++ b/board/freescale/mx6q_arm2/mx6q_arm2.c
@@ -110,9 +110,9 @@ static inline void setup_boot_device(void)
 		break;
 	case 0x3:
 		if (bt_mem_type)
-			boot_dev = SPI_NOR_BOOT;
-		else
 			boot_dev = I2C_BOOT;
+		else
+			boot_dev = SPI_NOR_BOOT;
 		break;
 	case 0x4:
 	case 0x5:
@@ -479,8 +479,12 @@ int get_mmc_env_devno(void)
 {
 	uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4);
 
-	/* BOOT_CFG2[3] and BOOT_CFG2[4] */
-	return (soc_sbmr & 0x00001800) >> 11;
+	if (SD_BOOT == boot_dev || MMC_BOOT == boot_dev) {
+		/* BOOT_CFG2[3] and BOOT_CFG2[4] */
+		return (soc_sbmr & 0x00001800) >> 11;
+	} else
+		return -1;
+
 }
 #endif
 
@@ -851,7 +855,7 @@ int checkboard(void)
 	default:
 		printf("unknown");
 	}
-	printf("]\n");
+	printf(" ]\n");
 
 	printf("Boot Device: ");
 	switch (get_boot_device()) {
-- 
cgit v1.1