Skip to contentSkip to conversation

Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

PATCH New Ben Warren 4 participants 19 messages Jul 27, 2009 – Oct 5, 2009 Network drivers

lore
Share & tools
lore

Ben Warren

author
#0 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

All in-tree boards that use this controller have CONFIG_NET_MULTI added
Also:
- changed CONFIG_DRIVER_SMC91111 to CONFIG_SMC91111
- cleaned up line lengths
- modified all boards that override weak function in this driver
- modified all eeprom standalone apps to work with new driver

---
 board/altera/ep1c20/ep1c20.c                  |   12 +
 board/altera/ep1s10/ep1s10.c                  |   12 +
 board/altera/ep1s40/ep1s40.c                  |   12 +
 board/armltd/integrator/integrator.c          |   13 +-
 board/armltd/versatile/versatile.c            |   12 +
 board/bf533-ezkit/bf533-ezkit.c               |   12 +
 board/bf533-stamp/bf533-stamp.c               |   12 +
 board/bf538f-ezkit/bf538f-ezkit.c             |   12 +
 board/bf561-ezkit/bf561-ezkit.c               |   12 +
 board/blackstamp/blackstamp.c                 |   12 +
 board/cerf250/cerf250.c                       |   12 +
 board/cm-bf533/cm-bf533.c                     |   12 +
 board/cm-bf561/cm-bf561.c                     |   12 +
 board/cradle/cradle.c                         |   12 +
 board/delta/delta.c                           |   12 +
 board/dnp1110/dnp1110.c                       |   12 +
 board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c |   12 +
 board/gaisler/gr_ep2s60/gr_ep2s60.c           |   12 +
 board/innokom/innokom.c                       |   12 +
 board/logodl/logodl.c                         |   12 +
 board/lpd7a40x/lpd7a40x.c                     |   12 +
 board/ms7722se/ms7722se.c                     |   12 +
 board/netstar/eeprom.c                        |   57 ++--
 board/netstar/netstar.c                       |   12 +
 board/psyent/pk1c20/pk1c20.c                  |   12 +
 board/pxa255_idp/pxa_idp.c                    |   12 +
 board/renesas/MigoR/migo_r.c                  |   12 +
 board/st/nhk8815/nhk8815.c                    |   12 +
 board/voiceblue/eeprom.c                      |   57 ++--
 board/voiceblue/voiceblue.c                   |   12 +
 board/xaeniax/xaeniax.c                       |   12 +
 board/xm250/xm250.c                           |   12 +
 board/xsengine/xsengine.c                     |   12 +
 board/zylonite/zylonite.c                     |   12 +
 drivers/net/Makefile                          |    2 +-
 drivers/net/smc91111.c                        |  491 ++++++++++++-------------
 drivers/net/smc91111.h                        |  192 +++++-----
 examples/standalone/smc91111_eeprom.c         |   98 +++---
 include/configs/EP1C20.h                      |    3 +-
 include/configs/EP1S10.h                      |    3 +-
 include/configs/EP1S40.h                      |    3 +-
 include/configs/MigoR.h                       |    3 +-
 include/configs/PK1C20.h                      |    3 +-
 include/configs/bf533-ezkit.h                 |    3 +-
 include/configs/bf533-stamp.h                 |    3 +-
 include/configs/bf538f-ezkit.h                |    3 +-
 include/configs/bf561-ezkit.h                 |    3 +-
 include/configs/blackstamp.h                  |    3 +-
 include/configs/cerf250.h                     |    3 +-
 include/configs/cm-bf533.h                    |    3 +-
 include/configs/cm-bf561.h                    |    3 +-
 include/configs/cradle.h                      |    3 +-
 include/configs/dnp1110.h                     |    3 +-
 include/configs/gr_cpci_ax2000.h              |    3 +-
 include/configs/gr_ep2s60.h                   |    3 +-
 include/configs/innokom.h                     |    3 +-
 include/configs/integratorcp.h                |    3 +-
 include/configs/logodl.h                      |    3 +-
 include/configs/lpd7a400-10.h                 |    3 +-
 include/configs/lpd7a404-10.h                 |    3 +-
 include/configs/ms7722se.h                    |    3 +-
 include/configs/netstar.h                     |    3 +-
 include/configs/nhk8815.h                     |    3 +-
 include/configs/pxa255_idp.h                  |    3 +-
 include/configs/versatile.h                   |    3 +-
 include/configs/voiceblue.h                   |    3 +-
 include/configs/xaeniax.h                     |    3 +-
 include/configs/xm250.h                       |    3 +-
 include/configs/xsengine.h                    |    3 +-
 include/configs/zylonite.h                    |    2 +-
 include/netdev.h                              |    1 +
 71 files changed, 888 insertions(+), 490 deletions(-)
