Skip to contentSkip to conversation

Support for SPEAr13xx boards added

PATCH New Vipin KUMAR 4 participants 46 messages Jul 14, 2010 – Aug 1, 2010

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

cover Support for SPEAr13xx boards added

The following patch-set adds the support for the following
1. SPEAr13xx boards (SPEAr1300 and SPEAr1310)
2. Addition of High speed support for USB device for usbtty framework
3. Miscellneous fixes in Network and FSMC (NAND controller) drivers

Please consider the patch-set for inclusion in the mainline

Please make sure that the following patches can be applied only after the following Network driver patch which Ben has already accepted in his tree 5b1b1883ffcb75de71a0b4e66b279c88ae1e15fc : SPEAr : Network driver support added

Regards
Vipin

Armando Visconti (1):
SPEAr1300: Workaround the UHC problem (issue #101435)

Vipin KUMAR (26):
change_bit routine defined
SPEAr : SMI erase and write timeouts increased
SPEAr : Placing ethaddr write and read within CONFIG_CMD_NET SPEAr : Reducing the max RAM size to 128MB
SPEAr : Basic arch related support added for SPEAr SoCs SPEAr : Network support configured for spear SoCs
SPEAr : macb driver support added for spear310 and spear320 SPEAr : FSMC driver support added
SPEAr : Configuring FSMC driver for NAND interface
SPEAr : i2c driver moved completely into drivers/i2c SPEAr : smi driver moved completely into drivers/mtd SPEAr : USB Device Controller driver support added
SPEAr : Supporting various configurations for spear3xx and spear6xx
boards
SPEAr : Basic spear1300 architecture support added
SPEAr : spear1300 SoC support added
SPEAr : Removing extraneous code
SPEAr : USB device controller bugfixes
SPEAr : Network driver fixes.
SPEAr : Changing the default environment variable bootargs Enable high speed support for usb device framework and usbtty SPEAr : High speed support for designware peripheral SPEAr : Enable usb device high speed support
SPEAr : Network support configuration
SPEAr : Enabling GPT clock explicitly
SPEAr : smi_init moved to board_init
SPEAr : Ethernet issue workaround is not needed when uboot is acting
as flashing

Vipin Kumar (1):
SPEAr1310 : spear1310 support added

 MAINTAINERS                                        |    2 +
 MAKEALL                                            |    2 +
 Makefile                                           |   41 ++-
 arch/arm/cpu/arm926ejs/spear/Makefile              |    3 +-
 arch/arm/cpu/arm926ejs/spear/cpu.c                 |   84 ++++
 arch/arm/cpu/arm_cortexa8/spear13xx/Makefile       |   52 +++
 arch/arm/cpu/arm_cortexa8/spear13xx/ca9_ltimer.c   |  136 +++++++
 arch/arm/cpu/arm_cortexa8/spear13xx/cache.S        |  114 ++++++
 arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c          |  133 +++++++
 .../arm/cpu/arm_cortexa8/spear13xx/reset.c         |   40 +-
 .../arm/include/asm/arch-spear/clk.h               |   26 +-
 arch/arm/include/asm/arch-spear/hardware.h         |   16 +-
 arch/arm/include/asm/arch-spear/spr_misc.h         |    7 +
 .../arm/include/asm/arch-spear13xx/ca9_ltimer.h    |   36 +-
 .../arm/include/asm/arch-spear13xx/hardware.h      |   35 +-
 arch/arm/include/asm/arch-spear13xx/spr_misc.h     |  317 ++++++++++++++++
 .../arm/include/asm/arch-spear13xx/sys_proto.h     |   29 +-
 arch/arm/include/asm/bitops.h                      |   11 +-
 board/spear/common/Makefile                        |   12 +-
 .../spear/common/spr13xx_lowlevel_init.S           |   35 +-
 .../spear/common/spr13xx_misc.c                    |   48 +--
 board/spear/common/spr_misc.c                      |   32 ++-
 board/spear/spear1300/Makefile                     |   51 +++
 board/spear/spear1300/config.mk                    |   28 ++
 board/spear/spear1300/spear1300.c                  |   70 ++++
 board/spear/spear1310/Makefile                     |   51 +++
 board/spear/spear1310/config.mk                    |   28 ++
 board/spear/spear1310/spear1310.c                  |   70 ++++
 board/spear/spear300/config.mk                     |   11 -
 board/spear/spear300/spear300.c                    |   18 +-
 board/spear/spear310/config.mk                     |   11 -
 board/spear/spear310/spear310.c                    |   35 ++-
 board/spear/spear320/config.mk                     |   11 -
 board/spear/spear320/spear320.c                    |   23 +-
 board/spear/spear600/config.mk                     |   11 -
 board/spear/spear600/spear600.c                    |   18 +-
 doc/README.spear                                   |   51 ++-
 drivers/i2c/Makefile                               |    2 +-
 drivers/i2c/{spr_i2c.c => designware_i2c.c}        |    4 +-
 .../spr_i2c.h => drivers/i2c/designware_i2c.h      |    6 +-
 drivers/mtd/Makefile                               |    2 +-
 drivers/mtd/nand/Makefile                          |    2 +-
 drivers/mtd/nand/fsmc_nand.c                       |  401 ++++++++++++++++++++
 drivers/mtd/nand/spr_nand.c                        |  124 ------
 drivers/mtd/{spr_smi.c => st_smi.c}                |   61 ++--
 drivers/net/designware.c                           |    8 +-
 drivers/net/designware.h                           |    2 +-
 drivers/serial/usbtty.h                            |    4 +-
 drivers/usb/gadget/Makefile                        |    2 +-
 drivers/usb/gadget/{spr_udc.c => designware_udc.c} |  123 ++++---
 include/configs/spear-common.h                     |   50 ++-
 include/configs/spear13xx_evb.h                    |  225 +++++++++++
 include/configs/{spear3xx.h => spear3xx_evb.h}     |   31 ++
 include/configs/{spear6xx.h => spear6xx_evb.h}     |   12 +
 include/linux/mtd/fsmc_nand.h                      |  108 ++++++
 .../spr_smi.h => include/linux/mtd/st_smi.h        |   10 +-
 include/usb/{spr_udc.h => designware_udc.h}        |    9 +-
 57 files changed, 2424 insertions(+), 460 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/spear/cpu.c
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/Makefile
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/ca9_ltimer.c
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/cache.S
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c
 copy include/configs/spear6xx.h => arch/arm/cpu/arm_cortexa8/spear13xx/reset.c (55%)
 mode change 100644 => 100755
 copy include/configs/spear6xx.h => arch/arm/include/asm/arch-spear/clk.h (64%)
 copy include/configs/spear6xx.h => arch/arm/include/asm/arch-spear13xx/ca9_ltimer.h (55%)
 copy include/configs/spear6xx.h => arch/arm/include/asm/arch-spear13xx/hardware.h (54%)
 create mode 100644 arch/arm/include/asm/arch-spear13xx/spr_misc.h
 copy include/configs/spear6xx.h => arch/arm/include/asm/arch-spear13xx/sys_proto.h (64%)
 copy include/configs/spear6xx.h => board/spear/common/spr13xx_lowlevel_init.S (56%)
 rename arch/arm/include/asm/arch-spear/spr_nand.h => board/spear/common/spr13xx_misc.c (52%)
 create mode 100644 board/spear/spear1300/Makefile
 create mode 100644 board/spear/spear1300/config.mk
 create mode 100644 board/spear/spear1300/spear1300.c
 create mode 100644 board/spear/spear1310/Makefile
 create mode 100644 board/spear/spear1310/config.mk
 create mode 100644 board/spear/spear1310/spear1310.c
 rename drivers/i2c/{spr_i2c.c => designware_i2c.c} (98%)
 rename arch/arm/include/asm/arch-spear/spr_i2c.h => drivers/i2c/designware_i2c.h (98%)
 create mode 100644 drivers/mtd/nand/fsmc_nand.c
 delete mode 100644 drivers/mtd/nand/spr_nand.c
 rename drivers/mtd/{spr_smi.c => st_smi.c} (94%)
 rename drivers/usb/gadget/{spr_udc.c => designware_udc.c} (90%)
 create mode 100644 include/configs/spear13xx_evb.h
 rename include/configs/{spear3xx.h => spear3xx_evb.h} (85%)
 rename include/configs/{spear6xx.h => spear6xx_evb.h} (84%)
 create mode 100644 include/linux/mtd/fsmc_nand.h
 rename arch/arm/include/asm/arch-spear/spr_smi.h => include/linux/mtd/st_smi.h (95%)
 rename include/usb/{spr_udc.h => designware_udc.h} (97%)
#1 lore raw

PATCH 1/28 change_bit routine defined

From: Vipin KUMAR <[email protected]>

change_bit routine is left implementation dependent until now. This routine is now defined for arm platforms in asm-arm/bitops.h

The Flexible Static memory controller driver, placed in mtd/nand/fsmc_nand.c needs this routine. FSMC is a memory controller peripheral from ST. The new driver implements the NAND interface part of the peripheral.

---
 arch/arm/include/asm/bitops.h |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
arch/arm/include/asm/bitops.h +9 -2
index 270f163..435857b 100644
@@ -29,8 +29,6 @@ extern void set_bit(int nr, volatile void * addr);
 
 extern void clear_bit(int nr, volatile void * addr);
 
-extern void change_bit(int nr, volatile void * addr);
-
 static inline void __change_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = BIT_MASK(nr);
@@ -39,6 +37,15 @@ static inline void __change_bit(int nr, volatile void *addr)
 	*p ^= mask;
 }
 
+static inline void change_bit(int nr, volatile void *addr)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	__change_bit(nr, addr);
+	local_irq_restore(flags);
+}
+
 static inline int __test_and_set_bit(int nr, volatile void *addr)
 {
 	unsigned long mask = BIT_MASK(nr);
Signature · 1 line
1.6.0.2
#2 lore raw

PATCH 2/28 SPEAr : SMI erase and write timeouts increased

From: Vipin KUMAR <[email protected]>

SMI driver fails because of low timeout values. Increasing the write mode timeout and transfer timeouts to 15 ms

---
 arch/arm/include/asm/arch-spear/spr_smi.h |    4 +-
 drivers/mtd/spr_smi.c                     |   57 ++++++++++++++++++-----------
 2 files changed, 38 insertions(+), 23 deletions(-)
arch/arm/include/asm/arch-spear/spr_smi.h +2 -2
index 06df745..0cca000 100644
@@ -109,7 +109,7 @@ struct flash_dev {
 };
 
 #define SFLASH_PAGE_SIZE	0x100	/* flash page size */
-#define XFER_FINISH_TOUT	2	/* xfer finish timeout */
-#define WMODE_TOUT		2	/* write enable timeout */
+#define XFER_FINISH_TOUT	15	/* xfer finish timeout(in ms) */
+#define WMODE_TOUT		15	/* write enable timeout(in ms) */
 
 #endif
drivers/mtd/spr_smi.c +36 -21

133 lines not on this page · raw message

Signature · 1 line
1.6.0.2
#3 lore raw

PATCH 3/28 SPEAr : Placing ethaddr write and read within CONFIG_CMD_NET

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 |   28 +++++++++++++++++++++-------
 doc/README.spear              |    8 ++++++++
 2 files changed, 29 insertions(+), 7 deletions(-)
board/spear/common/spr_misc.c +21 -7
index d99036b..1148984 100644
@@ -38,6 +38,10 @@
 DECLARE_GLOBAL_DATA_PTR;
 static struct chip_data chip_data;
 
+#if defined(CONFIG_CMD_NET)
+static int i2c_read_mac(uchar *buffer);
+#endif
+
 int dram_init(void)
 {
 	struct xloader_table *xloader_tb =
@@ -166,6 +170,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];
@@ -205,15 +210,17 @@ static int write_mac(uchar *mac)
 	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);
 	struct chip_data *chip = &chip_data;
+	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)) {
 		cmd_usage(cmdtp);
@@ -244,9 +251,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)
@@ -255,6 +265,7 @@ 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 (chip->cpufreq == -1)
@@ -274,13 +285,13 @@ int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		else
 			printf("DDR Type    = Not Known\n");
 
+#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
 		printf("Xloader Rev = %s\n", chip->version);
 
 		return 0;
@@ -293,4 +304,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.6.0.2
#4 lore raw

PATCH 4/28 SPEAr : Reducing the max RAM size to 128MB

From: Vipin KUMAR <[email protected]>

---
 include/configs/spear-common.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/configs/spear-common.h +1 -1
index cc52e39..b526558 100644
@@ -208,6 +208,6 @@
 /* Physical Memory Map */
 #define CONFIG_NR_DRAM_BANKS			1
 #define PHYS_SDRAM_1				0x00000000
-#define PHYS_SDRAM_1_MAXSIZE			0x40000000
+#define PHYS_SDRAM_1_MAXSIZE			0x08000000
 
 #endif
Signature · 1 line
1.6.0.2
#5 lore raw

PATCH 5/28 SPEAr : Basic arch related support added for SPEAr SoCs

From: Vipin KUMAR <[email protected]>

Adding CONFIG_DISPLAY_CPUINFO and CONFIG_ARCH_CPU_INIT support for SPEAr3xx and SPEAr6xx SoCs

CONFIG_DISPLAY_CPUINFO includes the built CPU related information

Earlier, architecture specific init code was mixed with board initialization code in board/spear/...
CONFIG_ARCH_CPU_INIT includes the architecture specific initialisation code with in arch/arm/spear/cpu.c

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

78 lines not on this page · raw message

arch/arm/include/asm/arch-spear/spr_misc.h +5 -0
index 8b96d9b..045d2bb 100644
@@ -126,5 +126,10 @@ struct misc_regs {
 
 /* PERIPH1_CLKEN, PERIPH1_RST value */
 #define MISC_USBDENB			0x01000000
+#define MISC_ETHENB			0x00800000
+#define MISC_SMIENB			0x00200000
+#define MISC_FSMCENB			0x00000200
+#define MISC_I2CENB			0x00000080
+#define MISC_UART0ENB			0x00000008
 
 #endif
include/configs/spear-common.h +2 -0
index b526558..10beef7 100644
@@ -168,6 +168,8 @@
 #define CONFIG_ENV_SIZE				0x02000
 
 /* Miscellaneous configurable options */
+#define CONFIG_ARCH_CPU_INIT			1
+#define CONFIG_DISPLAY_CPUINFO			1
 #define CONFIG_BOOT_PARAMS_ADDR			0x00000100
 #define CONFIG_CMDLINE_TAG			1
 #define CONFIG_SETUP_MEMORY_TAGS		1
Signature · 1 line
1.6.0.2
#6 lore raw

PATCH 6/28 SPEAr : Network support configured for spear SoCs

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 818f36c..39d64b6 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 60ee544..774f466 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
@@ -56,3 +57,12 @@ int board_nand_init(struct nand_chip *nand)
 
 	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 03dfe16..f25eedf 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
@@ -57,3 +58,12 @@ int board_nand_init(struct nand_chip *nand)
 
 	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 2ba2dbb..1ed05aa 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
@@ -57,3 +58,12 @@ int board_nand_init(struct nand_chip *nand)
 
 	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 eef9a37..cd7ff2c 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
@@ -51,3 +52,12 @@ int board_nand_init(struct nand_chip *nand)
 
 	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 10beef7..1398837 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_SPEARUDC
 #define CONFIG_USB_DEVICE
@@ -99,11 +107,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 0248aba..502c50f 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.6.0.2
#7 lore raw

PATCH 7/28 SPEAr : macb driver support added for spear310 and spear320

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 39d64b6..9f1e154 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_SPEAR_FSMCBASE			(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 f25eedf..96f1e00 100644
@@ -61,9 +61,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 1ed05aa..c3208e2 100644
@@ -61,9 +61,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 502c50f..689d914 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.6.0.2
#8 lore raw

PATCH 8/28 SPEAr : FSMC driver support added

From: Vipin KUMAR <[email protected]>

Flexible static memory controller is a peripheral provided by ST, which controls the access to NAND chips along with many other memory device chips eg NOR, SRAM.

This patch adds the driver support for FSMC controller interfacing with NAND memory.

---
 drivers/mtd/nand/Makefile     |    1 +
 drivers/mtd/nand/fsmc_nand.c  |  401 +++++++++++++++++++++++++++++++++++++++++
 include/linux/mtd/fsmc_nand.h |  108 +++++++++++
 3 files changed, 510 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/nand/fsmc_nand.c
 create mode 100644 include/linux/mtd/fsmc_nand.h
drivers/mtd/nand/Makefile +1 -0
index 28f27da..4c6b54f 100644
@@ -38,6 +38,7 @@ COBJS-$(CONFIG_DRIVER_NAND_BFIN) += bfin_nand.o
 COBJS-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
+COBJS-$(CONFIG_NAND_FSMC) += fsmc_nand.o
 COBJS-$(CONFIG_NAND_KB9202) += kb9202_nand.o
 COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
 COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o
drivers/mtd/nand/fsmc_nand.c new file +401 -0

401 lines not on this page · raw message

include/linux/mtd/fsmc_nand.h new file +108 -0

108 lines not on this page · raw message

Signature · 1 line
1.6.0.2
#9 lore raw

PATCH 9/28 SPEAr : Configuring FSMC driver for NAND interface

From: Vipin KUMAR <[email protected]>

Since FSMC is a standard IP and it supports different memory interfaces, it is supported independent of spear platform and spear is configured to use that driver for interfacing with the NAND device

Spear platform uses generic FSMC driver and spear specific files i.e drivers/mtd/nand/spr_nand.c, arch/arm/include/asm/arch-spear/spr_nand.h are removed

---
 arch/arm/include/asm/arch-spear/hardware.h |    8 +-
 arch/arm/include/asm/arch-spear/spr_nand.h |   57 -------------
 board/spear/spear300/spear300.c            |    7 +-
 board/spear/spear310/spear310.c            |    7 +-
 board/spear/spear320/spear320.c            |    7 +-
 board/spear/spear600/spear600.c            |    7 +-
 drivers/mtd/nand/Makefile                  |    1 -
 drivers/mtd/nand/spr_nand.c                |  124 ----------------------------
 include/configs/spear-common.h             |    2 +-
 include/configs/spear3xx.h                 |    4 +
 include/configs/spear6xx.h                 |    3 +
 11 files changed, 28 insertions(+), 199 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-spear/spr_nand.h
 delete mode 100644 drivers/mtd/nand/spr_nand.c
arch/arm/include/asm/arch-spear/hardware.h +4 -4
index 9f1e154..52037b6 100644
@@ -38,15 +38,15 @@
 
 #if defined(CONFIG_SPEAR600)
 #define CONFIG_SYS_I2C_BASE			(0xD0200000)
-#define CONFIG_SPEAR_FSMCBASE			(0xD1800000)
+#define CONFIG_SYS_FSMC_BASE			(0xD1800000)
 
 #elif defined(CONFIG_SPEAR300)
 #define CONFIG_SYS_I2C_BASE			(0xD0180000)
-#define CONFIG_SPEAR_FSMCBASE			(0x94000000)
+#define CONFIG_SYS_FSMC_BASE			(0x94000000)
 
 #elif defined(CONFIG_SPEAR310)
 #define CONFIG_SYS_I2C_BASE			(0xD0180000)
-#define CONFIG_SPEAR_FSMCBASE			(0x44000000)
+#define CONFIG_SYS_FSMC_BASE			(0x44000000)
 
 #undef CONFIG_SYS_NAND_CLE
 #undef CONFIG_SYS_NAND_ALE
@@ -63,7 +63,7 @@
 
 #elif defined(CONFIG_SPEAR320)
 #define CONFIG_SYS_I2C_BASE			(0xD0180000)
-#define CONFIG_SPEAR_FSMCBASE			(0x4C000000)
+#define CONFIG_SYS_FSMC_BASE			(0x4C000000)
 
 #define CONFIG_SPEAR_EMIBASE			(0x40000000)
 #define CONFIG_SPEAR_RASBASE			(0xB3000000)
arch/arm/include/asm/arch-spear/spr_nand.h deleted +0 -57

57 lines not on this page · raw message

board/spear/spear300/spear300.c +4 -3
index 774f466..3f7ccb8 100644
@@ -25,10 +25,10 @@
 #include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -47,14 +47,15 @@ int board_nand_init(struct nand_chip *nand)
 	struct misc_regs *const misc_regs_p =
 	    (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
 	if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
 	     MISC_SOCCFG30) ||
 	    ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
 	     MISC_SOCCFG31)) {
 
-		return spear_nand_init(nand);
+		return fsmc_nand_init(nand);
 	}
-
+#endif
 	return -1;
 }
 
board/spear/spear310/spear310.c +4 -3
index 96f1e00..f74bbac 100644
@@ -26,10 +26,10 @@
 #include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -48,14 +48,15 @@ int board_nand_init(struct nand_chip *nand)
 	struct misc_regs *const misc_regs_p =
 	    (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
 	if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
 	     MISC_SOCCFG30) ||
 	    ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
 	     MISC_SOCCFG31)) {
 
-		return spear_nand_init(nand);
+		return fsmc_nand_init(nand);
 	}
-
+#endif
 	return -1;
 }
 
board/spear/spear320/spear320.c +4 -3
index c3208e2..adddfd1 100644
@@ -26,10 +26,10 @@
 #include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -48,14 +48,15 @@ int board_nand_init(struct nand_chip *nand)
 	struct misc_regs *const misc_regs_p =
 	    (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
 	if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
 	     MISC_SOCCFG30) ||
 	    ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
 	     MISC_SOCCFG31)) {
 
-		return spear_nand_init(nand);
+		return fsmc_nand_init(nand);
 	}
-
+#endif
 	return -1;
 }
 
board/spear/spear600/spear600.c +4 -3
index cd7ff2c..5a32b7f 100644
@@ -25,10 +25,10 @@
 #include <netdev.h>
 #include <nand.h>
 #include <asm/io.h>
+#include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_defs.h>
 #include <asm/arch/spr_misc.h>
-#include <asm/arch/spr_nand.h>
 
 int board_init(void)
 {
@@ -47,9 +47,10 @@ int board_nand_init(struct nand_chip *nand)
 	struct misc_regs *const misc_regs_p =
 	    (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
 
+#if defined(CONFIG_NAND_FSMC)
 	if (!(readl(&misc_regs_p->auto_cfg_reg) & MISC_NANDDIS))
-		return spear_nand_init(nand);
-
+		return fsmc_nand_init(nand);
+#endif
 	return -1;
 }
 
drivers/mtd/nand/Makefile +0 -1
index 4c6b54f..36fc8b3 100644
@@ -48,7 +48,6 @@ COBJS-$(CONFIG_NAND_NDFC) += ndfc.o
 COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
 COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
 COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
-COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o
 COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o
 endif
drivers/mtd/nand/spr_nand.c deleted +0 -124

124 lines not on this page · raw message

include/configs/spear-common.h +1 -1
index 1398837..a54d534 100644
@@ -94,7 +94,7 @@
 #define CONFIG_SYS_LOADS_BAUD_CHANGE
 
 /* NAND FLASH Configuration */
-#define CONFIG_NAND_SPEAR			1
+#define CONFIG_NAND_FSMC			1
 #define CONFIG_SYS_MAX_NAND_DEVICE		1
 #define CONFIG_MTD_NAND_VERIFY_WRITE		1
 
include/configs/spear3xx.h +4 -0
index 689d914..fde505c 100644
@@ -133,6 +133,10 @@
 
 #endif
 
+/* NAND flash configuration */
+#define CONFIG_SYS_FSMC_NAND_SP			1
+#define CONFIG_SYS_FSMC_NAND_8BIT		1
+
 #if defined(CONFIG_SPEAR300)
 #define CONFIG_SYS_NAND_BASE			(0x80000000)
 
include/configs/spear6xx.h +3 -0
index 2ad5beb..2532344 100644
@@ -38,6 +38,9 @@
 #define CONFIG_PL01x_PORTS			{ (void *)CONFIG_SYS_SERIAL0, \
 						(void *)CONFIG_SYS_SERIAL1 }
 
+/* NAND flash configuration */
+#define CONFIG_SYS_FSMC_NAND_SP			1
+#define CONFIG_SYS_FSMC_NAND_8BIT		1
 #define CONFIG_SYS_NAND_BASE			(0xD2000000)
 
 #endif  /* __CONFIG_H */
Signature · 1 line
1.6.0.2
#10 lore raw

PATCH 10/28 SPEAr : i2c driver moved completely into drivers/i2c

From: Vipin KUMAR <[email protected]>

The earlier i2c driver was specific to spear platforms. This patch implements the i2c controller as a generic driver which can be used by multiple platforms

The driver files are now renamed to designware_i2c.c and designware_i2c.h and these are moved into drivers/i2c folder for reusability by other platforms

---
 drivers/i2c/Makefile                               |    2 +-
 drivers/i2c/{spr_i2c.c => designware_i2c.c}        |    4 ++--
 .../spr_i2c.h => drivers/i2c/designware_i2c.h      |    6 +++---
 include/configs/spear-common.h                     |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
 rename drivers/i2c/{spr_i2c.c => designware_i2c.c} (98%)
 rename arch/arm/include/asm/arch-spear/spr_i2c.h => drivers/i2c/designware_i2c.h (98%)
drivers/i2c/Makefile +1 -1
index d2c2515..099a6cd 100644
@@ -27,6 +27,7 @@ LIB	:= $(obj)libi2c.a
 
 COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
 COBJS-$(CONFIG_DRIVER_DAVINCI_I2C) += davinci_i2c.o
+COBJS-$(CONFIG_DW_I2C) += designware_i2c.o
 COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_KIRKWOOD) += kirkwood_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
@@ -38,7 +39,6 @@ COBJS-$(CONFIG_PPC4XX_I2C) += ppc4xx_i2c.o
 COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
 COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o
 COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
-COBJS-$(CONFIG_SPEAR_I2C) += spr_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 
 COBJS	:= $(COBJS-y)
drivers/i2c/designware_i2c.c renamed from drivers/i2c/spr_i2c.c +2 -2
similarity index 98%
rename from drivers/i2c/spr_i2c.c
rename to drivers/i2c/designware_i2c.c
index eabfe84..d352146 100644
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
-#include <asm/arch/spr_i2c.h>
+#include "designware_i2c.h"
 
 static struct i2c_regs *const i2c_regs_p =
     (struct i2c_regs *)CONFIG_SYS_I2C_BASE;
@@ -113,7 +113,7 @@ int i2c_get_bus_speed(void)
 /*
  * i2c_init - Init function
  * @speed:	required i2c speed
- * @slaveadd:	slave address for the spear device
+ * @slaveadd:	slave address for the device
  *
  * Initialization function.
  */
drivers/i2c/designware_i2c.h renamed from arch/arm/include/asm/arch-spear/spr_i2c.h +3 -3
similarity index 98%
rename from arch/arm/include/asm/arch-spear/spr_i2c.h
rename to drivers/i2c/designware_i2c.h
index 7521ebc..03b520e 100644
@@ -21,8 +21,8 @@
  * MA 02111-1307 USA
  */
 
