aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/fixups-dreamcast.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/sh/drivers/pci/fixups-dreamcast.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/sh/drivers/pci/fixups-dreamcast.c')
-rw-r--r--arch/sh/drivers/pci/fixups-dreamcast.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/arch/sh/drivers/pci/fixups-dreamcast.c b/arch/sh/drivers/pci/fixups-dreamcast.c
new file mode 100644
index 000000000000..cf30e2fa51be
--- /dev/null
+++ b/arch/sh/drivers/pci/fixups-dreamcast.c
@@ -0,0 +1,81 @@
1/*
2 * arch/sh/pci/fixups-dreamcast.c
3 *
4 * PCI fixups for the Sega Dreamcast
5 *
6 * Copyright (C) 2001, 2002 M. R. Brown
7 * Copyright (C) 2002, 2003 Paul Mundt
8 *
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.
12 *
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
15 * for more details.
16 */
17
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>
26
27#include <asm/io.h>
28#include <asm/irq.h>
29#include <asm/mach/pci.h>
30
31static void __init gapspci_fixup_resources(struct pci_dev *dev)
32{
33 struct pci_channel *p = board_pci_channels;
34
35 printk(KERN_NOTICE "PCI: Fixing up device %s\n", pci_name(dev));
36
37 switch (dev->device) {
38 case PCI_DEVICE_ID_SEGA_BBA:
39 /*
40 * We also assume that dev->devfn == 0
41 */
42 dev->resource[1].start = p->io_resource->start + 0x100;
43 dev->resource[1].end = dev->resource[1].start + 0x200 - 1;
44 break;
45 default:
46 printk("PCI: Failed resource fixup\n");
47 }
48}
49
50DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, gapspci_fixup_resources);
51
52void __init pcibios_fixup_bus(struct pci_bus *bus)
53{
54 /*
55 * We don't have any sub bus to fix up, and this is a rather
56 * stupid place to put general device fixups. Don't do it.
57 * Use the pcibios_fixups table or suffer the consequences.
58 */
59}
60
61void __init pcibios_fixup_irqs(void)
62{
63 struct pci_dev *dev = 0;
64
65 for_each_pci_dev(dev) {
66 /*
67 * The interrupt routing semantics here are quite trivial.
68 *
69 * We basically only support one interrupt, so we only bother
70 * updating a device's interrupt line with this single shared
71 * interrupt. Keeps routing quite simple, doesn't it?
72 */
73 printk(KERN_NOTICE "PCI: Fixing up IRQ routing for device %s\n",
74 pci_name(dev));
75
76 dev->irq = GAPSPCI_IRQ;
77
78 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
79 }
80}
81