xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/pci/pci.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunPCI bus bridges have standardized Device Tree bindings:
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunPCI Bus Binding to: IEEE Std 1275-1994
4*4882a593Smuzhiyunhttps://www.devicetree.org/open-firmware/bindings/pci/pci2_1.pdf
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunAnd for the interrupt mapping part:
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunOpen Firmware Recommended Practice: Interrupt Mapping
9*4882a593Smuzhiyunhttps://www.devicetree.org/open-firmware/practice/imap/imap0_9d.pdf
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunAdditionally to the properties specified in the above standards a host bridge
12*4882a593Smuzhiyundriver implementation may support the following properties:
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun- linux,pci-domain:
15*4882a593Smuzhiyun   If present this property assigns a fixed PCI domain number to a host bridge,
16*4882a593Smuzhiyun   otherwise an unstable (across boots) unique number will be assigned.
17*4882a593Smuzhiyun   It is required to either not set this property at all or set it for all
18*4882a593Smuzhiyun   host bridges in the system, otherwise potentially conflicting domain numbers
19*4882a593Smuzhiyun   may be assigned to root buses behind different host bridges.  The domain
20*4882a593Smuzhiyun   number for each host bridge in the system must be unique.
21*4882a593Smuzhiyun- max-link-speed:
22*4882a593Smuzhiyun   If present this property specifies PCI gen for link capability.  Host
23*4882a593Smuzhiyun   drivers could add this as a strategy to avoid unnecessary operation for
24*4882a593Smuzhiyun   unsupported link speed, for instance, trying to do training for
25*4882a593Smuzhiyun   unsupported link speed, etc.  Must be '4' for gen4, '3' for gen3, '2'
26*4882a593Smuzhiyun   for gen2, and '1' for gen1. Any other values are invalid.
27*4882a593Smuzhiyun- reset-gpios:
28*4882a593Smuzhiyun   If present this property specifies PERST# GPIO. Host drivers can parse the
29*4882a593Smuzhiyun   GPIO and apply fundamental reset to endpoints.
30*4882a593Smuzhiyun- supports-clkreq:
31*4882a593Smuzhiyun   If present this property specifies that CLKREQ signal routing exists from
32*4882a593Smuzhiyun   root port to downstream device and host bridge drivers can do programming
33*4882a593Smuzhiyun   which depends on CLKREQ signal existence. For example, programming root port
34*4882a593Smuzhiyun   not to advertise ASPM L1 Sub-States support if there is no CLKREQ signal.
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunPCI-PCI Bridge properties
37*4882a593Smuzhiyun-------------------------
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunPCIe root ports and switch ports may be described explicitly in the device
40*4882a593Smuzhiyuntree, as children of the host bridge node. Even though those devices are
41*4882a593Smuzhiyundiscoverable by probing, it might be necessary to describe properties that
42*4882a593Smuzhiyunaren't provided by standard PCIe capabilities.
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunRequired properties:
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun- reg:
47*4882a593Smuzhiyun   Identifies the PCI-PCI bridge. As defined in the IEEE Std 1275-1994
48*4882a593Smuzhiyun   document, it is a five-cell address encoded as (phys.hi phys.mid
49*4882a593Smuzhiyun   phys.lo size.hi size.lo). phys.hi should contain the device's BDF as
50*4882a593Smuzhiyun   0b00000000 bbbbbbbb dddddfff 00000000. The other cells should be zero.
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun   The bus number is defined by firmware, through the standard bridge
53*4882a593Smuzhiyun   configuration mechanism. If this port is a switch port, then firmware
54*4882a593Smuzhiyun   allocates the bus number and writes it into the Secondary Bus Number
55*4882a593Smuzhiyun   register of the bridge directly above this port. Otherwise, the bus
56*4882a593Smuzhiyun   number of a root port is the first number in the bus-range property,
57*4882a593Smuzhiyun   defaulting to zero.
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun   If firmware leaves the ARI Forwarding Enable bit set in the bridge
60*4882a593Smuzhiyun   above this port, then phys.hi contains the 8-bit function number as
61*4882a593Smuzhiyun   0b00000000 bbbbbbbb ffffffff 00000000. Note that the PCIe specification
62*4882a593Smuzhiyun   recommends that firmware only leaves ARI enabled when it knows that the
63*4882a593Smuzhiyun   OS is ARI-aware.
64*4882a593Smuzhiyun
65*4882a593SmuzhiyunOptional properties:
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun- external-facing:
68*4882a593Smuzhiyun   When present, the port is external-facing. All bridges and endpoints
69*4882a593Smuzhiyun   downstream of this port are external to the machine. The OS can, for
70*4882a593Smuzhiyun   example, use this information to identify devices that cannot be
71*4882a593Smuzhiyun   trusted with relaxed DMA protection, as users could easily attach
72*4882a593Smuzhiyun   malicious devices to this port.
73*4882a593Smuzhiyun
74*4882a593SmuzhiyunExample:
75*4882a593Smuzhiyun
76*4882a593Smuzhiyunpcie@10000000 {
77*4882a593Smuzhiyun	compatible = "pci-host-ecam-generic";
78*4882a593Smuzhiyun	...
79*4882a593Smuzhiyun	pcie@0008 {
80*4882a593Smuzhiyun		/* Root port 00:01.0 is external-facing */
81*4882a593Smuzhiyun		reg = <0x00000800 0 0 0 0>;
82*4882a593Smuzhiyun		external-facing;
83*4882a593Smuzhiyun	};
84*4882a593Smuzhiyun};
85