board/altera/ep1c20/ep1c20.c +12 -0
index c5bfb85..82900f7 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 int board_early_init_f (void)
 {
@@ -38,3 +39,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_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/altera/ep1s10/ep1s10.c +12 -0
index de9bf42..cf886da 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 int board_early_init_f (void)
 {
@@ -38,3 +39,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_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/altera/ep1s40/ep1s40.c +12 -0
index c0eca17..6395de7 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 int checkboard (void)
 {
@@ -33,3 +34,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_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/armltd/integrator/integrator.c +9 -4
index a46deea..518944e 100644
@@ -34,9 +34,7 @@
  */
 
 #include <common.h>
-#ifdef CONFIG_PCI
 #include <netdev.h>
-#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -127,9 +125,16 @@ extern void dram_query(void);
 	return 0;
 }
 
-#ifdef CONFIG_PCI
+#ifdef CONFIG_CMD_NET
 int board_eth_init(bd_t *bis)
 {
-	return pci_eth_init(bis);
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+#ifdef CONFIG_PCI
+	rc += pci_eth_init(bis);
+#endif
+	return rc;
 }
 #endif
board/armltd/versatile/versatile.c +12 -0
index 197bc89..6e836dd 100644
@@ -34,6 +34,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -89,3 +90,14 @@ int dram_init (void)
 {
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/bf533-ezkit/bf533-ezkit.c +12 -0
index d5f0b7c..ff0e15e 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include "psd4256.h"
 #include "flash-defines.h"
 
@@ -57,3 +58,14 @@ int misc_init_r(void)
 
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/bf533-stamp/bf533-stamp.c +12 -0
index 7108dda..32e7174 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include "bf533-stamp.h"
 
@@ -283,3 +284,14 @@ void __led_toggle(led_id_t mask)
 }
 
 #endif
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/bf538f-ezkit/bf538f-ezkit.c +12 -0
index bbee989..1897405 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <config.h>
 #include <asm/blackfin.h>
 
@@ -25,3 +26,14 @@ phys_size_t initdram(int board_type)
 	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
 	return gd->bd->bi_memsize;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/bf561-ezkit/bf561-ezkit.c +12 -0
index 5aede17..24347e2 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -43,3 +44,14 @@ phys_size_t initdram(int board_type)
 	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
 	return gd->bd->bi_memsize;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/blackstamp/blackstamp.c +12 -0
index b671899..524c86c 100644
@@ -12,6 +12,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -44,3 +45,14 @@ void swap_to(int device_id)
 	SSYNC();
 }
 #endif
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/cerf250/cerf250.c +12 -0
index 307894f..59346bc 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -71,3 +72,14 @@ int dram_init (void)
 
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/cm-bf533/cm-bf533.c +12 -0
index 7eb761d..6598e27 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -23,3 +24,14 @@ phys_size_t initdram(int board_type)
 	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
 	return gd->bd->bi_memsize;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/cm-bf561/cm-bf561.c +12 -0
index 5bce9eb..b204d7c 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -23,3 +24,14 @@ phys_size_t initdram(int board_type)
 	gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
 	return gd->bd->bi_memsize;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/cradle/cradle.c +12 -0
index 6d8d555..21eb655 100644
@@ -27,6 +27,7 @@
 
 #include <asm/arch/pxa-regs.h>
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -223,3 +224,14 @@ dram_init (void)
 		PHYS_SDRAM_3_SIZE +
 		PHYS_SDRAM_4_SIZE );
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/delta/delta.c +12 -0
index 84ff47e..a294213 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <i2c.h>
 #include <da9030.h>
 #include <malloc.h>
@@ -363,3 +364,14 @@ void hw_watchdog_reset(void)
 	i2c_reg_write(addr, SYS_CONTROL_A, val);
 }
 #endif
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/dnp1110/dnp1110.c +12 -0
index ab8e7be..c215f5f 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <SA-1100.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -53,3 +54,14 @@ int dram_init (void)
 
 	return (0);
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c +12 -0
index 105a747..7fe85b8 100644
@@ -19,6 +19,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <config.h>
 #include <asm/leon.h>
 
