diff options
author | Hans de Goede <hdegoede@redhat.com> | 2016-07-27 17:58:06 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2016-07-31 21:45:34 +0200 |
commit | 97322c3e074d49b1e2c6d98c7e69e5da3093636f (patch) | |
tree | 1a2e1c8c2a33723df510175405ef8bce3712fc88 /board/sunxi | |
parent | 3e5e274aed347cfcbf7cb7772fcd51d513f59402 (diff) | |
download | u-boot-97322c3e074d49b1e2c6d98c7e69e5da3093636f.tar.gz |
sunxi: Ensure that the NIC specific bytes of the mac are not all 0
On 2 of my H3 boards bytes 13-15 of the SID are all 0 leading to
the NIC specific bytes of the mac all being 0, which leads to the
boards not getting an ipv6 address from the dhcp server.
This commits adds a check to ensure this does not happen.
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Corentin LABBE <clabbe.montjoie@gmail.com>
Cc: Amit Singh Tomar <amittomer25@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'board/sunxi')
-rw-r--r-- | board/sunxi/board.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 36cf96381c..ef3fe26d69 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -623,6 +623,10 @@ static void setup_environment(const void *fdt) ret = sunxi_get_sid(sid); if (ret == 0 && sid[0] != 0 && sid[3] != 0) { + /* Ensure the NIC specific bytes of the mac are not all 0 */ + if ((sid[3] & 0xffffff) == 0) + sid[3] |= 0x800000; + for (i = 0; i < 4; i++) { sprintf(ethaddr, "ethernet%d", i); if (!fdt_get_alias(fdt, ethaddr)) |