ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / ppc / platforms / gemini_pci.c
1 #include <linux/kernel.h>
2 #include <linux/init.h>
3 #include <linux/pci.h>
4 #include <linux/slab.h>
5
6 #include <asm/machdep.h>
7 #include <platforms/gemini.h>
8 #include <asm/byteorder.h>
9 #include <asm/io.h>
10 #include <asm/uaccess.h>
11 #include <asm/pci-bridge.h>
12
13 void __init gemini_pcibios_fixup(void)
14 {
15         int i;
16         struct pci_dev *dev = NULL;
17         
18         while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
19                 for(i = 0; i < 6; i++) {
20                         if (dev->resource[i].flags & IORESOURCE_IO) {
21                                 dev->resource[i].start |= (0xfe << 24);
22                                 dev->resource[i].end |= (0xfe << 24);
23                         }
24                 }
25         }
26 }
27
28
29 /* The "bootloader" for Synergy boards does none of this for us, so we need to
30    lay it all out ourselves... --Dan */
31 void __init gemini_find_bridges(void)
32 {
33         struct pci_controller* hose;
34         
35         ppc_md.pcibios_fixup = gemini_pcibios_fixup;
36
37         hose = pcibios_alloc_controller();
38         if (!hose)
39                 return;
40         setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
41 }