All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] TXx9: Fix RBTX4939 ethernet address initialization
@ 2008-09-10 15:44 Atsushi Nemoto
  2008-10-27 17:18 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2008-09-10 15:44 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

Fix location of ethernet adddress when booted from external ROM.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
This is a patch for linux-queue tree.  This patch can be folded into
the patch titled "TXx9: Add RBTX4939 board support".

 arch/mips/txx9/rbtx4939/setup.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
index 277864d..df324f8 100644
--- a/arch/mips/txx9/rbtx4939/setup.c
+++ b/arch/mips/txx9/rbtx4939/setup.c
@@ -249,16 +249,21 @@ 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
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] TXx9: Fix RBTX4939 ethernet address initialization
  2008-09-10 15:44 [PATCH] TXx9: Fix RBTX4939 ethernet address initialization Atsushi Nemoto
@ 2008-10-27 17:18 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2008-10-27 17:18 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: linux-mips

On Thu, Sep 11, 2008 at 12:44:04AM +0900, Atsushi Nemoto wrote:

> Fix location of ethernet adddress when booted from external ROM.

Thanks, applied.

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-27 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-10 15:44 [PATCH] TXx9: Fix RBTX4939 ethernet address initialization Atsushi Nemoto
2008-10-27 17:18 ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.