#include <asm/arch/sm.h>
#define EFUSE_MAC_OFFSET 0
-#define EFUSE_MAC_SIZE 6
+#define EFUSE_MAC_SIZE 12
#define MAC_ADDR_LEN 6
int mmc_get_env_dev(void)
int misc_init_r(void)
{
u8 mac_addr[MAC_ADDR_LEN];
- char efuse_mac_addr[EFUSE_MAC_SIZE];
+ char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3];
ssize_t len;
meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
if (len != EFUSE_MAC_SIZE)
return 0;
- for (int i = 0; i < 6; i++)
- mac_addr[i] = efuse_mac_addr[i];
+ /* MAC is stored in ASCII format, 1bytes = 2characters */
+ for (int i = 0; i < 6; i++) {
+ tmp[0] = efuse_mac_addr[i * 2];
+ tmp[1] = efuse_mac_addr[i * 2 + 1];
+ tmp[2] = '\0';
+ mac_addr[i] = simple_strtoul(tmp, NULL, 16);
+ }
if (is_valid_ethaddr(mac_addr))
eth_env_set_enetaddr("ethaddr", mac_addr);