-#ifndef __SPR_I2C_H_
-#define __SPR_I2C_H_
+#ifndef __DW_I2C_H_
+#define __DW_I2C_H_
 
 struct i2c_regs {
 	u32 ic_con;
@@ -143,4 +143,4 @@ struct i2c_regs {
 #define I2C_FAST_SPEED		400000
 #define I2C_STANDARD_SPEED	100000
 
-#endif /* __SPR_I2C_H_ */
+#endif /* __DW_I2C_H_ */
include/configs/spear-common.h +1 -1
index a54d534..2393bdf 100644
@@ -47,7 +47,7 @@
 
 /* I2C driver configuration */
 #define CONFIG_HARD_I2C
-#define CONFIG_SPEAR_I2C
+#define CONFIG_DW_I2C
 #define CONFIG_SYS_I2C_SPEED			400000
 #define CONFIG_SYS_I2C_SLAVE			0x02
 
Signature · 1 line
1.6.0.2
#11 lore raw

PATCH 11/28 SPEAr : smi driver moved completely into drivers/mtd

From: Vipin KUMAR <[email protected]>

SMI is the serial memory interface controller provided by ST.

The earlier driver was specific to spear platform. The driver files are renamed to st_smi.c and st_smi.h and moved into drivers/mtd folder for reusability by other platforms using smi controller peripheral.

---
 drivers/mtd/Makefile                               |    2 +-
 drivers/mtd/{spr_smi.c => st_smi.c}                |    2 +-
 .../arch-spear/spr_smi.h => drivers/mtd/st_smi.h   |    4 ++--
 include/configs/spear-common.h                     |    6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)
 rename drivers/mtd/{spr_smi.c => st_smi.c} (99%)
 rename arch/arm/include/asm/arch-spear/spr_smi.h => drivers/mtd/st_smi.h (99%)
drivers/mtd/Makefile +1 -1
index cbf6f15..d868d27 100644
@@ -34,7 +34,7 @@ COBJS-$(CONFIG_FLASH_CFI_MTD) += cfi_mtd.o
 COBJS-$(CONFIG_HAS_DATAFLASH) += dataflash.o
 COBJS-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
 COBJS-$(CONFIG_MW_EEPROM) += mw_eeprom.o
-COBJS-$(CONFIG_SPEARSMI) += spr_smi.o
+COBJS-$(CONFIG_ST_SMI) += st_smi.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/mtd/st_smi.c renamed from drivers/mtd/spr_smi.c +1 -1
similarity index 99%
rename from drivers/mtd/spr_smi.c
rename to drivers/mtd/st_smi.c
index c6ba951..5193c1c 100644
@@ -27,7 +27,7 @@
 
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
-#include <asm/arch/spr_smi.h>
+#include "st_smi.h"
 
 #if !defined(CONFIG_SYS_NO_FLASH)
 
drivers/mtd/st_smi.h renamed from arch/arm/include/asm/arch-spear/spr_smi.h +2 -2
similarity index 99%
rename from arch/arm/include/asm/arch-spear/spr_smi.h
rename to drivers/mtd/st_smi.h
index 0cca000..afab546 100644
@@ -21,8 +21,8 @@
  * MA 02111-1307 USA
  */
 
-#ifndef SPR_SMI_H
-#define SPR_SMI_H
+#ifndef ST_SMI_H
+#define ST_SMI_H
 
 /* 0xF800.0000 . 0xFBFF.FFFF	64MB	SMI (Serial Flash Mem) */
 /* 0xFC00.0000 . 0xFC1F.FFFF	2MB	SMI (Serial Flash Reg.) */
include/configs/spear-common.h +3 -3
index 2393bdf..4aa0c15 100644
@@ -61,10 +61,10 @@
 #if defined(CONFIG_FLASH_PNOR)
 #define CONFIG_SPEAR_EMI			1
 #else
-#define CONFIG_SPEARSMI				1
+#define CONFIG_ST_SMI				1
 #endif
 
-#if defined(CONFIG_SPEARSMI)
+#if defined(CONFIG_ST_SMI)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS		2
 #define CONFIG_SYS_FLASH_BASE			(0xF8000000)
@@ -130,7 +130,7 @@
  * U-Boot Environment placing definitions.
  */
 #if defined(CONFIG_ENV_IS_IN_FLASH)
-#ifdef CONFIG_SPEARSMI
+#ifdef CONFIG_ST_SMI
 /*
  * Environment is in serial NOR flash
  */
Signature · 1 line
1.6.0.2
#12 lore raw

PATCH 12/28 SPEAr : USB Device Controller driver support added

From: Vipin KUMAR <[email protected]>

The earlier usb device controller driver was specific to spear platforms. This patch implements the usb device controller driver as a generic controller which can be reused by other platforms using this peripheral.

---
 drivers/serial/usbtty.h                            |    4 +-
 drivers/usb/gadget/Makefile                        |    2 +-
 drivers/usb/gadget/{spr_udc.c => designware_udc.c} |   57 ++++++++++----------
 include/configs/spear-common.h                     |    4 +-
 include/usb/{spr_udc.h => designware_udc.h}        |    6 +-
 5 files changed, 37 insertions(+), 36 deletions(-)
 rename drivers/usb/gadget/{spr_udc.c => designware_udc.c} (94%)
 rename include/usb/{spr_udc.h => designware_udc.h} (98%)
drivers/serial/usbtty.h +2 -2
index a23169a..38b407f 100644
@@ -33,8 +33,8 @@
 #include <usb/musb_udc.h>
 #elif defined(CONFIG_PXA27X)
 #include <usb/pxa27x_udc.h>
-#elif defined(CONFIG_SPEAR3XX) || defined(CONFIG_SPEAR600)
-#include <usb/spr_udc.h>
+#elif defined(CONFIG_DW_UDC)
+#include <usb/designware_udc.h>
 #endif
 
 #include <version_autogenerated.h>
drivers/usb/gadget/Makefile +1 -1
index 1d7362d..3820f36 100644
@@ -28,11 +28,11 @@ LIB	:= $(obj)libusb_gadget.a
 ifdef CONFIG_USB_DEVICE
 COBJS-y += core.o
 COBJS-y += ep0.o
+COBJS-$(CONFIG_DW_UDC) += designware_udc.o
 COBJS-$(CONFIG_OMAP1510) += omap1510_udc.o
 COBJS-$(CONFIG_OMAP1610) += omap1510_udc.o
 COBJS-$(CONFIG_MPC885_FAMILY) += mpc8xx_udc.o
 COBJS-$(CONFIG_PXA27X) += pxa27x_udc.o
-COBJS-$(CONFIG_SPEARUDC) += spr_udc.o
 endif
 
 COBJS	:= $(COBJS-y)
drivers/usb/gadget/designware_udc.c renamed from drivers/usb/gadget/spr_udc.c +28 -29

204 lines not on this page · raw message

include/configs/spear-common.h +3 -1
index 4aa0c15..c03520b 100644
@@ -36,14 +36,16 @@
 #define CONFIG_PHY_RESET_DELAY			(10000)		/* in usec */
 
 /* USBD driver configuration */
-#define CONFIG_SPEARUDC
+#define CONFIG_DW_UDC
 #define CONFIG_USB_DEVICE
 #define CONFIG_USB_TTY
 
 #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
include/usb/designware_udc.h renamed from include/usb/spr_udc.h +3 -3
similarity index 98%
rename from include/usb/spr_udc.h
rename to include/usb/designware_udc.h
index 2c332d5..ae98e8c 100644
@@ -21,8 +21,8 @@
  * MA 02111-1307 USA
  */
 
-#ifndef __SPR_UDC_H
-#define __SPR_UDC_H
+#ifndef __DW_UDC_H
+#define __DW_UDC_H
 
 /*
  * Defines for  USBD
@@ -227,4 +227,4 @@ void udc_startup_events(struct usb_device_instance *device);
 void udc_setup_ep(struct usb_device_instance *device, unsigned int ep,
 		  struct usb_endpoint_instance *endpoint);
 
-#endif /* __SPR_UDC_H */
+#endif /* __DW_UDC_H */
Signature · 1 line
1.6.0.2
#13 lore raw

PATCH 13/28 SPEAr : Supporting various configurations for spear3xx and spear6xx boards

From: Vipin KUMAR <[email protected]>

spear3xx and 6xx 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

Also, renaming the include/configs/spearxxx.h files to spear3xx_evb.h, spear6xx_evb.h etc to depict evaluation board configuration.

---
 Makefile                                       |   25 +++++++++++++++----
 board/spear/spear300/config.mk                 |   11 --------
 board/spear/spear310/config.mk                 |   11 --------
 board/spear/spear320/config.mk                 |   11 --------
 board/spear/spear600/config.mk                 |   11 --------
 doc/README.spear                               |   31 +++++++++++++++++-------
 include/configs/{spear3xx.h => spear3xx_evb.h} |   10 +++++++
 include/configs/{spear6xx.h => spear6xx_evb.h} |   10 +++++++
 8 files changed, 62 insertions(+), 58 deletions(-)
 rename include/configs/{spear3xx.h => spear3xx_evb.h} (95%)
 rename include/configs/{spear6xx.h => spear6xx_evb.h} (88%)
Makefile +20 -5
index 1d87f37..e264c50 100644
@@ -2088,12 +2088,27 @@ omap730p2_cs3boot_config :	unconfig
 	@$(MKCONFIG) -n $@ -a omap730p2 arm arm926ejs omap730p2 ti omap
 
 spear300_config \
+spear300_nand_config \
+spear300_usbtty_config \
+spear300_usbtty_nand_config \
 spear310_config \
-spear320_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear3xx arm arm926ejs $(@:_config=) spear spear
-
-spear600_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear6xx arm arm926ejs $(@:_config=) spear spear
+spear310_nand_config \
+spear310_usbtty_config \
+spear310_usbtty_nand_config \
+spear320_config \
+spear320_nand_config \
+spear320_usbtty_config \
+spear320_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $@ spear3xx_evb arm arm926ejs $(@:_config=) spear spear
+
+spear600_config \
+spear600_nand_config \
+spear600_usbtty_config \
+spear600_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs $(@:_config=) spear spear
+
+suen3_config:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs km_arm keymile kirkwood
 
 SX1_stdout_serial_config \
 SX1_config:		unconfig
board/spear/spear300/config.mk +0 -11
index 35646f2..0bbb40f 100644
@@ -26,14 +26,3 @@
 TEXT_BASE = 0x00700000
 
 ALL += $(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 +0 -11
index cba8436..c8264c3 100644
@@ -27,18 +27,7 @@ TEXT_BASE = 0x00700000
 
 ALL += $(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
-
 # Support parallel flash
 ifeq ($(FLASH),PNOR)
 PLATFORM_RELFLAGS += -DCONFIG_FLASH_PNOR
 endif
-
-ifeq ($(CONSOLE),USB)
-PLATFORM_RELFLAGS += -DCONFIG_SPEAR_USBTTY
-endif
board/spear/spear320/config.mk +0 -11
index cba8436..c8264c3 100644
@@ -27,18 +27,7 @@ TEXT_BASE = 0x00700000
 
 ALL += $(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
-
 # Support parallel flash
 ifeq ($(FLASH),PNOR)
 PLATFORM_RELFLAGS += -DCONFIG_FLASH_PNOR
 endif
-
-ifeq ($(CONSOLE),USB)
-PLATFORM_RELFLAGS += -DCONFIG_SPEAR_USBTTY
-endif
board/spear/spear600/config.mk +0 -11
index 35646f2..0bbb40f 100644
@@ -26,14 +26,3 @@
 TEXT_BASE = 0x00700000
 
 ALL += $(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
doc/README.spear +22 -9
index a6ff7fd..3161e64 100644
@@ -6,9 +6,9 @@ SPEAr600 is also known as SPEArPlus and SPEAr300 is also known as SPEArBasic
 The SPEAr SoC family embeds a customizable logic that can be programmed
 one-time by a customer at silicon mask level (i.e. not at runtime!).
 
-We are now adding the support in u-boot for two SoC: SPEAr600 and SPEAr3xx.
+U-Boot supports four SoCs: SPEAr600, SPEAr3xx
 
-All 4 SoCs share common peripherals.
+All 4 SoCs (SPEAr3xx and SPEAr600) share common peripherals.
 
 1. ARM926ejs core based (sp600 has two cores, the 2nd handled only in Linux)
 2. FastEthernet (sp600 has Gbit version, but same controller - GMAC)
@@ -22,7 +22,7 @@ All 4 SoCs share common peripherals.
 10. others ..
 
 Everything is supported in Linux.
-u-boot is not currently supporting all peripeharls (just a few as listed below).
+u-boot is currently not supporting all peripeharls (just a few as listed below).
 1. USB Device
 2. NAND controller (FSMC)
 3. Serial Memory Interface
@@ -32,17 +32,30 @@ u-boot is not currently supporting all peripeharls (just a few as listed below).
 
 Build options
 	make spear600_config
+		spear600 build with environment variables placed at default
+		location i.e. Serial NOR device
+	make spear600_nand_config
+		spear600 build with environment variables placed in NAND device
+	make spear600_usbtty_config
+		spear600 build with usbtty terminal as default and environment
+		placed at default location
+	make spear600_usbtty_nand_config
+		Build with usbtty terminal as default and environment placed in
+		NAND device
 	make spear300_config
+	make spear300_nand_config
+	make spear300_usbtty_config
+	make spear300_usbtty_nand_config
 	make spear310_config
+	make spear310_nand_config
+	make spear310_usbtty_config
+	make spear310_usbtty_nand_config
 	make spear320_config
+	make spear320_nand_config
+	make spear320_usbtty_config
+	make spear320_usbtty_nand_config
 
 Further options
-	make ENV=NAND (supported by all 4 SoCs)
-	- This option generates a uboot image that saves environment inn NAND
-
-	make CONSOLE=USB (supported by all 4 SoCs)
-	- This option generates a uboot image for using usbdevice as a tty i/f
-
 	make FLASH=PNOR (supported by SPEAr310 and SPEAr320)
 	- This option generates a uboot image that supports emi controller for
 	CFI compliant parallel NOR flash
include/configs/spear3xx_evb.h renamed from include/configs/spear3xx.h +10 -0
similarity index 95%
rename from include/configs/spear3xx.h
rename to include/configs/spear3xx_evb.h
index fde505c..f0c915e 100644
@@ -39,6 +39,16 @@
 #define CONFIG_SPEAR320				1
 #endif
 
+#if defined(CONFIG_MK_usbtty)
+#define CONFIG_SPEAR_USBTTY			1
+#endif
+
+#if defined(CONFIG_MK_nand)
+#define CONFIG_ENV_IS_IN_NAND			1
+#else
+#define CONFIG_ENV_IS_IN_FLASH			1
+#endif
+
 #include <configs/spear-common.h>
 
 /* Ethernet driver configuration */
include/configs/spear6xx_evb.h renamed from include/configs/spear6xx.h +10 -0
similarity index 88%
rename from include/configs/spear6xx.h
rename to include/configs/spear6xx_evb.h
index 2532344..82d24df 100644
@@ -30,6 +30,16 @@
  */
 #define CONFIG_SPEAR600				1
 
+#if defined(CONFIG_MK_usbtty)
+#define CONFIG_SPEAR_USBTTY			1
+#endif
+
+#if defined(CONFIG_MK_nand)
+#define CONFIG_ENV_IS_IN_NAND			1
+#else
+#define CONFIG_ENV_IS_IN_FLASH			1
+#endif
+
 #include <configs/spear-common.h>
 
 /* Serial Configuration (PL011) */
Signature · 1 line
1.6.0.2
#14 lore raw

PATCH 14/28 SPEAr : Basic spear1300 architecture support added

From: Vipin KUMAR <[email protected]>

SPEAr1300 is an ARMCortexA9 dual core based SoC which supports multiple peripherals such as

1. Ethernet Controller
2. USB Device Controller
3. USB Host Controllers
4. MTD interfaces for NAND and NOR(serial and parallel) flash devices etc

For more information, visit www.st.com/spear

This patch adds the architecture support for spear1300.

---
 arch/arm/cpu/arm_cortexa8/spear13xx/Makefile     |   52 ++++
 arch/arm/cpu/arm_cortexa8/spear13xx/ca9_ltimer.c |  136 +++++++++
 arch/arm/cpu/arm_cortexa8/spear13xx/cache.S      |  114 ++++++++
 arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c        |   96 +++++++
 arch/arm/cpu/arm_cortexa8/spear13xx/reset.c      |   47 ++++
 arch/arm/include/asm/arch-spear13xx/ca9_ltimer.h |   43 +++
 arch/arm/include/asm/arch-spear13xx/hardware.h   |   42 +++
 arch/arm/include/asm/arch-spear13xx/spr_misc.h   |  317 ++++++++++++++++++++++
 arch/arm/include/asm/arch-spear13xx/sys_proto.h  |   34 +++
 9 files changed, 881 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/Makefile
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/ca9_ltimer.c
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/cache.S
 create mode 100644 arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c
 create mode 100755 arch/arm/cpu/arm_cortexa8/spear13xx/reset.c
 create mode 100644 arch/arm/include/asm/arch-spear13xx/ca9_ltimer.h
 create mode 100644 arch/arm/include/asm/arch-spear13xx/hardware.h
 create mode 100644 arch/arm/include/asm/arch-spear13xx/spr_misc.h
 create mode 100644 arch/arm/include/asm/arch-spear13xx/sys_proto.h
arch/arm/cpu/arm_cortexa8/spear13xx/Makefile new file +52 -0
new file mode 100644
index 0000000..a1e17d4
@@ -0,0 +1,52 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2008
+# Guennadi Liakhovetki, DENX Software Engineering, <[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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(SOC).a
+
+COBJS	+= ca9_ltimer.o
+COBJS	+= cpu.o
+COBJS	+= reset.o
+
+SOBJS	= cache.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+all:	 $(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/arm/cpu/arm_cortexa8/spear13xx/ca9_ltimer.c new file +136 -0

136 lines not on this page · raw message

arch/arm/cpu/arm_cortexa8/spear13xx/cache.S new file +114 -0

114 lines not on this page · raw message

arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c new file +96 -0

96 lines not on this page · raw message

arch/arm/cpu/arm_cortexa8/spear13xx/reset.c new file +47 -0

47 lines not on this page · raw message

arch/arm/include/asm/arch-spear13xx/ca9_ltimer.h new file +43 -0

43 lines not on this page · raw message

arch/arm/include/asm/arch-spear13xx/hardware.h new file +42 -0

42 lines not on this page · raw message

arch/arm/include/asm/arch-spear13xx/spr_misc.h new file +317 -0

317 lines not on this page · raw message

arch/arm/include/asm/arch-spear13xx/sys_proto.h new file +34 -0
new file mode 100644
index 0000000..98b9a6b
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2010
+ * Vipin Kumar, STMicroelectronics, <[email protected]>
+ *
+ * Based on arch/arm/include/asm/arch-omap3/sys_proto.h
+ *
+ * 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 _SYS_PROTO_H_
+#define _SYS_PROTO_H_
+
+u32 get_device_type(void);
+void invalidate_dcache(u32);
+void l2_cache_disable(void);
+void l2_cache_enable(void);
+
+#endif
Signature · 1 line
1.6.0.2
#15 lore raw

PATCH 15/28 SPEAr : spear1300 SoC support added

From: Vipin KUMAR <[email protected]>

SPEAr1300 SoC support contains basic spear1300 support along with the usage of following drivers
- serial driver(UART)
- i2c driver
- smi driver
- nand driver(FSMC)
- usbd driver

---
 MAINTAINERS                                |    1 +
 MAKEALL                                    |    1 +
 Makefile                                   |    6 +
 board/spear/common/Makefile                |   12 ++-
 board/spear/common/spr13xx_lowlevel_init.S |   38 +++++
 board/spear/common/spr13xx_misc.c          |   47 +++++++
 board/spear/spear1300/Makefile             |   51 +++++++
 board/spear/spear1300/config.mk            |   28 ++++
 board/spear/spear1300/spear1300.c          |   66 +++++++++
 doc/README.spear                           |   11 ++-
 include/configs/spear13xx_evb.h            |  201 ++++++++++++++++++++++++++++
 include/configs/spear3xx_evb.h             |    1 -
 include/configs/spear6xx_evb.h             |    1 -
 13 files changed, 458 insertions(+), 6 deletions(-)
 create mode 100644 board/spear/common/spr13xx_lowlevel_init.S
 create mode 100644 board/spear/common/spr13xx_misc.c
 create mode 100644 board/spear/spear1300/Makefile
 create mode 100644 board/spear/spear1300/config.mk
 create mode 100644 board/spear/spear1300/spear1300.c
 create mode 100644 include/configs/spear13xx_evb.h
MAINTAINERS +1 -0
index 9485070..4f9ad7f 100644
@@ -669,6 +669,7 @@ Prakash Kumar <[email protected]>
 
 Vipin Kumar <[email protected]>
 
+	spear1300	ARM CORTEX-A9 (spear1300 Soc)
 	spear300	ARM926EJS (spear300 Soc)
 	spear310	ARM926EJS (spear310 Soc)
 	spear320	ARM926EJS (spear320 Soc)
MAKEALL +1 -0
index 4637390..e77608a 100755
@@ -659,6 +659,7 @@ LIST_ARM_CORTEX_A8="		\
 	omap3_zoom2		\
 	s5p_goni		\
 	smdkc100		\
+	spear1300		\
 "
 
 #########################################################################
Makefile +6 -0
index e264c50..ffd4fc1 100644
@@ -2107,6 +2107,12 @@ spear600_usbtty_config \
 spear600_usbtty_nand_config :	unconfig
 	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs $(@:_config=) spear spear
 
+spear1300_config \
+spear1300_nand_config \
+spear1300_usbtty_config \
+spear1300_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $(@:_config=) spear13xx_evb arm arm_cortexa8 spear1300 spear spear13xx
+
 suen3_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs km_arm keymile kirkwood
 
board/spear/common/Makefile +10 -2
index 4f8959f..44c943e 100644
@@ -29,8 +29,16 @@ endif
 
 LIB	= $(obj)lib$(VENDOR).a
 
-COBJS	:= spr_misc.o
-SOBJS	:= spr_lowlevel_init.o
+COBJS-$(CONFIG_SPEAR3XX) += spr_misc.o
+COBJS-$(CONFIG_SPEAR600) += spr_misc.o
+COBJS-$(CONFIG_SPEAR13XX) += spr13xx_misc.o
+
+SOBJS-$(CONFIG_SPEAR3XX) += spr_lowlevel_init.o
+SOBJS-$(CONFIG_SPEAR600) += spr_lowlevel_init.o
+SOBJS-$(CONFIG_SPEAR13XX) += spr13xx_lowlevel_init.o
+
+COBJS	:= $(COBJS-y)
+SOBJS	:= $(SOBJS-y)
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
board/spear/common/spr13xx_lowlevel_init.S new file +38 -0
new file mode 100644
index 0000000..13e0372
@@ -0,0 +1,38 @@
+/*
+ * (C) Copyright 2010
+ * Vipin Kumar, ST Micoelectronics, 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
+ */
+
+#include <config.h>
+
+/*
+ * platform specific initializations are already done in Xloader
+ * Initializations already done include
+ * DDR, PLLs, IP's clock enable and reset release etc
+ */
+.globl lowlevel_init
+lowlevel_init:
+	/* By default, U-Boot switches CPU to low-vector */
+	/* Revert this as we work in high vector even in U-Boot */
+	mrc	p15, 0, r0, c1, c0, 0
+	orr	r0, r0, #0x00002000
+	mcr	p15, 0, r0, c1, c0, 0
+	mov	pc, lr
board/spear/common/spr13xx_misc.c new file +47 -0

47 lines not on this page · raw message

board/spear/spear1300/Makefile new file +51 -0

51 lines not on this page · raw message

board/spear/spear1300/config.mk new file +28 -0
new file mode 100644
index 0000000..4bd519c
@@ -0,0 +1,28 @@
+#
+# (C) Copyright 2010
+# 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
+#
+
+#########################################################################
+
+TEXT_BASE = 0x00700000
+
+ALL += $(obj)u-boot.img
board/spear/spear1300/spear1300.c new file +66 -0

66 lines not on this page · raw message

doc/README.spear +9 -2
index 3161e64..94b492f 100644
@@ -6,9 +6,10 @@ SPEAr600 is also known as SPEArPlus and SPEAr300 is also known as SPEArBasic
 The SPEAr SoC family embeds a customizable logic that can be programmed
 one-time by a customer at silicon mask level (i.e. not at runtime!).
 
-U-Boot supports four SoCs: SPEAr600, SPEAr3xx
+U-Boot supports five spear SoCs: SPEAr600, SPEAr3xx, SPEAr1300
 
-All 4 SoCs (SPEAr3xx and SPEAr600) share common peripherals.
+4 SoCs (SPEAr3xx and SPEAr600) share common peripherals. SPEAr1300 is based on
+ARM CortexA9 core and other peripherals are common
 
 1. ARM926ejs core based (sp600 has two cores, the 2nd handled only in Linux)
 2. FastEthernet (sp600 has Gbit version, but same controller - GMAC)
@@ -29,6 +30,7 @@ u-boot is currently not supporting all peripeharls (just a few as listed below).
 4. EMI (Parallel NOR interface)
 4. I2C
 5. UART
+6. Network
 
 Build options
 	make spear600_config
@@ -55,6 +57,11 @@ Build options
 	make spear320_usbtty_config
 	make spear320_usbtty_nand_config
 
+	make spear1300_config
+	make spear1300_nand_config
+	make spear1300_usbtty_config
+	make spear1300_usbtty_nand_config
+
 Further options
 	make FLASH=PNOR (supported by SPEAr310 and SPEAr320)
 	- This option generates a uboot image that supports emi controller for
include/configs/spear13xx_evb.h new file +201 -0

201 lines not on this page · raw message

include/configs/spear3xx_evb.h +0 -1
index f0c915e..48e1f34 100644
@@ -144,7 +144,6 @@
 #endif
 
 /* NAND flash configuration */
-#define CONFIG_SYS_FSMC_NAND_SP			1
 #define CONFIG_SYS_FSMC_NAND_8BIT		1
 
 #if defined(CONFIG_SPEAR300)
include/configs/spear6xx_evb.h +0 -1
index 82d24df..9a629d4 100644
@@ -49,7 +49,6 @@
 						(void *)CONFIG_SYS_SERIAL1 }
 
 /* NAND flash configuration */
-#define CONFIG_SYS_FSMC_NAND_SP			1
 #define CONFIG_SYS_FSMC_NAND_8BIT		1
 #define CONFIG_SYS_NAND_BASE			(0xD2000000)
 
Signature · 1 line
1.6.0.2
#16 lore raw

PATCH 16/28 SPEAr : Removing extraneous code

From: Vipin KUMAR <[email protected]>

This sub-patch removes extraneous code from the spear platform code

---
 include/configs/spear-common.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
include/configs/spear-common.h +0 -1
index c03520b..1f7aff7 100644
@@ -57,7 +57,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.6.0.2
#17 lore raw

PATCH 17/28 SPEAr : USB device controller bugfixes

From: Vipin KUMAR <[email protected]>

This patch fixes a few bugs in USB device controller driver. The fixes are as follows
1. Adding error condition checks eg. NULL return
2. Endpoint other than endpoint 0 (control endpoint) are initialized only if usb state machine reaches STATE_ADDRESSED or above
3. Zero length packet handling corrected
4. Dead code removed
5. Bulk out endpoint returns after servicing 1 interrupt and returns back to service if more interrupts are pending

---
 drivers/usb/gadget/designware_udc.c |   59 ++++++++++++++++++++++------------
 1 files changed, 38 insertions(+), 21 deletions(-)
drivers/usb/gadget/designware_udc.c +38 -21
index aee44aa..3c20f3d 100644
@@ -497,16 +497,24 @@ static void dw_udc_epn_tx(int ep)
 {
 	struct usb_endpoint_instance *endpoint = dw_find_ep(ep);
 
+	if (!endpoint)
+		return;
+
 	/*
 	 * We need to transmit a terminating zero-length packet now if
 	 * we have sent all of the data in this URB and the transfer
 	 * size was an exact multiple of the packet size.
 	 */
-	if (endpoint && endpoint->tx_urb && endpoint->tx_urb->actual_length) {
-		if (endpoint->last == endpoint->tx_packetSize) {
-			/* handle zero length packet here */
-			writel(0x0, &inep_regs_p[ep].write_done);
-		}
+	if (endpoint->tx_urb &&
+	    (endpoint->last == endpoint->tx_packetSize) &&
+	    (endpoint->tx_urb->actual_length - endpoint->sent -
+	     endpoint->last == 0)) {
+		/* handle zero length packet here */
+		writel(0x0, &inep_regs_p[ep].write_done);
+
+	}
+
+	if (endpoint->tx_urb && endpoint->tx_urb->actual_length) {
 		/* retire the data that was just sent */
 		usbd_tx_complete(endpoint);
 		/*
@@ -548,8 +556,6 @@ int udc_init(void)
 
 	readl(&plug_regs_p->plug_pending);
 
-	udc_disconnect();
-
 	for (i = 0; i < UDC_INIT_MDELAY; i++)
 		udelay(1000);
 
@@ -561,10 +567,9 @@ int udc_init(void)
 	writel(~0x0, &udc_regs_p->endp_int_mask);
 
 	writel(DEV_CONF_FS_SPEED | DEV_CONF_REMWAKEUP | DEV_CONF_SELFPOW |
-	       /* Dev_Conf_SYNCFRAME | */
 	       DEV_CONF_PHYINT_16, &udc_regs_p->dev_conf);
 
-	writel(0x0, &udc_regs_p->dev_cntl);
+	writel(DEV_CNTL_SOFTDISCONNECT, &udc_regs_p->dev_cntl);
 
 	/* Clear all interrupts pending */
 	writel(DEV_INT_MSK, &udc_regs_p->dev_int);
@@ -588,6 +593,9 @@ void udc_setup_ep(struct usb_device_instance *device,
 	char *tt;
 	u32 endp_intmask;
 
+	if ((ep != 0) && (udc_device->device_state < STATE_ADDRESSED))
+		return;
+
 	tt = getenv("usbtty");
 	if (!tt)
 		tt = "generic";
@@ -647,9 +655,6 @@ void udc_setup_ep(struct usb_device_instance *device,
 		writel(packet_size | ((buffer_size / sizeof(int)) << 16),
 		       &out_p->endp_maxpacksize);
 
-		writel((packet_size << 19) | ENDP_EPTYPE_CNTL,
-		       &udc_regs_p->udc_endp_reg[ep_num]);
-
 	} else if ((ep_addr & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) {
 		/* Setup the IN endpoint */
 		writel(0x0, &in_p->endp_status);
@@ -708,7 +713,17 @@ void udc_setup_ep(struct usb_device_instance *device,
 /* Turn on the USB connection by enabling the pullup resistor */
 void udc_connect(void)
 {
-	u32 plug_st;
+	u32 plug_st, dev_cntl;
+
+	dev_cntl = readl(&udc_regs_p->dev_cntl);
+	dev_cntl |= DEV_CNTL_SOFTDISCONNECT;
+	writel(dev_cntl, &udc_regs_p->dev_cntl);
+
+	udelay(1000);
+
+	dev_cntl = readl(&udc_regs_p->dev_cntl);
+	dev_cntl &= ~DEV_CNTL_SOFTDISCONNECT;
+	writel(dev_cntl, &udc_regs_p->dev_cntl);
 
 	plug_st = readl(&plug_regs_p->plug_state);
 	plug_st &= ~(PLUG_STATUS_PHY_RESET | PLUG_STATUS_PHY_MODE);
@@ -720,6 +735,8 @@ void udc_disconnect(void)
 {
 	u32 plug_st;
 
+	writel(DEV_CNTL_SOFTDISCONNECT, &udc_regs_p->dev_cntl);
+
 	plug_st = readl(&plug_regs_p->plug_state);
 	plug_st |= (PLUG_STATUS_PHY_RESET | PLUG_STATUS_PHY_MODE);
 	writel(plug_st, &plug_regs_p->plug_state);
@@ -789,11 +806,6 @@ void dw_udc_plug_irq(void)
 		UDCDBG("device attached and powered");
 		udc_state_transition(udc_device->device_state, STATE_POWERED);
 	} else {
-		/*
-		 * USB cable detached
-		 * Reset the PHY and switch the mode.
-		 */
-		udc_disconnect();
 		writel(~0x0, &udc_regs_p->dev_int_mask);
 
 		UDCDBG("device detached or unpowered");
@@ -809,13 +821,18 @@ void dw_udc_dev_irq(void)
 	if (readl(&udc_regs_p->dev_int) & DEV_INT_USBRESET) {
 		writel(~0x0, &udc_regs_p->endp_int_mask);
 
-		udc_connect();
-
 		writel(readl(&inep_regs_p[0].endp_cntl) | ENDP_CNTL_FLUSH,
 		       &inep_regs_p[0].endp_cntl);
 
 		writel(DEV_INT_USBRESET, &udc_regs_p->dev_int);
 
+		/*
+		 * This endpoint0 specific register can be programmed only
+		 * after the phy clock is initialized
+		 */
+		writel((EP0_MAX_PACKET_SIZE << 19) | ENDP_EPTYPE_CNTL,
+				&udc_regs_p->udc_endp_reg[0]);
+
 		UDCDBG("device reset in progess");
 		udc_state_transition(udc_device->device_state, STATE_DEFAULT);
 	}
@@ -902,7 +919,7 @@ void dw_udc_endpoint_irq(void)
 		writel(ENDP0_INT_CTRLIN, &udc_regs_p->endp_int);
 	}
 
-	while (readl(&udc_regs_p->endp_int) & ENDP_INT_NONISOOUT_MSK) {
+	if (readl(&udc_regs_p->endp_int) & ENDP_INT_NONISOOUT_MSK) {
 		u32 epnum = 0;
 		u32 ep_int = readl(&udc_regs_p->endp_int) &
 		    ENDP_INT_NONISOOUT_MSK;
Signature · 1 line
1.6.0.2
#18 lore raw

PATCH 18/28 SPEAr : Network driver fixes.

From: Vipin KUMAR <[email protected]>

The network controller mac resets hardware address stored in MAC_HI and MAC_LO registers if mac is resetted. So, hw mac address needs to be restored in case mac is explicitly resetted from driver.
Also the max frame length for Normal descriptor can be 0x7FF i.e 2047, so reducing it to 1600

---
 drivers/net/designware.c |    8 ++++++--
 drivers/net/designware.h |    2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/designware.c +6 -2
index d0d9827..3e687a5 100644
@@ -148,6 +148,8 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
 	if (mac_reset(dev) < 0)
 		return -1;
 
+	dw_write_hwaddr(dev);
+
 	writel(FIXEDBURST | PRIORXTX_41 | BURST_16,
 			&dma_p->busmode);
 
@@ -300,8 +302,10 @@ static int eth_mdio_write(struct eth_device *dev, u8 addr, u8 reg, u16 val)
 	writel(miiaddr | MII_CLKRANGE_150_250M | MII_BUSY, &mac_p->miiaddr);
 
 	do {
-		if (!(readl(&mac_p->miiaddr) & MII_BUSY))
+		if (!(readl(&mac_p->miiaddr) & MII_BUSY)) {
 			ret = 0;
+			break;
+		}
 		udelay(1000);
 	} while (timeout--);
 
@@ -377,7 +381,7 @@ static int configure_phy(struct eth_device *dev)
 
 #if defined(CONFIG_DW_SEARCH_PHY)
 	phy_addr = find_phy(dev);
-	if (phy_addr > 0)
+	if (phy_addr >= 0)
 		priv->address = phy_addr;
 	else
 		return -1;
drivers/net/designware.h +1 -1
index e5828a6..42133b3 100644
@@ -121,7 +121,7 @@ struct eth_dma_regs {
 #define RXSTART			(1 << 1)
 
 /* Descriptior related definitions */
-#define MAC_MAX_FRAME_SZ	(2048)
+#define MAC_MAX_FRAME_SZ	(1600)
 
 struct dmamacdescr {
 	u32 txrx_status;
Signature · 1 line
1.6.0.2
#19 lore raw

PATCH 19/28 SPEAr : Changing the default environment variable bootargs

From: Vipin KUMAR <[email protected]>

Linux expects the console to be set to ttyAMA0,115200, so this change is to make default bootargs to console=ttyAMA0,115200....

This patch modifies the default bootargs for all spear devices as following

For environment present in NOR flash
...root=/dev/mtdblock3...
For environment present in NAND flash
...root=/dev/mtdblock7...

---
 include/configs/spear-common.h  |   10 ++++++----
 include/configs/spear13xx_evb.h |   10 ++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)
include/configs/spear-common.h +6 -4
index 1f7aff7..012a27c 100644
@@ -137,7 +137,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"
 
@@ -163,7 +163,7 @@
 
 #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; " \
@@ -171,8 +171,10 @@
 #endif
 
 #define CONFIG_BOOTARGS_NFS			"root=/dev/nfs ip=dhcp " \
-						"console=ttyS0 init=/bin/sh"
-#define CONFIG_BOOTARGS				"console=ttyS0 mem=128M "  \
+						"console=ttyAMA0,115200 " \
+						"init=/bin/sh"
+#define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \
+						"mem=128M "  \
 						"root="CONFIG_FSMTDBLK \
 						"rootfstype=jffs2"
 
include/configs/spear13xx_evb.h +6 -4
index bb0811c..eeb46c0 100644
@@ -131,7 +131,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 0xe6050000"
 
@@ -145,7 +145,7 @@
 
 #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; " \
@@ -153,8 +153,10 @@
 #endif
 
 #define CONFIG_BOOTARGS_NFS			"root=/dev/nfs ip=dhcp " \
-						"console=ttyAMA0 init=/bin/sh"
-#define CONFIG_BOOTARGS				"console=ttyAMA0 mem=128M "  \
+						"console=ttyAMA0,115200 " \
+						"init=/bin/sh"
+#define CONFIG_BOOTARGS				"console=ttyAMA0,115200 " \
+						"mem=128M "  \
 						"root="CONFIG_FSMTDBLK \
 						"rootfstype=jffs2"
 
Signature · 1 line
1.6.0.2
#20 lore raw

PATCH 20/28 SPEAr1300: Workaround the UHC problem (issue #101435)

From: Armando Visconti <[email protected]>

---
 arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c |   33 +++++++++++++++++++++++++++++
 include/configs/spear13xx_evb.h           |    3 ++
 2 files changed, 36 insertions(+), 0 deletions(-)
arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c +33 -0
index ab197b3..4720b60 100644
@@ -83,6 +83,39 @@ int arch_cpu_init(void)
 	writel(perip1_clk_enb, &misc_p->perip1_clk_enb);
 	writel(perip2_clk_enb, &misc_p->perip2_clk_enb);
 
+#ifdef CONFIG_SPEAR1300_ISSUE_101435
+	{
+		u32	tmp_var;
+
+		/*
+		 * WRKD the UHC problem (issue #101435)
+		 *
+		 * Bit2 in MISC sys_sw_res reg is used to
+		 * discriminate whether we are coming from a power-on
+		 * reset or not.
+		 */
+		tmp_var = readl(&misc_p->sys_sw_res);
+		if ((tmp_var & 0x4) == 0) {
+			/* Enable UHC1 and UHC2 clocks) */
+			tmp_var = readl(&misc_p->perip1_clk_enb);
+			writel(tmp_var | 0x600, &misc_p->perip1_clk_enb);
+
+			/* Wait few cycles */
+			for (tmp_var = 0; tmp_var < 0x10000; tmp_var++)
+				;
+
+			/* Reset the system */
+			writel(0x1, &misc_p->sys_sw_res);
+			while (1)
+				;
+		} else {
+			/* Clear the RESET condition. */
+			writel(0x2, &misc_p->sys_sw_res);
+		}
+
+	}
+#endif
+
 	return 0;
 }
 #endif
include/configs/spear13xx_evb.h +3 -0
index eeb46c0..21cc131 100644
@@ -39,6 +39,9 @@
 #define CONFIG_ENV_IS_IN_FLASH			1
 #endif
 
+/* Solve issue #101435 - UHC blocks the BUSMATRIX */
+#define CONFIG_SPEAR1300_ISSUE_101435 1
+
 /* Ethernet configuration */
 #define CONFIG_MII
 #define CONFIG_DESIGNWARE_ETH
Signature · 1 line
1.6.0.2
#21 lore raw

PATCH 21/28 Enable high speed support for usb device framework and usbtty

From: Vipin KUMAR <[email protected]>

This patch adds the support for high speed in usb device framework and usbtty driver. This feature has been kept within a macro CONFIG_USBD_HS, so the board configuration files have to define this macro to enable high speed support.

Along with that specific peripheral drivers also need to define a function to let the framework know that the enumeration has happened at high speed. This function prototype is "int is_usbd_high_speed(void)"

---
 Makefile |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
Makefile +8 -4
index ffd4fc1..870207d 100644
@@ -2090,22 +2090,26 @@ omap730p2_cs3boot_config :	unconfig
 spear300_config \
 spear300_nand_config \
 spear300_usbtty_config \
-spear300_usbtty_nand_config \
+spear300_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $(@:_config=) spear3xx_evb arm arm926ejs spear300 spear spear
+
 spear310_config \
 spear310_nand_config \
 spear310_usbtty_config \
-spear310_usbtty_nand_config \
+spear310_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $(@:_config=) spear3xx_evb arm arm926ejs spear310 spear spear
+
 spear320_config \
 spear320_nand_config \
 spear320_usbtty_config \
 spear320_usbtty_nand_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear3xx_evb arm arm926ejs $(@:_config=) spear spear
+	@$(MKCONFIG) -n $@ -t $@ spear3xx_evb arm arm926ejs spear320 spear spear
 
 spear600_config \
 spear600_nand_config \
 spear600_usbtty_config \
 spear600_usbtty_nand_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs $(@:_config=) spear spear
+	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs spear600 spear spear
 
 spear1300_config \
 spear1300_nand_config \
Signature · 1 line
1.6.0.2
#22 lore raw

PATCH 22/28 SPEAr : High speed support for designware peripheral

From: Vipin KUMAR <[email protected]>

This patch adds the support for usb device high speed for designware peripheral.

---
 drivers/usb/gadget/designware_udc.c |   13 +++++++++----
 include/usb/designware_udc.h        |    3 +++
 2 files changed, 12 insertions(+), 4 deletions(-)
drivers/usb/gadget/designware_udc.c +9 -4
index 3c20f3d..d4b53a2 100644
@@ -566,7 +566,7 @@ int udc_init(void)
 	writel(~0x0, &udc_regs_p->dev_int_mask);
 	writel(~0x0, &udc_regs_p->endp_int_mask);
 
-	writel(DEV_CONF_FS_SPEED | DEV_CONF_REMWAKEUP | DEV_CONF_SELFPOW |
+	writel(DEV_CONF_HS_SPEED | DEV_CONF_REMWAKEUP | DEV_CONF_SELFPOW |
 	       DEV_CONF_PHYINT_16, &udc_regs_p->dev_conf);
 
 	writel(DEV_CNTL_SOFTDISCONNECT, &udc_regs_p->dev_cntl);
@@ -577,6 +577,11 @@ int udc_init(void)
 	return 0;
 }
 
+int is_usbd_high_speed(void)
+{
+	return (readl(&udc_regs_p->dev_stat) & DEV_STAT_ENUM) ? 0 : 1;
+}
+
 /*
  * udc_setup_ep - setup endpoint
  * Associate a physical endpoint with endpoint_instance
@@ -792,7 +797,7 @@ void udc_startup_events(struct usb_device_instance *device)
 /*
  * Plug detection interrupt handling
  */
-void dw_udc_plug_irq(void)
+static void dw_udc_plug_irq(void)
 {
 	if (readl(&plug_regs_p->plug_state) & PLUG_STATUS_ATTACHED) {
 		/*
@@ -816,7 +821,7 @@ void dw_udc_plug_irq(void)
 /*
  * Device interrupt handling
  */
-void dw_udc_dev_irq(void)
+static void dw_udc_dev_irq(void)
 {
 	if (readl(&udc_regs_p->dev_int) & DEV_INT_USBRESET) {
 		writel(~0x0, &udc_regs_p->endp_int_mask);
@@ -886,7 +891,7 @@ void dw_udc_dev_irq(void)
 /*
  * Endpoint interrupt handling
  */
-void dw_udc_endpoint_irq(void)
+static void dw_udc_endpoint_irq(void)
 {
 	while (readl(&udc_regs_p->endp_int) & ENDP0_INT_CTRLOUT) {
 
include/usb/designware_udc.h +3 -0
index ae98e8c..8d48ae9 100644
@@ -197,6 +197,9 @@ struct udcfifo_regs {
 #define  UDC_INT_PACKET_SIZE		64
 #define  UDC_OUT_ENDPOINT		2
 #define  UDC_BULK_PACKET_SIZE		64
+#if defined(CONFIG_USBD_HS)
+#define  UDC_BULK_HS_PACKET_SIZE	512
+#endif
 #define  UDC_IN_ENDPOINT		3
 #define  UDC_OUT_PACKET_SIZE		64
 #define  UDC_IN_PACKET_SIZE		64
Signature · 1 line
1.6.0.2
#23 lore raw

PATCH 23/28 SPEAr : Enable usb device high speed support

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 +
 include/configs/spear13xx_evb.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
include/configs/spear-common.h +1 -0
index 012a27c..b02d512 100644
@@ -38,6 +38,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"
include/configs/spear13xx_evb.h +1 -0
index 21cc131..427892d 100644
@@ -54,6 +54,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.6.0.2
#24 lore raw

PATCH 24/28 SPEAr : Network support configuration

From: Vipin KUMAR <[email protected]>

This patch implements the review feedbacks provided by Ben according to which board_eth_init routine should not return -1. Instead, it should handle the errors itself (by printing error banner / somethign else)

For more info
http://lists.denx.de/pipermail/u-boot/2010-May/071357.html

---
 board/spear/spear300/spear300.c |    7 ++++---
 board/spear/spear310/spear310.c |   21 ++++++++++-----------
 board/spear/spear320/spear320.c |    8 ++++----
 board/spear/spear600/spear600.c |    7 ++++---
 4 files changed, 22 insertions(+), 21 deletions(-)
board/spear/spear300/spear300.c +4 -3
index 3f7ccb8..d9f9aca 100644
@@ -61,9 +61,10 @@ 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++;
 #endif
+	return ret;
 }
board/spear/spear310/spear310.c +10 -11
index f74bbac..9543b19 100644
@@ -63,27 +63,26 @@ 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;
+	if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY) >= 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 +4 -4
index adddfd1..77f3bc5 100644
@@ -64,13 +64,13 @@ 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;
+	if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY) >= 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 +4 -3
index 5a32b7f..ec10396 100644
@@ -56,9 +56,10 @@ 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++;
 #endif
+	return ret;
 }
Signature · 1 line
1.6.0.2
#25 lore raw

PATCH 25/28 SPEAr : Enabling GPT clock explicitly

From: Vipin KUMAR <[email protected]>

uboot needs gpt for timer operations. This clock was enabled from previous level booting software until now. This patch enables it in uboot explicitly

---
 arch/arm/cpu/arm926ejs/spear/cpu.c         |    6 ++++++
 arch/arm/include/asm/arch-spear/spr_misc.h |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/spear/cpu.c +6 -0
index 0f66e05..4dc7d69 100644
@@ -35,6 +35,12 @@ int arch_cpu_init(void)
 
 	periph1_clken = readl(&misc_p->periph1_clken);
 
+#if defined(CONFIG_SPEAR3XX)
+	periph1_clken |= MISC_GPT2ENB;
+#elif defined(CONFIG_SPEAR600)
+	periph1_clken |= MISC_GPT3ENB;
+#endif
+
 #if defined(CONFIG_PL011_SERIAL)
 	periph1_clken |= MISC_UART0ENB;
 #endif
arch/arm/include/asm/arch-spear/spr_misc.h +2 -0
index 045d2bb..b10c726 100644
@@ -128,6 +128,8 @@ struct misc_regs {
 #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
Signature · 1 line
1.6.0.2
#26 lore raw

PATCH 26/28 SPEAr : smi_init moved to board_init

From: Vipin KUMAR <[email protected]>

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

This patch adds these changes

---
 board/spear/common/spr_misc.c           |    4 ++++
 board/spear/spear1300/spear1300.c       |    4 ++++
 drivers/mtd/st_smi.c                    |    4 ++--
 {drivers => include/linux}/mtd/st_smi.h |    2 ++
 4 files changed, 12 insertions(+), 2 deletions(-)
 rename {drivers => include/linux}/mtd/st_smi.h (99%)
board/spear/common/spr_misc.c +4 -0
index 1148984..b1ee6b1 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>
@@ -164,6 +165,9 @@ int spear_board_init(ulong mach_type)
 		       sizeof(chip->version));
 	}
 
+#if defined(CONFIG_ST_SMI)
+	smi_init();
+#endif
 #ifdef CONFIG_SPEAR_EMI
 	spear_emi_init();
 #endif
board/spear/spear1300/spear1300.c +4 -0
index 64fb880..6b904eb 100644
@@ -24,6 +24,7 @@
 #include <common.h>
 #include <netdev.h>
 #include <nand.h>
+#include <linux/mtd/st_smi.h>
 #include <linux/mtd/fsmc_nand.h>
 #include <asm/arch/hardware.h>
 
@@ -34,6 +35,9 @@ int board_init(void)
 	gd->bd->bi_arch_number = MACH_TYPE_SPEAR1300;
 	gd->bd->bi_boot_params = CONFIG_BOOT_PARAMS_ADDR;
 
+#if defined(CONFIG_ST_SMI)
+	smi_init();
+#endif
 	return 0;
 }
 
drivers/mtd/st_smi.c +2 -2
index 5193c1c..4766cf2 100644
@@ -24,10 +24,10 @@
 #include <common.h>
 #include <flash.h>
 #include <linux/err.h>
+#include <linux/mtd/st_smi.h>
 
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
-#include "st_smi.h"
 
 #if !defined(CONFIG_SYS_NO_FLASH)
 
@@ -246,7 +246,7 @@ static int smi_write_enable(int bank)
  *
  * SMI initialization routine. Sets SMI control register1.
  */
-static void smi_init(void)
+void smi_init(void)
 {
 	/* Setting the fast mode values. SMI working at 166/4 = 41.5 MHz */
 	writel(HOLD1 | FAST_MODE | BANK_EN | DSEL_TIME | PRESCAL4,
include/linux/mtd/st_smi.h renamed from drivers/mtd/st_smi.h +2 -0
similarity index 99%
rename from drivers/mtd/st_smi.h
rename to include/linux/mtd/st_smi.h
index afab546..04f81ea 100644
@@ -112,4 +112,6 @@ struct flash_dev {
 #define XFER_FINISH_TOUT	15	/* xfer finish timeout(in ms) */
 #define WMODE_TOUT		15	/* write enable timeout(in ms) */
 
+extern void smi_init(void);
+
 #endif
Signature · 1 line
1.6.0.2
#27 lore raw

PATCH 27/28 SPEAr : Ethernet issue workaround is not needed when uboot is acting as flashing

From: Vipin KUMAR <[email protected]>

Ethernet/UHC issue workaround which resets the SoC has an unexpected effect while using uboot as flashing utils firmware. So, excluding the changes for uboot built as usbtty firmware

Enable overwriting of env variables. The env variables ethaddr, serial# etc support a feture of being written only once. Though this feature is bypassed using this patch

---
 include/configs/spear-common.h  |   10 ++++++++++
 include/configs/spear13xx_evb.h |   15 ++++++++++++++-
 include/configs/spear3xx_evb.h  |    2 ++
 3 files changed, 26 insertions(+), 1 deletions(-)
include/configs/spear-common.h +10 -0
index b02d512..a0b8270 100644
@@ -27,6 +27,7 @@
  * Common configurations used for both spear3xx as well as spear6xx
  */
 
+#if !defined(CONFIG_SPEAR_USBTTY)
 /* Ethernet driver configuration */
 #define CONFIG_MII
 #define CONFIG_DESIGNWARE_ETH
@@ -34,6 +35,7 @@
 #define CONFIG_DW0_PHY				1
 #define CONFIG_NET_MULTI
 #define CONFIG_PHY_RESET_DELAY			(10000)		/* in usec */
+#endif
 
 /* USBD driver configuration */
 #define CONFIG_DW_UDC
@@ -109,14 +111,22 @@
 #define CONFIG_CMD_MEMORY
 #define CONFIG_CMD_RUN
 #define CONFIG_CMD_SAVES
+
+#if !defined(CONFIG_SPEAR_USBTTY)
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
+#endif
 
 /* This must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <config_cmd_default.h>
 
+#if defined(CONFIG_SPEAR_USBTTY)
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+#endif
+
 /*
  * Default Environment Varible definitions
  */
include/configs/spear13xx_evb.h +14 -1
index 427892d..195a08e 100644
@@ -39,9 +39,12 @@
 #define CONFIG_ENV_IS_IN_FLASH			1
 #endif
 
+#if !defined(CONFIG_SPEAR_USBTTY)
 /* Solve issue #101435 - UHC blocks the BUSMATRIX */
-#define CONFIG_SPEAR1300_ISSUE_101435 1
+#define CONFIG_SPEAR1300_ISSUE_101435		1
+#endif
 
+#if !defined(CONFIG_SPEAR_USBTTY)
 /* Ethernet configuration */
 #define CONFIG_MII
 #define CONFIG_DESIGNWARE_ETH
@@ -50,6 +53,7 @@
 #define CONFIG_DW_SEARCH_PHY			1
 #define CONFIG_DW0_PHY				1
 #define CONFIG_PHY_RESET_DELAY			(10000)		/* in usec */
+#endif
 
 /* USBD driver configuration */
 #define CONFIG_DW_UDC
@@ -108,14 +112,22 @@
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_MEMORY
 #define CONFIG_CMD_RUN
+
+#if !defined(CONFIG_SPEAR_USBTTY)
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
+#endif
 
 /* This must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <config_cmd_default.h>
 
+#if defined(CONFIG_SPEAR_USBTTY)
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+#endif
+
 /*
  * Default Environment Varible definitions
  */
@@ -126,6 +138,7 @@
 #define CONFIG_BOOTDELAY			1
 #endif
 
+#define CONFIG_ENV_OVERWRITE
 /*
  * Environment placing
  */
include/configs/spear3xx_evb.h +2 -0
index 48e1f34..889a58c 100644
@@ -51,6 +51,7 @@
 
 #include <configs/spear-common.h>
 
+#if !defined(CONFIG_SPEAR_USBTTY)
 /* Ethernet driver configuration */
 #define CONFIG_DW_ALTDESCRIPTOR			1
 
@@ -66,6 +67,7 @@
 #define CONFIG_MACB0_PHY			0x01
 
 #endif
+#endif
 
 /* Serial Configuration (PL011) */
 #define CONFIG_SYS_SERIAL0			0xD0000000
Signature · 1 line
1.6.0.2
#28 lore raw

PATCH 28/28 SPEAr1310 : spear1310 support added

This patch adds the support for spear1310 SoC. Currently spear1310 uses the following drivers
- UART (PL011)
- designware i2c
- st smi (Serial Memory Interface)
- designware usb device
- designware ethernet

---
 MAINTAINERS                               |    1 +
 MAKEALL                                   |    1 +
 Makefile                                  |    6 +++
 arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c |    4 ++
 board/spear/spear1310/Makefile            |   51 +++++++++++++++++++++
 board/spear/spear1310/config.mk           |   28 +++++++++++
 board/spear/spear1310/spear1310.c         |   70 +++++++++++++++++++++++++++++
 doc/README.spear                          |   11 +++-
 include/configs/spear13xx_evb.h           |    5 ++
 9 files changed, 174 insertions(+), 3 deletions(-)
 create mode 100644 board/spear/spear1310/Makefile
 create mode 100644 board/spear/spear1310/config.mk
 create mode 100644 board/spear/spear1310/spear1310.c
MAINTAINERS +1 -0
index 4f9ad7f..e9ac299 100644
@@ -670,6 +670,7 @@ Prakash Kumar <[email protected]>
 Vipin Kumar <[email protected]>
 
 	spear1300	ARM CORTEX-A9 (spear1300 Soc)
+	spear1310	ARM CORTEX-A9 (spear1310 Soc)
 	spear300	ARM926EJS (spear300 Soc)
 	spear310	ARM926EJS (spear310 Soc)
 	spear320	ARM926EJS (spear320 Soc)
MAKEALL +1 -0
index e77608a..d140d38 100755
@@ -660,6 +660,7 @@ LIST_ARM_CORTEX_A8="		\
 	s5p_goni		\
 	smdkc100		\
 	spear1300		\
+	spear1310		\
 "
 
 #########################################################################
Makefile +6 -0
index 870207d..fb0ad0f 100644
@@ -2117,6 +2117,12 @@ spear1300_usbtty_config \
 spear1300_usbtty_nand_config :	unconfig
 	@$(MKCONFIG) -n $@ -t $(@:_config=) spear13xx_evb arm arm_cortexa8 spear1300 spear spear13xx
 
+spear1310_config \
+spear1310_nand_config \
+spear1310_usbtty_config \
+spear1310_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $(@:_config=) spear13xx_evb arm arm_cortexa8 spear1310 spear spear13xx
+
 suen3_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm926ejs km_arm keymile kirkwood
 
arch/arm/cpu/arm_cortexa8/spear13xx/cpu.c +4 -0
index 4720b60..bf0da29 100644
@@ -123,7 +123,11 @@ int arch_cpu_init(void)
 #ifdef CONFIG_DISPLAY_CPUINFO
 int print_cpuinfo(void)
 {
+#if defined(CONFIG_SPEAR1300)
 	printf("CPU:   SPEAr1300\n");
+#elif defined(CONFIG_SPEAR1310)
+	printf("CPU:   SPEAr1310\n");
+#endif
 	return 0;
 }
 #endif
board/spear/spear1310/Makefile new file +51 -0

51 lines not on this page · raw message

board/spear/spear1310/config.mk new file +28 -0
new file mode 100644
index 0000000..4bd519c
@@ -0,0 +1,28 @@
+#
+# (C) Copyright 2010
+# 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
+#
+
+#########################################################################
+
+TEXT_BASE = 0x00700000
+
+ALL += $(obj)u-boot.img
board/spear/spear1310/spear1310.c new file +70 -0

70 lines not on this page · raw message

doc/README.spear +8 -3
index 94b492f..6839c23 100644
@@ -6,10 +6,11 @@ SPEAr600 is also known as SPEArPlus and SPEAr300 is also known as SPEArBasic
 The SPEAr SoC family embeds a customizable logic that can be programmed
 one-time by a customer at silicon mask level (i.e. not at runtime!).
 
-U-Boot supports five spear SoCs: SPEAr600, SPEAr3xx, SPEAr1300
+U-Boot supports six spear SoCs: SPEAr600, SPEAr3xx, SPEAr1300, SPEAr1310
 
-4 SoCs (SPEAr3xx and SPEAr600) share common peripherals. SPEAr1300 is based on
-ARM CortexA9 core and other peripherals are common
+4 SoCs (SPEAr3xx and SPEAr600) are based on arm926ejs core and share
+common peripherals. SPEAr13xx SoCs are based on ARM CortexA9 core
+and other peripherals are common.
 
 1. ARM926ejs core based (sp600 has two cores, the 2nd handled only in Linux)
 2. FastEthernet (sp600 has Gbit version, but same controller - GMAC)
@@ -61,6 +62,10 @@ Build options
 	make spear1300_nand_config
 	make spear1300_usbtty_config
 	make spear1300_usbtty_nand_config
+	make spear1310_config
+	make spear1310_nand_config
+	make spear1310_usbtty_config
+	make spear1310_usbtty_nand_config
 
 Further options
 	make FLASH=PNOR (supported by SPEAr310 and SPEAr320)
include/configs/spear13xx_evb.h +5 -0
index 195a08e..820170d 100644
@@ -29,6 +29,11 @@
 #define CONFIG_SPEAR1300			1
 #endif
 
+#if defined(CONFIG_MK_spear1310)
+#define CONFIG_SPEAR13XX			1
+#define CONFIG_SPEAR1310			1
+#endif
+
 #if defined(CONFIG_MK_usbtty)
 #define CONFIG_SPEAR_USBTTY			1
 #endif
Signature · 1 line
1.6.0.2
#29 lore raw

PATCH 28/28 SPEAr1310 : spear1310 support added

Dear Vipin KUMAR,

Quoted 7 lines · In message <[email protected]> you wrote:

This patch adds the support for spear1310 SoC. Currently spear1310 uses the following drivers
- UART (PL011)
- designware i2c
- st smi (Serial Memory Interface)
- designware usb device
- designware ethernet

Is this adding a SoC or a board? Looks more like a board to me!

Makefile spear1300_usbtty_config \ · line 2124

Quoted 13 lines
Makefile +5 -0
index 870207d..fb0ad0f 100644
@@ -2117,6 +2117,12 @@ spear1300_usbtty_config \
 spear1300_usbtty_nand_config :	unconfig
 	@$(MKCONFIG) -n $@ -t $(@:_config=) spear13xx_evb arm arm_cortexa8 spear1300 spear spear13xx
 
+spear1310_config \
+spear1310_nand_config \
+spear1310_usbtty_config \
+spear1310_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $(@:_config=) spear13xx_evb arm arm_cortexa8 spear1310 spear spear13xx

NAK. Please move to boards.cfg instead.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
What's the sound a name makes when it's dropped?
#30 lore raw

PATCH 27/28 SPEAr : Ethernet issue workaround is not needed when uboot is acting as flashing

In reply to Vipin KUMAR

Dear Vipin KUMAR,

Quoted 5 lines · In message <[email protected]> you wrote:

From: Vipin KUMAR <[email protected]>

Ethernet/UHC issue workaround which resets the SoC has an unexpected effect while using uboot as flashing utils firmware. So, excluding the changes for uboot built as usbtty firmware

Sorry, but I don't understand what you're trying to tell us here. Please re-formulate so everybody understands this.

Quoted 3 lines

Enable overwriting of env variables. The env variables ethaddr, serial# etc support a feture of being written only once. Though this feature is bypassed using this patch

This is not a good idea, it seems to me.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"There was no difference between  the  behavior  of  a  god  and  the
operations of pure chance..."   - Thomas Pynchon, _Gravity's Rainbow_
#31 lore raw

PATCH 25/28 SPEAr : Enabling GPT clock explicitly

In reply to Vipin KUMAR

Dear Vipin KUMAR,

Quoted 4 lines · In message <[email protected]> you wrote:

From: Vipin KUMAR <[email protected]>

uboot needs gpt for timer operations. This clock was enabled from previous level booting software until now. This patch enables it in uboot explicitly

Please note: the correct spelling is "U-Boot".

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The majority of the stupid is  invincible  and  guaranteed  for  all
time.  The  terror  of their tyranny, however, is alleviated by their
lack of consistency."                               - Albert Einstein
#32 lore raw

PATCH 24/28 SPEAr : Network support configuration

In reply to Vipin KUMAR

Dear Vipin KUMAR,

Quoted 8 lines · In message <[email protected]> you wrote:

From: Vipin KUMAR <[email protected]>

This patch implements the review feedbacks provided by Ben according to which board_eth_init routine should not return -1. Instead, it should handle the errors itself (by printing error banner / somethign else)

For more info
http://lists.denx.de/pipermail/u-boot/2010-May/071357.html

Please squash into the patch that adds this code.

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The universe contains any amount of horrible ways  to  be  woken  up,
such as the noise of the mob breaking down the front door, the scream
of fire engines, or the realization that today is the Monday which on
Friday night was a comfortably long way off.
                                 - Terry Pratchett, _Moving Pictures_
#33 lore raw

PATCH 22/28 SPEAr : High speed support for designware peripheral

In reply to Vipin KUMAR

Hi,

2010/7/14 Vipin KUMAR <[email protected]>:

Quoted 9 lines

From: Vipin KUMAR <[email protected]>

This patch adds the support for usb device high speed for designware peripheral.

---
?drivers/usb/gadget/designware_udc.c | ? 13 +++++++++---- ?include/usb/designware_udc.h ? ? ? ?| ? ?3 +++ ?2 files changed, 12 insertions(+), 4 deletions(-)

#34 lore raw

PATCH 21/28 Enable high speed support for usb device framework and usbtty

In reply to Vipin KUMAR

Dear Vipin KUMAR,

Quoted 41 lines · In message <[email protected]> you wrote:

From: Vipin KUMAR <[email protected]>

This patch adds the support for high speed in usb device framework and usbtty driver. This feature has been kept within a macro CONFIG_USBD_HS, so the board configuration files have to define this macro to enable high speed support.

Along with that specific peripheral drivers also need to define a function to let the framework know that the enumeration has happened at high speed. This function prototype is "int is_usbd_high_speed(void)"

---
 Makefile |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
Makefile +7 -3
index ffd4fc1..870207d 100644
@@ -2090,22 +2090,26 @@ omap730p2_cs3boot_config :	unconfig
 spear300_config \
 spear300_nand_config \
 spear300_usbtty_config \
-spear300_usbtty_nand_config \
+spear300_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $(@:_config=) spear3xx_evb arm arm926ejs spear300 spear spear
+
 spear310_config \
 spear310_nand_config \
 spear310_usbtty_config \
-spear310_usbtty_nand_config \
+spear310_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $(@:_config=) spear3xx_evb arm arm926ejs spear310 spear spear
+
 spear320_config \
 spear320_nand_config \
 spear320_usbtty_config \
 spear320_usbtty_nand_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear3xx_evb arm arm926ejs $(@:_config=) spear spear
+	@$(MKCONFIG) -n $@ -t $@ spear3xx_evb arm arm926ejs spear320 spear spear

Makefile omap730p2_cs3boot_config : unconfig · line 2115

Quoted 10 lines
Makefile +1 -1
 
 spear600_config \
 spear600_nand_config \
 spear600_usbtty_config \
 spear600_usbtty_nand_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs $(@:_config=) spear spear
+	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs spear600 spear spear
 
 spear1300_config \
 spear1300_nand_config \

NAK.

Please move to boards.cfg instead.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Never underestimate the power of human stupidity  when  it  comes  to
using technology they don't understand.
#35 lore raw

PATCH 17/28 SPEAr : USB device controller bugfixes

In reply to Vipin KUMAR

Hi,

2010/7/14 Vipin KUMAR <[email protected]>:

Quoted 12 lines

From: Vipin KUMAR <[email protected]>

This patch fixes a few bugs in USB device controller driver. The fixes are as follows
1. Adding error condition checks eg. NULL return
2. Endpoint other than endpoint 0 (control endpoint) are initialized only if usb state machine reaches STATE_ADDRESSED or above
3. Zero length packet handling corrected
4. Dead code removed
5. Bulk out endpoint returns after servicing 1 interrupt and returns back to service if more interrupts are pending

Quoted 4 lines

---
?drivers/usb/gadget/designware_udc.c | ? 59 ++++++++++++++++++++++------------ ?1 files changed, 38 insertions(+), 21 deletions(-)

#36 lore raw

PATCH 15/28 SPEAr : spear1300 SoC support added

In reply to Vipin KUMAR

Dear Vipin KUMAR,

Quoted 4 lines · In message <[email protected]> you wrote:

From: Vipin KUMAR <[email protected]>

SPEAr1300 SoC support contains basic spear1300 support along with the usage of following drivers

Are you here adding support for a SoC or for a board??? Looks more like board support to me...

...

Makefile spear600_usbtty_config \ · line 2114

Quoted 11 lines
Makefile +5 -0
@@ -2107,6 +2107,12 @@ spear600_usbtty_config \
 spear600_usbtty_nand_config :	unconfig
 	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs $(@:_config=) spear spear
 
+spear1300_config \
+spear1300_nand_config \
+spear1300_usbtty_config \
+spear1300_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $(@:_config=) spear13xx_evb arm arm_cortexa8 spear1300 spear spear13xx

NAK.

Please use boards.cfg instead.

...

Makefile spear600_usbtty_config \ · line 2117

Quoted 3 lines
Makefile +3 -0
+int misc_init_r(void)
+{
+	setenv("verify", "n");

NAK.

Please don't mess with things a user might want to do differently.

You can add this as default settingin your environment, but please allow the user to dicede otherwise.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I paid too much for it, but its worth it.
#37 lore raw

PATCH 15/28 SPEAr : spear1300 SoC support added

Quoted 2 lines · Wolfgang Denk

Dear Vipin KUMAR,

Dear Wolfgang,

Quoted 9 lines
Quoted 4 lines · In message <[email protected]> you wrote:

From: Vipin KUMAR <[email protected]>

SPEAr1300 SoC support contains basic spear1300 support along with the usage of following drivers

Are you here adding support for a SoC or for a board??? Looks more like board support to me...

Yes, it is a board support. I would change this comment here

Quoted 15 lines

...

Makefile spear600_usbtty_config \ · line 2114

Quoted 11 lines
Makefile +5 -0
@@ -2107,6 +2107,12 @@ spear600_usbtty_config \
 spear600_usbtty_nand_config :	unconfig
 	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs $(@:_config=) spear spear
 
+spear1300_config \
+spear1300_nand_config \
+spear1300_usbtty_config \
+spear1300_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $(@:_config=) spear13xx_evb arm arm_cortexa8 spear1300 spear spear13xx

NAK.

Quoted 2 lines

Please use boards.cfg instead.

OK.

Quoted 8 lines

...

Makefile

Quoted 3 lines
Makefile +3 -0
+int misc_init_r(void)
+{
+	setenv("verify", "n");

NAK.

Quoted 5 lines

Please don't mess with things a user might want to do differently.

You can add this as default settingin your environment, but please allow the user to dicede otherwise.

OK. I would add this in default environments in patch-set v2

Quoted 2 lines

Thanks for your valuable inputs. I would incorporate these and send a patch-set v2

Thanks and Regards
Vipin

Quoted 4 lines

Best regards,

Wolfgang Denk

#38 lore raw

PATCH 14/28 SPEAr : Basic spear1300 architecture support added

In reply to Vipin KUMAR

Dear Vipin KUMAR,

Quoted 4 lines · In message <[email protected]> you wrote:

From: Vipin KUMAR <[email protected]>

SPEAr1300 is an ARMCortexA9 dual core based SoC which supports multiple peripherals such as

...

arch/arm/cpu/arm_cortexa8/spear13xx/reset.c line 40

Quoted 7 lines
arch/arm/cpu/arm_cortexa8/spear13xx/reset.c new file +7 -0
+	printf("System is going to reboot ...\n");
+
+	/*
+	 * This 1 second delay will allow the above message
+	 * to be printed before reset
+	 */
+	udelay((1000 * 1000));

udelay() is not designed to provide such long delays. This may or may not work - it's bad style in any case.

Also, do we really need one second to print 30 characters?

And hey, why do you print this at all? Please remove the printf() _and_ the delay.

...

arch/arm/include/asm/arch-spear13xx/ca9_ltimer.h line 41

Quoted 4 lines
arch/arm/include/asm/arch-spear13xx/ca9_ltimer.h new file +4 -0
+/* load related definitions */
+#define FREE_RUNNING		(0xFFFFFFFF)
+
+#define CONFIG_SPEARCA9_HZ_CLK	(250000000)

No parens needed in these #defines (please check and fix globally).

...

arch/arm/include/asm/arch-spear13xx/sys_proto.h

Quoted 3 lines
arch/arm/include/asm/arch-spear13xx/sys_proto.h new file +0 -0
@@ -0,0 +1,34 @@

Drop that header file, and move the prototypes to some other suitable header.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Quote from the Boss... "I didn't say it was your fault.  I said I was
going to blame it on you."
#39 lore raw

PATCH 13/28 SPEAr : Supporting various configurations for spear3xx and spear6xx boards

In reply to Vipin KUMAR

Dear Vipin KUMAR,

Quoted 48 lines · In message <[email protected]> you wrote:

From: Vipin KUMAR <[email protected]>

spear3xx and 6xx 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

Also, renaming the include/configs/spearxxx.h files to spear3xx_evb.h, spear6xx_evb.h etc to depict evaluation board configuration.

---
 Makefile                                       |   25 +++++++++++++++----
 board/spear/spear300/config.mk                 |   11 --------
 board/spear/spear310/config.mk                 |   11 --------
 board/spear/spear320/config.mk                 |   11 --------
 board/spear/spear600/config.mk                 |   11 --------
 doc/README.spear                               |   31 +++++++++++++++++-------
 include/configs/{spear3xx.h => spear3xx_evb.h} |   10 +++++++
 include/configs/{spear6xx.h => spear6xx_evb.h} |   10 +++++++
 8 files changed, 62 insertions(+), 58 deletions(-)
 rename include/configs/{spear3xx.h => spear3xx_evb.h} (95%)
 rename include/configs/{spear6xx.h => spear6xx_evb.h} (88%)
Makefile +10 -5
index 1d87f37..e264c50 100644
@@ -2088,12 +2088,27 @@ omap730p2_cs3boot_config :	unconfig
 	@$(MKCONFIG) -n $@ -a omap730p2 arm arm926ejs omap730p2 ti omap
 
 spear300_config \
+spear300_nand_config \
+spear300_usbtty_config \
+spear300_usbtty_nand_config \
 spear310_config \
-spear320_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear3xx arm arm926ejs $(@:_config=) spear spear
-
-spear600_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear6xx arm arm926ejs $(@:_config=) spear spear
+spear310_nand_config \
+spear310_usbtty_config \
+spear310_usbtty_nand_config \
+spear320_config \
+spear320_nand_config \
+spear320_usbtty_config \
+spear320_usbtty_nand_config :	unconfig

Makefile omap730p2_cs3boot_config : unconfig · line 2111

Quoted 10 lines
Makefile +10 -0
+	@$(MKCONFIG) -n $@ -t $@ spear3xx_evb arm arm926ejs $(@:_config=) spear spear
+
+spear600_config \
+spear600_nand_config \
+spear600_usbtty_config \
+spear600_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs $(@:_config=) spear spear
+
+suen3_config:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs km_arm keymile kirkwood

NAK.

I don't want to have such stuff in the Makefile any more. Please try to find a way how to do this using boards.cfg instead.

[I know that tis is non-trivial; you may want to talk to Detlev about this - he was thinking about the same issue, but I don;t know if he came to any conclusions.]

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have the simplest tastes.  I am always satisfied with the best.
                                                       -- Oscar Wilde
#40 lore raw

PATCH 13/28 SPEAr : Supporting various configurations for spear3xx and spear6xx boards

Dear Vipin KUMAR,

Quoted 36 lines · I wrote:
Quoted 22 lines
Makefile +10 -5
@@ -2088,12 +2088,27 @@ omap730p2_cs3boot_config :	unconfig
 	@$(MKCONFIG) -n $@ -a omap730p2 arm arm926ejs omap730p2 ti omap
 
 spear300_config \
+spear300_nand_config \
+spear300_usbtty_config \
+spear300_usbtty_nand_config \
 spear310_config \
-spear320_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear3xx arm arm926ejs $(@:_config=) spear spear
-
-spear600_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear6xx arm arm926ejs $(@:_config=) spear spear
+spear310_nand_config \
+spear310_usbtty_config \
+spear310_usbtty_nand_config \
+spear320_config \
+spear320_nand_config \
+spear320_usbtty_config \
+spear320_usbtty_nand_config :	unconfig

Makefile omap730p2_cs3boot_config : unconfig · line 2111

Quoted 10 lines
Makefile +10 -0
+	@$(MKCONFIG) -n $@ -t $@ spear3xx_evb arm arm926ejs $(@:_config=) spear spear
+
+spear600_config \
+spear600_nand_config \
+spear600_usbtty_config \
+spear600_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs $(@:_config=) spear spear
+
+suen3_config:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs km_arm keymile kirkwood

NAK.

Quoted 6 lines

I don't want to have such stuff in the Makefile any more. Please try to find a way how to do this using boards.cfg instead.

[I know that tis is non-trivial; you may want to talk to Detlev about this - he was thinking about the same issue, but I don;t know if he came to any conclusions.]

I discussed this topic with Detlev. This is the suggestion we came up with:

- At the moment, the first fieled in the boards.cfg file is used to determine the name of the board configuration file.
- We will now extend this and allow for additional configuration parameters to be appended.
- Unlike in the Makefile, where we were restricted by the make syntax, we suggest to use a comma as separator character.
- There can be an arbitrary number of such parameters (zero or more), but of course the list should be kept short to keep the file readable.
- The configuration parameters can take the simple form "name" (as we use now in the Makefile) or "name=value".
- The code in "mkconfig" that processes these parameters (similar to what the "-t" option is doing now) will translate a plain "name" entry into a "#define CONFIG_MK_<name> 1", and a "name=value" entry into "#define CONFIG_MK_<name> value".

In the result, instead of adding these lines to the Makefile:

+spear310_nand_config \
+spear310_usbtty_config \
+spear310_usbtty_nand_config \
+spear320_config \
+spear320_nand_config \
+spear320_usbtty_config \
+spear320_usbtty_nand_config : unconfig
+ @$(MKCONFIG) -n $@ -t $@ spear3xx_evb arm arm926ejs $(@:_config=) spear spear

we would add these lines to the boards.cfg file:

spear310 arm arm926ejs arm926ejs spear310 spear spear
spear310,nand arm arm926ejs arm926ejs spear310 spear spear
spear310,usbtty arm arm926ejs arm926ejs spear310 spear spear

spear310,usbtty,nand	arm  arm926ejs  arm926ejs  spear310  spear  spear
spear320		arm  arm926ejs  arm926ejs  spear310  spear  spear

spear320,nand arm arm926ejs arm926ejs spear310 spear spear
spear320,usbtty arm arm926ejs arm926ejs spear310 spear spear
spear320,usbtty,nand arm arm926ejs arm926ejs spear310 spear spear

What do you think?

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Whom the gods would destroy, they first teach BASIC.
#41 lore raw

PATCH 13/28 SPEAr : Supporting various configurations for spear3xx and spear6xx boards

Quoted 5 lines · Wolfgang Denk

spear310 arm arm926ejs arm926ejs spear310 spear spear
spear310,nand arm arm926ejs arm926ejs spear310 spear spear
spear310,usbtty arm arm926ejs arm926ejs spear310 spear spear

spear310,usbtty,nand	arm  arm926ejs  arm926ejs  spear310  spear  spear
spear320		arm  arm926ejs  arm926ejs  spear310  spear  spear
Quoted 7 lines

spear320,nand arm arm926ejs arm926ejs spear310 spear spear
spear320,usbtty arm arm926ejs arm926ejs spear310 spear spear
spear320,usbtty,nand arm arm926ejs arm926ejs spear310 spear spear

What do you think?

My 5 cents:

I would add the "parameters" to the end, at the right side, then it won't turn ugly if there are many parameters. One could also think of releasing the line length limitation for this file...

spear320 arm arm926ejs arm926ejs spear310 spear spear
...

spear320  arm  arm926ejs  arm926ejs  spear310  spear  spear	usbtty
spear320  arm  arm926ejs  arm926ejs  spear310  spear  spear	usbtty,nand
spear320  arm  arm926ejs  arm926ejs  spear310  spear  spear	usbtty,nand,and,theese,are,epic,many,needless,parameters

and it would keep the lefthand side of the table nice and tidy.

Best Regards,
Reinhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reinhard_meyer.vcf
Type: text/x-vcard
Size: 370 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100716/f823736b/attachment.vcf

#42 lore raw

PATCH 13/28 SPEAr : Supporting various configurations for spear3xx and spear6xx boards

In reply to Wolfgang Denk
Quoted 81 lines · Wolfgang Denk

Dear Vipin KUMAR,

Quoted 36 lines · I wrote:
Quoted 22 lines
Makefile +10 -5
@@ -2088,12 +2088,27 @@ omap730p2_cs3boot_config :	unconfig
 	@$(MKCONFIG) -n $@ -a omap730p2 arm arm926ejs omap730p2 ti omap
 
 spear300_config \
+spear300_nand_config \
+spear300_usbtty_config \
+spear300_usbtty_nand_config \
 spear310_config \
-spear320_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear3xx arm arm926ejs $(@:_config=) spear spear
-
-spear600_config :	unconfig
-	@$(MKCONFIG) -n $@ -t $@ spear6xx arm arm926ejs $(@:_config=) spear spear
+spear310_nand_config \
+spear310_usbtty_config \
+spear310_usbtty_nand_config \
+spear320_config \
+spear320_nand_config \
+spear320_usbtty_config \
+spear320_usbtty_nand_config :	unconfig

Makefile omap730p2_cs3boot_config : unconfig · line 2111

Quoted 10 lines
Makefile +10 -0
+	@$(MKCONFIG) -n $@ -t $@ spear3xx_evb arm arm926ejs $(@:_config=) spear spear
+
+spear600_config \
+spear600_nand_config \
+spear600_usbtty_config \
+spear600_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $@ spear6xx_evb arm arm926ejs $(@:_config=) spear spear
+
+suen3_config:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs km_arm keymile kirkwood

NAK.

Quoted 6 lines

I don't want to have such stuff in the Makefile any more. Please try to find a way how to do this using boards.cfg instead.

[I know that tis is non-trivial; you may want to talk to Detlev about this - he was thinking about the same issue, but I don;t know if he came to any conclusions.]

I discussed this topic with Detlev. This is the suggestion we came up with:

- At the moment, the first fieled in the boards.cfg file is used to determine the name of the board configuration file.
- We will now extend this and allow for additional configuration parameters to be appended.
- Unlike in the Makefile, where we were restricted by the make syntax, we suggest to use a comma as separator character.
- There can be an arbitrary number of such parameters (zero or more), but of course the list should be kept short to keep the file readable.
- The configuration parameters can take the simple form "name" (as we use now in the Makefile) or "name=value".
- The code in "mkconfig" that processes these parameters (similar to what the "-t" option is doing now) will translate a plain "name" entry into a "#define CONFIG_MK_<name> 1", and a "name=value" entry into "#define CONFIG_MK_<name> value".

In the result, instead of adding these lines to the Makefile:

Makefile +8 -0
+spear310_nand_config \
+spear310_usbtty_config \
+spear310_usbtty_nand_config \
+spear320_config \
+spear320_nand_config \
+spear320_usbtty_config \
+spear320_usbtty_nand_config :	unconfig
+	@$(MKCONFIG) -n $@ -t $@ spear3xx_evb arm arm926ejs $(@:_config=) spear spear

we would add these lines to the boards.cfg file:

Quoted 10 lines

spear310 arm arm926ejs arm926ejs spear310 spear spear
spear310,nand arm arm926ejs arm926ejs spear310 spear spear
spear310,usbtty arm arm926ejs arm926ejs spear310 spear spear

spear310,usbtty,nand	arm  arm926ejs  arm926ejs  spear310  spear  spear
spear320		arm  arm926ejs  arm926ejs  spear310  spear  spear

spear320,nand arm arm926ejs arm926ejs spear310 spear spear
spear320,usbtty arm arm926ejs arm926ejs spear310 spear spear
spear320,usbtty,nand arm arm926ejs arm926ejs spear310 spear spear

Dear Wolfgang,

Got it. This is nice. Clears up a little mess in the Makefile I would make the changes as suggested.
Thanks..

Regards
Vipin

Quoted 7 lines

What do you think?

Best regards,

Wolfgang Denk

#43 lore raw

PATCH 12/28 SPEAr : USB Device Controller driver support added

In reply to Vipin KUMAR

Hi,

2010/7/14 Vipin KUMAR <[email protected]>:

Quoted 8 lines

From: Vipin KUMAR <[email protected]>

The earlier usb device controller driver was specific to spear platforms. This patch implements the usb device controller driver as a generic controller which can be reused by other platforms using this peripheral.

---

Quoted 8 lines
?drivers/serial/usbtty.h ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? ?4 +-
?drivers/usb/gadget/Makefile ? ? ? ? ? ? ? ? ? ? ? ?| ? ?2 +-
?drivers/usb/gadget/{spr_udc.c => designware_udc.c} | ? 57 ++++++++++----------
?include/configs/spear-common.h ? ? ? ? ? ? ? ? ? ? | ? ?4 +-
?include/usb/{spr_udc.h => designware_udc.h} ? ? ? ?| ? ?6 +-

?5 files changed, 37 insertions(+), 36 deletions(-) ?rename drivers/usb/gadget/{spr_udc.c => designware_udc.c} (94%) ?rename include/usb/{spr_udc.h => designware_udc.h} (98%)

#44 lore raw

PATCH 8/28 SPEAr : FSMC driver support added

In reply to Vipin KUMAR

Dear Vipin KUMAR,

Quoted 10 lines · In message <[email protected]> you wrote:

From: Vipin KUMAR <[email protected]>

Flexible static memory controller is a peripheral provided by ST, which controls the access to NAND chips along with many other memory device chips eg NOR, SRAM.

This patch adds the driver support for FSMC controller interfacing with NAND memory.

...

drivers/mtd/nand/fsmc_nand.c line 132

Quoted 4 lines
drivers/mtd/nand/fsmc_nand.c new file +4 -0
+static void fsmc_nand_hwcontrol(struct mtd_info *mtd, int cmd, uint ctrl)
+{
+	struct nand_chip *this = mtd->priv;
+	ulong IO_ADDR_W;

We don't allow for CAPITAL C identifiers - these are reserved for macros.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Bus error -- please leave by the rear door.
#45 lore raw

PATCH 7/28 SPEAr : macb driver support added for spear310 and spear320

In reply to Vipin KUMAR

Dear Vipin KUMAR,

Quoted 16 lines · In message <[email protected]> you wrote:

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

...

Quoted 6 lines
board/spear/spear310/spear310.c +6 -0
+#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,

board/spear/spear310/spear310.c int board_nand_init(struct nand_chip *nand) · line 85

Quoted 10 lines
board/spear/spear310/spear310.c +10 -0
+				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;

We need braces for multiline statements.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Infidels in all ages have battled for the rights of man, and have at
all times been the fearless advocates of liberty and justice."
- Robert Green Ingersoll