Skip to contentSkip to conversation

net: mvpp2: support setting hardware addresses from ethernet core

PATCH New Matt Pelland 4 participants 9 messages May 8, 2019 – Sep 4, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mvpp2: support setting hardware addresses from ethernet core

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.

---
 drivers/net/mvpp2.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/mvpp2.c +8 -0
index bcc6fe92a9..d2d17f1417 100644
@@ -5321,6 +5321,13 @@ static void mvpp2_stop(struct udevice *dev)
 	mvpp2_cleanup_txqs(port);
 }
 
+static mvpp2_write_hwaddr(struct udevice *dev)
+{
+	struct mvpp2_port *port = dev_get_priv(dev);
+
+	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 = {
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/1 net: mvpp2: support setting hardware addresses from ethernet core

Quoted 7 lines · Matt Pelland

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.

#2 lore raw

PATCH 1/1 net: mvpp2: support setting hardware addresses from ethernet core

In reply to Matt Pelland
Quoted 6 lines · Matt Pelland

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.

Thanks,
Stefan

#3 lore raw

PATCH 1/1 net: mvpp2: support setting hardware addresses from ethernet core

In reply to Matt Pelland
Quoted 16 lines · Matt Pelland

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.

---
 drivers/net/mvpp2.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/mvpp2.c +0 -0
index bcc6fe92a9..d2d17f1417 100644

drivers/net/mvpp2.c static void mvpp2_stop(struct udevice *dev) · line 5324

Quoted 4 lines
drivers/net/mvpp2.c +1 -0
@@ -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.

drivers/net/mvpp2.c static void mvpp2_stop(struct udevice *dev) · line 5328

Quoted 4 lines
drivers/net/mvpp2.c +4 -0
+{
+       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().

Quoted 20 lines
drivers/net/mvpp2.c +3 -1
+}
+
 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

#4 lore raw

PATCH 1/1 net: mvpp2: support setting hardware addresses from ethernet core

Quoted 21 lines · Joe Hershberger
Quoted 19 lines · Matt Pelland

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.

---
 drivers/net/mvpp2.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/mvpp2.c +0 -0
index bcc6fe92a9..d2d17f1417 100644
@@ -5321,6 +5321,13 @@ static void mvpp2_stop(struct udevice *dev)
        mvpp2_cleanup_txqs(port);
 }
 
Quoted 3 lines

drivers/net/mvpp2.c static void mvpp2_stop(struct udevice *dev) · line 5324

Quoted 1 line
drivers/net/mvpp2.c +1 -0
+static mvpp2_write_hwaddr(struct udevice *dev)

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

Should we expect an update to this patch or drop it from patchwork?

Quoted 28 lines

drivers/net/mvpp2.c static void mvpp2_stop(struct udevice *dev) · line 5328

Quoted 5 lines
drivers/net/mvpp2.c +4 -0
+{
+       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().

Quoted 20 lines
drivers/net/mvpp2.c +3 -1
+}
+
 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

#5 lore raw

PATCH 1/1 net: mvpp2: support setting hardware addresses from ethernet core

Quoted 22 lines · Joe Hershberger
Quoted 21 lines · Matt Pelland
Quoted 19 lines

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.

---
 drivers/net/mvpp2.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/mvpp2.c +0 -0
index bcc6fe92a9..d2d17f1417 100644
@@ -5321,6 +5321,13 @@ static void mvpp2_stop(struct udevice *dev)
        mvpp2_cleanup_txqs(port);
 }
 
Quoted 5 lines
Quoted 3 lines

drivers/net/mvpp2.c static void mvpp2_stop(struct udevice *dev) · line 5324

Quoted 1 line
drivers/net/mvpp2.c +1 -0
+static mvpp2_write_hwaddr(struct udevice *dev)

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

Should we expect an update to this patch or drop it from patchwork?

Hi Joe,

Many apologies for the delay on this. I had my email filters misconfigured and things were getting sent to an archive instead of my inbox. I've cleaned up the patch in question.

Thanks,
Matt

#6 lore raw

PATCH v2 1/1 net: mvpp2: support setting hardware addresses from ethernet core

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.

---
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(+)
drivers/net/mvpp2.c +8 -0
index bcc6fe92a9..bd89725e77 100644
@@ -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 = {
Signature · 1 line
2.21.0
#7 lore raw

PATCH v2 1/1 net: mvpp2: support setting hardware addresses from ethernet core

Quoted 7 lines · Matt Pelland

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.