diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-02-25 04:42:17 +0100 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-02-25 04:42:17 +0100 |
commit | 181afa94989f431e93eccd784c14c37ccb395a00 (patch) | |
tree | 490f25b823d6e607c8275c0fb7d66a6c2aaa4b78 /arch/blackfin | |
parent | [Blackfin] arch: Fix bug - Setting peripheral_map only when dma channel is UA... (diff) | |
download | linux-181afa94989f431e93eccd784c14c37ccb395a00.tar.xz linux-181afa94989f431e93eccd784c14c37ccb395a00.zip |
[Blackfin] arch: grab mac address from OTP on BF527-EZKIT
The bf527-ezkit stores the mac address in OTP,
so grab it from there rather than flash
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/mach-bf527/boards/ezkit.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c index 770056b0e68b..ab7a21faaa71 100644 --- a/arch/blackfin/mach-bf527/boards/ezkit.c +++ b/arch/blackfin/mach-bf527/boards/ezkit.c @@ -936,13 +936,18 @@ void native_machine_restart(char *cmd) bfin_gpio_reset_spi0_ssel1(); } -/* - * Currently the MAC address is saved in Flash by U-Boot - */ -#define FLASH_MAC 0x203f0000 void bfin_get_ether_addr(char *addr) { - *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC); - *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4); + /* the MAC is stored in OTP memory page 0xDF */ + u32 ret; + u64 otp_mac; + u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A; + + ret = otp_read(0xDF, 0x00, &otp_mac); + if (!(ret & 0x1)) { + char *otp_mac_p = (char *)&otp_mac; + for (ret = 0; ret < 6; ++ret) + addr[ret] = otp_mac_p[5 - ret]; + } } EXPORT_SYMBOL(bfin_get_ether_addr); |