@@ -37,3 +38,14 @@ int misc_init_r(void)
 {
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/gaisler/gr_ep2s60/gr_ep2s60.c +12 -0
index 2904d32..7241c6d 100644
@@ -19,6 +19,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <config.h>
 #include <asm/leon.h>
 
@@ -37,3 +38,14 @@ int misc_init_r(void)
 {
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/innokom/innokom.c +12 -0
index c2b88ae..3412f10 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/mach-types.h>
 
@@ -182,3 +183,14 @@ void show_boot_progress (int status)
 
 	return;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/logodl/logodl.c +12 -0
index c57210a..2562ecc 100644
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <asm/arch/pxa-regs.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -120,3 +121,14 @@ void show_boot_progress (int status)
 
 	return;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/lpd7a40x/lpd7a40x.c +12 -0
index 7edb65e..437dad0 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #if defined(CONFIG_LH7A400)
 #include <lh7a400.h>
 #elif defined(CONFIG_LH7A404)
@@ -79,3 +80,14 @@ int dram_init (void)
 
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/ms7722se/ms7722se.c +12 -0
index 32234d3..4e40b17 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 
@@ -57,3 +58,14 @@ void led_set_state(unsigned short value)
 {
 	writew(value & 0xFF, LED_BASE);
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/netstar/eeprom.c +30 -27

146 lines not on this page · raw message

board/netstar/netstar.c +12 -0
index ffd60bf..df1704b 100644
@@ -21,6 +21,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <i2c.h>
 #include <flash.h>
 #include <nand.h>
@@ -115,3 +116,14 @@ int board_nand_init(struct nand_chip *nand)
 	return 0;
 }
 #endif
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/psyent/pk1c20/pk1c20.c +12 -0
index 95b48bc..0a24866 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 int board_early_init_f (void)
 {
@@ -38,3 +39,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_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/pxa255_idp/pxa_idp.c +12 -0
index e9e479c..05e30ec 100644
@@ -31,6 +31,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <command.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -133,3 +134,14 @@ U_BOOT_CMD(idpcmd, CONFIG_SYS_MAXARGS, 0, do_idpcmd,
 );
 
 #endif
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/renesas/MigoR/migo_r.c +12 -0
index 204ca78..c0f26ac 100644
@@ -24,6 +24,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 
@@ -51,3 +52,14 @@ int dram_init (void)
 void led_set_state (unsigned short value)
 {
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/st/nhk8815/nhk8815.c +12 -0
index 085a5e0..c5b8c19 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -77,3 +78,14 @@ int dram_init(void)
 	gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/voiceblue/eeprom.c +30 -27

146 lines not on this page · raw message

board/voiceblue/voiceblue.c +12 -0
index 59b3310..5f8af2b 100644
@@ -20,6 +20,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -66,3 +67,14 @@ int board_late_init(void)
 
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/xaeniax/xaeniax.c +12 -0
index 9baa457..4c19c4d 100644
@@ -29,6 +29,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -71,3 +72,14 @@ int dram_init (void)
 
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/xm250/xm250.c +12 -0
index 56b1cd4..246bdde 100644
@@ -27,6 +27,7 @@
 
 #include <asm/arch/pxa-regs.h>
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -80,3 +81,14 @@ dram_init (void)
 
 	return (0);
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/xsengine/xsengine.c +12 -0
index 65923e9..4464fd4 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -61,3 +62,14 @@ int dram_init (void)
 
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
board/zylonite/zylonite.c +12 -0
index 5829170..749a40f 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -68,3 +69,14 @@ int dram_init (void)
 
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif
drivers/net/Makefile +1 -1
index 34b56d8..2df075c 100644
@@ -63,7 +63,7 @@ COBJS-$(CONFIG_RTL8139) += rtl8139.o
 COBJS-$(CONFIG_RTL8169) += rtl8169.o
 COBJS-$(CONFIG_DRIVER_S3C4510_ETH) += s3c4510b_eth.o
 COBJS-$(CONFIG_SH_ETHER) += sh_eth.o
-COBJS-$(CONFIG_DRIVER_SMC91111) += smc91111.o
+COBJS-$(CONFIG_SMC91111) += smc91111.o
 COBJS-$(CONFIG_SMC911X) += smc911x.o
 COBJS-$(CONFIG_TIGON3) += tigon3.o bcm570x_autoneg.o 5701rls.o
 COBJS-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
drivers/net/smc91111.c +232 -259

1,106 lines not on this page · raw message

drivers/net/smc91111.h +98 -94

369 lines not on this page · raw message

examples/standalone/smc91111_eeprom.c +52 -46

217 lines not on this page · raw message

include/configs/EP1C20.h +2 -1
index 8941e4d..61d8e20 100644
@@ -151,7 +151,8 @@
  * cache bypass so there's no need to monkey with inx/outx macros.
  *----------------------------------------------------------------------*/
 #define CONFIG_SMC91111_BASE	0x82110300	/* Base addr (bypass)	*/
-#define CONFIG_DRIVER_SMC91111			/* Using SMC91c111	*/
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111			/* Using SMC91c111	*/
 #undef	CONFIG_SMC91111_EXT_PHY			/* Internal PHY		*/
 #define CONFIG_SMC_USE_32_BIT			/* 32-bit interface	*/
 
include/configs/EP1S10.h +2 -1
index 53bd0d8..41e64e6 100644
@@ -145,7 +145,8 @@
  * cache bypass so there's no need to monkey with inx/outx macros.
  *----------------------------------------------------------------------*/
 #define CONFIG_SMC91111_BASE	0x82110300	/* Base addr (bypass)	*/
-#define CONFIG_DRIVER_SMC91111			/* Using SMC91c111	*/
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111			/* Using SMC91c111	*/
 #undef	CONFIG_SMC91111_EXT_PHY			/* Internal PHY		*/
 #define CONFIG_SMC_USE_32_BIT			/* 32-bit interface	*/
 
include/configs/EP1S40.h +2 -1
index 9e9a8a4..5b332e4 100644
@@ -145,7 +145,8 @@
  * cache bypass so there's no need to monkey with inx/outx macros.
  *----------------------------------------------------------------------*/
 #define CONFIG_SMC91111_BASE	0x82110300	/* Base addr (bypass)	*/
-#define CONFIG_DRIVER_SMC91111			/* Using SMC91c111	*/
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111			/* Using SMC91c111	*/
 #undef	CONFIG_SMC91111_EXT_PHY			/* Internal PHY		*/
 #define CONFIG_SMC_USE_32_BIT			/* 32-bit interface	*/
 
include/configs/MigoR.h +2 -1
index 3853574..6083892 100644
@@ -50,7 +50,8 @@
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* SMC9111 */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE    (0xB0000000)
 
 /* MEMORY */
include/configs/PK1C20.h +2 -1
index 522349f..cf6f7a9 100644
@@ -151,7 +151,8 @@
  * cache bypass so there's no need to monkey with inx/outx macros.
  *----------------------------------------------------------------------*/
 #define CONFIG_SMC91111_BASE	0x82110300	/* Base addr (bypass)	*/
-#define CONFIG_DRIVER_SMC91111			/* Using SMC91c111	*/
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111			/* Using SMC91c111	*/
 #undef	CONFIG_SMC91111_EXT_PHY			/* Internal PHY		*/
 #define CONFIG_SMC_USE_32_BIT			/* 32-bit interface	*/
 
include/configs/bf533-ezkit.h +2 -1
index f896cb0..8f23f1d 100644
@@ -65,7 +65,8 @@
  * Network Settings
  */
 #define ADI_CMDS_NETWORK	1
-#define CONFIG_DRIVER_SMC91111	1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111	1
 #define CONFIG_SMC91111_BASE	0x20310300
 #define SMC91111_EEPROM_INIT() \
 	do { \
include/configs/bf533-stamp.h +2 -1
index 4be2a5c..4693f00 100644
@@ -60,7 +60,8 @@
  * Network Settings
  */
 #define ADI_CMDS_NETWORK	1
-#define CONFIG_DRIVER_SMC91111	1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111	1
 #define CONFIG_SMC91111_BASE	0x20300300
 #define SMC91111_EEPROM_INIT() \
 	do { \
include/configs/bf538f-ezkit.h +2 -1
index 535687f..c4d899d 100644
@@ -60,7 +60,8 @@
  * Network Settings
  */
 #define ADI_CMDS_NETWORK	1
-#define CONFIG_DRIVER_SMC91111	1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111	1
 #define CONFIG_SMC91111_BASE	0x20310300
 #define CONFIG_HOSTNAME		bf538f-ezkit
 /* Uncomment next line to use fixed MAC address */
include/configs/bf561-ezkit.h +2 -1
index 4779a97..a1fa80b 100644
@@ -60,7 +60,8 @@
  * Network Settings
  */
 #define ADI_CMDS_NETWORK	1
-#define CONFIG_DRIVER_SMC91111	1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111	1
 #define CONFIG_SMC91111_BASE	0x2C010300
 #define CONFIG_SMC_USE_32_BIT	1
 #define CONFIG_HOSTNAME		bf561-ezkit
include/configs/blackstamp.h +2 -1
index 887f3fb..6c9b3e0 100644
@@ -30,7 +30,8 @@
 /*
  * Board settings
  */
-#define CONFIG_DRIVER_SMC91111	1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111	1
 #define CONFIG_SMC91111_BASE	0x20300300
 
 /* FLASH/ETHERNET uses the same address range
include/configs/cerf250.h +2 -1
index b924758..477b94a 100644
@@ -53,7 +53,8 @@
 /*
  * Hardware drivers
  */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE 0x04000300
 #define CONFIG_SMC_USE_32_BIT
 
include/configs/cm-bf533.h +2 -1
index ea548e9..06eb288 100644
@@ -60,7 +60,8 @@
  * Network Settings
  */
 #define ADI_CMDS_NETWORK	1
-#define CONFIG_DRIVER_SMC91111	1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111	1
 #define CONFIG_SMC91111_BASE	0x20200300
 #define CONFIG_HOSTNAME		cm-bf533
 /* Uncomment next line to use fixed MAC address */
include/configs/cm-bf561.h +2 -1
index 1153f11..dd747c8 100644
@@ -61,7 +61,8 @@
  */
 #define ADI_CMDS_NETWORK	1
 /* The next 2 lines are for use with DEV-BF5xx */
-#define CONFIG_DRIVER_SMC91111	1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111	1
 #define CONFIG_SMC91111_BASE	0x28000300
 /* The next 3 lines are for use with EXT-BF5xx-USB-ETH2 */
 /* #define CONFIG_DRIVER_SMC911X 1 */
include/configs/cradle.h +2 -1
index b150c22..200b61e 100644
@@ -49,7 +49,8 @@
 /*
  * Hardware drivers
  */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE 0x10000300
 #define CONFIG_SMC91111_EXT_PHY
 #define CONFIG_SMC_USE_32_BIT
include/configs/dnp1110.h +2 -1
index b6cfc67..e48e20f 100644
@@ -54,7 +54,8 @@
 /*
  * Hardware drivers
  */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE 0x20000300
 
 
include/configs/gr_cpci_ax2000.h +2 -1
index bbe635b..d188439 100644
@@ -292,7 +292,8 @@
 /*
  * Ethernet configuration uses on board SMC91C111
  */
-#define CONFIG_DRIVER_SMC91111          1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111          1
 #define CONFIG_SMC91111_BASE		0x20000300	/* chip select 3         */
 #define CONFIG_SMC_USE_32_BIT		1	/* 32 bit bus  */
 #undef  CONFIG_SMC_91111_EXT_PHY	/* we use internal phy   */
include/configs/gr_ep2s60.h +2 -1
index 7b0a08f..3a568ff 100644
@@ -267,7 +267,8 @@
 #ifndef USE_GRETH
 
 /* USE SMC91C111 MAC */
-#define CONFIG_DRIVER_SMC91111          1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111          1
 #define CONFIG_SMC91111_BASE		0x20000300	/* chip select 3         */
 #define CONFIG_SMC_USE_32_BIT		1	/* 32 bit bus  */
 #undef  CONFIG_SMC_91111_EXT_PHY	/* we use internal phy   */
include/configs/innokom.h +2 -1
index ed03ad3..9cb0d42 100644
@@ -157,7 +157,8 @@
 /*
  * SMSC91C111 Network Card
  */
-#define CONFIG_DRIVER_SMC91111		1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111		1
 #define CONFIG_SMC91111_BASE		0x14000000 /* chip select 5         */
 #undef  CONFIG_SMC_USE_32_BIT		           /* 16 bit bus access     */
 #undef  CONFIG_SMC_91111_EXT_PHY		   /* we use internal phy   */
include/configs/integratorcp.h +2 -1
index e38d569..caafc93 100644
@@ -53,7 +53,8 @@
 /*
  * Hardware drivers
  */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC_USE_32_BIT
 #define CONFIG_SMC91111_BASE    0xC8000000
 #undef CONFIG_SMC91111_EXT_PHY
include/configs/logodl.h +2 -1
index 5b903f0..0535ee1 100644
@@ -133,7 +133,8 @@
  * SMSC91C111 Network Card
  */
 #if 0
-#define CONFIG_DRIVER_SMC91111		1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111		1
 #define CONFIG_SMC91111_BASE		0x10000000 /* chip select 4         */
 #undef  CONFIG_SMC_USE_32_BIT		           /* 16 bit bus access     */
 #undef  CONFIG_SMC_91111_EXT_PHY		   /* we use internal phy   */
include/configs/lpd7a400-10.h +2 -1
index 6145c37..5f57c3a 100644
@@ -72,7 +72,8 @@
  * Default IO base of chip is 0x300, Card Engine has this address lines
  * (LAN chip) tied to Vcc, so we just care about the chip select
  */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE	(0x70000000)
 #undef CONFIG_SMC_USE_32_BIT
 #define CONFIG_SMC_USE_IOFUNCS
include/configs/lpd7a404-10.h +2 -1
index ce23f3d..9074e28 100644
@@ -72,7 +72,8 @@
  * Default IO base of chip is 0x300, Card Engine has this address lines
  * (LAN chip) tied to Vcc, so we just care about the chip select
  */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE	(0x70000000)
 #undef CONFIG_SMC_USE_32_BIT
 #define CONFIG_SMC_USE_IOFUNCS
include/configs/ms7722se.h +2 -1
index 6755af3..0251428 100644
@@ -48,7 +48,8 @@
 #undef  CONFIG_SHOW_BOOT_PROGRESS
 
 /* SMC9111 */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE    (0xB8000000)
 
 /* MEMORY */
include/configs/netstar.h +2 -1
index f0b4207..7bddf24 100644
@@ -93,7 +93,8 @@
 #define CONFIG_SYS_NS16550_CLK		(CONFIG_XTAL_FREQ)	/* can be 12M/32Khz or 48Mhz  */
 #define CONFIG_SYS_NS16550_COM1		OMAP1510_UART1_BASE	/* uart1 */
 
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE		0x04000300
 
 #define CONFIG_SYS_FLASH_BASE		PHYS_FLASH_1
include/configs/nhk8815.h +2 -1
index 3e2e09f..bf0c7bc 100644
@@ -116,7 +116,8 @@
 #define __io(a)			((void __iomem *)(PCI_IO_VADDR + (a)))
 #define __mem_isa(a)		((a) + PCI_MEMORY_VADDR)
 
-#define CONFIG_DRIVER_SMC91111	/* Using SMC91c111*/
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111	/* Using SMC91c111*/
 #define CONFIG_SMC91111_BASE	0x34000300
 #undef  CONFIG_SMC91111_EXT_PHY	/* Internal PHY */
 #define CONFIG_SMC_USE_32_BIT
include/configs/pxa255_idp.h +2 -1
index 2cae8ca..6c1defc 100644
@@ -87,7 +87,8 @@
 /*
  * Hardware drivers
  */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE	(PXA_CS5_PHYS + IDP_CS5_ETH_OFFSET + 0x300)
 #define CONFIG_SMC_USE_32_BIT	1
 /* #define CONFIG_SMC_USE_IOFUNCS */
include/configs/versatile.h +2 -1
index a9b70cc..4273b84 100644
@@ -82,7 +82,8 @@
  * Hardware drivers
  */
 
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC_USE_32_BIT
 #define CONFIG_SMC91111_BASE	0x10010000
 #undef CONFIG_SMC91111_EXT_PHY
include/configs/voiceblue.h +2 -1
index c9c3132..0dde65d 100644
@@ -94,7 +94,8 @@
 /*
  * Hardware drivers
  */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE	0x08000300
 
 #define CONFIG_HARD_I2C
include/configs/xaeniax.h +2 -1
index 83883f6..1329f0f 100644
@@ -196,7 +196,8 @@
 /*
  * SMSC91C111 Network Card
  */
-#define CONFIG_DRIVER_SMC91111		1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111		1
 #define CONFIG_SMC91111_BASE		0x10000300  /* chip select 3         */
 #define CONFIG_SMC_USE_32_BIT		1          /* 32 bit bus  */
 #undef  CONFIG_SMC_91111_EXT_PHY		   /* we use internal phy   */
include/configs/xm250.h +2 -1
index f18701a..cd56ce7 100644
@@ -50,7 +50,8 @@
 /*
  * Hardware drivers
  */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE		0x04000300
 #undef	CONFIG_SMC91111_EXT_PHY
 #define CONFIG_SMC_USE_32_BIT
include/configs/xsengine.h +2 -1
index 2697cca..f68461b 100644
@@ -94,7 +94,8 @@
 #define CONFIG_SYS_GBL_DATA_SIZE		128		/* size in bytes reserved for initial data */
 
 /* Hardware drivers */
-#define CONFIG_DRIVER_SMC91111
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111
 #define CONFIG_SMC91111_BASE		0x04000300
 #define CONFIG_SMC_USE_32_BIT		1
 
include/configs/zylonite.h +1 -1
index 86b6ea1..36c341e 100644
@@ -62,7 +62,7 @@
 
 #undef TURN_ON_ETHERNET
 #ifdef TURN_ON_ETHERNET
-# define CONFIG_DRIVER_SMC91111 1
+# define CONFIG_SMC91111 1
 # define CONFIG_SMC91111_BASE   0x14000300
 # define CONFIG_SMC91111_EXT_PHY
 # define CONFIG_SMC_USE_32_BIT
include/netdev.h +1 -0
index 3e66586..4636b57 100644
@@ -73,6 +73,7 @@ int rtl8169_initialize(bd_t *bis);
 int scc_initialize(bd_t *bis);
 int skge_initialize(bd_t *bis);
 int smc911x_initialize(u8 dev_num, int base_addr);
+int smc91111_initialize(u8 dev_num, int base_addr);
 int tsi108_eth_initialize(bd_t *bis);
 int uec_initialize(int index);
 int uec_standard_init(bd_t *bis);
Signature · 1 line
1.5.6.3
author
#1 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

Quoted 9 lines · Ben Warren

All in-tree boards that use this controller have CONFIG_NET_MULTI added
Also:
- changed CONFIG_DRIVER_SMC91111 to CONFIG_SMC91111
- cleaned up line lengths
- modified all boards that override weak function in this driver
- modified all eeprom standalone apps to work with new driver

This patch is pretty big (~98k) and should probably be split up in its final incarnation. This is really meant as a test patch.

Since I don't have boards with this chip family, I'm unable to test for anything beyond clean compiling. I don't have a blackfin toolchain installed, but it does build cleanly on 'MAKEALL ARM9' using ELDK 4.1 for ARM.

If anybody is able to test, please do and let me know the results.

regards,
Ben

#2 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

On Mon 27 Jul 2009 17:47, Ben Warren pondered:

Quoted 13 lines
Quoted 9 lines · Ben Warren

All in-tree boards that use this controller have CONFIG_NET_MULTI added
Also:
- changed CONFIG_DRIVER_SMC91111 to CONFIG_SMC91111
- cleaned up line lengths
- modified all boards that override weak function in this driver
- modified all eeprom standalone apps to work with new driver

This patch is pretty big (~98k) and should probably be split up in its final incarnation. This is really meant as a test patch.

Quoted 6 lines

Since I don't have boards with this chip family, I'm unable to test for anything beyond clean compiling. I don't have a blackfin toolchain installed, but it does build cleanly on 'MAKEALL ARM9' using ELDK 4.1 for ARM.

If anybody is able to test, please do and let me know the results.

I have a few boards in the office - I'll try tomorrow.

author
#3 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

Hi Robin,

Quoted 22 lines · Robin Getz

On Mon 27 Jul 2009 17:47, Ben Warren pondered:

Quoted 20 lines
Quoted 10 lines · Ben Warren

All in-tree boards that use this controller have CONFIG_NET_MULTI added
Also:
- changed CONFIG_DRIVER_SMC91111 to CONFIG_SMC91111
- cleaned up line lengths
- modified all boards that override weak function in this driver
- modified all eeprom standalone apps to work with new driver

This patch is pretty big (~98k) and should probably be split up in its final incarnation. This is really meant as a test patch.

Since I don't have boards with this chip family, I'm unable to test for anything beyond clean compiling. I don't have a blackfin toolchain installed, but it does build cleanly on 'MAKEALL ARM9' using ELDK 4.1 for ARM.

Quoted 6 lines
Quoted 2 lines

If anybody is able to test, please do and let me know the results.

I have a few boards in the office - I'll try tomorrow.

Did you ever get a chance to try this out? If it works for you, I'll send out v2 addressing some style stuff.

regards,
Ben

#4 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

In reply to Ben Warren

On Mon 27 Jul 2009 17:47, Ben Warren pondered:

Quoted 9 lines
Quoted 8 lines · Ben Warren

All in-tree boards that use this controller have CONFIG_NET_MULTI added
Also:
- changed CONFIG_DRIVER_SMC91111 to CONFIG_SMC91111
- cleaned up line lengths
- modified all boards that override weak function in this driver
- modified all eeprom standalone apps to work with new driver

Quoted 7 lines
Quoted 1 line

This patch is pretty big (~98k) and should probably be split up in its final incarnation. This is really meant as a test patch.

Since I don't have boards with this chip family, I'm unable to test for anything beyond clean compiling. I don't have a blackfin toolchain installed,

There are always tarballs and rpms (source and binaries) at:
http://blackfin.uclinux.org/gf/project/toolchain/frs/?action=FrsReleaseBrowse&frs_package_id=127

Quoted 12 lines

but it does build cleanly on 'MAKEALL ARM9' using ELDK 4.1 for ARM.

If anybody is able to test, please do and let me know the results.

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

#5 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver toCONFIG_NET_MULTI API

In reply to Ben Warren

On Mon 27 Jul 2009 17:43, Ben Warren pondered:

Quoted 2 lines

All in-tree boards that use this controller have CONFIG_NET_MULTI added

First - thanks.

Second - It's a style thing, but...

Quoted 4 lines
---
 board/bf533-ezkit/bf533-ezkit.c               |   12 +
 include/netdev.h                              |    1 +
 71 files changed, 888 insertions(+), 490 deletions(-)

[snip]

Quoted 28 lines
board/bf533-ezkit/bf533-ezkit.c +12 -0
index d5f0b7c..ff0e15e 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include "psd4256.h"
 #include "flash-defines.h"
 
@@ -57,3 +58,14 @@ int misc_init_r(void)
 
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif

[snip]

include/netdev.h int rtl8169_initialize(bd_t *bis); · line 79

Quoted 12 lines
include/netdev.h +1 -0
index 3e66586..4636b57 100644
@@ -73,6 +73,7 @@ int rtl8169_initialize(bd_t *bis);
 int scc_initialize(bd_t *bis);
 int skge_initialize(bd_t *bis);
 int smc911x_initialize(u8 dev_num, int base_addr);
+int smc91111_initialize(u8 dev_num, int base_addr);
 int tsi108_eth_initialize(bd_t *bis);
 int uec_initialize(int index);
 int uec_standard_init(bd_t *bis);

would be alot less ifdefs if you put it in the header file...

#ifdef CONFIG_SMC91111
int smc91111_initialize(u8 dev_num, int base_addr); #else
#define smc91111_initialize(dev_num, base_addr) 0 #endif

that would remove all the "ifdef CONFIG_SMC91111" in all the board files...

also would not be required to set the initial value anymore either...

-Robin

author
#6 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver toCONFIG_NET_MULTI API

Hi Robin,

Quoted 71 lines · Robin Getz

On Mon 27 Jul 2009 17:43, Ben Warren pondered:

Quoted 3 lines

All in-tree boards that use this controller have CONFIG_NET_MULTI added

First - thanks.

Second - It's a style thing, but...

Quoted 5 lines
---
 board/bf533-ezkit/bf533-ezkit.c               |   12 +
 include/netdev.h                              |    1 +
 71 files changed, 888 insertions(+), 490 deletions(-)

[snip]

Quoted 29 lines
board/bf533-ezkit/bf533-ezkit.c +12 -0
index d5f0b7c..ff0e15e 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include "psd4256.h"
 #include "flash-defines.h"
 
@@ -57,3 +58,14 @@ int misc_init_r(void)
 
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif

[snip]

include/netdev.h int rtl8169_initialize(bd_t *bis); · line 79

Quoted 13 lines
include/netdev.h +1 -0
index 3e66586..4636b57 100644
@@ -73,6 +73,7 @@ int rtl8169_initialize(bd_t *bis);
 int scc_initialize(bd_t *bis);
 int skge_initialize(bd_t *bis);
 int smc911x_initialize(u8 dev_num, int base_addr);
+int smc91111_initialize(u8 dev_num, int base_addr);
 int tsi108_eth_initialize(bd_t *bis);
 int uec_initialize(int index);
 int uec_standard_init(bd_t *bis);

would be alot less ifdefs if you put it in the header file...

#ifdef CONFIG_SMC91111
int smc91111_initialize(u8 dev_num, int base_addr); #else
#define smc91111_initialize(dev_num, base_addr) 0 #endif

Quoted 6 lines

that would remove all the "ifdef CONFIG_SMC91111" in all the board files...

also would not be required to set the initial value anymore either...

-Robin

I actually like to have them in the board C code. To the casual observer, it is obvious that certain ethernet controllers are optional, whereas if all they see is a string of initialization functions for different chips they might say, "WTF?".

regards,
Ben

#7 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver toCONFIG_NET_MULTI API

On Mon 27 Jul 2009 18:17, Ben Warren pondered:

Quoted 4 lines

I actually like to have them in the board C code.? To the casual
observer, it is obvious that certain ethernet controllers are optional, whereas if all they see is a string of initialization functions for different chips they might say, "WTF?".

Like I said - it is a style thing. less ifdefs is better in my opinion. Since you need to answer more questions about things - your way is OK too...

Something like this is pretty easy to understand - and on modern compilers (anything over 3.x gcc) should compile to the same as yours (and I think is just as easy to understand for the casual reader)

       if (smc91111_initialize(0, CONFIG_SMC91111_BASE))
             return 1;

       return 0;
#8 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver toCONFIG_NET_MULTI API

In reply to Robin Getz
Quoted 67 lines · On Monday 27 July 2009 18:16:27 Robin Getz wrote:

On Mon 27 Jul 2009 17:43, Ben Warren pondered:

Quoted 2 lines

All in-tree boards that use this controller have CONFIG_NET_MULTI added

First - thanks.

Second - It's a style thing, but...

Quoted 4 lines
---
 board/bf533-ezkit/bf533-ezkit.c               |   12 +
 include/netdev.h                              |    1 +
 71 files changed, 888 insertions(+), 490 deletions(-)

[snip]

Quoted 28 lines
board/bf533-ezkit/bf533-ezkit.c +12 -0
index d5f0b7c..ff0e15e 100644
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include "psd4256.h"
 #include "flash-defines.h"
 
@@ -57,3 +58,14 @@ int misc_init_r(void)
 
 	return 0;
 }
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC91111
+	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+	return rc;
+}
+#endif

[snip]

include/netdev.h int rtl8169_initialize(bd_t *bis); · line 79

Quoted 12 lines
include/netdev.h +1 -0
index 3e66586..4636b57 100644
@@ -73,6 +73,7 @@ int rtl8169_initialize(bd_t *bis);
 int scc_initialize(bd_t *bis);
 int skge_initialize(bd_t *bis);
 int smc911x_initialize(u8 dev_num, int base_addr);
+int smc91111_initialize(u8 dev_num, int base_addr);
 int tsi108_eth_initialize(bd_t *bis);
 int uec_initialize(int index);
 int uec_standard_init(bd_t *bis);

would be alot less ifdefs if you put it in the header file...

#ifdef CONFIG_SMC91111
int smc91111_initialize(u8 dev_num, int base_addr); #else
#define smc91111_initialize(dev_num, base_addr) 0 #endif

Quoted 3 lines

that would remove all the "ifdef CONFIG_SMC91111" in all the board files...

also would not be required to set the initial value anymore either...

for at least the Blackfin boards, i would keep the style that was used with the bf548-ezkit:
#ifdef CONFIG_SMC91111
int board_eth_init(bd_t *bis)

{
	return smc91111_initialize(0, CONFIG_SMC91111_BASE);
}

#endif

for most of the boards, they wont really have anything else, but if they do, i can extend them then.
-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/20090727/0879e434/attachment.pgp

#9 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

In reply to Ben Warren
Quoted 7 lines · On Monday 27 July 2009 17:43:22 Ben Warren wrote:

All in-tree boards that use this controller have CONFIG_NET_MULTI added
Also:
- changed CONFIG_DRIVER_SMC91111 to CONFIG_SMC91111
- cleaned up line lengths
- modified all boards that override weak function in this driver
- modified all eeprom standalone apps to work with new driver

annoyingly, i dont have any of the boards with me, so my attached changes are only compile tested for Blackfin boards.

- fix enetaddr handling
- scrub dead functions
- drop stub func indirection
- fix possible memleak in initialize func
- tweak Blackin board style
-mike

board/bf533-ezkit/bf533-ezkit.c +2 -6
index ff0e15e..8727dee 100644
@@ -59,13 +59,9 @@ int misc_init_r(void)
 	return 0;
 }
 
-#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
-	int rc = 0;
-#ifdef CONFIG_SMC91111
-	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
-#endif
-	return rc;
+	return smc91111_initialize(0, CONFIG_SMC91111_BASE);
 }
 #endif
board/bf533-stamp/bf533-stamp.c +2 -6
index 32e7174..a226910 100644
@@ -285,13 +285,9 @@ void __led_toggle(led_id_t mask)
 
 #endif
 
-#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
-	int rc = 0;
-#ifdef CONFIG_SMC91111
-	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
-#endif
-	return rc;
+	return smc91111_initialize(0, CONFIG_SMC91111_BASE);
 }
 #endif
board/bf538f-ezkit/bf538f-ezkit.c +2 -6
index 1897405..15916fa 100644
@@ -27,13 +27,9 @@ phys_size_t initdram(int board_type)
 	return gd->bd->bi_memsize;
 }
 
