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
6 * Copyright (C) 2000, 2001, 04 Keith M Wesolowski
8 #include <linux/kernel.h>
9 #include <linux/init.h>
10 #include <linux/pci.h>
11 #include <linux/types.h>
12 #include <asm/bootinfo.h>
14 extern struct pci_ops nile4_pci_ops;
15 extern struct pci_ops gt64120_pci_ops;
16 static struct resource lasat_pci_mem_resource = {
17 .name = "LASAT PCI MEM",
20 .flags = IORESOURCE_MEM,
23 static struct resource lasat_pci_io_resource = {
24 .name = "LASAT PCI IO",
27 .flags = IORESOURCE_IO,
30 static struct pci_controller lasat_pci_controller = {
31 .mem_resource = &lasat_pci_mem_resource,
32 .io_resource = &lasat_pci_io_resource,
35 static int __init lasat_pci_setup(void)
37 printk("PCI: starting\n");
39 switch (mips_machtype) {
41 lasat_pci_controller.pci_ops = >64120_pci_ops;
44 lasat_pci_controller.pci_ops = &nile4_pci_ops;
47 panic("pcibios_init: mips_machtype incorrect");
50 register_pci_controller(&lasat_pci_controller);
55 arch_initcall(lasat_pci_setup);
57 #define LASATINT_ETH1 0
58 #define LASATINT_ETH0 1
59 #define LASATINT_HDC 2
60 #define LASATINT_COMP 3
61 #define LASATINT_HDLC 4
62 #define LASATINT_PCIA 5
63 #define LASATINT_PCIB 6
64 #define LASATINT_PCIC 7
65 #define LASATINT_PCID 8
67 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
77 return LASATINT_ETH1; /* Ethernet 1 (LAN 2) */
79 return LASATINT_ETH0; /* Ethernet 0 (LAN 1) */
81 return LASATINT_HDC; /* IDE controller */
83 return 0xff; /* Illegal */
89 /* Do platform specific device initialization at pci_enable_device() time */
90 int pcibios_plat_dev_init(struct pci_dev *dev)