board: samsung: e850-96: Set ethaddr
Set the environment variable for Ethernet MAC address (ethaddr). Use the
SoC ID to make sure it's unique. It'll be formatted in a way that
follows the consecutive style of the serial number ("serial#" variable),
i.e.:
OTP_CHIPID0 = 0xf51c8113
OTP_CHIPID1 = 0x236
get_chip_id() = 0x236f51c8113
serial# =
00000236f51c8113
ethaddr = 02:36:f5:1c:81:13
where corresponding bytes of the MAC address are:
mac_addr[0] = 0x02 // OTP_CHIPID1[15:8]
mac_addr[1] = 0x36 // OTP_CHIPID1[7:0]
mac_addr[2] = 0xf5 // OTP_CHIPID0[31:24]
mac_addr[3] = 0x1c // OTP_CHIPID0[23:16]
mac_addr[4] = 0x81 // OTP_CHIPID0[15:8]
mac_addr[5] = 0x13 // OTP_CHIPID0[7:0]
because OTP_CHIPID1 has only 16 significant bits (with actual ID
values), and all 32 bits of OTP_CHIPID0 are significant.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>