| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
| Uwe Zeisberger | f30c226 | 2006-10-03 23:01:26 +0200 | [diff] [blame] | 2 | * arch/sh/drivers/pci/fixups-dreamcast.c | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * | 
|  | 4 | * PCI fixups for the Sega Dreamcast | 
|  | 5 | * | 
|  | 6 | * Copyright (C) 2001, 2002  M. R. Brown | 
| Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 7 | * Copyright (C) 2002, 2003, 2006  Paul Mundt | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <linux/sched.h> | 
|  | 19 | #include <linux/kernel.h> | 
|  | 20 | #include <linux/param.h> | 
|  | 21 | #include <linux/interrupt.h> | 
|  | 22 | #include <linux/init.h> | 
|  | 23 | #include <linux/irq.h> | 
|  | 24 | #include <linux/pci.h> | 
|  | 25 |  | 
|  | 26 | #include <asm/io.h> | 
|  | 27 | #include <asm/irq.h> | 
|  | 28 | #include <asm/mach/pci.h> | 
|  | 29 |  | 
|  | 30 | static void __init gapspci_fixup_resources(struct pci_dev *dev) | 
|  | 31 | { | 
|  | 32 | struct pci_channel *p = board_pci_channels; | 
|  | 33 |  | 
|  | 34 | printk(KERN_NOTICE "PCI: Fixing up device %s\n", pci_name(dev)); | 
|  | 35 |  | 
|  | 36 | switch (dev->device) { | 
|  | 37 | case PCI_DEVICE_ID_SEGA_BBA: | 
|  | 38 | /* | 
|  | 39 | * We also assume that dev->devfn == 0 | 
|  | 40 | */ | 
|  | 41 | dev->resource[1].start	= p->io_resource->start  + 0x100; | 
|  | 42 | dev->resource[1].end	= dev->resource[1].start + 0x200 - 1; | 
|  | 43 | break; | 
|  | 44 | default: | 
|  | 45 | printk("PCI: Failed resource fixup\n"); | 
|  | 46 | } | 
|  | 47 | } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, gapspci_fixup_resources); | 
|  | 49 |  | 
| Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 50 | int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | { | 
| Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 52 | /* | 
|  | 53 | * The interrupt routing semantics here are quite trivial. | 
|  | 54 | * | 
|  | 55 | * We basically only support one interrupt, so we only bother | 
|  | 56 | * updating a device's interrupt line with this single shared | 
|  | 57 | * interrupt. Keeps routing quite simple, doesn't it? | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | */ | 
| Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 59 | return GAPSPCI_IRQ; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | } |