Skip to contentSkip to conversation

Powerpc MSI support via RTAS

PATCH In review Michael Ellerman 1 participant 1 message Aug 18, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/4 Powerpc MSI support via RTAS

Powerpc MSI support via RTAS. Based on Jake's code, reworked to:
* only ever set 1 MSI.
* implement disable, we can't do without it.
* bork if firmware enables MSI-X on us, that's not ok.
* more error handling.

NOT tested. Mainline apparently isn't booting atm on the machines that have the required firmware :/

---

 arch/powerpc/platforms/pseries/setup.c |    1 
 drivers/pci/Makefile                   |    1 
 drivers/pci/msi-rtas.c                 |  199 +++++++++++++++++++++++++++++++++
 include/asm-powerpc/pci-bridge.h       |    3 
 include/asm-powerpc/rtas.h             |    6 
 5 files changed, 210 insertions(+)
arch/powerpc/platforms/pseries/setup.c +1 -0
Index: git/arch/powerpc/platforms/pseries/setup.c
===================================================================
@@ -273,6 +273,7 @@ static void __init pseries_discover_pic(
 			return;
 		} else if (strstr(typep, "ppc-xicp")) {
 			ppc_md.init_IRQ       = xics_init_IRQ;
+			rtas_msi_init();
 #ifdef CONFIG_KEXEC
 			ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics;
 #endif
drivers/pci/Makefile +1 -0
Index: git/drivers/pci/Makefile
===================================================================
@@ -31,6 +31,7 @@ msiobj-$(CONFIG_X86) := msi.o msi-apic.o
 msiobj-$(CONFIG_IA64) := msi.o msi-apic.o
 msiobj-$(CONFIG_IA64_GENERIC) := msi-altix.o
 msiobj-$(CONFIG_IA64_SGI_SN2) := msi-altix.o
+msiobj-$(CONFIG_PPC_PSERIES) := msi-rtas.o
 
 obj-$(CONFIG_PCI_MSI) += $(msiobj-y)
 
drivers/pci/msi-rtas.c new file +199 -0

199 lines not on this page · raw message

include/asm-powerpc/pci-bridge.h +3 -0
Index: git/include/asm-powerpc/pci-bridge.h
===================================================================
@@ -81,6 +81,9 @@ struct pci_dn {
 	struct	pci_dev *pcidev;	/* back-pointer to the pci device */
 	struct	device_node *node;	/* back-pointer to the device_node */
 	u32	config_space[16];	/* saved PCI config space */
+#ifdef CONFIG_PCI_MSI
+	int	saved_irq;		/* saved LSI for MSI */
+#endif
 };
 
 /* Get the pointer to a device_node's pci_dn */
include/asm-powerpc/rtas.h +6 -0
Index: git/include/asm-powerpc/rtas.h
===================================================================
@@ -246,5 +246,11 @@ static inline u32 rtas_config_addr(int b
 			(devfn << 8) | (reg & 0xff);
 }
 
+#ifdef CONFIG_PCI_MSI
+extern void rtas_msi_init(void);
+#else
+static inline void rtas_msi_init(void) { }
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* _POWERPC_RTAS_H */