Freescale MSI interrupt controller

Schema identifier ($id): "http://devicetree.org/schemas/interrupt-controller/fsl,mpic-msi.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

The Freescale hypervisor and msi-address-64 -------------------------------------------

Normally, PCI devices have access to all of CCSR via an ATMU mapping. The Freescale MSI driver calculates the address of MSIIR (in the MSI register block) and sets that address as the MSI message address.

In a virtualized environment, the hypervisor may need to create an IOMMU mapping for MSIIR. The Freescale ePAPR hypervisor has this requirement because of hardware limitations of the Peripheral Access Management Unit (PAMU), which is currently the only IOMMU that the hypervisor supports. The ATMU is programmed with the guest physical address, and the PAMU intercepts transactions and reroutes them to the true physical address.

In the PAMU, each PCI controller is given only one primary window. The PAMU restricts DMA operations so that they can only occur within a window. Because PCI devices must be able to DMA to memory, the primary window must be used to cover all of the guest's memory space.

PAMU primary windows can be divided into 256 subwindows, and each subwindow can have its own address mapping ("guest physical" to "true physical"). However, each subwindow has to have the same alignment, which means they cannot be located at just any address. Because of these restrictions, it is usually impossible to create a 4KB subwindow that covers MSIIR where it's normally located.

Therefore, the hypervisor has to create a subwindow inside the same primary window used for memory, but mapped to the MSIR block (where MSIIR lives). The first subwindow after the end of guest memory is used for this. The address specified in the msi-address-64 property is the PCI address of MSIIR. The hypervisor configures the PAMU to map that address to the true physical address of MSIIR.

Maintainers (maintainers): "J. Neuschäfer <j.ne@posteo.net>"

Properties and child nodes (properties) #

compatible — required here #

Exactly one of these rules must match (oneOf) #

Rule 1

Allowed values (enum): "fsl,mpic-msi", "fsl,mpic-msi-v4.3", "fsl,ipic-msi", "fsl,vmpic-msi", "fsl,vmpic-msi-v4.3"

Rule 2

Array item rules (items)

Item 1

Allowed values (enum): "fsl,mpc8572-msi", "fsl,mpc8610-msi", "fsl,mpc8641-msi"

Item 2

Exact value (const): "fsl,mpic-msi"

reg — required here #

Minimum number of items (minItems): 1

Array item rules (items) #

Item 1

Address and length of the shared message interrupt register set

Item 2

Address of aliased MSIIR or MSIIR1 register for platforms that have such an alias. If using MSIIR1, the second region must be added because different MSI group has different MSIIR1 offset.

interrupts — required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 16

Each one of the interrupts here is one entry per 32 MSIs, and routed to the host interrupt controller. The interrupts should be set as edge sensitive. If msi-available-ranges is present, only the interrupts that correspond to available ranges shall be present.

msi-available-ranges — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32-matrix

Array item rules (items) #

Array item rules (items)

Item 1

First MSI interrupt in this range

Item 2

Number of MSI interrupts in this range

Define which MSI interrupt can be used in the 256 MSI interrupts. If not specified, all the MSI interrupts can be used. Each available range must begin and end on a multiple of 32 (i.e. no splitting an individual MSI register or the associated PIC interrupt).

msi-address-64 — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint64

64-bit PCI address of the MSIIR register. The MSIIR register is used for MSI messaging. The address of MSIIR in PCI address space is the MSI message address. This property may be used in virtualized environments where the hypervisor has created an alternate mapping for the MSIR block. See the top-level description for an explanation.

Required in this object (required): "compatible", "reg", "interrupts"

All of these rules must match (allOf) #

Rule 1 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "fsl,mpic-msi-v4.3", "fsl,vmpic-msi-v4.3"

When the condition matches (then) #

Properties and child nodes (properties)

interrupts — not listed as required here

Minimum number of items (minItems): 16

Version 4.3 implies that there are 16 shared interrupts, and they are configured through MSIIR1.

msi-available-ranges — not listed as required here

false — Not permitted by this property rule.

reg — not listed as required here

Minimum number of items (minItems): 2

When the condition does not match (else) #

Properties and child nodes (properties)

interrupts — not listed as required here

Maximum number of items (maxItems): 8

In versions before 4.3, only 8 shared interrupts are available, and they are configured through MSIIR.

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (examples) #

msi@41600 {
        compatible = "fsl,mpc8610-msi", "fsl,mpic-msi";
        reg = <0x41600 0x80>;
        msi-available-ranges = <0 0x100>;
        interrupts = <0xe0 0>, <0xe1 0>, <0xe2 0>, <0xe3 0>,
                     <0xe4 0>, <0xe5 0>, <0xe6 0>, <0xe7 0>;
};
msi@41600 {
        compatible = "fsl,mpic-msi-v4.3";
        reg = <0x41600 0x200>, <0x44148 4>;
        interrupts = <0xe0 0 0 0>, <0xe1 0 0 0>, <0xe2 0 0 0>, <0xe3 0 0 0>,
                     <0xe4 0 0 0>, <0xe5 0 0 0>, <0xe6 0 0 0>, <0xe7 0 0 0>,
                     <0x100 0 0 0>, <0x101 0 0 0>, <0x102 0 0 0>, <0x103 0 0 0>,
                     <0x104 0 0 0>, <0x105 0 0 0>, <0x106 0 0 0>, <0x107 0 0 0>;
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Line 124: MPIC v4.3 does not support this property because the 32 interrupts of

Line 125: an individual register are not continuous when using MSIIR1.

Edit this page