diff options
author | Klaus Goger <klaus.goger@theobroma-systems.com> | 2019-08-19 16:56:15 +0200 |
---|---|---|
committer | Klaus Goger <klaus.goger@theobroma-systems.com> | 2019-08-19 16:56:15 +0200 |
commit | fd5e387f5017093f9073e92433ea7c2926068e0f (patch) | |
tree | ed782e08c0c48140a4c0e4bc8198456fa7bf78b9 | |
parent | 7d993fcc86d44e9023c698f0b74a48ace042eeec (diff) |
ARM: sunxi: pangolin: fix mac and serial generationHEADv2015.07-pangolin
a wrong shift in the emmc cid resulted in duplicated
mac addresses. use the correct emmc product serialnumber bits instead
of the manufacturing date
-rw-r--r-- | board/sunxi/board.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 449d09beea..05a89bcabe 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -631,16 +631,16 @@ int misc_init_r(void) /* Non OUI / registered MAC address */ mac_addr[0] = 0x02; mac_addr[1] = (mmc0->cid[0] >> 24) & 0xff; - mac_addr[2] = (mmc0->cid[2] >> 0) & 0xff; - mac_addr[3] = (mmc0->cid[3] >> 24) & 0xff; - mac_addr[4] = (mmc0->cid[3] >> 16) & 0xff; - mac_addr[5] = (mmc0->cid[3] >> 8) & 0xff; + mac_addr[2] = (mmc0->cid[2] >> 8) & 0xff; + mac_addr[3] = (mmc0->cid[2] >> 0) & 0xff; + mac_addr[4] = (mmc0->cid[3] >> 24) & 0xff; + mac_addr[5] = (mmc0->cid[3] >> 16) & 0xff; eth_setenv_enetaddr("ethaddr", mac_addr); } - snprintf(serial_string, sizeof(serial_string), "%08x%02x%06x", - mmc0->cid[0]>>24,mmc0->cid[2]&0xff,mmc0->cid[3]>>8); + snprintf(serial_string, sizeof(serial_string), "%08x%04x%04x", + mmc0->cid[0]>>24,mmc0->cid[2]&0xffff,mmc0->cid[3]>>16); setenv("serial#", serial_string); #else unsigned int sid[4]; |