[u-boot] net: ftgmac100: Reset FTGMAC100 before setting MAC

Message ID 1511238509-28279-1-git-send-email-qhuyduong@hotmail.com
State New
Headers show
Series
  • [u-boot] net: ftgmac100: Reset FTGMAC100 before setting MAC
Related show

Commit Message

Huy Duong Nov. 21, 2017, 4:28 a.m.
In ftgmac100_initialize(), FTGMAC100 is reset after MACs are set, hence
all MACs set before will be erased. This patch moves ftgmac100_reset() to
before ftgmac100_set_mac_from_env().

Signed-off-by: Huy Duong <qhuyduong@hotmail.com>
---
 drivers/net/ftgmac100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index 9d5ba98..5779057 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -791,11 +791,11 @@  int ftgmac100_initialize(bd_t *bd)
 		miiphy_register(dev->name, ftgmac100_reg_read, ftgmac100_reg_write);
 #endif
 
+		ftgmac100_reset(dev);
+
 		/* set the ethernet address */
 		ftgmac100_set_mac_from_env(dev);
 
-		ftgmac100_reset(dev);
-
 		card_number++;
 	}
 	return card_number;