Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86542
b: refs/heads/master
c: 181afa9
h: refs/heads/master
v: v3
  • Loading branch information
Mike Frysinger authored and Bryan Wu committed Feb 25, 2008
1 parent 9c5105d commit 06a4ace
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 549aaa8425b4a1de23cbddc650dac75b91204af6
refs/heads/master: 181afa94989f431e93eccd784c14c37ccb395a00
17 changes: 11 additions & 6 deletions trunk/arch/blackfin/mach-bf527/boards/ezkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 06a4ace

Please sign in to comment.