public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC][PATCH] Ethernet Support for eNET Board
Date: Sat, 29 Aug 2009 21:03:03 +1000	[thread overview]
Message-ID: <4A990AE7.2080908@gmail.com> (raw)

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?


diff --git a/board/eNET/eNET.c b/board/eNET/eNET.c
index 29cf295..9359ea6 100644
--- a/board/eNET/eNET.c
+++ b/board/eNET/eNET.c
@@ -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);
+}
+
diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c
index db8a727..a3df564 100644
--- a/drivers/net/rtl8139.c
+++ b/drivers/net/rtl8139.c
@@ -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);
diff --git a/include/asm-i386/ic/sc520.h b/include/asm-i386/ic/sc520.h
index 57c9904..6e2375c 100644
--- a/include/asm-i386/ic/sc520.h
+++ b/include/asm-i386/ic/sc520.h
@@ -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) */
diff --git a/include/configs/eNET.h b/include/configs/eNET.h
index c4c38de..df0d586 100644
--- a/include/configs/eNET.h
+++ b/include/configs/eNET.h
@@ -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
  */

             reply	other threads:[~2009-08-29 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-29 11:03 Graeme Russ [this message]
2009-09-04 20:00 ` [U-Boot] [RFC][PATCH] Ethernet Support for eNET Board Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A990AE7.2080908@gmail.com \
    --to=graeme.russ@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox