[U-Boot] [PATCHv2 19/21] net: sun8i_gmac: Add read_rom_hwaddr hook

Olliver Schinagl oliver at schinagl.nl
Mon Apr 10 15:33:54 UTC 2017


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 at schinagl.nl>
---
 drivers/net/Makefile     | 2 +-
 drivers/net/sun8i_emac.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 1c0bca229b..b6e5640576 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -25,7 +25,7 @@ obj-$(CONFIG_E1000_SPI) += e1000_spi.o
 obj-$(CONFIG_EEPRO100) += eepro100.o
 obj-$(CONFIG_SUNXI_EMAC) += sunxi_common.o sunxi_emac.o
 obj-$(CONFIG_SUNXI_GMAC) += sunxi_common.o sunxi_gmac.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 b87210bad7..f2838f9f8f 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -22,6 +22,8 @@
 #include <miiphy.h>
 #include <net.h>
 
+#include "sunxi_common.h"
+
 #define MDIO_CMD_MII_BUSY		BIT(0)
 #define MDIO_CMD_MII_WRITE		BIT(1)
 
@@ -705,6 +707,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_eth_read_rom_hwaddr,
 	.send                   = sun8i_emac_eth_send,
 	.recv                   = sun8i_emac_eth_recv,
 	.free_pkt               = sun8i_eth_free_pkt,
-- 
2.11.0



More information about the U-Boot mailing list