[U-Boot] [SPEAr Fixes PATCH 05/11] spear: Append MISC_ as prefix to misc register bitmasks

Vipin Kumar vipin.kumar at st.com
Fri Nov 2 18:39:38 CET 2012


Signed-off-by: Vipin Kumar <vipin.kumar at st.com>
---
 arch/arm/cpu/arm926ejs/spear/cpu.c      |  4 ++--
 arch/arm/cpu/arm926ejs/spear/spear600.c | 22 +++++++++-------------
 arch/arm/include/asm/arch-spear/misc.h  | 10 ++++++++--
 3 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/spear/cpu.c b/arch/arm/cpu/arm926ejs/spear/cpu.c
index 1301608..311f31b 100644
--- a/arch/arm/cpu/arm926ejs/spear/cpu.c
+++ b/arch/arm/cpu/arm926ejs/spear/cpu.c
@@ -44,8 +44,8 @@ int arch_cpu_init(void)
 	periph1_clken |= MISC_UART0ENB;
 
 	periph_clk_cfg = readl(&misc_p->periph_clk_cfg);
-	periph_clk_cfg &= ~CONFIG_SPEAR_UARTCLKMSK;
-	periph_clk_cfg |= CONFIG_SPEAR_UART48M;
+	periph_clk_cfg &= ~MISC_UARTCLKMSK;
+	periph_clk_cfg |= MISC_UART48M;
 	writel(periph_clk_cfg, &misc_p->periph_clk_cfg);
 #endif
 #if defined(CONFIG_DESIGNWARE_ETH)
diff --git a/arch/arm/cpu/arm926ejs/spear/spear600.c b/arch/arm/cpu/arm926ejs/spear/spear600.c
index f4ec10a..bd8cb7a 100644
--- a/arch/arm/cpu/arm926ejs/spear/spear600.c
+++ b/arch/arm/cpu/arm926ejs/spear/spear600.c
@@ -138,8 +138,9 @@ void soc_init(void)
  */
 static u32 read_bootstrap(void)
 {
-	return (readl(CONFIG_SPEAR_BOOTSTRAPCFG) >> CONFIG_SPEAR_BOOTSTRAPSHFT)
-		& CONFIG_SPEAR_BOOTSTRAPMASK;
+	struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
+
+	return readl(&misc_p->auto_cfg_reg) & MISC_BOOTSTRAPMASK;
 }
 
 int snor_boot_selected(void)
@@ -148,16 +149,13 @@ int snor_boot_selected(void)
 
 	if (SNOR_BOOT_SUPPORTED) {
 		/* Check whether SNOR boot is selected */
-		if ((bootstrap & CONFIG_SPEAR_ONLYSNORBOOT) ==
-			CONFIG_SPEAR_ONLYSNORBOOT)
+		if ((bootstrap & MISC_ONLYSNORBOOT) == MISC_ONLYSNORBOOT)
 			return TRUE;
 
-		if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
-			CONFIG_SPEAR_NORNAND8BOOT)
+		if ((bootstrap & MISC_NORNANDBOOT) == MISC_NORNAND8BOOT)
 			return TRUE;
 
-		if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
-			CONFIG_SPEAR_NORNAND16BOOT)
+		if ((bootstrap & MISC_NORNANDBOOT) == MISC_NORNAND16BOOT)
 			return TRUE;
 	}
 
@@ -170,12 +168,10 @@ int nand_boot_selected(void)
 
 	if (NAND_BOOT_SUPPORTED) {
 		/* Check whether NAND boot is selected */
-		if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
-			CONFIG_SPEAR_NORNAND8BOOT)
+		if ((bootstrap & MISC_NORNANDBOOT) == MISC_NORNAND8BOOT)
 			return TRUE;
 
-		if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
-			CONFIG_SPEAR_NORNAND16BOOT)
+		if ((bootstrap & MISC_NORNANDBOOT) == MISC_NORNAND16BOOT)
 			return TRUE;
 	}
 
@@ -194,7 +190,7 @@ int usb_boot_selected(void)
 
 	if (USB_BOOT_SUPPORTED) {
 		/* Check whether USB boot is selected */
-		if (!(bootstrap & CONFIG_SPEAR_USBBOOT))
+		if (!(bootstrap & MISC_USBBOOT))
 			return TRUE;
 	}
 
diff --git a/arch/arm/include/asm/arch-spear/misc.h b/arch/arm/include/asm/arch-spear/misc.h
index 89f7964..2696203 100644
--- a/arch/arm/include/asm/arch-spear/misc.h
+++ b/arch/arm/include/asm/arch-spear/misc.h
@@ -137,12 +137,18 @@ struct misc_regs {
 #define MISC_SOCCFG30                   0x0000000C
 #define MISC_SOCCFG31                   0x0000000D
 #define MISC_NANDDIS			0x00020000
+#define MISC_BOOTSTRAPMASK		0x000B0000
+#define MISC_ONLYSNORBOOT		0x000A0000
+#define MISC_NORNANDBOOT		0x000B0000
+#define MISC_NORNAND8BOOT		0x00080000
+#define MISC_NORNAND16BOOT		0x00090000
+#define MISC_USBBOOT			0x00080000
 
 /* PERIPH_CLK_CFG value */
 #define MISC_GPT3SYNTH			0x00000400
 #define MISC_GPT4SYNTH			0x00000800
-#define CONFIG_SPEAR_UART48M		0
-#define CONFIG_SPEAR_UARTCLKMSK		(0x1 << 4)
+#define MISC_UART48M			0x00000000
+#define MISC_UARTCLKMSK			0x00000010
 
 /* PRSC_CLK_CFG value */
 /*
-- 
1.7.11.4



More information about the U-Boot mailing list