ACPI: property: graph: Update graph documentation to use generic references

Instead of port and endpoint properties for representing ports and
endpoints, use the keys of the hierarchical data extension references
when referring to the port and endpoint nodes. Additionally, use "reg"
properties as in Device Tree to specify the number of the port or the
endpoint.

The keys of the port nodes begin with "port" and the keys of the endpoint
nodes begin with "endpoint", both followed by "@" character and the number
of the port or the endpoint.

These changes have the advantage that no ACPI specific properties need to
be added to refer to non-device nodes. Additionally, using the name of the
node instead of an integer property inside the node is easier to parse in
code and easier for humans to understand.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Sakari Ailus 2018-07-17 17:19:21 +03:00 committed by Rafael J. Wysocki
parent e49363e96f
commit a4138e7c12
2 changed files with 36 additions and 30 deletions

View file

@ -75,6 +75,7 @@ Example
}) })
} }
Please also see a graph example in graph.txt .
References References
---------- ----------

View file

@ -38,34 +38,39 @@ represents a connection to that interface.
All port nodes are located under the device's "_DSD" node in the hierarchical All port nodes are located under the device's "_DSD" node in the hierarchical
data extension tree. The data extension related to each port node must begin data extension tree. The data extension related to each port node must begin
with "port" and must be followed by the number of the port as its key. The with "port" and must be followed by the "@" character and the number of the port
target object it refers to should be called "PRTX", where "X" is the number of as its key. The target object it refers to should be called "PRTX", where "X" is
the port. An example of such a package would be: the number of the port. An example of such a package would be:
Package() { "port4", PRT4 } Package() { "port@4", PRT4 }
Further on, endpoints are located under the port nodes. The hierarchical data Further on, endpoints are located under the port nodes. The hierarchical
extension key of the endpoint nodes must begin with "endpoint" and must be data extension key of the endpoint nodes must begin with
followed by the number of the endpoint. The object it refers to should be called "endpoint" and must be followed by the "@" character and the number of the
"EPXY", where "X" is the number of the port and "Y" is the number of the endpoint. The object it refers to should be called "EPXY", where "X" is the
endpoint. An example of such a package would be: number of the port and "Y" is the number of the endpoint. An example of such a
package would be:
Package() { "endpoint0", EP40 } Package() { "endpoint@0", EP40 }
Each port node contains a property extension key "port", the value of Each port node contains a property extension key "port", the value of which is
which is the number of the port. Each endpoint is similarly numbered the number of the port. Each endpoint is similarly numbered with a property
with a property extension key "endpoint". Port numbers must be unique within a extension key "reg", the value of which is the number of the endpoint. Port
device and endpoint numbers must be unique within a port. If a device object numbers must be unique within a device and endpoint numbers must be unique
may only has a single port, then the number of that port shall be zero. within a port. If a device object may only has a single port, then the number
Similarly, if a port may only have a single endpoint, the number of that of that port shall be zero. Similarly, if a port may only have a single
endpoint shall be zero. endpoint, the number of that endpoint shall be zero.
The endpoint reference uses property extension with "remote-endpoint" property The endpoint reference uses property extension with "remote-endpoint" property
name followed by a reference in the same package. Such references consist of the name followed by a reference in the same package. Such references consist of the
the remote device reference, number of the port in the device and finally the the remote device reference, the first package entry of the port data extension
number of the endpoint in that port. Individual references thus appear as: reference under the device and finally the first package entry of the endpoint
data extension reference under the port. Individual references thus appear as:
Package() { device, port_number, endpoint_number } Package() { device, "port@X", "endpoint@Y" }
In the above example, "X" is the number of the port and "Y" is the number of the
endpoint.
The references to endpoints must be always done both ways, to the The references to endpoints must be always done both ways, to the
remote endpoint and back from the referred remote endpoint node. remote endpoint and back from the referred remote endpoint node.
@ -83,24 +88,24 @@ A simple example of this is show below:
}, },
ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
Package () { Package () {
Package () { "port0", PRT0 }, Package () { "port@0", PRT0 },
} }
}) })
Name (PRT0, Package() { Name (PRT0, Package() {
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package () { Package () {
Package () { "port", 0 }, Package () { "reg", 0 },
}, },
ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
Package () { Package () {
Package () { "endpoint0", EP00 }, Package () { "endpoint@0", EP00 },
} }
}) })
Name (EP00, Package() { Name (EP00, Package() {
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package () { Package () {
Package () { "endpoint", 0 }, Package () { "reg", 0 },
Package () { "remote-endpoint", Package() { \_SB.PCI0.ISP, 4, 0 } }, Package () { "remote-endpoint", Package() { \_SB.PCI0.ISP, "port@4", "endpoint@0" } },
} }
}) })
} }
@ -113,26 +118,26 @@ A simple example of this is show below:
Name (_DSD, Package () { Name (_DSD, Package () {
ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
Package () { Package () {
Package () { "port4", PRT4 }, Package () { "port@4", PRT4 },
} }
}) })
Name (PRT4, Package() { Name (PRT4, Package() {
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package () { Package () {
Package () { "port", 4 }, /* CSI-2 port number */ Package () { "reg", 4 }, /* CSI-2 port number */
}, },
ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
Package () { Package () {
Package () { "endpoint0", EP40 }, Package () { "endpoint@0", EP40 },
} }
}) })
Name (EP40, Package() { Name (EP40, Package() {
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package () { Package () {
Package () { "endpoint", 0 }, Package () { "reg", 0 },
Package () { "remote-endpoint", Package () { \_SB.PCI0.I2C2.CAM0, 0, 0 } }, Package () { "remote-endpoint", Package () { \_SB.PCI0.I2C2.CAM0, "port@0", "endpoint@0" } },
} }
}) })
} }