diff options
author | Magnus Damm <damm@opensource.se> | 2009-10-27 06:47:34 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-27 20:18:24 -0400 |
commit | 8013cc9a5d2f6dcb79ffdcf707cf90ba120edfec (patch) | |
tree | bcdfe11905b811a77df5d60c635d7c04f9e91b71 /arch/sh/boards | |
parent | 9b3b21f788a9d7ff999544bf9b7ba950f68a9357 (diff) |
sh: mac address through private data for sh_eth on ms7724se
Convert the ms7724se board code to pass the mac
address to the sh_eth driver using platform data.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/mach-se/7724/setup.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index ce6b36ebe64d..4488b3e774df 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -507,7 +507,7 @@ static int __init sh_eth_is_eeprom_ready(void) | |||
507 | static void __init sh_eth_init(void) | 507 | static void __init sh_eth_init(void) |
508 | { | 508 | { |
509 | int i; | 509 | int i; |
510 | u16 mac[3]; | 510 | u16 mac; |
511 | 511 | ||
512 | /* check EEPROM status */ | 512 | /* check EEPROM status */ |
513 | if (!sh_eth_is_eeprom_ready()) | 513 | if (!sh_eth_is_eeprom_ready()) |
@@ -521,16 +521,10 @@ static void __init sh_eth_init(void) | |||
521 | if (!sh_eth_is_eeprom_ready()) | 521 | if (!sh_eth_is_eeprom_ready()) |
522 | return; | 522 | return; |
523 | 523 | ||
524 | mac[i] = ctrl_inw(EEPROM_DATA); | 524 | mac = ctrl_inw(EEPROM_DATA); |
525 | mac[i] = ((mac[i] & 0xFF) << 8) | (mac[i] >> 8); /* swap */ | 525 | sh_eth_plat.mac_addr[i << 1] = mac & 0xff; |
526 | sh_eth_plat.mac_addr[(i << 1) + 1] = mac >> 8; | ||
526 | } | 527 | } |
527 | |||
528 | /* reset sh-eth */ | ||
529 | ctrl_outl(0x1, SH_ETH_ADDR + 0x0); | ||
530 | |||
531 | /* set MAC addr */ | ||
532 | ctrl_outl(((mac[0] << 16) | (mac[1])), SH_ETH_MAHR); | ||
533 | ctrl_outl((mac[2]), SH_ETH_MALR); | ||
534 | } | 528 | } |
535 | 529 | ||
536 | #define SW4140 0xBA201000 | 530 | #define SW4140 0xBA201000 |