Subject: Re: Gigabit Ethernet support on gmac?
To: None <thorpej@wasabisystems.com>
From: Monroe Williams <monroe@criticalpath.com>
List: port-macppc
Date: 10/18/2001 11:43:14
on 10/17/01 8:56 PM, Jason R Thorpe at thorpej@wasabisystems.com wrote:

> On Wed, Oct 17, 2001 at 07:03:45PM -0700, Monroe Williams wrote:
> 
>> Well, I cobbled together something like bus_space_write_8 & friends on
>> macppc, built a kernel with the gem driver, and got the message:
> 
> I just committed a change to the GEM driver that eliminates the need for
> 64-bit PCI bus access.  Back out your bus_space changes, and update the
> gem.c and gemreg.h files in sys/dev/ic.

Done.  Thanks.

>> "could not map gem registers"
>> 
>> from the gem driver on boot.  This seems to come from dev/pci/if_gem_pci.c.
>> AFAICT, nothing that would use my implementation of bus_space_write_8 has
>> been called at this point, so I don't think it matters whether I got it
>> quite right.
> 
> This appears to be some ... unfortunate bogusness in the PCI front-end
> to the GEM driver.  I have fixed this, as well.
> 
> I also went ahead and added some code (which I have NOT even test-
> compiled on a PowerPC) that will fetch the MAC address.  You will
> have to possibly fix this up.  These changes can be obtained by
> updating sys/dev/pci/if_gem_pci.c.

Congratulations.  It looks like you got the MAC address code right the first
time.  ;)  Not only does it build, the interface has the same MAC address
with the gem driver that it had with the gm driver.

>> Has anyone actually seen the gem driver work on macppc, or is it just
>> theoretically supposed to work with the UniNorth ethernet core?  ;)
> 
> It's "theory" right now ... but it should work.  Note that Linux has a
> merged driver as well.

With a kernel that generates this dmesg output:

gem0 at pci2 dev 15 function 0: Apple Computer GMAC Ethernet (rev. 0x01)
gem0: interrupting at irq 41
gem0: Ethernet address 00:30:65:d6:f3:de
brgphy0 at gem0 phy 0: BCM5401 1000BASE-T media interface, rev. 3
brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT,
1000baseT-FDX, auto

If I boot the machine while connected to a 100baseTX switch, it doesn't
autodetect.  (ifconfig shows "media: Ethernet autoselect (none)".)  I can
get connectivity by doing `ifconfig gem0 media 100baseTX-FDX`.  If I then
set the media back to autoselect, it seems to work fine thereafter.  I can
hot-plug the cable as needed, the ifconfig output reflects the state of the
world, and the interface works as expected.

I can't get gigabit to work at all.  If I hot-plug the cable into the
gigabit switch, the link lights show a 1G link and ifconfig shows

media: Ethernet autoselect (1000baseTX full-duplex)

but no packets flow.  I've tried various manual media configurations with no
joy.  Booting the machine while connected to the gigabit switch works no
better.

Before you ask: yes, I'm using a 4-pair cable.  I've seen a gigabit
connection work with it today.

I also built a kernel with the brgphy driver configured out, so it uses the
ukphy driver:

gem0 at pci2 dev 15 function 0: Apple Computer GMAC Ethernet (rev. 0x01)
gem0: interrupting at irq 41
gem0: Ethernet address 00:30:65:d6:f3:de
ukphy0 at gem0 phy 0: Generic IEEE 802.3u media interface
ukphy0: BCM5401 1000BASE-T media interface (OUI 0x001018, model 0x0005),
rev. 3
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT,
1000baseT-FDX, auto

The results are mostly the same, but when it's plugged into the Gigabit
switch in autoconfig mode, ifconfig shows:

media: Ethernet autoselect (100baseTX full-duplex)

which doesn't match what the lights on the switch show (1G link).

Any ideas?

Thanks again,
-- monroe
------------------------------------------------------------------------
Monroe Williams                                  monroe@criticalpath.com