[U-Boot] [PATCH 1/3] common: Fix-up MAC addr in dts by fetching env variable serially

York Sun york.sun at nxp.com
Tue Nov 21 17:21:39 UTC 2017


On 11/21/2017 08:26 AM, Prabhakar Kushwaha wrote:
> Current implementation of MAC address fix-up of device tree uses
> tailing number behind "ethernet" found in "/aliases".  It is not
> necessary for trailing number of “ethernet” to be sequential. There
> can be hole in between or any node disabled.
> 
> So provide support device tree fix-up of “ethernent” node with MAC
> addresses fetched sequentially from environment variables.

My understanding is current implementation matches the trailing number
behind "ethernet" found in "/aliases" with environmental variables
ethNaddr (where N is 1, 2, 3, ... or absent). This doesn't require
"ethernet" nodes or ethNaddr variables to be consecutive.

>From your change, I understand you are trying to apply consecutive
ethNaddr variables to "ethernet" nodes in the order they appear in
device tree.

You didn't explain what benefit you get from this new scheme, or what
problem you are trying to solve.

My understanding is you have device tree with some "ethernet" nodes
disabled (or with gap in the numbering). You also have a pool of MAC
addresses in the form of consecutive ethNaddr variables. You goal is to
assign these ethNaddr to "ethernet" nodes in the order they appear in
the device tree. Do I understand you correctly?

Is it possible to address this issue from another angle? How about
setting ethNaddr variables in U-Boot according to the SerDes protocol?
You may have explored this path already. Let me know why this doesn't work.

> 
> Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com>
> ---
>  README               | 10 ++++++++++
>  common/fdt_support.c | 25 +++++++++++++++++++++----
>  2 files changed, 31 insertions(+), 4 deletions(-)
> 
> diff --git a/README b/README
> index 7a4f342..640b310 100644
> --- a/README
> +++ b/README
> @@ -1603,6 +1603,16 @@ The following options need to be configured:
>  
>  		See doc/README.link-local for more information.
>  
> + - MAC address from environment variables
> +
> +		FDT_SEQ_MACADDR_FROM_ENV

Why not create a Kconfig option?

York


More information about the U-Boot mailing list