Path: blob/master/arch/arm/mach-ixp4xx/vulcan-pci.c
10817 views
/*1* arch/arch/mach-ixp4xx/vulcan-pci.c2*3* Vulcan board-level PCI initialization4*5* Copyright (C) 2010 Marc Zyngier <[email protected]>6*7* based on ixdp425-pci.c:8* Copyright (C) 2002 Intel Corporation.9* Copyright (C) 2003-2004 MontaVista Software, Inc.10*11* This program is free software; you can redistribute it and/or modify12* it under the terms of the GNU General Public License version 2 as13* published by the Free Software Foundation.14*15*/1617#include <linux/pci.h>18#include <linux/init.h>19#include <linux/irq.h>20#include <asm/mach/pci.h>21#include <asm/mach-types.h>2223/* PCI controller GPIO to IRQ pin mappings */24#define INTA 225#define INTB 32627void __init vulcan_pci_preinit(void)28{29#ifndef CONFIG_IXP4XX_INDIRECT_PCI30/*31* Cardbus bridge wants way more than the SoC can actually offer,32* and leaves the whole PCI bus in a mess. Artificially limit it33* to 8MB per region. Of course indirect mode doesn't have this34* limitation...35*/36pci_cardbus_mem_size = SZ_8M;37pr_info("Vulcan PCI: limiting CardBus memory size to %dMB\n",38(int)(pci_cardbus_mem_size >> 20));39#endif40irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);41irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);42ixp4xx_pci_preinit();43}4445static int __init vulcan_map_irq(struct pci_dev *dev, u8 slot, u8 pin)46{47if (slot == 1)48return IXP4XX_GPIO_IRQ(INTA);4950if (slot == 2)51return IXP4XX_GPIO_IRQ(INTB);5253return -1;54}5556struct hw_pci vulcan_pci __initdata = {57.nr_controllers = 1,58.preinit = vulcan_pci_preinit,59.swizzle = pci_std_swizzle,60.setup = ixp4xx_setup,61.scan = ixp4xx_scan_bus,62.map_irq = vulcan_map_irq,63};6465int __init vulcan_pci_init(void)66{67if (machine_is_arcom_vulcan())68pci_common_init(&vulcan_pci);69return 0;70}7172subsys_initcall(vulcan_pci_init);737475