aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/drivers/pci')
-rw-r--r--arch/sh/drivers/pci/Makefile3
-rw-r--r--arch/sh/drivers/pci/ops-r7780rp.c37
-rw-r--r--arch/sh/drivers/pci/pci-sh4.h2
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c17
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.h3
5 files changed, 45 insertions, 17 deletions
diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile
index cc8d0d0b1427..8a7e70651939 100644
--- a/arch/sh/drivers/pci/Makefile
+++ b/arch/sh/drivers/pci/Makefile
@@ -8,12 +8,13 @@ obj-$(CONFIG_PCI_AUTO) += pci-auto.o
8obj-$(CONFIG_CPU_SUBTYPE_ST40STB1) += pci-st40.o 8obj-$(CONFIG_CPU_SUBTYPE_ST40STB1) += pci-st40.o
9obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o 9obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o
10obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o 10obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o
11obj-$(CONFIG_CPU_SUBTYPE_SH7785) += pci-sh7780.o ops-sh4.o
11 12
12obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \ 13obj-$(CONFIG_SH_DREAMCAST) += ops-dreamcast.o fixups-dreamcast.o \
13 dma-dreamcast.o 14 dma-dreamcast.o
14obj-$(CONFIG_SH_SECUREEDGE5410) += ops-snapgear.o 15obj-$(CONFIG_SH_SECUREEDGE5410) += ops-snapgear.o
15obj-$(CONFIG_SH_RTS7751R2D) += ops-rts7751r2d.o fixups-rts7751r2d.o 16obj-$(CONFIG_SH_RTS7751R2D) += ops-rts7751r2d.o fixups-rts7751r2d.o
16obj-$(CONFIG_SH_SH03) += ops-sh03.o fixups-sh03.o 17obj-$(CONFIG_SH_SH03) += ops-sh03.o fixups-sh03.o
17obj-$(CONFIG_SH_R7780RP) += ops-r7780rp.o fixups-r7780rp.o 18obj-$(CONFIG_SH_HIGHLANDER) += ops-r7780rp.o fixups-r7780rp.o
18obj-$(CONFIG_SH_TITAN) += ops-titan.o 19obj-$(CONFIG_SH_TITAN) += ops-titan.o
19obj-$(CONFIG_SH_LANDISK) += ops-landisk.o 20obj-$(CONFIG_SH_LANDISK) += ops-landisk.o
diff --git a/arch/sh/drivers/pci/ops-r7780rp.c b/arch/sh/drivers/pci/ops-r7780rp.c
index eeea1577e112..6f4fb38bafa2 100644
--- a/arch/sh/drivers/pci/ops-r7780rp.c
+++ b/arch/sh/drivers/pci/ops-r7780rp.c
@@ -17,18 +17,35 @@
17#include <asm/io.h> 17#include <asm/io.h>
18#include "pci-sh4.h" 18#include "pci-sh4.h"
19 19
20static char r7780rp_irq_tab[] __initdata = {
21 0, 1, 2, 3,
22};
23
24static char r7780mp_irq_tab[] __initdata = {
25 65, 66, 67, 68,
26};
27
28static char r7785rp_irq_tab[][4] __initdata = {
29 { 65, 66, 67, 68 }, /* INT ABCD */
30 { 66, 67, 68, 65 }, /* INT BCDA */
31 { 67, 68, 65, 66 }, /* INT CDAB */
32 { 68, 65, 66, 67 }, /* INT DABC */
33 { 64, 64, 64, 64 }, /* PCI Host */
34};
35
20int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) 36int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
21{ 37{
22 switch (slot) { 38 if (mach_is_r7780rp())
23 case 0: return IRQ_PCISLOT1; /* PCI Interrupt #1 */ 39 return r7780rp_irq_tab[slot];
24 case 1: return IRQ_PCISLOT2; /* PCI Interrupt #2 */ 40 if (mach_is_r7780mp())
25 case 2: return IRQ_PCISLOT3; /* PCI Interrupt #3 */ 41 return r7780mp_irq_tab[slot];
26 case 3: return IRQ_PCISLOT4; /* PCI Interrupt E4 */ 42 if (mach_is_r7785rp())
27 default: 43 return r7785rp_irq_tab[slot][pin];
28 printk(KERN_ERR "PCI: Bad IRQ mapping " 44
29 "request for slot %d, func %d\n", slot, pin-1); 45 printk(KERN_ERR "PCI: Bad IRQ mapping "
30 return -1; 46 "request for slot %d, func %d\n", slot, pin-1);
31 } 47
48 return -1;
32} 49}
33 50
34static struct resource sh7780_io_resource = { 51static struct resource sh7780_io_resource = {
diff --git a/arch/sh/drivers/pci/pci-sh4.h b/arch/sh/drivers/pci/pci-sh4.h
index 5a61d6041f2c..1901c33cde6a 100644
--- a/arch/sh/drivers/pci/pci-sh4.h
+++ b/arch/sh/drivers/pci/pci-sh4.h
@@ -1,7 +1,7 @@
1#ifndef __PCI_SH4_H 1#ifndef __PCI_SH4_H
2#define __PCI_SH4_H 2#define __PCI_SH4_H
3 3
4#ifdef CONFIG_CPU_SUBTYPE_SH7780 4#if defined(CONFIG_CPU_SUBTYPE_SH7780) || defined(CONFIG_CPU_SUBTYPE_SH7785)
5#include "pci-sh7780.h" 5#include "pci-sh7780.h"
6#else 6#else
7#include "pci-sh7751.h" 7#include "pci-sh7751.h"
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index 602b644c35ad..16b30a9e94bb 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -48,7 +48,7 @@
48static int __init sh7780_pci_init(void) 48static int __init sh7780_pci_init(void)
49{ 49{
50 unsigned int id; 50 unsigned int id;
51 int ret; 51 int ret, match = 0;
52 52
53 pr_debug("PCI: Starting intialization.\n"); 53 pr_debug("PCI: Starting intialization.\n");
54 54
@@ -56,8 +56,17 @@ static int __init sh7780_pci_init(void)
56 56
57 /* check for SH7780/SH7780R hardware */ 57 /* check for SH7780/SH7780R hardware */
58 id = pci_read_reg(SH7780_PCIVID); 58 id = pci_read_reg(SH7780_PCIVID);
59 if ((id != ((SH7780_DEVICE_ID << 16) | SH7780_VENDOR_ID)) && 59 if ((id & 0xffff) == SH7780_VENDOR_ID) {
60 (id != ((SH7781_DEVICE_ID << 16) | SH7780_VENDOR_ID))) { 60 switch ((id >> 16) & 0xffff) {
61 case SH7780_DEVICE_ID:
62 case SH7781_DEVICE_ID:
63 case SH7785_DEVICE_ID:
64 match = 1;
65 break;
66 }
67 }
68
69 if (unlikely(!match)) {
61 printk(KERN_ERR "PCI: This is not an SH7780 (%x)\n", id); 70 printk(KERN_ERR "PCI: This is not an SH7780 (%x)\n", id);
62 return -ENODEV; 71 return -ENODEV;
63 } 72 }
@@ -138,7 +147,7 @@ int __init sh7780_pcic_init(struct sh4_pci_address_map *map)
138 * DMA interrupts... 147 * DMA interrupts...
139 */ 148 */
140 149
141#ifdef CONFIG_SH_R7780RP 150#ifdef CONFIG_SH_HIGHLANDER
142 pci_fixup_pcic(); 151 pci_fixup_pcic();
143#endif 152#endif
144 153
diff --git a/arch/sh/drivers/pci/pci-sh7780.h b/arch/sh/drivers/pci/pci-sh7780.h
index f02d2180a4bc..bd44255509e6 100644
--- a/arch/sh/drivers/pci/pci-sh7780.h
+++ b/arch/sh/drivers/pci/pci-sh7780.h
@@ -14,8 +14,9 @@
14 14
15/* Platform Specific Values */ 15/* Platform Specific Values */
16#define SH7780_VENDOR_ID 0x1912 16#define SH7780_VENDOR_ID 0x1912
17#define SH7780_DEVICE_ID 0x0002
18#define SH7781_DEVICE_ID 0x0001 17#define SH7781_DEVICE_ID 0x0001
18#define SH7780_DEVICE_ID 0x0002
19#define SH7785_DEVICE_ID 0x0007
19 20
20/* SH7780 Control Registers */ 21/* SH7780 Control Registers */
21#define SH7780_PCI_VCR0 0xFE000000 22#define SH7780_PCI_VCR0 0xFE000000