diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2009-05-12 16:51:56 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-05-19 01:50:38 -0400 |
commit | 3da34aae03d498ee62f75aa7467de93cce3030fd (patch) | |
tree | f2cbdc5e8cd09801ca32d26977cbf4eb8feae415 /arch/powerpc/sysdev | |
parent | 12ac426f889f3a6b821c7ca73e74d83f0fc84c13 (diff) |
powerpc/fsl: Support unique MSI addresses per PCIe Root Complex
Its feasible based on how the PCI address map is setup that the region
of PCI address space used for MSIs differs for each PHB on the same SoC.
Instead of assuming that the address mappes to CCSRBAR 1:1 we read
PEXCSRBAR (BAR0) for the PHB that the given pci_dev is on.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/fsl_msi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index f25ce818d40a..da38a1ff97bb 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c | |||
@@ -113,8 +113,13 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq, | |||
113 | struct msi_msg *msg) | 113 | struct msi_msg *msg) |
114 | { | 114 | { |
115 | struct fsl_msi *msi_data = fsl_msi; | 115 | struct fsl_msi *msi_data = fsl_msi; |
116 | struct pci_controller *hose = pci_bus_to_host(pdev->bus); | ||
117 | u32 base = 0; | ||
116 | 118 | ||
117 | msg->address_lo = msi_data->msi_addr_lo; | 119 | pci_bus_read_config_dword(hose->bus, |
120 | PCI_DEVFN(0, 0), PCI_BASE_ADDRESS_0, &base); | ||
121 | |||
122 | msg->address_lo = msi_data->msi_addr_lo + base; | ||
118 | msg->address_hi = msi_data->msi_addr_hi; | 123 | msg->address_hi = msi_data->msi_addr_hi; |
119 | msg->data = hwirq; | 124 | msg->data = hwirq; |
120 | 125 | ||
@@ -271,7 +276,7 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev, | |||
271 | msi->irqhost->host_data = msi; | 276 | msi->irqhost->host_data = msi; |
272 | 277 | ||
273 | msi->msi_addr_hi = 0x0; | 278 | msi->msi_addr_hi = 0x0; |
274 | msi->msi_addr_lo = res.start + features->msiir_offset; | 279 | msi->msi_addr_lo = features->msiir_offset + (res.start & 0xfffff); |
275 | 280 | ||
276 | rc = fsl_msi_init_allocator(msi); | 281 | rc = fsl_msi_init_allocator(msi); |
277 | if (rc) { | 282 | if (rc) { |