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/init.h>
9 #include <linux/kernel.h>
10 #include <linux/pci.h>
11 #include <linux/types.h>
13 #include <asm/lasat/lasat.h>
17 extern struct pci_ops nile4_pci_ops
;
18 extern struct pci_ops gt64xxx_pci0_ops
;
19 static struct resource lasat_pci_mem_resource
= {
20 .name
= "LASAT PCI MEM",
23 .flags
= IORESOURCE_MEM
,
26 static struct resource lasat_pci_io_resource
= {
27 .name
= "LASAT PCI IO",
30 .flags
= IORESOURCE_IO
,
33 static struct pci_controller lasat_pci_controller
= {
34 .mem_resource
= &lasat_pci_mem_resource
,
35 .io_resource
= &lasat_pci_io_resource
,
38 static int __init
lasat_pci_setup(void)
40 printk(KERN_DEBUG
"PCI: starting\n");
43 lasat_pci_controller
.pci_ops
= &nile4_pci_ops
;
45 lasat_pci_controller
.pci_ops
= >64xxx_pci0_ops
;
47 register_pci_controller(&lasat_pci_controller
);
52 arch_initcall(lasat_pci_setup
);
54 #define LASAT_IRQ_ETH1 (LASAT_IRQ_BASE + 0)
55 #define LASAT_IRQ_ETH0 (LASAT_IRQ_BASE + 1)
56 #define LASAT_IRQ_HDC (LASAT_IRQ_BASE + 2)
57 #define LASAT_IRQ_COMP (LASAT_IRQ_BASE + 3)
58 #define LASAT_IRQ_HDLC (LASAT_IRQ_BASE + 4)
59 #define LASAT_IRQ_PCIA (LASAT_IRQ_BASE + 5)
60 #define LASAT_IRQ_PCIB (LASAT_IRQ_BASE + 6)
61 #define LASAT_IRQ_PCIC (LASAT_IRQ_BASE + 7)
62 #define LASAT_IRQ_PCID (LASAT_IRQ_BASE + 8)
64 int __init
pcibios_map_irq(const struct pci_dev
*dev
, u8 slot
, u8 pin
)
70 return LASAT_IRQ_PCIA
+ (((slot
-1) + (pin
-1)) % 4);
72 return LASAT_IRQ_ETH1
; /* Ethernet 1 (LAN 2) */
74 return LASAT_IRQ_ETH0
; /* Ethernet 0 (LAN 1) */
76 return LASAT_IRQ_HDC
; /* IDE controller */
78 return 0xff; /* Illegal */
84 /* Do platform specific device initialization at pci_enable_device() time */
85 int pcibios_plat_dev_init(struct pci_dev
*dev
)