aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-05-18 04:42:29 -0400
committerPaul Mundt <lethal@linux-sh.org>2012-05-18 04:42:29 -0400
commit58796ce67a80e8725220af83c5a550bf6a4dab12 (patch)
tree393e6f0f97b1f8bc6c6b1f8e9494282e4c91dcd2 /arch/sh/drivers
parent9f38045643859bed21068e8a7b868c961091065e (diff)
sh: legacy PCI evt2irq migration.
This converts over the legacy PCI IRQs to evt2irq() backed hwirq lookups. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers')
-rw-r--r--arch/sh/drivers/pci/fixups-landisk.c3
-rw-r--r--arch/sh/drivers/pci/fixups-r7780rp.c7
-rw-r--r--arch/sh/drivers/pci/fixups-sdk7780.c18
-rw-r--r--arch/sh/drivers/pci/fixups-se7751.c5
-rw-r--r--arch/sh/drivers/pci/fixups-sh03.c19
-rw-r--r--arch/sh/drivers/pci/fixups-snapgear.c11
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.c3
7 files changed, 39 insertions, 27 deletions
diff --git a/arch/sh/drivers/pci/fixups-landisk.c b/arch/sh/drivers/pci/fixups-landisk.c
index ecb1d1060638..db5b40a98e62 100644
--- a/arch/sh/drivers/pci/fixups-landisk.c
+++ b/arch/sh/drivers/pci/fixups-landisk.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/pci.h> 16#include <linux/pci.h>
17#include <linux/sh_intc.h>
17#include "pci-sh4.h" 18#include "pci-sh4.h"
18 19
19#define PCIMCR_MRSET_OFF 0xBFFFFFFF 20#define PCIMCR_MRSET_OFF 0xBFFFFFFF
@@ -27,7 +28,7 @@ int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
27 * slot2: pin1-4 = irq7,8,5,6 28 * slot2: pin1-4 = irq7,8,5,6
28 * slot3: pin1-4 = irq8,5,6,7 29 * slot3: pin1-4 = irq8,5,6,7
29 */ 30 */
30 int irq = ((slot + pin - 1) & 0x3) + 5; 31 int irq = ((slot + pin - 1) & 0x3) + evt2irq(0x2a0);
31 32
32 if ((slot | (pin - 1)) > 0x3) { 33 if ((slot | (pin - 1)) > 0x3) {
33 printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n", 34 printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n",
diff --git a/arch/sh/drivers/pci/fixups-r7780rp.c b/arch/sh/drivers/pci/fixups-r7780rp.c
index f9370dce0b70..57ed3f09d0c2 100644
--- a/arch/sh/drivers/pci/fixups-r7780rp.c
+++ b/arch/sh/drivers/pci/fixups-r7780rp.c
@@ -12,13 +12,10 @@
12 */ 12 */
13#include <linux/pci.h> 13#include <linux/pci.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/sh_intc.h>
15#include "pci-sh4.h" 16#include "pci-sh4.h"
16 17
17static char irq_tab[] __initdata = {
18 65, 66, 67, 68,
19};
20
21int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) 18int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
22{ 19{
23 return irq_tab[slot]; 20 return evt2irq(0xa20) + slot;
24} 21}
diff --git a/arch/sh/drivers/pci/fixups-sdk7780.c b/arch/sh/drivers/pci/fixups-sdk7780.c
index 0b8472501b88..c0a015ae6ecf 100644
--- a/arch/sh/drivers/pci/fixups-sdk7780.c
+++ b/arch/sh/drivers/pci/fixups-sdk7780.c
@@ -13,18 +13,28 @@
13 */ 13 */
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/sh_intc.h>
16#include "pci-sh4.h" 17#include "pci-sh4.h"
17 18
19#define IRQ_INTA evt2irq(0xa20)
20#define IRQ_INTB evt2irq(0xa40)
21#define IRQ_INTC evt2irq(0xa60)
22#define IRQ_INTD evt2irq(0xa80)
23
18/* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */ 24/* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */
19static char sdk7780_irq_tab[4][16] __initdata = { 25static char sdk7780_irq_tab[4][16] __initdata = {
20 /* INTA */ 26 /* INTA */
21 { 65, 68, 67, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, 27 { IRQ_INTA, IRQ_INTD, IRQ_INTC, IRQ_INTD, -1, -1, -1, -1, -1, -1,
28 -1, -1, -1, -1, -1, -1 },
22 /* INTB */ 29 /* INTB */
23 { 66, 65, -1, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, 30 { IRQ_INTB, IRQ_INTA, -1, IRQ_INTA, -1, -1, -1, -1, -1, -1, -1, -1,
31 -1, -1, -1, -1 },
24 /* INTC */ 32 /* INTC */
25 { 67, 66, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, 33 { IRQ_INTC, IRQ_INTB, -1, IRQ_INTB, -1, -1, -1, -1, -1, -1, -1, -1,
34 -1, -1, -1, -1 },
26 /* INTD */ 35 /* INTD */
27 { 68, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, 36 { IRQ_INTD, IRQ_INTC, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
37 -1, -1, -1 },
28}; 38};
29 39
30int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) 40int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
diff --git a/arch/sh/drivers/pci/fixups-se7751.c b/arch/sh/drivers/pci/fixups-se7751.c
index 2ec146c3fa44..84a88ca92008 100644
--- a/arch/sh/drivers/pci/fixups-se7751.c
+++ b/arch/sh/drivers/pci/fixups-se7751.c
@@ -4,13 +4,14 @@
4#include <linux/delay.h> 4#include <linux/delay.h>
5#include <linux/pci.h> 5#include <linux/pci.h>
6#include <linux/io.h> 6#include <linux/io.h>
7#include <linux/sh_intc.h>
7#include "pci-sh4.h" 8#include "pci-sh4.h"
8 9
9int __init pcibios_map_platform_irq(const struct pci_dev *, u8 slot, u8 pin) 10int __init pcibios_map_platform_irq(const struct pci_dev *, u8 slot, u8 pin)
10{ 11{
11 switch (slot) { 12 switch (slot) {
12 case 0: return 13; 13 case 0: return evt2irq(0x3a0);
13 case 1: return 13; /* AMD Ethernet controller */ 14 case 1: return evt2irq(0x3a0); /* AMD Ethernet controller */
14 case 2: return -1; 15 case 2: return -1;
15 case 3: return -1; 16 case 3: return -1;
16 case 4: return -1; 17 case 4: return -1;
diff --git a/arch/sh/drivers/pci/fixups-sh03.c b/arch/sh/drivers/pci/fixups-sh03.c
index 1615e5906168..16207bef9f52 100644
--- a/arch/sh/drivers/pci/fixups-sh03.c
+++ b/arch/sh/drivers/pci/fixups-sh03.c
@@ -2,6 +2,7 @@
2#include <linux/init.h> 2#include <linux/init.h>
3#include <linux/types.h> 3#include <linux/types.h>
4#include <linux/pci.h> 4#include <linux/pci.h>
5#include <linux/sh_intc.h>
5 6
6int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) 7int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
7{ 8{
@@ -9,21 +10,21 @@ int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
9 10
10 if (dev->bus->number == 0) { 11 if (dev->bus->number == 0) {
11 switch (slot) { 12 switch (slot) {
12 case 4: return 5; /* eth0 */ 13 case 4: return evt2irq(0x2a0); /* eth0 */
13 case 8: return 5; /* eth1 */ 14 case 8: return evt2irq(0x2a0); /* eth1 */
14 case 6: return 2; /* PCI bridge */ 15 case 6: return evt2irq(0x240); /* PCI bridge */
15 default: 16 default:
16 printk(KERN_ERR "PCI: Bad IRQ mapping request " 17 printk(KERN_ERR "PCI: Bad IRQ mapping request "
17 "for slot %d\n", slot); 18 "for slot %d\n", slot);
18 return 2; 19 return evt2irq(0x240);
19 } 20 }
20 } else { 21 } else {
21 switch (pin) { 22 switch (pin) {
22 case 0: irq = 2; break; 23 case 0: irq = evt2irq(0x240); break;
23 case 1: irq = 2; break; 24 case 1: irq = evt2irq(0x240); break;
24 case 2: irq = 2; break; 25 case 2: irq = evt2irq(0x240); break;
25 case 3: irq = 2; break; 26 case 3: irq = evt2irq(0x240); break;
26 case 4: irq = 2; break; 27 case 4: irq = evt2irq(0x240); break;
27 default: irq = -1; break; 28 default: irq = -1; break;
28 } 29 }
29 } 30 }
diff --git a/arch/sh/drivers/pci/fixups-snapgear.c b/arch/sh/drivers/pci/fixups-snapgear.c
index 4a093c648d12..6e33ba4cd076 100644
--- a/arch/sh/drivers/pci/fixups-snapgear.c
+++ b/arch/sh/drivers/pci/fixups-snapgear.c
@@ -16,6 +16,7 @@
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/pci.h> 18#include <linux/pci.h>
19#include <linux/sh_intc.h>
19#include "pci-sh4.h" 20#include "pci-sh4.h"
20 21
21int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) 22int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
@@ -24,11 +25,11 @@ int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
24 25
25 switch (slot) { 26 switch (slot) {
26 case 8: /* the PCI bridge */ break; 27 case 8: /* the PCI bridge */ break;
27 case 11: irq = 8; break; /* USB */ 28 case 11: irq = evt2irq(0x300); break; /* USB */
28 case 12: irq = 11; break; /* PCMCIA */ 29 case 12: irq = evt2irq(0x360); break; /* PCMCIA */
29 case 13: irq = 5; break; /* eth0 */ 30 case 13: irq = evt2irq(0x2a0); break; /* eth0 */
30 case 14: irq = 8; break; /* eth1 */ 31 case 14: irq = evt2irq(0x300); break; /* eth1 */
31 case 15: irq = 11; break; /* safenet (unused) */ 32 case 15: irq = evt2irq(0x360); break; /* safenet (unused) */
32 } 33 }
33 34
34 printk("PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n", 35 printk("PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n",
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index 4df27c4fbf99..c045142f7338 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -18,6 +18,7 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sh_clk.h> 20#include <linux/sh_clk.h>
21#include <linux/sh_intc.h>
21#include "pcie-sh7786.h" 22#include "pcie-sh7786.h"
22#include <asm/sizes.h> 23#include <asm/sizes.h>
23 24
@@ -468,7 +469,7 @@ static int __init pcie_init(struct sh7786_pcie_port *port)
468 469
469int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) 470int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
470{ 471{
471 return 71; 472 return evt2irq(0xae0);
472} 473}
473 474
474static int __init sh7786_pcie_core_init(void) 475static int __init sh7786_pcie_core_init(void)