Date: Sun, 13 Jun 2010 22:13:31 +0200 From: Kristof Provost <kristof@sigsegv.be> To: Norikatsu Shigemura <nork@FreeBSD.org> Cc: freebsd-arm@FreeBSD.org, freebsd-current@FreeBSD.org, yongari@FreeBSD.org Subject: Re: [OpenRD Ultimate] e1000phy(88E1149/88E1121) has a initialize issue Message-ID: <20100613201331.GA19653@nereid> In-Reply-To: <20100613233723.ed2c3a30.nork@FreeBSD.org> References: <20100613233723.ed2c3a30.nork@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--HlL+5n6rz5pIUxbD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On 2010-06-13 23:37:23 (+0900), Norikatsu Shigemura <nork@FreeBSD.org> wrote:
> Hi yongari!
>
> I have a OpenRD Ultimate, which has two GbE ports - if_mge(4). But
> I couldn't use mge1 like following. So I tried to investigate.
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Jun 13 05:02:14 sidearms kernel: mge1: watchdog timeout
> Jun 13 05:02:14 sidearms kernel: mge1: Timeout on link-up
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
I believe the mge(4) driver incorrectly configures the PHY address for
the second interface. Can you give the attached patch a try?
I'm not familiar with the PHY code so I won't comment on those changes.
Regards,
Kristof
--HlL+5n6rz5pIUxbD
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="if_mge_openrd.patch"
Index: sys/dev/mge/if_mge.c
===================================================================
--- sys/dev/mge/if_mge.c (revision 208113)
+++ sys/dev/mge/if_mge.c (working copy)
@@ -606,7 +606,6 @@
mge_attach(device_t dev)
{
struct mge_softc *sc;
- struct mii_softc *miisc;
struct ifnet *ifp;
uint8_t hwaddr[ETHER_ADDR_LEN];
int i, error ;
@@ -690,9 +689,9 @@
}
sc->mii = device_get_softc(sc->miibus);
- /* Tell the MAC where to find the PHY so autoneg works */
- miisc = LIST_FIRST(&sc->mii->mii_phys);
- MGE_WRITE(sc, MGE_REG_PHYDEV, miisc->mii_phy);
+ /* Tell the MAC where to find the PHY so autoneg works
+ * We assume a static mapping (see mge_miibus_readreg) */
+ MGE_WRITE(sc, MGE_REG_PHYDEV, device_get_unit(dev) + MII_ADDR_BASE);
/* Attach interrupt handlers */
for (i = 0; i < 2; ++i) {
--HlL+5n6rz5pIUxbD--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100613201331.GA19653>
