Commit 2b8ff9f2 authored by Matthew Minter's avatar Matthew Minter Committed by Bjorn Helgaas

sh/PCI: Remove __init optimisations from IRQ mapping functions/data

Currently many IRQ mapping functions and data structures use the __init and
__initdata optimisations. These result in the relevant functions being
innaccessible after boot time.

However for deferred IRQ assignment it is important to have access to these
functions at PCI device enable time.

Therefore, remove the optimisation from the relevant data structures and
functions to prepare for deferred IRQ assignment.
Signed-off-by: default avatarMatthew Minter <matt@masarand.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
parent 902d886d
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <cpu/irq.h> #include <cpu/irq.h>
#include "pci-sh5.h" #include "pci-sh5.h"
int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{ {
int result = -1; int result = -1;
......
...@@ -76,7 +76,7 @@ static void gapspci_fixup_resources(struct pci_dev *dev) ...@@ -76,7 +76,7 @@ static void gapspci_fixup_resources(struct pci_dev *dev)
} }
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, gapspci_fixup_resources); DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, gapspci_fixup_resources);
int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{ {
/* /*
* The interrupt routing semantics here are quite trivial. * The interrupt routing semantics here are quite trivial.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
#include "pci-sh4.h" #include "pci-sh4.h"
int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{ {
return evt2irq(0xa20) + slot; return evt2irq(0xa20) + slot;
} }
...@@ -20,18 +20,18 @@ ...@@ -20,18 +20,18 @@
#define PCIMCR_MRSET_OFF 0xBFFFFFFF #define PCIMCR_MRSET_OFF 0xBFFFFFFF
#define PCIMCR_RFSH_OFF 0xFFFFFFFB #define PCIMCR_RFSH_OFF 0xFFFFFFFB
static u8 rts7751r2d_irq_tab[] __initdata = { static u8 rts7751r2d_irq_tab[] = {
IRQ_PCI_INTA, IRQ_PCI_INTA,
IRQ_PCI_INTB, IRQ_PCI_INTB,
IRQ_PCI_INTC, IRQ_PCI_INTC,
IRQ_PCI_INTD, IRQ_PCI_INTD,
}; };
static char lboxre2_irq_tab[] __initdata = { static char lboxre2_irq_tab[] = {
IRQ_ETH0, IRQ_ETH1, IRQ_INTA, IRQ_INTD, IRQ_ETH0, IRQ_ETH1, IRQ_INTA, IRQ_INTD,
}; };
int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{ {
if (mach_is_lboxre2()) if (mach_is_lboxre2())
return lboxre2_irq_tab[slot]; return lboxre2_irq_tab[slot];
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define IRQ_INTD evt2irq(0xa80) #define IRQ_INTD evt2irq(0xa80)
/* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */ /* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */
static char sdk7780_irq_tab[4][16] __initdata = { static char sdk7780_irq_tab[4][16] = {
/* INTA */ /* INTA */
{ IRQ_INTA, IRQ_INTD, IRQ_INTC, IRQ_INTD, -1, -1, -1, -1, -1, -1, { IRQ_INTA, IRQ_INTD, IRQ_INTC, IRQ_INTD, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1 }, -1, -1, -1, -1, -1, -1 },
...@@ -37,7 +37,7 @@ static char sdk7780_irq_tab[4][16] __initdata = { ...@@ -37,7 +37,7 @@ static char sdk7780_irq_tab[4][16] __initdata = {
-1, -1, -1 }, -1, -1, -1 },
}; };
int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{ {
return sdk7780_irq_tab[pin-1][slot]; return sdk7780_irq_tab[pin-1][slot];
} }
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
#include "pci-sh4.h" #include "pci-sh4.h"
int __init pcibios_map_platform_irq(const struct pci_dev *, u8 slot, u8 pin) int pcibios_map_platform_irq(const struct pci_dev *, u8 slot, u8 pin)
{ {
switch (slot) { switch (slot) {
case 0: return evt2irq(0x3a0); case 0: return evt2irq(0x3a0);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{ {
int irq; int irq;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
#include "pci-sh4.h" #include "pci-sh4.h"
int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{ {
int irq = -1; int irq = -1;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <mach/titan.h> #include <mach/titan.h>
#include "pci-sh4.h" #include "pci-sh4.h"
static char titan_irq_tab[] __initdata = { static char titan_irq_tab[] = {
TITAN_IRQ_WAN, TITAN_IRQ_WAN,
TITAN_IRQ_LAN, TITAN_IRQ_LAN,
TITAN_IRQ_MPCIA, TITAN_IRQ_MPCIA,
...@@ -27,7 +27,7 @@ static char titan_irq_tab[] __initdata = { ...@@ -27,7 +27,7 @@ static char titan_irq_tab[] __initdata = {
TITAN_IRQ_USB, TITAN_IRQ_USB,
}; };
int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{ {
int irq = titan_irq_tab[slot]; int irq = titan_irq_tab[slot];
......
...@@ -467,7 +467,7 @@ static int __init pcie_init(struct sh7786_pcie_port *port) ...@@ -467,7 +467,7 @@ static int __init pcie_init(struct sh7786_pcie_port *port)
return 0; return 0;
} }
int __init pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin) int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
{ {
return evt2irq(0xae0); return evt2irq(0xae0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment