Skip to contentSkip to conversation

added Mercury EP2500 board support It uses the mcf5282 processor with real time clock and EEPROM.

PATCH New David Wu 2 participants 4 messages Apr 8, 2010 – May 4, 2010

lore
Share & tools
lore

David Wu

author
#0 lore raw

PATCH 3/7 added Mercury EP2500 board support It uses the mcf5282 processor with real time clock and EEPROM.

---
  board/Mercury/ep2500/Makefile   |   44 ++++++
  board/Mercury/ep2500/config.mk  |   23 +++
  board/Mercury/ep2500/ep2500.c   |  191 +++++++++++++++++++++++++
  board/Mercury/ep2500/u-boot.lds |  140 ++++++++++++++++++
  include/configs/EP2500.h        |  297  
+++++++++++++++++++++++++++++++++++++++
  5 files changed, 695 insertions(+), 0 deletions(-)

create mode 100644 board/Mercury/ep2500/Makefile create mode 100644 board/Mercury/ep2500/config.mk create mode 100644 board/Mercury/ep2500/ep2500.c create mode 100644 board/Mercury/ep2500/u-boot.lds create mode 100644 include/configs/EP2500.h

board/Mercury/ep2500/Makefile new file +44 -0
new file mode 100644
index 0000000..424ab1c
@@ -0,0 +1,44 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# 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$(BOARD).a
+
+COBJS	= $(BOARD).o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
(quoted diff) +0 -0

b/board/Mercury/ep2500/config.mk
new file mode 100644
index 0000000..5639dbb

board/Mercury/ep2500/config.mk new file +23 -0
@@ -0,0 +1,23 @@
+#
+# (c) Copyright 2009 Arcturus Networks Inc.
+#     by David Wu <www.ArcturusNetworks.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
+#
+TEXT_BASE = 0xFF000000
board/Mercury/ep2500/ep2500.c new file +191 -0

191 lines not on this page · raw message

(quoted diff) +0 -0

b/board/Mercury/ep2500/u-boot.lds
new file mode 100644
index 0000000..f46e025

board/Mercury/ep2500/u-boot.lds new file +140 -0

140 lines not on this page · raw message

include/configs/EP2500.h new file +122 -0

122 lines not on this page · raw message