-#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
-	int rc = 0;
-#ifdef CONFIG_SMC91111
-	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
-#endif
-	return rc;
+	return smc91111_initialize(0, CONFIG_SMC91111_BASE);
 }
 #endif
board/bf561-ezkit/bf561-ezkit.c +2 -6
index 24347e2..e5d7eb3 100644
@@ -45,13 +45,9 @@ phys_size_t initdram(int board_type)
 	return gd->bd->bi_memsize;
 }
 
-#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
-	int rc = 0;
-#ifdef CONFIG_SMC91111
-	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
-#endif
-	return rc;
+	return smc91111_initialize(0, CONFIG_SMC91111_BASE);
 }
 #endif
board/blackstamp/blackstamp.c +2 -6
index 524c86c..f55ab97 100644
@@ -46,13 +46,9 @@ void swap_to(int device_id)
 }
 #endif
 
-#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
-	int rc = 0;
-#ifdef CONFIG_SMC91111
-	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
-#endif
-	return rc;
+	return smc91111_initialize(0, CONFIG_SMC91111_BASE);
 }
 #endif
board/cm-bf533/cm-bf533.c +2 -6
index 6598e27..ab0bf3b 100644
@@ -25,13 +25,9 @@ phys_size_t initdram(int board_type)
 	return gd->bd->bi_memsize;
 }
 
