[U-Boot] [PATCH v4][Net] Convert CS8900 Ethernet driver to CONFIG_NET_MULTI API

2009-08-25 Thread Ben Warren
All in-tree boards that use this controller have CONFIG_NET_MULTI added
Also:
  - changed CONFIG_DRIVER_CS8900 to CONFIG_CS8900
  - changed CS8900_BASE to CONFIG_CS8900_BASE
  - changed CS8900_BUS?? to CONFIG_CS8900_BUS??
  - cleaned up line lengths
  - modified VCMA9 command function that accesses the device
  - removed MAC address initialization from lib_arm/board.c

Signed-off-by: Ben Warren biggerbadder...@gmail.com
Tested-by: Wolfgang Denk w...@denx.de
Acked-by: Wolfgang Denk w...@denx.de
---

v4: Changed 8-bit accesses to use volatile keyword (change made by w...@denx.de)
v3: Added accessor macros to ensure proper bus access 
v2: Fixed typo: CS8900_BUS32 - CONFIG_CS8900_BUS32
Added more descriptive printf in cs8900_init as suggested by Wolfgang
Initialize 'priv' data structure in cs8900_initialize()

 board/altera/dk1c20/dk1c20.c  |   12 ++
 board/altera/dk1s10/dk1s10.c  |   12 ++
 board/armadillo/armadillo.c   |   12 ++
 board/csb226/csb226.c |   12 ++
 board/ep7312/ep7312.c |   12 ++
 board/freescale/mx31ads/mx31ads.c |   12 ++
 board/impa7/impa7.c   |   12 ++
 board/lart/lart.c |   12 ++
 board/mpl/vcma9/cmd_vcma9.c   |   28 +++--
 board/mpl/vcma9/vcma9.c   |   12 ++
 board/mx1ads/mx1ads.c |   12 ++
 board/samsung/smdk2400/smdk2400.c |   12 ++
 board/samsung/smdk2410/smdk2410.c |   12 ++
 board/samsung/smdk6400/smdk6400.c |   12 ++
 board/sbc2410x/sbc2410x.c |   12 ++
 board/ssv/adnpesc1/adnpesc1.c |   12 ++
 board/trab/trab.c |   12 ++
 drivers/net/Makefile  |2 +-
 drivers/net/cs8900.c  |  276 ++---
 drivers/net/cs8900.h  |   41 ---
 include/configs/ADNPESC1.h|   14 +-
 include/configs/DK1C20.h  |   14 +-
 include/configs/DK1S10.h  |   14 +-
 include/configs/VCMA9.h   |7 +-
 include/configs/armadillo.h   |9 +-
 include/configs/csb226.h  |7 +-
 include/configs/ep7312.h  |9 +-
 include/configs/impa7.h   |7 +-
 include/configs/lart.h|7 +-
 include/configs/mx1ads.h  |7 +-
 include/configs/mx31ads.h |7 +-
 include/configs/sbc2410x.h|7 +-
 include/configs/smdk2400.h|7 +-
 include/configs/smdk2410.h|7 +-
 include/configs/smdk6400.h|7 +-
 include/configs/trab.h|7 +-
 include/netdev.h  |1 +
 lib_arm/board.c   |9 --
 38 files changed, 476 insertions(+), 210 deletions(-)

diff --git a/board/altera/dk1c20/dk1c20.c b/board/altera/dk1c20/dk1c20.c
index 11c19b7..0bcaa4f 100644
--- a/board/altera/dk1c20/dk1c20.c
+++ b/board/altera/dk1c20/dk1c20.c
@@ -25,6 +25,7 @@
  */
 
 #include common.h
+#include netdev.h
 #include nios-io.h
 #ifdefined(CONFIG_SEVENSEG)
 #include ../common/sevenseg.h
@@ -79,3 +80,14 @@ int ide_preinit (void)
return 0;
 }
 #endif
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+   int rc = 0;
+#ifdef CONFIG_CS8900
+   rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
+#endif
+   return rc;
+}
+#endif
diff --git a/board/altera/dk1s10/dk1s10.c b/board/altera/dk1s10/dk1s10.c
index 64d591e..fb96501 100644
--- a/board/altera/dk1s10/dk1s10.c
+++ b/board/altera/dk1s10/dk1s10.c
@@ -22,6 +22,7 @@
  */
 
 #include common.h
+#include netdev.h
 #ifdefined(CONFIG_SEVENSEG)
 #include ../common/sevenseg.h
 #endif
@@ -58,3 +59,14 @@ phys_size_t initdram (int board_type)
 {
return (0);
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+   int rc = 0;
+#ifdef CONFIG_CS8900
+   rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
+#endif
+   return rc;
+}
+#endif
diff --git a/board/armadillo/armadillo.c b/board/armadillo/armadillo.c
index ca5bd1d..a825144 100644
--- a/board/armadillo/armadillo.c
+++ b/board/armadillo/armadillo.c
@@ -26,6 +26,7 @@
  */
 
 #include common.h
+#include netdev.h
 #include clps7111.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -58,3 +59,14 @@ int dram_init (void)
 
return (0);
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+   int rc = 0;
+#ifdef CONFIG_CS8900
+   rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
+#endif
+   return rc;
+}
+#endif
diff --git a/board/csb226/csb226.c b/board/csb226/csb226.c
index 80caf8b..0a6c13d 100644
--- a/board/csb226/csb226.c
+++ b/board/csb226/csb226.c
@@ -24,6 +24,7 @@
  */
 
 #include common.h
+#include netdev.h
 #include asm/arch/pxa-regs.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -151,3 +152,14 @@ void show_boot_progress (int status)
 
return;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+   int rc = 0;
+#ifdef CONFIG_CS8900
+   rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
+#endif
+   return rc;
+}
+#endif
diff --git a/board/ep7312/ep7312.c b/board/ep7312/ep7312.c
index 6968a5d..8ed14ad 100644
--- 

Re: [U-Boot] [PATCH v4][Net] Convert CS8900 Ethernet driver to CONFIG_NET_MULTI API

2009-08-25 Thread Ben Warren
Ben Warren wrote:
 All in-tree boards that use this controller have CONFIG_NET_MULTI added
 Also:
   - changed CONFIG_DRIVER_CS8900 to CONFIG_CS8900
   - changed CS8900_BASE to CONFIG_CS8900_BASE
   - changed CS8900_BUS?? to CONFIG_CS8900_BUS??
   - cleaned up line lengths
   - modified VCMA9 command function that accesses the device
   - removed MAC address initialization from lib_arm/board.c

 Signed-off-by: Ben Warren biggerbadder...@gmail.com
 Tested-by: Wolfgang Denk w...@denx.de
 Acked-by: Wolfgang Denk w...@denx.de
 ---
   
Applied to net/next

regards,
Ben
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot