Port-ofppc archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Pegasos interrupt mapping and dmamem_alloc
Hi!
Today I found the reason for the "couldn't map interrupt" error on the Pegasos.
There is a bug in pci_machdep_ofw.c genofw_setup_pciintr_map(), when
creating the dictionary entry for Pegasos interrupt pins.
At least the last method for "super-annoying OFW" is affected, which reads
the interrupt lines directly from the PCI bus. Reading the "interrupt"
property returns a pin number from 1 to 4, but this is erroneously added to
'A' (generating pins from 'B' to 'E'!). The following diff fixes that:
--- pci_machdep_ofw.c.orig 2007-11-03 13:24:48.000000000 +0100
+++ pci_machdep_ofw.c 2007-11-03 14:15:38.000000000 +0100
@@ -312,7 +312,8 @@
if (OF_getprop(node, "interrupts", &pin, 4) < 0)
pin = 1;
intr_num = prop_number_create_integer(irq);
- sprintf(key, "pin-%c", 'A' + pin);
+
+ sprintf(key, "pin-%c", 'A' + (pin-1));
prop_dictionary_set(sub, key, intr_num);
prop_object_release(intr_num);
sprintf(key, "devfunc-%d", dev*0x8 + func);
Now it looked a bit better:
---8<---
pcib0 at pci0 dev 12 function 0: VIA Technologies VT8231 PCI-ISA Bridge (rev.
0x10)
viaide0 at pci0 dev 12 function 1
viaide0: VIA Technologies VT8231 ATA100 controller
viaide0: using irq 14 for native-PCI interrupt
atabus0 at viaide0 channel 0
atabus1 at viaide0 channel 1
...
vr0 at pci0 dev 13 function 0: VIA VT6102 (Rhine II) 10/100 Ethernet
vr0: interrupting at irq 9
vr0: Ethernet address: 00:0b:2f:44:82:3d
panic: call to null-ptr from 0x2e03e8
---8<---
But then a new crash! The _dma_phys_to_bus_mem() function in the
pci_bus_dma_tag structure was not initialized! I don't know why you are
making a difference between pci_bus_dma_tag for macppc and for the rest?
Usng the macppc-version instead, which initializes the two missing function
pointers, fixes the problem:
--- pci_machdep_common.c.orig 2007-11-03 15:31:45.000000000 +0100
+++ pci_machdep_common.c 2007-11-03 15:39:58.000000000 +0100
@@ -76,22 +76,24 @@
*/
#ifndef macppc
struct powerpc_bus_dma_tag pci_bus_dma_tag = {
- 0, /* _bounce_thresh */
- _bus_dmamap_create,
- _bus_dmamap_destroy,
- _bus_dmamap_load,
- _bus_dmamap_load_mbuf,
- _bus_dmamap_load_uio,
- _bus_dmamap_load_raw,
- _bus_dmamap_unload,
- NULL, /* _dmamap_sync */
- _bus_dmamem_alloc,
- _bus_dmamem_free,
- _bus_dmamem_map,
- _bus_dmamem_unmap,
- _bus_dmamem_mmap,
+ ._dmamap_create = _bus_dmamap_create,
+ ._dmamap_destroy = _bus_dmamap_destroy,
+ ._dmamap_load = _bus_dmamap_load,
+ ._dmamap_load_mbuf = _bus_dmamap_load_mbuf,
+ ._dmamap_load_uio = _bus_dmamap_load_uio,
+ ._dmamap_load_raw = _bus_dmamap_load_raw,
+ ._dmamap_unload = _bus_dmamap_unload,
+ ._dmamap_sync = NULL,
+ ._dmamem_alloc = _bus_dmamem_alloc,
+ ._dmamem_free = _bus_dmamem_free,
+ ._dmamem_map = _bus_dmamem_map,
+ ._dmamem_unmap = _bus_dmamem_unmap,
+ ._dmamem_mmap = _bus_dmamem_mmap,
+ ._dma_phys_to_bus_mem = _bus_dma_phys_to_bus_mem_generic,
+ ._dma_bus_mem_to_phys = _bus_dma_bus_mem_to_phys_generic,
};
#endif
+
int
genppc_pci_bus_maxdevs(pci_chipset_tag_t pc, int busno)
{
Now even the ethernet adapter is correctly initialized:
---8<---
vr0 at pci0 dev 13 function 0: VIA VT6102 (Rhine II) 10/100 Ethernet
vr0: interrupting at irq 9
vr0: Ethernet address: 00:0b:2f:44:82:3d
ukphy0 at vr0 phy 16: Generic IEEE 802.3u media interface
ukphy0: RTL8201L 10/100 media interface (OUI 0x000004, model 0x0020), rev. 1
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
---8<---
But also a new problem: now attaching ofb0 freezes the system... *sigh*
--
_ Frank Wille (frank%phoenix.owl.de@localhost)
_ // http://sun.hasenbraten.de/~frank/
\X/ Phx @ #AmigaGer
Home |
Main Index |
Thread Index |
Old Index