void tx28_get_ethaddr(void) { u32 buf[2]; /* to make use of cpu_to_be32 */ u32 ethaddr[2]; int ret; ret = mxs_ocotp_read(buf, 8, 0); if (ret != 8) return; ethaddr[0] = cpu_to_be32(buf[0]); ethaddr[1] = cpu_to_be32(buf[1]); eth_register_ethaddr(0, (char *)ethaddr); }
/* fec */ static void mx28_evk_get_ethaddr(void) { u8 mac_ocotp[3], mac[6]; int ret; ret = mxs_ocotp_read(mac_ocotp, 3, 0); if (ret != 3) { pr_err("Reading MAC from OCOTP failed!\n"); return; } mac[0] = 0x00; mac[1] = 0x04; mac[2] = 0x9f; mac[3] = mac_ocotp[2]; mac[4] = mac_ocotp[1]; mac[5] = mac_ocotp[0]; eth_register_ethaddr(0, mac); }