Patchwork [U-Boot,SPEAr,Enhancement,4/9] spear/configs: Modify several configurations

login
register
mail settings
Submitter Vipin Kumar
Date Nov. 2, 2012, 5:39 p.m.
Message ID <faa02e94cd13288c060bd9c4f9835add2470e7f8.1351877331.git.vipin.kumar@st.com>
Download mbox | patch
Permalink /patch/196698/
State New
Delegated to: Vipin Kumar
Headers show

Comments

Vipin Kumar - Nov. 2, 2012, 5:39 p.m.
- Define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
   Define CONFIG_SYS_EXCEPTION_VECTORS_HIGH and remove specific initialization
   of CPU as high vector
- Define CONFIG_DISPLAY_BOARDINFO and print board info
- Add GPIO support
- Define CONFIG_BOOT_PARAMS_P for all spear boards
   It also makes a few board_init calls redundant so remove them from the code
- Enable OTG support
- Enable SPI and SDMMC support
- Enable USBH EHCI support
- Disable caches explicitly
- Keep ATAG interface for kernel booting
   The older kernel needs an ATAG interface to boot. The bootloader needs to
   pass the information in the form of ATAGS. Keep this ATAG interface with the
   new DT interface for kernel booting
- Remove extraneous configurations

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
---
 board/st/spear/spear_common.c        | 16 +++++++++
 board/st/spear/spear_lowlevel_init.S | 14 --------
 include/configs/spear.h              | 49 +++++++++++++++++++++++++--
 include/configs/spear300-evb.h       | 24 ++++++++++----
 include/configs/spear310-evb.h       | 24 ++++++++++----
 include/configs/spear320-evb.h       | 64 +++++++++++-------------------------
 include/configs/spear600-evb.h       | 32 ++++++++++++++----
 7 files changed, 141 insertions(+), 82 deletions(-)

Patch

diff --git a/board/st/spear/spear_common.c b/board/st/spear/spear_common.c
index f274b6e..2257779 100644
--- a/board/st/spear/spear_common.c
+++ b/board/st/spear/spear_common.c
@@ -39,6 +39,22 @@  void lowlevel_init(void)
 {
 }
 
+int checkboard(void)
+{
+#ifdef CONFIG_MACH_SPEAR300EVB
+	printf("BOARD: SPEAr300-EVB\n");
+#elif defined(CONFIG_MACH_SPEAR310EVB)
+	printf("BOARD: SPEAr310-EVB\n");
+#elif defined(CONFIG_MACH_SPEAR320EVB)
+	printf("BOARD: SPEAr320-PLC\n");
+#elif defined(CONFIG_MACH_SPEAR600EVB)
+	printf("BOARD: SPEAr600-EVB\n");
+#else
+#error BOARD not supported
+#endif
+	return 0;
+}
+
 int dram_init(void)
 {
 	/* Store complete RAM size and return */
diff --git a/board/st/spear/spear_lowlevel_init.S b/board/st/spear/spear_lowlevel_init.S
index 6fbe579..77fa821 100644
--- a/board/st/spear/spear_lowlevel_init.S
+++ b/board/st/spear/spear_lowlevel_init.S
@@ -23,20 +23,6 @@ 
 
 #include <config.h>
 
-/*
- * platform specific initializations are already done in Xloader
- * Initializations already done include
- * DDR, PLLs, IP's clock enable and reset release etc
- */
-.globl lowlevel_init
-lowlevel_init:
-	/* By default, U-Boot switches CPU to low-vector */
-	/* Revert this as we work in high vector even in U-Boot */
-	mrc	p15, 0, r0, c1, c0, 0
-	orr	r0, r0, #0x00002000
-	mcr	p15, 0, r0, c1, c0, 0
-	mov	pc, lr
-
 /* void setfreq(unsigned int device, unsigned int frequency) */
 .global setfreq
 setfreq:
diff --git a/include/configs/spear.h b/include/configs/spear.h
index a8ddf54..4cb551d 100644
--- a/include/configs/spear.h
+++ b/include/configs/spear.h
@@ -29,7 +29,7 @@ 
 #define CONFIG_PLAT_SPEAR
 
 #define CONFIG_SYS_TEXT_BASE			0x00700000
-#define CONFIG_BOOT_PARAMS_ADDR			0x00000100
+#define CONFIG_BOOT_PARAMS_P			0x00000100
 
 /* Timer, HZ specific defines */
 #define CONFIG_SYS_HZ				1000
@@ -38,7 +38,6 @@ 
 #if defined(CONFIG_DESIGNWARE_ETH) || defined(CONFIG_MACB)
 	#define CONFIG_MII
 	#define CONFIG_NET_MULTI
-	#define CONFIG_PHY_GIGE
 
 	#define CONFIG_CMD_NET
 	#define CONFIG_CMD_MII
@@ -50,7 +49,7 @@ 
 #endif
 
 /* Generic configuration for USBD driver */
-#if defined(CONFIG_DW_UDC)
+#if defined(CONFIG_DW_UDC) || defined(CONFIG_DW_OTG)
 	#define CONFIG_USB_DEVICE
 	#define CONFIG_USBD_HS
 	#define CONFIG_USB_TTY
@@ -87,6 +86,25 @@ 
 	#define CONFIG_CMD_I2C
 #endif
 
+/* Generic configuration for GPIO driver */
+#if defined(CONFIG_SPEAR_GPIO)
+	#define CONFIG_CMD_GPIO
+#endif
+
+/* Generic configuration for USB EHCI driver */
+#if defined(CONFIG_USB_EHCI_SPEAR)
+	#define CONFIG_USB_EHCI
+	#define CONFIG_USB_STORAGE
+	#define CONFIG_CMD_USB
+#endif
+
+/* Enable FAT and Partition types */
+#if defined(CONFIG_USB_STORAGE)
+	#define CONFIG_CMD_FAT
+	#define CONFIG_DOS_PARTITION
+	#define CONFIG_ISO_PARTITION
+#endif
+
 /* Generic configuration for ST SMI driver */
 #if defined(CONFIG_ST_SMI)
 	#define CONFIG_SYS_FLASH_ERASE_TOUT	(3 * CONFIG_SYS_HZ)
@@ -107,6 +125,23 @@ 
 						57600, 115200 }
 #endif
 
