[U-Boot] [SPEAr Fixes PATCH 02/11] spear/configs: Split config files hierarchically into plat, arch, soc and board

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


The spear configuration files are split into spear6xx_evb.h and spear3xx_evb.h
with the common configurations placed in spear-common.h.

This split of configuration is not very conducive to increasing number of boards
within each architecture. With number of boards supported by spear3xx_evb.h
going up to 4, managing those boards becomes a tedious task.

This patch tries to re-split the spear configuration files hierarchically into

board files (spear600-evb.h, spear300-evb.h ...)
soc files (spear600.h, spear300.h ...)
arch files (spear6xx.h, spear3xx.h)
platform file (spear.h)

board configuration file would define the driver enabler which is required for
that respective board and would also define all board related configurations.
All other generic configurations would be defined by respective config files
(either spear3xx.h or spear300.h/spear310.h etc)

Signed-off-by: Vipin Kumar <vipin.kumar at st.com>
---
 arch/arm/cpu/arm926ejs/spear/cpu.c             |  12 +-
 arch/arm/cpu/arm926ejs/spear/spl.c             |   8 +-
 arch/arm/cpu/arm926ejs/spear/timer.c           |   4 +-
 arch/arm/include/asm/arch-spear/spr_misc.h     |   4 +-
 include/configs/spear-common.h                 | 251 -------------------------
 include/configs/spear.h                        | 193 +++++++++++++++++++
 include/configs/spear300-evb.h                 |  99 ++++++++++
 include/configs/{spear6xx_evb.h => spear300.h} |  45 ++---
 include/configs/spear310-evb.h                 | 130 +++++++++++++
 include/configs/spear310.h                     |  76 ++++++++
 include/configs/spear320-evb.h                 | 128 +++++++++++++
 include/configs/spear320.h                     |  66 +++++++
 include/configs/spear3xx.h                     |  50 +++++
 include/configs/spear3xx_evb.h                 | 173 -----------------
 include/configs/spear600-evb.h                 |  99 ++++++++++
 include/configs/spear600.h                     |  58 ++++++
 include/configs/x600.h                         |   2 +-
 17 files changed, 928 insertions(+), 470 deletions(-)
 delete mode 100644 include/configs/spear-common.h
 create mode 100644 include/configs/spear.h
 create mode 100644 include/configs/spear300-evb.h
 rename include/configs/{spear6xx_evb.h => spear300.h} (54%)
 create mode 100644 include/configs/spear310-evb.h
 create mode 100644 include/configs/spear310.h
 create mode 100644 include/configs/spear320-evb.h
 create mode 100644 include/configs/spear320.h
 create mode 100644 include/configs/spear3xx.h
 delete mode 100644 include/configs/spear3xx_evb.h
 create mode 100644 include/configs/spear600-evb.h
 create mode 100644 include/configs/spear600.h

diff --git a/arch/arm/cpu/arm926ejs/spear/cpu.c b/arch/arm/cpu/arm926ejs/spear/cpu.c
index e299de3..7f29514 100644
--- a/arch/arm/cpu/arm926ejs/spear/cpu.c
+++ b/arch/arm/cpu/arm926ejs/spear/cpu.c
@@ -34,9 +34,9 @@ int arch_cpu_init(void)
 
 	periph1_clken = readl(&misc_p->periph1_clken);
 
-#if defined(CONFIG_SPEAR3XX)
+#if defined(CONFIG_ARCH_SPEAR3XX)
 	periph1_clken |= MISC_GPT2ENB;
-#elif defined(CONFIG_SPEAR600)
+#elif defined(CONFIG_SOC_SPEAR600)
 	periph1_clken |= MISC_GPT3ENB;
 #endif
 
