Skip to contentSkip to conversation

SPEAr: Update platform support for SPEAr3xx/6xx

PATCH Superseded Amit Virdi 3 participants 28 messages Mar 30, 2012 – Apr 2, 2012

Subsystems (2)
lore
Share & tools
lore

Amit Virdi

author
#0 lore raw

v2 cover SPEAr: Update platform support for SPEAr3xx/6xx

This patchset updates the SPEAr support in the u-boot. It contains various bugfixes and enhancements.

The patches have certain dependencies on the drivers, so should be applied once the driver patches are frozen. The various drivers on which these patches depend are:
1. USB device controller:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/125220/focus=126598
2. Designware ethernet controller:
http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/126029
3. ST_SMI: http://lists.denx.de/pipermail/u-boot/2012-February/118672.html
4. FSMC_NAND: http://patchwork.ozlabs.org/patch/143167/

In a subsequent patchset, more features shall be added along with cleanup of the directory structure.

Changes since V1:
- config.mk files removed from board/spear/spearxxx/ directories
- Dropped two patches which were irrelevant
- Removed following config variables:
CONFIG_MONITOR_IS_IN_RAM CONFIG_MTD_NAND_VERIFY_WRITE
- Defined CONFIG_EXTRA_ENV_UNLOCK only for SPEAr310 and SPEAr320
- Some cosmetic cleanups

Amit Virdi (6):
SPEAr: Fix ARM relocation support
SPEAr: Eliminate dependency on Xloader table
SPEAr: Initialize SNOR in early_board_init_f
SPEAr: Remove CONFIG_MTD_NAND_VERIFY_WRITE to speed up NAND access cleanup/SPEAr: Remove unnecessary parenthesis cleanup/SPEAr: Define configuration flags more elegantly

Shiraz Hashim (4):
SPEAr: Enable autoneg for ethernet
SPEAr: Enable dcache for fast file transfer
SPEAr: explicitly select clk src for UART
SPEAr: Correct SoC ID offset in misc configuration space

Vipin KUMAR (9):
SPEAr: Place ethaddr write and read within CONFIG_CMD_NET
SPEAr: Configure network support for spear SoCs
SPEAr: Add macb driver support for spear310 and spear320
SPEAr: Add basic arch related support for SPEAr SoCs
SPEAr: Add configuration options for spear3xx and spear6xx boards
SPEAr: Remove unused flag (CONFIG_SYS_HZ_CLOCK)
SPEAr: Change the default environment variables
SPEAr: Enable usb device high speed support
SPEAr: Enable udc and usb-console support only for usbtty
configuration

Vipin Kumar (5):
SPEAr: Add interface information in initialization
SPEAr: Enable CONFIG_SYS_FLASH_PROTECTION
SPEAr: Correct the definition of CONFIG_SYS_MONITOR_BASE
SPEAr: Enable CONFIG_SYS_FLASH_EMPTY_INFO macro
SPEAr: Enable ONFI nand flash detection for spear3xx and 6xx and evb

 arch/arm/cpu/arm926ejs/spear/Makefile              |    3 +-
 arch/arm/cpu/arm926ejs/spear/cpu.c                 |   87 +++++++++++++++++
 .../arm/include/asm/arch-spear/clk.h               |   29 +-----
 arch/arm/include/asm/arch-spear/hardware.h         |    8 ++
 arch/arm/include/asm/arch-spear/spr_defs.h         |    7 --
 arch/arm/include/asm/arch-spear/spr_gpt.h          |    4 +-
 arch/arm/include/asm/arch-spear/spr_misc.h         |   11 ++-
 .../arm/include/asm/arch-spear/spr_xloader_table.h |   67 -------------
 board/spear/common/spr_misc.c                      |  102 +++++++-------------
 board/spear/spear300/config.mk                     |   39 --------
 board/spear/spear300/spear300.c                    |   15 +++
 board/spear/spear310/config.mk                     |   44 ---------
 board/spear/spear310/spear310.c                    |   32 ++++++
 board/spear/spear320/config.mk                     |   44 ---------
 board/spear/spear320/spear320.c                    |   30 ++++++
 board/spear/spear600/config.mk                     |   39 --------
 board/spear/spear600/spear600.c                    |   18 ++++
 boards.cfg                                         |   24 ++++-
 doc/README.spear                                   |   54 ++++++++---
 drivers/net/designware.c                           |   10 ++-
 drivers/net/designware.h                           |    1 +
 include/configs/spear-common.h                     |   86 +++++++++++-----
 include/configs/{spear3xx.h => spear3xx_evb.h}     |   58 +++++++++--
 include/configs/{spear6xx.h => spear6xx_evb.h}     |   17 +++-
 include/netdev.h                                   |    2 +-
 25 files changed, 436 insertions(+), 395 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/spear/cpu.c
 copy include/configs/spear6xx.h => arch/arm/include/asm/arch-spear/clk.h (60%)
 delete mode 100644 arch/arm/include/asm/arch-spear/spr_xloader_table.h
 delete mode 100644 board/spear/spear300/config.mk
 delete mode 100644 board/spear/spear310/config.mk
 delete mode 100644 board/spear/spear320/config.mk
 delete mode 100644 board/spear/spear600/config.mk
 rename include/configs/{spear3xx.h => spear3xx_evb.h} (74%)
 rename include/configs/{spear6xx.h => spear6xx_evb.h} (80%)
Signature · 1 line
1.7.2.2
author
#1 lore raw

PATCH v2 1/24 SPEAr: Fix ARM relocation support

While the u-boot code is running from the flash, it is essential that no access is made to the bss segment. This is due to the fact that .rel.dyn and .bss areas overlap and former contains information used in relocation. In SPEAr, this was not taken into consideration. As a result, while the relocation wasn't complete, dram_init populated an uninitialized global variable resulting in corruption of .rel.dyn area, which resulted in u-boot crash.

This commit fixes this problem by removing code that accesses bss segment

---
 board/spear/common/spr_misc.c |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)
board/spear/common/spr_misc.c +1 -19
index 0812c20..3ab278f 100644
@@ -40,27 +40,9 @@ static struct chip_data chip_data;
 
 int dram_init(void)
 {
-	struct xloader_table *xloader_tb =
-	    (struct xloader_table *)XLOADER_TABLE_ADDRESS;
-	struct xloader_table_1_1 *table_1_1;
-	struct xloader_table_1_2 *table_1_2;
-	struct chip_data *chip = &chip_data;
-
+	/* Store complete RAM size and return */
 	gd->ram_size = get_ram_size(PHYS_SDRAM_1, PHYS_SDRAM_1_MAXSIZE);
 
-	if (XLOADER_TABLE_VERSION_1_1 == xloader_tb->table_version) {
-		table_1_1 = &xloader_tb->table.table_1_1;
-		chip->dramfreq = table_1_1->ddrfreq;
-		chip->dramtype = table_1_1->ddrtype;
-
-	} else if (XLOADER_TABLE_VERSION_1_2 == xloader_tb->table_version) {
-		table_1_2 = &xloader_tb->table.table_1_2;
-		chip->dramfreq = table_1_2->ddrfreq;
-		chip->dramtype = table_1_2->ddrtype;
-	} else {
-		chip->dramfreq = -1;
-	}
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.2
author
#2 lore raw

PATCH v2 2/24 SPEAr: Eliminate dependency on Xloader table

In reply to Amit Virdi

Xloader table was used primarily to inform u-boot about the DDR size. However, now the ddr size is calculated at runtime which eliminates any need for the Xloader table. So removing this unnecessary code.

---
 arch/arm/include/asm/arch-spear/spr_defs.h         |    7 --
 .../arm/include/asm/arch-spear/spr_xloader_table.h |   67 --------------------
 board/spear/common/spr_misc.c                      |   41 ------------
 3 files changed, 0 insertions(+), 115 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-spear/spr_xloader_table.h
arch/arm/include/asm/arch-spear/spr_defs.h +0 -7
index fa8412c..0ddce62 100644
@@ -28,13 +28,6 @@ extern int spear_board_init(ulong);
 extern void setfreq(unsigned int, unsigned int);
 extern unsigned int setfreq_sz;
 
-struct chip_data {
-	int cpufreq;
-	int dramfreq;
-	int dramtype;
-	uchar version[32];
-};
-
 /* HW mac id in i2c memory definitions */
 #define MAGIC_OFF	0x0
 #define MAGIC_LEN	0x2
arch/arm/include/asm/arch-spear/spr_xloader_table.h deleted +0 -67

67 lines not on this page · raw message

board/spear/common/spr_misc.c +0 -41

91 lines not on this page · raw message

Signature · 1 line
1.7.2.2
author
#3 lore raw

PATCH v2 3/24 SPEAr: Place ethaddr write and read within CONFIG_CMD_NET

In reply to Amit Virdi

From: Vipin KUMAR <[email protected]>

ethaddr can be optionally read from i2c memory. So, chip_config command supports reading/writing hw mac id into i2c memory. Placing this code within CONFIG_CMD_NET as this would only be needed when network interface is configured

---
 board/spear/common/spr_misc.c |   29 +++++++++++++++++++++--------
 doc/README.spear              |    8 ++++++++
 2 files changed, 29 insertions(+), 8 deletions(-)
board/spear/common/spr_misc.c +21 -8
index be96c15..e2918ff 100644
@@ -36,6 +36,10 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if defined(CONFIG_CMD_NET)
+static int i2c_read_mac(uchar *buffer);
+#endif
+
 int dram_init(void)
 {
 	/* Store complete RAM size and return */
@@ -136,6 +140,7 @@ int spear_board_init(ulong mach_type)
 	return 0;
 }
 
+#if defined(CONFIG_CMD_NET)
 static int i2c_read_mac(uchar *buffer)
 {
 	u8 buf[2];
@@ -172,17 +177,18 @@ static int write_mac(uchar *mac)
 		return 0;
 	}
 
-	puts("I2C EEPROM writing failed \n");
+	puts("I2C EEPROM writing failed\n");
 	return -1;
 }
