Dual PCI Bus Patch


Lewis Johnson (ljohnson@direct.ca)
Sun, 03 Oct 1999 21:12:25 -0700


Here is a patch to get the second PCI bus to work. We have used it with both
2.2.11 and 2.2.12 kernels. The only devices I've tried on the second bus are
PCI nek2 cards and a Asante 10/100 card, both work.

This patch was written by Welsey Terpstra, pyrrhic@iota.dhs.org

------------------------------------

diff -r linux-2.2.11.orig/arch/ppc/kernel/pmac_pci.c
linux-2.2.11/arch/ppc/kernel/pmac_pci.c
25a26,33
> #define DEBUG
>
> #ifdef DEBUG
> #define DBG(x...) printk(x)
> #else
> #define DBG(x...)
> #endif
>
449a458,461
> int base;
>
> pci_scan_peer_bridge(1);
> pci_scan_peer_bridge(2);
471a484,505
>
> /*
> * We need to move the io base address according to the bus it
> * is on.
> */
> for (base = 0; base < 6; base++)
> {
> /* If this is an IO base address below system io bases */
> if ((dev->base_address[base] & PCI_COMMAND_IO) != 0 &&
> (dev->base_address[base] < 0xF0000000L)
> )
> {
> DBG("Remapping device %02x:%02x [%04x/%04x]",
> dev->bus->number, dev->devfn,
> dev->vendor, dev->device);
> DBG(", region %i", base);
> DBG(": %08lx", dev->base_address[base]);
> dev->base_address[base] +=
> (unsigned long)bp->io_base;
> DBG(" -> %08lx\n", dev->base_address[base]);
> }
> }
diff -r linux-2.2.11.orig/drivers/pci/pci.c linux-2.2.11/drivers/pci/pci.c
22c22
< #undef DEBUG

---
> #define DEBUG
diff -r linux-2.2.11.orig/include/asm-ppc/io.h
linux-2.2.11/include/asm-ppc/io.h
32d31
< extern unsigned long isa_io_base;
35c34
< #define _IO_BASE isa_io_base
---
> extern unsigned long isa_io_base;
37a37,41
> #ifdef CONFIG_PMAC
> #define _IO_BASE 0
> #else
> #define _IO_BASE isa_io_base
> #endif /* CONFIG_PMAC */



This archive was generated by hypermail 2.0b3 on Mon Oct 04 1999 - 04:14:13 GMT