[U-Boot] [PATCHv2 15/21] net: sunxi_emac: Add read_rom_hwaddr hook

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


With this patch sunxi_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/sunxi_emac.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 2493a48b88..c840770bd8 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -23,7 +23,7 @@ obj-$(CONFIG_DNET) += dnet.o
 obj-$(CONFIG_E1000) += e1000.o
 obj-$(CONFIG_E1000_SPI) += e1000_spi.o
 obj-$(CONFIG_EEPRO100) += eepro100.o
-obj-$(CONFIG_SUNXI_EMAC) += sunxi_emac.o
+obj-$(CONFIG_SUNXI_EMAC) += sunxi_common.o sunxi_emac.o
 obj-$(CONFIG_SUN8I_EMAC) += sun8i_emac.o
 obj-$(CONFIG_ENC28J60) += enc28j60.o
 obj-$(CONFIG_EP93XX) += ep93xx_eth.o
diff --git a/drivers/net/sunxi_emac.c b/drivers/net/sunxi_emac.c
index 0dc37de242..b50f0eec09 100644
--- a/drivers/net/sunxi_emac.c
+++ b/drivers/net/sunxi_emac.c
@@ -16,6 +16,8 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/gpio.h>
 
+#include "sunxi_common.h"
+
 /* EMAC register  */
 struct emac_regs {
 	u32 ctl;	/* 0x00 */
@@ -582,6 +584,7 @@ static const struct eth_ops sunxi_emac_eth_ops = {
 	.recv			= sunxi_emac_eth_recv,
 	.stop			= sunxi_emac_eth_stop,
 	.write_hwaddr		= sunxi_emac_eth_write_hwaddr,
+	.read_rom_hwaddr	= sunxi_eth_read_rom_hwaddr,
 };
 
 static int sunxi_emac_eth_ofdata_to_platdata(struct udevice *dev)
-- 
2.11.0



More information about the U-Boot mailing list