+#endif
 
 int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	void (*sram_setfreq) (unsigned int, unsigned int);
+	unsigned int frequency;
+#if defined(CONFIG_CMD_NET)
 	unsigned char mac[6];
-	unsigned int reg, frequency;
-	char *s, *e;
-	char i2c_mac[20];
+#endif
 
 	if ((argc > 3) || (argc < 2))
 		return cmd_usage(cmdtp);
@@ -207,9 +213,12 @@ int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		}
 
 		return 0;
+
+#if defined(CONFIG_CMD_NET)
 	} else if (!strcmp(argv[1], "ethaddr")) {
 
-		s = argv[2];
+		u32 reg;
+		char *e, *s = argv[2];
 		for (reg = 0; reg < 6; ++reg) {
 			mac[reg] = s ? simple_strtoul(s, &e, 16) : 0;
 			if (s)
@@ -218,14 +227,15 @@ int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		write_mac(mac);
 
 		return 0;
+#endif
 	} else if (!strcmp(argv[1], "print")) {
+#if defined(CONFIG_CMD_NET)
 		if (!i2c_read_mac(mac)) {
-			sprintf(i2c_mac, "%pM", mac);
-			printf("Ethaddr (from i2c mem) = %s\n", i2c_mac);
+			printf("Ethaddr (from i2c mem) = %pM\n", mac);
 		} else {
 			printf("Ethaddr (from i2c mem) = Not set\n");
 		}
-
+#endif
 		return 0;
 	}
 
@@ -235,4 +245,7 @@ int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 U_BOOT_CMD(chip_config, 3, 1, do_chip_config,
 	   "configure chip",
 	   "chip_config cpufreq/ddrfreq frequency\n"
+#if defined(CONFIG_CMD_NET)
+	   "chip_config ethaddr XX:XX:XX:XX:XX:XX\n"
+#endif
 	   "chip_config print");
doc/README.spear +8 -0
index a8b1052..a6ff7fd 100644
@@ -46,3 +46,11 @@ Further options
 	make FLASH=PNOR (supported by SPEAr310 and SPEAr320)
 	- This option generates a uboot image that supports emi controller for
 	CFI compliant parallel NOR flash
+
+Mac id storage and retrieval in spear platforms
+
+Please read doc/README.enetaddr for the implementation guidelines for mac id
+usage. Basically, environment has precedence over board specific storage. The
+ethaddr beeing used for the network interface is always taken only from
+environment variables. Although, we can check the mac id programmed in i2c
+memory by using chip_config command
Signature · 1 line
1.7.2.2
author
#4 lore raw

PATCH v2 4/24 SPEAr: Configure network support for spear SoCs

In reply to Amit Virdi

From: Vipin KUMAR <[email protected]>

---
 arch/arm/include/asm/arch-spear/hardware.h |    1 +
 board/spear/spear300/spear300.c            |   10 ++++++++++
 board/spear/spear310/spear310.c            |   10 ++++++++++
 board/spear/spear320/spear320.c            |   10 ++++++++++
 board/spear/spear600/spear600.c            |   10 ++++++++++
 include/configs/spear-common.h             |   14 ++++++++++++--
 include/configs/spear3xx.h                 |    3 +++
 7 files changed, 56 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-spear/hardware.h +1 -0
index a6517b2..70fc030 100644
@@ -31,6 +31,7 @@
 #define CONFIG_SPEAR_SYSCNTLBASE		(0xFCA00000)
 #define CONFIG_SPEAR_TIMERBASE			(0xFC800000)
 #define CONFIG_SPEAR_MISCBASE			(0xFCA80000)
+#define CONFIG_SPEAR_ETHBASE			0xE0800000
 
 #define CONFIG_SYS_NAND_CLE			(1 << 16)
 #define CONFIG_SYS_NAND_ALE			(1 << 17)
board/spear/spear300/spear300.c +10 -0
index 32bcb77..3f7ccb8 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
 #include <linux/mtd/fsmc_nand.h>
@@ -57,3 +58,12 @@ int board_nand_init(struct nand_chip *nand)
 #endif
 	return -1;
 }
+
+int board_eth_init(bd_t *bis)
+{
+#if defined(CONFIG_DESIGNWARE_ETH)
+	return designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY);
+#else
+	return -1;
+#endif
+}
board/spear/spear310/spear310.c +10 -0
index 8b58218..8c5b5ba 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
 #include <linux/mtd/fsmc_nand.h>
@@ -58,3 +59,12 @@ int board_nand_init(struct nand_chip *nand)
 #endif
 	return -1;
 }
+
+int board_eth_init(bd_t *bis)
+{
+#if defined(CONFIG_DESIGNWARE_ETH)
+	return designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY);
+#else
+	return -1;
+#endif
+}
board/spear/spear320/spear320.c +10 -0
index 172ad35..b60acc2 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
 #include <linux/mtd/fsmc_nand.h>
@@ -58,3 +59,12 @@ int board_nand_init(struct nand_chip *nand)
 #endif
 	return -1;
 }
+
+int board_eth_init(bd_t *bis)
+{
+#if defined(CONFIG_DESIGNWARE_ETH)
+	return designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY);
+#else
+	return -1;
+#endif
+}
board/spear/spear600/spear600.c +10 -0
index 7cf63d6..5a32b7f 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
 #include <linux/mtd/fsmc_nand.h>
@@ -52,3 +53,12 @@ int board_nand_init(struct nand_chip *nand)
 #endif
 	return -1;
 }
+
+int board_eth_init(bd_t *bis)
+{
+#if defined(CONFIG_DESIGNWARE_ETH)
+	return designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY);
+#else
+	return -1;
+#endif
+}
include/configs/spear-common.h +12 -2
index 8f4973a..49b9cd3 100644
@@ -27,6 +27,14 @@
  * Common configurations used for both spear3xx as well as spear6xx
  */
 
+/* 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 */
+
 /* USBD driver configuration */
 #define CONFIG_DW_UDC
 #define CONFIG_USB_DEVICE
@@ -103,11 +111,13 @@
 #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>
-#undef CONFIG_CMD_NET
-#undef CONFIG_CMD_NFS
 
 /*
  * Default Environment Varible definitions
include/configs/spear3xx.h +3 -0
index 2a86c21..035b321 100644
@@ -41,6 +41,9 @@
 
 #include <configs/spear-common.h>
 
+/* Ethernet driver configuration */
+#define CONFIG_DW_ALTDESCRIPTOR			1
+
 /* Serial Configuration (PL011) */
 #define CONFIG_SYS_SERIAL0			0xD0000000
 
Signature · 1 line
1.7.2.2
author
#5 lore raw

PATCH v2 5/24 SPEAr: Add macb driver support for spear310 and spear320

In reply to Amit Virdi

