Skip to content

Commit e1ac611

Browse files
committed
dt-bindings: PCI: Convert generic host binding to DT schema
Convert the generic PCI host binding to DT schema. The derivative Juno, PLDA XpressRICH3-AXI, and Designware ECAM bindings all just vary in their compatible strings. The simplest way to convert those to schema is just add them into the common generic PCI host schema. The HiSilicon ECAM and Cavium ThunderX PEM bindings have an additional 'reg' entry, but are otherwise the same binding as well. Cc: Bjorn Helgaas <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Andrew Murray <[email protected]> Cc: Zhou Wang <[email protected]> Cc: Will Deacon <[email protected]> Cc: David Daney <[email protected]> Signed-off-by: Rob Herring <[email protected]>
1 parent 919ba6e commit e1ac611

File tree

9 files changed

+173
-281
lines changed

9 files changed

+173
-281
lines changed

Documentation/devicetree/bindings/pci/arm,juno-r1-pcie.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

Documentation/devicetree/bindings/pci/designware-pcie-ecam.txt

Lines changed: 0 additions & 42 deletions
This file was deleted.

Documentation/devicetree/bindings/pci/hisilicon-pcie.txt

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -41,45 +41,3 @@ Hip05 Example (note that Hip06 is the same except compatible):
4141
0x0 0 0 3 &mbigen_pcie 3 12
4242
0x0 0 0 4 &mbigen_pcie 4 13>;
4343
};
44-
45-
HiSilicon Hip06/Hip07 PCIe host bridge DT (almost-ECAM) description.
46-
47-
Some BIOSes place the host controller in a mode where it is ECAM
48-
compliant for all devices other than the root complex. In such cases,
49-
the host controller should be described as below.
50-
51-
The properties and their meanings are identical to those described in
52-
host-generic-pci.txt except as listed below.
53-
54-
Properties of the host controller node that differ from
55-
host-generic-pci.txt:
56-
57-
- compatible : Must be "hisilicon,hip06-pcie-ecam", or
58-
"hisilicon,hip07-pcie-ecam"
59-
60-
- reg : Two entries: First the ECAM configuration space for any
61-
other bus underneath the root bus. Second, the base
62-
and size of the HiSilicon host bridge registers include
63-
the RC's own config space.
64-
65-
Example:
66-
pcie0: pcie@a0090000 {
67-
compatible = "hisilicon,hip06-pcie-ecam";
68-
reg = <0 0xb0000000 0 0x2000000>, /* ECAM configuration space */
69-
<0 0xa0090000 0 0x10000>; /* host bridge registers */
70-
bus-range = <0 31>;
71-
msi-map = <0x0000 &its_dsa 0x0000 0x2000>;
72-
msi-map-mask = <0xffff>;
73-
#address-cells = <3>;
74-
#size-cells = <2>;
75-
device_type = "pci";
76-
dma-coherent;
77-
ranges = <0x02000000 0 0xb2000000 0x0 0xb2000000 0 0x5ff0000
78-
0x01000000 0 0 0 0xb7ff0000 0 0x10000>;
79-
#interrupt-cells = <1>;
80-
interrupt-map-mask = <0xf800 0 0 7>;
81-
interrupt-map = <0x0 0 0 1 &mbigen_pcie0 650 4
82-
0x0 0 0 2 &mbigen_pcie0 650 4
83-
0x0 0 0 3 &mbigen_pcie0 650 4
84-
0x0 0 0 4 &mbigen_pcie0 650 4>;
85-
};

Documentation/devicetree/bindings/pci/host-generic-pci.txt

