Skip to content

Commit

Permalink
powerpc/fsl_msi: enable msi sharing through AMP OSes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Yang authored and Kumar Gala committed May 25, 2010
1 parent 694a7a3 commit 061ca4a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arch/powerpc/sysdev/fsl_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,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");

Expand Down Expand Up @@ -320,6 +322,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++) {
Expand All @@ -336,7 +342,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);
Expand Down

0 comments on commit 061ca4a

Please sign in to comment.