Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / mips / pci / fixup-ocelot3.c
blobececc03ec6205e69b2ece3c25c0bfce7e67905f3
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Copyright (C) 2004 Montavista Software Inc.
7 * Author: Manish Lachwani (mlachwani@mvista.com)
9 * Looking at the schematics for the Ocelot-3 board, there are
10 * two PCI busses and each bus has two PCI slots.
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/pci.h>
15 #include <asm/mipsregs.h>
18 * Do platform specific device initialization at
19 * pci_enable_device() time
21 int pcibios_plat_dev_init(struct pci_dev *dev)
23 return 0;
26 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
28 int bus = dev->bus->number;
30 if (bus == 0 && slot == 1)
31 return 2; /* PCI-X A */
32 if (bus == 0 && slot == 2)
33 return 3; /* PCI-X B */
34 if (bus == 1 && slot == 1)
35 return 4; /* PCI A */
36 if (bus == 1 && slot == 2)
37 return 5; /* PCI B */
39 return 0;
40 panic("Whooops in pcibios_map_irq");