aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf527/boards/ezkit.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/mach-bf527/boards/ezkit.c')
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c17
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)
936 bfin_gpio_reset_spi0_ssel1(); 936 bfin_gpio_reset_spi0_ssel1();
937} 937}
938 938
939/*
940 * Currently the MAC address is saved in Flash by U-Boot
941 */
942#define FLASH_MAC 0x203f0000
943void bfin_get_ether_addr(char *addr) 939void bfin_get_ether_addr(char *addr)
944{ 940{
945 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC); 941 /* the MAC is stored in OTP memory page 0xDF */
946 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4); 942 u32 ret;
943 u64 otp_mac;
944 u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A;
945
946 ret = otp_read(0xDF, 0x00, &otp_mac);
947 if (!(ret & 0x1)) {
948 char *otp_mac_p = (char *)&otp_mac;
949 for (ret = 0; ret < 6; ++ret)
950 addr[ret] = otp_mac_p[5 - ret];
951 }
947} 952}
948EXPORT_SYMBOL(bfin_get_ether_addr); 953EXPORT_SYMBOL(bfin_get_ether_addr);