2 * arch/arch/mach-ixp4xx/sg5xx-pci.c
4 * PCI setup routines for Cyberguard/SnapGear SG5XX family boards
6 * Copyright (C) 2005 SnapGear Inc
7 * Copyright (C) 2004 MontaVista Softwrae, Inc.
9 * Maintainer: Cyberguard Inc
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
17 #include <linux/kernel.h>
18 #include <linux/pci.h>
19 #include <linux/init.h>
20 #include <linux/irq.h>
21 #include <asm/mach-types.h>
22 #include <asm/hardware.h>
24 #include <asm/mach/pci.h>
26 extern void ixp4xx_pci_preinit(void);
27 extern int ixp4xx_setup(int nr
, struct pci_sys_data
*sys
);
28 extern struct pci_bus
*ixp4xx_scan_bus(int nr
, struct pci_sys_data
*sys
);
30 void __init
sg5xx_pci_preinit(void)
32 set_irq_type(IRQ_IXP4XX_GPIO8
, IRQT_LOW
);
36 static int __init
sg5xx_map_irq(struct pci_dev
*dev
, u8 slot
, u8 pin
)
38 if (slot
== 12 || slot
== 14)
39 return IRQ_IXP4XX_GPIO8
;
43 struct hw_pci sg5xx_pci __initdata
= {
45 .preinit
= sg5xx_pci_preinit
,
46 .swizzle
= pci_std_swizzle
,
47 .setup
= ixp4xx_setup
,
48 .scan
= ixp4xx_scan_bus
,
49 .map_irq
= sg5xx_map_irq
,
52 int __init
sg5xx_pci_init(void)
54 if (machine_is_sg565() || machine_is_sg8100())
55 pci_common_init(&sg5xx_pci
);
59 subsys_initcall(sg5xx_pci_init
);