-#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
-	int rc = 0;
-#ifdef CONFIG_SMC91111
-	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
-#endif
-	return rc;
+	return smc91111_initialize(0, CONFIG_SMC91111_BASE);
 }
 #endif
board/cm-bf561/cm-bf561.c +2 -6
index b204d7c..f21a015 100644
@@ -25,13 +25,9 @@ phys_size_t initdram(int board_type)
 	return gd->bd->bi_memsize;
 }
 
-#ifdef CONFIG_CMD_NET
+#ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
-	int rc = 0;
-#ifdef CONFIG_SMC91111
-	rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
-#endif
-	return rc;
+	return smc91111_initialize(0, CONFIG_SMC91111_BASE);
 }
 #endif
drivers/net/smc91111.c +34 -201

335 lines not on this page · raw message

-------------- 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/20090727/27dfcb49/attachment-0001.pgp

#10 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

In reply to Ben Warren
Quoted 5 lines · On Monday 27 July 2009 17:43:22 Ben Warren wrote:
include/configs/blackstamp.h +0 -0
index 887f3fb..6c9b3e0 100644

include/configs/blackstamp.h line 37

Quoted 9 lines
include/configs/blackstamp.h +2 -1
@@ -30,7 +30,8 @@
 /*
  * Board settings
  */
