Selaa lähdekoodia

[POWERPC] MSI abstraction

Instead of trying to make PPC64 MSI fit in a Intel-centric MSI layer, a
simple short-term solution is to hook the pci_{en/dis}able_msi() calls
and make a machdep call.

The rest of the MSI functions are superfluous for what is needed at this
time.  Many of which can have machdep calls added as needed.

Ben and Michael Ellerman are looking into rewrite the MSI layer to be
more generic.  However, in the meantime this works as a interim
solution.

Signed-off-by: Jake Moilanen <moilanen@austin.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Jake Moilanen 19 vuotta sitten
vanhempi
commit
204face4fb
2 muutettua tiedostoa jossa 30 lisäystä ja 0 poistoa
  1. 25 0
      arch/powerpc/kernel/irq.c
  2. 5 0
      include/asm-powerpc/machdep.h

+ 25 - 0
arch/powerpc/kernel/irq.c

@@ -47,6 +47,7 @@
 #include <linux/cpumask.h>
 #include <linux/cpumask.h>
 #include <linux/profile.h>
 #include <linux/profile.h>
 #include <linux/bitops.h>
 #include <linux/bitops.h>
+#include <linux/pci.h>
 
 
 #include <asm/uaccess.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/system.h>
@@ -436,6 +437,30 @@ void do_softirq(void)
 }
 }
 EXPORT_SYMBOL(do_softirq);
 EXPORT_SYMBOL(do_softirq);
 
 
+#ifdef CONFIG_PCI_MSI
+int pci_enable_msi(struct pci_dev * pdev)
+{
+	if (ppc_md.enable_msi)
+		return ppc_md.enable_msi(pdev);
+	else
+		return -1;
+}
+
+void pci_disable_msi(struct pci_dev * pdev)
+{
+	if (ppc_md.disable_msi)
+		ppc_md.disable_msi(pdev);
+}
+
+void pci_scan_msi_device(struct pci_dev *dev) {}
+int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec) {return -1;}
+void pci_disable_msix(struct pci_dev *dev) {}
+void msi_remove_pci_irq_vectors(struct pci_dev *dev) {}
+void disable_msi_mode(struct pci_dev *dev, int pos, int type) {}
+void pci_no_msi(void) {}
+
+#endif
+
 #ifdef CONFIG_PPC64
 #ifdef CONFIG_PPC64
 static int __init setup_noirqdistrib(char *str)
 static int __init setup_noirqdistrib(char *str)
 {
 {

+ 5 - 0
include/asm-powerpc/machdep.h

@@ -238,6 +238,11 @@ struct machdep_calls {
 	 */
 	 */
 	void (*machine_kexec)(struct kimage *image);
 	void (*machine_kexec)(struct kimage *image);
 #endif /* CONFIG_KEXEC */
 #endif /* CONFIG_KEXEC */
+
+#ifdef CONFIG_PCI_MSI
+	int (*enable_msi)(struct pci_dev *pdev);
+	void (*disable_msi)(struct pci_dev *pdev);
+#endif /* CONFIG_PCI_MSI */
 };
 };
 
 
 extern void power4_idle(void);
 extern void power4_idle(void);