Skip to content

Commit 97c5911

Browse files
committed
schemas: Split up PCI binding
The pci-bus.yaml binding is mostly for host bridges. However, there is a need to define a binding schema for PCI-PCI bridges and PCI devices. Much of the pci-bus.yaml applies to PCI-PCI bridges as well. Split the binding into separate bus, device, host-bridge and PCI-PCI bridge bindings. A complication is that pci-bus.yaml is already widely referenced, so we need to preserve its name and all the host bridge properties. Just leaving pci-bus.yaml as the host bridge binding would be confusing. Instead, move everything to the new binding files and make pci-bus.yaml just a reference to pci-host-bridge.yaml. Signed-off-by: Rob Herring <[email protected]>
1 parent 3fc752e commit 97c5911

File tree

5 files changed

+325
-217
lines changed

5 files changed

+325
-217
lines changed
+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# SPDX-License-Identifier: (GPL2.0-only OR BSD-2-Clause)
2+
# Copyright 2018 Linaro Ltd.
3+
# Copyright 2024 Arm Ltd.
4+
%YAML 1.2
5+
---
6+
$id: http://devicetree.org/schemas/pci/pci-bus-common.yaml#
7+
$schema: http://devicetree.org/meta-schemas/base.yaml#
8+
9+
title: PCI Bus Common Properties
10+
11+
description: |
12+
Common properties for PCI bus structure.
13+
14+
PCI bus bridges have standardized Device Tree bindings:
15+
16+
PCI Bus Binding to: IEEE Std 1275-1994
17+
http://www.devicetree.org/open-firmware/bindings/pci/pci2_1.pdf
18+
19+
And for the interrupt mapping part:
20+
21+
Open Firmware Recommended Practice: Interrupt Mapping
22+
http://www.devicetree.org/open-firmware/practice/imap/imap0_9d.pdf
23+
24+
maintainers:
25+
- Rob Herring <[email protected]>
26+
27+
properties:
28+
$nodename:
29+
pattern: "^pcie?@"
30+
31+
ranges:
32+
oneOf:
33+
- type: boolean
34+
- minItems: 1
35+
maxItems: 32 # Should be enough
36+
items:
37+
minItems: 5
38+
maxItems: 8
39+
additionalItems: true
40+
items:
41+
- enum:
42+
- 0x01000000
43+
- 0x02000000
44+
- 0x03000000
45+
- 0x42000000
46+
- 0x43000000
47+
- 0x81000000
48+
- 0x82000000
49+
- 0x83000000
50+
- 0xc2000000
51+
- 0xc3000000
52+
53+
dma-ranges:
54+
oneOf:
55+
- type: boolean
56+
- minItems: 1
57+
maxItems: 32 # Should be enough
58+
items:
59+
minItems: 5
60+
maxItems: 8
61+
additionalItems: true
62+
items:
63+
- enum:
64+
- 0x02000000
65+
- 0x03000000
66+
- 0x42000000
67+
- 0x43000000
68+
69+
"#address-cells":
70+
const: 3
71+
72+
"#size-cells":
73+
const: 2
74+
75+
device_type:
76+
const: pci
77+
78+
bus-range:
79+
$ref: /schemas/types.yaml#/definitions/uint32-array
80+
minItems: 2
81+
maxItems: 2
82+
items:
83+
maximum: 255
84+
85+
external-facing:
86+
description:
87+
When present, the port is externally facing. All bridges and endpoints
88+
downstream of this port are external to the machine. The OS can, for
89+
example, use this information to identify devices that cannot be
90+
trusted with relaxed DMA protection, as users could easily attach
91+
malicious devices to this port.
92+
type: boolean
93+
94+
"#interrupt-cells":
95+
const: 1
96+
97+
interrupt-map: true
98+
# minItems: 1
99+
# maxItems: 88 # 22 IDSEL x 4 IRQs
100+
# items:
101+
# minItems: 6 # 3 addr cells, 1 PCI IRQ cell, 1 phandle, 1+ parent addr and IRQ cells
102+
# maxItems: 16
103+
104+
interrupt-map-mask:
105+
items:
106+
- description: PCI high address cell
107+
minimum: 0
108+
maximum: 0xff00
109+
- description: PCI mid address cell
110+
const: 0
111+
- description: PCI low address cell
112+
const: 0
113+
- description: PCI IRQ cell
114+
minimum: 0
115+
maximum: 7
116+
117+
max-link-speed:
118+
description:
119+
If present this property specifies PCI generation number for link
120+
capability. Host drivers could add this as a strategy to avoid
121+
unnecessary operation for unsupported link speed, for instance, trying to
122+
do training for unsupported link speed, etc.
123+
$ref: /schemas/types.yaml#/definitions/uint32
124+
enum: [ 1, 2, 3, 4 ]
125+
126+
num-lanes:
127+
description: The number of PCIe lanes
128+
$ref: /schemas/types.yaml#/definitions/uint32
129+
enum: [ 1, 2, 4, 8, 16, 32 ]
130+
131+
reset-gpios:
132+
description: GPIO controlled connection to PERST# signal
133+
maxItems: 1
134+
135+
slot-power-limit-milliwatt:
136+
description:
137+
If present, specifies slot power limit in milliwatts.
138+
This property is invalid in host bridge nodes.
139+
maxItems: 1
140+
141+
supports-clkreq:
142+
description:
143+
If present this property specifies that CLKREQ signal routing exists from
144+
root port to downstream device and host bridge drivers can do programming
145+
which depends on CLKREQ signal existence. For example, programming root port
146+
not to advertise ASPM L1 Sub-States support if there is no CLKREQ signal.
147+
type: boolean
148+
149+
aspm-no-l0s:
150+
description: Disables ASPM L0s capability
151+
type: boolean
152+
153+
patternProperties:
154+
"@1?[0-9a-f](,[0-7])?$":
155+
type: object
156+
$ref: pci-device.yaml#
157+
additionalProperties: true
158+
159+
required:
160+
- device_type
161+
- ranges
162+
- "#address-cells"
163+
- "#size-cells"
164+
165+
additionalProperties: true

0 commit comments

Comments
 (0)