-#define CONFIG_DRIVER_SMC91111	1
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC91111	1
 #define CONFIG_SMC91111_BASE	0x20300300
 
 /* FLASH/ETHERNET uses the same address range

change to this header is incomplete. it needs this additional change:

configs/blackstamp.h +2 -2
@@ -70,7 +70,7 @@
  * Network settings
  */
 
-#ifdef CONFIG_DRIVER_SMC91111
+#ifdef CONFIG_SMC91111
 #define CONFIG_IPADDR		192.168.0.15
 #define CONFIG_NETMASK		255.255.255.0
 #define CONFIG_GATEWAYIP	192.168.0.1
@@ -109,7 +109,7 @@
 
 #include <config_cmd_default.h>
 
-#ifdef CONFIG_DRIVER_SMC91111
+#ifdef CONFIG_SMC91111
 # define CONFIG_CMD_DHCP
 # define CONFIG_CMD_PING
 #else

-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/20090902/d65e28bd/attachment.pgp

#11 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

In reply to Ben Warren

the attached patch incorporates my changes and has been tested on actual hardware with 2009.08
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Convert-SMC91111-Ethernet-driver-to-CONFIG_NET_MULTI.patch
Type: text/x-patch
Size: 103717 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090911/8d98b7c7/attachment-0001.bin
-------------- 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/20090911/8d98b7c7/attachment-0001.pgp

