2 * arch/sh/pci/fixups-dreamcast.c
4 * PCI fixups for the Sega Dreamcast
6 * Copyright (C) 2001, 2002 M. R. Brown
7 * Copyright (C) 2002, 2003 Paul Mundt
9 * This file originally bore the message (with enclosed-$):
10 * Id: pci.c,v 1.3 2003/05/04 19:29:46 lethal Exp
11 * Dreamcast PCI: Supports SEGA Broadband Adaptor only.
13 * This file is subject to the terms and conditions of the GNU General Public
14 * License. See the file "COPYING" in the main directory of this archive
18 #include <linux/config.h>
19 #include <linux/sched.h>
20 #include <linux/kernel.h>
21 #include <linux/param.h>
22 #include <linux/interrupt.h>
23 #include <linux/init.h>
24 #include <linux/irq.h>
25 #include <linux/pci.h>
29 #include <asm/mach/pci.h>
31 static void __init gapspci_fixup_resources(struct pci_dev *dev)
33 struct pci_channel *p = board_pci_channels;
35 printk(KERN_NOTICE "PCI: Fixing up device %s\n", pci_name(dev));
37 switch (dev->device) {
38 case PCI_DEVICE_ID_SEGA_BBA:
40 * We also assume that dev->devfn == 0
42 dev->resource[1].start = p->io_resource->start + 0x100;
43 dev->resource[1].end = dev->resource[1].start + 0x200 - 1;
46 printk("PCI: Failed resource fixup\n");
50 struct pci_fixup pcibios_fixups[] = {
51 { PCI_FIXUP_HEADER, PCI_ANY_ID,
52 PCI_ANY_ID, gapspci_fixup_resources },
56 void __init pcibios_fixup_bus(struct pci_bus *bus)
59 * We don't have any sub bus to fix up, and this is a rather
60 * stupid place to put general device fixups. Don't do it.
61 * Use the pcibios_fixups table or suffer the consequences.
65 void __init pcibios_fixup_irqs(void)
67 struct pci_dev *dev = 0;
69 while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
71 * The interrupt routing semantics here are quite trivial.
73 * We basically only support one interrupt, so we only bother
74 * updating a device's interrupt line with this single shared
75 * interrupt. Keeps routing quite simple, doesn't it?
77 printk(KERN_NOTICE "PCI: Fixing up IRQ routing for device %s\n",
80 dev->irq = GAPSPCI_IRQ;
82 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);