All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
@ 2009-05-11  6:39 Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  6:39 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 more replies)
  0 siblings, 3 replies; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-11  6:39 UTC (permalink / raw)
  To: u-boot

init it at the eth_initialize

this will allow to add later a hook to update the enetadd hw storage
when it's updated in env or when the env is saved

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Ben Warren <biggerbadderben@gmail.com>
---
 include/net.h |    2 ++
 net/eth.c     |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/net.h b/include/net.h
index 5a1d36e..2ed6263 100644
--- a/include/net.h
+++ b/include/net.h
@@ -93,6 +93,7 @@ enum eth_state_t {
 };
 
 struct eth_device {
+	int num;
 	char name[NAMESIZE];
 	unsigned char enetaddr[6];
 	int iobase;
@@ -105,6 +106,7 @@ struct eth_device {
 #ifdef CONFIG_MCAST_TFTP
 	int (*mcast) (struct eth_device*, u32 ip, u8 set);
 #endif
+	int  (*set_hw_enetaddr) (struct eth_device*, bd_t*);
 	struct eth_device *next;
 	void *priv;
 };
diff --git a/net/eth.c b/net/eth.c
index c6fa5b9..99bb6c2 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -217,6 +217,8 @@ int eth_initialize(bd_t *bis)
 			if (eth_number)
 				puts (", ");
 
+			dev->num = eth_number;
+
 			printf("%s", dev->name);
 
 			if (ethprime && strcmp (dev->name, ethprime) == 0) {
@@ -240,6 +242,8 @@ int eth_initialize(bd_t *bis)
 				}
 
 				memcpy(dev->enetaddr, env_enetaddr, 6);
+				if(dev->set_hw_enetaddr)
+					dev->set_hw_enetaddr(dev, bis);
 			}
 
 			eth_number++;
-- 
1.6.1.3

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support
  2009-05-11  6:39 [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-11  6:39 ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  6:39   ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Jean-Christophe PLAGNIOL-VILLARD
                     ` (2 more replies)
  2009-05-11  7:48 ` [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Mike Frysinger
  2009-05-12  0:28 ` Ben Warren
  2 siblings, 3 replies; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-11  6:39 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Ben Warren <biggerbadderben@gmail.com>
Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
---
 drivers/net/macb.c |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 6de0a04..a339730 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -404,12 +404,25 @@ static int macb_phy_init(struct macb_device *macb)
 	}
 }
 
-static int macb_init(struct eth_device *netdev, bd_t *bd)
+static int macb_set_hw_enetaddr(struct eth_device *netdev, bd_t *bd)
 {
 	struct macb_device *macb = to_macb(netdev);
-	unsigned long paddr;
 	u32 hwaddr_bottom;
 	u16 hwaddr_top;
+
+	/* set hardware address */
+	hwaddr_bottom = cpu_to_le32(*((u32 *)netdev->enetaddr));
+	macb_writel(macb, SA1B, hwaddr_bottom);
+	hwaddr_top = cpu_to_le16(*((u16 *)(netdev->enetaddr + 4)));
+	macb_writel(macb, SA1T, hwaddr_top);
+
+	return 0;
+}
+
+static int macb_init(struct eth_device *netdev, bd_t *bd)
+{
+	struct macb_device *macb = to_macb(netdev);
+	unsigned long paddr;
 	int i;
 
 	/*
@@ -439,10 +452,7 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
 	macb_writel(macb, TBQP, macb->tx_ring_dma);
 
 	/* set hardware address */
-	hwaddr_bottom = cpu_to_le32(*((u32 *)netdev->enetaddr));
-	macb_writel(macb, SA1B, hwaddr_bottom);
-	hwaddr_top = cpu_to_le16(*((u16 *)(netdev->enetaddr + 4)));
-	macb_writel(macb, SA1T, hwaddr_top);
+	macb_set_hw_enetaddr(netdev, bd);
 
 	/* choose RMII or MII mode. This depends on the board */
 #ifdef CONFIG_RMII
@@ -521,6 +531,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr)
 	netdev->halt = macb_halt;
 	netdev->send = macb_send;
 	netdev->recv = macb_recv;
+	netdev->set_hw_enetaddr = macb_set_hw_enetaddr;
 
 	/*
 	 * Do some basic initialization so that we at least can talk
-- 
1.6.1.3

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api
  2009-05-11  6:39 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-11  6:39   ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  6:39     ` [U-Boot] [PATCH 4/4] at91/macb: remove reset_phy callback Jean-Christophe PLAGNIOL-VILLARD
                       ` (2 more replies)
  2009-05-11  9:13   ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Haavard Skinnemoen
  2009-05-12  0:29   ` Ben Warren
  2 siblings, 3 replies; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-11  6:39 UTC (permalink / raw)
  To: u-boot

this add multi devices support and merge dm9000's eeprom command support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Ben Warren <biggerbadderben@gmail.com>
Cc: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
Cc: Konstantin Kletschke <kletschke@synertronixx.de>
Cc: Stelian Pop <stelian.pop@leadtechdesign.com>
---
 board/atmel/at91sam9261ek/at91sam9261ek.c |   17 +-
 board/freescale/m5253demo/m5253demo.c     |   10 +
 board/scb9328/scb9328.c                   |    9 +
 board/trizepsiv/Makefile                  |    2 +-
 board/trizepsiv/conxs.c                   |   10 +
 board/trizepsiv/eeprom.c                  |   84 -----
 drivers/net/dm9000x.c                     |  469 ++++++++++++++++++-----------
 include/configs/M5253DEMO.h               |    3 +-
 include/configs/at91sam9261ek.h           |    5 +-
 include/configs/scb9328.h                 |    3 +-
 include/configs/trizepsiv.h               |    4 +-
 include/netdev.h                          |    1 +
 12 files changed, 341 insertions(+), 276 deletions(-)
 delete mode 100644 board/trizepsiv/eeprom.c

diff --git a/board/atmel/at91sam9261ek/at91sam9261ek.c b/board/atmel/at91sam9261ek/at91sam9261ek.c
index a89cb8b..6aec5c6 100644
--- a/board/atmel/at91sam9261ek/at91sam9261ek.c
+++ b/board/atmel/at91sam9261ek/at91sam9261ek.c
@@ -34,9 +34,7 @@
 #include <asm/arch/io.h>
 #include <lcd.h>
 #include <atmel_lcdc.h>
-#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_DRIVER_DM9000)
-#include <net.h>
-#endif
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -234,15 +232,10 @@ int dram_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_RESET_PHY_R
-void reset_phy(void)
-{
 #ifdef CONFIG_DRIVER_DM9000
-	/*
-	 * Initialize ethernet HW addr prior to starting Linux,
-	 * needed for nfsroot
-	 */
-	eth_init(gd->bd);
-#endif
+int board_eth_init(bd_t *bis)
+{
+	return dm9000_eth_initialize(0, (u32*)CONFIG_DM9000_BASE,
+					(u32*)(CONFIG_DM9000_BASE + 4));
 }
 #endif
diff --git a/board/freescale/m5253demo/m5253demo.c b/board/freescale/m5253demo/m5253demo.c
index b39cd4d..25d6f9e 100644
--- a/board/freescale/m5253demo/m5253demo.c
+++ b/board/freescale/m5253demo/m5253demo.c
@@ -25,6 +25,8 @@
  */
 
 #include <common.h>
+#include <netdev.h>
+
 #include <asm/immap.h>
 
 int checkboard(void)
@@ -138,3 +140,11 @@ void ide_set_reset(int idereset)
 	}
 }
 #endif				/* CONFIG_CMD_IDE */
+
+#ifdef CONFIG_DRIVER_DM9000
+int board_eth_init(bd_t *bis)
+{
+	return dm9000_eth_initialize(0, (u32*)CONFIG_DM9000_BASE,
+					(u32*)(CONFIG_DM9000_BASE + 4));
+}
+#endif
diff --git a/board/scb9328/scb9328.c b/board/scb9328/scb9328.c
index 3f6831b..1e8ea67 100644
--- a/board/scb9328/scb9328.c
+++ b/board/scb9328/scb9328.c
@@ -19,6 +19,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -70,3 +71,11 @@ void show_boot_progress (int status)
 {
 	return;
 }
+
+#ifdef CONFIG_DRIVER_DM9000
+int board_eth_init(bd_t *bis)
+{
+	return dm9000_eth_initialize(0, (u32*)CONFIG_DM9000_BASE,
+					(u32*)(CONFIG_DM9000_BASE + 4));
+}
+#endif
diff --git a/board/trizepsiv/Makefile b/board/trizepsiv/Makefile
index 44c0d49..b105dd7 100644
--- a/board/trizepsiv/Makefile
+++ b/board/trizepsiv/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= conxs.o eeprom.o
+COBJS	:= conxs.o
 SOBJS	:= lowlevel_init.o pxavoltage.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/board/trizepsiv/conxs.c b/board/trizepsiv/conxs.c
index 7c6c855..272f7b6 100644
--- a/board/trizepsiv/conxs.c
+++ b/board/trizepsiv/conxs.c
@@ -32,6 +32,8 @@
  */
 
 #include <common.h>
+#include <netdev.h>
+
 #include <asm/arch/pxa-regs.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -144,3 +146,11 @@ int dram_init (void)
 
 	return 0;
 }