*/
+#define CONFIG_SYS_I2C_OFFSET 0x00000300
+#define CONFIG_SYS_IMMR CONFIG_SYS_MBAR
+/*#define CONFIG_CMD_EEPROM */
+#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+#define MAC_ADDRESS_OFFSET_IN_EEPROM 118
+
+#define CONFIG_HOSTNAME EP2500
+#define PRODUCT_REVISION "EP2500"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "REVISION="PRODUCT_REVISION"\0" \
+ "netdev=eth0\0" \
+ "loadaddr=10010000\0" \
+ "u-boot=u-boot.bin\0" \
+ "load=tftp ${loadaddr) ${u-boot}\0" \
+ "upd=run load; run prog\0" \
+ "prog=prot off ff000000 ff03ffff;" \
+ "era ff000000 ff03ffff;" \
+ "cp.b ${loadaddr} ff000000 ${filesize};"\
+ "setenv filesize;save\0" \
+ ""
+
+#define CONFIG_SYS_PROMPT "-> "
+#define CONFIG_SYS_LONGHELP /* undef to save memory */
+
+#if defined(CONFIG_CMD_KGDB)
+#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
+#else
+#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
+#endif
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
+ /* Print Buffer Size */
+#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
+#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /*Boot Argument Buffer Size
*/
+
+#define CONFIG_SYS_LOAD_ADDR 0x20000
+
+#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START+CONFIG_SYS_SDRAM0_SIZE)
+ /* first SDRAM */
+
+#define CONFIG_SYS_HZ 1000
+#define CONFIG_SYS_CLK 58982400 /* 58.98 MHz; 7.3728 MHz * 8 */
+
+/* PLL Configuration: Ext Clock * 6 (see table 9-4 of MCF user manual) */ +
+#define CONFIG_SYS_MFD 0x02 /* PLL Multiplication Factor Devider */
+#define CONFIG_SYS_RFD 0x00 /* PLL Reduce Frecuency Devider */
+
+/*
+ * Low Level Configuration Settings
+ * (address mappings, register initial values, etc.)
+ * You should know what you are doing if you make changes here.
+ */
+#define CONFIG_SYS_MBAR 0x40000000
+ +/*-----------------------------------------------------------------------
+ * Definitions for initial stack pointer and data area (in DPRAM)
+ */
+#define CONFIG_SYS_INIT_RAM_ADDR 0x20000000
+#define CONFIG_SYS_INIT_RAM_END 0x10000 /* End of used area in internal
SRAM */
+#define CONFIG_SYS_GBL_DATA_SIZE 64 /*size in bytes reserved for initial data */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - \
+ CONFIG_SYS_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
+ +/*-----------------------------------------------------------------------
+ * Start addresses for the final memory configuration
+ * (Set up by the startup code)
+ * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
+ */
+#define CONFIG_SYS_SDRAM_BASE 0x10000000
+#define CONFIG_SYS_SDRAM_SIZE 32
+#define CONFIG_SYS_SDRAM0_BASE 0x10000000
+#define CONFIG_SYS_SDRAM0_SIZE 16
+#define CONFIG_SYS_SDRAM1_BASE 0x11000000
+#define CONFIG_SYS_SDRAM1_SIZE 16
+
+#define CONFIG_SYS_FLASH_BASE CONFIG_SYS_CS0_BASE
+#define CONFIG_SYS_INT_FLASH_BASE 0xF0000000
+#define CONFIG_SYS_INT_FLASH_SIZE 0x80000
+#define CONFIG_SYS_INT_FLASH_ENABLE 0x21
+
+/* If M5282 port is fully implemented the monitor base will be behind
+ * the vector table. */
+#if (TEXT_BASE != CONFIG_SYS_INT_FLASH_BASE)
+#define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_FLASH_BASE + 0x400)
+#else
+#define CONFIG_SYS_MONITOR_BASE (TEXT_BASE + 0x418) /* 24 Byte for
CFM-Config */
+#endif
+
+#define CONFIG_SYS_MONITOR_LEN 0x20000
+#define CONFIG_SYS_MALLOC_LEN (256 << 10)
+#define CONFIG_SYS_BOOTPARAMS_LEN (64*1024)
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization ??
+ */
+#define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE+(CONFIG_SYS_SDRAM_SIZE<<20))
+ +/*-----------------------------------------------------------------------
+ * FLASH organization
+ */
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_FLASH_CFI_DRIVER 1
+#define CONFIG_SYS_FLASH_SIZE 0x1000000
+ /* Max size that the board might have */
+#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
+#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */
+#define CONFIG_SYS_MAX_FLASH_SECT 128 /* max number of sectors on one chip */
+#define CONFIG_SYS_FLASH_PROTECTION /* "Real"(hardware) sectors
protection */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+ +/*-----------------------------------------------------------------------
+ * Cache Configuration
+ */
+#define ICACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_END
- 8)
+#define DCACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_END
- 4)
+#define CONFIG_SYS_ICACHE_INV (CF_CACR_CINV | CF_CACR_INVI)
+#define CONFIG_SYS_CACHE_ACR0 (CONFIG_SYS_SDRAM_BASE | \
+ CF_ADDRMASK(CONFIG_SYS_SDRAM_SIZE) | \
+ CF_ACR_EN | CF_ACR_SM_ALL)
+#define CONFIG_SYS_CACHE_ACR1 0
+#define CONFIG_SYS_CACHE_ICACR (CF_CACR_CENB | CF_CACR_DISD) /*
0x80400000 */
+#define CONFIG_SYS_CACHELINE_SIZE 16
+ +/*-----------------------------------------------------------------------
+ * Memory bank definitions
+ */
+#define CONFIG_SYS_CS0_BASE 0xFF000000
+#define CONFIG_SYS_CS0_CTRL 0x00001da0
+#define CONFIG_SYS_CS0_MASK 0x00FF0001
+#define CONFIG_SYS_CS2_BASE 0x30000000
+#define CONFIG_SYS_CS2_CTRL 0x000015a0
+#define CONFIG_SYS_CS2_MASK 0x000f0041
+ +/*-----------------------------------------------------------------------
+ * Port configuration
+ */

