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