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>
This commit is contained in:
@@ -30,7 +30,7 @@ LIST_HEAD(msi_head);
|
||||
|
||||
struct fsl_msi_feature {
|
||||
u32 fsl_pic_ip;
|
||||
u32 msiir_offset;
|
||||
u32 msiir_offset; /* Offset of MSIIR, relative to start of MSIR bank */
|
||||
};
|
||||
|
||||
struct fsl_msi_cascade_data {
|
||||
@@ -126,10 +126,19 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
|
||||
{
|
||||
struct fsl_msi *msi_data = fsl_msi_data;
|
||||
struct pci_controller *hose = pci_bus_to_host(pdev->bus);
|
||||
u64 base = fsl_pci_immrbar_base(hose);
|
||||
u64 address; /* Physical address of the MSIIR */
|
||||
int len;
|
||||
const u64 *reg;
|
||||
|
||||
msg->address_lo = msi_data->msi_addr_lo + lower_32_bits(base);
|
||||
msg->address_hi = msi_data->msi_addr_hi + upper_32_bits(base);
|
||||
/* If the msi-address-64 property exists, then use it */
|
||||
reg = of_get_property(hose->dn, "msi-address-64", &len);
|
||||
if (reg && (len == sizeof(u64)))
|
||||
address = be64_to_cpup(reg);
|
||||
else
|
||||
address = fsl_pci_immrbar_base(hose) + msi_data->msiir_offset;
|
||||
|
||||
msg->address_lo = lower_32_bits(address);
|
||||
msg->address_hi = upper_32_bits(address);
|
||||
|
||||
msg->data = hwirq;
|
||||
|
||||
@@ -359,8 +368,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
|
||||
|
||||
msi->irqhost->host_data = msi;
|
||||
|
||||
msi->msi_addr_hi = 0x0;
|
||||
msi->msi_addr_lo = features->msiir_offset + (res.start & 0xfffff);
|
||||
msi->msiir_offset = features->msiir_offset + (res.start & 0xfffff);
|
||||
|
||||
rc = fsl_msi_init_allocator(msi);
|
||||
if (rc) {
|
||||
|
Reference in New Issue
Block a user