1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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#include <linux/dma-mapping.h>
26
27#include <asm/io.h>
28#include <asm/irq.h>
29#include <mach/pci.h>
30
31static void gapspci_fixup_resources(struct pci_dev *dev)
32{
33 struct pci_channel *p = dev->sysdata;
34 struct resource res;
35 struct pci_bus_region region;
36
37 printk(KERN_NOTICE "PCI: Fixing up device %s\n", pci_name(dev));
38
39 switch (dev->device) {
40 case PCI_DEVICE_ID_SEGA_BBA:
41
42
43
44 dev->resource[1].start = p->resources[0].start + 0x100;
45 dev->resource[1].end = dev->resource[1].start + 0x200 - 1;
46
47
48
49
50
51 dev->resource[1].flags |= IORESOURCE_PCI_FIXED;
52
53
54
55
56
57
58
59
60
61
62 res.start = GAPSPCI_DMA_BASE;
63 res.end = GAPSPCI_DMA_BASE + GAPSPCI_DMA_SIZE - 1;
64 res.flags = IORESOURCE_MEM;
65 pcibios_resource_to_bus(dev->bus, ®ion, &res);
66 BUG_ON(dma_declare_coherent_memory(&dev->dev,
67 res.start,
68 region.start,
69 resource_size(&res),
70 DMA_MEMORY_EXCLUSIVE));
71 break;
72 default:
73 printk("PCI: Failed resource fixup\n");
74 }
75}
76DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, gapspci_fixup_resources);
77
78int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
79{
80
81
82
83
84
85
86
87 return GAPSPCI_IRQ;
88}
89