author
#12 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

Quoted 3 lines · Mike Frysinger

the attached patch incorporates my changes and has been tested on actual hardware with 2009.08
-mike

Thanks a lot. I'm applying it to the net tree.

regards,
Ben

#13 lore raw

PATCH 1/1 smc91111_eeprom: get working with net multi conversion

This should be squashed into the pending:
Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

The changes to the eeprom were incomplete, and the new version needs slightly different handling on the BF533 boards that share flash.

---
 examples/standalone/smc91111_eeprom.c |    4 +++-
 include/configs/bf533-ezkit.h         |    5 +++--
 include/configs/bf533-stamp.h         |    5 +++--
 3 files changed, 9 insertions(+), 5 deletions(-)
examples/standalone/smc91111_eeprom.c +3 -1
index a38cc4d..89afc87 100644
@@ -29,9 +29,11 @@
 
 #include <common.h>
 #include <exports.h>
+/* the smc91111.h gets base addr through eth_device' iobase */
+struct eth_device { unsigned long iobase; };
 #include "../drivers/net/smc91111.h"
 
-#ifdef CONFIG_DRIVER_SMC91111
+#ifdef CONFIG_SMC91111
 
 #ifndef SMC91111_EEPROM_INIT
 # define SMC91111_EEPROM_INIT()