From: Vipin KUMAR <[email protected]>

SPEAr310 and SPEAr320 SoCs have an extra ethernet controller. The driver for this device is already supported by u-boot, so configuring board configuration file and defining base addresses etc to make use of the common driver

---
 arch/arm/include/asm/arch-spear/clk.h      |   27 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-spear/hardware.h |    7 +++++++
 board/spear/spear310/spear310.c            |   25 ++++++++++++++++++++++---
 board/spear/spear320/spear320.c            |   12 +++++++++---
 include/configs/spear3xx.h                 |   13 +++++++++++++
 5 files changed, 78 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-spear/clk.h
arch/arm/include/asm/arch-spear/clk.h new file +27 -0
new file mode 100644
index 0000000..a45ec18
@@ -0,0 +1,27 @@
+/*
+ * (C) Copyright 2010
+ * Vipin Kumar, STMicroelectronics, <[email protected]>
+ *
+ * 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
+ */
+
+static inline unsigned long get_macb_pclk_rate(unsigned int dev_id)
+{
+	return 83000000;
+}
arch/arm/include/asm/arch-spear/hardware.h +7 -0
index 70fc030..0012dd7 100644
@@ -56,6 +56,11 @@
 #define CONFIG_SPEAR_EMIBASE			(0x4F000000)
 #define CONFIG_SPEAR_RASBASE			(0xB4000000)
 
+#define CONFIG_SYS_MACB0_BASE			0xB0000000
+#define CONFIG_SYS_MACB1_BASE			0xB0800000
+#define CONFIG_SYS_MACB2_BASE			0xB1000000
+#define CONFIG_SYS_MACB3_BASE			0xB1800000
+
 #elif defined(CONFIG_SPEAR320)
 #define CONFIG_SYS_I2C_BASE			(0xD0180000)
 #define CONFIG_SYS_FSMC_BASE			(0x4C000000)
@@ -63,5 +68,7 @@
 #define CONFIG_SPEAR_EMIBASE			(0x40000000)
 #define CONFIG_SPEAR_RASBASE			(0xB3000000)
 
+#define CONFIG_SYS_MACB0_BASE			0xAA000000
+
 #endif
 #endif /* _ASM_ARCH_HARDWARE_H */
board/spear/spear310/spear310.c +22 -3
index 8c5b5ba..f74bbac 100644
@@ -62,9 +62,28 @@ int board_nand_init(struct nand_chip *nand)
 
 int board_eth_init(bd_t *bis)
 {
+	int ret = 0;
+
 #if defined(CONFIG_DESIGNWARE_ETH)
-	return designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY);
-#else
-	return -1;
+	if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY) < 0)
+		ret += -1;
+#endif
+#if defined(CONFIG_MACB)
+	if (macb_eth_initialize(0, (void *)CONFIG_SYS_MACB0_BASE,
+				CONFIG_MACB0_PHY) < 0)
+		ret += -1;
+
+	if (macb_eth_initialize(1, (void *)CONFIG_SYS_MACB1_BASE,
+				CONFIG_MACB1_PHY) < 0)
+		ret += -1;
+
+	if (macb_eth_initialize(2, (void *)CONFIG_SYS_MACB2_BASE,
+				CONFIG_MACB2_PHY) < 0)
+		ret += -1;
+
+	if (macb_eth_initialize(3, (void *)CONFIG_SYS_MACB3_BASE,
+				CONFIG_MACB3_PHY) < 0)
+		ret += -1;
 #endif
+	return ret;
 }
board/spear/spear320/spear320.c +9 -3
index b60acc2..adddfd1 100644
@@ -62,9 +62,15 @@ int board_nand_init(struct nand_chip *nand)
 
 int board_eth_init(bd_t *bis)
 {
+	int ret = 0;
 #if defined(CONFIG_DESIGNWARE_ETH)
-	return designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY);
-#else
-	return -1;
+	if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY) < 0)
+		ret += -1;
+#endif
+#if defined(CONFIG_MACB)
+	if (macb_eth_initialize(0, (void *)CONFIG_SYS_MACB0_BASE,
+				CONFIG_MACB0_PHY) < 0)
+		ret += -1;
 #endif
+	return ret;
 }
include/configs/spear3xx.h +13 -0
index 035b321..f3e3354 100644
@@ -44,6 +44,19 @@
 /* Ethernet driver configuration */
 #define CONFIG_DW_ALTDESCRIPTOR			1
 
+#if defined(CONFIG_SPEAR310)
+#define CONFIG_MACB				1
+#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				1
+#define CONFIG_MACB0_PHY			0x01
+
+#endif
+
 /* Serial Configuration (PL011) */
 #define CONFIG_SYS_SERIAL0			0xD0000000
 
Signature · 1 line
1.7.2.2
author
#6 lore raw

PATCH v2 6/24 SPEAr: Add interface information in initialization

In reply to Amit Virdi

From: Vipin Kumar <[email protected]>

Few Designware peripheral registers need to be modified based on the ethernet interface selected by the board. This patch supports interface information in ethernet driver

---
 board/spear/spear300/spear300.c |   11 ++++++++---
 board/spear/spear310/spear310.c |   23 +++++++++++++----------
 board/spear/spear320/spear320.c |   22 ++++++++++++++++++----
 board/spear/spear600/spear600.c |   14 +++++++++++---
 drivers/net/designware.c        |   10 +++++++++-
 drivers/net/designware.h        |    1 +
 include/netdev.h                |    2 +-
 7 files changed, 61 insertions(+), 22 deletions(-)
board/spear/spear300/spear300.c +8 -3
index 3f7ccb8..bf3bbc5 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <miiphy.h>
 #include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
@@ -61,9 +62,13 @@ int board_nand_init(struct nand_chip *nand)
 
 int board_eth_init(bd_t *bis)
 {
+	int ret = 0;
+
 #if defined(CONFIG_DESIGNWARE_ETH)
-	return designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY);
-#else
-	return -1;
+	u32 interface = PHY_INTERFACE_MODE_MII;
+	if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY,
+				interface) >= 0)
+		ret++;
 #endif
+	return ret;
 }
board/spear/spear310/spear310.c +13 -10
index f74bbac..107b34b 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <miiphy.h>
 #include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
@@ -65,25 +66,27 @@ int board_eth_init(bd_t *bis)
 	int ret = 0;
 
 #if defined(CONFIG_DESIGNWARE_ETH)
-	if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY) < 0)
-		ret += -1;
+	u32 interface = PHY_INTERFACE_MODE_MII;
+	if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY,
+				interface) >= 0)
+		ret++;
 #endif
 #if defined(CONFIG_MACB)
 	if (macb_eth_initialize(0, (void *)CONFIG_SYS_MACB0_BASE,
-				CONFIG_MACB0_PHY) < 0)
-		ret += -1;
+				CONFIG_MACB0_PHY) >= 0)
+		ret++;
 
 	if (macb_eth_initialize(1, (void *)CONFIG_SYS_MACB1_BASE,
-				CONFIG_MACB1_PHY) < 0)
-		ret += -1;
+				CONFIG_MACB1_PHY) >= 0)
+		ret++;
 
 	if (macb_eth_initialize(2, (void *)CONFIG_SYS_MACB2_BASE,
-				CONFIG_MACB2_PHY) < 0)
-		ret += -1;
+				CONFIG_MACB2_PHY) >= 0)
+		ret++;
 
 	if (macb_eth_initialize(3, (void *)CONFIG_SYS_MACB3_BASE,
-				CONFIG_MACB3_PHY) < 0)
-		ret += -1;
+				CONFIG_MACB3_PHY) >= 0)
+		ret++;
 #endif
 	return ret;
 }
board/spear/spear320/spear320.c +18 -4
index adddfd1..ffe11ad 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <miiphy.h>
 #include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
@@ -31,8 +32,18 @@
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
 
+#define PLGPIO_SEL_36	0xb3000028
+#define PLGPIO_IO_36	0xb3000038
+
+static void spear_phy_reset(void)
+{
+	writel(0x10, PLGPIO_IO_36);
+	writel(0x10, PLGPIO_SEL_36);
+}
+
 int board_init(void)
 {
+	spear_phy_reset();
 	return spear_board_init(MACH_TYPE_SPEAR320);
 }
 