+#define CONFIG_SYS_PACNT                0x0000000	/* Port A D[31:24] */
+#define CONFIG_SYS_PADDR                0x0000000
+#define CONFIG_SYS_PADAT                0x0000000
+
+#define CONFIG_SYS_PBCNT                0x0000000	/* Port B D[23:16] */
+#define CONFIG_SYS_PBDDR                0x0000000
+#define CONFIG_SYS_PBDAT                0x0000000
+
+#define CONFIG_SYS_PCCNT                0x0000000	/* Port C D[15:08] */
+#define CONFIG_SYS_PCDDR                0x0000000
+#define CONFIG_SYS_PCDAT                0x0000000
+
+#define CONFIG_SYS_PDCNT                0x0000000	/* Port D D[07:00] */
+#define CONFIG_SYS_PCDDR                0x0000000
+#define CONFIG_SYS_PCDAT                0x0000000
+
+#define CONFIG_SYS_PASPAR		0x000F
+#define CONFIG_SYS_PEHLPAR              0xC0
+#define CONFIG_SYS_PUAPAR               0x0F	/* UA0..UA3 = Uart 0 +1 */
+#define CONFIG_SYS_DDRUA                0x05
+#define CONFIG_SYS_PJPAR                0xF5

+
+#define CONFIG_SYS_PEHLPAR 0xC0
+#define CONFIG_SYS_DDRD 0xFF /* Port D : all output */
+#define CONFIG_SYS_PFPAR 0xE0
+
+#define CONFIG_SYS_PTCPAR 0x0 /* Port TC used for UART0 */
+#define CONFIG_SYS_PORTTC 0x0 /* driver 0 */
+#define CONFIG_SYS_DDRTC 0xf /* output */
+
+#define MCFSDRAMC_DACR_F(i) (*(vu_long
*)(CONFIG_SYS_MBAR+0x00000048+(i*0x8)))
+#define MCFSDRAMC_DMR_F(i) (*(vu_long
*)(CONFIG_SYS_MBAR+0x0000004c+(i*0x8)))
+
+#endif /* _CONFIG_EP2500_H */

Signature · 1 line
1.5.6
#1 lore raw

PATCH 3/7 added Mercury EP2500 board support It uses the mcf5282 processor with real time clock and EEPROM.

Dear "David Wu",

Quoted 9 lines · In message <[email protected]> you wrote:
---
  board/Mercury/ep2500/Makefile   |   44 ++++++
  board/Mercury/ep2500/config.mk  |   23 +++
  board/Mercury/ep2500/ep2500.c   |  191 +++++++++++++++++++++++++
  board/Mercury/ep2500/u-boot.lds |  140 ++++++++++++++++++
  include/configs/EP2500.h        |  297  
+++++++++++++++++++++++++++++++++++++++
  5 files changed, 695 insertions(+), 0 deletions(-)
Quoted 5 lines

create mode 100644 board/Mercury/ep2500/Makefile create mode 100644 board/Mercury/ep2500/config.mk create mode 100644 board/Mercury/ep2500/ep2500.c create mode 100644 board/Mercury/ep2500/u-boot.lds create mode 100644 include/configs/EP2500.h

Your Subject (= commit message tile) is WAY too long.

Don't try to press everything in a single line.

Entries to MAINTAINERS and MAKEALL are missing.

