Patchwork [v3,3/5] fsl_msi: enable msi sharing through AMP OSes

login
register
mail settings
Submitter Yang Li
Date April 22, 2010, 8:31 a.m.
Message ID <1271925099-29100-3-git-send-email-leoli@freescale.com>
Download mbox | patch
Permalink /patch/50698/
State Accepted
Delegated to: Kumar Gala
Headers show

Comments

Yang Li - April 22, 2010, 8:31 a.m.
Make a single PCIe MSI bank shareable through CAMP OSes. The number of
MSI used by each core can be configured by dts file.

Signed-off-by: Zhao Chenhui <b26998@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 arch/powerpc/sysdev/fsl_msi.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
Kumar Gala - May 24, 2010, 7:12 p.m.
On Apr 22, 2010, at 3:31 AM, Li Yang wrote:

> Make a single PCIe MSI bank shareable through CAMP OSes. The number of
> MSI used by each core can be configured by dts file.
> 
> Signed-off-by: Zhao Chenhui <b26998@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/sysdev/fsl_msi.c |    8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)

applied to next

- k

Patch

diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index b7ea19a..7c442e2 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -260,6 +260,8 @@  static int __devinit fsl_of_msi_probe(struct of_device *dev,
 	const u32 *p;
 	struct fsl_msi_feature *features = match->data;
 	struct fsl_msi_cascade_data *cascade_data = NULL;
+	int len;
+	u32 offset;
 
 	printk(KERN_DEBUG "Setting up Freescale MSI support\n");
 
@@ -319,6 +321,10 @@  static int __devinit fsl_of_msi_probe(struct of_device *dev,
 		err = -EINVAL;
 		goto error_out;
 	}
+	offset = 0;
+	p = of_get_property(dev->node, "msi-available-ranges", &len);
+	if (p)
+		offset = *p / IRQS_PER_MSI_REG;
 
 	count /= sizeof(u32);
 	for (i = 0; i < count / 2; i++) {
@@ -335,7 +341,7 @@  static int __devinit fsl_of_msi_probe(struct of_device *dev,
 				err = -ENOMEM;
 				goto error_out;
 			}
-			cascade_data->index = i;
+			cascade_data->index = i + offset;
 			cascade_data->msi_data = msi;
 			set_irq_data(virt_msir, (void *)cascade_data);
 			set_irq_chained_handler(virt_msir, fsl_msi_cascade);