Path: blob/master/arch/arm/mach-ixp4xx/gtwx5715-pci.c
10817 views
/*1* arch/arm/mach-ixp4xx/gtwx5715-pci.c2*3* Gemtek GTWX5715 (Linksys WRV54G) board setup4*5* Copyright (C) 2004 George T. Joseph6* Derived from Coyote7*8* This program is free software; you can redistribute it and/or9* modify it under the terms of the GNU General Public License10* as published by the Free Software Foundation; either version 211* of the License, or (at your option) any later version.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.21*22*/2324#include <linux/pci.h>25#include <linux/init.h>26#include <linux/delay.h>27#include <linux/irq.h>28#include <asm/mach-types.h>29#include <mach/hardware.h>30#include <asm/mach/pci.h>3132#define SLOT0_DEVID 033#define SLOT1_DEVID 134#define INTA 10 /* slot 1 has INTA and INTB crossed */35#define INTB 113637/*38* Slot 0 isn't actually populated with a card connector but39* we initialize it anyway in case a future version has the40* slot populated or someone with good soldering skills has41* some free time.42*/43void __init gtwx5715_pci_preinit(void)44{45irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);46irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);47ixp4xx_pci_preinit();48}495051static int __init gtwx5715_map_irq(struct pci_dev *dev, u8 slot, u8 pin)52{53int rc = -1;5455if ((slot == SLOT0_DEVID && pin == 1) ||56(slot == SLOT1_DEVID && pin == 2))57rc = IXP4XX_GPIO_IRQ(INTA);58else if ((slot == SLOT0_DEVID && pin == 2) ||59(slot == SLOT1_DEVID && pin == 1))60rc = IXP4XX_GPIO_IRQ(INTB);6162printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n",63__func__, slot, pin, rc);64return rc;65}6667struct hw_pci gtwx5715_pci __initdata = {68.nr_controllers = 1,69.preinit = gtwx5715_pci_preinit,70.swizzle = pci_std_swizzle,71.setup = ixp4xx_setup,72.scan = ixp4xx_scan_bus,73.map_irq = gtwx5715_map_irq,74};7576int __init gtwx5715_pci_init(void)77{78if (machine_is_gtwx5715())79pci_common_init(>wx5715_pci);8081return 0;82}8384subsys_initcall(gtwx5715_pci_init);858687