Path: blob/master/arch/arm/mach-ixp4xx/coyote-pci.c
10817 views
/*1* arch/arm/mach-ixp4xx/coyote-pci.c2*3* PCI setup routines for ADI Engineering Coyote platform4*5* Copyright (C) 2002 Jungo Software Technologies.6* Copyright (C) 2003 MontaVista Softwrae, Inc.7*8* Maintainer: Deepak Saxena <[email protected]>9*10* This program is free software; you can redistribute it and/or modify11* it under the terms of the GNU General Public License version 2 as12* published by the Free Software Foundation.13*14*/1516#include <linux/kernel.h>17#include <linux/pci.h>18#include <linux/init.h>19#include <linux/irq.h>20#include <asm/mach-types.h>21#include <mach/hardware.h>22#include <asm/irq.h>23#include <asm/mach/pci.h>2425#define SLOT0_DEVID 1426#define SLOT1_DEVID 152728/* PCI controller GPIO to IRQ pin mappings */29#define SLOT0_INTA 630#define SLOT1_INTA 113132void __init coyote_pci_preinit(void)33{34irq_set_irq_type(IXP4XX_GPIO_IRQ(SLOT0_INTA), IRQ_TYPE_LEVEL_LOW);35irq_set_irq_type(IXP4XX_GPIO_IRQ(SLOT1_INTA), IRQ_TYPE_LEVEL_LOW);36ixp4xx_pci_preinit();37}3839static int __init coyote_map_irq(struct pci_dev *dev, u8 slot, u8 pin)40{41if (slot == SLOT0_DEVID)42return IXP4XX_GPIO_IRQ(SLOT0_INTA);43else if (slot == SLOT1_DEVID)44return IXP4XX_GPIO_IRQ(SLOT1_INTA);45else return -1;46}4748struct hw_pci coyote_pci __initdata = {49.nr_controllers = 1,50.preinit = coyote_pci_preinit,51.swizzle = pci_std_swizzle,52.setup = ixp4xx_setup,53.scan = ixp4xx_scan_bus,54.map_irq = coyote_map_irq,55};5657int __init coyote_pci_init(void)58{59if (machine_is_adi_coyote())60pci_common_init(&coyote_pci);61return 0;62}6364subsys_initcall(coyote_pci_init);656667