@@ -63,14 +74,17 @@ int board_nand_init(struct nand_chip *nand)
 int board_eth_init(bd_t *bis)
 {
 	int ret = 0;
+
 #if defined(CONFIG_DESIGNWARE_ETH)
-	if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY) < 0)
-		ret += -1;
+	u32 interface = PHY_INTERFACE_MODE_MII;
+	if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY,
+				interface) >= 0)
+		ret++;
 #endif
 #if defined(CONFIG_MACB)
 	if (macb_eth_initialize(0, (void *)CONFIG_SYS_MACB0_BASE,
-				CONFIG_MACB0_PHY) < 0)
-		ret += -1;
+				CONFIG_MACB0_PHY) >= 0)
+		ret++;
 #endif
 	return ret;
 }
board/spear/spear600/spear600.c +11 -3
index 5a32b7f..f592233 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <miiphy.h>
 #include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
@@ -56,9 +57,16 @@ int board_nand_init(struct nand_chip *nand)
 
 int board_eth_init(bd_t *bis)
 {
+	int ret = 0;
+
 #if defined(CONFIG_DESIGNWARE_ETH)
-	return designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY);
-#else
-	return -1;
+	u32 interface = PHY_INTERFACE_MODE_MII;
+#if defined(CONFIG_DW_AUTONEG)
+	interface = PHY_INTERFACE_MODE_GMII;
+#endif
+	if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY,
+				interface) >= 0)
+		ret++;
 #endif
+	return ret;
 }
drivers/net/designware.c +9 -1
index e8e669b..e263022 100644
@@ -171,6 +171,13 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
 	if (priv->speed != SPEED_1000M)
 		conf |= MII_PORTSELECT;
 
+	if ((priv->interface != PHY_INTERFACE_MODE_MII) &&
+		(priv->interface != PHY_INTERFACE_MODE_GMII)) {
+
+		if (priv->speed == SPEED_100M)
+			conf |= FES_100;
+	}
+
 	if (priv->duplex == FULL_DUPLEX)
 		conf |= FULLDPLXMODE;
 
@@ -532,7 +539,7 @@ static int dw_mii_write(const char *devname, u8 addr, u8 reg, u16 val)
 }
 #endif
 
-int designware_initialize(u32 id, ulong base_addr, u32 phy_addr)
+int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface)
 {
 	struct eth_device *dev;
 	struct dw_eth_dev *priv;
@@ -566,6 +573,7 @@ int designware_initialize(u32 id, ulong base_addr, u32 phy_addr)
 			DW_DMA_BASE_OFFSET);
 	priv->address = phy_addr;
 	priv->phy_configured = 0;
+	priv->interface = interface;
 
 	if (mac_reset(dev) < 0)
 		return -1;
drivers/net/designware.h +1 -0
index abf729d..40020bf 100644
@@ -234,6 +234,7 @@ struct dmamacdescr {
 
 struct dw_eth_dev {
 	u32 address;
+	u32 interface;
 	u32 speed;
 	u32 duplex;
 	u32 tx_currdescnum;
include/netdev.h +1 -1
index b0c21d5..bad1eaf 100644
@@ -52,7 +52,7 @@ int calxedaxgmac_initialize(u32 id, ulong base_addr);
 int cs8900_initialize(u8 dev_num, int base_addr);
 int davinci_emac_initialize(void);
 int dc21x4x_initialize(bd_t *bis);
-int designware_initialize(u32 id, ulong base_addr, u32 phy_addr);
+int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface);
 int dm9000_initialize(bd_t *bis);
 int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr);
 int e1000_initialize(bd_t *bis);
Signature · 1 line
1.7.2.2
author
#7 lore raw

PATCH v2 7/24 SPEAr: Add basic arch related support for SPEAr SoCs

In reply to Amit Virdi

From: Vipin KUMAR <[email protected]>

Earlier, architecture specific init code was mixed with board initialization code in board/spear/... This patch updates architecture support for SPEAr in latest u-boot and prints the SoC information.

---
 arch/arm/cpu/arm926ejs/spear/Makefile      |    3 +-
 arch/arm/cpu/arm926ejs/spear/cpu.c         |   82 ++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-spear/spr_misc.h |    7 +++
 include/configs/spear-common.h             |    2 +
 4 files changed, 93 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/spear/cpu.c
arch/arm/cpu/arm926ejs/spear/Makefile +2 -1
index f32ec4c..46923a4 100644
@@ -25,7 +25,8 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).o
 
-COBJS	:= reset.o \
+COBJS	:= cpu.o \
+	   reset.o \
 	   timer.o
 SOBJS	:=
 
arch/arm/cpu/arm926ejs/spear/cpu.c new file +82 -0

82 lines not on this page · raw message

