public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Matt Pelland <mpelland@starry.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] net: mvpp2: support setting hardware addresses from ethernet core
Date: Tue, 30 Jul 2019 09:40:24 -0400	[thread overview]
Message-ID: <20190730134023.16923-2-mpelland@starry.com> (raw)
In-Reply-To: <20190730134023.16923-1-mpelland@starry.com>

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@starry.com>
---
Changes since v1:
 - Correctly specify the return type of mvpp2_write_hwaddr
 - Correctly return the status code of mvpp2_prs_update_mac_da

 drivers/net/mvpp2.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index bcc6fe92a9..bd89725e77 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 int mvpp2_write_hwaddr(struct udevice *dev)
+{
+	struct mvpp2_port *port = dev_get_priv(dev);
+
+	return mvpp2_prs_update_mac_da(port, port->dev_addr);
+}
+
 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

  reply	other threads:[~2019-07-30 13:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 19:34 [U-Boot] [PATCH] net: mvpp2: support setting hardware addresses from ethernet core Matt Pelland
2019-05-08 21:53 ` Joe Hershberger
2019-05-09  5:17 ` Stefan Roese
2019-06-01 18:40 ` Joe Hershberger
2019-07-08 19:00   ` Joe Hershberger
2019-07-30 13:40     ` Matt Pelland
2019-07-30 13:40       ` Matt Pelland [this message]
2019-07-30 22:19         ` [U-Boot] [PATCH v2] " Joe Hershberger
2019-09-04 16:40         ` [U-Boot] " Joe Hershberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190730134023.16923-2-mpelland@starry.com \
    --to=mpelland@starry.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox