162306a36Sopenharmony_ciPCI bus bridges have standardized Device Tree bindings:
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciPCI Bus Binding to: IEEE Std 1275-1994
462306a36Sopenharmony_cihttps://www.devicetree.org/open-firmware/bindings/pci/pci2_1.pdf
562306a36Sopenharmony_ci
662306a36Sopenharmony_ciAnd for the interrupt mapping part:
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciOpen Firmware Recommended Practice: Interrupt Mapping
962306a36Sopenharmony_cihttps://www.devicetree.org/open-firmware/practice/imap/imap0_9d.pdf
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ciAdditionally to the properties specified in the above standards a host bridge
1262306a36Sopenharmony_cidriver implementation may support the following properties:
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci- linux,pci-domain:
1562306a36Sopenharmony_ci   If present this property assigns a fixed PCI domain number to a host bridge,
1662306a36Sopenharmony_ci   otherwise an unstable (across boots) unique number will be assigned.
1762306a36Sopenharmony_ci   It is required to either not set this property at all or set it for all
1862306a36Sopenharmony_ci   host bridges in the system, otherwise potentially conflicting domain numbers
1962306a36Sopenharmony_ci   may be assigned to root buses behind different host bridges.  The domain
2062306a36Sopenharmony_ci   number for each host bridge in the system must be unique.
2162306a36Sopenharmony_ci- max-link-speed:
2262306a36Sopenharmony_ci   If present this property specifies PCI gen for link capability.  Host
2362306a36Sopenharmony_ci   drivers could add this as a strategy to avoid unnecessary operation for
2462306a36Sopenharmony_ci   unsupported link speed, for instance, trying to do training for
2562306a36Sopenharmony_ci   unsupported link speed, etc.  Must be '4' for gen4, '3' for gen3, '2'
2662306a36Sopenharmony_ci   for gen2, and '1' for gen1. Any other values are invalid.
2762306a36Sopenharmony_ci- reset-gpios:
2862306a36Sopenharmony_ci   If present this property specifies PERST# GPIO. Host drivers can parse the
2962306a36Sopenharmony_ci   GPIO and apply fundamental reset to endpoints.
3062306a36Sopenharmony_ci- supports-clkreq:
3162306a36Sopenharmony_ci   If present this property specifies that CLKREQ signal routing exists from
3262306a36Sopenharmony_ci   root port to downstream device and host bridge drivers can do programming
3362306a36Sopenharmony_ci   which depends on CLKREQ signal existence. For example, programming root port
3462306a36Sopenharmony_ci   not to advertise ASPM L1 Sub-States support if there is no CLKREQ signal.
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ciPCI-PCI Bridge properties
3762306a36Sopenharmony_ci-------------------------
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ciPCIe root ports and switch ports may be described explicitly in the device
4062306a36Sopenharmony_citree, as children of the host bridge node. Even though those devices are
4162306a36Sopenharmony_cidiscoverable by probing, it might be necessary to describe properties that
4262306a36Sopenharmony_ciaren't provided by standard PCIe capabilities.
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ciRequired properties:
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci- reg:
4762306a36Sopenharmony_ci   Identifies the PCI-PCI bridge. As defined in the IEEE Std 1275-1994
4862306a36Sopenharmony_ci   document, it is a five-cell address encoded as (phys.hi phys.mid
4962306a36Sopenharmony_ci   phys.lo size.hi size.lo). phys.hi should contain the device's BDF as
5062306a36Sopenharmony_ci   0b00000000 bbbbbbbb dddddfff 00000000. The other cells should be zero.
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci   The bus number is defined by firmware, through the standard bridge
5362306a36Sopenharmony_ci   configuration mechanism. If this port is a switch port, then firmware
5462306a36Sopenharmony_ci   allocates the bus number and writes it into the Secondary Bus Number
5562306a36Sopenharmony_ci   register of the bridge directly above this port. Otherwise, the bus
5662306a36Sopenharmony_ci   number of a root port is the first number in the bus-range property,
5762306a36Sopenharmony_ci   defaulting to zero.
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci   If firmware leaves the ARI Forwarding Enable bit set in the bridge
6062306a36Sopenharmony_ci   above this port, then phys.hi contains the 8-bit function number as
6162306a36Sopenharmony_ci   0b00000000 bbbbbbbb ffffffff 00000000. Note that the PCIe specification
6262306a36Sopenharmony_ci   recommends that firmware only leaves ARI enabled when it knows that the
6362306a36Sopenharmony_ci   OS is ARI-aware.
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ciOptional properties:
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci- external-facing:
6862306a36Sopenharmony_ci   When present, the port is external-facing. All bridges and endpoints
6962306a36Sopenharmony_ci   downstream of this port are external to the machine. The OS can, for
7062306a36Sopenharmony_ci   example, use this information to identify devices that cannot be
7162306a36Sopenharmony_ci   trusted with relaxed DMA protection, as users could easily attach
7262306a36Sopenharmony_ci   malicious devices to this port.
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ciExample:
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_cipcie@10000000 {
7762306a36Sopenharmony_ci	compatible = "pci-host-ecam-generic";
7862306a36Sopenharmony_ci	...
7962306a36Sopenharmony_ci	pcie@0008 {
8062306a36Sopenharmony_ci		/* Root port 00:01.0 is external-facing */
8162306a36Sopenharmony_ci		reg = <0x00000800 0 0 0 0>;
8262306a36Sopenharmony_ci		external-facing;
8362306a36Sopenharmony_ci	};
8462306a36Sopenharmony_ci};
85