arch/arm/include/asm/arch-spear/spr_misc.h +7 -0
index 8b96d9b..b10c726 100644
@@ -126,5 +126,12 @@ struct misc_regs {
 
 /* PERIPH1_CLKEN, PERIPH1_RST value */
 #define MISC_USBDENB			0x01000000
+#define MISC_ETHENB			0x00800000
+#define MISC_SMIENB			0x00200000
+#define MISC_GPT3ENB			0x00010000
+#define MISC_GPT2ENB			0x00000800
+#define MISC_FSMCENB			0x00000200
+#define MISC_I2CENB			0x00000080
+#define MISC_UART0ENB			0x00000008
 
 #endif
include/configs/spear-common.h +2 -0
index 49b9cd3..bf91d72 100644
@@ -182,6 +182,8 @@
 #define CONFIG_ENV_SIZE				0x02000
 
 /* Miscellaneous configurable options */
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_BOOT_PARAMS_ADDR			0x00000100
 #define CONFIG_CMDLINE_TAG			1
 #define CONFIG_SETUP_MEMORY_TAGS		1
Signature · 1 line
1.7.2.2
author
#8 lore raw

PATCH v2 8/24 SPEAr: Add configuration options for spear3xx and spear6xx boards

In reply to Amit Virdi

From: Vipin KUMAR <[email protected]>

This patch adds options for all the below mentioned configurations and subsequently renames the include/configs/spearxxx.h files to spear3xx_evb.h, spear6xx_evb.h etc to depict evaluation board configuration.

SPEAr3xx and SPEAr6xx boards can be compiled in following configurations
1. Environment placed in NAND
2. Console on usb device
3. Console on usb device with environment placed in NAND
4. SPEAr310 and SPEAr320 support environment variables in parallel NOR flash.

---
 board/spear/spear300/config.mk                 |   39 ------------------
 board/spear/spear310/config.mk                 |   44 ---------------------
 board/spear/spear320/config.mk                 |   44 ---------------------
 board/spear/spear600/config.mk                 |   39 ------------------
 boards.cfg                                     |   24 +++++++++--
 doc/README.spear                               |   50 ++++++++++++++++--------
 include/configs/spear-common.h                 |    3 +
 include/configs/{spear3xx.h => spear3xx_evb.h} |   10 +++++
 include/configs/{spear6xx.h => spear6xx_evb.h} |   10 +++++
 9 files changed, 77 insertions(+), 186 deletions(-)
 delete mode 100644 board/spear/spear300/config.mk
 delete mode 100644 board/spear/spear310/config.mk
 delete mode 100644 board/spear/spear320/config.mk
 delete mode 100644 board/spear/spear600/config.mk
 rename include/configs/{spear3xx.h => spear3xx_evb.h} (96%)
 rename include/configs/{spear6xx.h => spear6xx_evb.h} (89%)
board/spear/spear300/config.mk deleted +0 -39
deleted file mode 100644
index 5848ef8..0000000
@@ -1,39 +0,0 @@
-#
-# (C) Copyright 2009
-# Vipin Kumar, ST Microelectronics <[email protected]>
-#
-# 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
-#
-
-#########################################################################
-
-CONFIG_SYS_TEXT_BASE = 0x00700000
-
-ALL-y += $(obj)u-boot.img
-
-# Environment variables in NAND
-ifeq ($(ENV),NAND)
-PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_NAND
-else
-PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_FLASH
-endif
-
-ifeq ($(CONSOLE),USB)
-PLATFORM_RELFLAGS += -DCONFIG_SPEAR_USBTTY
-endif
board/spear/spear310/config.mk deleted +0 -44

44 lines not on this page · raw message

board/spear/spear320/config.mk deleted +0 -44

44 lines not on this page · raw message

board/spear/spear600/config.mk deleted +0 -39
deleted file mode 100644
index 5848ef8..0000000
@@ -1,39 +0,0 @@
-#
-# (C) Copyright 2009
-# Vipin Kumar, ST Microelectronics <[email protected]>
-#
-# 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
-#
-
-#########################################################################
-
-CONFIG_SYS_TEXT_BASE = 0x00700000
-
-ALL-y += $(obj)u-boot.img
-
-# Environment variables in NAND
-ifeq ($(ENV),NAND)
-PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_NAND
-else
-PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_FLASH
-endif
-
-ifeq ($(CONSOLE),USB)
-PLATFORM_RELFLAGS += -DCONFIG_SPEAR_USBTTY
-endif
boards.cfg +20 -4
index 28cc345..d03be63 100644
@@ -178,10 +178,26 @@ omap730p2_cs0boot	     arm         arm926ejs   omap730p2		 ti             omap
 omap730p2_cs3boot	     arm         arm926ejs   omap730p2		 ti             omap        omap730p2:CS3_BOOT
 edminiv2                     arm         arm926ejs   -                   LaCie          orion5x
 dkb			     arm         arm926ejs   -                   Marvell        pantheon
-spear300                     arm         arm926ejs   spear300            spear          spear       spear3xx:spear300
-spear310                     arm         arm926ejs   spear310            spear          spear       spear3xx:spear310
-spear320                     arm         arm926ejs   spear320            spear          spear       spear3xx:spear320
-spear600                     arm         arm926ejs   spear600            spear          spear       spear6xx:spear600
+spear300                     arm         arm926ejs   spear300            spear          spear       spear3xx_evb:spear300
+spear300_nand                arm         arm926ejs   spear300            spear          spear       spear3xx_evb:spear300,nand
+spear300_usbtty              arm         arm926ejs   spear300            spear          spear       spear3xx_evb:spear300,usbtty
+spear300_usbtty_nand         arm         arm926ejs   spear300            spear          spear       spear3xx_evb:spear300,usbtty,nand
+spear310                     arm         arm926ejs   spear310            spear          spear       spear3xx_evb:spear310
+spear310_pnor                arm         arm926ejs   spear310            spear          spear       spear3xx_evb:spear310,FLASH_PNOR
+spear310_nand                arm         arm926ejs   spear310            spear          spear       spear3xx_evb:spear310,nand
+spear310_usbtty              arm         arm926ejs   spear310            spear          spear       spear3xx_evb:spear310,usbtty
+spear310_usbtty_pnor         arm         arm926ejs   spear310            spear          spear       spear3xx_evb:spear310,usbtty,FLASH_PNOR
+spear310_usbtty_nand         arm         arm926ejs   spear310            spear          spear       spear3xx_evb:spear310,usbtty,nand
+spear320                     arm         arm926ejs   spear320            spear          spear       spear3xx_evb:spear320
+spear320_pnor                arm         arm926ejs   spear320            spear          spear       spear3xx_evb:spear320,FLASH_PNOR
+spear320_nand                arm         arm926ejs   spear320            spear          spear       spear3xx_evb:spear320,nand
+spear320_usbtty              arm         arm926ejs   spear320            spear          spear       spear3xx_evb:spear320,usbtty
+spear320_usbtty_pnor         arm         arm926ejs   spear320            spear          spear       spear3xx_evb:spear320,usbtty,FLASH_PNOR
+spear320_usbtty_nand         arm         arm926ejs   spear320            spear          spear       spear3xx_evb:spear320,usbtty,nand
+spear600                     arm         arm926ejs   spear600            spear          spear       spear6xx_evb:spear600
+spear600_nand                arm         arm926ejs   spear600            spear          spear       spear6xx_evb:spear600,nand
+spear600_usbtty              arm         arm926ejs   spear600            spear          spear       spear6xx_evb:spear600,usbtty
+spear600_usbtty_nand         arm         arm926ejs   spear600            spear          spear       spear6xx_evb:spear600,usbtty,nand
 versatileab                  arm         arm926ejs   versatile           armltd         versatile   versatile:ARCH_VERSATILE_AB
 versatilepb                  arm         arm926ejs   versatile           armltd         versatile   versatile:ARCH_VERSATILE_PB
 versatileqemu                arm         arm926ejs   versatile           armltd         versatile   versatile:ARCH_VERSATILE_QEMU,ARCH_VERSATILE_PB
doc/README.spear +34 -16

71 lines not on this page · raw message

include/configs/spear-common.h +3 -0
index bf91d72..b7ba6af 100644
@@ -27,6 +27,9 @@
  * 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
include/configs/spear3xx_evb.h renamed from include/configs/spear3xx.h +10 -0
similarity index 96%
rename from include/configs/spear3xx.h
rename to include/configs/spear3xx_evb.h
index f3e3354..d6fdc09 100644
@@ -39,6 +39,16 @@
 #define CONFIG_SPEAR320				1
 #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 */
include/configs/spear6xx_evb.h renamed from include/configs/spear6xx.h +10 -0
similarity index 89%
rename from include/configs/spear6xx.h
rename to include/configs/spear6xx_evb.h
index c5bcc30..18bd140 100644
@@ -30,6 +30,16 @@
  */
 #define CONFIG_SPEAR600				1
 
+#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>
 
 /* Serial Configuration (PL011) */
Signature · 1 line
1.7.2.2
author
#9 lore raw

PATCH v2 9/24 SPEAr: Remove unused flag (CONFIG_SYS_HZ_CLOCK)

In reply to Amit Virdi

From: Vipin KUMAR <[email protected]>

SPEAr doesn't need CONFIG_SYS_HZ_CLOCK. This commit removes it.

---
 include/configs/spear-common.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
include/configs/spear-common.h +0 -1
index b7ba6af..8103b8b 100644
@@ -60,7 +60,6 @@
 
 /* Timer, HZ specific defines */
 #define CONFIG_SYS_HZ				(1000)
-#define CONFIG_SYS_HZ_CLOCK			(8300000)
 
 /* Flash configuration */
 #if defined(CONFIG_FLASH_PNOR)
Signature · 1 line
1.7.2.2
author
#10 lore raw

PATCH v2 10/24 SPEAr: Change the default environment variables

In reply to Amit Virdi

From: Vipin KUMAR <[email protected]>

This patch modifies the default environment variables as:
1. Default bootargs:
- console=ttyAMA0,115200
- For environment present in NOR flash
root=/dev/mtdblock3
- For environment present in NAND flash
root=/dev/mtdblock7
- Removes "mem=" option
2. Introduces CONFIG_EXTRA_ENV_USBTTY as default usbtty env var even when usbtty is not selected
3. Add default definitions for nfsboot and ramboot
4. Add a new default environment variable(CONFIG_EXTRA_ENV_UNLOCK) for SPEAr310 and SPEAr320

Signifacance of CONFIG_EXTRA_ENV_USBTTY:
This environment variable is important for flashing utility to work. So if somebody accidently erases the env sector then also this variable must be preserved so that flashing utility functions properly.

Signifacance of CONFIG_EXTRA_ENV_UNLOCK:
This env variable is read by the cfi driver to unlock all flash sectors. This is necessary because the Parallel NOR flash connected on the spear310 and spear320 boards, M28W64, has all its sectors in locked state at reset and these have to be unlocked explicitly before being erased or written.

---
 include/configs/spear-common.h |   28 +++++++++++++++++++---------
 include/configs/spear3xx_evb.h |   10 ++++++++++
 include/configs/spear6xx_evb.h |    3 +++
 3 files changed, 32 insertions(+), 9 deletions(-)
include/configs/spear-common.h +19 -9
index 8103b8b..41eae81 100644
@@ -46,9 +46,7 @@
 #define CONFIG_USBD_PRODUCT_NAME		"SPEAr SoC"
 #define CONFIG_USBD_MANUFACTURER		"ST Microelectronics"
 
-#if defined(CONFIG_USB_TTY)
 #define CONFIG_EXTRA_ENV_USBTTY			"usbtty=cdc_acm\0"
-#endif
 
 /* I2C driver configuration */
 #define CONFIG_HARD_I2C
@@ -142,7 +140,7 @@
  */
 #define CONFIG_SYS_MONITOR_LEN			0x00040000
 #define CONFIG_ENV_SECT_SIZE			0x00010000
-#define CONFIG_FSMTDBLK				"/dev/mtdblock8 "
+#define CONFIG_FSMTDBLK				"/dev/mtdblock3 "
 
 #define CONFIG_BOOTCOMMAND			"bootm 0xf8050000"
 
@@ -168,19 +166,33 @@
 
 #define CONFIG_ENV_OFFSET			0x60000
 #define CONFIG_ENV_RANGE			0x10000
-#define CONFIG_FSMTDBLK				"/dev/mtdblock12 "
+#define CONFIG_FSMTDBLK				"/dev/mtdblock7 "
 
 #define CONFIG_BOOTCOMMAND			"nand read.jffs2 0x1600000 " \
 						"0x80000 0x4C0000; " \
 						"bootm 0x1600000"
 #endif
 
-#define CONFIG_BOOTARGS_NFS			"root=/dev/nfs ip=dhcp " \
-						"console=ttyS0 init=/bin/sh"
-#define CONFIG_BOOTARGS				"console=ttyS0 mem=128M "  \
+#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
 
 /* Miscellaneous configurable options */
@@ -212,8 +224,6 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET		1
 #define CONFIG_SYS_64BIT_VSPRINTF		1
 
-#define CONFIG_EXTRA_ENV_SETTINGS		CONFIG_EXTRA_ENV_USBTTY
-
 /* Stack sizes */
 #define CONFIG_STACKSIZE			(128*1024)
 
include/configs/spear3xx_evb.h +10 -0
index d6fdc09..d603785 100644
@@ -158,4 +158,14 @@
 
 #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 */
include/configs/spear6xx_evb.h +3 -0
index 18bd140..3e0f50b 100644
@@ -53,4 +53,7 @@
 #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 */
Signature · 1 line
1.7.2.2
author
#11 lore raw

PATCH v2 11/24 SPEAr: Initialize SNOR in early_board_init_f

In reply to Amit Virdi

flash reading is required earlier than flash_init is called since the env_init is called before flash_init. This makes the smi_init necessary before env_init being called.

---
 board/spear/common/spr_misc.c  |    8 ++++++++
 include/configs/spear-common.h |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)
