[PATCH 2/2] i.MX53: add serial downloader bootsource

Eric Bénard eric at eukrea.com
Wed Apr 10 10:10:58 EDT 2013


Signed-off-by: Eric Bénard <eric at eukrea.com>
---
 arch/arm/mach-imx/boot.c | 70 +++++++++++++++++++++++++-----------------------
 1 file changed, 37 insertions(+), 33 deletions(-)

diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index bd0cb84..2e3f7ca 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -172,39 +172,43 @@ void imx53_boot_save_loc(void __iomem *src_base)
 	int instance;
 	uint32_t cfg1 = readl(src_base + IMX53_SRC_SBMR);
 
-	switch ((cfg1 & 0xff) >> 4) {
-	case 2:
-		src = BOOTSOURCE_HD;
-		break;
-	case 3:
-		if (cfg1 & (1 << 3))
-			src = BOOTSOURCE_SPI;
-		else
-			src = BOOTSOURCE_I2C;
-		break;
-	case 4:
-	case 5:
-	case 6:
-	case 7:
-		src = BOOTSOURCE_MMC;
-		break;
-	default:
-		break;
-	}
-
-	if (cfg1 & (1 << 7))
-		src = BOOTSOURCE_NAND;
-
-
-	switch (src) {
-	case BOOTSOURCE_MMC:
-	case BOOTSOURCE_SPI:
-	case BOOTSOURCE_I2C:
-		instance = (cfg1 >> 21) & 0x3;
-		break;
-	default:
-		instance = 0;
-		break;
+	if ((cfg1 & 0x03000000) >> 24 == 0x3)
+		src = BOOTSOURCE_SERIAL;
+	else {
+		switch ((cfg1 & 0xff) >> 4) {
+		case 2:
+			src = BOOTSOURCE_HD;
+			break;
+		case 3:
+			if (cfg1 & (1 << 3))
+				src = BOOTSOURCE_SPI;
+			else
+				src = BOOTSOURCE_I2C;
+			break;
+		case 4:
+		case 5:
+		case 6:
+		case 7:
+			src = BOOTSOURCE_MMC;
+			break;
+		default:
+			break;
+		}
+
+		if (cfg1 & (1 << 7))
+			src = BOOTSOURCE_NAND;
+
+
+		switch (src) {
+		case BOOTSOURCE_MMC:
+		case BOOTSOURCE_SPI:
+		case BOOTSOURCE_I2C:
+			instance = (cfg1 >> 21) & 0x3;
+			break;
+		default:
+			instance = 0;
+			break;
+		}
 	}
 
 	bootsource_set(src);
-- 
1.7.11.7




More information about the barebox mailing list