Subject: Re: sun pci GE/gem
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: john heasley <heas@shrubbery.net>
List: port-sparc64
Date: 07/06/2003 21:50:48
Fri, Jun 27, 2003 at 01:30:33PM -0700, john heasley:
> Fri, Jun 27, 2003 at 10:18:14PM +0200, Manuel Bouyer:
> > On Fri, Jun 27, 2003 at 01:04:44PM -0700, john heasley wrote:
> > > Fri, Jun 27, 2003 at 09:09:51PM +0200, Manuel Bouyer:
> > > > On Thu, Jun 26, 2003 at 02:26:04PM -0700, john heasley wrote:
> > > > > Has anyone been successful in using a Sun PCI GE card (SUNW,pci-gem)?
> > > > > 
> > > > > This card functions on my blade under solaris (w/ a catalyst 3512g),
> > > > > but does not work on my u60 under netbsd.  I suspect that the phy is
> > > > > not being diddled properly, because the switch does not report any
> > > > > activity afaict.
> > > > > 
> > > > > trying to figure out where i should start looking...
> > > > 
> > > > Can you post the boot messages ?
> > > 
> > > gem0 at pci0 dev 4 function 0: Sun Microsystems, Inc. GEM Gigabit Ethernet (rev. 0x01)
> > > gem0: interrupting at ivec 3018
> > > gem0: Ethernet address 08:00:20:9d:57:87, 20KB RX fifo, 9KB TX fifo
> > > 
> > > no phy, but i have not yet figured out which one it has and ukphy attach.
> > 
> > You mean, no phy attach at all ?
> > Otherwise, the ukphy line contains valuable infos.
> 
> None at all and no msgs with MIIVERBOSE or the various GEMDEBUGs.
> 
> >From what Eduardo mentioned, it's not supposed to have a phy, because it
> definitely has a SERDES, the agilent HDMP-1646A.  Thanks Eduardo.
> 
> The doc that i found on the SERDES seems to indicate that all it has is
> a loopback pin and is otherwise unconfigurable...but, that doesnt make
> sense to me, since something has to perform the negotiation.  clues welcome.
> 
> btw, if anyone has a pointer to user docs for the GEM or agilent, please
> pass them my way.  My googling has not turned-up anything useful yet.

ok, I have figured out the right bits to turn to make this card work.
but, as Eduardo said, it does not have a MII connected to the SERDES,
so i'm trying to figure out how to fake one.

when mii_attach tries to read the BMSR, i return the SERDES status register
and 1 for each of the phy IDs.  like so,

gem_pcs_readreg: phy 0 reg 1
gem_pcs_readreg: phy 0 reg 2
gem_pcs_readreg: phy 0 reg 3
mii_attach: bmsr=300, id1=1, id2=1
ukphy3 at gem0 phy 0: Generic IEEE 802.3u media interface
ukphy3: OUI 0x000002, model 0x0000, rev. 1
gem_pcs_writereg: 
gem_pcs_writereg: phy 0 reg 0 val 8400
gem_pcs_readreg: phy 0 reg 0
gem_pcs_readreg: phy 0 reg 1
ukphy3: 100baseTX			<<<< which is wrong of course


but it panic's here.  i'm having trouble following what is supposed to
be happening here.  what is it trying to match?

gem_attach: phy discovered by mii_attach(): phy 0, instance 0
ifmedia_set: target=32
ifmedia_match: target=32, mask=fffffff
ifmedia_match: next->ifm_media=22, target=20
ifmedia_match: next->ifm_media=26, target=20
ifmedia_set: no match for 0x20/0xfffffff
panic: ifmedia_set
kdb breakpoint at 1137f30
Stopped in pid 0.1 (swapper) at netbsd:cpu_Debugger+0x4:        nop

clues?
thanks.