Skip to contentSkip to conversation

Ethernet Support for eNET Board

RFC PATCH New Graeme Russ 2 participants 2 messages Aug 29, 2009 – Sep 4, 2009 Network drivers

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Ethernet Support for eNET Board

OK, after much wailing and gnashing of teeth, I have FINALLY got the Ethernet chips on my eNET board working. In the end, the critical mod was in drivers/net/rtl8139.c, line 217 where I needed to change PCI_BASE_ADDRESS_1 to PCI_BASE_ADDRESS_0 - The big question for me now is Why? I assume this driver is working for everyone else, and this change will probably break the driver for everyone else, so now I need to know what I can do so that Ethernet works on my board WITHOUT modifying rtl8139.c

I also had to move SC520_PCI_IO_PHYS from 0x1000 to 0x2000 because I have LEDs, Hex Switches and a couple of other board specific I/O at 0x1000

Anyone got any ideas?

board/eNET/eNET.c +9 -0
index 29cf295..9359ea6 100644
@@ -24,6 +24,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/ic/sc520.h>
+#include <net.h>
+#include <netdev.h>
 
 #ifdef CONFIG_HW_WATCHDOG
 #include <watchdog.h>
@@ -165,3 +167,10 @@ ulong board_flash_get_legacy (ulong base, int banknum, flash_info_t * info)
 	} else
 		return 0;
 }
+
+int board_eth_init(bd_t *bis)
+{
+	printf("Initializing Ethernet\n");
+	return pci_eth_init(bis);
+}
+
drivers/net/rtl8139.c +1 -1
index db8a727..a3df564 100644
@@ -214,7 +214,7 @@ int rtl8139_initialize(bd_t *bis)
 		if ((devno = pci_find_devices(supported, idx++)) < 0)
 			break;
 
-		pci_read_config_dword(devno, PCI_BASE_ADDRESS_1, &iobase);
+		pci_read_config_dword(devno, PCI_BASE_ADDRESS_0, &iobase);
 		iobase &= ~0xf;
 
 		debug ("rtl8139: REALTEK RTL8139 @0x%x\n", iobase);
include/asm-i386/ic/sc520.h +3 -3
index 57c9904..6e2375c 100644
@@ -306,14 +306,14 @@ extern volatile sc520_mmcr_t *sc520_mmcr;
 
 /* PCI I/O space from 0x1000 to 0xdfff
  * (make 0xe000-0xfdff available for stuff like PCCard boot) */
-#define SC520_PCI_IO_PHYS	0x00001000
-#define SC520_PCI_IO_BUS	0x00001000
+#define SC520_PCI_IO_PHYS	0x00002000
+#define SC520_PCI_IO_BUS	0x00002000
 #define SC520_PCI_IO_SIZE	0x0000d000
 
 /* system memory from 0x00000000 to 0x0fffffff */
 #define	SC520_PCI_MEMORY_PHYS	0x00000000
 #define	SC520_PCI_MEMORY_BUS	0x00000000
-#define SC520_PCI_MEMORY_SIZE	0x10000000
+#define SC520_PCI_MEMORY_SIZE	0x08000000
 
 /* PCI bus memory from 0x10000000 to 0x26ffffff
  * (make 0x27000000 - 0x27ffffff available for stuff like PCCard boot) */
include/configs/eNET.h +8 -1
index c4c38de..df0d586 100644
@@ -86,9 +86,10 @@
 #define CONFIG_CMD_LOADS	/* loads			*/
 #define CONFIG_CMD_MEMORY	/* md mm nm mw cp cmp crc base loop mtest */
 #define CONFIG_CMD_MISC		/* Misc functions like sleep etc*/
-#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#define CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 #undef CONFIG_CMD_NFS		/* NFS support			*/
 #define CONFIG_CMD_PCI		/* PCI support			*/
+#define CONFIG_CMD_PING		/* ICMP echo support		*/
 #define CONFIG_CMD_RUN		/* run command in env variable	*/
 #define CONFIG_CMD_SAVEENV	/* saveenv			*/
 #define CONFIG_CMD_SETGETDCR	/* DCR support on 4xx		*/
@@ -208,6 +209,12 @@
 #define CONFIG_SYS_THIRD_PCI_IRQ   11
 #define CONFIG_SYS_FORTH_PCI_IRQ   15
 
+ /*
+ * Network device (TRL8100B) support
+ */
+#define CONFIG_NET_MULTI
+#define CONFIG_RTL8139
+
 /*-----------------------------------------------------------------------
  * Hardware watchdog configuration
  */
#1 lore raw

RFC PATCH 1/1 Ethernet Support for eNET Board

Dear Graeme Russ,

board/eNET/eNET.c

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

OK, after much wailing and gnashing of teeth, I have FINALLY got the Ethernet chips on my eNET board working. In the end, the critical mod was in drivers/net/rtl8139.c, line 217 where I needed to change PCI_BASE_ADDRESS_1 to PCI_BASE_ADDRESS_0 - The big question for me now is Why? I assume this driver is working for everyone else, and this change will probably break the driver for everyone else, so now I need to know what I can do so that Ethernet works on my board WITHOUT modifying rtl8139.c

I also had to move SC520_PCI_IO_PHYS from 0x1000 to 0x2000 because I have LEDs, Hex Switches and a couple of other board specific I/O at 0x1000

Anyone got any ideas?

board/eNET/eNET.c +0 -0

I understand this is not to apply yet? Signed-off-by: etc are missing...

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
In an organization, each person rises to the level of his own  incom-
petency                                         - The Peter Principle