board/spear/common/spr_misc.c +8 -0
index e2918ff..043c72a 100644
@@ -25,6 +25,7 @@
 #include <command.h>
 #include <i2c.h>
 #include <net.h>
+#include <linux/mtd/st_smi.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_emi.h>
@@ -54,6 +55,13 @@ void dram_init_banksize(void)
 	gd->bd->bi_dram[0].size = gd->ram_size;
 }
 
+int board_early_init_f()
+{
+#if defined(CONFIG_ST_SMI)
+	smi_init();
+#endif
+	return 0;
+}
 int misc_init_r(void)
 {
 #if defined(CONFIG_CMD_NET)
include/configs/spear-common.h +1 -0
index 41eae81..df8bec5 100644
@@ -197,6 +197,7 @@
 
 /* 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			1
Signature · 1 line
1.7.2.2
author
#12 lore raw

PATCH v2 12/24 SPEAr: Enable usb device high speed support

In reply to Amit Virdi

From: Vipin KUMAR <[email protected]>

This patch enables the support for usb high speed device for spear platform SOCs

---
 include/configs/spear-common.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/spear-common.h +1 -0
index df8bec5..ce01026 100644
@@ -41,6 +41,7 @@
 /* USBD driver configuration */
 #define CONFIG_DW_UDC
 #define CONFIG_USB_DEVICE
+#define CONFIG_USBD_HS
 #define CONFIG_USB_TTY
 
 #define CONFIG_USBD_PRODUCT_NAME		"SPEAr SoC"
Signature · 1 line
1.7.2.2
#13 lore raw

PATCH v2 12/24 SPEAr: Enable usb device high speed support

Dear Amit Virdi,

Quoted 1 line

From: Vipin KUMAR <[email protected]>

Cc me with usb related stuff please.

Does USBTTY work for you? Tom complained about it.

Quoted 15 lines

This patch enables the support for usb high speed device for spear platform SOCs

---
 include/configs/spear-common.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/include/configs/spear-common.h index df8bec5..ce01026 100644

include/configs/spear-common.h line 47

Quoted 7 lines
include/configs/spear-common.h +1 -0
@@ -41,6 +41,7 @@
 /* USBD driver configuration */
 #define CONFIG_DW_UDC
 #define CONFIG_USB_DEVICE
+#define CONFIG_USBD_HS
 #define CONFIG_USB_TTY
 
 #define CONFIG_USBD_PRODUCT_NAME		"SPEAr SoC"

Best regards,
Marek Vasut

author
#14 lore raw

PATCH v2 12/24 SPEAr: Enable usb device high speed support

Dear Marek,

Quoted 6 lines · Marek Vasut

Dear Amit Virdi,

Quoted 1 line

From: Vipin KUMAR<[email protected]>

Cc me with usb related stuff please.

Ok, I'll take care in future.

Quoted 2 lines

Does USBTTY work for you? Tom complained about it.

Yes it works and we haven't found any issue till date. Infact, Vipin has developed a tool for flashing using usbtty and we have been using it for quite long.

What kind of problems did Tom faced?

Best Regards
Amit Virdi

Quoted 26 lines
Quoted 15 lines

This patch enables the support for usb high speed device for spear platform SOCs

---
  include/configs/spear-common.h |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/include/configs/spear-common.h index df8bec5..ce01026 100644

include/configs/spear-common.h line 47

Quoted 7 lines
include/configs/spear-common.h +1 -0
@@ -41,6 +41,7 @@
  /* USBD driver configuration */
  #define CONFIG_DW_UDC
  #define CONFIG_USB_DEVICE
+#define CONFIG_USBD_HS
  #define CONFIG_USB_TTY
 
  #define CONFIG_USBD_PRODUCT_NAME		"SPEAr SoC"

Best regards,
Marek Vasut

#15 lore raw

PATCH v2 12/24 SPEAr: Enable usb device high speed support

Quoted 12 lines · Amit Virdi

Dear Marek,

Quoted 6 lines · Marek Vasut

Dear Amit Virdi,

Quoted 1 line

From: Vipin KUMAR<[email protected]>

Cc me with usb related stuff please.

Ok, I'll take care in future.

Quoted 8 lines
Quoted 2 lines

Does USBTTY work for you? Tom complained about it.

Yes it works and we haven't found any issue till date. Infact, Vipin has developed a tool for flashing using usbtty and we have been using it for quite long.

What kind of problems did Tom faced?

On a beagleboard it's acting like the buffer isn't being flushed at first. If I type 'help' after switching from UART I have to hit space a few times to see all the output.

Signature · 1 line
Tom
author
#16 lore raw

PATCH v2 13/24 SPEAr: Enable udc and usb-console support only for usbtty configuration

In reply to Amit Virdi

From: Vipin KUMAR <[email protected]>

This patch enables the UDC and usb-console support only for usbtty configurations

---
 include/configs/spear-common.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/configs/spear-common.h +3 -0
index ce01026..801cb90 100644
@@ -39,6 +39,7 @@
 #define CONFIG_PHY_RESET_DELAY			10000		/* in usec */
 
 /* USBD driver configuration */
+#if defined(CONFIG_SPEAR_USBTTY)
 #define CONFIG_DW_UDC
 #define CONFIG_USB_DEVICE
 #define CONFIG_USBD_HS
@@ -47,6 +48,8 @@
 #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 */
Signature · 1 line
1.7.2.2
author
#17 lore raw

PATCH v2 14/24 SPEAr: Enable autoneg for ethernet

In reply to Amit Virdi

From: Shiraz Hashim <[email protected]>

Enabling autoneg avoids situation on few phys with fixed configuration. For example, in one situation, nfs boot timed out when phy configuration is 100Mbps. In another situtation, when traffic is directed to SPEAr, either thru cross-cable or thru switch, the TFTP or DHCP command in u-boot starts to timeout very often.

When Autoneg is ON, same phys started working perfectly.

---
 include/configs/spear-common.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/spear-common.h +1 -0
index 801cb90..0ba4544 100644
@@ -37,6 +37,7 @@
 #define CONFIG_DW0_PHY				1
 #define CONFIG_NET_MULTI
 #define CONFIG_PHY_RESET_DELAY			10000		/* in usec */
+#define CONFIG_DW_AUTONEG
 
 /* USBD driver configuration */
 #if defined(CONFIG_SPEAR_USBTTY)
Signature · 1 line
1.7.2.2
author
#18 lore raw

PATCH v2 15/24 SPEAr: Enable dcache for fast file transfer

In reply to Amit Virdi

From: Shiraz Hashim <[email protected]>

Enable data cache with 1:1 mapping of DDR to enable fast file transfer over tty which was doing lot of copy.

This feature is enabled only for flashing operation i.e. when CONFIG_SPEAR_USBTTY is enabled.

This has been tested on SPEAr320, SPEAr600 and SPEAr900 evaluation boards.

Following figures show an estimate on the performance improvements. The test setup was a Linux host (not Windows) and involved measurement of only binary transfer time, through kermit. The flash erase and flash copy time would be unaffected by these patches.

Another thing is this that the timings remained more or less same across ARM9 and Cortex based devices, hence reporting only one of the cases.

Before Enhancements
===================

$ time ukermit.small -p /dev/ttyACM0 -f spear320_uImage.img
Downloading file: 100.00% completed(2014080/2014080 bytes)
real    0m41.228s
user    0m0.002s
sys     0m0.064s

After Enhancements
==================

$ time ukermit.large -p /dev/ttyACM0 -f spear320_uImage.img
Downloading file: 100.00% completed(2014080/2014080 bytes)
real    0m5.441s
user    0m0.001s
sys     0m0.001s
---
 board/spear/common/spr_misc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
board/spear/common/spr_misc.c +4 -0
index 043c72a..99a6595 100644
@@ -76,6 +76,10 @@ int misc_init_r(void)
 	setenv("stdin", "usbtty");
 	setenv("stdout", "usbtty");
 	setenv("stderr", "usbtty");
+
+#ifndef CONFIG_SYS_NO_DCACHE
+	dcache_enable();
+#endif
 #endif
 	return 0;
 }
