aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorLi Yang <leoli@freescale.com>2010-04-22 04:31:37 -0400
committerKumar Gala <galak@kernel.crashing.org>2010-05-24 22:26:34 -0400
commit061ca4adfb2e3c986a182fd30f7e939a1ff8d29d (patch)
tree038402d2fb9f6f0d919c1fc6d5556d252a4f629d /arch/powerpc
parent694a7a3611a1c0e28d99b4955151c6ce68e89752 (diff)
powerpc/fsl_msi: enable msi sharing through AMP OSes
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> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/sysdev/fsl_msi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index efffcbd190a1..1ab703915972 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -261,6 +261,8 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev,
261 const u32 *p; 261 const u32 *p;
262 struct fsl_msi_feature *features = match->data; 262 struct fsl_msi_feature *features = match->data;
263 struct fsl_msi_cascade_data *cascade_data = NULL; 263 struct fsl_msi_cascade_data *cascade_data = NULL;
264 int len;
265 u32 offset;
264 266
265 printk(KERN_DEBUG "Setting up Freescale MSI support\n"); 267 printk(KERN_DEBUG "Setting up Freescale MSI support\n");
266 268
@@ -320,6 +322,10 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev,
320 err = -EINVAL; 322 err = -EINVAL;
321 goto error_out; 323 goto error_out;
322 } 324 }
325 offset = 0;
326 p = of_get_property(dev->node, "msi-available-ranges", &len);
327 if (p)
328 offset = *p / IRQS_PER_MSI_REG;
323 329
324 count /= sizeof(u32); 330 count /= sizeof(u32);
325 for (i = 0; i < count / 2; i++) { 331 for (i = 0; i < count / 2; i++) {
@@ -336,7 +342,7 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev,
336 err = -ENOMEM; 342 err = -ENOMEM;
337 goto error_out; 343 goto error_out;
338 } 344 }
339 cascade_data->index = i; 345 cascade_data->index = i + offset;
340 cascade_data->msi_data = msi; 346 cascade_data->msi_data = msi;
341 set_irq_data(virt_msir, (void *)cascade_data); 347 set_irq_data(virt_msir, (void *)cascade_data);
342 set_irq_chained_handler(virt_msir, fsl_msi_cascade); 348 set_irq_chained_handler(virt_msir, fsl_msi_cascade);