diff mbox

[U-Boot,PATCHv6,26/28] net: sun8i_gmac: Add read_rom_hwaddr hook

Message ID 20170515080244.21345-27-oliver@schinagl.nl
State Changes Requested
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Olliver Schinagl May 15, 2017, 8:02 a.m. UTC
With this patch sun8i_emac can now get the MAC address from the board in
a predetermined board specific manner.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
 drivers/net/Makefile     | 2 +-
 drivers/net/sun8i_emac.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 5df5567536..8464062d83 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -24,7 +24,7 @@  obj-$(CONFIG_E1000_SPI) += e1000_spi.o
 obj-$(CONFIG_EEPRO100) += eepro100.o
 obj-$(CONFIG_SUN4I_EMAC) += sunxi_common.o sun4i_mac.o
 obj-$(CONFIG_SUN7I_MAC) += sunxi_common.o sun7i_mac.o
-obj-$(CONFIG_SUN8I_EMAC) += sun8i_emac.o
+obj-$(CONFIG_SUN8I_EMAC) += sunxi_common.o sun8i_emac.o
 obj-$(CONFIG_ENC28J60) += enc28j60.o
 obj-$(CONFIG_EP93XX) += ep93xx_eth.o
 obj-$(CONFIG_ETHOC) += ethoc.o
diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index a3dbe2823b..5093f9c83d 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -25,6 +25,8 @@ 
 #include <asm-generic/gpio.h>
 #endif
 
+#include "sunxi_common.h"
+
 #define MDIO_CMD_MII_BUSY		BIT(0)
 #define MDIO_CMD_MII_WRITE		BIT(1)
 
@@ -757,6 +759,7 @@  static int sun8i_emac_eth_probe(struct udevice *dev)
 static const struct eth_ops sun8i_emac_eth_ops = {
 	.start                  = sun8i_emac_eth_start,
 	.write_hwaddr           = sun8i_eth_write_hwaddr,
+	.read_rom_hwaddr	= sunxi_mac_read_rom_hwaddr,
 	.send                   = sun8i_emac_eth_send,
 	.recv                   = sun8i_emac_eth_recv,
 	.free_pkt               = sun8i_eth_free_pkt,