aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/fsl_msi.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2011-09-23 13:41:35 -0400
committerKumar Gala <galak@kernel.crashing.org>2011-10-14 03:54:29 -0400
commit2bcd1c0cfcf53a384159c272c972645e7e822140 (patch)
tree221e336531b92f2eef53cd48a1c1ad217ccf894b /arch/powerpc/sysdev/fsl_msi.c
parent45116806139743cf35baa01a584e5972e5d833f6 (diff)
powerpc/fsl_msi: add support for "msi-address-64" property
Add support for the msi-address-64 property of a PCI node. This property specifies the PCI address of MSIIR (message signaled interrupt index register). In commit 3da34aae ("powerpc/fsl: Support unique MSI addresses per PCIe Root Complex"), the msi_addr_hi/msi_addr_lo fields of struct fsl_msi were redefined from an actual address to just an offset, but the fields were not renamed accordingly. These fields are replace with a single field, msiir_offset, to reflect the new meaning. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev/fsl_msi.c')
-rw-r--r--arch/powerpc/sysdev/fsl_msi.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 1cca25146b1f..e5c344d336ea 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -30,7 +30,7 @@ LIST_HEAD(msi_head);
30 30
31struct fsl_msi_feature { 31struct fsl_msi_feature {
32 u32 fsl_pic_ip; 32 u32 fsl_pic_ip;
33 u32 msiir_offset; 33 u32 msiir_offset; /* Offset of MSIIR, relative to start of MSIR bank */
34}; 34};
35 35
36struct fsl_msi_cascade_data { 36struct fsl_msi_cascade_data {
@@ -126,10 +126,19 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
126{ 126{
127 struct fsl_msi *msi_data = fsl_msi_data; 127 struct fsl_msi *msi_data = fsl_msi_data;
128 struct pci_controller *hose = pci_bus_to_host(pdev->bus); 128 struct pci_controller *hose = pci_bus_to_host(pdev->bus);
129 u64 base = fsl_pci_immrbar_base(hose); 129 u64 address; /* Physical address of the MSIIR */
130 int len;
131 const u64 *reg;
132
133 /* If the msi-address-64 property exists, then use it */
134 reg = of_get_property(hose->dn, "msi-address-64", &len);
135 if (reg && (len == sizeof(u64)))
136 address = be64_to_cpup(reg);
137 else
138 address = fsl_pci_immrbar_base(hose) + msi_data->msiir_offset;
130 139
131 msg->address_lo = msi_data->msi_addr_lo + lower_32_bits(base); 140 msg->address_lo = lower_32_bits(address);
132 msg->address_hi = msi_data->msi_addr_hi + upper_32_bits(base); 141 msg->address_hi = upper_32_bits(address);
133 142
134 msg->data = hwirq; 143 msg->data = hwirq;
135 144
@@ -359,8 +368,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
359 368
360 msi->irqhost->host_data = msi; 369 msi->irqhost->host_data = msi;
361 370
362 msi->msi_addr_hi = 0x0; 371 msi->msiir_offset = features->msiir_offset + (res.start & 0xfffff);
363 msi->msi_addr_lo = features->msiir_offset + (res.start & 0xfffff);
364 372
365 rc = fsl_msi_init_allocator(msi); 373 rc = fsl_msi_init_allocator(msi);
366 if (rc) { 374 if (rc) {