+/* Generic configuration for AMBA PL022 driver */
+#if defined(CONFIG_PL022_SPI)
+	#define CONFIG_CMD_SPI
+	#if defined(CONFIG_SPI_FLASH)
+		#define CONFIG_CMD_SF
+		#define CONFIG_SPI_FLASH_STMICRO
+	#endif
+#endif
+
+/* Generic configuration for Arasan SD/MMC driver */
+#if defined(CONFIG_SPEAR_SDHCI)
+	#define CONFIG_MMC
+	#define CONFIG_SDHCI
+	#define CONFIG_GENERIC_MMC
+	#define CONFIG_CMD_MMC
+#endif
+
 /* Generic configuration for FSMC NAND driver */
 #if defined(CONFIG_NAND_FSMC)
 	#define CONFIG_SYS_NAND_SELF_INIT
@@ -153,12 +188,20 @@ 
 
 /* Miscellaneous configurable options */
 #define CONFIG_ARCH_CPU_INIT
+#define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_POST				CONFIG_SYS_POST_MEMORY
 #define CONFIG_SYS_POST_WORD_ADDR		0x0
+#define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
+
+#if !defined(CONFIG_SPL_BUILD)
+	#define CONFIG_SYS_DCACHE_OFF
+#endif
 
 #define CONFIG_OF_LIBFDT
 #define CONFIG_CMDLINE_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
 
 #define CONFIG_ZERO_BOOTDELAY_CHECK
 #define CONFIG_AUTOBOOT_KEYED
diff --git a/include/configs/spear300-evb.h b/include/configs/spear300-evb.h
index cb6d764..e3f4ab4 100644
--- a/include/configs/spear300-evb.h
+++ b/include/configs/spear300-evb.h
@@ -54,6 +54,14 @@ 
 	#define CONFIG_SYS_I2C_SLAVE			0x02
 #endif
 
+/* GPIO configurations */
+#define CONFIG_SPEAR_GPIO
+
+/* USB EHCI configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_USB_EHCI_SPEAR
+#endif
+
 /* AMBA PL011 configurations */
 #define CONFIG_PL011_SERIAL
 #define CONFIG_CONS_INDEX			0
@@ -74,17 +82,19 @@ 
 	/* Environment is in serial NOR flash */
 	#define CONFIG_ENV_ADDR			0xF8060000
 	#define CONFIG_ENV_SECT_SIZE		0x00010000
-	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock3 "
-	#define CONFIG_BOOTCOMMAND		"bootm 0xF8070000"
+	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock5 "
+	#define CONFIG_BOOTCOMMAND		"" \
+		"bootm 0xf8080000 - 0xf8070000"
 
 #elif defined(CONFIG_ENV_IS_IN_NAND)
 	/* Environment is in NAND */
