* [U-Boot] [PATCH] net: macb: Fix GMAC not work when enable DM_ETH
@ 2017-04-18 7:41 Wenyou Yang
2017-04-19 0:12 ` Simon Glass
0 siblings, 1 reply; 2+ messages in thread
From: Wenyou Yang @ 2017-04-18 7:41 UTC (permalink / raw)
To: u-boot
Always search the PHY to determine the macb->phy_addr before using
the PHY to fix "No PHY present" error.
Fix the wrong test of the GMAC's phy interface mode, it should be
PHY_INTERFACE_MODE_RGMII.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
drivers/net/macb.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 402e866817..fbd7b4d4cd 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -447,7 +447,6 @@ static void macb_phy_reset(struct macb_device *macb, const char *name)
name, status);
}
-#ifdef CONFIG_MACB_SEARCH_PHY
static int macb_phy_find(struct macb_device *macb, const char *name)
{
int i;
@@ -468,7 +467,6 @@ static int macb_phy_find(struct macb_device *macb, const char *name)
return 0;
}
-#endif /* CONFIG_MACB_SEARCH_PHY */
#ifdef CONFIG_DM_ETH
static int macb_phy_init(struct udevice *dev, const char *name)
@@ -488,11 +486,9 @@ static int macb_phy_init(struct macb_device *macb, const char *name)
int i;
arch_get_mdio_control(name);
-#ifdef CONFIG_MACB_SEARCH_PHY
/* Auto-detect phy_addr */
if (!macb_phy_find(macb, name))
return 0;
-#endif /* CONFIG_MACB_SEARCH_PHY */
/* Check if the PHY is up to snuff... */
phy_id = macb_mdio_read(macb, MII_PHYSID1);
@@ -667,7 +663,7 @@ static int _macb_init(struct macb_device *macb, const char *name)
* to select interface between RMII and MII.
*/
#ifdef CONFIG_DM_ETH
- if (macb->phy_interface == PHY_INTERFACE_MODE_RMII)
+ if (macb->phy_interface == PHY_INTERFACE_MODE_RGMII)
gem_writel(macb, UR, GEM_BIT(RGMII));
else
gem_writel(macb, UR, 0);
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] net: macb: Fix GMAC not work when enable DM_ETH
2017-04-18 7:41 [U-Boot] [PATCH] net: macb: Fix GMAC not work when enable DM_ETH Wenyou Yang
@ 2017-04-19 0:12 ` Simon Glass
0 siblings, 0 replies; 2+ messages in thread
From: Simon Glass @ 2017-04-19 0:12 UTC (permalink / raw)
To: u-boot
On 18 April 2017 at 01:41, Wenyou Yang <wenyou.yang@atmel.com> wrote:
> Always search the PHY to determine the macb->phy_addr before using
> the PHY to fix "No PHY present" error.
>
> Fix the wrong test of the GMAC's phy interface mode, it should be
> PHY_INTERFACE_MODE_RGMII.
>
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> ---
>
> drivers/net/macb.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-19 0:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18 7:41 [U-Boot] [PATCH] net: macb: Fix GMAC not work when enable DM_ETH Wenyou Yang
2017-04-19 0:12 ` Simon Glass
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.