diff options
| -rw-r--r-- | arch/mips/txx9/rbtx4939/setup.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c index 6daee9b1cd5e..98fbd9391bf8 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) | |||
| 308 | #if defined(CONFIG_TC35815) || defined(CONFIG_TC35815_MODULE) | 308 | #if defined(CONFIG_TC35815) || defined(CONFIG_TC35815_MODULE) |
| 309 | int i, j; | 309 | int i, j; |
| 310 | unsigned char ethaddr[2][6]; | 310 | unsigned char ethaddr[2][6]; |
| 311 | u8 bdipsw = readb(rbtx4939_bdipsw_addr) & 0x0f; | ||
| 312 | |||
| 311 | for (i = 0; i < 2; i++) { | 313 | for (i = 0; i < 2; i++) { |
| 312 | unsigned long area = CKSEG1 + 0x1fff0000 + (i * 0x10); | 314 | unsigned long area = CKSEG1 + 0x1fff0000 + (i * 0x10); |
| 313 | if (readb(rbtx4939_bdipsw_addr) & 8) { | 315 | if (bdipsw == 0) |
| 316 | memcpy(ethaddr[i], (void *)area, 6); | ||
| 317 | else { | ||
| 314 | u16 buf[3]; | 318 | u16 buf[3]; |
| 315 | area -= 0x03000000; | 319 | if (bdipsw & 8) |
| 320 | area -= 0x03000000; | ||
| 321 | else | ||
| 322 | area -= 0x01000000; | ||
| 316 | for (j = 0; j < 3; j++) | 323 | for (j = 0; j < 3; j++) |
| 317 | buf[j] = le16_to_cpup((u16 *)(area + j * 2)); | 324 | buf[j] = le16_to_cpup((u16 *)(area + j * 2)); |
| 318 | memcpy(ethaddr[i], buf, 6); | 325 | memcpy(ethaddr[i], buf, 6); |
| 319 | } else | 326 | } |
| 320 | memcpy(ethaddr[i], (void *)area, 6); | ||
| 321 | } | 327 | } |
| 322 | tx4939_ethaddr_init(ethaddr[0], ethaddr[1]); | 328 | tx4939_ethaddr_init(ethaddr[0], ethaddr[1]); |
| 323 | #endif | 329 | #endif |