Lines changed: 0 additions & 101 deletions
This file was deleted.
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pci/host-generic-pci.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Generic PCI host controller
8+
9+
maintainers:
10+
- Will Deacon <[email protected]>
11+
12+
description: |
13+
Firmware-initialised PCI host controllers and PCI emulations, such as the
14+
virtio-pci implementations found in kvmtool and other para-virtualised
15+
systems, do not require driver support for complexities such as regulator
16+
and clock management. In fact, the controller may not even require the
17+
configuration of a control interface by the operating system, instead
18+
presenting a set of fixed windows describing a subset of IO, Memory and
19+
Configuration Spaces.
20+
21+
Configuration Space is assumed to be memory-mapped (as opposed to being
22+
accessed via an ioport) and laid out with a direct correspondence to the
23+
geography of a PCI bus address by concatenating the various components to
24+
form an offset.
25+
26+
For CAM, this 24-bit offset is:
27+
28+
cfg_offset(bus, device, function, register) =
29+
bus << 16 | device << 11 | function << 8 | register
30+
31+
While ECAM extends this by 4 bits to accommodate 4k of function space:
32+
33+
cfg_offset(bus, device, function, register) =
34+
bus << 20 | device << 15 | function << 12 | register
35+
36+
properties:
37+
compatible:
38+
description: Depends on the layout of configuration space (CAM vs ECAM
39+
respectively). May also have more specific compatibles.
40+
oneOf:
41+
- description:
42+
PCIe host controller in Arm Juno based on PLDA XpressRICH3-AXI IP
43+
items:
44+
- const: arm,juno-r1-pcie
45+
- const: plda,xpressrich3-axi
46+
- const: pci-host-ecam-generic
47+
- description: |
48+
ThunderX PCI host controller for pass-1.x silicon
49+
50+
Firmware-initialized PCI host controller to on-chip devices found on
51+
some Cavium ThunderX processors. These devices have ECAM-based config
52+
access, but the BARs are all at fixed addresses. We handle the fixed
53+
addresses by synthesizing Enhanced Allocation (EA) capabilities for
54+
these devices.
55+
const: cavium,pci-host-thunder-ecam
56+
- description:
57+
Cavium ThunderX PEM firmware-initialized PCIe host controller
58+
const: cavium,pci-host-thunder-pem
59+
- description:
60+
HiSilicon Hip06/Hip07 PCIe host bridge in almost-ECAM mode. Some
61+
firmware places the host controller in a mode where it is ECAM
62+
compliant for all devices other than the root complex.
63+
enum:
64+
- hisilicon,hip06-pcie-ecam
65+
- hisilicon,hip07-pcie-ecam
66+
- description: |
67+
In some cases, firmware may already have configured the Synopsys
68+
DesignWare PCIe controller in RC mode with static ATU window mappings
69+
that cover all config, MMIO and I/O spaces in a [mostly] ECAM
70+
compatible fashion. In this case, there is no need for the OS to
71+
perform any low level setup of clocks, PHYs or device registers, nor
72+
is there any reason for the driver to reconfigure ATU windows for
73+
config and/or IO space accesses at runtime.
74+
75+
In cases where the IP was synthesized with a minimum ATU window size
76+
of 64 KB, it cannot be supported by the generic ECAM driver, because
77+
it requires special config space accessors that filter accesses to
78+
device #1 and beyond on the first bus.
79+
items:
80+
- enum:
81+
- marvell,armada8k-pcie-ecam
82+
- socionext,synquacer-pcie-ecam
83+
- const: snps,dw-pcie-ecam
84+
- description:
85+
CAM or ECAM compliant PCI host controllers without any quirks
86+
enum:
87+
- pci-host-cam-generic
88+
- pci-host-ecam-generic
89+
90+
reg:
91+
description:
92+
The Configuration Space base address and size, as accessed from the parent
93+
bus. The base address corresponds to the first bus in the "bus-range"
94+
property. If no "bus-range" is specified, this will be bus 0 (the
95+
default). Some host controllers have a 2nd non-compliant address range,
96+
so 2 entries are allowed.
97+
minItems: 1
98+
maxItems: 2
99+
100+
ranges:
101+
description:
102+
As described in IEEE Std 1275-1994, but must provide at least a
103+
definition of non-prefetchable memory. One or both of prefetchable Memory
104+
and IO Space may also be provided.
105+
minItems: 1
106+
maxItems: 3
107+
108+
dma-coherent: true
109+
110+
required:
111+
- compatible
112+
- reg
113+
- ranges
114+
115+
allOf:
116+
- $ref: /schemas/pci/pci-bus.yaml#
117+
- if:
118+
properties:
119+
compatible:
120+
contains:
121+
const: arm,juno-r1-pcie
122+
then:
123+
required:
124+
- dma-coherent
125+
126+
- if:
127+
properties:
128+
compatible:
129+
not:
130+
contains:
131+
enum:
132+
- cavium,pci-host-thunder-pem
133+
- hisilicon,hip06-pcie-ecam
134+
- hisilicon,hip07-pcie-ecam
135+
then:
136+
properties:
137+
reg:
138+
maxItems: 1
139+
140+
examples:
141+
- |
142+
143+
bus {
144+
#address-cells = <2>;
145+
#size-cells = <2>;
146+
pcie@40000000 {
147+
compatible = "pci-host-cam-generic";
148+
device_type = "pci";
149+
#address-cells = <3>;
150+
#size-cells = <2>;
151+
bus-range = <0x0 0x1>;
152+
153+
// CPU_PHYSICAL(2) SIZE(2)
154+
reg = <0x0 0x40000000 0x0 0x1000000>;
155+
156+
// BUS_ADDRESS(3) CPU_PHYSICAL(2) SIZE(2)
157+
ranges = <0x01000000 0x0 0x01000000 0x0 0x01000000 0x0 0x00010000>,
158+
<0x02000000 0x0 0x41000000 0x0 0x41000000 0x0 0x3f000000>;
159+
160+
#interrupt-cells = <0x1>;
161+
162+
// PCI_DEVICE(3) INT#(1) CONTROLLER(PHANDLE) CONTROLLER_DATA(3)
163+
interrupt-map = < 0x0 0x0 0x0 0x1 &gic 0x0 0x4 0x1>,
164+
< 0x800 0x0 0x0 0x1 &gic 0x0 0x5 0x1>,
165+
<0x1000 0x0 0x0 0x1 &gic 0x0 0x6 0x1>,
166+
<0x1800 0x0 0x0 0x1 &gic 0x0 0x7 0x1>;
167+
168+
// PCI_DEVICE(3) INT#(1)
169+
interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
170+
};
171+
};
172+
...

0 commit comments

Comments
 (0)