diff options
author | Timur Tabi <timur@freescale.com> | 2011-09-23 13:41:35 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2011-10-14 03:54:29 -0400 |
commit | 2bcd1c0cfcf53a384159c272c972645e7e822140 (patch) | |
tree | 221e336531b92f2eef53cd48a1c1ad217ccf894b /arch/powerpc | |
parent | 45116806139743cf35baa01a584e5972e5d833f6 (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')
-rw-r--r-- | arch/powerpc/sysdev/fsl_msi.c | 20 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_msi.h | 3 |
2 files changed, 15 insertions, 8 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 | ||
31 | struct fsl_msi_feature { | 31 | struct 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 | ||
36 | struct fsl_msi_cascade_data { | 36 | struct 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) { |
diff --git a/arch/powerpc/sysdev/fsl_msi.h b/arch/powerpc/sysdev/fsl_msi.h index 624580c252d7..1313abbc5200 100644 --- a/arch/powerpc/sysdev/fsl_msi.h +++ b/arch/powerpc/sysdev/fsl_msi.h | |||
@@ -28,8 +28,7 @@ struct fsl_msi { | |||
28 | 28 | ||
29 | unsigned long cascade_irq; | 29 | unsigned long cascade_irq; |
30 | 30 | ||
31 | u32 msi_addr_lo; | 31 | u32 msiir_offset; /* Offset of MSIIR, relative to start of CCSR */ |
32 | u32 msi_addr_hi; | ||
33 | void __iomem *msi_regs; | 32 | void __iomem *msi_regs; |
34 | u32 feature; | 33 | u32 feature; |
35 | int msi_virqs[NR_MSI_REG]; | 34 | int msi_virqs[NR_MSI_REG]; |