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>
13 #include <asm/lasat/lasatint.h>
15 extern struct pci_ops nile4_pci_ops;
16 extern struct pci_ops gt64xxx_pci0_ops;
17 static struct resource lasat_pci_mem_resource = {
18 .name = "LASAT PCI MEM",
21 .flags = IORESOURCE_MEM,
24 static struct resource lasat_pci_io_resource = {
25 .name = "LASAT PCI IO",
28 .flags = IORESOURCE_IO,
31 static struct pci_controller lasat_pci_controller = {
32 .mem_resource = &lasat_pci_mem_resource,
33 .io_resource = &lasat_pci_io_resource,
36 static int __init lasat_pci_setup(void)
38 printk(KERN_DEBUG "PCI: starting\n");
40 switch (mips_machtype) {
42 lasat_pci_controller.pci_ops = >64xxx_pci0_ops;
45 lasat_pci_controller.pci_ops = &nile4_pci_ops;
48 panic("pcibios_init: mips_machtype incorrect");
51 register_pci_controller(&lasat_pci_controller);
56 arch_initcall(lasat_pci_setup);
58 #define LASATINT_ETH1 (LASATINT_BASE + 0)
59 #define LASATINT_ETH0 (LASATINT_BASE + 1)
60 #define LASATINT_HDC (LASATINT_BASE + 2)
61 #define LASATINT_COMP (LASATINT_BASE + 3)
62 #define LASATINT_HDLC (LASATINT_BASE + 4)
63 #define LASATINT_PCIA (LASATINT_BASE + 5)
64 #define LASATINT_PCIB (LASATINT_BASE + 6)
65 #define LASATINT_PCIC (LASATINT_BASE + 7)
66 #define LASATINT_PCID (LASATINT_BASE + 8)
68 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
74 return LASATINT_PCIA + (((slot-1) + (pin-1)) % 4);
76 return LASATINT_ETH1; /* Ethernet 1 (LAN 2) */
78 return LASATINT_ETH0; /* Ethernet 0 (LAN 1) */
80 return LASATINT_HDC; /* IDE controller */
82 return 0xff; /* Illegal */
88 /* Do platform specific device initialization at pci_enable_device() time */
89 int pcibios_plat_dev_init(struct pci_dev *dev)