[PATCH] ftgmac100: fixup MAC address set during board bringup
Anton D. Kachalov
mouse at yandex-team.ru
Tue Nov 22 17:24:06 AEDT 2016
Hardware reset leads to clear all registers.
Make the hardware reset first before actual MAC address set in ftgmac100_initialization loop.
Based on datasheet only one bit (SW_RST) have to be set in order to proper MAC reset.
Signed-off-by: Anton D. Kachalov <mouse at yandex-team.ru>
---
drivers/net/ftgmac100.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
--- a/drivers/net/ftgmac100.c 2016-11-22 07:07:44.000000000 +0300
+++ b/drivers/net/ftgmac100.c 2016-11-22 07:27:12.131940971 +0300
@@ -457,7 +457,7 @@ static void ftgmac100_reset(struct eth_d
debug("%s()\n", __func__);
//Ryan modify
- __raw_writel(__raw_readl(&ftgmac100->maccr) | FTGMAC100_MACCR_SW_RST, &ftgmac100->maccr);
+ __raw_writel(FTGMAC100_MACCR_SW_RST, &ftgmac100->maccr);
while (__raw_readl(&ftgmac100->maccr) & FTGMAC100_MACCR_SW_RST);
@@ -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;
More information about the openbmc
mailing list