GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / powerpc / platforms / pseries / pci.c
blob667b5efe709f6cbbff5b61b5e83696d8e4d3ddae
1 /*
2 * Copyright (C) 2001 Dave Engebretsen, IBM Corporation
3 * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM
5 * pSeries specific routines for PCI.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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>
28 #include <asm/eeh.h>
29 #include <asm/pci-bridge.h>
30 #include <asm/prom.h>
31 #include <asm/ppc-pci.h>
34 static void __init pSeries_request_regions(void)
36 if (!isa_io_base)
37 return;
39 request_region(0x20,0x20,"pic1");
40 request_region(0xa0,0x20,"pic2");
41 request_region(0x00,0x20,"dma1");
42 request_region(0x40,0x20,"timer");
43 request_region(0x80,0x10,"dma page reg");
44 request_region(0xc0,0x20,"dma2");
47 void __init pSeries_final_fixup(void)
49 pSeries_request_regions();
51 pci_addr_cache_build();
55 * Assume the winbond 82c105 is the IDE controller on a
56 * p610/p615/p630. We should probably be more careful in case
57 * someone tries to plug in a similar adapter.
59 static void fixup_winbond_82c105(struct pci_dev* dev)
61 int i;
62 unsigned int reg;
64 if (!machine_is(pseries))
65 return;
67 printk("Using INTC for W82c105 IDE controller.\n");
68 pci_read_config_dword(dev, 0x40, &reg);
69 /* Enable LEGIRQ to use INTC instead of ISA interrupts */
70 pci_write_config_dword(dev, 0x40, reg | (1<<11));
72 for (i = 0; i < DEVICE_COUNT_RESOURCE; ++i) {
73 /* zap the 2nd function of the winbond chip */
74 if (dev->resource[i].flags & IORESOURCE_IO
75 && dev->bus->number == 0 && dev->devfn == 0x81)
76 dev->resource[i].flags &= ~IORESOURCE_IO;
77 if (dev->resource[i].start == 0 && dev->resource[i].end) {
78 dev->resource[i].flags = 0;
79 dev->resource[i].end = 0;
83 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
84 fixup_winbond_82c105);