MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / arch / arm / mach-ixp4xx / ess710-pci.c
blob457e10c14b90d9866eb0dc029f3ff6b662bcf7a1
1 /*
2 * arch/arm/mach-ixp4xx/ixdp425-pci.c
4 * ESS710 board-level PCI initialization
5 * Copyright (C) 2004 SnapGear - A CyberGuard Company
7 * Copyright (C) 2002 Intel Corporation.
8 * Copyright (C) 2003-2004 MontaVista Software, Inc.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
16 #include <linux/pci.h>
17 #include <linux/init.h>
18 #include <linux/delay.h>
19 #include <linux/irq.h>
20 #include <asm/mach/pci.h>
21 #include <asm/irq.h>
22 #include <asm/hardware.h>
23 #include <asm/mach-types.h>
25 void __init ess710_pci_preinit(void)
27 printk("PCI: reset bus...\n");
28 gpio_line_set(13, 0);
29 gpio_line_config(13, IXP4XX_GPIO_OUT);
30 gpio_line_set(13, 0);
31 mdelay(50);
32 gpio_line_set(13, 1);
33 mdelay(50);
35 gpio_line_config(6, IXP4XX_GPIO_IN);
36 set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW); /* INTA */
37 gpio_line_config(7, IXP4XX_GPIO_IN);
38 set_irq_type(IRQ_IXP4XX_GPIO7, IRQT_LOW); /* INTB */
39 gpio_line_config(8, IXP4XX_GPIO_IN);
40 set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW); /* INTC */
42 ixp4xx_pci_preinit();
45 static int __init ess710_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
47 if (slot == 16)
48 return IRQ_ESS710_PCI_INTA;
49 else if (slot == 15)
50 return IRQ_ESS710_PCI_INTB;
51 else if (slot == 14)
52 return IRQ_ESS710_PCI_INTC;
53 else if (slot == 13)
54 return IRQ_ESS710_PCI_INTC;
55 return -1;
58 struct hw_pci ess710_pci __initdata = {
59 .nr_controllers = 1,
60 .preinit = ess710_pci_preinit,
61 .swizzle = pci_std_swizzle,
62 .setup = ixp4xx_setup,
63 .scan = ixp4xx_scan_bus,
64 .map_irq = ess710_map_irq,
67 int __init ess710_pci_init(void)
69 if (machine_is_ess710())
70 pci_common_init(&ess710_pci);
71 return 0;
74 subsys_initcall(ess710_pci_init);