aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/ops-landisk.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 03:43:28 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 03:43:28 -0400
commit959f85f8a3223c116bbe95dd8a9b207790b5d4d3 (patch)
treee7da9ccf292f860bfa0ff9cc8b2682cd1d6bad4d /arch/sh/drivers/pci/ops-landisk.c
parente108b2ca2349f510ce7d7f910eda89f71d710d84 (diff)
sh: Consolidated SH7751/SH7780 PCI support.
This cleans up quite a lot of the PCI mess that we currently have, and attempts to consolidate the duplication in the SH7780 and SH7751 PCI controllers. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers/pci/ops-landisk.c')
-rw-r--r--arch/sh/drivers/pci/ops-landisk.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/arch/sh/drivers/pci/ops-landisk.c b/arch/sh/drivers/pci/ops-landisk.c
new file mode 100644
index 000000000000..ada301c21fe7
--- /dev/null
+++ b/arch/sh/drivers/pci/ops-landisk.c
@@ -0,0 +1,68 @@
1/*
2 * arch/sh/drivers/pci/ops-landisk.c
3 *
4 * PCI initialization for the I-O DATA Device, Inc. LANDISK board
5 *
6 * Copyright (C) 2006 kogiidena
7 *
8 * May be copied or modified under the terms of the GNU General Public
9 * License. See linux/COPYING for more information.
10 */
11#include <linux/config.h>
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/init.h>
15#include <linux/delay.h>
16#include <linux/pci.h>
17#include "pci-sh4.h"
18
19static struct resource sh7751_io_resource = {
20 .name = "SH7751 IO",
21 .start = 0x4000,
22 .end = 0x4000 + SH7751_PCI_IO_SIZE - 1,
23 .flags = IORESOURCE_IO
24};
25
26static struct resource sh7751_mem_resource = {
27 .name = "SH7751 mem",
28 .start = SH7751_PCI_MEMORY_BASE,
29 .end = SH7751_PCI_MEMORY_BASE + SH7751_PCI_MEM_SIZE - 1,
30 .flags = IORESOURCE_MEM
31};
32
33struct pci_channel board_pci_channels[] = {
34 {&sh4_pci_ops, &sh7751_io_resource, &sh7751_mem_resource, 0, 0x3ff},
35 {NULL, NULL, NULL, 0, 0},
36};
37
38static struct sh4_pci_address_map sh7751_pci_map = {
39 .window0 = {
40 .base = SH7751_CS3_BASE_ADDR,
41 .size = (64 << 20), /* 64MB */
42 },
43
44 .flags = SH4_PCIC_NO_RESET,
45};
46
47int __init pcibios_init_platform(void)
48{
49 return sh7751_pcic_init(&sh7751_pci_map);
50}
51
52int pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
53{
54 /*
55 * slot0: pin1-4 = irq5,6,7,8
56 * slot1: pin1-4 = irq6,7,8,5
57 * slot2: pin1-4 = irq7,8,5,6
58 * slot3: pin1-4 = irq8,5,6,7
59 */
60 int irq = ((slot + pin - 1) & 0x3) + 5;
61
62 if ((slot | (pin - 1)) > 0x3) {
63 printk("PCI: Bad IRQ mapping request for slot %d pin %c\n",
64 slot, pin - 1 + 'A');
65 return -1;
66 }
67 return irq;
68}