1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include <linux/init.h>
23#include <linux/ioport.h>
24#include <linux/kernel.h>
25#include <linux/pci.h>
26#include <linux/string.h>
27
28#include <asm/eeh.h>
29#include <asm/pci-bridge.h>
30#include <asm/prom.h>
31#include <asm/ppc-pci.h>
32
33#if 0
34void pcibios_name_device(struct pci_dev *dev)
35{
36 struct device_node *dn;
37
38
39
40
41 dn = pci_device_to_OF_node(dev);
42 if (dn) {
43 const char *loc_code = of_get_property(dn, "ibm,loc-code", 0);
44 if (loc_code) {
45 int loc_len = strlen(loc_code);
46 if (loc_len < sizeof(dev->dev.name)) {
47 memmove(dev->dev.name+loc_len+1, dev->dev.name,
48 sizeof(dev->dev.name)-loc_len-1);
49 memcpy(dev->dev.name, loc_code, loc_len);
50 dev->dev.name[loc_len] = ' ';
51 dev->dev.name[sizeof(dev->dev.name)-1] = '\0';
52 }
53 }
54 }
55}
56DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_name_device);
57#endif
58
59static void __init pSeries_request_regions(void)
60{
61 if (!isa_io_base)
62 return;
63
64 request_region(0x20,0x20,"pic1");
65 request_region(0xa0,0x20,"pic2");
66 request_region(0x00,0x20,"dma1");
67 request_region(0x40,0x20,"timer");
68 request_region(0x80,0x10,"dma page reg");
69 request_region(0xc0,0x20,"dma2");
70}
71
72void __init pSeries_final_fixup(void)
73{
74 pSeries_request_regions();
75
76 pci_addr_cache_build();
77}
78
79
80
81
82
83
84static void fixup_winbond_82c105(struct pci_dev* dev)
85{
86 int i;
87 unsigned int reg;
88
89 if (!machine_is(pseries))
90 return;
91
92 printk("Using INTC for W82c105 IDE controller.\n");
93 pci_read_config_dword(dev, 0x40, ®);
94
95 pci_write_config_dword(dev, 0x40, reg | (1<<11));
96
97 for (i = 0; i < DEVICE_COUNT_RESOURCE; ++i) {
98
99 if (dev->resource[i].flags & IORESOURCE_IO
100 && dev->bus->number == 0 && dev->devfn == 0x81)
101 dev->resource[i].flags &= ~IORESOURCE_IO;
102 if (dev->resource[i].start == 0 && dev->resource[i].end) {
103 dev->resource[i].flags = 0;
104 dev->resource[i].end = 0;
105 }
106 }
107}
108DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
109 fixup_winbond_82c105);
110