summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2008-09-11 00:44:04 +0900
committerRalf Baechle <ralf@linux-mips.org>2008-10-30 14:44:33 +0000
commit9cc4581528233e2a4eb8720621c1e2f613d7c38a (patch)
tree175780ec90a8a6d5bf4b488f593a9911170683d0 /arch/mips
parente946217e4fdaa67681bbabfa8e6b18641921f750 (diff)
downloadlinux-3.10-9cc4581528233e2a4eb8720621c1e2f613d7c38a.tar.gz
linux-3.10-9cc4581528233e2a4eb8720621c1e2f613d7c38a.tar.bz2
linux-3.10-9cc4581528233e2a4eb8720621c1e2f613d7c38a.zip
MIPS: TXx9: Fix RBTX4939 ethernet address initialization
Fix location of ethernet adddress when booted from external ROM. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/txx9/rbtx4939/setup.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
index 6daee9b1cd5..98fbd9391bf 100644
--- a/arch/mips/txx9/rbtx4939/setup.c
+++ b/arch/mips/txx9/rbtx4939/setup.c
@@ -308,16 +308,22 @@ static void __init rbtx4939_device_init(void)
#if defined(CONFIG_TC35815) || defined(CONFIG_TC35815_MODULE)
int i, j;
unsigned char ethaddr[2][6];
+ u8 bdipsw = readb(rbtx4939_bdipsw_addr) & 0x0f;
+
for (i = 0; i < 2; i++) {
unsigned long area = CKSEG1 + 0x1fff0000 + (i * 0x10);
- if (readb(rbtx4939_bdipsw_addr) & 8) {
+ if (bdipsw == 0)
+ memcpy(ethaddr[i], (void *)area, 6);
+ else {
u16 buf[3];
- area -= 0x03000000;
+ if (bdipsw & 8)
+ area -= 0x03000000;
+ else
+ area -= 0x01000000;
for (j = 0; j < 3; j++)
buf[j] = le16_to_cpup((u16 *)(area + j * 2));
memcpy(ethaddr[i], buf, 6);
- } else
- memcpy(ethaddr[i], (void *)area, 6);
+ }
}
tx4939_ethaddr_init(ethaddr[0], ethaddr[1]);
#endif