Subject: Re: 3c905 (ex) in beige g3 problem
To: Tim Kelly <hockey@dialectronics.com>
From: Michael <macallan18@earthlink.net>
List: port-macppc
Date: 10/12/2004 15:09:22
Hello,

> >   pchb0: Motorola MPC106 "Grackle" Host Bridge (rev. 0x40)
> >   ex0 at pci0 dev 15 function 0: 3Com 3c905B-TX 10/100 Ethernet (rev.
> >   0x30) PCI_INTERRUPT_REG: a0a0100
> >   pci_intr_map: no mapping for pin A
> >   ex0: couldn't map interrupt
> 
> In trying to walk backwards from the ex driver, it appears to me that
> the interrupt line and pin are retrieved in pci_device_probe
> (sys/dev/pci/pci.c). According to pcireg.h, the line is the lowest byte
> of the interrupt register, and as such, the readout indicates that the
> line value is 0. This is consistent with the code from pci_intr_map,
> which bails if line is 0 or 255. 
> 
> The previously posted OF printout indicates that AAPL,interrupt is 0x19
> (irq 25), which means that at OF did at least assign an interrupt to the
> card.
Yep, so a fix should be trivial.

> Have I correctly traced this back?
As far as I can tell - not that I'm an expert but I played with the PCI config code on macppc a while ago to get some other hardware to work - yes. 

> If so, is this indicative of OF not properly initializing the card?
No, OF assigned an interrupt and for some reason it didn't end up in the NetBSD kernel. The code that walks through the OF tree and configures PCI devices changed a lot since 1.6 and I had to patch a few things, mainly to get devices behind a PCI bridge to work again. Look at sys/arch/macppc/pci/pci_machdep.c, probably add a few printf()s to fixpci() to see what exactly it does with the card in question and why it doesn't find the correct interrupt. Looks like it messes up the interrupt register for some reason.

> If this is true, then would there need to be some macpcc specific code added to the ex driver to properly
> configure the interrupt?
I don't think the ex driver needs any change - I'd suggest looking at pci_machdep.c first to see what goes wrong and why.

have fun
Michael