[U-Boot] [PATCHv2 18/21] net: sunxi_gmac: Add read_rom_hwaddr hook

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


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

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 3a0ab139c3..1c0bca229b 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -24,7 +24,7 @@ obj-$(CONFIG_E1000) += e1000.o
 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_gmac.o
+obj-$(CONFIG_SUNXI_GMAC) += sunxi_common.o sunxi_gmac.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_gmac.c b/drivers/net/sunxi_gmac.c
index 15f8164c34..0f6d124d2b 100644
--- a/drivers/net/sunxi_gmac.c
+++ b/drivers/net/sunxi_gmac.c
@@ -15,6 +15,7 @@
 #include <net.h>
 
 #include "designware.h"
+#include "sunxi_common.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -102,6 +103,7 @@ const struct eth_ops sunxi_gmac_eth_ops = {
 	.free_pkt		= designware_eth_free_pkt,
 	.stop			= designware_eth_stop,
 	.write_hwaddr		= designware_eth_write_hwaddr,
+	.read_rom_hwaddr	= sunxi_eth_read_rom_hwaddr,
 };
 
 static const struct udevice_id sunxi_gmac_eth_ids[] = {
-- 
2.11.0



More information about the U-Boot mailing list