+
+#ifdef CONFIG_DRIVER_DM9000
+int board_eth_init(bd_t *bis)
+{
+	return dm9000_eth_initialize(0, (u32*)CONFIG_DM9000_BASE,
+					(u32*)(CONFIG_DM9000_BASE + 0x8004));
+}
+#endif
diff --git a/board/trizepsiv/eeprom.c b/board/trizepsiv/eeprom.c
deleted file mode 100644
index 63f1c6c..0000000
--- a/board/trizepsiv/eeprom.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * (C) Copyright 2007
- * Stefano Babic, DENX Software Engineering, sbabic 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 <common.h>
-#include <command.h>
-
-extern u16 read_srom_word(int);
-extern void write_srom_word(int offset, u16 val);
-
-static int do_read_dm9000_eeprom ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) {
-	int i;
-
-	for (i=0; i < 0x40; i++) {
-		if (!(i % 0x10))
-			printf("\n%08lx:", i);
-		printf(" %04x", read_srom_word(i));
-	}
-	printf ("\n");
-	return (0);
-}
-
-static int do_write_dm9000_eeprom ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) {
-	int offset,value;
-
-	if (argc < 4) {
-		cmd_usage(cmdtp);
-		return 1;
-	}
-
-	offset=simple_strtoul(argv[2],NULL,16);
-	value=simple_strtoul(argv[3],NULL,16);
-	if (offset > 0x40) {
-		printf("Wrong offset : 0x%x\n",offset);
-		cmd_usage(cmdtp);
-		return 1;
-	}
-	write_srom_word(offset, value);
-	return (0);
-}
-
-int do_dm9000_eeprom ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) {
-	if (argc < 2) {
-		cmd_usage(cmdtp);
-		return 1;
-	}
-
-	if (strcmp (argv[1],"read") == 0) {
-		return (do_read_dm9000_eeprom(cmdtp,flag,argc,argv));
-	} else if (strcmp (argv[1],"write") == 0) {
-		return (do_write_dm9000_eeprom(cmdtp,flag,argc,argv));
-	} else {
-		cmd_usage(cmdtp);
-		return 1;
-	}
-}
-
-U_BOOT_CMD(
-	dm9000ee,4,1,do_dm9000_eeprom,
-	"Read/Write eeprom connected to Ethernet Controller",
-	"\ndm9000ee write <word offset> <value> \n"
-	"\tdm9000ee read \n"
-	"\tword:\t\t00-02 : MAC Address\n"
-	"\t\t\t03-07 : DM9000 Configuration\n"
-	"\t\t\t08-63 : User data\n");
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index 8ca2bf7..61ca492 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -1,6 +1,11 @@
 /*
   dm9000.c: Version 1.2 12/15/2003
 
+	Add eemprom command support
+
+	(C) Copyright 2007
+	Stefano Babic, DENX Software Engineering, sbabic at denx.de.
+
 	A Davicom DM9000 ISA NIC fast Ethernet driver for Linux.
 	Copyright (C) 1997  Sten Wang
 
@@ -61,6 +66,8 @@ TODO: external MII is not functional, only internal at the moment.
 #include <common.h>
 #include <command.h>
 #include <net.h>
+#include <netdev.h>
+#include <malloc.h>
 #include <asm/io.h>
 
 #include "dm9000x.h"
@@ -88,6 +95,8 @@ TODO: external MII is not functional, only internal at the moment.
 
 /* Structure/enum declaration ------------------------------- */
 typedef struct board_info {
+	u32 *io_addr;
+	u32 *data_addr;
 	u32 runt_length_counter;	/* counter: RX length < 64byte */
 	u32 long_length_counter;	/* counter: RX length > 1514byte */
 	u32 reset_counter;	/* counter: RESET */
@@ -99,23 +108,20 @@ typedef struct board_info {
 	u8 phy_addr;
 	u8 device_wait_reset;	/* device state */
 	unsigned char srom[128];
-	void (*outblk)(volatile void *data_ptr, int count);
-	void (*inblk)(void *data_ptr, int count);
-	void (*rx_status)(u16 *RxStatus, u16 *RxLen);
+	void (*outblk)(struct board_info *db, volatile void *data_ptr, int count);
+	void (*inblk)(struct board_info *db, void *data_ptr, int count);
+	void (*rx_status)(struct board_info *db, u16 *RxStatus, u16 *RxLen);
+	struct eth_device	netdev;
 } board_info_t;
-static board_info_t dm9000_info;
+#define to_board_info(_nd) container_of(_nd, struct board_info, netdev)
 
 /* function declaration ------------------------------------- */
-int eth_init(bd_t * bd);
-int eth_send(volatile void *, int);
-int eth_rx(void);
-void eth_halt(void);
-static int dm9000_probe(void);
-static u16 phy_read(int);
-static void phy_write(int, u16);
-static void read_srom_word(int, u8 *);
-static u8 DM9000_ior(int);
-static void DM9000_iow(int reg, u8 value);
+static u16 phy_read(struct board_info *db, int reg);
+static void phy_write(struct board_info *db, int reg, u16 value);
+static void read_srom_word(struct eth_device *netdev, int offset, u8 *to);
+static void write_srom_word(struct eth_device *netdev, int offset, u16 val);
+static u8 DM9000_ior(struct board_info *db, int reg);
+static void DM9000_iow(struct board_info *db, int reg, u8 value);
 
 /* DM9000 network board routine ---------------------------- */
 
@@ -127,112 +133,115 @@ static void DM9000_iow(int reg, u8 value);
 #define DM9000_inl(r) (*(volatile u32 *)r)
 
 #ifdef CONFIG_DM9000_DEBUG
-static void
-dump_regs(void)
+static void dump_regs(struct board_info *db)
 {
 	DM9000_DBG("\n");
-	DM9000_DBG("NCR   (0x00): %02x\n", DM9000_ior(0));
-	DM9000_DBG("NSR   (0x01): %02x\n", DM9000_ior(1));
-	DM9000_DBG("TCR   (0x02): %02x\n", DM9000_ior(2));
-	DM9000_DBG("TSRI  (0x03): %02x\n", DM9000_ior(3));
-	DM9000_DBG("TSRII (0x04): %02x\n", DM9000_ior(4));
-	DM9000_DBG("RCR   (0x05): %02x\n", DM9000_ior(5));
-	DM9000_DBG("RSR   (0x06): %02x\n", DM9000_ior(6));
-	DM9000_DBG("ISR   (0xFE): %02x\n", DM9000_ior(DM9000_ISR));
+	DM9000_DBG("NCR   (0x00): %02x\n", DM9000_ior(db, 0));
+	DM9000_DBG("NSR   (0x01): %02x\n", DM9000_ior(db, 1));
+	DM9000_DBG("TCR   (0x02): %02x\n", DM9000_ior(db, 2));
+	DM9000_DBG("TSRI  (0x03): %02x\n", DM9000_ior(db, 3));
+	DM9000_DBG("TSRII (0x04): %02x\n", DM9000_ior(db, 4));
+	DM9000_DBG("RCR   (0x05): %02x\n", DM9000_ior(db, 5));
+	DM9000_DBG("RSR   (0x06): %02x\n", DM9000_ior(db, 6));
+	DM9000_DBG("ISR   (0xFE): %02x\n", DM9000_ior(db, DM9000_ISR));
 	DM9000_DBG("\n");
 }
 #endif
 
-static void dm9000_outblk_8bit(volatile void *data_ptr, int count)
+static void dm9000_outblk_8bit(struct board_info *db, volatile void *data_ptr,
+			       int count)
 {
 	int i;
 	for (i = 0; i < count; i++)
-		DM9000_outb((((u8 *) data_ptr)[i] & 0xff), DM9000_DATA);
+		DM9000_outb((((u8 *) data_ptr)[i] & 0xff), db->data_addr);
 }
 
-static void dm9000_outblk_16bit(volatile void *data_ptr, int count)
+static void dm9000_outblk_16bit(struct board_info *db, volatile void *data_ptr,
+				int count)
 {
 	int i;
 	u32 tmplen = (count + 1) / 2;
 
 	for (i = 0; i < tmplen; i++)
-		DM9000_outw(((u16 *) data_ptr)[i], DM9000_DATA);
+		DM9000_outw(((u16 *) data_ptr)[i], db->data_addr);
 }
-static void dm9000_outblk_32bit(volatile void *data_ptr, int count)
+
+static void dm9000_outblk_32bit(struct board_info *db, volatile void *data_ptr,
+				int count)
 {
 	int i;
 	u32 tmplen = (count + 3) / 4;
 
 	for (i = 0; i < tmplen; i++)
-		DM9000_outl(((u32 *) data_ptr)[i], DM9000_DATA);
+		DM9000_outl(((u32 *) data_ptr)[i], db->data_addr);
 }
 
-static void dm9000_inblk_8bit(void *data_ptr, int count)
+static void dm9000_inblk_8bit(struct board_info *db, void *data_ptr, int count)
 {
 	int i;
 	for (i = 0; i < count; i++)
-		((u8 *) data_ptr)[i] = DM9000_inb(DM9000_DATA);
+		((u8 *) data_ptr)[i] = DM9000_inb(db->data_addr);
 }
 
-static void dm9000_inblk_16bit(void *data_ptr, int count)
+static void dm9000_inblk_16bit(struct board_info *db, void *data_ptr, int count)
 {
 	int i;
 	u32 tmplen = (count + 1) / 2;
 
 	for (i = 0; i < tmplen; i++)
-		((u16 *) data_ptr)[i] = DM9000_inw(DM9000_DATA);
+		((u16 *) data_ptr)[i] = DM9000_inw(db->data_addr);
 }
-static void dm9000_inblk_32bit(void *data_ptr, int count)
+
+static void dm9000_inblk_32bit(struct board_info *db, void *data_ptr, int count)
 {
 	int i;
 	u32 tmplen = (count + 3) / 4;
 
 	for (i = 0; i < tmplen; i++)
-		((u32 *) data_ptr)[i] = DM9000_inl(DM9000_DATA);
+		((u32 *) data_ptr)[i] = DM9000_inl(db->data_addr);
 }
 
-static void dm9000_rx_status_32bit(u16 *RxStatus, u16 *RxLen)
+static void dm9000_rx_status_32bit(struct board_info *db, u16 *RxStatus, u16 *RxLen)
 {
 	u32 tmpdata;
 
-	DM9000_outb(DM9000_MRCMD, DM9000_IO);
+	DM9000_outb(DM9000_MRCMD, db->io_addr);
 
-	tmpdata = DM9000_inl(DM9000_DATA);
+	tmpdata = DM9000_inl(db->data_addr);
 	*RxStatus = __le16_to_cpu(tmpdata);
 	*RxLen = __le16_to_cpu(tmpdata >> 16);
 }
 
-static void dm9000_rx_status_16bit(u16 *RxStatus, u16 *RxLen)
+static void dm9000_rx_status_16bit(struct board_info *db, u16 *RxStatus, u16 *RxLen)
 {
-	DM9000_outb(DM9000_MRCMD, DM9000_IO);
+	DM9000_outb(DM9000_MRCMD, db->io_addr);
 
-	*RxStatus = __le16_to_cpu(DM9000_inw(DM9000_DATA));
-	*RxLen = __le16_to_cpu(DM9000_inw(DM9000_DATA));
+	*RxStatus = __le16_to_cpu(DM9000_inw(db->data_addr));
+	*RxLen = __le16_to_cpu(DM9000_inw(db->data_addr));
 }
 
-static void dm9000_rx_status_8bit(u16 *RxStatus, u16 *RxLen)
+static void dm9000_rx_status_8bit(struct board_info *db, u16 *RxStatus, u16 *RxLen)
 {
-	DM9000_outb(DM9000_MRCMD, DM9000_IO);
+	DM9000_outb(DM9000_MRCMD, db->io_addr);
 
 	*RxStatus =
-	    __le16_to_cpu(DM9000_inb(DM9000_DATA) +
-			  (DM9000_inb(DM9000_DATA) << 8));
+	    __le16_to_cpu(DM9000_inb(db->data_addr) +
+			  (DM9000_inb(db->data_addr) << 8));
 	*RxLen =
-	    __le16_to_cpu(DM9000_inb(DM9000_DATA) +
-			  (DM9000_inb(DM9000_DATA) << 8));
+	    __le16_to_cpu(DM9000_inb(db->data_addr) +
+			  (DM9000_inb(db->data_addr) << 8));
 }
 
 /*
   Search DM9000 board, allocate space and register it
 */
-int
-dm9000_probe(void)
+static int dm9000_probe(struct board_info *db)
 {
 	u32 id_val;
-	id_val = DM9000_ior(DM9000_VIDL);
-	id_val |= DM9000_ior(DM9000_VIDH) << 8;
-	id_val |= DM9000_ior(DM9000_PIDL) << 16;
-	id_val |= DM9000_ior(DM9000_PIDH) << 24;
+	id_val = DM9000_ior(db, DM9000_VIDL);
+	id_val |= DM9000_ior(db, DM9000_VIDH) << 8;
+	id_val |= DM9000_ior(db, DM9000_PIDL) << 16;
+	id_val |= DM9000_ior(db, DM9000_PIDH) << 24;
 	if (id_val == DM9000_ID) {
 		printf("dm9000 i/o: 0x%x, id: 0x%x \n", CONFIG_DM9000_BASE,
 		       id_val);
@@ -245,8 +254,7 @@ dm9000_probe(void)
 }
 
 /* General Purpose dm9000 reset routine */
-static void
-dm9000_reset(void)
+static void dm9000_reset(struct board_info *db)
 {
 	DM9000_DBG("resetting DM9000\n");
 
@@ -254,51 +262,70 @@ dm9000_reset(void)
 	   see DM9000 Application Notes V1.22 Jun 11, 2004 page 29 */
 
 	/* DEBUG: Make all GPIO0 outputs, all others inputs */
-	DM9000_iow(DM9000_GPCR, GPCR_GPIO0_OUT);
+	DM9000_iow(db, DM9000_GPCR, GPCR_GPIO0_OUT);
 	/* Step 1: Power internal PHY by writing 0 to GPIO0 pin */
-	DM9000_iow(DM9000_GPR, 0);
+	DM9000_iow(db, DM9000_GPR, 0);
 	/* Step 2: Software reset */
-	DM9000_iow(DM9000_NCR, (NCR_LBK_INT_MAC | NCR_RST));
+	DM9000_iow(db, DM9000_NCR, (NCR_LBK_INT_MAC | NCR_RST));
 
 	do {
 		DM9000_DBG("resetting the DM9000, 1st reset\n");
 		udelay(25); /* Wait at least 20 us */
-	} while (DM9000_ior(DM9000_NCR) & 1);
+	} while (DM9000_ior(db, DM9000_NCR) & 1);
 
-	DM9000_iow(DM9000_NCR, 0);
-	DM9000_iow(DM9000_NCR, (NCR_LBK_INT_MAC | NCR_RST)); /* Issue a second reset */
+	DM9000_iow(db, DM9000_NCR, 0);
+	DM9000_iow(db, DM9000_NCR, (NCR_LBK_INT_MAC | NCR_RST)); /* Issue a second reset */
 
 	do {
 		DM9000_DBG("resetting the DM9000, 2nd reset\n");
 		udelay(25); /* Wait@least 20 us */
-	} while (DM9000_ior(DM9000_NCR) & 1);
+	} while (DM9000_ior(db, DM9000_NCR) & 1);
 
 	/* Check whether the ethernet controller is present */
-	if ((DM9000_ior(DM9000_PIDL) != 0x0) ||
-	    (DM9000_ior(DM9000_PIDH) != 0x90))
+	if ((DM9000_ior(db, DM9000_PIDL) != 0x0) ||
+	    (DM9000_ior(db, DM9000_PIDH) != 0x90))
 		printf("ERROR: resetting DM9000 -> not responding\n");
 }
 
+static int dm9000_set_hw_enetaddr(struct eth_device *netdev, bd_t *bd)
+{
+	struct board_info *db = to_board_info(netdev);
+	int i, oft;
+
+	/* fill device MAC address registers */
+	for (i = 0, oft = DM9000_PAR; i < 6; i++, oft++)
+		DM9000_iow(db, oft, netdev->enetaddr[i]);
+	for (i = 0, oft = 0x16; i < 8; i++, oft++)
+		DM9000_iow(db, oft, 0xff);
+
+	/* read back mac, just to be sure */
+	for (i = 0, oft = 0x10; i < 6; i++, oft++)
+		DM9000_DBG("%02x:", DM9000_ior(db, oft));
+	DM9000_DBG("\n");
+
+	return 0;
+}
+
 /* Initilize dm9000 board
 */
