|
发表于 2016-9-8 10:38:04
|
显示全部楼层
vim board/freescale/mx28_evk/mx28_evk.c
int fec_get_mac_addr(unsigned char *mac)
{
u32 val;
/*set this bit to open the OTP banks for reading*/
REG_WR(REGS_OCOTP_BASE, HW_OCOTP_CTRL_SET,
BM_OCOTP_CTRL_RD_BANK_OPEN);
/*wait until OTP contents are readable*/
while (BM_OCOTP_CTRL_BUSY & REG_RD(REGS_OCOTP_BASE, HW_OCOTP_CTRL))
udelay(100);
mac[0] = 0x00;
mac[1] = 0x04;
val = REG_RD(REGS_OCOTP_BASE, HW_OCOTP_CUSTn(0));
mac[2] = (val >> 24) & 0xFF;
mac[3] = (val >> 16) & 0xFF;
mac[4] = (val >> 8) & 0xFF;
mac[5] = (val >> 0) & 0xFF;
return 0;
}
从这个函数可以看出来默认的前个字节是0x00,0x04 |
|