board: samsung: e850-96: Set ethaddr
authorSam Protsenko <semen.protsenko@linaro.org>
Wed, 6 Aug 2025 22:27:02 +0000 (17:27 -0500)
committerMinkyu Kang <mk7.kang@samsung.com>
Mon, 1 Sep 2025 07:37:12 +0000 (16:37 +0900)
commitcb64735bdd487ebc6f8eff790bd966152e9e466b
treed13440f99b1c4e84ce4af660edaa044dfd669da9
parent3b36c242eb338f19c4436f5deba66a65ee85071d
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>
board/samsung/e850-96/e850-96.c