[U-Boot] [PATCH] net: mvpp2: support setting hardware addresses from ethernet core

Joe Hershberger joe.hershberger at ni.com
Sat Jun 1 18:40:11 UTC 2019


On Wed, May 8, 2019 at 2:36 PM Matt Pelland <mpelland at starry.com> wrote:
>
> mvpp2 already has support for setting MAC addresses but this
> functionality was not exposed to the ethernet core. This commit exposes
> this functionality so that MAC address assignments stored in U-Boot's
> environment are correctly applied before Linux boots.
>
> Signed-off-by: Matt Pelland <mpelland at starry.com>
> ---
>  drivers/net/mvpp2.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
> index bcc6fe92a9..d2d17f1417 100644
> --- a/drivers/net/mvpp2.c
> +++ b/drivers/net/mvpp2.c
> @@ -5321,6 +5321,13 @@ static void mvpp2_stop(struct udevice *dev)
>         mvpp2_cleanup_txqs(port);
>  }
>
> +static mvpp2_write_hwaddr(struct udevice *dev)

This breaks the build. The function must return an int.

> +{
> +       struct mvpp2_port *port = dev_get_priv(dev);
> +
> +       mvpp2_prs_update_mac_da(port, port->dev_addr);

Missing status return from the result of mvpp2_prs_update_mac_da().

> +}
> +
>  static int mvpp22_smi_phy_addr_cfg(struct mvpp2_port *port)
>  {
>         writel(port->phyaddr, port->priv->iface_base +
> @@ -5525,6 +5532,7 @@ static const struct eth_ops mvpp2_ops = {
>         .send           = mvpp2_send,
>         .recv           = mvpp2_recv,
>         .stop           = mvpp2_stop,
> +       .write_hwaddr   = mvpp2_write_hwaddr
>  };
>
>  static struct driver mvpp2_driver = {
> --
> 2.21.0
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot


More information about the U-Boot mailing list