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

Message ID 1511238735-29162-1-git-send-email-qhuyduong@hotmail.com
State Accepted, archived
Headers show
Series
  • [u-boot] net: ftgmac100: Reset FTGMAC100 before setting MAC
Related show

Commit Message

Huy Duong Nov. 21, 2017, 4:32 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(-)

Comments

Joel Stanley Feb. 13, 2018, 4 a.m. | #1
On Tue, Nov 21, 2017 at 3:02 PM, Huy Duong <quochuybk2010@gmail.com> wrote:
> 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>

Sorry for neglecting you patch.

This makes sense to me. Merged into v2016.07-aspeed-openbmc.

Cheers,

Joel

> ---
>  drivers/net/ftgmac100.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> 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;
> --
> 2.7.4
>

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;