Quoted 10 lines
board/Mercury/ep2500/ep2500.c new file +10 -0
+void board_get_enetaddr(uchar *enet)
+{
+	int i;
+	unsigned char buff[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+
+	/* Read MAC address (6 bytes) in EEPROM */
+	if (i2c_read
+	    (CONFIG_SYS_I2C_EEPROM_ADDR, MAC_ADDRESS_OFFSET_IN_EEPROM,
+	     CONFIG_SYS_I2C_EEPROM_ADDR_LEN, buff, 6) != 0) {
+		puts("Error reading the EEPROM.\n");

board/Mercury/ep2500/ep2500.c line 145

Quoted 10 lines
board/Mercury/ep2500/ep2500.c new file +10 -0
+	}
+
+	/*
+	 * When buff returns all 0xFF the EEPROM has not
+	 * been programed with a valid MAC. In this case
+	 * we set enet to all 0x00 as 0xFF is not valid
+	 * for this usage model.
+	 */
+	if (buff[0] == 0xff && buff[1] == 0xff && buff[2] == 0xff &&
+	    buff[3] == 0xff && buff[4] == 0xff && buff[5] == 0xff) {

We have standard functions for such checks. Please use them.

board/Mercury/ep2500/ep2500.c line 151

Quoted 6 lines
board/Mercury/ep2500/ep2500.c new file +6 -0
+		for (i = 0; i < 6; i++)
+			enet[i] = 0;
+	} else {
+		for (i = 0; i < 6; i++)
+			enet[i] = buff[i];
+	}

Hm... the whole code makes no sense to me, as neiter all-ones nor all-zeros are legal MAC addresses.

board/Mercury/ep2500/ep2500.c line 163

Quoted 8 lines
board/Mercury/ep2500/ep2500.c new file +8 -0
+int misc_init_r(void)
+{
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+	uchar enetaddr[6];
+
+	if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+		board_get_enetaddr(enetaddr);
+		eth_setenv_enetaddr("ethaddr", enetaddr);

Please see recent discussion about this topic.

board/Mercury/ep2500/ep2500.c line 189

Quoted 13 lines
board/Mercury/ep2500/ep2500.c new file +13 -0
+void i2c_init_board(void)
+{
+	struct fsl_i2c *dev;
+
+	dev = (struct fsl_i2c *)(CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
+
+	if (readb(&dev->sr) & I2C_SR_MBB) {
+		writeb(0, &dev->cr);
+		writeb(0xa0, &dev->cr);
+		readb(&dev->dr);
+		writeb(0x0, &dev->sr);
+		writeb(0, &dev->cr);
+		writeb(I2C_CR_MEN, &dev->cr);

Please add comments what you are doing. Replace 0x0A by a symbolic name. Use a consistent style (i. e. wither use "0x0" or "0", but don't mix both styles.

include/configs/EP2500.h line 113

Quoted 8 lines
include/configs/EP2500.h new file +8 -0
+#ifdef CONFIG_MCFFEC
+#	define CONFIG_ETHADDR	00:00:00:00:00:00
+#	define CONFIG_IPADDR	192.168.1.2
+#	define CONFIG_NETMASK	255.255.255.0
+#	define CONFIG_SERVERIP	192.168.1.1
+#	define CONFIG_GATEWAYIP	192.168.1.1
+#	define CONFIG_OVERWRITE_ETHADDR_ONCE
+/*#define CONFIG_ENV_OVERWRITE */

Please remove this, it will not be accepted.

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
Calm down, it's *__only* ones and zeroes.
author
#2 lore raw

PATCH 3/7 added Mercury EP2500 board support It uses the mcf5282 processor with real time clock and EEPROM.

Hi Wolfgang,

Thanks for checking the patch, Please see inline.

Quoted 18 lines · Wolfgang Denk

Dear "David Wu",

Quoted 9 lines · In message <[email protected]> you wrote:
---
  board/Mercury/ep2500/Makefile   |   44 ++++++
  board/Mercury/ep2500/config.mk  |   23 +++
  board/Mercury/ep2500/ep2500.c   |  191 +++++++++++++++++++++++++
  board/Mercury/ep2500/u-boot.lds |  140 ++++++++++++++++++
  include/configs/EP2500.h        |  297
+++++++++++++++++++++++++++++++++++++++
  5 files changed, 695 insertions(+), 0 deletions(-)
Quoted 5 lines

create mode 100644 board/Mercury/ep2500/Makefile create mode 100644 board/Mercury/ep2500/config.mk create mode 100644 board/Mercury/ep2500/ep2500.c create mode 100644 board/Mercury/ep2500/u-boot.lds create mode 100644 include/configs/EP2500.h

Quoted 1 line

Your Subject (= commit message tile) is WAY too long.

Let me know the size of subject line.

Quoted 3 lines

Don't try to press everything in a single line.

Entries to MAINTAINERS and MAKEALL are missing.

Will add them in. My patch is actually applied on top of another set of patches from TsiChung.

Quoted 14 lines
Quoted 14 lines
board/Mercury/ep2500/ep2500.c new file +14 -0
+void board_get_enetaddr(uchar *enet)
+{
+	int i;
+	unsigned char buff[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+
+	/* Read MAC address (6 bytes) in EEPROM */
+	if (i2c_read
+	    (CONFIG_SYS_I2C_EEPROM_ADDR, MAC_ADDRESS_OFFSET_IN_EEPROM,
+	     CONFIG_SYS_I2C_EEPROM_ADDR_LEN, buff, 6) != 0) {
+		puts("Error reading the EEPROM.\n");
+	}
+
+	/*
+	 * When buff returns all 0xFF the EEPROM has not
Quoted 8 lines

board/Mercury/ep2500/ep2500.c line 145

Quoted 6 lines
board/Mercury/ep2500/ep2500.c new file +6 -0
+	 * been programed with a valid MAC. In this case
+	 * we set enet to all 0x00 as 0xFF is not valid
+	 * for this usage model.
+	 */
+	if (buff[0] == 0xff && buff[1] == 0xff && buff[2] == 0xff &&
+	    buff[3] == 0xff && buff[4] == 0xff && buff[5] == 0xff) {

We have standard functions for such checks. Please use them.

It would be nice if you can let me know the function. I am grep'ing in u-boot and it's so hard to find it.

Quoted 9 lines

board/Mercury/ep2500/ep2500.c line 151

Quoted 6 lines
board/Mercury/ep2500/ep2500.c new file +6 -0
+		for (i = 0; i < 6; i++)
+			enet[i] = 0;
+	} else {
+		for (i = 0; i < 6; i++)
+			enet[i] = buff[i];
+	}

Hm... the whole code makes no sense to me, as neiter all-ones nor all-zeros are legal MAC addresses.

All ones are valid broadcast MAC address. It is just not valid for source MAC address.
I want to set to all zeros instead in case of all FFs. Is this against any rules?

Quoted 12 lines

board/Mercury/ep2500/ep2500.c line 163

Quoted 10 lines
board/Mercury/ep2500/ep2500.c new file +8 -0
+int misc_init_r(void)
+{
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+	uchar enetaddr[6];
+
+	if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+		board_get_enetaddr(enetaddr);
+		eth_setenv_enetaddr("ethaddr", enetaddr);

Please see recent discussion about this topic.

Could you let me know the thread -- I am new here.

Quoted 16 lines
Quoted 4 lines
board/Mercury/ep2500/ep2500.c new file +3 -0
+void i2c_init_board(void)
+{
+	struct fsl_i2c *dev;

board/Mercury/ep2500/ep2500.c line 189

Quoted 10 lines
board/Mercury/ep2500/ep2500.c new file +10 -0
+
+	dev = (struct fsl_i2c *)(CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
+
+	if (readb(&dev->sr) & I2C_SR_MBB) {
+		writeb(0, &dev->cr);
+		writeb(0xa0, &dev->cr);
+		readb(&dev->dr);
+		writeb(0x0, &dev->sr);
+		writeb(0, &dev->cr);
+		writeb(I2C_CR_MEN, &dev->cr);

Please add comments what you are doing. Replace 0x0A by a symbolic

You mean comments for "writeb(0xa0, &dev->cr)" -- OK.

Quoted 12 lines

name. Use a consistent style (i. e. wither use "0x0" or "0", but don't mix both styles.

include/configs/EP2500.h line 113

Quoted 8 lines
include/configs/EP2500.h new file +8 -0
+#ifdef CONFIG_MCFFEC
+#	define CONFIG_ETHADDR	00:00:00:00:00:00
+#	define CONFIG_IPADDR	192.168.1.2
+#	define CONFIG_NETMASK	255.255.255.0
+#	define CONFIG_SERVERIP	192.168.1.1
+#	define CONFIG_GATEWAYIP	192.168.1.1
+#	define CONFIG_OVERWRITE_ETHADDR_ONCE
+/*#define CONFIG_ENV_OVERWRITE */

Please remove this, it will not be accepted.

Are you talking about the last line. Sure I can remove it. Otherwise would you mind tell me the reason? format is wrong, some defines are wrong or ifdef (or use if defined instead)?

Kind regards,
David

Quoted 4 lines

Best regards,

Wolfgang Denk

#3 lore raw

PATCH 3/7 added Mercury EP2500 board support It uses the mcf5282 processor with real time clock and EEPROM.

Dear "David Wu",

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

Your Subject (= commit message tile) is WAY too long.

Let me know the size of subject line.

Quoting the "SubmittingPatches" document:

The "summary phrase" in the email's Subject should concisely describe the patch which that email contains. The "summary phrase" should not be a filename. Do not use the same "summary phrase" for every patch in a whole patch series (where a "patch series" is an ordered sequence of multiple, related patches).

Bear in mind that the "summary phrase" of your email becomes a globally-unique identifier for that patch. It propagates all the way into the git changelog. The "summary phrase" may later be used in developer discussions which refer to the patch. People will want to google for the "summary phrase" to read discussion regarding that patch. It will also be the only thing that people may quickly see when, two or three months later, they are going through perhaps thousands of patches using tools such as "gitk" or "git log --oneline".

For these reasons, the "summary" must be no more than 70-75 characters, and it must describe both what the patch changes, as well as why the patch might be necessary. It is challenging to be both succinct and descriptive, but that is what a well-written summary should do.

Quoted 10 lines
Quoted 10 lines

board/Mercury/ep2500/ep2500.c line 145

Quoted 8 lines
board/Mercury/ep2500/ep2500.c new file +8 -0
+	/*
+	 * When buff returns all 0xFF the EEPROM has not
+	 * been programed with a valid MAC. In this case
+	 * we set enet to all 0x00 as 0xFF is not valid
+	 * for this usage model.
+	 */
+	if (buff[0] == 0xff && buff[1] == 0xff && buff[2] == 0xff &&
+	    buff[3] == 0xff && buff[4] == 0xff && buff[5] == 0xff) {

We have standard functions for such checks. Please use them.

Quoted 2 lines

It would be nice if you can let me know the function. I am grep'ing in u-boot and it's so hard to find it.

-> grep valid include/net.h
#define VLAN_IDMASK 0x0fff /* mask of valid vlan id */
* is_valid_ether_addr - Determine if the given Ethernet address is
* valid
* Return true if the address is valid.
static inline int is_valid_ether_addr(const u8 * addr) ------------------^^^^^^^^^^^^^^^^^^^

Quoted 6 lines
Quoted 5 lines

board/Mercury/ep2500/ep2500.c line 163

Quoted 3 lines
board/Mercury/ep2500/ep2500.c new file +3 -0
+	if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+		board_get_enetaddr(enetaddr);
+		eth_setenv_enetaddr("ethaddr", enetaddr);

Please see recent discussion about this topic.

Could you let me know the thread -- I am new here.

Search for "add write_hwaddr support" (respective commits have just been pulled into the master branch).

Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
board/Mercury/ep2500/ep2500.c new file +7 -0
+void i2c_init_board(void)
+{
+	struct fsl_i2c *dev;
+
+	dev = (struct fsl_i2c *)(CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
+
+	if (readb(&dev->sr) & I2C_SR_MBB) {
Quoted 8 lines

board/Mercury/ep2500/ep2500.c line 189

Quoted 6 lines
board/Mercury/ep2500/ep2500.c new file +6 -0
+		writeb(0, &dev->cr);
+		writeb(0xa0, &dev->cr);
+		readb(&dev->dr);
+		writeb(0x0, &dev->sr);
+		writeb(0, &dev->cr);
+		writeb(I2C_CR_MEN, &dev->cr);

Please add comments what you are doing. Replace 0x0A by a symbolic

Quoted 1 line

You mean comments for "writeb(0xa0, &dev->cr)" -- OK.

Yes, plus replacing 0x0A by a symbolic constant.

Quoted 12 lines
Quoted 12 lines

name. Use a consistent style (i. e. wither use "0x0" or "0", but don't mix both styles.

include/configs/EP2500.h line 113

Quoted 8 lines
include/configs/EP2500.h new file +8 -0
+#ifdef CONFIG_MCFFEC
+#	define CONFIG_ETHADDR	00:00:00:00:00:00
+#	define CONFIG_IPADDR	192.168.1.2
+#	define CONFIG_NETMASK	255.255.255.0
+#	define CONFIG_SERVERIP	192.168.1.1
+#	define CONFIG_GATEWAYIP	192.168.1.1
+#	define CONFIG_OVERWRITE_ETHADDR_ONCE
+/*#define CONFIG_ENV_OVERWRITE */

Please remove this, it will not be accepted.

Quoted 3 lines

Are you talking about the last line. Sure I can remove it. Otherwise would you mind tell me the reason? format is wrong, some defines are wrong or ifdef (or use if defined instead)?

I mean the whole block. We don't accept any static network initalizations. They may work for you, they don't work for others.

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
Imitation is the sincerest form of plagarism.