[U-Boot] [RFC PATCH 2/3] net: fec_mxc: query mac address from environment

Joe Hershberger joe.hershberger at gmail.com
Wed Jun 3 16:05:23 CEST 2015


Hi Damien,

On Tue, Jun 2, 2015 at 3:22 PM, Damien Riegel
<damien.riegel at savoirfairelinux.com> wrote:
> The TS-4800 doesn't have its MAC address fused, therefore the
> fec_mxc driver can not currently fetch it.
>
> This commit adds the capability to fetch the MAC address from
> environment if not found in fuses.
>
> Signed-off-by: Damien Riegel <damien.riegel at savoirfairelinux.com>
> Cc: Stefano Babic <sbabic at denx.de>
> Cc: Joe Hershberger <joe.hershberger at ni.com>
> ---
>  drivers/net/fec_mxc.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 9225d37..a789ecc 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -1040,6 +1040,10 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
>                 if (!getenv("ethaddr"))
>                         eth_setenv_enetaddr("ethaddr", ethaddr);
>         }
> +       else if (eth_getenv_enetaddr("ethaddr", ethaddr)) {
> +               debug("got MAC%d address from env: %pM\n", dev_id, ethaddr);
> +               memcpy(edev->enetaddr, ethaddr, 6);
> +       }

This is not the appropriate way to handle this.

The network stack should already be setting this for you. Line 696 in net/eth.c

Is this attempting to fix a problem that you've observed?

Thanks,
-Joe


More information about the U-Boot mailing list