-	#define CONFIG_ENV_OFFSET		0x00060000
-	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock7 "
+	#define CONFIG_ENV_OFFSET		0x00070000
+	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock11 "
 
-	#define CONFIG_BOOTCOMMAND		"nand read.jffs2 0x1600000 " \
-						"0x80000 0x4C0000; " \
-						"bootm 0x1600000"
+	#define CONFIG_BOOTCOMMAND		"" \
+		"nand read.jffs2 0x800000 0x78000 0x008000; " \
+		"nand read.jffs2 0x900000 0x80000 0x4C0000; " \
+		"bootm 0x900000 - 0x800000"
 #endif
 
 #define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \
diff --git a/include/configs/spear310-evb.h b/include/configs/spear310-evb.h
index cb73ba7..505c8a4 100644
--- a/include/configs/spear310-evb.h
+++ b/include/configs/spear310-evb.h
@@ -67,6 +67,14 @@ 
 	#define CONFIG_SYS_I2C_SLAVE		0x02
 #endif
 
+/* GPIO configurations */
+#define CONFIG_SPEAR_GPIO
+
+/* USB EHCI configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_USB_EHCI_SPEAR
+#endif
+
 /* AMBA PL011 configurations */
 #define CONFIG_PL011_SERIAL
 #define CONFIG_CONS_INDEX			0
@@ -105,17 +113,19 @@ 
 		/* Environment is in serial NOR flash */
 		#define CONFIG_ENV_ADDR			0xF8060000
 		#define CONFIG_ENV_SECT_SIZE		0x00010000
-		#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock3 "
-		#define CONFIG_BOOTCOMMAND		"bootm 0xF8050000"
+		#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock5 "
+		#define CONFIG_BOOTCOMMAND		"" \
+			"bootm 0xf8080000 - 0xf8070000"
 	#endif
 #elif defined(CONFIG_ENV_IS_IN_NAND)
 	/* Environment is in NAND */
-	#define CONFIG_ENV_OFFSET		0x00060000
-	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock7 "
+	#define CONFIG_ENV_OFFSET		0x00140000
+	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock11 "
 
-	#define CONFIG_BOOTCOMMAND		"nand read.jffs2 0x1600000 " \
-						"0x200000 0x4C0000; " \
-						"bootm 0x1600000"
+	#define CONFIG_BOOTCOMMAND		"" \
+		"nand read.jffs2 0x800000 0x180000 0x020000; " \
+		"nand read.jffs2 0x900000 0x1c0000 0x4C0000; " \
+		"bootm 0x900000 - 0x800000"
 #endif
 
 #define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \
diff --git a/include/configs/spear320-evb.h b/include/configs/spear320-evb.h
index a054970..229fa83 100644
--- a/include/configs/spear320-evb.h
+++ b/include/configs/spear320-evb.h
@@ -28,15 +28,7 @@ 
 	#define CONFIG_SPEAR_USBTTY
 #endif
 
-#if defined(CONFIG_pnor)
-	#define CONFIG_FLASH_PNOR
-#endif
-
-#if defined(CONFIG_nand)
-	#define CONFIG_ENV_IS_IN_NAND
-#else
-	#define CONFIG_ENV_IS_IN_FLASH
-#endif
+#define CONFIG_ENV_IS_IN_FLASH
 
 #define CONFIG_MACH_SPEAR320EVB
 #define CONFIG_MACH_TYPE			MACH_TYPE_SPEAR320
@@ -69,51 +61,35 @@ 
 #define CONFIG_PL011_SERIAL
 #define CONFIG_CONS_INDEX			0
 
+/* GPIO configurations */
+#define CONFIG_SPEAR_GPIO
+
+/* USB EHCI configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_USB_EHCI_SPEAR
+#endif
+
 /* Designware UDC configurations */
 #if defined(CONFIG_SPEAR_USBTTY)
 	#define CONFIG_DW_UDC
 #endif
 
-/* FSMC NAND configurations */
-#define CONFIG_NAND_FSMC
-#define CONFIG_SYS_FSMC_NAND_8BIT
-
 /* Flash configurations */
-#if defined(CONFIG_FLASH_PNOR)
-	#define CONFIG_ST_EMI
-#else
-	#define CONFIG_ST_SMI
-#endif
+#define CONFIG_ST_SMI
 
