Path: blob/master/arch/sh/drivers/pci/fixups-dreamcast.c
10819 views
/*1* arch/sh/drivers/pci/fixups-dreamcast.c2*3* PCI fixups for the Sega Dreamcast4*5* Copyright (C) 2001, 2002 M. R. Brown6* Copyright (C) 2002, 2003, 2006 Paul Mundt7*8* This file originally bore the message (with enclosed-$):9* Id: pci.c,v 1.3 2003/05/04 19:29:46 lethal Exp10* Dreamcast PCI: Supports SEGA Broadband Adaptor only.11*12* This file is subject to the terms and conditions of the GNU General Public13* License. See the file "COPYING" in the main directory of this archive14* for more details.15*/1617#include <linux/sched.h>18#include <linux/kernel.h>19#include <linux/param.h>20#include <linux/interrupt.h>21#include <linux/init.h>22#include <linux/irq.h>23#include <linux/pci.h>24#include <linux/dma-mapping.h>2526#include <asm/io.h>27#include <asm/irq.h>28#include <mach/pci.h>2930static void __init gapspci_fixup_resources(struct pci_dev *dev)31{32struct pci_channel *p = dev->sysdata;3334printk(KERN_NOTICE "PCI: Fixing up device %s\n", pci_name(dev));3536switch (dev->device) {37case PCI_DEVICE_ID_SEGA_BBA:38/*39* We also assume that dev->devfn == 040*/41dev->resource[1].start = p->resources[0].start + 0x100;42dev->resource[1].end = dev->resource[1].start + 0x200 - 1;4344/*45* This is not a normal BAR, prevent any attempts to move46* the BAR, as this will result in a bus lock.47*/48dev->resource[1].flags |= IORESOURCE_PCI_FIXED;4950/*51* Redirect dma memory allocations to special memory window.52*/53BUG_ON(!dma_declare_coherent_memory(&dev->dev,54GAPSPCI_DMA_BASE,55GAPSPCI_DMA_BASE,56GAPSPCI_DMA_SIZE,57DMA_MEMORY_MAP |58DMA_MEMORY_EXCLUSIVE));59break;60default:61printk("PCI: Failed resource fixup\n");62}63}64DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, gapspci_fixup_resources);6566int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)67{68/*69* The interrupt routing semantics here are quite trivial.70*71* We basically only support one interrupt, so we only bother72* updating a device's interrupt line with this single shared73* interrupt. Keeps routing quite simple, doesn't it?74*/75return GAPSPCI_IRQ;76}777879