-int
-eth_init(bd_t * bd)
+static int dm9000_init(struct eth_device *netdev, bd_t * bd)
 {
-	int i, oft, lnk;
+	int i, lnk;
 	u8 io_mode;
-	struct board_info *db = &dm9000_info;
+	struct board_info *db = to_board_info(netdev);
+	char enetvar[32];
 	uchar enetaddr[6];
 
-	DM9000_DBG("eth_init()\n");
+	DM9000_DBG("dm9000_init()\n");
 
 	/* RESET device */
-	dm9000_reset();
+	dm9000_reset(db);
 
-	if (dm9000_probe() < 0)
+	if (dm9000_probe(db) < 0)
 		return -1;
 
 	/* Auto-detect 8/16/32 bit mode, ISR Bit 6+7 indicate bus width */
-	io_mode = DM9000_ior(DM9000_ISR) >> 6;
+	io_mode = DM9000_ior(db, DM9000_ISR) >> 6;
 
 	switch (io_mode) {
 	case 0x0:  /* 16-bit mode */
@@ -329,52 +356,44 @@ eth_init(bd_t * bd)
 	}
 
 	/* Program operating register, only internal phy supported */
-	DM9000_iow(DM9000_NCR, 0x0);
+	DM9000_iow(db, DM9000_NCR, 0x0);
 	/* TX Polling clear */
-	DM9000_iow(DM9000_TCR, 0);
+	DM9000_iow(db, DM9000_TCR, 0);
 	/* Less 3Kb, 200us */
-	DM9000_iow(DM9000_BPTR, BPTR_BPHW(3) | BPTR_JPT_600US);
+	DM9000_iow(db, DM9000_BPTR, BPTR_BPHW(3) | BPTR_JPT_600US);
 	/* Flow Control : High/Low Water */
-	DM9000_iow(DM9000_FCTR, FCTR_HWOT(3) | FCTR_LWOT(8));
+	DM9000_iow(db, DM9000_FCTR, FCTR_HWOT(3) | FCTR_LWOT(8));
 	/* SH FIXME: This looks strange! Flow Control */
-	DM9000_iow(DM9000_FCR, 0x0);
+	DM9000_iow(db, DM9000_FCR, 0x0);
 	/* Special Mode */
-	DM9000_iow(DM9000_SMCR, 0);
+	DM9000_iow(db, DM9000_SMCR, 0);
 	/* clear TX status */
-	DM9000_iow(DM9000_NSR, NSR_WAKEST | NSR_TX2END | NSR_TX1END);
+	DM9000_iow(db, DM9000_NSR, NSR_WAKEST | NSR_TX2END | NSR_TX1END);
 	/* Clear interrupt status */
-	DM9000_iow(DM9000_ISR, ISR_ROOS | ISR_ROS | ISR_PTS | ISR_PRS);
+	DM9000_iow(db, DM9000_ISR, ISR_ROOS | ISR_ROS | ISR_PTS | ISR_PRS);
 
 	/* Set Node address */
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+	sprintf(enetvar, netdev->num ? "eth%daddr" : "ethaddr", netdev->num);
+	if (!eth_getenv_enetaddr(enetvar, enetaddr)) {
 #if !defined(CONFIG_AT91SAM9261EK)
 		for (i = 0; i < 3; i++)
-			read_srom_word(i, enetaddr + 2 * i);
-		eth_setenv_enetaddr("ethaddr", enetaddr);
+			read_srom_word(netdev, i, enetaddr + 2 * i);
+		eth_setenv_enetaddr(enetvar, enetaddr);
 #endif
 	}
 
 	printf("MAC: %pM\n", enetaddr);
 
-	/* fill device MAC address registers */
-	for (i = 0, oft = DM9000_PAR; i < 6; i++, oft++)
-		DM9000_iow(oft, enetaddr[i]);
-	for (i = 0, oft = 0x16; i < 8; i++, oft++)
-		DM9000_iow(oft, 0xff);
-
-	/* read back mac, just to be sure */
-	for (i = 0, oft = 0x10; i < 6; i++, oft++)
-		DM9000_DBG("%02x:", DM9000_ior(oft));
-	DM9000_DBG("\n");
+	dm9000_set_hw_enetaddr(netdev, bd);
 
 	/* Activate DM9000 */
 	/* RX enable */
-	DM9000_iow(DM9000_RCR, RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN);
+	DM9000_iow(db, DM9000_RCR, RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN);
 	/* Enable TX/RX interrupt mask */
-	DM9000_iow(DM9000_IMR, IMR_PAR);
+	DM9000_iow(db, DM9000_IMR, IMR_PAR);
 
 	i = 0;
-	while (!(phy_read(1) & 0x20)) {	/* autonegation complete bit */
+	while (!(phy_read(db, 1) & 0x20)) {	/* autonegation complete bit */
 		udelay(1000);
 		i++;
 		if (i == 10000) {
@@ -384,7 +403,7 @@ eth_init(bd_t * bd)
 	}
 
 	/* see what we've got */
-	lnk = phy_read(17) >> 12;
+	lnk = phy_read(db, 17) >> 12;
 	printf("operating at ");
 	switch (lnk) {
 	case 1:
@@ -411,39 +430,39 @@ eth_init(bd_t * bd)
   Hardware start transmission.
   Send a packet to media from the upper layer.
 */
-int
-eth_send(volatile void *packet, int length)
+static int dm9000_send(struct eth_device *netdev, volatile void *packet,
+			   int length)
 {
 	int tmo;
-	struct board_info *db = &dm9000_info;
+	struct board_info *db = to_board_info(netdev);
 
-	DM9000_DMP_PACKET("eth_send", packet, length);
+	DM9000_DMP_PACKET("dm9000_send", packet, length);
 
-	DM9000_iow(DM9000_ISR, IMR_PTM); /* Clear Tx bit in ISR */
+	DM9000_iow(db, DM9000_ISR, IMR_PTM); /* Clear Tx bit in ISR */
 
 	/* Move data to DM9000 TX RAM */
-	DM9000_outb(DM9000_MWCMD, DM9000_IO); /* Prepare for TX-data */
+	DM9000_outb(DM9000_MWCMD, db->io_addr); /* Prepare for TX-data */
 
 	/* push the data to the TX-fifo */
-	(db->outblk)(packet, length);
+	(db->outblk)(db, packet, length);
 
 	/* Set TX length to DM9000 */
-	DM9000_iow(DM9000_TXPLL, length & 0xff);
-	DM9000_iow(DM9000_TXPLH, (length >> 8) & 0xff);
+	DM9000_iow(db, DM9000_TXPLL, length & 0xff);
+	DM9000_iow(db, DM9000_TXPLH, (length >> 8) & 0xff);
 
 	/* Issue TX polling command */
-	DM9000_iow(DM9000_TCR, TCR_TXREQ); /* Cleared after TX complete */
+	DM9000_iow(db, DM9000_TCR, TCR_TXREQ); /* Cleared after TX complete */
 
 	/* wait for end of transmission */
 	tmo = get_timer(0) + 5 * CONFIG_SYS_HZ;
-	while ( !(DM9000_ior(DM9000_NSR) & (NSR_TX1END | NSR_TX2END)) ||
-		!(DM9000_ior(DM9000_ISR) & IMR_PTM) ) {
+	while ( !(DM9000_ior(db, DM9000_NSR) & (NSR_TX1END | NSR_TX2END)) ||
+		!(DM9000_ior(db, DM9000_ISR) & IMR_PTM) ) {
 		if (get_timer(0) >= tmo) {
 			printf("transmission timeout\n");
 			break;
 		}
 	}
-	DM9000_iow(DM9000_ISR, IMR_PTM); /* Clear Tx bit in ISR */
+	DM9000_iow(db, DM9000_ISR, IMR_PTM); /* Clear Tx bit in ISR */
 
 	DM9000_DBG("transmit done\n\n");
 	return 0;
@@ -453,47 +472,47 @@ eth_send(volatile void *packet, int length)
   Stop the interface.
   The interface is stopped when it is brought.
 */
-void
-eth_halt(void)
+static void dm9000_halt(struct eth_device *netdev)
 {
-	DM9000_DBG("eth_halt\n");
+	struct board_info *db = to_board_info(netdev);
+
+	DM9000_DBG("dm9000_halt\n");
 
 	/* RESET devie */
-	phy_write(0, 0x8000);	/* PHY RESET */
-	DM9000_iow(DM9000_GPR, 0x01);	/* Power-Down PHY */
-	DM9000_iow(DM9000_IMR, 0x80);	/* Disable all interrupt */
-	DM9000_iow(DM9000_RCR, 0x00);	/* Disable RX */
+	phy_write(db, 0, 0x8000);	/* PHY RESET */
+	DM9000_iow(db, DM9000_GPR, 0x01);	/* Power-Down PHY */
+	DM9000_iow(db, DM9000_IMR, 0x80);	/* Disable all interrupt */
+	DM9000_iow(db, DM9000_RCR, 0x00);	/* Disable RX */
 }
 
 /*
   Received a packet and pass to upper layer
 */
-int
-eth_rx(void)
+static int dm9000_recv(struct eth_device *netdev)
 {
 	u8 rxbyte, *rdptr = (u8 *) NetRxPackets[0];
 	u16 RxStatus, RxLen = 0;
-	struct board_info *db = &dm9000_info;
+	struct board_info *db = to_board_info(netdev);
 
 	/* Check packet ready or not, we must check
 	   the ISR status first for DM9000A */
-	if (!(DM9000_ior(DM9000_ISR) & 0x01)) /* Rx-ISR bit must be set. */
+	if (!(DM9000_ior(db, DM9000_ISR) & 0x01)) /* Rx-ISR bit must be set. */
 		return 0;
 
-	DM9000_iow(DM9000_ISR, 0x01); /* clear PR status latched in bit 0 */
+	DM9000_iow(db, DM9000_ISR, 0x01); /* clear PR status latched in bit 0 */
 
 	/* There is _at least_ 1 package in the fifo, read them all */
 	for (;;) {
-		DM9000_ior(DM9000_MRCMDX);	/* Dummy read */
+		DM9000_ior(db, DM9000_MRCMDX);	/* Dummy read */
 
 		/* Get most updated data,
 		   only look at bits 0:1, See application notes DM9000 */
-		rxbyte = DM9000_inb(DM9000_DATA) & 0x03;
+		rxbyte = DM9000_inb(db->data_addr) & 0x03;
 
 		/* Status check: this byte must be 0 or 1 */
 		if (rxbyte > DM9000_PKT_RDY) {
-			DM9000_iow(DM9000_RCR, 0x00);	/* Stop Device */
-			DM9000_iow(DM9000_ISR, 0x80);	/* Stop INT request */
+			DM9000_iow(db, DM9000_RCR, 0x00);	/* Stop Device */
+			DM9000_iow(db, DM9000_ISR, 0x80);	/* Stop INT request */
 			printf("DM9000 error: status check fail: 0x%x\n",
 				rxbyte);
 			return 0;
@@ -505,13 +524,13 @@ eth_rx(void)
 		DM9000_DBG("receiving packet\n");
 
 		/* A packet ready now  & Get status/length */
-		(db->rx_status)(&RxStatus, &RxLen);
+		(db->rx_status)(db, &RxStatus, &RxLen);
 
 		DM9000_DBG("rx status: 0x%04x rx len: %d\n", RxStatus, RxLen);
 
 		/* Move data from DM9000 */
 		/* Read received packet from RX SRAM */
-		(db->inblk)(rdptr, RxLen);
+		(db->inblk)(db, rdptr, RxLen);
 
 		if ((RxStatus & 0xbf00) || (RxLen < 0x40)
 			|| (RxLen > DM9000_PKT_MAX)) {
@@ -526,10 +545,10 @@ eth_rx(void)
 			}
 			if (RxLen > DM9000_PKT_MAX) {
 				printf("rx length too big\n");
-				dm9000_reset();
+				dm9000_reset(db);
 			}
 		} else {
-			DM9000_DMP_PACKET("eth_rx", rdptr, RxLen);
+			DM9000_DMP_PACKET("dm9000_send", rdptr, RxLen);
 
 			DM9000_DBG("passing packet to upper layer\n");
 			NetReceive(NetRxPackets[0], RxLen);
@@ -538,65 +557,93 @@ eth_rx(void)
 	return 0;
 }
 
+int dm9000_eth_initialize(int id, u32 *data_addr, u32 *io_addr)
+{
+	struct board_info *db;
+	struct eth_device *netdev;
+
+	db = malloc(sizeof(struct board_info));
+	if (!db) {
+		printf("Error: Failed to allocate memory for DM9000_%d\n", id);
+		return -1;
+	}
+	memset(db, 0, sizeof(struct board_info));
+
+	netdev = &db->netdev;
+
+	db->io_addr = io_addr;
+	db->data_addr = data_addr;
+
+	sprintf(netdev->name, "dm9000_%d", id);
+	netdev->init = dm9000_init;
+	netdev->halt = dm9000_halt;
+	netdev->send = dm9000_send;
+	netdev->recv = dm9000_recv;
+	netdev->set_hw_enetaddr = dm9000_set_hw_enetaddr;
+
+	eth_register(netdev);
+
+	return 0;
+}
+
 /*
   Read a word data from SROM
 */
-static void read_srom_word(int offset, u8 *to)
+static void read_srom_word(struct eth_device *netdev, int offset, u8 *to)
 {
-	DM9000_iow(DM9000_EPAR, offset);
-	DM9000_iow(DM9000_EPCR, 0x4);
+	struct board_info *db = to_board_info(netdev);
+
+	DM9000_iow(db, DM9000_EPAR, offset);
+	DM9000_iow(db, DM9000_EPCR, 0x4);
 	udelay(8000);
-	DM9000_iow(DM9000_EPCR, 0x0);
-	to[0] = DM9000_ior(DM9000_EPDRL);
-	to[1] = DM9000_ior(DM9000_EPDRH);
+	DM9000_iow(db, DM9000_EPCR, 0x0);
+	to[0] = DM9000_ior(db, DM9000_EPDRL);
+	to[1] = DM9000_ior(db, DM9000_EPDRH);
 }
 
-void
-write_srom_word(int offset, u16 val)
+static void write_srom_word(struct eth_device *netdev, int offset, u16 val)
 {
-	DM9000_iow(DM9000_EPAR, offset);
-	DM9000_iow(DM9000_EPDRH, ((val >> 8) & 0xff));
-	DM9000_iow(DM9000_EPDRL, (val & 0xff));
-	DM9000_iow(DM9000_EPCR, 0x12);
+	struct board_info *db = to_board_info(netdev);
+
+	DM9000_iow(db, DM9000_EPAR, offset);
+	DM9000_iow(db, DM9000_EPDRH, ((val >> 8) & 0xff));
+	DM9000_iow(db, DM9000_EPDRL, (val & 0xff));
+	DM9000_iow(db, DM9000_EPCR, 0x12);
 	udelay(8000);
-	DM9000_iow(DM9000_EPCR, 0);
+	DM9000_iow(db, DM9000_EPCR, 0);
 }
 
-
 /*
    Read a byte from I/O port
 */
-static u8
-DM9000_ior(int reg)
+static u8 DM9000_ior(struct board_info *db, int reg)
 {
-	DM9000_outb(reg, DM9000_IO);
-	return DM9000_inb(DM9000_DATA);
+	DM9000_outb(reg, db->io_addr);
+	return DM9000_inb(db->data_addr);
 }
 
 /*
    Write a byte to I/O port
 */
-static void
-DM9000_iow(int reg, u8 value)
+static void DM9000_iow(struct board_info *db, int reg, u8 value)
 {
-	DM9000_outb(reg, DM9000_IO);
-	DM9000_outb(value, DM9000_DATA);
+	DM9000_outb(reg, db->io_addr);
+	DM9000_outb(value, db->data_addr);
 }
 
 /*
    Read a word from phyxcer
 */
-static u16
-phy_read(int reg)
+static u16 phy_read(struct board_info *db, int reg)
 {
 	u16 val;
 
 	/* Fill the phyxcer register into REG_0C */
-	DM9000_iow(DM9000_EPAR, DM9000_PHY | reg);
-	DM9000_iow(DM9000_EPCR, 0xc);	/* Issue phyxcer read command */
-	udelay(100);			/* Wait read complete */
-	DM9000_iow(DM9000_EPCR, 0x0);	/* Clear phyxcer read command */
-	val = (DM9000_ior(DM9000_EPDRH) << 8) | DM9000_ior(DM9000_EPDRL);
+	DM9000_iow(db, DM9000_EPAR, DM9000_PHY | reg);
+	DM9000_iow(db, DM9000_EPCR, 0xc);	/* Issue phyxcer read command */
+	udelay(100);				/* Wait read complete */
+	DM9000_iow(db, DM9000_EPCR, 0x0);	/* Clear phyxcer read command */
+	val = (DM9000_ior(db, DM9000_EPDRH) << 8) | DM9000_ior(db, DM9000_EPDRL);
 
 	/* The read data keeps on REG_0D & REG_0E */
 	DM9000_DBG("phy_read(0x%x): 0x%x\n", reg, val);
@@ -606,18 +653,102 @@ phy_read(int reg)
 /*
    Write a word to phyxcer
 */
-static void
-phy_write(int reg, u16 value)
+static void phy_write(struct board_info *db, int reg, u16 value)
 {
 
 	/* Fill the phyxcer register into REG_0C */
-	DM9000_iow(DM9000_EPAR, DM9000_PHY | reg);
+	DM9000_iow(db, DM9000_EPAR, DM9000_PHY | reg);
 
 	/* Fill the written data into REG_0D & REG_0E */
-	DM9000_iow(DM9000_EPDRL, (value & 0xff));
-	DM9000_iow(DM9000_EPDRH, ((value >> 8) & 0xff));
-	DM9000_iow(DM9000_EPCR, 0xa);	/* Issue phyxcer write command */
-	udelay(500);			/* Wait write complete */
-	DM9000_iow(DM9000_EPCR, 0x0);	/* Clear phyxcer write command */
+	DM9000_iow(db, DM9000_EPDRL, (value & 0xff));
+	DM9000_iow(db, DM9000_EPDRH, ((value >> 8) & 0xff));
+	DM9000_iow(db, DM9000_EPCR, 0xa);	/* Issue phyxcer write command */
+	udelay(500);				/* Wait write complete */
+	DM9000_iow(db, DM9000_EPCR, 0x0);	/* Clear phyxcer write command */
 	DM9000_DBG("phy_write(reg:0x%x, value:0x%x)\n", reg, value);
 }
+
+#ifdef CONFIG_CMD_DM9000_EEPROM
+static
+int do_read_dm9000_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	struct eth_device *netdev;
+	int i;
+	u8 data;
+
+	if (argc < 3) {
+		cmd_usage(cmdtp);
+		return 1;
+	}
+
+	netdev = eth_get_dev_by_name(argv[2]);
+	if(!netdev) {
+		puts ("No ethernet found.\n");
+		return 1;
+	}
+
+	for (i = 0; i < 0x40; i++) {
+		if (!(i % 0x10))
+			printf("\n%08x:", i);
+		read_srom_word(netdev, i, &data);
+		printf(" %04x", data);
+	}
+	printf ("\n");
+	return 0;
+}
+
+static
+int do_write_dm9000_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	struct eth_device *netdev;
+	int offset, value;
+
+	if (argc < 5) {
+		cmd_usage(cmdtp);
+		return 1;
+	}
+
+	netdev = eth_get_dev_by_name(argv[2]);
+	if(!netdev) {
+		puts ("No ethernet found.\n");
+		return 1;
+	}
+
+	offset = simple_strtoul(argv[3], NULL, 16);
+	value = simple_strtoul(argv[4], NULL, 16);
+	if (offset > 0x40) {
+		printf("Wrong offset : 0x%x\n", offset);
+		cmd_usage(cmdtp);
+		return 1;
+	}
+	write_srom_word(netdev, offset, value);
+	return 0;
+}
+
+static
+int do_dm9000_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	if (argc < 3) {
+		cmd_usage(cmdtp);
+		return 1;
+	}
+
+	if (strcmp (argv[1], "read") == 0) {
+		return (do_read_dm9000_eeprom(cmdtp, flag, argc, argv));
+	} else if (strcmp (argv[1], "write") == 0) {
+		return (do_write_dm9000_eeprom(cmdtp, flag, argc, argv));
+	} else {
+		cmd_usage(cmdtp);
+		return 1;
+	}
+}
+
+U_BOOT_CMD(
+	dm9000ee,4,1,do_dm9000_eeprom,
+	"Read/Write eeprom connected to Ethernet Controller",
+	"\ndm9000ee write <name> <word offset> <value> \n"
+	"\tdm9000ee read <name>\n"
+	"\tword:\t\t00-02 : MAC Address\n"
+	"\t\t\t03-07 : DM9000 Configuration\n"
+	"\t\t\t08-63 : User data\n");
+#endif
diff --git a/include/configs/M5253DEMO.h b/include/configs/M5253DEMO.h
index 1fea6c3..b61de14 100644
--- a/include/configs/M5253DEMO.h
+++ b/include/configs/M5253DEMO.h
@@ -91,9 +91,8 @@
 #define CONFIG_DRIVER_DM9000
 #ifdef CONFIG_DRIVER_DM9000
 #	define CONFIG_DM9000_BASE	(CONFIG_SYS_CS1_BASE | 0x300)
-#	define DM9000_IO		CONFIG_DM9000_BASE
-#	define DM9000_DATA		(CONFIG_DM9000_BASE + 4)
 #	undef CONFIG_DM9000_DEBUG
+#	define CONFIG_NET_MULTI
 
 #	define CONFIG_ETHADDR		00:e0:0c:bc:e5:60
 #	define CONFIG_IPADDR		10.82.121.249
diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
index fdaa71c..dad825a 100644
--- a/include/configs/at91sam9261ek.h
+++ b/include/configs/at91sam9261ek.h
@@ -134,11 +134,8 @@
 /* Ethernet */
 #define CONFIG_DRIVER_DM9000		1
 #define CONFIG_DM9000_BASE		0x30000000
-#define DM9000_IO			CONFIG_DM9000_BASE
-#define DM9000_DATA			(CONFIG_DM9000_BASE + 4)
-#define CONFIG_DM9000_USE_16BIT		1
+#define CONFIG_NET_MULTI		1
 #define CONFIG_NET_RETRY_COUNT		20
-#define CONFIG_RESET_PHY_R		1
 
 /* USB */
 #define CONFIG_USB_ATMEL
diff --git a/include/configs/scb9328.h b/include/configs/scb9328.h
index 893c3d3..39e6a4a 100644
--- a/include/configs/scb9328.h
+++ b/include/configs/scb9328.h
@@ -257,8 +257,7 @@
 
 #define CONFIG_DRIVER_DM9000		1
 #define CONFIG_DM9000_BASE		0x16000000
-#define DM9000_IO			CONFIG_DM9000_BASE
-#define DM9000_DATA			(CONFIG_DM9000_BASE+4)
+#define CONFIG_NET_MULTI		1
 
 /* f_{dpll}=2*f{ref}*(MFI+MFN/(MFD+1))/(PD+1)
    f_ref=16,777MHz
diff --git a/include/configs/trizepsiv.h b/include/configs/trizepsiv.h
index 4917318..fce9079 100644
--- a/include/configs/trizepsiv.h
+++ b/include/configs/trizepsiv.h
@@ -279,8 +279,8 @@
 
 #define CONFIG_DRIVER_DM9000		1
 #define CONFIG_DM9000_BASE	0x08000000
-#define DM9000_IO			CONFIG_DM9000_BASE
-#define DM9000_DATA			(CONFIG_DM9000_BASE+0x8004)
+#define CONFIG_NET_MULTI		1
+#define CONFIG_CMD_DM9000_EEPROM
 
 #define CONFIG_USB_OHCI_NEW	1
 #define CONFIG_SYS_USB_OHCI_BOARD_INIT	1
diff --git a/include/netdev.h b/include/netdev.h
index 63cf730..07328fa 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -44,6 +44,7 @@ int cpu_eth_init(bd_t *bis);
 int au1x00_enet_initialize(bd_t*);
 int bfin_EMAC_initialize(bd_t *bis);
 int dc21x4x_initialize(bd_t *bis);
+int dm9000_eth_initialize(int id, u32 *data_addr, u32 *io_addr);
 int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr);
 int e1000_initialize(bd_t *bis);
 int eepro100_initialize(bd_t *bis);
-- 
1.6.1.3

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 4/4] at91/macb: remove reset_phy callback
  2009-05-11  6:39   ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-11  6:39     ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-12  0:31       ` Ben Warren
  2009-05-11 18:02     ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Mike Frysinger
  2009-05-12  0:30     ` Ben Warren
  2 siblings, 1 reply; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-11  6:39 UTC (permalink / raw)
  To: u-boot

reset_phy was used to force the macb to be always init in order to
set the enetaddr in the hw registers which now done at the eth_initialize

This also reduce the boot time

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Stelian Pop <stelian.pop@leadtechdesign.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 board/afeb9260/afeb9260.c                 |   16 ----------------
 board/atmel/at91cap9adk/at91cap9adk.c     |   16 ----------------
 board/atmel/at91sam9260ek/at91sam9260ek.c |   16 ----------------
 board/atmel/at91sam9263ek/at91sam9263ek.c |   16 ----------------
 board/atmel/at91sam9rlek/at91sam9rlek.c   |    3 ---
 board/ronetix/pm9263/pm9263.c             |   16 ----------------
 include/configs/afeb9260.h                |    1 -
 include/configs/at91cap9adk.h             |    1 -
 include/configs/at91sam9260ek.h           |    1 -
 include/configs/at91sam9263ek.h           |    1 -
 include/configs/pm9263.h                  |    1 -
 11 files changed, 0 insertions(+), 88 deletions(-)

diff --git a/board/afeb9260/afeb9260.c b/board/afeb9260/afeb9260.c
index 024db2b..6f74012 100644
--- a/board/afeb9260/afeb9260.c
+++ b/board/afeb9260/afeb9260.c
@@ -33,10 +33,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/io.h>
 #include <asm/arch/hardware.h>
-#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
 #include <netdev.h>
-#include <net.h>
-#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -160,19 +157,6 @@ int dram_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_RESET_PHY_R
-void reset_phy(void)
-{
-#ifdef CONFIG_MACB
-	/*
-	 * Initialize ethernet HW addr prior to starting Linux,
-	 * needed for nfsroot
-	 */
-	eth_init(gd->bd);
-#endif
-}
-#endif
-
 int board_eth_init(bd_t *bis)
 {
 	int rc = 0;
diff --git a/board/atmel/at91cap9adk/at91cap9adk.c b/board/atmel/at91cap9adk/at91cap9adk.c
index 9f73df6..2fd20db 100644
--- a/board/atmel/at91cap9adk/at91cap9adk.c
+++ b/board/atmel/at91cap9adk/at91cap9adk.c
@@ -35,9 +35,6 @@
 #include <asm/arch/hardware.h>
 #include <lcd.h>
 #include <atmel_lcdc.h>
-#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
-#include <net.h>
-#endif
 #include <netdev.h>
 
 #define MP_BLOCK_3_BASE	0xFDF00000
@@ -336,19 +333,6 @@ int dram_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_RESET_PHY_R
-void reset_phy(void)
-{
-#ifdef CONFIG_MACB
-	/*
-	 * Initialize ethernet HW addr prior to starting Linux,
-	 * needed for nfsroot
-	 */
-	eth_init(gd->bd);
-#endif
-}
-#endif
-
 int board_eth_init(bd_t *bis)
 {
 	int rc = 0;
diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c
index 6bd3b44..8d01c4f 100644
--- a/board/atmel/at91sam9260ek/at91sam9260ek.c
+++ b/board/atmel/at91sam9260ek/at91sam9260ek.c
@@ -32,9 +32,6 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/io.h>
 #include <asm/arch/hardware.h>
-#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
-#include <net.h>
-#endif
 #include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -172,19 +169,6 @@ int dram_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_RESET_PHY_R
-void reset_phy(void)
-{
-#ifdef CONFIG_MACB
-	/*
-	 * Initialize ethernet HW addr prior to starting Linux,
-	 * needed for nfsroot
-	 */
-	eth_init(gd->bd);
-#endif
-}
-#endif
-
 int board_eth_init(bd_t *bis)
 {
 	int rc = 0;
diff --git a/board/atmel/at91sam9263ek/at91sam9263ek.c b/board/atmel/at91sam9263ek/at91sam9263ek.c
index 57d5c95..e19fd50 100644
--- a/board/atmel/at91sam9263ek/at91sam9263ek.c
+++ b/board/atmel/at91sam9263ek/at91sam9263ek.c
@@ -36,9 +36,6 @@
 #include <asm/arch/hardware.h>
 #include <lcd.h>
 #include <atmel_lcdc.h>
-#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
-#include <net.h>
-#endif
 #include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -259,19 +256,6 @@ int dram_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_RESET_PHY_R
-void reset_phy(void)
-{
-#ifdef CONFIG_MACB
-	/*
-	 * Initialize ethernet HW addr prior to starting Linux,
-	 * needed for nfsroot
-	 */
-	eth_init(gd->bd);
-#endif
-}
-#endif
-
 int board_eth_init(bd_t *bis)
 {
 	int rc = 0;
diff --git a/board/atmel/at91sam9rlek/at91sam9rlek.c b/board/atmel/at91sam9rlek/at91sam9rlek.c
index 7013ba2..94bcc17 100644
--- a/board/atmel/at91sam9rlek/at91sam9rlek.c
+++ b/board/atmel/at91sam9rlek/at91sam9rlek.c
@@ -34,9 +34,6 @@
 #include <asm/arch/io.h>
 #include <lcd.h>
 #include <atmel_lcdc.h>
-#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
-#include <net.h>
-#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/board/ronetix/pm9263/pm9263.c b/board/ronetix/pm9263/pm9263.c
index d24ef9a..4927edd 100644
--- a/board/ronetix/pm9263/pm9263.c
+++ b/board/ronetix/pm9263/pm9263.c
@@ -39,9 +39,6 @@
 #include <lcd.h>
 #include <atmel_lcdc.h>
 #include <dataflash.h>
-#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
-#include <net.h>
-#endif
 #include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -356,19 +353,6 @@ int dram_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_RESET_PHY_R
-void reset_phy(void)
-{
-#ifdef CONFIG_MACB
-	/*
-	 * Initialize ethernet HW addr prior to starting Linux,
-	 * needed for nfsroot
-	 */
-	eth_init(gd->bd);
-#endif
-}
-#endif
-
 int board_eth_init(bd_t *bis)
 {
 	int rc = 0;
diff --git a/include/configs/afeb9260.h b/include/configs/afeb9260.h
index c5134a2..2e891b0 100644
--- a/include/configs/afeb9260.h
+++ b/include/configs/afeb9260.h
@@ -114,7 +114,6 @@
 /* Ethernet */
 #define CONFIG_MACB			1
 #undef CONFIG_RMII			/* We have full MII there */
-#define CONFIG_RESET_PHY_R		1
 
 #define CONFIG_NET_MULTI		1
 #define CONFIG_NET_RETRY_COUNT		20
diff --git a/include/configs/at91cap9adk.h b/include/configs/at91cap9adk.h
index b2e6d7d..d3d2059 100644
--- a/include/configs/at91cap9adk.h
+++ b/include/configs/at91cap9adk.h
@@ -138,7 +138,6 @@
 #define CONFIG_RMII			1
 #define CONFIG_NET_MULTI		1
 #define CONFIG_NET_RETRY_COUNT		20
-#define CONFIG_RESET_PHY_R		1
 
 /* USB */
 #define CONFIG_USB_ATMEL
diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index e46c9d6..68e45a1 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -134,7 +134,6 @@
 #define CONFIG_RMII			1
 #define CONFIG_NET_MULTI		1
 #define CONFIG_NET_RETRY_COUNT		20
-#define CONFIG_RESET_PHY_R		1
 
 /* USB */
 #define CONFIG_USB_ATMEL
diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h
index d03ecee..016ec58 100644
--- a/include/configs/at91sam9263ek.h
+++ b/include/configs/at91sam9263ek.h
@@ -144,7 +144,6 @@
 #define CONFIG_RMII			1
 #define CONFIG_NET_MULTI		1
 #define CONFIG_NET_RETRY_COUNT		20
-#define CONFIG_RESET_PHY_R		1
 
 /* USB */
 #define CONFIG_USB_ATMEL
diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h
index 0db17b3..ffb40be 100644
--- a/include/configs/pm9263.h
+++ b/include/configs/pm9263.h
@@ -232,7 +232,6 @@
 #define CONFIG_RMII			1
 #define CONFIG_NET_MULTI		1
 #define CONFIG_NET_RETRY_COUNT		20
-#define CONFIG_RESET_PHY_R		1
 
 /* USB */
 #define CONFIG_USB_ATMEL
-- 
1.6.1.3

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11  6:39 [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  6:39 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-11  7:48 ` Mike Frysinger
  2009-05-11 12:08   ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-12  0:28 ` Ben Warren
  2 siblings, 1 reply; 37+ messages in thread
From: Mike Frysinger @ 2009-05-11  7:48 UTC (permalink / raw)
  To: u-boot

On Monday 11 May 2009 02:39:26 Jean-Christophe PLAGNIOL-VILLARD wrote:
> this will allow to add later a hook to update the enetadd hw storage
> when it's updated in env or when the env is saved

there is no need for that on purpose.  the network layer will recheck the 
environment every time it gets initialized, and it gets initialized with every 
network step.  this is already documented in doc/README.enetaddr.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090511/2d88e118/attachment.pgp 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support
  2009-05-11  6:39 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  6:39   ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-11  9:13   ` Haavard Skinnemoen
  2009-05-12  0:29   ` Ben Warren
  2 siblings, 0 replies; 37+ messages in thread
From: Haavard Skinnemoen @ 2009-05-11  9:13 UTC (permalink / raw)
  To: u-boot

Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Ben Warren <biggerbadderben@gmail.com>
> Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>

Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11  7:48 ` [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Mike Frysinger
@ 2009-05-11 12:08   ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11 13:26     ` Wolfgang Denk
  0 siblings, 1 reply; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-11 12:08 UTC (permalink / raw)
  To: u-boot

On 03:48 Mon 11 May     , Mike Frysinger wrote:
> On Monday 11 May 2009 02:39:26 Jean-Christophe PLAGNIOL-VILLARD wrote:
> > this will allow to add later a hook to update the enetadd hw storage
> > when it's updated in env or when the env is saved
> 
> there is no need for that on purpose.  the network layer will recheck the 
> environment every time it gets initialized, and it gets initialized with every 
> network step.  this is already documented in doc/README.enetaddr.
Unfortunatly we need it to set the enetaddr in the register of the soc evenif
there is no ethernet transfer as for the macb on at91 or the dm9000.
This how the kernel pass the mac address for the bootloader.

Best Regards,
J.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 12:08   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-11 13:26     ` Wolfgang Denk
  2009-05-11 14:24       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 37+ messages in thread
From: Wolfgang Denk @ 2009-05-11 13:26 UTC (permalink / raw)
  To: u-boot

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <20090511120809.GA1812@game.jcrosoft.org> you wrote:
>
> > there is no need for that on purpose.  the network layer will recheck the 
> > environment every time it gets initialized, and it gets initialized with every 
> > network step.  this is already documented in doc/README.enetaddr.
> Unfortunatly we need it to set the enetaddr in the register of the soc evenif
> there is no ethernet transfer as for the macb on at91 or the dm9000.
> This how the kernel pass the mac address for the bootloader.

You mean, this is how U-Boot is supposed to pass the MAC address to
the Kernel, right?

Well, strictly speaking this is (1) in direct violation of U-Boot's
design principles which say NOT to initialize things it does not use
itself, and (2) a bug in the Linux kernel that should be fixed there.

In this case it may be just writing to  a  register  without  further
initialization  of the hardware, but if we allow for that you can bet
that tomorrow someone will  try  and  add  code  that  requires  more
extensive initialization of the hardware for the same purpose, and he
will argue that his code must go in because there is preexisting code
that does the same.

That's why I have to NAK this.

The problem should be fixed in the Linux kernel. I know that RMK does
not alow for things like a MAC ATAG or similar, so the best you can
do is hope for quick approach of device tree based drivers. Until
then, you probably have to resort to out-of-tree (Linux) solutions
like everybody else who hit this problem before.

Best regards,

Wolfgang Denk

-- 
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
Nobody trips over mountains. It is the small pebble that  causes  you
to  stumble.  Pass all the pebbles in your path and you will find you
have crossed the mountain.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 13:26     ` Wolfgang Denk
@ 2009-05-11 14:24       ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11 16:01         ` Wolfgang Denk
  2009-05-11 16:24         ` Mike Frysinger
  0 siblings, 2 replies; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-11 14:24 UTC (permalink / raw)
  To: u-boot

On 15:26 Mon 11 May     , Wolfgang Denk wrote:
> Dear Jean-Christophe PLAGNIOL-VILLARD,
> 
> In message <20090511120809.GA1812@game.jcrosoft.org> you wrote:
> >
> > > there is no need for that on purpose.  the network layer will recheck the 
> > > environment every time it gets initialized, and it gets initialized with every 
> > > network step.  this is already documented in doc/README.enetaddr.
> > Unfortunatly we need it to set the enetaddr in the register of the soc evenif
> > there is no ethernet transfer as for the macb on at91 or the dm9000.
> > This how the kernel pass the mac address for the bootloader.
> 
> You mean, this is how U-Boot is supposed to pass the MAC address to
> the Kernel, right?
> 
> Well, strictly speaking this is (1) in direct violation of U-Boot's
> design principles which say NOT to initialize things it does not use
> itself, and (2) a bug in the Linux kernel that should be fixed there.
> 
> In this case it may be just writing to  a  register  without  further
> initialization  of the hardware, but if we allow for that you can bet
> that tomorrow someone will  try  and  add  code  that  requires  more
> extensive initialization of the hardware for the same purpose, and he
> will argue that his code must go in because there is preexisting code
> that does the same.
this exactly what is done only write mac hw register
without init the eth stack

before we do need to init the mac and detect the phy if we want to store
now we have to call the set_hw_enetaddr

Best Regards,
J.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 14:24       ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-11 16:01         ` Wolfgang Denk
  2009-05-11 16:30           ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11 16:24         ` Mike Frysinger
  1 sibling, 1 reply; 37+ messages in thread
From: Wolfgang Denk @ 2009-05-11 16:01 UTC (permalink / raw)
  To: u-boot

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <20090511142454.GB1812@game.jcrosoft.org> you wrote:
>
> > > Unfortunatly we need it to set the enetaddr in the register of the soc evenif
> > > there is no ethernet transfer as for the macb on at91 or the dm9000.
> > > This how the kernel pass the mac address for the bootloader.
> > 
> > You mean, this is how U-Boot is supposed to pass the MAC address to
> > the Kernel, right?
> > 
> > Well, strictly speaking this is (1) in direct violation of U-Boot's
> > design principles which say NOT to initialize things it does not use
> > itself, and (2) a bug in the Linux kernel that should be fixed there.
> > 
> > In this case it may be just writing to  a  register  without  further
> > initialization  of the hardware, but if we allow for that you can bet
> > that tomorrow someone will  try  and  add  code  that  requires  more
> > extensive initialization of the hardware for the same purpose, and he
> > will argue that his code must go in because there is preexisting code
> > that does the same.
> this exactly what is done only write mac hw register
> without init the eth stack
> 
> before we do need to init the mac and detect the phy if we want to store
> now we have to call the set_hw_enetaddr

Yes, I perfectly understood this. You did not have to explain it
again.

Did you understand what I wrote, too?

Best regards,

Wolfgang Denk

-- 
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
Minds are like parachutes - they only function when open.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 14:24       ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11 16:01         ` Wolfgang Denk
@ 2009-05-11 16:24         ` Mike Frysinger
  2009-05-11 16:37           ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11 17:24           ` Mike Frysinger
  1 sibling, 2 replies; 37+ messages in thread
From: Mike Frysinger @ 2009-05-11 16:24 UTC (permalink / raw)
  To: u-boot

On Monday 11 May 2009 10:24:54 Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 15:26 Mon 11 May     , Wolfgang Denk wrote:
> > Dear Jean-Christophe PLAGNIOL-VILLARD,
> >
> > In message <20090511120809.GA1812@game.jcrosoft.org> you wrote:
> > > > there is no need for that on purpose.  the network layer will recheck
> > > > the environment every time it gets initialized, and it gets
> > > > initialized with every network step.  this is already documented in
> > > > doc/README.enetaddr.
> > >
> > > Unfortunatly we need it to set the enetaddr in the register of the soc
> > > evenif there is no ethernet transfer as for the macb on at91 or the
> > > dm9000. This how the kernel pass the mac address for the bootloader.
> >
> > You mean, this is how U-Boot is supposed to pass the MAC address to
> > the Kernel, right?
> >
> > Well, strictly speaking this is (1) in direct violation of U-Boot's
> > design principles which say NOT to initialize things it does not use
> > itself, and (2) a bug in the Linux kernel that should be fixed there.
> >
> > In this case it may be just writing to  a  register  without  further
> > initialization  of the hardware, but if we allow for that you can bet
> > that tomorrow someone will  try  and  add  code  that  requires  more
> > extensive initialization of the hardware for the same purpose, and he
> > will argue that his code must go in because there is preexisting code
> > that does the same.
>
> this exactly what is done only write mac hw register
> without init the eth stack
>
> before we do need to init the mac and detect the phy if we want to store
> now we have to call the set_hw_enetaddr

then we agree you're doing it wrong and this patch is not needed/wanted

there is this FAQ, but i think we can add more info to it:
http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090511/08ed61a4/attachment.pgp 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 16:01         ` Wolfgang Denk
@ 2009-05-11 16:30           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-11 16:30 UTC (permalink / raw)
  To: u-boot

On 18:01 Mon 11 May     , Wolfgang Denk wrote:
> Dear Jean-Christophe PLAGNIOL-VILLARD,
> 
> In message <20090511142454.GB1812@game.jcrosoft.org> you wrote:
> >
> > > > Unfortunatly we need it to set the enetaddr in the register of the soc evenif
> > > > there is no ethernet transfer as for the macb on at91 or the dm9000.
> > > > This how the kernel pass the mac address for the bootloader.
> > > 
> > > You mean, this is how U-Boot is supposed to pass the MAC address to
> > > the Kernel, right?
> > > 
> > > Well, strictly speaking this is (1) in direct violation of U-Boot's
> > > design principles which say NOT to initialize things it does not use
> > > itself, and (2) a bug in the Linux kernel that should be fixed there.
> > > 
> > > In this case it may be just writing to  a  register  without  further
> > > initialization  of the hardware, but if we allow for that you can bet
> > > that tomorrow someone will  try  and  add  code  that  requires  more
> > > extensive initialization of the hardware for the same purpose, and he
> > > will argue that his code must go in because there is preexisting code
> > > that does the same.
> > this exactly what is done only write mac hw register
> > without init the eth stack
> > 
> > before we do need to init the mac and detect the phy if we want to store
> > now we have to call the set_hw_enetaddr
> 
> Yes, I perfectly understood this. You did not have to explain it
> again.
So no I do not understand why you nack it

Best Regards,
J.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 16:24         ` Mike Frysinger
@ 2009-05-11 16:37           ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11 16:56             ` Mike Frysinger
  2009-05-11 17:49             ` Wolfgang Denk
  2009-05-11 17:24           ` Mike Frysinger
  1 sibling, 2 replies; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-11 16:37 UTC (permalink / raw)
  To: u-boot

On 12:24 Mon 11 May     , Mike Frysinger wrote:
> On Monday 11 May 2009 10:24:54 Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 15:26 Mon 11 May     , Wolfgang Denk wrote:
> > > Dear Jean-Christophe PLAGNIOL-VILLARD,
> > >
> > > In message <20090511120809.GA1812@game.jcrosoft.org> you wrote:
> > > > > there is no need for that on purpose.  the network layer will recheck
> > > > > the environment every time it gets initialized, and it gets
> > > > > initialized with every network step.  this is already documented in
> > > > > doc/README.enetaddr.
> > > >
> > > > Unfortunatly we need it to set the enetaddr in the register of the soc
> > > > evenif there is no ethernet transfer as for the macb on at91 or the
> > > > dm9000. This how the kernel pass the mac address for the bootloader.
> > >
> > > You mean, this is how U-Boot is supposed to pass the MAC address to
> > > the Kernel, right?
> > >
> > > Well, strictly speaking this is (1) in direct violation of U-Boot's
> > > design principles which say NOT to initialize things it does not use
> > > itself, and (2) a bug in the Linux kernel that should be fixed there.
> > >
> > > In this case it may be just writing to  a  register  without  further
> > > initialization  of the hardware, but if we allow for that you can bet
> > > that tomorrow someone will  try  and  add  code  that  requires  more
> > > extensive initialization of the hardware for the same purpose, and he
> > > will argue that his code must go in because there is preexisting code
> > > that does the same.
> >
> > this exactly what is done only write mac hw register
> > without init the eth stack
> >
> > before we do need to init the mac and detect the phy if we want to store
> > now we have to call the set_hw_enetaddr
> 
> then we agree you're doing it wrong and this patch is not needed/wanted
> 
> there is this FAQ, but i think we can add more info to it:
> http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux
It does not work ether
how do you deal with multiple nic?
how do set a mac for NFS Rootfs?
how do you boot a *mainline* kernel?

Best Regards,
J.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 16:37           ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-11 16:56             ` Mike Frysinger
  2009-05-12  0:04               ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11 17:49             ` Wolfgang Denk
  1 sibling, 1 reply; 37+ messages in thread
From: Mike Frysinger @ 2009-05-11 16:56 UTC (permalink / raw)
  To: u-boot

On Monday 11 May 2009 12:37:28 Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 12:24 Mon 11 May     , Mike Frysinger wrote:
> > On Monday 11 May 2009 10:24:54 Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > On 15:26 Mon 11 May     , Wolfgang Denk wrote:
> > > > In message Jean-Christophe wrote:
> > > > > > there is no need for that on purpose.  the network layer will
> > > > > > recheck the environment every time it gets initialized, and it
> > > > > > gets initialized with every network step.  this is already
> > > > > > documented in doc/README.enetaddr.
> > > > >
> > > > > Unfortunatly we need it to set the enetaddr in the register of the
> > > > > soc evenif there is no ethernet transfer as for the macb on at91 or
> > > > > the dm9000. This how the kernel pass the mac address for the
> > > > > bootloader.
> > > >
> > > > You mean, this is how U-Boot is supposed to pass the MAC address to
> > > > the Kernel, right?
> > > >
> > > > Well, strictly speaking this is (1) in direct violation of U-Boot's
> > > > design principles which say NOT to initialize things it does not use
> > > > itself, and (2) a bug in the Linux kernel that should be fixed there.
> > > >
> > > > In this case it may be just writing to  a  register  without  further
> > > > initialization  of the hardware, but if we allow for that you can bet
> > > > that tomorrow someone will  try  and  add  code  that  requires  more
> > > > extensive initialization of the hardware for the same purpose, and he
> > > > will argue that his code must go in because there is preexisting code
> > > > that does the same.
> > >
> > > this exactly what is done only write mac hw register
> > > without init the eth stack
> > >
> > > before we do need to init the mac and detect the phy if we want to
> > > store now we have to call the set_hw_enetaddr
> >
> > then we agree you're doing it wrong and this patch is not needed/wanted
> >
> > there is this FAQ, but i think we can add more info to it:
> > http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux
>
> It does not work ether

your solution blatantly ignores the issues raised in the FAQ.  you cant push a 
change without clearing addressing those.

> how do you deal with multiple nic?

the ATAG/FDT tree handles most arches.

for the rest you have two major issues to address:
 - how do i pass it to the next OS ?
    * have the OS read the u-boot environment
    * have the OS read the command line
 - how does the OS set it ?
    * add a board hook to set it
    * set it via user space and normal methods (`ifconfig hw`)

> how do set a mac for NFS Rootfs?

use initramfs

> how do you boot a *mainline* kernel?

i dont know why you're emphasizing mainline.  if it's your board and if you 
implement the change correctly, submit it to mainline.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090511/2e4100ca/attachment.pgp 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 16:24         ` Mike Frysinger
  2009-05-11 16:37           ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-11 17:24           ` Mike Frysinger
  2009-05-11 17:54             ` Wolfgang Denk
  1 sibling, 1 reply; 37+ messages in thread
From: Mike Frysinger @ 2009-05-11 17:24 UTC (permalink / raw)
  To: u-boot

On Monday 11 May 2009 12:24:31 Mike Frysinger wrote:
> there is this FAQ, but i think we can add more info to it:
> http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux

ive filled it out some more ... i'm assuming this is the best place for such 
information

also, i dont really know this wiki, so i cheated with the FDT wiki link and 
used the full path since i was unable to guess at how to make it work 
relatively.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090511/f403e4b0/attachment.pgp 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 16:37           ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11 16:56             ` Mike Frysinger
@ 2009-05-11 17:49             ` Wolfgang Denk
  1 sibling, 0 replies; 37+ messages in thread
From: Wolfgang Denk @ 2009-05-11 17:49 UTC (permalink / raw)
  To: u-boot

Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <20090511163728.GB32661@game.jcrosoft.org> you wrote:
>
> > then we agree you're doing it wrong and this patch is not needed/wanted
> > 
> > there is this FAQ, but i think we can add more info to it:
> > http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux
> It does not work ether

What is "it" in this sentence?

You start a discussion here which is off topic on the U-Boot list. It
deals with a problem that is caused by the  ARM  Linuxkernel  design.
It's  a  very old problem, that has been discussed many times before,
and it's unlikely that we willsolve it here. If you want to solve it,
then please explain it to RMK.

> how do you deal with multiple nic?

Other (more reasonable architectures) use a device tree (current
PowerPC), a binary data structure (old PowerPC), or command line
arguments.

> how do set a mac for NFS Rootfs?

Other (more reasonable architectures) use a device tree (current
PowerPC), a binary data structure (old PowerPC), or command line
arguments.

> how do you boot a *mainline* kernel?

Other (more reasonable architectures) use a device tree (current
PowerPC), a binary data structure (old PowerPC), or command line
arguments.

The fact that mainline ARM has serious deficiencies is another story.
Or can you explain why the ARM kernel cannot load  and  uncompress  a
ramdisk  image  from NOR flash, why we instead have to load it to RAM
first, adding a completely unnecessary copy operation? It's just  one
of  the  issues  with  the  ARM  Linux  kernel  that need to be fixed
*there*.

But, as mentioned, this is off topic here.


Best regards,

Wolfgang Denk

-- 
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 whole problem with the world is  that  fools  and  fanatics  are
always so certain of themselves, but wiser people so full of doubts."
- Bertrand Russell

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 17:24           ` Mike Frysinger
@ 2009-05-11 17:54             ` Wolfgang Denk
  0 siblings, 0 replies; 37+ messages in thread
From: Wolfgang Denk @ 2009-05-11 17:54 UTC (permalink / raw)
  To: u-boot

Dear Mike,

in message <200905111324.58673.vapier@gentoo.org> you wrote:
>
> ive filled it out some more ... i'm assuming this is the best place for such 
> information

Thanks.

> also, i dont really know this wiki, so i cheated with the FDT wiki link and
> used the full path since i was unable to guess at how to make it work 
> relatively.

See http://www.denx.de/wiki/TWiki/TextFormattingRules next time you
have such an issue. I fixed it.

Best regards,

Wolfgang Denk

-- 
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
Everyting looks interesting until you do it. Then you find it's  just
another job.                     - Terry Pratchett, _Moving Pictures_

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api
  2009-05-11  6:39   ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  6:39     ` [U-Boot] [PATCH 4/4] at91/macb: remove reset_phy callback Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-11 18:02     ` Mike Frysinger
  2009-05-11 23:58       ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-12  0:30     ` Ben Warren
  2 siblings, 1 reply; 37+ messages in thread
From: Mike Frysinger @ 2009-05-11 18:02 UTC (permalink / raw)
  To: u-boot

On Monday 11 May 2009 02:39:28 Jean-Christophe PLAGNIOL-VILLARD wrote:
> this add multi devices support and merge dm9000's eeprom command support

assuming this doesnt depend on the first two patches in this series, this 
sounds great to me

> +U_BOOT_CMD(
> +	dm9000ee,4,1,do_dm9000_eeprom,
> +	"Read/Write eeprom connected to Ethernet Controller",
> +	"\ndm9000ee write <name> <word offset> <value> \n"
> +	"\tdm9000ee read <name>\n"
> +	"\tword:\t\t00-02 : MAC Address\n"
> +	"\t\t\t03-07 : DM9000 Configuration\n"
> +	"\t\t\t08-63 : User data\n");

the usage is slightly damaged in the original ... be nice to not copy over 
that broken crap.  i.e. it should look like:
	"write <name> <word offset> <value>\n"
	"dm9000ee read <name>\n"
	"\tword:\t\t00-02 : MAC Address\n"
	"\t\t\t03-07 : DM9000 Configuration\n"
	"\t\t\t08-63 : User data\n");

> +int dm9000_eth_initialize(int id, u32 *data_addr, u32 *io_addr);

requiring the data and io addr to be 32bit aligned is not a real requirement 
is it ?  so perhaps it should be void* here instead of u32*.
-mike

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api
  2009-05-11 18:02     ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Mike Frysinger
@ 2009-05-11 23:58       ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-12  0:37         ` Mike Frysinger
  0 siblings, 1 reply; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-11 23:58 UTC (permalink / raw)
  To: u-boot

On 14:02 Mon 11 May     , Mike Frysinger wrote:
> On Monday 11 May 2009 02:39:28 Jean-Christophe PLAGNIOL-VILLARD wrote:
> > this add multi devices support and merge dm9000's eeprom command support
> 
> assuming this doesnt depend on the first two patches in this series, this 
> sounds great to me
no it does

Best Regards,
J.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11 16:56             ` Mike Frysinger
@ 2009-05-12  0:04               ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-12  0:36                 ` Mike Frysinger
  2009-05-12 17:02                 ` Scott Wood
  0 siblings, 2 replies; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-12  0:04 UTC (permalink / raw)
  To: u-boot

> > > >
> > > > this exactly what is done only write mac hw register
> > > > without init the eth stack
> > > >
> > > > before we do need to init the mac and detect the phy if we want to
> > > > store now we have to call the set_hw_enetaddr
> > >
> > > then we agree you're doing it wrong and this patch is not needed/wanted
> > >
> > > there is this FAQ, but i think we can add more info to it:
> > > http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux
> >
> > It does not work ether
> 
> your solution blatantly ignores the issues raised in the FAQ.  you cant push a 
> change without clearing addressing those.
> 
> > how do you deal with multiple nic?
> 
> the ATAG/FDT tree handles most arches.
both not possible
> 
> for the rest you have two major issues to address:
>  - how do i pass it to the next OS ?
>     * have the OS read the u-boot environment
>     * have the OS read the command line
>  - how does the OS set it ?
>     * add a board hook to set it
>     * set it via user space and normal methods (`ifconfig hw`)
> 
> > how do set a mac for NFS Rootfs?
> 
> use initramfs
don't you think it's overkill to use a initramfs just for set a mac address??
> 
> > how do you boot a *mainline* kernel?
> 
> i dont know why you're emphasizing mainline.  if it's your board and if you 
> implement the change correctly, submit it to mainline.
because I already known RMK answer
NACK

Best Regards,
J.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-11  6:39 [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  6:39 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  7:48 ` [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Mike Frysinger
@ 2009-05-12  0:28 ` Ben Warren
  2 siblings, 0 replies; 37+ messages in thread
From: Ben Warren @ 2009-05-12  0:28 UTC (permalink / raw)
  To: u-boot

Jean-Christophe PLAGNIOL-VILLARD wrote:
> init it at the eth_initialize
>
> this will allow to add later a hook to update the enetadd hw storage
> when it's updated in env or when the env is saved
>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Ben Warren <biggerbadderben@gmail.com>
> ---
>  include/net.h |    2 ++
>  net/eth.c     |    4 ++++
>  2 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/include/net.h b/include/net.h
> index 5a1d36e..2ed6263 100644
> --- a/include/net.h
> +++ b/include/net.h
> @@ -93,6 +93,7 @@ enum eth_state_t {
>  };
>  
>  struct eth_device {
> +	int num;
>  	char name[NAMESIZE];
>  	unsigned char enetaddr[6];
>  	int iobase;
> @@ -105,6 +106,7 @@ struct eth_device {
>  #ifdef CONFIG_MCAST_TFTP
>  	int (*mcast) (struct eth_device*, u32 ip, u8 set);
>  #endif
> +	int  (*set_hw_enetaddr) (struct eth_device*, bd_t*);
>  	struct eth_device *next;
>  	void *priv;
>  };
> diff --git a/net/eth.c b/net/eth.c
> index c6fa5b9..99bb6c2 100644
> --- a/net/eth.c
> +++ b/net/eth.c
> @@ -217,6 +217,8 @@ int eth_initialize(bd_t *bis)
>  			if (eth_number)
>  				puts (", ");
>  
> +			dev->num = eth_number;
> +
>  			printf("%s", dev->name);
>  
>  			if (ethprime && strcmp (dev->name, ethprime) == 0) {
> @@ -240,6 +242,8 @@ int eth_initialize(bd_t *bis)
>  				}
>  
>  				memcpy(dev->enetaddr, env_enetaddr, 6);
> +				if(dev->set_hw_enetaddr)
> +					dev->set_hw_enetaddr(dev, bis);
>  			}
>  
>  			eth_number++;
>   
NAK, as convincingly explained by others.

regards,
Ben

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support
  2009-05-11  6:39 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  6:39   ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  9:13   ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Haavard Skinnemoen
@ 2009-05-12  0:29   ` Ben Warren
  2 siblings, 0 replies; 37+ messages in thread
From: Ben Warren @ 2009-05-12  0:29 UTC (permalink / raw)
  To: u-boot

Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Ben Warren <biggerbadderben@gmail.com>
> Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
> ---
>  drivers/net/macb.c |   23 +++++++++++++++++------
>  1 files changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 6de0a04..a339730 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -404,12 +404,25 @@ static int macb_phy_init(struct macb_device *macb)
>  	}
>  }
>  
> -static int macb_init(struct eth_device *netdev, bd_t *bd)
> +static int macb_set_hw_enetaddr(struct eth_device *netdev, bd_t *bd)
>  {
>  	struct macb_device *macb = to_macb(netdev);
> -	unsigned long paddr;
>  	u32 hwaddr_bottom;
>  	u16 hwaddr_top;
> +
> +	/* set hardware address */
> +	hwaddr_bottom = cpu_to_le32(*((u32 *)netdev->enetaddr));
> +	macb_writel(macb, SA1B, hwaddr_bottom);
> +	hwaddr_top = cpu_to_le16(*((u16 *)(netdev->enetaddr + 4)));
> +	macb_writel(macb, SA1T, hwaddr_top);
> +
> +	return 0;
> +}
> +
> +static int macb_init(struct eth_device *netdev, bd_t *bd)
> +{
> +	struct macb_device *macb = to_macb(netdev);
> +	unsigned long paddr;
>  	int i;
>  
>  	/*
> @@ -439,10 +452,7 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
>  	macb_writel(macb, TBQP, macb->tx_ring_dma);
>  
>  	/* set hardware address */
> -	hwaddr_bottom = cpu_to_le32(*((u32 *)netdev->enetaddr));
> -	macb_writel(macb, SA1B, hwaddr_bottom);
> -	hwaddr_top = cpu_to_le16(*((u16 *)(netdev->enetaddr + 4)));
> -	macb_writel(macb, SA1T, hwaddr_top);
> +	macb_set_hw_enetaddr(netdev, bd);
>  
>  	/* choose RMII or MII mode. This depends on the board */
>  #ifdef CONFIG_RMII
> @@ -521,6 +531,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr)
>  	netdev->halt = macb_halt;
>  	netdev->send = macb_send;
>  	netdev->recv = macb_recv;
> +	netdev->set_hw_enetaddr = macb_set_hw_enetaddr;
>   
NAK, since this function pointer doesn't exist due to NAK'ing of part 1

regards,
Ben

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api
  2009-05-11  6:39   ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  6:39     ` [U-Boot] [PATCH 4/4] at91/macb: remove reset_phy callback Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11 18:02     ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Mike Frysinger
@ 2009-05-12  0:30     ` Ben Warren
  2 siblings, 0 replies; 37+ messages in thread
From: Ben Warren @ 2009-05-12  0:30 UTC (permalink / raw)
  To: u-boot

Jean-Christophe PLAGNIOL-VILLARD wrote:
> this add multi devices support and merge dm9000's eeprom command support
>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Ben Warren <biggerbadderben@gmail.com>
> Cc: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
> Cc: Konstantin Kletschke <kletschke@synertronixx.de>
> Cc: Stelian Pop <stelian.pop@leadtechdesign.com>
> ---
>   
I'll go over this in the next few days.

thanks,
Ben

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 4/4] at91/macb: remove reset_phy callback
  2009-05-11  6:39     ` [U-Boot] [PATCH 4/4] at91/macb: remove reset_phy callback Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-12  0:31       ` Ben Warren
  0 siblings, 0 replies; 37+ messages in thread
From: Ben Warren @ 2009-05-12  0:31 UTC (permalink / raw)
  To: u-boot

Jean-Christophe PLAGNIOL-VILLARD wrote:
> reset_phy was used to force the macb to be always init in order to
> set the enetaddr in the hw registers which now done at the eth_initialize
>
>   
I guess this is also NAK due to NAK'ing of parts 1 & 2.

regards,
Ben

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-12  0:04               ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-12  0:36                 ` Mike Frysinger
  2009-05-12  8:48                   ` Detlev Zundel
  2009-05-12 17:02                 ` Scott Wood
  1 sibling, 1 reply; 37+ messages in thread
From: Mike Frysinger @ 2009-05-12  0:36 UTC (permalink / raw)
  To: u-boot

On Monday 11 May 2009 20:04:46 Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > this exactly what is done only write mac hw register
> > > > > without init the eth stack
> > > > >
> > > > > before we do need to init the mac and detect the phy if we want to
> > > > > store now we have to call the set_hw_enetaddr
> > > >
> > > > then we agree you're doing it wrong and this patch is not
> > > > needed/wanted
> > > >
> > > > there is this FAQ, but i think we can add more info to it:
> > > > http://www.denx.de/wiki/view/DULG/EthernetDoesNotWorkInLinux
> > >
> > > It does not work ether
> >
> > your solution blatantly ignores the issues raised in the FAQ.  you cant
> > push a change without clearing addressing those.
> >
> > > how do you deal with multiple nic?
> >
> > the ATAG/FDT tree handles most arches.
>
> both not possible
>
> > for the rest you have two major issues to address:
> >  - how do i pass it to the next OS ?
> >     * have the OS read the u-boot environment
> >     * have the OS read the command line
> >  - how does the OS set it ?
> >     * add a board hook to set it
> >     * set it via user space and normal methods (`ifconfig hw`)
> >
> > > how do set a mac for NFS Rootfs?
> >
> > use initramfs
>
> don't you think it's overkill to use a initramfs just for set a mac
> address??

no, i think it's perfectly reasonable.  and considering you have no other 
option here that'll get merged ...
-mike

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api
  2009-05-11 23:58       ` Jean-Christophe PLAGNIOL-VILLARD
@ 2009-05-12  0:37         ` Mike Frysinger
  0 siblings, 0 replies; 37+ messages in thread
From: Mike Frysinger @ 2009-05-12  0:37 UTC (permalink / raw)
  To: u-boot

On Monday 11 May 2009 19:58:27 Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 14:02 Mon 11 May     , Mike Frysinger wrote:
> > On Monday 11 May 2009 02:39:28 Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > this add multi devices support and merge dm9000's eeprom command
> > > support
> >
> > assuming this doesnt depend on the first two patches in this series, this
> > sounds great to me
>
> no it does

shouldnt be hard to decouple it then considering the eth struct already passes 
down the initialized mac address
-mike

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-12  0:36                 ` Mike Frysinger
@ 2009-05-12  8:48                   ` Detlev Zundel
  2009-05-12 12:26                     ` Mike Frysinger
  2009-05-12 16:59                     ` Scott Wood
  0 siblings, 2 replies; 37+ messages in thread
From: Detlev Zundel @ 2009-05-12  8:48 UTC (permalink / raw)
  To: u-boot

Hi,

>> > > how do set a mac for NFS Rootfs?
>> >
>> > use initramfs
>>
>> don't you think it's overkill to use a initramfs just for set a mac
>> address??
>
> no, i think it's perfectly reasonable.  and considering you have no other 
> option here that'll get merged ...

Can you please explain to me, why you think it to be reasonable to
demand providing an initramfs in the order of 100s of k to set an
attribute of a hardware device which has its own driver?

Apart from being constantly repeated, I do not understand this reasoning
at all.  My (old-school) belief was that an operating system deals with
abstracting the hardware thus userspace does not need to (nor should)
know too many hw details.

Knowing that there is not a clear distinction line, I still fail to see
why a mac address of a network interface should be handled by
userspace.  Can someone enlighten me here?

Thanks
  Detlev

-- 
Ftpd never switches uid and euid, it uses setfsuid(2) instead. The
main reason is that uid switching has been exploited in several
breakins, but the sheer ugliness of uid switching counts too.
                                     -- pure-ftpd(8)
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-12  8:48                   ` Detlev Zundel
@ 2009-05-12 12:26                     ` Mike Frysinger
  2009-05-12 14:18                       ` Detlev Zundel
  2009-05-12 16:59                     ` Scott Wood
  1 sibling, 1 reply; 37+ messages in thread
From: Mike Frysinger @ 2009-05-12 12:26 UTC (permalink / raw)
  To: u-boot

On Tuesday 12 May 2009 04:48:28 Detlev Zundel wrote:
> >> > > how do set a mac for NFS Rootfs?
> >> >
> >> > use initramfs
> >>
> >> don't you think it's overkill to use a initramfs just for set a mac
> >> address??
> >
> > no, i think it's perfectly reasonable.  and considering you have no other
> > option here that'll get merged ...
>
> Can you please explain to me, why you think it to be reasonable to
> demand providing an initramfs in the order of 100s of k to set an
> attribute of a hardware device which has its own driver?
>
> Apart from being constantly repeated, I do not understand this reasoning
> at all.  My (old-school) belief was that an operating system deals with
> abstracting the hardware thus userspace does not need to (nor should)
> know too many hw details.
>
> Knowing that there is not a clear distinction line, I still fail to see
> why a mac address of a network interface should be handled by
> userspace.  Can someone enlighten me here?

no one said it must be done in userspace, that was just one method for doing 
it.  read the FAQ for other possibilities.
-mike

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-12 12:26                     ` Mike Frysinger
@ 2009-05-12 14:18                       ` Detlev Zundel
  2009-05-12 16:21                         ` Daniel Stenberg
  2009-05-12 22:06                         ` Mike Frysinger
  0 siblings, 2 replies; 37+ messages in thread
From: Detlev Zundel @ 2009-05-12 14:18 UTC (permalink / raw)
  To: u-boot

Hi Mike,

> On Tuesday 12 May 2009 04:48:28 Detlev Zundel wrote:
>> >> > > how do set a mac for NFS Rootfs?
>> >> >
>> >> > use initramfs
>> >>
>> >> don't you think it's overkill to use a initramfs just for set a mac
>> >> address??
>> >
>> > no, i think it's perfectly reasonable.  and considering you have no other
>> > option here that'll get merged ...
>>
>> Can you please explain to me, why you think it to be reasonable to
>> demand providing an initramfs in the order of 100s of k to set an
>> attribute of a hardware device which has its own driver?
>>
>> Apart from being constantly repeated, I do not understand this reasoning
>> at all.  My (old-school) belief was that an operating system deals with
>> abstracting the hardware thus userspace does not need to (nor should)
>> know too many hw details.
>>
>> Knowing that there is not a clear distinction line, I still fail to see
>> why a mac address of a network interface should be handled by
>> userspace.  Can someone enlighten me here?
>
> no one said it must be done in userspace, that was just one method for doing 
> it.  read the FAQ for other possibilities.

No you lost me completely.  The question cited above was whether you
find it plausible to use initramfs - and thus userspace - to set a mac
address.  You answered that you find this plausible.  This is what I do
not understand.  

I never ran across this outside of linux arm where people seriously
repeat the statement over and over that a whole initramfs with an
initial userspace and a pivot_root is plausible for nfs root whilst
patches of a few lines float around doing the same in the kernel.

Now proof by repetition is not my preferred form of understanding a
problem, so I was asking for an explanation from someone arguing along
the same lines.

Cheers
  Detlev

-- 
We can forgive a man for making a useful thing as long as he does not
admire it.  The only excuse  for making  a useless  thing is that one
admires it intensely.
                                    --- Oscar Wilde
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-12 14:18                       ` Detlev Zundel
@ 2009-05-12 16:21                         ` Daniel Stenberg
  2009-05-12 22:06                         ` Mike Frysinger
  1 sibling, 0 replies; 37+ messages in thread
From: Daniel Stenberg @ 2009-05-12 16:21 UTC (permalink / raw)
  To: u-boot

On Tue, 12 May 2009, Detlev Zundel wrote:

> I never ran across this outside of linux arm where people seriously repeat 
> the statement over and over that a whole initramfs with an initial userspace 
> and a pivot_root is plausible for nfs root whilst patches of a few lines 
> float around doing the same in the kernel.
>
> Now proof by repetition is not my preferred form of understanding a problem, 
> so I was asking for an explanation from someone arguing along the same 
> lines.

The wiki page that explains the problem and provides the suggested solutions 
does not repeat that same mantra. It mentions the initramfs method as one way 
out of several - I don't think it mentions that solution as particularly 
better in any way. Wolfgang also repeated (most of) them here just a few mails 
ago in this thread.

-- 

  / daniel.haxx.se

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-12  8:48                   ` Detlev Zundel
  2009-05-12 12:26                     ` Mike Frysinger
@ 2009-05-12 16:59                     ` Scott Wood
  2009-05-13  8:39                       ` Detlev Zundel
  1 sibling, 1 reply; 37+ messages in thread
From: Scott Wood @ 2009-05-12 16:59 UTC (permalink / raw)
  To: u-boot

On Tue, May 12, 2009 at 10:48:28AM +0200, Detlev Zundel wrote:
> Can you please explain to me, why you think it to be reasonable to
> demand providing an initramfs in the order of 100s of k to set an
> attribute of a hardware device which has its own driver?

Kind of defeats any space-usage argument against putting device trees in
ARM instead...

> Apart from being constantly repeated, I do not understand this reasoning
> at all.  My (old-school) belief was that an operating system deals with
> abstracting the hardware thus userspace does not need to (nor should)
> know too many hw details.

There's more to the operating system than the kernel.

-Scott

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-12  0:04               ` Jean-Christophe PLAGNIOL-VILLARD
  2009-05-12  0:36                 ` Mike Frysinger
@ 2009-05-12 17:02                 ` Scott Wood
  1 sibling, 0 replies; 37+ messages in thread
From: Scott Wood @ 2009-05-12 17:02 UTC (permalink / raw)
  To: u-boot

On Tue, May 12, 2009 at 02:04:46AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > i dont know why you're emphasizing mainline.  if it's your board and if you 
> > implement the change correctly, submit it to mainline.
> because I already known RMK answer
> NACK

So go to RMK and say you need device trees because you got NACKed in
u-boot. :-)

-Scott

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-12 14:18                       ` Detlev Zundel
  2009-05-12 16:21                         ` Daniel Stenberg
@ 2009-05-12 22:06                         ` Mike Frysinger
  2009-05-13  8:41                           ` Detlev Zundel
  1 sibling, 1 reply; 37+ messages in thread
From: Mike Frysinger @ 2009-05-12 22:06 UTC (permalink / raw)
  To: u-boot

On Tuesday 12 May 2009 10:18:25 Detlev Zundel wrote:
> Hi Mike,
>
> > On Tuesday 12 May 2009 04:48:28 Detlev Zundel wrote:
> >> >> > > how do set a mac for NFS Rootfs?
> >> >> >
> >> >> > use initramfs
> >> >>
> >> >> don't you think it's overkill to use a initramfs just for set a mac
> >> >> address??
> >> >
> >> > no, i think it's perfectly reasonable.  and considering you have no
> >> > other option here that'll get merged ...
> >>
> >> Can you please explain to me, why you think it to be reasonable to
> >> demand providing an initramfs in the order of 100s of k to set an
> >> attribute of a hardware device which has its own driver?
> >>
> >> Apart from being constantly repeated, I do not understand this reasoning
> >> at all.  My (old-school) belief was that an operating system deals with
> >> abstracting the hardware thus userspace does not need to (nor should)
> >> know too many hw details.
> >>
> >> Knowing that there is not a clear distinction line, I still fail to see
> >> why a mac address of a network interface should be handled by
> >> userspace.  Can someone enlighten me here?
> >
> > no one said it must be done in userspace, that was just one method for
> > doing it.  read the FAQ for other possibilities.
>
> No you lost me completely.  The question cited above was whether you
> find it plausible to use initramfs - and thus userspace - to set a mac
> address.  You answered that you find this plausible.  This is what I do
> not understand.
>
> I never ran across this outside of linux arm where people seriously
> repeat the statement over and over that a whole initramfs with an
> initial userspace and a pivot_root is plausible for nfs root whilst
> patches of a few lines float around doing the same in the kernel.

i never said that a completely populated initramfs was needed.  it can be 
accomplished pretty easily with very little code.  
-mike

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-12 16:59                     ` Scott Wood
@ 2009-05-13  8:39                       ` Detlev Zundel
  0 siblings, 0 replies; 37+ messages in thread
From: Detlev Zundel @ 2009-05-13  8:39 UTC (permalink / raw)
  To: u-boot

Hi Scott,

> On Tue, May 12, 2009 at 10:48:28AM +0200, Detlev Zundel wrote:
>> Can you please explain to me, why you think it to be reasonable to
>> demand providing an initramfs in the order of 100s of k to set an
>> attribute of a hardware device which has its own driver?
>
> Kind of defeats any space-usage argument against putting device trees in
> ARM instead...

Good point.

>> Apart from being constantly repeated, I do not understand this reasoning
>> at all.  My (old-school) belief was that an operating system deals with
>> abstracting the hardware thus userspace does not need to (nor should)
>> know too many hw details.
>
> There's more to the operating system than the kernel.

Sure - but how does this affect the question at hand?

Cheers
  Detlev

-- 
Practice random senselessness and act kind of beautiful.
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-12 22:06                         ` Mike Frysinger
@ 2009-05-13  8:41                           ` Detlev Zundel
  2009-05-13 18:07                             ` Mike Frysinger
  0 siblings, 1 reply; 37+ messages in thread
From: Detlev Zundel @ 2009-05-13  8:41 UTC (permalink / raw)
  To: u-boot

Hi Mike,

>> I never ran across this outside of linux arm where people seriously
>> repeat the statement over and over that a whole initramfs with an
>> initial userspace and a pivot_root is plausible for nfs root whilst
>> patches of a few lines float around doing the same in the kernel.
>
> i never said that a completely populated initramfs was needed.  it can be 
> accomplished pretty easily with very little code.  

Sure, but still, how big is such an initramfs, do you have any numbers
here?

And how many lines of C code does it take to set the MAC in the kernel?
Is this really worth it?

Cheers
  Detlev

-- 
Basically,  Barnes & Noble separates things by how old they are  -- current
stuff is "Fiction", stuff from 20 years ago is "Literature", stuff from 100
years ago is "Classics", stuff from 400 years ago is "Shakespeare" [..] and
stuff from 2000 years ago is "History".
                     -- James "Kibo" Parry in <kibo-1207032212000001@10.0.1.2>
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-13  8:41                           ` Detlev Zundel
@ 2009-05-13 18:07                             ` Mike Frysinger
  2009-05-15 14:42                               ` Detlev Zundel
  0 siblings, 1 reply; 37+ messages in thread
From: Mike Frysinger @ 2009-05-13 18:07 UTC (permalink / raw)
  To: u-boot

On Wednesday 13 May 2009 04:41:29 Detlev Zundel wrote:
> >> I never ran across this outside of linux arm where people seriously
> >> repeat the statement over and over that a whole initramfs with an
> >> initial userspace and a pivot_root is plausible for nfs root whilst
> >> patches of a few lines float around doing the same in the kernel.
> >
> > i never said that a completely populated initramfs was needed.  it can be
> > accomplished pretty easily with very little code.
>
> Sure, but still, how big is such an initramfs, do you have any numbers
> here?
>
> And how many lines of C code does it take to set the MAC in the kernel?
> Is this really worth it?

that is the problem of whoever needs this functionality.
-mike

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
  2009-05-13 18:07                             ` Mike Frysinger
@ 2009-05-15 14:42                               ` Detlev Zundel
  0 siblings, 0 replies; 37+ messages in thread
From: Detlev Zundel @ 2009-05-15 14:42 UTC (permalink / raw)
  To: u-boot

Hi Mike,

> On Wednesday 13 May 2009 04:41:29 Detlev Zundel wrote:
>> >> I never ran across this outside of linux arm where people seriously
>> >> repeat the statement over and over that a whole initramfs with an
>> >> initial userspace and a pivot_root is plausible for nfs root whilst
>> >> patches of a few lines float around doing the same in the kernel.
>> >
>> > i never said that a completely populated initramfs was needed.  it can be
>> > accomplished pretty easily with very little code.
>>
>> Sure, but still, how big is such an initramfs, do you have any numbers
>> here?
>>
>> And how many lines of C code does it take to set the MAC in the kernel?
>> Is this really worth it?
>
> that is the problem of whoever needs this functionality.

Ah.  Now this is exactly what reminded me of the ARM Linux ML in the
first place :(

Seeing that I do not learn anything new here, I'll stop.

Cheers
  Detlev

-- 
We can forgive a man for making a useful thing as long as he does not
admire it.  The only excuse  for making  a useless  thing is that one
admires it intensely.
                                    --- Oscar Wilde
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2009-05-15 14:42 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-11  6:39 [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Jean-Christophe PLAGNIOL-VILLARD
2009-05-11  6:39 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Jean-Christophe PLAGNIOL-VILLARD
2009-05-11  6:39   ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Jean-Christophe PLAGNIOL-VILLARD
2009-05-11  6:39     ` [U-Boot] [PATCH 4/4] at91/macb: remove reset_phy callback Jean-Christophe PLAGNIOL-VILLARD
2009-05-12  0:31       ` Ben Warren
2009-05-11 18:02     ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Mike Frysinger
2009-05-11 23:58       ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-12  0:37         ` Mike Frysinger
2009-05-12  0:30     ` Ben Warren
2009-05-11  9:13   ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Haavard Skinnemoen
2009-05-12  0:29   ` Ben Warren
2009-05-11  7:48 ` [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Mike Frysinger
2009-05-11 12:08   ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 13:26     ` Wolfgang Denk
2009-05-11 14:24       ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 16:01         ` Wolfgang Denk
2009-05-11 16:30           ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 16:24         ` Mike Frysinger
2009-05-11 16:37           ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 16:56             ` Mike Frysinger
2009-05-12  0:04               ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-12  0:36                 ` Mike Frysinger
2009-05-12  8:48                   ` Detlev Zundel
2009-05-12 12:26                     ` Mike Frysinger
2009-05-12 14:18                       ` Detlev Zundel
2009-05-12 16:21                         ` Daniel Stenberg
2009-05-12 22:06                         ` Mike Frysinger
2009-05-13  8:41                           ` Detlev Zundel
2009-05-13 18:07                             ` Mike Frysinger
2009-05-15 14:42                               ` Detlev Zundel
2009-05-12 16:59                     ` Scott Wood
2009-05-13  8:39                       ` Detlev Zundel
2009-05-12 17:02                 ` Scott Wood
2009-05-11 17:49             ` Wolfgang Denk
2009-05-11 17:24           ` Mike Frysinger
2009-05-11 17:54             ` Wolfgang Denk
2009-05-12  0:28 ` Ben Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.