-/* CFI Driver configurations */
-#if defined(CONFIG_FLASH_PNOR)
-	#define CONFIG_FLASH_CFI_DRIVER
-	#define CONFIG_SYS_MAX_FLASH_SECT	(127 + 8)
-#endif
+/* SPL support */
+#define CONFIG_SPL
+#define CONFIG_SPEAR_DDR_2HCLK
+#define CONFIG_DDR_MT47H64M16
 
 /* Environment Variable configs */
 #if defined(CONFIG_ENV_IS_IN_FLASH)
-	#if defined(CONFIG_FLASH_PNOR)
-		/* Environment is in parallel NOR flash */
-		#define CONFIG_ENV_ADDR			0xF8040000
-		#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock3 "
-		#define CONFIG_BOOTCOMMAND		"bootm 0xF8050000"
-
-	#else
-		/* Environment is in serial NOR flash */
-		#define CONFIG_ENV_ADDR			0xF8060000
-		#define CONFIG_ENV_SECT_SIZE		0x00010000
-		#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock3 "
-		#define CONFIG_BOOTCOMMAND		"bootm 0xF8070000"
-	#endif
-#elif defined(CONFIG_ENV_IS_IN_NAND)
-	/* Environment is in NAND */
-	#define CONFIG_ENV_OFFSET		0x00060000
-	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock7 "
-
-	#define CONFIG_BOOTCOMMAND		"nand read.jffs2 0x1600000 " \
-						"0x200000 0x4C0000; " \
-						"bootm 0x1600000"
+	/* Environment is in serial NOR flash */
+	#define CONFIG_ENV_ADDR			0xF8060000
+	#define CONFIG_ENV_SECT_SIZE		0x00010000
+	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock5 "
+	#define CONFIG_BOOTCOMMAND		"" \
+		"bootm 0xf8080000 - 0xf8070000"
 #endif
 
 #define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \
diff --git a/include/configs/spear600-evb.h b/include/configs/spear600-evb.h
index 5fe326a..e7c5ee3 100644
--- a/include/configs/spear600-evb.h
+++ b/include/configs/spear600-evb.h
@@ -41,6 +41,7 @@ 
 #if !defined(CONFIG_SPEAR_USBTTY)
 	#define CONFIG_DESIGNWARE_ETH
 	#define CONFIG_DW_SEARCH_PHY
+	#define CONFIG_PHY_GIGE
 	#define CONFIG_DW0_PHY			1
 	#define CONFIG_PHY_RESET_DELAY		10000		/* in usec */
 	#define CONFIG_DW_AUTONEG
@@ -54,6 +55,14 @@ 
 	#define CONFIG_SYS_I2C_SLAVE		0x02
 #endif
 
+/* GPIO configurations */
+#define CONFIG_SPEAR_GPIO
+
+/* USB EHCI configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_USB_EHCI_SPEAR
+#endif
+
 /* AMBA PL011 configurations */
 #define CONFIG_PL011_SERIAL
 #define CONFIG_CONS_INDEX			0
@@ -70,21 +79,30 @@ 
 /* ST SMI (Serial flash) configurations */
 #define CONFIG_ST_SMI
 
+/* SPL support */
+#define CONFIG_SPL
+#define CONFIG_SPEAR_DDR_2HCLK
+#define CONFIG_DDR_MT47H32M16
+#define CONFIG_SPL_TEXT_BASE			0xD2800B00
+#define CONFIG_SYS_SNOR_BOOT_BASE		0xF8010000
+
 #if defined(CONFIG_ENV_IS_IN_FLASH)
 	/* Environment is in serial NOR flash */
 	#define CONFIG_ENV_ADDR			0xF8060000
 	#define CONFIG_ENV_SECT_SIZE		0x00010000
-	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock3 "
-	#define CONFIG_BOOTCOMMAND		"bootm 0xF8060000"
+	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock5 "
+	#define CONFIG_BOOTCOMMAND		"" \
+		"bootm 0xf8080000 - 0xf8070000"
 
 #elif defined(CONFIG_ENV_IS_IN_NAND)
 	/* Environment is in NAND */
-	#define CONFIG_ENV_OFFSET		0x00060000
-	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock7 "
+	#define CONFIG_ENV_OFFSET		0x00140000
+	#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock11 "
 
-	#define CONFIG_BOOTCOMMAND		"nand read.jffs2 0x1600000 " \
-						"0x80000 0x4C0000; " \
-						"bootm 0x1600000"
+	#define CONFIG_BOOTCOMMAND		"" \
+		"nand read.jffs2 0x800000 0x180000 0x020000; " \
+		"nand read.jffs2 0x900000 0x1c0000 0x4C0000; " \
+		"bootm 0x900000 - 0x800000"
 #endif
 
 #define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \