xref: /freebsd/sys/contrib/device-tree/Bindings/misc/fsl,qoriq-mc.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
10e8011faSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
20e8011faSEmmanuel Vadot%YAML 1.2
30e8011faSEmmanuel Vadot---
40e8011faSEmmanuel Vadot$id: http://devicetree.org/schemas/misc/fsl,qoriq-mc.yaml#
50e8011faSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
60e8011faSEmmanuel Vadot
70e8011faSEmmanuel Vadottitle: Freescale Management Complex
80e8011faSEmmanuel Vadot
90e8011faSEmmanuel Vadotmaintainers:
100e8011faSEmmanuel Vadot  - Frank Li <Frank.Li@nxp.com>
110e8011faSEmmanuel Vadot
120e8011faSEmmanuel Vadotdescription: |
130e8011faSEmmanuel Vadot  The Freescale Management Complex (fsl-mc) is a hardware resource
140e8011faSEmmanuel Vadot  manager that manages specialized hardware objects used in
150e8011faSEmmanuel Vadot  network-oriented packet processing applications. After the fsl-mc
160e8011faSEmmanuel Vadot  block is enabled, pools of hardware resources are available, such as
170e8011faSEmmanuel Vadot  queues, buffer pools, I/O interfaces. These resources are building
180e8011faSEmmanuel Vadot  blocks that can be used to create functional hardware objects/devices
190e8011faSEmmanuel Vadot  such as network interfaces, crypto accelerator instances, L2 switches,
200e8011faSEmmanuel Vadot  etc.
210e8011faSEmmanuel Vadot
220e8011faSEmmanuel Vadot  For an overview of the DPAA2 architecture and fsl-mc bus see:
230e8011faSEmmanuel Vadot  Documentation/networking/device_drivers/ethernet/freescale/dpaa2/overview.rst
240e8011faSEmmanuel Vadot
250e8011faSEmmanuel Vadot  As described in the above overview, all DPAA2 objects in a DPRC share the
260e8011faSEmmanuel Vadot  same hardware "isolation context" and a 10-bit value called an ICID
270e8011faSEmmanuel Vadot  (isolation context id) is expressed by the hardware to identify
280e8011faSEmmanuel Vadot  the requester.
290e8011faSEmmanuel Vadot
300e8011faSEmmanuel Vadot  The generic 'iommus' property is insufficient to describe the relationship
310e8011faSEmmanuel Vadot  between ICIDs and IOMMUs, so an iommu-map property is used to define
320e8011faSEmmanuel Vadot  the set of possible ICIDs under a root DPRC and how they map to
330e8011faSEmmanuel Vadot  an IOMMU.
340e8011faSEmmanuel Vadot
350e8011faSEmmanuel Vadot  For generic IOMMU bindings, see
360e8011faSEmmanuel Vadot  Documentation/devicetree/bindings/iommu/iommu.txt.
370e8011faSEmmanuel Vadot
380e8011faSEmmanuel Vadot  For arm-smmu binding, see:
390e8011faSEmmanuel Vadot  Documentation/devicetree/bindings/iommu/arm,smmu.yaml.
400e8011faSEmmanuel Vadot
410e8011faSEmmanuel Vadot  The MSI writes are accompanied by sideband data which is derived from the ICID.
420e8011faSEmmanuel Vadot  The msi-map property is used to associate the devices with both the ITS
430e8011faSEmmanuel Vadot  controller and the sideband data which accompanies the writes.
440e8011faSEmmanuel Vadot
450e8011faSEmmanuel Vadot  For generic MSI bindings, see
460e8011faSEmmanuel Vadot  Documentation/devicetree/bindings/interrupt-controller/msi.txt.
470e8011faSEmmanuel Vadot
480e8011faSEmmanuel Vadot  For GICv3 and GIC ITS bindings, see:
490e8011faSEmmanuel Vadot  Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml.
500e8011faSEmmanuel Vadot
510e8011faSEmmanuel Vadotproperties:
520e8011faSEmmanuel Vadot  compatible:
530e8011faSEmmanuel Vadot    enum:
540e8011faSEmmanuel Vadot      - fsl,qoriq-mc
550e8011faSEmmanuel Vadot    description:
560e8011faSEmmanuel Vadot      Must be "fsl,qoriq-mc".  A Freescale Management Complex
570e8011faSEmmanuel Vadot      compatible with this binding must have Block Revision
580e8011faSEmmanuel Vadot      Registers BRR1 and BRR2 at offset 0x0BF8 and 0x0BFC in
590e8011faSEmmanuel Vadot      the MC control register region.
600e8011faSEmmanuel Vadot
610e8011faSEmmanuel Vadot  reg:
620e8011faSEmmanuel Vadot    items:
630e8011faSEmmanuel Vadot      - description:
640e8011faSEmmanuel Vadot          the first region is the command portal for the
650e8011faSEmmanuel Vadot          this machine and must always be present
660e8011faSEmmanuel Vadot
670e8011faSEmmanuel Vadot      - description:
680e8011faSEmmanuel Vadot          the second region is the MC control registers. This
690e8011faSEmmanuel Vadot          region may not be present in some scenarios, such
700e8011faSEmmanuel Vadot          as in the device tree presented to a virtual machine.
710e8011faSEmmanuel Vadot
720e8011faSEmmanuel Vadot  ranges:
730e8011faSEmmanuel Vadot    description: |
740e8011faSEmmanuel Vadot      A standard property.  Defines the mapping between the child
750e8011faSEmmanuel Vadot      MC address space and the parent system address space.
760e8011faSEmmanuel Vadot
770e8011faSEmmanuel Vadot      The MC address space is defined by 3 components:
780e8011faSEmmanuel Vadot        <region type> <offset hi> <offset lo>
790e8011faSEmmanuel Vadot
800e8011faSEmmanuel Vadot      Valid values for region type are
810e8011faSEmmanuel Vadot        0x0 - MC portals
820e8011faSEmmanuel Vadot        0x1 - QBMAN portals
830e8011faSEmmanuel Vadot
840e8011faSEmmanuel Vadot  "#address-cells":
850e8011faSEmmanuel Vadot    const: 3
860e8011faSEmmanuel Vadot
870e8011faSEmmanuel Vadot  "#size-cells":
880e8011faSEmmanuel Vadot    const: 1
890e8011faSEmmanuel Vadot
900e8011faSEmmanuel Vadot  iommu-map:
910e8011faSEmmanuel Vadot    description: |
920e8011faSEmmanuel Vadot      Maps an ICID to an IOMMU and associated iommu-specifier
930e8011faSEmmanuel Vadot      data.
940e8011faSEmmanuel Vadot
950e8011faSEmmanuel Vadot      The property is an arbitrary number of tuples of
960e8011faSEmmanuel Vadot      (icid-base,iommu,iommu-base,length).
970e8011faSEmmanuel Vadot
980e8011faSEmmanuel Vadot      Any ICID i in the interval [icid-base, icid-base + length) is
990e8011faSEmmanuel Vadot      associated with the listed IOMMU, with the iommu-specifier
1000e8011faSEmmanuel Vadot      (i - icid-base + iommu-base).
1010e8011faSEmmanuel Vadot
1020e8011faSEmmanuel Vadot  msi-map:
1030e8011faSEmmanuel Vadot    description: |
1040e8011faSEmmanuel Vadot      Maps an ICID to a GIC ITS and associated msi-specifier
1050e8011faSEmmanuel Vadot      data.
1060e8011faSEmmanuel Vadot
1070e8011faSEmmanuel Vadot      The property is an arbitrary number of tuples of
1080e8011faSEmmanuel Vadot      (icid-base,gic-its,msi-base,length).
1090e8011faSEmmanuel Vadot
1100e8011faSEmmanuel Vadot      Any ICID in the interval [icid-base, icid-base + length) is
1110e8011faSEmmanuel Vadot      associated with the listed GIC ITS, with the msi-specifier
1120e8011faSEmmanuel Vadot      (i - icid-base + msi-base).
1130e8011faSEmmanuel Vadot
1140e8011faSEmmanuel Vadot  msi-parent:
1150e8011faSEmmanuel Vadot    deprecated: true
116*b2d2a78aSEmmanuel Vadot    maxItems: 1
1170e8011faSEmmanuel Vadot    description:
1180e8011faSEmmanuel Vadot      Describes the MSI controller node handling message
1190e8011faSEmmanuel Vadot      interrupts for the MC. When there is no translation
1200e8011faSEmmanuel Vadot      between the ICID and deviceID this property can be used
1210e8011faSEmmanuel Vadot      to describe the MSI controller used by the devices on the
1220e8011faSEmmanuel Vadot      mc-bus.
1230e8011faSEmmanuel Vadot      The use of this property for mc-bus is deprecated. Please
1240e8011faSEmmanuel Vadot      use msi-map.
1250e8011faSEmmanuel Vadot
1260e8011faSEmmanuel Vadot  dma-coherent: true
1270e8011faSEmmanuel Vadot
1280e8011faSEmmanuel Vadot  dpmacs:
1290e8011faSEmmanuel Vadot    type: object
1300e8011faSEmmanuel Vadot    description:
1310e8011faSEmmanuel Vadot      The fsl-mc node may optionally have dpmac sub-nodes that describe
1320e8011faSEmmanuel Vadot      the relationship between the Ethernet MACs which belong to the MC
1330e8011faSEmmanuel Vadot      and the Ethernet PHYs on the system board.
1340e8011faSEmmanuel Vadot
1350e8011faSEmmanuel Vadot    properties:
1360e8011faSEmmanuel Vadot      "#address-cells":
1370e8011faSEmmanuel Vadot        const: 1
1380e8011faSEmmanuel Vadot
1390e8011faSEmmanuel Vadot      "#size-cells":
1400e8011faSEmmanuel Vadot        const: 0
1410e8011faSEmmanuel Vadot
1420e8011faSEmmanuel Vadot    patternProperties:
1430e8011faSEmmanuel Vadot      '^ethernet@[a-f0-9]+$':
1440e8011faSEmmanuel Vadot        $ref: /schemas/net/fsl,qoriq-mc-dpmac.yaml
1450e8011faSEmmanuel Vadot
1460e8011faSEmmanuel Vadot    additionalProperties: false
1470e8011faSEmmanuel Vadot
1480e8011faSEmmanuel Vadotrequired:
1490e8011faSEmmanuel Vadot  - compatible
1500e8011faSEmmanuel Vadot  - reg
1510e8011faSEmmanuel Vadot  - ranges
1520e8011faSEmmanuel Vadot  - "#address-cells"
1530e8011faSEmmanuel Vadot  - "#size-cells"
1540e8011faSEmmanuel Vadot
1550e8011faSEmmanuel VadotadditionalProperties: false
1560e8011faSEmmanuel Vadot
1570e8011faSEmmanuel Vadotexamples:
1580e8011faSEmmanuel Vadot  - |
1590e8011faSEmmanuel Vadot    fsl-mc@80c000000 {
1600e8011faSEmmanuel Vadot        compatible = "fsl,qoriq-mc";
1610e8011faSEmmanuel Vadot        reg = <0x0c000000 0x40>,    /* MC portal base */
1620e8011faSEmmanuel Vadot              <0x08340000 0x40000>; /* MC control reg */
1630e8011faSEmmanuel Vadot        /*
1640e8011faSEmmanuel Vadot         * Region type 0x0 - MC portals
1650e8011faSEmmanuel Vadot         * Region type 0x1 - QBMAN portals
1660e8011faSEmmanuel Vadot         */
1670e8011faSEmmanuel Vadot        ranges = <0x0 0x0 0x8 0x0c000000 0x4000000
1680e8011faSEmmanuel Vadot                 0x1 0x0 0x8 0x18000000 0x8000000>;
1690e8011faSEmmanuel Vadot
1700e8011faSEmmanuel Vadot        /* define map for ICIDs 23-64 */
1710e8011faSEmmanuel Vadot        iommu-map = <23 &smmu 23 41>;
1720e8011faSEmmanuel Vadot        /* define msi map for ICIDs 23-64 */
1730e8011faSEmmanuel Vadot        msi-map = <23 &its 23 41>;
1740e8011faSEmmanuel Vadot        #address-cells = <3>;
1750e8011faSEmmanuel Vadot        #size-cells = <1>;
1760e8011faSEmmanuel Vadot
1770e8011faSEmmanuel Vadot        dpmacs {
1780e8011faSEmmanuel Vadot            #address-cells = <1>;
1790e8011faSEmmanuel Vadot            #size-cells = <0>;
1800e8011faSEmmanuel Vadot
1810e8011faSEmmanuel Vadot            ethernet@1 {
1820e8011faSEmmanuel Vadot                compatible = "fsl,qoriq-mc-dpmac";
1830e8011faSEmmanuel Vadot                reg = <1>;
1840e8011faSEmmanuel Vadot                phy-handle = <&mdio0_phy0>;
1850e8011faSEmmanuel Vadot            };
1860e8011faSEmmanuel Vadot        };
1870e8011faSEmmanuel Vadot    };
188