Signature · 1 line
1.7.2.2
author
#19 lore raw

PATCH v2 16/24 SPEAr: Enable CONFIG_SYS_FLASH_PROTECTION

In reply to Amit Virdi

From: Vipin Kumar <[email protected]>

This patch enables flash protection(lock/unlock) for CFI devices. This is necessary because the Parallel NOR flash connected on the spear boards, M28W64, can be locked/unlocked on a sector basis. Moreover, all its sectors are in locked state at reset and these have to be unlocked explicitly before being erased or written.

---
 include/configs/spear3xx_evb.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/configs/spear3xx_evb.h +2 -0
index d603785..242e648 100644
@@ -111,6 +111,7 @@
 #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
@@ -126,6 +127,7 @@
 #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
Signature · 1 line
1.7.2.2
author
#20 lore raw

PATCH v2 17/24 SPEAr: Correct the definition of CONFIG_SYS_MONITOR_BASE

In reply to Amit Virdi

From: Vipin Kumar <[email protected]>

The below text is copy pasted from README
- CONFIG_SYS_MONITOR_BASE:
Physical start address of boot monitor code (set by make config files to be same as the text base address (TEXT_BASE) used when linking) - same as CONFIG_SYS_FLASH_BASE when booting from flash.

This patch corrects the definition of CONFIG_SYS_MONITOR_BASE and sets it to TEXT_BASE

---
 include/configs/spear-common.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/configs/spear-common.h +2 -2
index 0ba4544..def8daf 100644
@@ -161,8 +161,7 @@
 						"0x4C0000; bootm 0x1600000"
 #endif
 
-#define CONFIG_SYS_MONITOR_BASE			CONFIG_SYS_FLASH_BASE
-#define CONFIG_ENV_ADDR				(CONFIG_SYS_MONITOR_BASE + \
+#define CONFIG_ENV_ADDR				(CONFIG_SYS_FLASH_BASE + \
 						CONFIG_SYS_MONITOR_LEN)
 #elif defined(CONFIG_ENV_IS_IN_NAND)
 /*
@@ -199,6 +198,7 @@
 
 
 #define CONFIG_ENV_SIZE				0x02000
+#define CONFIG_SYS_MONITOR_BASE			CONFIG_SYS_TEXT_BASE
 
 /* Miscellaneous configurable options */
 #define CONFIG_ARCH_CPU_INIT
Signature · 1 line
1.7.2.2
author
#21 lore raw

PATCH v2 18/24 SPEAr: Enable CONFIG_SYS_FLASH_EMPTY_INFO macro

In reply to Amit Virdi

From: Vipin Kumar <[email protected]>

Enable CONFIG_SYS_FLASH_EMPTY_INFO macro to enable reporting of empty sector information through flinfo command.

---
 include/configs/spear-common.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/configs/spear-common.h +2 -1
index def8daf..97c278f 100644
@@ -81,7 +81,6 @@
 						CONFIG_SYS_CS1_FLASH_BASE}
 #define CONFIG_SYS_MAX_FLASH_SECT		128
 
-#define CONFIG_SYS_FLASH_EMPTY_INFO		1
 #define CONFIG_SYS_FLASH_ERASE_TOUT		(3 * CONFIG_SYS_HZ)
 #define CONFIG_SYS_FLASH_WRITE_TOUT		(3 * CONFIG_SYS_HZ)
 
@@ -230,6 +229,8 @@
 #define CONFIG_SYS_CONSOLE_INFO_QUIET		1
 #define CONFIG_SYS_64BIT_VSPRINTF		1
 
+#define CONFIG_SYS_FLASH_EMPTY_INFO
+
 /* Stack sizes */
 #define CONFIG_STACKSIZE			(128*1024)
 
Signature · 1 line
1.7.2.2
author
#22 lore raw

PATCH v2 19/24 SPEAr: Enable ONFI nand flash detection for spear3xx and 6xx and evb

In reply to Amit Virdi

From: Vipin Kumar <[email protected]>

---
 include/configs/spear-common.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/configs/spear-common.h +2 -0
index 97c278f..76248e6 100644
@@ -105,6 +105,8 @@
 #define CONFIG_NAND_FSMC
 #define CONFIG_SYS_MAX_NAND_DEVICE		1
 #define CONFIG_MTD_NAND_VERIFY_WRITE		1
+#define CONFIG_SYS_NAND_ONFI_DETECTION
+#define CONFIG_SYS_NAND_QUIET_TEST
 
 /*
  * Command support defines
Signature · 1 line
1.7.2.2
author
#23 lore raw

PATCH v2 20/24 SPEAr: Remove CONFIG_MTD_NAND_VERIFY_WRITE to speed up NAND access

In reply to Amit Virdi

When CONFIG_MTD_NAND_VERIFY_WRITE is defined, nand driver read back the data everytime it writes. This process unnecessarily slows down the nand access.

---
 include/configs/spear-common.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
include/configs/spear-common.h +0 -1
index 76248e6..673f483 100644
@@ -104,7 +104,6 @@
 #define CONFIG_MTD_PARTITIONS
 #define CONFIG_NAND_FSMC
 #define CONFIG_SYS_MAX_NAND_DEVICE		1
-#define CONFIG_MTD_NAND_VERIFY_WRITE		1
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_SYS_NAND_QUIET_TEST
 
Signature · 1 line
1.7.2.2
author
#24 lore raw

PATCH v2 21/24 SPEAr: explicitly select clk src for UART

In reply to Amit Virdi

From: Shiraz Hashim <[email protected]>

UART in u-boot intends to run on 48MHz clock supplied by USB PLL. Explicitly select the intended clock source.

---
 arch/arm/cpu/arm926ejs/spear/cpu.c         |    7 ++++++-
 arch/arm/include/asm/arch-spear/spr_misc.h |    2 ++
 2 files changed, 8 insertions(+), 1 deletions(-)
arch/arm/cpu/arm926ejs/spear/cpu.c +6 -1
index 9e074bc..e299de3 100644
@@ -30,7 +30,7 @@ int arch_cpu_init(void)
 {
 	struct misc_regs *const misc_p =
 	    (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
-	u32 periph1_clken;
+	u32 periph1_clken, periph_clk_cfg;
 
 	periph1_clken = readl(&misc_p->periph1_clken);
 
@@ -42,6 +42,11 @@ int arch_cpu_init(void)
 
 #if defined(CONFIG_PL011_SERIAL)
 	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;
+	writel(periph_clk_cfg, &misc_p->periph_clk_cfg);
 #endif
 #if defined(CONFIG_DESIGNWARE_ETH)
 	periph1_clken |= MISC_ETHENB;
arch/arm/include/asm/arch-spear/spr_misc.h +2 -0
index b10c726..384944d 100644
@@ -110,6 +110,8 @@ struct misc_regs {
 /* PERIPH_CLK_CFG value */
 #define MISC_GPT3SYNTH			0x00000400
 #define MISC_GPT4SYNTH			0x00000800
