xref: /linux/Documentation/driver-api/cxl/linux/example-configurations/single-device.rst (revision e9ef810dfee7a2227da9d423aecb0ced35faddbe)
1*ef3a43a6SGregory Price.. SPDX-License-Identifier: GPL-2.0
2*ef3a43a6SGregory Price
3*ef3a43a6SGregory Price=============
4*ef3a43a6SGregory PriceSingle Device
5*ef3a43a6SGregory Price=============
6*ef3a43a6SGregory PriceThis cxl-cli configuration dump shows the following host configuration:
7*ef3a43a6SGregory Price
8*ef3a43a6SGregory Price* A single socket system with one CXL root
9*ef3a43a6SGregory Price* CXL Root has Four (4) CXL Host Bridges
10*ef3a43a6SGregory Price* One CXL Host Bridges has a single CXL Memory Expander Attached
11*ef3a43a6SGregory Price* No interleave is present.
12*ef3a43a6SGregory Price
13*ef3a43a6SGregory PriceThis output is generated by :code:`cxl list -v` and describes the relationships
14*ef3a43a6SGregory Pricebetween objects exposed in :code:`/sys/bus/cxl/devices/`.
15*ef3a43a6SGregory Price
16*ef3a43a6SGregory Price::
17*ef3a43a6SGregory Price
18*ef3a43a6SGregory Price  [
19*ef3a43a6SGregory Price    {
20*ef3a43a6SGregory Price        "bus":"root0",
21*ef3a43a6SGregory Price        "provider":"ACPI.CXL",
22*ef3a43a6SGregory Price        "nr_dports":4,
23*ef3a43a6SGregory Price        "dports":[
24*ef3a43a6SGregory Price            {
25*ef3a43a6SGregory Price                "dport":"pci0000:00",
26*ef3a43a6SGregory Price                "alias":"ACPI0016:01",
27*ef3a43a6SGregory Price                "id":0
28*ef3a43a6SGregory Price            },
29*ef3a43a6SGregory Price            {
30*ef3a43a6SGregory Price                "dport":"pci0000:a8",
31*ef3a43a6SGregory Price                "alias":"ACPI0016:02",
32*ef3a43a6SGregory Price                "id":4
33*ef3a43a6SGregory Price            },
34*ef3a43a6SGregory Price            {
35*ef3a43a6SGregory Price                "dport":"pci0000:2a",
36*ef3a43a6SGregory Price                "alias":"ACPI0016:03",
37*ef3a43a6SGregory Price                "id":1
38*ef3a43a6SGregory Price            },
39*ef3a43a6SGregory Price            {
40*ef3a43a6SGregory Price                "dport":"pci0000:d2",
41*ef3a43a6SGregory Price                "alias":"ACPI0016:00",
42*ef3a43a6SGregory Price                "id":5
43*ef3a43a6SGregory Price            }
44*ef3a43a6SGregory Price        ],
45*ef3a43a6SGregory Price
46*ef3a43a6SGregory PriceThis chunk shows the CXL "bus" (root0) has 4 downstream ports attached to CXL
47*ef3a43a6SGregory PriceHost Bridges.  The `Root` can be considered the singular upstream port attached
48*ef3a43a6SGregory Priceto the platform's memory controller - which routes memory requests to it.
49*ef3a43a6SGregory Price
50*ef3a43a6SGregory PriceThe `ports:root0` section lays out how each of these downstream ports are
51*ef3a43a6SGregory Priceconfigured.  If a port is not configured (id's 0, 1, and 4), they are omitted.
52*ef3a43a6SGregory Price
53*ef3a43a6SGregory Price::
54*ef3a43a6SGregory Price
55*ef3a43a6SGregory Price        "ports:root0":[
56*ef3a43a6SGregory Price            {
57*ef3a43a6SGregory Price                "port":"port1",
58*ef3a43a6SGregory Price                "host":"pci0000:d2",
59*ef3a43a6SGregory Price                "depth":1,
60*ef3a43a6SGregory Price                "nr_dports":3,
61*ef3a43a6SGregory Price                "dports":[
62*ef3a43a6SGregory Price                    {
63*ef3a43a6SGregory Price                        "dport":"0000:d2:01.1",
64*ef3a43a6SGregory Price                        "alias":"device:02",
65*ef3a43a6SGregory Price                        "id":0
66*ef3a43a6SGregory Price                    },
67*ef3a43a6SGregory Price                    {
68*ef3a43a6SGregory Price                        "dport":"0000:d2:01.3",
69*ef3a43a6SGregory Price                        "alias":"device:05",
70*ef3a43a6SGregory Price                        "id":2
71*ef3a43a6SGregory Price                    },
72*ef3a43a6SGregory Price                    {
73*ef3a43a6SGregory Price                        "dport":"0000:d2:07.1",
74*ef3a43a6SGregory Price                        "alias":"device:0d",
75*ef3a43a6SGregory Price                        "id":113
76*ef3a43a6SGregory Price                    }
77*ef3a43a6SGregory Price                ],
78*ef3a43a6SGregory Price
79*ef3a43a6SGregory PriceThis chunk shows the available downstream ports associated with the CXL Host
80*ef3a43a6SGregory PriceBridge :code:`port1`.  In this case, :code:`port1` has 3 available downstream
81*ef3a43a6SGregory Priceports: :code:`dport1`, :code:`dport2`, and :code:`dport113`..
82*ef3a43a6SGregory Price
83*ef3a43a6SGregory Price::
84*ef3a43a6SGregory Price
85*ef3a43a6SGregory Price                "endpoints:port1":[
86*ef3a43a6SGregory Price                    {
87*ef3a43a6SGregory Price                        "endpoint":"endpoint5",
88*ef3a43a6SGregory Price                        "host":"mem0",
89*ef3a43a6SGregory Price                        "parent_dport":"0000:d2:01.1",
90*ef3a43a6SGregory Price                        "depth":2,
91*ef3a43a6SGregory Price                        "memdev":{
92*ef3a43a6SGregory Price                            "memdev":"mem0",
93*ef3a43a6SGregory Price                            "ram_size":137438953472,
94*ef3a43a6SGregory Price                            "serial":0,
95*ef3a43a6SGregory Price                            "numa_node":0,
96*ef3a43a6SGregory Price                            "host":"0000:d3:00.0"
97*ef3a43a6SGregory Price                        },
98*ef3a43a6SGregory Price                        "decoders:endpoint5":[
99*ef3a43a6SGregory Price                            {
100*ef3a43a6SGregory Price                                "decoder":"decoder5.0",
101*ef3a43a6SGregory Price                                "resource":825975898112,
102*ef3a43a6SGregory Price                                "size":137438953472,
103*ef3a43a6SGregory Price                                "interleave_ways":1,
104*ef3a43a6SGregory Price                                "region":"region0",
105*ef3a43a6SGregory Price                                "dpa_resource":0,
106*ef3a43a6SGregory Price                                "dpa_size":137438953472,
107*ef3a43a6SGregory Price                                "mode":"ram"
108*ef3a43a6SGregory Price                            }
109*ef3a43a6SGregory Price                        ]
110*ef3a43a6SGregory Price                    }
111*ef3a43a6SGregory Price                ],
112*ef3a43a6SGregory Price
113*ef3a43a6SGregory PriceThis chunk shows the endpoints attached to the host bridge :code:`port1`.
114*ef3a43a6SGregory Price
115*ef3a43a6SGregory Price:code:`endpoint5` contains a single configured decoder :code:`decoder5.0`
116*ef3a43a6SGregory Pricewhich has the same interleave configuration as :code:`region0` (shown later).
117*ef3a43a6SGregory Price
118*ef3a43a6SGregory PriceNext we have the decoders belonging to the host bridge:
119*ef3a43a6SGregory Price
120*ef3a43a6SGregory Price::
121*ef3a43a6SGregory Price
122*ef3a43a6SGregory Price                "decoders:port1":[
123*ef3a43a6SGregory Price                    {
124*ef3a43a6SGregory Price                        "decoder":"decoder1.0",
125*ef3a43a6SGregory Price                        "resource":825975898112,
126*ef3a43a6SGregory Price                        "size":137438953472,
127*ef3a43a6SGregory Price                        "interleave_ways":1,
128*ef3a43a6SGregory Price                        "region":"region0",
129*ef3a43a6SGregory Price                        "nr_targets":1,
130*ef3a43a6SGregory Price                        "targets":[
131*ef3a43a6SGregory Price                            {
132*ef3a43a6SGregory Price                                "target":"0000:d2:01.1",
133*ef3a43a6SGregory Price                                "alias":"device:02",
134*ef3a43a6SGregory Price                                "position":0,
135*ef3a43a6SGregory Price                                "id":0
136*ef3a43a6SGregory Price                            }
137*ef3a43a6SGregory Price                        ]
138*ef3a43a6SGregory Price                    }
139*ef3a43a6SGregory Price                ]
140*ef3a43a6SGregory Price            },
141*ef3a43a6SGregory Price
142*ef3a43a6SGregory PriceHost Bridge :code:`port1` has a single decoder (:code:`decoder1.0`), whose only
143*ef3a43a6SGregory Pricetarget is :code:`dport1` - which is attached to :code:`endpoint5`.
144*ef3a43a6SGregory Price
145*ef3a43a6SGregory PriceThe next chunk shows the three CXL host bridges without attached endpoints.
146*ef3a43a6SGregory Price
147*ef3a43a6SGregory Price::
148*ef3a43a6SGregory Price
149*ef3a43a6SGregory Price            {
150*ef3a43a6SGregory Price                "port":"port2",
151*ef3a43a6SGregory Price                "host":"pci0000:00",
152*ef3a43a6SGregory Price                "depth":1,
153*ef3a43a6SGregory Price                "nr_dports":2,
154*ef3a43a6SGregory Price                "dports":[
155*ef3a43a6SGregory Price                    {
156*ef3a43a6SGregory Price                        "dport":"0000:00:01.3",
157*ef3a43a6SGregory Price                        "alias":"device:55",
158*ef3a43a6SGregory Price                        "id":2
159*ef3a43a6SGregory Price                    },
160*ef3a43a6SGregory Price                    {
161*ef3a43a6SGregory Price                        "dport":"0000:00:07.1",
162*ef3a43a6SGregory Price                        "alias":"device:5d",
163*ef3a43a6SGregory Price                        "id":113
164*ef3a43a6SGregory Price                    }
165*ef3a43a6SGregory Price                ]
166*ef3a43a6SGregory Price            },
167*ef3a43a6SGregory Price            {
168*ef3a43a6SGregory Price                "port":"port3",
169*ef3a43a6SGregory Price                "host":"pci0000:a8",
170*ef3a43a6SGregory Price                "depth":1,
171*ef3a43a6SGregory Price                "nr_dports":1,
172*ef3a43a6SGregory Price                "dports":[
173*ef3a43a6SGregory Price                    {
174*ef3a43a6SGregory Price                        "dport":"0000:a8:01.1",
175*ef3a43a6SGregory Price                        "alias":"device:c3",
176*ef3a43a6SGregory Price                        "id":0
177*ef3a43a6SGregory Price                    }
178*ef3a43a6SGregory Price                ]
179*ef3a43a6SGregory Price            },
180*ef3a43a6SGregory Price            {
181*ef3a43a6SGregory Price                "port":"port4",
182*ef3a43a6SGregory Price                "host":"pci0000:2a",
183*ef3a43a6SGregory Price                "depth":1,
184*ef3a43a6SGregory Price                "nr_dports":1,
185*ef3a43a6SGregory Price                "dports":[
186*ef3a43a6SGregory Price                    {
187*ef3a43a6SGregory Price                        "dport":"0000:2a:01.1",
188*ef3a43a6SGregory Price                        "alias":"device:d0",
189*ef3a43a6SGregory Price                        "id":0
190*ef3a43a6SGregory Price                    }
191*ef3a43a6SGregory Price                ]
192*ef3a43a6SGregory Price            }
193*ef3a43a6SGregory Price        ],
194*ef3a43a6SGregory Price
195*ef3a43a6SGregory PriceNext we have the `Root Decoders` belonging to :code:`root0`.  This root decoder
196*ef3a43a6SGregory Priceis a pass-through decoder because :code:`interleave_ways` is set to :code:`1`.
197*ef3a43a6SGregory Price
198*ef3a43a6SGregory PriceThis information is generated by the CXL driver reading the ACPI CEDT CMFWS.
199*ef3a43a6SGregory Price
200*ef3a43a6SGregory Price::
201*ef3a43a6SGregory Price
202*ef3a43a6SGregory Price        "decoders:root0":[
203*ef3a43a6SGregory Price            {
204*ef3a43a6SGregory Price                "decoder":"decoder0.0",
205*ef3a43a6SGregory Price                "resource":825975898112,
206*ef3a43a6SGregory Price                "size":137438953472,
207*ef3a43a6SGregory Price                "interleave_ways":1,
208*ef3a43a6SGregory Price                "max_available_extent":0,
209*ef3a43a6SGregory Price                "volatile_capable":true,
210*ef3a43a6SGregory Price                "nr_targets":1,
211*ef3a43a6SGregory Price                "targets":[
212*ef3a43a6SGregory Price                    {
213*ef3a43a6SGregory Price                        "target":"pci0000:d2",
214*ef3a43a6SGregory Price                        "alias":"ACPI0016:00",
215*ef3a43a6SGregory Price                        "position":0,
216*ef3a43a6SGregory Price                        "id":5
217*ef3a43a6SGregory Price                    }
218*ef3a43a6SGregory Price                ],
219*ef3a43a6SGregory Price
220*ef3a43a6SGregory PriceFinally we have the `Memory Region` associated with the `Root Decoder`
221*ef3a43a6SGregory Price:code:`decoder0.0`.  This region describes the discrete region associated
222*ef3a43a6SGregory Pricewith the lone device.
223*ef3a43a6SGregory Price
224*ef3a43a6SGregory Price::
225*ef3a43a6SGregory Price
226*ef3a43a6SGregory Price                "regions:decoder0.0":[
227*ef3a43a6SGregory Price                    {
228*ef3a43a6SGregory Price                        "region":"region0",
229*ef3a43a6SGregory Price                        "resource":825975898112,
230*ef3a43a6SGregory Price                        "size":137438953472,
231*ef3a43a6SGregory Price                        "type":"ram",
232*ef3a43a6SGregory Price                        "interleave_ways":1,
233*ef3a43a6SGregory Price                        "decode_state":"commit",
234*ef3a43a6SGregory Price                        "mappings":[
235*ef3a43a6SGregory Price                            {
236*ef3a43a6SGregory Price                                "position":0,
237*ef3a43a6SGregory Price                                "memdev":"mem0",
238*ef3a43a6SGregory Price                                "decoder":"decoder5.0"
239*ef3a43a6SGregory Price                            }
240*ef3a43a6SGregory Price                        ]
241*ef3a43a6SGregory Price                    }
242*ef3a43a6SGregory Price                ]
243*ef3a43a6SGregory Price            }
244*ef3a43a6SGregory Price        ]
245*ef3a43a6SGregory Price    }
246*ef3a43a6SGregory Price  ]
247