]> Git Repo - u-boot.git/commit - common/fdt_support.c
fdt: Rewrite the logic in fdt_fixup_ethernet()
authorBin Meng <[email protected]>
Tue, 3 Nov 2015 12:24:41 +0000 (04:24 -0800)
committerJoe Hershberger <[email protected]>
Tue, 22 Dec 2015 01:56:17 +0000 (19:56 -0600)
commitbc393a7954f741aeeb6da5a3161fe0961fa10be5
tree411a09882364fcb4b7489ff8eaad554baafda61e
parent52d825cc7b9d50f286cdbd026733bb15e81d3c66
fdt: Rewrite the logic in fdt_fixup_ethernet()

Currently in fdt_fixup_ethernet() the MAC address fix up is
handled in a loop of which the exit condition is to test the
"eth%daddr" env is not NULL. However this creates unnecessary
constrains that those "eth%daddr" env variables must be
sequential even if "ethernet%d" does not start from 0 in the
"/aliases" node. For example, with "/aliases" node below:

    aliases {
        ethernet3 = &enet3;
        ethernet4 = &enet4;
    };

"ethaddr", "eth1addr", "eth2addr" must exist in order to fix
up ethernet3's MAC address successfully.

Now we change the loop logic to iterate the properties in the
"/aliases" node. For each property, test if it is in a format
of "ethernet%d", then get its MAC address from corresponding
"eth%daddr" env and fix it up in the dtb.

Signed-off-by: Bin Meng <[email protected]>
Acked-by: Joe Hershberger <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
On OMAP4 Panda (+v4.3 kernel)
Tested-by: Tom Rini <[email protected]>
common/fdt_support.c
This page took 0.027938 seconds and 4 git commands to generate.