Subject: Re: 3c905 (ex) in beige g3 problem
To: None <port-macppc@netbsd.org>
From: Tim Kelly <hockey@dialectronics.com>
List: port-macppc
Date: 10/12/2004 07:54:02
I had Markus add a line to the if_ex_pci.c driver that would printout
the interrupt register.

>     Tim> aprint_normal("PCI_INTERRUPT_REG: %x\n",
>     pci_conf_read(pc,pa->pa_tag, Tim> PCI_INTERRUPT_REG));
> 
>     Tim> before
> 
>     Tim> 	/* Map and establish the interrupt. */
>     Tim> 	if (pci_intr_map(pa, &ih)) {
>     Tim> 		aprint_error("%s: couldn't map interrupt\n",
>     sc-> sc_dev.dv_xname);
>     Tim> 		return;
>     Tim> 	}
> 
>     Tim> Oops. That code should be added to sys/dev/pci/if_ex_pci.c
>     Tim> tim

His response:
> 
> Ok, I recompiled the kernel this way. Result:
> 
>   [...]
>   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.

Have I correctly traced this back? If so, is this indicative of OF not
properly initializing the card? If this is true, then would there need
to be some macpcc specific code added to the ex driver to properly
configure the interrupt?

tim