include/configs/bf533-ezkit.h +3 -2
index 8f23f1d..cee33f2 100644
@@ -70,8 +70,9 @@
 #define CONFIG_SMC91111_BASE	0x20310300
 #define SMC91111_EEPROM_INIT() \
 	do { \
-		*pFIO_DIR |= PF1; \
-		*pFIO_FLAG_S = PF1; \
+		bfin_write_FIO_DIR(bfin_read_FIO_DIR() | PF1 | PF0); \
+		bfin_write_FIO_FLAG_C(PF1); \
+		bfin_write_FIO_FLAG_S(PF0); \
 		SSYNC(); \
 	} while (0)
 #define CONFIG_HOSTNAME		bf533-ezkit
include/configs/bf533-stamp.h +3 -2
index 56fec53..573d4e5 100644
@@ -65,8 +65,9 @@
 #define CONFIG_SMC91111_BASE	0x20300300
 #define SMC91111_EEPROM_INIT() \
 	do { \
-		*pFIO_DIR |= PF1; \
-		*pFIO_FLAG_S = PF1; \
+		bfin_write_FIO_DIR(bfin_read_FIO_DIR() | PF1 | PF0); \
+		bfin_write_FIO_FLAG_C(PF1); \
+		bfin_write_FIO_FLAG_S(PF0); \
 		SSYNC(); \
 	} while (0)
 #define CONFIG_HOSTNAME		bf533-stamp
Signature · 1 line
1.6.5.rc1
#14 lore raw

PATCH 1/1 smc91111_eeprom: get working with net multi conversion

Dear Mike Frysinger,

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

This should be squashed into the pending:
Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

The changes to the eeprom were incomplete, and the new version needs slightly different handling on the BF533 boards that share flash.

Then better send a v2 patch which includes this stuff.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You can love it, change it, or leave it.    There is NO other option.
But do not complain - it is your own choice...                  -- wd
author
#15 lore raw

PATCH 1/1 smc91111_eeprom: get working with net multi conversion

Quoted 7 lines · Wolfgang Denk

Dear Mike Frysinger,

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

This should be squashed into the pending:
Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

Quoted 9 lines
Quoted 5 lines

The changes to the eeprom were incomplete, and the new version needs slightly different handling on the BF533 boards that share flash.

Then better send a v2 patch which includes this stuff.

I think he was commenting that my SMC91111 patch was incomplete and this fixes it, but may be wrong (it happens from time to time :).

regards,
Ben

#16 lore raw

PATCH 1/1 smc91111_eeprom: get working with net multi conversion

Quoted 8 lines · On Tuesday 22 September 2009 16:49:06 Ben Warren wrote:
Quoted 7 lines · Wolfgang Denk
Quoted 6 lines · Mike Frysinger

This should be squashed into the pending:
Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

The changes to the eeprom were incomplete, and the new version needs slightly different handling on the BF533 boards that share flash.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Then better send a v2 patch which includes this stuff.

I think he was commenting that my SMC91111 patch was incomplete and this fixes it, but may be wrong (it happens from time to time :).

yes, the original patch is Ben's and in Ben's tree, not mine
-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/20090922/da9639bc/attachment.pgp

author
#17 lore raw

PATCH 1/1 smc91111_eeprom: get working with net multi conversion

In reply to Mike Frysinger

Hi Mike,

Quoted 7 lines · Mike Frysinger

This should be squashed into the pending:
Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

The changes to the eeprom were incomplete, and the new version needs slightly different handling on the BF533 boards that share flash.

I squashed it into the other patch as you suggested. thanks again for helping out with this.

regards,
Ben

#18 lore raw

PATCH 1/1 Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API

In reply to Mike Frysinger

Dear Mike Frysinger,

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

--===============0077506097==
Content-Type: multipart/signed;
boundary="nextPart2279044.usXPOpWbKs";
protocol="application/pgp-signature";
micalg=pgp-sha1
Content-Transfer-Encoding: 7bit

--nextPart2279044.usXPOpWbKs
Content-Type: multipart/mixed;
boundary="Boundary-01=_rEiqKxzcR2Mk9j/"
Content-Transfer-Encoding: 7bit

Quoted 5 lines

--Boundary-01=_rEiqKxzcR2Mk9j/
Content-Type: Text/Plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Please do not do that. Patches are supposed to be submitten inline.

Except for that:

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"We don't care.  We don't have to.  We're the Phone Company."