@@ -71,13 +71,13 @@ int arch_cpu_init(void)
 #ifdef CONFIG_DISPLAY_CPUINFO
 int print_cpuinfo(void)
 {
-#ifdef CONFIG_SPEAR300
+#ifdef CONFIG_SOC_SPEAR300
 	printf("CPU:   SPEAr300\n");
-#elif defined(CONFIG_SPEAR310)
+#elif defined(CONFIG_SOC_SPEAR310)
 	printf("CPU:   SPEAr310\n");
-#elif defined(CONFIG_SPEAR320)
+#elif defined(CONFIG_SOC_SPEAR320)
 	printf("CPU:   SPEAr320\n");
-#elif defined(CONFIG_SPEAR600)
+#elif defined(CONFIG_SOC_SPEAR600)
 	printf("CPU:   SPEAr600\n");
 #else
 #error CPU not supported in spear platform
diff --git a/arch/arm/cpu/arm926ejs/spear/spl.c b/arch/arm/cpu/arm926ejs/spear/spl.c
index 48e6efb..77fe3a9 100644
--- a/arch/arm/cpu/arm926ejs/spear/spl.c
+++ b/arch/arm/cpu/arm926ejs/spear/spl.c
@@ -203,7 +203,7 @@ static void sys_init(void)
  */
 int get_socrev(void)
 {
-#if defined(CONFIG_SPEAR600)
+#if defined(CONFIG_SOC_SPEAR600)
 	struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 	u32 soc_id = readl(&misc_p->soc_core_id);
 	u32 pri_socid = (soc_id >> SOC_PRI_SHFT) & 0xFF;
@@ -219,11 +219,11 @@ int get_socrev(void)
 		return SOC_SPEAR600_BA;
 	else
 		return SOC_SPEAR_NA;
-#elif defined(CONFIG_SPEAR300)
+#elif defined(CONFIG_SOC_SPEAR300)
 	return SOC_SPEAR300;
-#elif defined(CONFIG_SPEAR310)
+#elif defined(CONFIG_SOC_SPEAR310)
 	return SOC_SPEAR310;
-#elif defined(CONFIG_SPEAR320)
+#elif defined(CONFIG_SOC_SPEAR320)
 	return SOC_SPEAR320;
 #endif
 }
diff --git a/arch/arm/cpu/arm926ejs/spear/timer.c b/arch/arm/cpu/arm926ejs/spear/timer.c
index 1dc7860..25a4f62 100644
--- a/arch/arm/cpu/arm926ejs/spear/timer.c
+++ b/arch/arm/cpu/arm926ejs/spear/timer.c
@@ -46,10 +46,10 @@ int timer_init(void)
 	u32 synth;
 
 	/* Prescaler setting */
-#if defined(CONFIG_SPEAR3XX)
+#if defined(CONFIG_ARCH_SPEAR3XX)
 	writel(MISC_PRSC_CFG, &misc_regs_p->prsc2_clk_cfg);
 	synth = MISC_GPT4SYNTH;
-#elif defined(CONFIG_SPEAR600)
+#elif defined(CONFIG_ARCH_SPEAR6XX)
 	writel(MISC_PRSC_CFG, &misc_regs_p->prsc1_clk_cfg);
 	synth = MISC_GPT3SYNTH;
 #else
diff --git a/arch/arm/include/asm/arch-spear/spr_misc.h b/arch/arm/include/asm/arch-spear/spr_misc.h
index 5f67a5f..b86296d 100644
--- a/arch/arm/include/asm/arch-spear/spr_misc.h
+++ b/arch/arm/include/asm/arch-spear/spr_misc.h
@@ -105,10 +105,10 @@ struct misc_regs {
 #define SYNTH23			0x00020003
 
 /* PLLx_FRQ value */
-#if defined(CONFIG_SPEAR3XX)
+#if defined(CONFIG_ARCH_SPEAR3XX)
 #define FREQ_332		0xA600010C
 #define FREQ_266		0x8500010C
-#elif defined(CONFIG_SPEAR600)
+#elif defined(CONFIG_ARCH_SPEAR6XX)
 #define FREQ_332		0xA600010F
 #define FREQ_266		0x8500010F
 #endif
diff --git a/include/configs/spear-common.h b/include/configs/spear-common.h
deleted file mode 100644
index 192cda1..0000000
--- a/include/configs/spear-common.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * (C) Copyright 2009
- * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef _SPEAR_COMMON_H
-#define _SPEAR_COMMON_H
-/*
- * Common configurations used for both spear3xx as well as spear6xx
- */
-
-/* U-boot Load Address */
-#define CONFIG_SYS_TEXT_BASE			0x00700000
-
-/* Ethernet driver configuration */
-#define CONFIG_MII
-#define CONFIG_DESIGNWARE_ETH
-#define CONFIG_DW_SEARCH_PHY
-#define CONFIG_DW0_PHY				1
-#define CONFIG_NET_MULTI
-#define CONFIG_PHY_RESET_DELAY			10000		/* in usec */
-#define CONFIG_DW_AUTONEG
-#define CONFIG_PHY_GIGE			/* Include GbE speed/duplex detection */
-
-/* USBD driver configuration */
-#if defined(CONFIG_SPEAR_USBTTY)
-#define CONFIG_DW_UDC
-#define CONFIG_USB_DEVICE
-#define CONFIG_USBD_HS
-#define CONFIG_USB_TTY
-
-#define CONFIG_USBD_PRODUCT_NAME		"SPEAr SoC"
-#define CONFIG_USBD_MANUFACTURER		"ST Microelectronics"
-
-#endif
-
-#define CONFIG_EXTRA_ENV_USBTTY			"usbtty=cdc_acm\0"
-
-/* I2C driver configuration */
-#define CONFIG_HARD_I2C
-#define CONFIG_DW_I2C
-#define CONFIG_SYS_I2C_SPEED			400000
-#define CONFIG_SYS_I2C_SLAVE			0x02
-
-#define CONFIG_I2C_CHIPADDRESS			0x50
-
-/* Timer, HZ specific defines */
-#define CONFIG_SYS_HZ				1000
-
-/* Flash configuration */
-#if defined(CONFIG_FLASH_PNOR)
-#define CONFIG_SPEAR_EMI
-#else
-#define CONFIG_ST_SMI
-#endif
-
-#if defined(CONFIG_ST_SMI)
-
-#define CONFIG_SYS_MAX_FLASH_BANKS		2
-#define CONFIG_SYS_FLASH_BASE			0xF8000000
-#define CONFIG_SYS_CS1_FLASH_BASE		0xF9000000
-#define CONFIG_SYS_FLASH_BANK_SIZE		0x01000000
-#define CONFIG_SYS_FLASH_ADDR_BASE		{CONFIG_SYS_FLASH_BASE, \
-						CONFIG_SYS_CS1_FLASH_BASE}
-#define CONFIG_SYS_MAX_FLASH_SECT		128
-
-#define CONFIG_SYS_FLASH_ERASE_TOUT		(3 * CONFIG_SYS_HZ)
-#define CONFIG_SYS_FLASH_WRITE_TOUT		(3 * CONFIG_SYS_HZ)
-
-#endif
-
-/*
- * Serial Configuration (PL011)
- * CONFIG_PL01x_PORTS is defined in specific files
- */
-#define CONFIG_PL011_SERIAL
-#define CONFIG_PL011_CLOCK			(48 * 1000 * 1000)
-#define CONFIG_CONS_INDEX			0
-#define CONFIG_BAUDRATE				115200
-#define CONFIG_SYS_BAUDRATE_TABLE		{ 9600, 19200, 38400, \
-						57600, 115200 }
-
-#define CONFIG_SYS_LOADS_BAUD_CHANGE
-
-/* NAND FLASH Configuration */
-#define CONFIG_SYS_NAND_SELF_INIT
-#define CONFIG_MTD_DEVICE
-#define CONFIG_MTD_PARTITIONS
-#define CONFIG_NAND_FSMC
-#define CONFIG_SYS_MAX_NAND_DEVICE		1
-#define CONFIG_SYS_NAND_ONFI_DETECTION
-#define CONFIG_SYS_NAND_QUIET_TEST
-
-/*
- * Command support defines
- */
-#define CONFIG_CMD_I2C
-#define CONFIG_CMD_NAND
-#define CONFIG_CMD_ENV
-#define CONFIG_CMD_MEMORY
-#define CONFIG_CMD_RUN
-#define CONFIG_CMD_SAVES
-#define CONFIG_CMD_NET
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_DHCP
-
-/* This must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <config_cmd_default.h>
-
-/*
- * Default Environment Varible definitions
- */
-#if defined(CONFIG_SPEAR_USBTTY)
-#define CONFIG_BOOTDELAY			-1
-#else
-#define CONFIG_BOOTDELAY			1
-#endif
-
-#define CONFIG_ENV_OVERWRITE
-
-/*
- * U-Boot Environment placing definitions.
- */
-#if defined(CONFIG_ENV_IS_IN_FLASH)
-#ifdef CONFIG_ST_SMI
-/*
- * Environment is in serial NOR flash
- */
-#define CONFIG_SYS_MONITOR_LEN			0x00040000
-#define CONFIG_ENV_SECT_SIZE			0x00010000
-#define CONFIG_FSMTDBLK				"/dev/mtdblock3 "
-
-#define CONFIG_BOOTCOMMAND			"bootm 0xf8050000"
-
-#elif defined(CONFIG_SPEAR_EMI)
-/*
- * Environment is in parallel NOR flash
- */
-#define CONFIG_SYS_MONITOR_LEN			0x00060000
-#define CONFIG_ENV_SECT_SIZE			0x00020000
-#define CONFIG_FSMTDBLK				"/dev/mtdblock3 "
-
-#define CONFIG_BOOTCOMMAND			"cp.b 0x50080000 0x1600000 " \
-						"0x4C0000; bootm 0x1600000"
-#endif
-
-#define CONFIG_ENV_ADDR				(CONFIG_SYS_FLASH_BASE + \
-						CONFIG_SYS_MONITOR_LEN)
-#elif defined(CONFIG_ENV_IS_IN_NAND)
-/*
- * Environment is in NAND
- */
-
-#define CONFIG_ENV_OFFSET			0x60000
-#define CONFIG_ENV_RANGE			0x10000
-#define CONFIG_FSMTDBLK				"/dev/mtdblock7 "
-
-#define CONFIG_BOOTCOMMAND			"nand read.jffs2 0x1600000 " \
-						"0x80000 0x4C0000; " \
-						"bootm 0x1600000"
-#endif
-
-#define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \
-						"mem=128M " \
-						"root="CONFIG_FSMTDBLK \
-						"rootfstype=jffs2"
-
-#define CONFIG_NFSBOOTCOMMAND						\
-	"bootp; "							\
-	"setenv bootargs root=/dev/nfs rw "				\
-	"nfsroot=$(serverip):$(rootpath) "				\
-	"ip=$(ipaddr):$(serverip):$(gatewayip):"			\
-			"$(netmask):$(hostname):$(netdev):off "		\
-			"console=ttyAMA0,115200 $(othbootargs);"	\
-	"bootm; "
-
-#define CONFIG_RAMBOOTCOMMAND						\
-	"setenv bootargs root=/dev/ram rw "				\
-		"console=ttyAMA0,115200 $(othbootargs);"		\
-	CONFIG_BOOTCOMMAND
-
-
-#define CONFIG_ENV_SIZE				0x02000
-#define CONFIG_SYS_MONITOR_BASE			CONFIG_SYS_TEXT_BASE
-
-/* Miscellaneous configurable options */
-#define CONFIG_ARCH_CPU_INIT
-#define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_DISPLAY_CPUINFO
-#define CONFIG_BOOT_PARAMS_ADDR			0x00000100
-#define CONFIG_CMDLINE_TAG
-#define CONFIG_SETUP_MEMORY_TAGS
-#define CONFIG_MISC_INIT_R
-#define CONFIG_ZERO_BOOTDELAY_CHECK
-#define CONFIG_AUTOBOOT_KEYED
-#define CONFIG_AUTOBOOT_STOP_STR		" "
-#define CONFIG_AUTOBOOT_PROMPT			\
-		"Hit SPACE in %d seconds to stop autoboot.\n", bootdelay
-
-#define CONFIG_SYS_MEMTEST_START		0x00800000
-#define CONFIG_SYS_MEMTEST_END			0x04000000
-#define CONFIG_SYS_MALLOC_LEN			(1024*1024)
-#define CONFIG_IDENT_STRING			"-SPEAr"
-#define CONFIG_SYS_LONGHELP
-#define CONFIG_SYS_PROMPT			"u-boot> "
-#define CONFIG_CMDLINE_EDITING
-#define CONFIG_SYS_CBSIZE			256
-#define CONFIG_SYS_PBSIZE			(CONFIG_SYS_CBSIZE + \
-						sizeof(CONFIG_SYS_PROMPT) + 16)
-#define CONFIG_SYS_MAXARGS			16
-#define CONFIG_SYS_BARGSIZE			CONFIG_SYS_CBSIZE
-#define CONFIG_SYS_LOAD_ADDR			0x00800000
-#define CONFIG_SYS_CONSOLE_INFO_QUIET
-
-#define CONFIG_SYS_FLASH_EMPTY_INFO
-
-/* Physical Memory Map */
-#define CONFIG_NR_DRAM_BANKS			1
-#define PHYS_SDRAM_1				0x00000000
-#define PHYS_SDRAM_1_MAXSIZE			0x40000000
-
-#define CONFIG_SYS_SDRAM_BASE			PHYS_SDRAM_1
-#define CONFIG_SYS_INIT_RAM_ADDR		0xD2800000
-#define CONFIG_SYS_INIT_RAM_SIZE		0x2000
-
-#define CONFIG_SYS_INIT_SP_OFFSET		\
-	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
-
-#define CONFIG_SYS_INIT_SP_ADDR			\
-	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
-
-#endif
diff --git a/include/configs/spear.h b/include/configs/spear.h
new file mode 100644
index 0000000..3a73811
--- /dev/null
+++ b/include/configs/spear.h
@@ -0,0 +1,193 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_SPEAR_H
+#define __CONFIG_SPEAR_H
+
+#include <config_cmd_default.h>
+
+#define CONFIG_PLAT_SPEAR
+
+#define CONFIG_SYS_TEXT_BASE			0x00700000
+#define CONFIG_BOOT_PARAMS_ADDR			0x00000100
+
+/* Timer, HZ specific defines */
+#define CONFIG_SYS_HZ				1000
+
+/* Generic configuration for Designware Ethernet */
+#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
+	#define CONFIG_CMD_PING
+	#define CONFIG_CMD_DHCP
+#else
+	#undef CONFIG_CMD_NET
+	#undef CONFIG_CMD_NFS
+#endif
+
+/* Generic configuration for USBD driver */
+#if defined(CONFIG_DW_UDC)
+	#define CONFIG_USB_DEVICE
+	#define CONFIG_USBD_HS
+	#define CONFIG_USB_TTY
+
+#ifndef CONFIG_USBD_PRODUCT_NAME
+	#define CONFIG_USBD_PRODUCT_NAME	"SPEAr SoC"
+#endif
+#ifndef CONFIG_USBD_MANUFACTURER
+	#define CONFIG_USBD_MANUFACTURER	"ST Microelectronics"
+#endif
+
+#endif /* CONFIG_DW_UDC */
+
+#if !defined(CONFIG_BOARD_EXTRA_ENV)
+	#define CONFIG_BOARD_EXTRA_ENV		""
+#endif
+#if !defined(CONFIG_SOC_EXTRA_ENV)
+	#define CONFIG_SOC_EXTRA_ENV		""
+#endif
+
+#define CONFIG_EXTRA_ENV_SETTINGS	CONFIG_BOARD_EXTRA_ENV \
+					CONFIG_SOC_EXTRA_ENV \
+	"usbtty=cdc_acm\0unlock=yes\0" \
+	"autoload=n\0" \
+	"nfsargs=setenv bootargs root=/dev/nfs rw "			\
+	"nfsroot=$(serverip):$(rootpath) "				\
+	"ip=$(ipaddr):$(serverip):$(gatewayip):"			\
+	"$(netmask):$(hostname):$(netdev):off "				\
+	"console=ttyAMA0,115200 $(othbootargs)\0"
+
+/* Generic configuration for I2C driver */
+#if defined(CONFIG_DW_I2C)
+	#define CONFIG_HARD_I2C
+	#define CONFIG_CMD_I2C
+#endif
+
+/* Generic configuration for ST SMI driver */
+#if defined(CONFIG_ST_SMI)
+	#define CONFIG_SYS_FLASH_ERASE_TOUT	(3 * CONFIG_SYS_HZ)
+	#define CONFIG_SYS_FLASH_WRITE_TOUT	(3 * CONFIG_SYS_HZ)
+#endif
+
+/* Generic configuration for CFI driver */
+#if defined(CONFIG_FLASH_CFI_DRIVER)
+	#define CONFIG_SYS_FLASH_CFI
+	#define CONFIG_SYS_FLASH_QUIET_TEST
+	#define CONFIG_SYS_FLASH_PROTECTION
+#endif
+
+/* Generic configuration for AMBA PL011 driver */
+#if defined(CONFIG_PL011_SERIAL)
+	#define CONFIG_BAUDRATE			115200
+	#define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, \
+						57600, 115200 }
+#endif
+
+/* Generic configuration for FSMC NAND driver */
+#if defined(CONFIG_NAND_FSMC)
+	#define CONFIG_SYS_NAND_SELF_INIT
+	#define CONFIG_MTD_DEVICE
+	#define CONFIG_MTD_PARTITIONS
+	#define CONFIG_SYS_MAX_NAND_DEVICE	1
+	#define CONFIG_SYS_NAND_ONFI_DETECTION
+	#define CONFIG_SYS_NAND_QUIET_TEST
+
+	#define CONFIG_CMD_NAND
+#endif
+
+/* Generic configuration for environment */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_CMD_GREPENV
+
+#if !defined(CONFIG_ENV_SIZE)
+	#define CONFIG_ENV_SIZE			0x02000
+#endif
+
+#if defined(CONFIG_SPEAR_USBTTY)
+	#undef CONFIG_ENV_IS_IN_FLASH
+	#undef CONFIG_ENV_IS_IN_NAND
+	#define CONFIG_ENV_IS_NOWHERE
+	#define CONFIG_PREBOOT		"setenv stdout usbtty;" \
+					"setenv stderr usbtty;" \
+					"setenv stdin usbtty"
+#endif
+
+#if defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_BOOTDELAY		-1
+#else
+	#define CONFIG_BOOTDELAY		1
+#endif
+
+#define CONFIG_NFSBOOTCOMMAND						\
+	"bootp; run nfsargs; run loados; run loaddtb; "			\
+	"bootm 0x900000 - 0x800000"
+
+#define CONFIG_RAMBOOTCOMMAND						\
+	"setenv bootargs root=/dev/ram rw "				\
+		"console=ttyAMA0,115200 $(othbootargs);"		\
+	CONFIG_BOOTCOMMAND
+
+/* Miscellaneous configurable options */
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DISPLAY_CPUINFO
+
+#define CONFIG_OF_LIBFDT
+#define CONFIG_CMDLINE_TAG
+
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_STOP_STR		" "
+#define CONFIG_AUTOBOOT_PROMPT			\
+		"Hit SPACE in %d seconds to stop autoboot.\n", bootdelay
+
+#define CONFIG_SYS_MEMTEST_START		0x00800000
+#define CONFIG_SYS_MEMTEST_END			0x04000000
+#define CONFIG_SYS_MALLOC_LEN			(1024*1024)
+#define CONFIG_IDENT_STRING			"-SPEAr"
+#define CONFIG_SYS_LONGHELP
+
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_PROMPT			"u-boot> "
+#define CONFIG_SYS_CBSIZE			256
+#define CONFIG_SYS_PBSIZE			(CONFIG_SYS_CBSIZE + \
+						sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS			16
+#define CONFIG_SYS_BARGSIZE			CONFIG_SYS_CBSIZE
+#define CONFIG_SYS_LOAD_ADDR			0x00900000
+#define CONFIG_SYS_CONSOLE_INFO_QUIET
+#define CONFIG_SYS_64BIT_VSPRINTF
+
+#define CONFIG_SYS_FLASH_EMPTY_INFO
+
+/* Physical Memory Map */
+#define CONFIG_NR_DRAM_BANKS			1
+#define CONFIG_SYS_SDRAM_BASE			0x00000000
+#define SDRAM_MAX_SIZE				0x40000000
+
+#endif /* __CONFIG_SPEAR_H */
diff --git a/include/configs/spear300-evb.h b/include/configs/spear300-evb.h
new file mode 100644
index 0000000..cb6d764
--- /dev/null
+++ b/include/configs/spear300-evb.h
@@ -0,0 +1,99 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#if defined(CONFIG_usbtty)
+	#define CONFIG_SPEAR_USBTTY
+#endif
+
+#if defined(CONFIG_nand)
+	#define CONFIG_ENV_IS_IN_NAND
+#else
+	#define CONFIG_ENV_IS_IN_FLASH
+#endif
+
+#define CONFIG_MACH_SPEAR300EVB
+#define CONFIG_MACH_TYPE			MACH_TYPE_SPEAR300
+
+/* Designware Ethernet configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_DESIGNWARE_ETH
+	#define CONFIG_DW_SEARCH_PHY
+	#define CONFIG_DW0_PHY				1
+	#define CONFIG_PHY_RESET_DELAY			10000	/* in usec */
+	#define CONFIG_DW_AUTONEG
+#endif
+
+/* Designware I2C configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_DW_I2C
+	#define CONFIG_I2C_CHIPADDRESS			0x50
+	#define CONFIG_SYS_I2C_SPEED			400000
+	#define CONFIG_SYS_I2C_SLAVE			0x02
+#endif
+
+/* AMBA PL011 configurations */
+#define CONFIG_PL011_SERIAL
+#define CONFIG_CONS_INDEX			0
+
+/* 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
+
+/* ST SMI (Serial flash) configurations */
+#define CONFIG_ST_SMI
+
+#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 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_BOOTCOMMAND		"nand read.jffs2 0x1600000 " \
+						"0x80000 0x4C0000; " \
+						"bootm 0x1600000"
+#endif
+
+#define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \
+						"root="CONFIG_SPEAR_ROOTFSBLK \
+						"rootfstype=jffs2"
+
+#define CONFIG_BOARD_EXTRA_ENV			""			\
+	"loados=tftpboot 0x900000 $(rootpath)/spear3xx_uImage\0"	\
+	"loaddtb=tftpboot 0x800000 $(rootpath)/spear300-evb.dtb\0"
+
+#include <configs/spear300.h>
+#endif /* __CONFIG_H */
diff --git a/include/configs/spear6xx_evb.h b/include/configs/spear300.h
similarity index 54%
rename from include/configs/spear6xx_evb.h
rename to include/configs/spear300.h
index 31b8725..1f09f71 100644
--- a/include/configs/spear6xx_evb.h
+++ b/include/configs/spear300.h
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2009
+ * (C) Copyright 2012
  * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
  *
  * See file CREDITS for list of people who contributed to this
@@ -21,39 +21,22 @@
  * MA 02111-1307 USA
  */
 
-#ifndef __CONFIG_H
-#define __CONFIG_H
+#ifndef __CONFIG_SPEAR300_H
+#define __CONFIG_SPEAR300_H
 
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-#define CONFIG_SPEAR600
+#define CONFIG_SOC_SPEAR300
 
-#if defined(CONFIG_usbtty)
-#define CONFIG_SPEAR_USBTTY
+/* PL011 configs */
+#if defined(CONFIG_PL011_SERIAL)
+#define CONFIG_SYS_SERIAL0			0xD0000000
+#define CONFIG_PL011_CLOCK			(48 * 1000 * 1000)
+#define CONFIG_PL01x_PORTS			{(void *)CONFIG_SYS_SERIAL0}
 #endif
 
-#if defined(CONFIG_nand)
-#define CONFIG_ENV_IS_IN_NAND
-#else
-#define CONFIG_ENV_IS_IN_FLASH
+/* FSMC NAND configs */
+#if defined(CONFIG_NAND_FSMC)
+#define CONFIG_SYS_NAND_BASE			0x80000000
 #endif
 
-#include <configs/spear-common.h>
-
-/* Serial Configuration (PL011) */
-#define CONFIG_SYS_SERIAL0			0xD0000000
-#define CONFIG_SYS_SERIAL1			0xD0080000
-#define CONFIG_PL01x_PORTS			{ (void *)CONFIG_SYS_SERIAL0, \
-						(void *)CONFIG_SYS_SERIAL1 }
-
-/* NAND flash configuration */
-#define CONFIG_SYS_FSMC_NAND_SP
-#define CONFIG_SYS_FSMC_NAND_8BIT
-#define CONFIG_SYS_NAND_BASE			0xD2000000
-
-/* Environment Settings */
-#define CONFIG_EXTRA_ENV_SETTINGS              CONFIG_EXTRA_ENV_USBTTY
-
-#endif  /* __CONFIG_H */
+#include <configs/spear3xx.h>
+#endif /* __CONFIG_SPEAR300_H */
diff --git a/include/configs/spear310-evb.h b/include/configs/spear310-evb.h
new file mode 100644
index 0000000..cb73ba7
--- /dev/null
+++ b/include/configs/spear310-evb.h
@@ -0,0 +1,130 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#if defined(CONFIG_usbtty)
+	#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_MACH_SPEAR310EVB
+#define CONFIG_MACH_TYPE			MACH_TYPE_SPEAR310
+
+/* Designware Ethernet configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_DESIGNWARE_ETH
+	#define CONFIG_DW_SEARCH_PHY
+	#define CONFIG_DW0_PHY			1
+	#define CONFIG_PHY_RESET_DELAY		10000		/* in usec */
+	#define CONFIG_DW_AUTONEG
+#endif
+
+/* MACB configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_MACB
+	#define CONFIG_MACB0_PHY		0x01
+	#define CONFIG_MACB1_PHY		0x03
+	#define CONFIG_MACB2_PHY		0x05
+	#define CONFIG_MACB3_PHY		0x07
+#endif
+
+/* Designware I2C configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_DW_I2C
+	#define CONFIG_I2C_CHIPADDRESS		0x50
+	#define CONFIG_SYS_I2C_SPEED		400000
+	#define CONFIG_SYS_I2C_SLAVE		0x02
+#endif
+
+/* AMBA PL011 configurations */
+#define CONFIG_PL011_SERIAL
+#define CONFIG_CONS_INDEX			0
+
+/* 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
+
+/* CFI Driver configurations */
+#if defined(CONFIG_FLASH_PNOR)
+	#define CONFIG_FLASH_CFI_DRIVER
+	#define CONFIG_SYS_MAX_FLASH_SECT		(127 + 8)
+#endif
+
+/* 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			0xF8050000
+		#define CONFIG_SPEAR_ROOTFSBLK		"/dev/mtdblock3 "
+		#define CONFIG_BOOTCOMMAND		"bootm 0xF8060000"
+
+	#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 0xF8050000"
+	#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"
+#endif
+
+#define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \
+						"root="CONFIG_SPEAR_ROOTFSBLK \
+						"rootfstype=jffs2"
+
+#define CONFIG_BOARD_EXTRA_ENV			""			\
+	"loados=tftpboot 0x900000 $(rootpath)/spear3xx_uImage\0"	\
+	"loaddtb=tftpboot 0x800000 $(rootpath)/spear310-evb.dtb\0"
+
+#include <configs/spear310.h>
+#endif /* __CONFIG_H */
diff --git a/include/configs/spear310.h b/include/configs/spear310.h
new file mode 100644
index 0000000..30984a2
--- /dev/null
+++ b/include/configs/spear310.h
@@ -0,0 +1,76 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_SPEAR310_H
+#define __CONFIG_SPEAR310_H
+
+#define CONFIG_SOC_SPEAR310
+
+/* PL011 configs */
+#if defined(CONFIG_PL011_SERIAL)
+	#define CONFIG_SYS_SERIAL0		0xD0000000
+	#define CONFIG_SYS_SERIAL1		0xB2000000
+	#define CONFIG_SYS_SERIAL2		0xB2080000
+	#define CONFIG_SYS_SERIAL3		0xB2100000
+	#define CONFIG_SYS_SERIAL4		0xB2180000
+	#define CONFIG_SYS_SERIAL5		0xB2200000
+
+	#if (CONFIG_CONS_INDEX)
+		#define CONFIG_PL011_CLOCK		(83 * 1000 * 1000)
+	#else
+		#define CONFIG_PL011_CLOCK		(48 * 1000 * 1000)
+	#endif
+
+	#define CONFIG_PL01x_PORTS		{(void *)CONFIG_SYS_SERIAL0, \
+						(void *)CONFIG_SYS_SERIAL1, \
+						(void *)CONFIG_SYS_SERIAL2, \
+						(void *)CONFIG_SYS_SERIAL3, \
+						(void *)CONFIG_SYS_SERIAL4, \
+						(void *)CONFIG_SYS_SERIAL5 }
+#endif
+
+/* CFI driver (Parallel flash) configs */
+#if defined(CONFIG_FLASH_CFI_DRIVER)
+	#define CONFIG_SYS_FLASH_PROTECTION
+	#define CONFIG_SYS_FLASH_BASE		0x50000000
+	#define CONFIG_SYS_CS1_FLASH_BASE	0x60000000
+	#define CONFIG_SYS_CS2_FLASH_BASE	0x70000000
+	#define CONFIG_SYS_CS3_FLASH_BASE	0x80000000
+	#define CONFIG_SYS_CS4_FLASH_BASE	0x90000000
+	#define CONFIG_SYS_CS5_FLASH_BASE	0xA0000000
+	#define CONFIG_SYS_FLASH_BANKS_LIST	{ CONFIG_SYS_FLASH_BASE,   \
+						CONFIG_SYS_CS1_FLASH_BASE, \
+						CONFIG_SYS_CS2_FLASH_BASE, \
+						CONFIG_SYS_CS3_FLASH_BASE, \
+						CONFIG_SYS_CS4_FLASH_BASE, \
+						CONFIG_SYS_CS5_FLASH_BASE }
+	#define CONFIG_SYS_MAX_FLASH_BANKS	6
+#endif
+
+/* FSMC NAND configs */
+#if defined(CONFIG_NAND_FSMC)
+	#define CONFIG_SYS_NAND_BASE			0x40000000
+#endif
+
+#include <configs/spear3xx.h>
+#endif /* __CONFIG_SPEAR310_H */
diff --git a/include/configs/spear320-evb.h b/include/configs/spear320-evb.h
new file mode 100644
index 0000000..a054970
--- /dev/null
+++ b/include/configs/spear320-evb.h
@@ -0,0 +1,128 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#if defined(CONFIG_usbtty)
+	#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_MACH_SPEAR320EVB
+#define CONFIG_MACH_TYPE			MACH_TYPE_SPEAR320
+
+/* Designware Ethernet configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_DESIGNWARE_ETH
+	#define CONFIG_DW_SEARCH_PHY
+	#define CONFIG_DW0_PHY			1
+	#define CONFIG_PHY_RESET_DELAY		10000		/* in usec */
+	#define CONFIG_DW_AUTONEG
+#endif
+
+/* MACB configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_MACB
+	#define CONFIG_MACB0_PHY		0x01
+	#define CONFIG_MACB1_PHY		0x02
+#endif
+
+/* Designware I2C configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_DW_I2C
+	#define CONFIG_I2C_CHIPADDRESS		0x50
+	#define CONFIG_SYS_I2C_SPEED		400000
+	#define CONFIG_SYS_I2C_SLAVE		0x02
+#endif
+
+/* AMBA PL011 configurations */
+#define CONFIG_PL011_SERIAL
+#define CONFIG_CONS_INDEX			0
+
+/* 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
+
+/* CFI Driver configurations */
+#if defined(CONFIG_FLASH_PNOR)
+	#define CONFIG_FLASH_CFI_DRIVER
+	#define CONFIG_SYS_MAX_FLASH_SECT	(127 + 8)
+#endif
+
+/* 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"
+#endif
+
+#define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \
+						"root="CONFIG_SPEAR_ROOTFSBLK \
+						"rootfstype=jffs2"
+
+#define CONFIG_BOARD_EXTRA_ENV			""			\
+	"loados=tftpboot 0x900000 $(rootpath)/spear3xx_uImage\0"	\
+	"loaddtb=tftpboot 0x800000 $(rootpath)/spear320-evb.dtb\0"
+
+#include <configs/spear320.h>
+#endif /* __CONFIG_H */
diff --git a/include/configs/spear320.h b/include/configs/spear320.h
new file mode 100644
index 0000000..bafcb9a
--- /dev/null
+++ b/include/configs/spear320.h
@@ -0,0 +1,66 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_SPEAR320_H
+#define __CONFIG_SPEAR320_H
+
+#define CONFIG_SOC_SPEAR320
+
+/* PL011 configs */
+#if defined(CONFIG_PL011_SERIAL)
+	#define CONFIG_SYS_SERIAL0		0xD0000000
+	#define CONFIG_SYS_SERIAL1		0xA3000000
+	#define CONFIG_SYS_SERIAL2		0xA4000000
+
+	#if (CONFIG_CONS_INDEX)
+		#define CONFIG_PL011_CLOCK		(83 * 1000 * 1000)
+	#else
+		#define CONFIG_PL011_CLOCK		(48 * 1000 * 1000)
+	#endif
+
+	#define CONFIG_PL01x_PORTS		{(void *)CONFIG_SYS_SERIAL0, \
+						(void *)CONFIG_SYS_SERIAL1, \
+						(void *)CONFIG_SYS_SERIAL2 }
+#endif
+
+/* CFI driver (Parallel flash) configs */
+#if defined(CONFIG_FLASH_CFI_DRIVER)
+	#define CONFIG_SYS_FLASH_PROTECTION
+	#define CONFIG_SYS_FLASH_BASE		0x44000000
+	#define CONFIG_SYS_CS1_FLASH_BASE	0x45000000
+	#define CONFIG_SYS_CS2_FLASH_BASE	0x46000000
+	#define CONFIG_SYS_CS3_FLASH_BASE	0x47000000
+	#define CONFIG_SYS_FLASH_BANKS_LIST	{ CONFIG_SYS_FLASH_BASE,   \
+						CONFIG_SYS_CS1_FLASH_BASE, \
+						CONFIG_SYS_CS2_FLASH_BASE, \
+						CONFIG_SYS_CS3_FLASH_BASE }
+	#define CONFIG_SYS_MAX_FLASH_BANKS	4
+#endif
+
+/* FSMC NAND configs */
+#if defined(CONFIG_NAND_FSMC)
+	#define CONFIG_SYS_NAND_BASE			0x50000000
+#endif
+
+#include <configs/spear3xx.h>
+#endif /* __CONFIG_SPEAR320_H */
diff --git a/include/configs/spear3xx.h b/include/configs/spear3xx.h
new file mode 100644
index 0000000..e89e9c2
--- /dev/null
+++ b/include/configs/spear3xx.h
@@ -0,0 +1,50 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_SPEAR3XX_H
+#define __CONFIG_SPEAR3XX_H
+
+#define CONFIG_ARCH_SPEAR3XX
+
+/* Designware Ethernet configurations */
+#if defined(CONFIG_DESIGNWARE_ETH)
+	#define CONFIG_DW_ALTDESCRIPTOR
+#endif
+
+/* ST SMI (Serial flash) configurations */
+#if defined(CONFIG_ST_SMI)
+	#define CONFIG_SYS_MAX_FLASH_BANKS	2
+	#define CONFIG_SYS_FLASH_BASE		0xF8000000
+	#define CONFIG_SYS_CS1_FLASH_BASE	0xF9000000
+	#define CONFIG_SYS_FLASH_BANK_SIZE	0x01000000
+	#define CONFIG_SYS_FLASH_ADDR_BASE	{CONFIG_SYS_FLASH_BASE, \
+						CONFIG_SYS_CS1_FLASH_BASE}
+	#define CONFIG_SYS_MAX_FLASH_SECT	128
+#endif
+
+/* Internal memory address for spear3xx */
+#define CONFIG_SYS_INIT_SP_ADDR			(0xD2800000 + 0x2000 - \
+						GENERATED_GBL_DATA_SIZE)
+
+#include <configs/spear.h>
+#endif /* __CONFIG_SPEAR3XX_H */
diff --git a/include/configs/spear3xx_evb.h b/include/configs/spear3xx_evb.h
deleted file mode 100644
index 3cd56dc..0000000
--- a/include/configs/spear3xx_evb.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * (C) Copyright 2009
- * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * High Level Configuration Options
- * (easy to change)
- */
-#if defined(CONFIG_spear300)
-#define CONFIG_SPEAR3XX
-#define CONFIG_SPEAR300
-#elif defined(CONFIG_spear310)
-#define CONFIG_SPEAR3XX
-#define CONFIG_SPEAR310
-#elif defined(CONFIG_spear320)
-#define CONFIG_SPEAR3XX
-#define CONFIG_SPEAR320
-#endif
-
-#if defined(CONFIG_usbtty)
-#define CONFIG_SPEAR_USBTTY
-#endif
-
-#if defined(CONFIG_nand)
-#define CONFIG_ENV_IS_IN_NAND
-#else
-#define CONFIG_ENV_IS_IN_FLASH
-#endif
-
-#include <configs/spear-common.h>
-
-/* Ethernet driver configuration */
-#define CONFIG_DW_ALTDESCRIPTOR
-
-#if defined(CONFIG_SPEAR310)
-#define CONFIG_MACB
-#define CONFIG_MACB0_PHY			0x01
-#define CONFIG_MACB1_PHY			0x03
-#define CONFIG_MACB2_PHY			0x05
-#define CONFIG_MACB3_PHY			0x07
-
-#elif defined(CONFIG_SPEAR320)
-#define CONFIG_MACB
-#define CONFIG_MACB0_PHY			0x01
-
-#endif
-
-/* Serial Configuration (PL011) */
-#define CONFIG_SYS_SERIAL0			0xD0000000
-
-#if defined(CONFIG_SPEAR300)
-#define CONFIG_PL01x_PORTS			{(void *)CONFIG_SYS_SERIAL0}
-
-#elif defined(CONFIG_SPEAR310)
-
-#if (CONFIG_CONS_INDEX)
-#undef  CONFIG_PL011_CLOCK
-#define CONFIG_PL011_CLOCK			(83 * 1000 * 1000)
-#endif
-
-#define CONFIG_SYS_SERIAL1			0xB2000000
-#define CONFIG_SYS_SERIAL2			0xB2080000
-#define CONFIG_SYS_SERIAL3			0xB2100000
-#define CONFIG_SYS_SERIAL4			0xB2180000
-#define CONFIG_SYS_SERIAL5			0xB2200000
-#define CONFIG_PL01x_PORTS			{(void *)CONFIG_SYS_SERIAL0, \
-						(void *)CONFIG_SYS_SERIAL1, \
-						(void *)CONFIG_SYS_SERIAL2, \
-						(void *)CONFIG_SYS_SERIAL3, \
-						(void *)CONFIG_SYS_SERIAL4, \
-						(void *)CONFIG_SYS_SERIAL5 }
-#elif defined(CONFIG_SPEAR320)
-
-#if (CONFIG_CONS_INDEX)
-#undef  CONFIG_PL011_CLOCK
-#define CONFIG_PL011_CLOCK			(83 * 1000 * 1000)
-#endif
-
-#define CONFIG_SYS_SERIAL1			0xA3000000
-#define CONFIG_SYS_SERIAL2			0xA4000000
-#define CONFIG_PL01x_PORTS			{(void *)CONFIG_SYS_SERIAL0, \
-						(void *)CONFIG_SYS_SERIAL1, \
-						(void *)CONFIG_SYS_SERIAL2 }
-#endif
-
-#if defined(CONFIG_SPEAR_EMI)
-
-#define CONFIG_SYS_FLASH_CFI
-#define CONFIG_FLASH_CFI_DRIVER
-
-#if defined(CONFIG_SPEAR310)
-#define CONFIG_SYS_FLASH_PROTECTION
-#define CONFIG_SYS_FLASH_BASE			0x50000000
-#define CONFIG_SYS_CS1_FLASH_BASE		0x60000000
-#define CONFIG_SYS_CS2_FLASH_BASE		0x70000000
-#define CONFIG_SYS_CS3_FLASH_BASE		0x80000000
-#define CONFIG_SYS_CS4_FLASH_BASE		0x90000000
-#define CONFIG_SYS_CS5_FLASH_BASE		0xA0000000
-#define CONFIG_SYS_FLASH_BANKS_LIST		{ CONFIG_SYS_FLASH_BASE,   \
-						CONFIG_SYS_CS1_FLASH_BASE, \
-						CONFIG_SYS_CS2_FLASH_BASE, \
-						CONFIG_SYS_CS3_FLASH_BASE, \
-						CONFIG_SYS_CS4_FLASH_BASE, \
-						CONFIG_SYS_CS5_FLASH_BASE }
-#define CONFIG_SYS_MAX_FLASH_BANKS		6
-
-#elif defined(CONFIG_SPEAR320)
-#define CONFIG_SYS_FLASH_PROTECTION
-#define CONFIG_SYS_FLASH_BASE			0x44000000
-#define CONFIG_SYS_CS1_FLASH_BASE		0x45000000
-#define CONFIG_SYS_CS2_FLASH_BASE		0x46000000
-#define CONFIG_SYS_CS3_FLASH_BASE		0x47000000
-#define CONFIG_SYS_FLASH_BANKS_LIST		{ CONFIG_SYS_FLASH_BASE,   \
-						CONFIG_SYS_CS1_FLASH_BASE, \
-						CONFIG_SYS_CS2_FLASH_BASE, \
-						CONFIG_SYS_CS3_FLASH_BASE }
-#define CONFIG_SYS_MAX_FLASH_BANKS		4
-
-#endif
-
-#define CONFIG_SYS_MAX_FLASH_SECT		(127 + 8)
-#define CONFIG_SYS_FLASH_QUIET_TEST
-
-#endif
-
-/* NAND flash configuration */
-#define CONFIG_SYS_FSMC_NAND_SP
-#define CONFIG_SYS_FSMC_NAND_8BIT
-
-#if defined(CONFIG_SPEAR300)
-#define CONFIG_SYS_NAND_BASE			0x80000000
-
-#elif defined(CONFIG_SPEAR310)
-#define CONFIG_SYS_NAND_BASE			0x40000000
-
-#elif defined(CONFIG_SPEAR320)
-#define CONFIG_SYS_NAND_BASE			0x50000000
-
-#endif
-
-/* Environment Settings */
-#if defined(CONFIG_SPEAR300)
-#define CONFIG_EXTRA_ENV_SETTINGS              CONFIG_EXTRA_ENV_USBTTY
-
-#elif defined(CONFIG_SPEAR310) || defined(CONFIG_SPEAR320)
-#define CONFIG_EXTRA_ENV_UNLOCK                        "unlock=yes\0"
-#define CONFIG_EXTRA_ENV_SETTINGS              CONFIG_EXTRA_ENV_USBTTY \
-						CONFIG_EXTRA_ENV_UNLOCK
-#endif
-
-#endif  /* __CONFIG_H */
diff --git a/include/configs/spear600-evb.h b/include/configs/spear600-evb.h
new file mode 100644
index 0000000..5fe326a
--- /dev/null
+++ b/include/configs/spear600-evb.h
@@ -0,0 +1,99 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#if defined(CONFIG_usbtty)
+	#define CONFIG_SPEAR_USBTTY
+#endif
+
+#if defined(CONFIG_nand)
+	#define CONFIG_ENV_IS_IN_NAND
+#else
+	#define CONFIG_ENV_IS_IN_FLASH
+#endif
+
+#define CONFIG_MACH_SPEAR600EVB
+#define CONFIG_MACH_TYPE			MACH_TYPE_SPEAR600
+
+/* Designware Ethernet configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_DESIGNWARE_ETH
+	#define CONFIG_DW_SEARCH_PHY
+	#define CONFIG_DW0_PHY			1
+	#define CONFIG_PHY_RESET_DELAY		10000		/* in usec */
+	#define CONFIG_DW_AUTONEG
+#endif
+
+/* Designware I2C configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_DW_I2C
+	#define CONFIG_I2C_CHIPADDRESS		0x50
+	#define CONFIG_SYS_I2C_SPEED		400000
+	#define CONFIG_SYS_I2C_SLAVE		0x02
+#endif
+
+/* AMBA PL011 configurations */
+#define CONFIG_PL011_SERIAL
+#define CONFIG_CONS_INDEX			0
+
+/* 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
+
+/* ST SMI (Serial flash) configurations */
+#define CONFIG_ST_SMI
+
+#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"
+
+#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 " \
+						"0x80000 0x4C0000; " \
+						"bootm 0x1600000"
+#endif
+
+#define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \
+						"root="CONFIG_SPEAR_ROOTFSBLK \
+						"rootfstype=jffs2"
+
+#define CONFIG_BOARD_EXTRA_ENV			""			\
+	"loados=tftpboot 0x900000 $(rootpath)/spear600_uImage\0"	\
+	"loaddtb=tftpboot 0x800000 $(rootpath)/spear600-evb.dtb\0"
+
+#include <configs/spear600.h>
+#endif
diff --git a/include/configs/spear600.h b/include/configs/spear600.h
new file mode 100644
index 0000000..e64f26d
--- /dev/null
+++ b/include/configs/spear600.h
@@ -0,0 +1,58 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, STMicroelectronics, <vipin.kumar at st.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_SPEAR600_H
+#define __CONFIG_SPEAR600_H
+
+#define CONFIG_SOC_SPEAR600
+#define CONFIG_ARCH_SPEAR6XX
+
+/* PL011 configs */
+#if defined(CONFIG_PL011_SERIAL)
+#define CONFIG_SYS_SERIAL0			0xD0000000
+#define CONFIG_PL011_CLOCK			(48 * 1000 * 1000)
+#define CONFIG_PL01x_PORTS			{(void *)CONFIG_SYS_SERIAL0}
+#endif
+
+/* FSMC NAND configs */
+#if defined(CONFIG_NAND_FSMC)
+#define CONFIG_SYS_NAND_BASE			0xD2000000
+#endif
+
+/* ST SMI (Serial flash) configurations */
+#if defined(CONFIG_ST_SMI)
+	#define CONFIG_SYS_MAX_FLASH_BANKS	2
+	#define CONFIG_SYS_FLASH_BASE		0xF8000000
+	#define CONFIG_SYS_CS1_FLASH_BASE	0xF9000000
+	#define CONFIG_SYS_FLASH_BANK_SIZE	0x01000000
+	#define CONFIG_SYS_FLASH_ADDR_BASE	{CONFIG_SYS_FLASH_BASE, \
+						CONFIG_SYS_CS1_FLASH_BASE}
+	#define CONFIG_SYS_MAX_FLASH_SECT	128
+#endif
+
+/* Internal memory address for spear3xx */
+#define CONFIG_SYS_INIT_SP_ADDR			(0xD2800000 + 0x2000 - \
+						GENERATED_GBL_DATA_SIZE)
+
+#include <configs/spear.h>
+#endif /* __CONFIG_SPEAR600_H */
diff --git a/include/configs/x600.h b/include/configs/x600.h
index 3082aaa..e15e36b 100644
--- a/include/configs/x600.h
+++ b/include/configs/x600.h
@@ -30,7 +30,7 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_SPEAR600				/* SPEAr600 SoC */
+#define CONFIG_SOC_SPEAR600			/* SPEAr600 SoC */
 #define CONFIG_X600				/* on X600 board */
 
 #include <asm/arch/hardware.h>
-- 
1.7.11.4



More information about the U-Boot mailing list