1*c66ec88fSEmmanuel Vadot* Freescale Management Complex 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotThe Freescale Management Complex (fsl-mc) is a hardware resource 4*c66ec88fSEmmanuel Vadotmanager that manages specialized hardware objects used in 5*c66ec88fSEmmanuel Vadotnetwork-oriented packet processing applications. After the fsl-mc 6*c66ec88fSEmmanuel Vadotblock is enabled, pools of hardware resources are available, such as 7*c66ec88fSEmmanuel Vadotqueues, buffer pools, I/O interfaces. These resources are building 8*c66ec88fSEmmanuel Vadotblocks that can be used to create functional hardware objects/devices 9*c66ec88fSEmmanuel Vadotsuch as network interfaces, crypto accelerator instances, L2 switches, 10*c66ec88fSEmmanuel Vadotetc. 11*c66ec88fSEmmanuel Vadot 12*c66ec88fSEmmanuel VadotFor an overview of the DPAA2 architecture and fsl-mc bus see: 13*c66ec88fSEmmanuel VadotDocumentation/networking/device_drivers/ethernet/freescale/dpaa2/overview.rst 14*c66ec88fSEmmanuel Vadot 15*c66ec88fSEmmanuel VadotAs described in the above overview, all DPAA2 objects in a DPRC share the 16*c66ec88fSEmmanuel Vadotsame hardware "isolation context" and a 10-bit value called an ICID 17*c66ec88fSEmmanuel Vadot(isolation context id) is expressed by the hardware to identify 18*c66ec88fSEmmanuel Vadotthe requester. 19*c66ec88fSEmmanuel Vadot 20*c66ec88fSEmmanuel VadotThe generic 'iommus' property is insufficient to describe the relationship 21*c66ec88fSEmmanuel Vadotbetween ICIDs and IOMMUs, so an iommu-map property is used to define 22*c66ec88fSEmmanuel Vadotthe set of possible ICIDs under a root DPRC and how they map to 23*c66ec88fSEmmanuel Vadotan IOMMU. 24*c66ec88fSEmmanuel Vadot 25*c66ec88fSEmmanuel VadotFor generic IOMMU bindings, see 26*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/iommu/iommu.txt. 27*c66ec88fSEmmanuel Vadot 28*c66ec88fSEmmanuel VadotFor arm-smmu binding, see: 29*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/iommu/arm,smmu.yaml. 30*c66ec88fSEmmanuel Vadot 31*c66ec88fSEmmanuel VadotThe MSI writes are accompanied by sideband data which is derived from the ICID. 32*c66ec88fSEmmanuel VadotThe msi-map property is used to associate the devices with both the ITS 33*c66ec88fSEmmanuel Vadotcontroller and the sideband data which accompanies the writes. 34*c66ec88fSEmmanuel Vadot 35*c66ec88fSEmmanuel VadotFor generic MSI bindings, see 36*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/interrupt-controller/msi.txt. 37*c66ec88fSEmmanuel Vadot 38*c66ec88fSEmmanuel VadotFor GICv3 and GIC ITS bindings, see: 39*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml. 40*c66ec88fSEmmanuel Vadot 41*c66ec88fSEmmanuel VadotRequired properties: 42*c66ec88fSEmmanuel Vadot 43*c66ec88fSEmmanuel Vadot - compatible 44*c66ec88fSEmmanuel Vadot Value type: <string> 45*c66ec88fSEmmanuel Vadot Definition: Must be "fsl,qoriq-mc". A Freescale Management Complex 46*c66ec88fSEmmanuel Vadot compatible with this binding must have Block Revision 47*c66ec88fSEmmanuel Vadot Registers BRR1 and BRR2 at offset 0x0BF8 and 0x0BFC in 48*c66ec88fSEmmanuel Vadot the MC control register region. 49*c66ec88fSEmmanuel Vadot 50*c66ec88fSEmmanuel Vadot - reg 51*c66ec88fSEmmanuel Vadot Value type: <prop-encoded-array> 52*c66ec88fSEmmanuel Vadot Definition: A standard property. Specifies one or two regions 53*c66ec88fSEmmanuel Vadot defining the MC's registers: 54*c66ec88fSEmmanuel Vadot 55*c66ec88fSEmmanuel Vadot -the first region is the command portal for the 56*c66ec88fSEmmanuel Vadot this machine and must always be present 57*c66ec88fSEmmanuel Vadot 58*c66ec88fSEmmanuel Vadot -the second region is the MC control registers. This 59*c66ec88fSEmmanuel Vadot region may not be present in some scenarios, such 60*c66ec88fSEmmanuel Vadot as in the device tree presented to a virtual machine. 61*c66ec88fSEmmanuel Vadot 62*c66ec88fSEmmanuel Vadot - ranges 63*c66ec88fSEmmanuel Vadot Value type: <prop-encoded-array> 64*c66ec88fSEmmanuel Vadot Definition: A standard property. Defines the mapping between the child 65*c66ec88fSEmmanuel Vadot MC address space and the parent system address space. 66*c66ec88fSEmmanuel Vadot 67*c66ec88fSEmmanuel Vadot The MC address space is defined by 3 components: 68*c66ec88fSEmmanuel Vadot <region type> <offset hi> <offset lo> 69*c66ec88fSEmmanuel Vadot 70*c66ec88fSEmmanuel Vadot Valid values for region type are 71*c66ec88fSEmmanuel Vadot 0x0 - MC portals 72*c66ec88fSEmmanuel Vadot 0x1 - QBMAN portals 73*c66ec88fSEmmanuel Vadot 74*c66ec88fSEmmanuel Vadot - #address-cells 75*c66ec88fSEmmanuel Vadot Value type: <u32> 76*c66ec88fSEmmanuel Vadot Definition: Must be 3. (see definition in 'ranges' property) 77*c66ec88fSEmmanuel Vadot 78*c66ec88fSEmmanuel Vadot - #size-cells 79*c66ec88fSEmmanuel Vadot Value type: <u32> 80*c66ec88fSEmmanuel Vadot Definition: Must be 1. 81*c66ec88fSEmmanuel Vadot 82*c66ec88fSEmmanuel VadotSub-nodes: 83*c66ec88fSEmmanuel Vadot 84*c66ec88fSEmmanuel Vadot The fsl-mc node may optionally have dpmac sub-nodes that describe 85*c66ec88fSEmmanuel Vadot the relationship between the Ethernet MACs which belong to the MC 86*c66ec88fSEmmanuel Vadot and the Ethernet PHYs on the system board. 87*c66ec88fSEmmanuel Vadot 88*c66ec88fSEmmanuel Vadot The dpmac nodes must be under a node named "dpmacs" which contains 89*c66ec88fSEmmanuel Vadot the following properties: 90*c66ec88fSEmmanuel Vadot 91*c66ec88fSEmmanuel Vadot - #address-cells 92*c66ec88fSEmmanuel Vadot Value type: <u32> 93*c66ec88fSEmmanuel Vadot Definition: Must be present if dpmac sub-nodes are defined and must 94*c66ec88fSEmmanuel Vadot have a value of 1. 95*c66ec88fSEmmanuel Vadot 96*c66ec88fSEmmanuel Vadot - #size-cells 97*c66ec88fSEmmanuel Vadot Value type: <u32> 98*c66ec88fSEmmanuel Vadot Definition: Must be present if dpmac sub-nodes are defined and must 99*c66ec88fSEmmanuel Vadot have a value of 0. 100*c66ec88fSEmmanuel Vadot 101*c66ec88fSEmmanuel Vadot These nodes must have the following properties: 102*c66ec88fSEmmanuel Vadot 103*c66ec88fSEmmanuel Vadot - compatible 104*c66ec88fSEmmanuel Vadot Value type: <string> 105*c66ec88fSEmmanuel Vadot Definition: Must be "fsl,qoriq-mc-dpmac". 106*c66ec88fSEmmanuel Vadot 107*c66ec88fSEmmanuel Vadot - reg 108*c66ec88fSEmmanuel Vadot Value type: <prop-encoded-array> 109*c66ec88fSEmmanuel Vadot Definition: Specifies the id of the dpmac. 110*c66ec88fSEmmanuel Vadot 111*c66ec88fSEmmanuel Vadot - phy-handle 112*c66ec88fSEmmanuel Vadot Value type: <phandle> 113*c66ec88fSEmmanuel Vadot Definition: Specifies the phandle to the PHY device node associated 114*c66ec88fSEmmanuel Vadot with the this dpmac. 115*c66ec88fSEmmanuel VadotOptional properties: 116*c66ec88fSEmmanuel Vadot 117*c66ec88fSEmmanuel Vadot- iommu-map: Maps an ICID to an IOMMU and associated iommu-specifier 118*c66ec88fSEmmanuel Vadot data. 119*c66ec88fSEmmanuel Vadot 120*c66ec88fSEmmanuel Vadot The property is an arbitrary number of tuples of 121*c66ec88fSEmmanuel Vadot (icid-base,iommu,iommu-base,length). 122*c66ec88fSEmmanuel Vadot 123*c66ec88fSEmmanuel Vadot Any ICID i in the interval [icid-base, icid-base + length) is 124*c66ec88fSEmmanuel Vadot associated with the listed IOMMU, with the iommu-specifier 125*c66ec88fSEmmanuel Vadot (i - icid-base + iommu-base). 126*c66ec88fSEmmanuel Vadot 127*c66ec88fSEmmanuel Vadot- msi-map: Maps an ICID to a GIC ITS and associated msi-specifier 128*c66ec88fSEmmanuel Vadot data. 129*c66ec88fSEmmanuel Vadot 130*c66ec88fSEmmanuel Vadot The property is an arbitrary number of tuples of 131*c66ec88fSEmmanuel Vadot (icid-base,gic-its,msi-base,length). 132*c66ec88fSEmmanuel Vadot 133*c66ec88fSEmmanuel Vadot Any ICID in the interval [icid-base, icid-base + length) is 134*c66ec88fSEmmanuel Vadot associated with the listed GIC ITS, with the msi-specifier 135*c66ec88fSEmmanuel Vadot (i - icid-base + msi-base). 136*c66ec88fSEmmanuel Vadot 137*c66ec88fSEmmanuel VadotDeprecated properties: 138*c66ec88fSEmmanuel Vadot 139*c66ec88fSEmmanuel Vadot - msi-parent 140*c66ec88fSEmmanuel Vadot Value type: <phandle> 141*c66ec88fSEmmanuel Vadot Definition: Describes the MSI controller node handling message 142*c66ec88fSEmmanuel Vadot interrupts for the MC. When there is no translation 143*c66ec88fSEmmanuel Vadot between the ICID and deviceID this property can be used 144*c66ec88fSEmmanuel Vadot to describe the MSI controller used by the devices on the 145*c66ec88fSEmmanuel Vadot mc-bus. 146*c66ec88fSEmmanuel Vadot The use of this property for mc-bus is deprecated. Please 147*c66ec88fSEmmanuel Vadot use msi-map. 148*c66ec88fSEmmanuel Vadot 149*c66ec88fSEmmanuel VadotExample: 150*c66ec88fSEmmanuel Vadot 151*c66ec88fSEmmanuel Vadot smmu: iommu@5000000 { 152*c66ec88fSEmmanuel Vadot compatible = "arm,mmu-500"; 153*c66ec88fSEmmanuel Vadot #iommu-cells = <1>; 154*c66ec88fSEmmanuel Vadot stream-match-mask = <0x7C00>; 155*c66ec88fSEmmanuel Vadot ... 156*c66ec88fSEmmanuel Vadot }; 157*c66ec88fSEmmanuel Vadot 158*c66ec88fSEmmanuel Vadot gic: interrupt-controller@6000000 { 159*c66ec88fSEmmanuel Vadot compatible = "arm,gic-v3"; 160*c66ec88fSEmmanuel Vadot ... 161*c66ec88fSEmmanuel Vadot } 162*c66ec88fSEmmanuel Vadot its: gic-its@6020000 { 163*c66ec88fSEmmanuel Vadot compatible = "arm,gic-v3-its"; 164*c66ec88fSEmmanuel Vadot msi-controller; 165*c66ec88fSEmmanuel Vadot ... 166*c66ec88fSEmmanuel Vadot }; 167*c66ec88fSEmmanuel Vadot 168*c66ec88fSEmmanuel Vadot fsl_mc: fsl-mc@80c000000 { 169*c66ec88fSEmmanuel Vadot compatible = "fsl,qoriq-mc"; 170*c66ec88fSEmmanuel Vadot reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */ 171*c66ec88fSEmmanuel Vadot <0x00000000 0x08340000 0 0x40000>; /* MC control reg */ 172*c66ec88fSEmmanuel Vadot /* define map for ICIDs 23-64 */ 173*c66ec88fSEmmanuel Vadot iommu-map = <23 &smmu 23 41>; 174*c66ec88fSEmmanuel Vadot /* define msi map for ICIDs 23-64 */ 175*c66ec88fSEmmanuel Vadot msi-map = <23 &its 23 41>; 176*c66ec88fSEmmanuel Vadot #address-cells = <3>; 177*c66ec88fSEmmanuel Vadot #size-cells = <1>; 178*c66ec88fSEmmanuel Vadot 179*c66ec88fSEmmanuel Vadot /* 180*c66ec88fSEmmanuel Vadot * Region type 0x0 - MC portals 181*c66ec88fSEmmanuel Vadot * Region type 0x1 - QBMAN portals 182*c66ec88fSEmmanuel Vadot */ 183*c66ec88fSEmmanuel Vadot ranges = <0x0 0x0 0x0 0x8 0x0c000000 0x4000000 184*c66ec88fSEmmanuel Vadot 0x1 0x0 0x0 0x8 0x18000000 0x8000000>; 185*c66ec88fSEmmanuel Vadot 186*c66ec88fSEmmanuel Vadot dpmacs { 187*c66ec88fSEmmanuel Vadot #address-cells = <1>; 188*c66ec88fSEmmanuel Vadot #size-cells = <0>; 189*c66ec88fSEmmanuel Vadot 190*c66ec88fSEmmanuel Vadot dpmac@1 { 191*c66ec88fSEmmanuel Vadot compatible = "fsl,qoriq-mc-dpmac"; 192*c66ec88fSEmmanuel Vadot reg = <1>; 193*c66ec88fSEmmanuel Vadot phy-handle = <&mdio0_phy0>; 194*c66ec88fSEmmanuel Vadot } 195*c66ec88fSEmmanuel Vadot } 196*c66ec88fSEmmanuel Vadot }; 197