Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Oct 2010 13:14:38 +0200
From:      Kristof Provost <kristof@sigsegv.be>
To:        Milan Obuch <freebsd-arm@dino.sk>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: Guruplug Server Plus working to some extent...
Message-ID:  <20101024111438.GA24690@nereid>
In-Reply-To: <201010212313.23283.freebsd-arm@dino.sk>
References:  <201010202309.40148.freebsd-arm@dino.sk> <20101021104352.588c6a5f@ernst.jennejohn.org> <201010211119.26731.freebsd-arm@dino.sk> <201010212313.23283.freebsd-arm@dino.sk>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2010-10-21 23:13:21 (+0200), Milan Obuch <freebsd-arm@dino.sk> wrote:
> Also, when I put mge1's ethernet link address (MAC) into .dts file, it is 
> initialised with this value, as expected. But nothing else changed - receiving 
> frames works, sending does not.
> 
> Maybe it's time for some mge's source tweaking, but I have absolutelly no idea 
> where to begin.
> 
I suspect the PHY asignment. The current code tries to retrieve the PHY
number from the dts but then probes for PHYs and uses the first one.

Can you try the following patch? I unfortunately don't have hardware
with two PHYs.
Make sure you have the correct phy number set for mge1 (probably just
0x1) in your dts.

It's probably not a final solution though as it relies on the dts for
information which can be probed automatically.

Index: dev/mge/if_mge.c                                        
===================================================================
--- dev/mge/if_mge.c  (revision 214256)
+++ dev/mge/if_mge.c  (working copy)
@@ -626,7 +626,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, phy;
@@ -717,8 +716,7 @@
  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);
+ MGE_WRITE(sc, MGE_REG_PHYDEV, phy);
 
  /* Attach interrupt handlers */
  for (i = 0; i < 2; ++i) {

Regards,
Kristof




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101024111438.GA24690>