+#define CONFIG_SPEAR_UART48M		0
+#define CONFIG_SPEAR_UARTCLKMSK		(0x1 << 4)
 
 /* PRSC_CLK_CFG value */
 /*
Signature · 1 line
1.7.2.2
author
#25 lore raw

PATCH v2 22/24 SPEAr: Correct SoC ID offset in misc configuration space

In reply to Amit Virdi

From: Shiraz Hashim <[email protected]>

SoC Core ID offset is 0x30 in miscellaneous configuration address space. It was wrongly mentioned as periph2 clk enable.

---
 arch/arm/include/asm/arch-spear/spr_misc.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/include/asm/arch-spear/spr_misc.h +1 -1
index 384944d..b8fcf49 100644
@@ -37,7 +37,7 @@ struct misc_regs {
 	u32 amba_clk_cfg;	/* 0x24 */
 	u32 periph_clk_cfg;	/* 0x28 */
 	u32 periph1_clken;	/* 0x2C */
-	u32 periph2_clken;	/* 0x30 */
+	u32 soc_core_id;	/* 0x30 */
 	u32 ras_clken;		/* 0x34 */
 	u32 periph1_rst;	/* 0x38 */
 	u32 periph2_rst;	/* 0x3C */
Signature · 1 line
1.7.2.2
author
#26 lore raw

PATCH v2 23/24 cleanup/SPEAr: Remove unnecessary parenthesis

In reply to Amit Virdi

In SPEAr configuration files, unnecessary paranthesis are used in some \#defines. Remove them as they serve no purpose

---
 arch/arm/include/asm/arch-spear/spr_gpt.h |    4 ++--
 include/configs/spear-common.h            |    8 ++++----
 include/configs/spear3xx_evb.h            |    6 +++---
 include/configs/spear6xx_evb.h            |    2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/include/asm/arch-spear/spr_gpt.h +2 -2
index 965b5ab..d95ba52 100644
@@ -79,7 +79,7 @@ struct gpt_regs {
 #define GPT_FREE_RUNNING		0xFFFF
 
 /* Timer, HZ specific defines */
-#define CONFIG_SPEAR_HZ			(1000)
-#define CONFIG_SPEAR_HZ_CLOCK		(8300000)
+#define CONFIG_SPEAR_HZ			1000
+#define CONFIG_SPEAR_HZ_CLOCK		8300000
 
 #endif
include/configs/spear-common.h +4 -4
index 673f483..aee5815 100644
@@ -62,7 +62,7 @@
 #define CONFIG_I2C_CHIPADDRESS			0x50
 
 /* Timer, HZ specific defines */
-#define CONFIG_SYS_HZ				(1000)
+#define CONFIG_SYS_HZ				1000
 
 /* Flash configuration */
 #if defined(CONFIG_FLASH_PNOR)
@@ -74,9 +74,9 @@
 #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_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
include/configs/spear3xx_evb.h +3 -3
index 242e648..d63c9df 100644
@@ -150,13 +150,13 @@
 #define CONFIG_SYS_FSMC_NAND_8BIT
 
 #if defined(CONFIG_SPEAR300)
-#define CONFIG_SYS_NAND_BASE			(0x80000000)
+#define CONFIG_SYS_NAND_BASE			0x80000000
 
 #elif defined(CONFIG_SPEAR310)
-#define CONFIG_SYS_NAND_BASE			(0x40000000)
+#define CONFIG_SYS_NAND_BASE			0x40000000
 
 #elif defined(CONFIG_SPEAR320)
-#define CONFIG_SYS_NAND_BASE			(0x50000000)
+#define CONFIG_SYS_NAND_BASE			0x50000000
 
 #endif
 
include/configs/spear6xx_evb.h +1 -1
index 3e0f50b..4a76134 100644
@@ -51,7 +51,7 @@
 /* NAND flash configuration */
 #define CONFIG_SYS_FSMC_NAND_SP
 #define CONFIG_SYS_FSMC_NAND_8BIT
-#define CONFIG_SYS_NAND_BASE			(0xD2000000)
+#define CONFIG_SYS_NAND_BASE			0xD2000000
 
 /* Environment Settings */
 #define CONFIG_EXTRA_ENV_SETTINGS              CONFIG_EXTRA_ENV_USBTTY
Signature · 1 line
1.7.2.2
author
#27 lore raw

PATCH v2 24/24 cleanup/SPEAr: Define configuration flags more elegantly

In reply to Amit Virdi

In SPEAr, some of the configuration flags eg. CONFIG_SPEAR_EMI, were given value "1", which isn't required. Define the flags without assigning any value

---
 include/configs/spear-common.h |   16 ++++++++--------
 include/configs/spear3xx_evb.h |   20 ++++++++++----------
 include/configs/spear6xx_evb.h |    2 +-
 3 files changed, 19 insertions(+), 19 deletions(-)
include/configs/spear-common.h +8 -8
index aee5815..766a315 100644
@@ -66,7 +66,7 @@
 
 /* Flash configuration */
 #if defined(CONFIG_FLASH_PNOR)
-#define CONFIG_SPEAR_EMI			1
+#define CONFIG_SPEAR_EMI
 #else
 #define CONFIG_ST_SMI
 #endif
@@ -205,11 +205,11 @@
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_BOOT_PARAMS_ADDR			0x00000100
-#define CONFIG_CMDLINE_TAG			1
-#define CONFIG_SETUP_MEMORY_TAGS		1
-#define CONFIG_MISC_INIT_R			1
-#define CONFIG_ZERO_BOOTDELAY_CHECK		1
-#define CONFIG_AUTOBOOT_KEYED			1
+#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
@@ -227,8 +227,8 @@
 #define CONFIG_SYS_MAXARGS			16
 #define CONFIG_SYS_BARGSIZE			CONFIG_SYS_CBSIZE
 #define CONFIG_SYS_LOAD_ADDR			0x00800000
-#define CONFIG_SYS_CONSOLE_INFO_QUIET		1
-#define CONFIG_SYS_64BIT_VSPRINTF		1
+#define CONFIG_SYS_CONSOLE_INFO_QUIET
+#define CONFIG_SYS_64BIT_VSPRINTF
 
 #define CONFIG_SYS_FLASH_EMPTY_INFO
 
include/configs/spear3xx_evb.h +10 -10
index d63c9df..3cd56dc 100644
@@ -29,14 +29,14 @@
  * (easy to change)
  */
 #if defined(CONFIG_spear300)
-#define CONFIG_SPEAR3XX				1
-#define CONFIG_SPEAR300				1
+#define CONFIG_SPEAR3XX
+#define CONFIG_SPEAR300
 #elif defined(CONFIG_spear310)
-#define CONFIG_SPEAR3XX				1
-#define CONFIG_SPEAR310				1
+#define CONFIG_SPEAR3XX
+#define CONFIG_SPEAR310
 #elif defined(CONFIG_spear320)
-#define CONFIG_SPEAR3XX				1
-#define CONFIG_SPEAR320				1
+#define CONFIG_SPEAR3XX
+#define CONFIG_SPEAR320
 #endif
 
 #if defined(CONFIG_usbtty)
@@ -52,17 +52,17 @@
 #include <configs/spear-common.h>
 
 /* Ethernet driver configuration */
-#define CONFIG_DW_ALTDESCRIPTOR			1
+#define CONFIG_DW_ALTDESCRIPTOR
 
 #if defined(CONFIG_SPEAR310)
-#define CONFIG_MACB				1
+#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				1
+#define CONFIG_MACB
 #define CONFIG_MACB0_PHY			0x01
 
 #endif
@@ -141,7 +141,7 @@
 #endif
 
 #define CONFIG_SYS_MAX_FLASH_SECT		(127 + 8)
-#define CONFIG_SYS_FLASH_QUIET_TEST		1
+#define CONFIG_SYS_FLASH_QUIET_TEST
 
 #endif
 
include/configs/spear6xx_evb.h +1 -1
index 4a76134..31b8725 100644
@@ -28,7 +28,7 @@
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_SPEAR600				1
+#define CONFIG_SPEAR600
 
 #if defined(CONFIG_usbtty)
 #define CONFIG_SPEAR_USBTTY
Signature · 1 line
1.7.2.2