xref: /openbmc/linux/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt (revision 07999587b7bbedbb6556c94f70227a99e66f19aa)
1d1523b52SThierry RedingNVIDIA Tegra PCIe controller
2d1523b52SThierry Reding
3d1523b52SThierry RedingRequired properties:
494716cddSJay Agarwal- compatible: "nvidia,tegra20-pcie" or "nvidia,tegra30-pcie"
5d1523b52SThierry Reding- device_type: Must be "pci"
6d1523b52SThierry Reding- reg: A list of physical base address and length for each set of controller
7d1523b52SThierry Reding  registers. Must contain an entry for each entry in the reg-names property.
8d1523b52SThierry Reding- reg-names: Must include the following entries:
9d1523b52SThierry Reding  "pads": PADS registers
10d1523b52SThierry Reding  "afi": AFI registers
11d1523b52SThierry Reding  "cs": configuration space region
12d1523b52SThierry Reding- interrupts: A list of interrupt outputs of the controller. Must contain an
13d1523b52SThierry Reding  entry for each entry in the interrupt-names property.
14d1523b52SThierry Reding- interrupt-names: Must include the following entries:
15d1523b52SThierry Reding  "intr": The Tegra interrupt that is asserted for controller interrupts
16d1523b52SThierry Reding  "msi": The Tegra interrupt that is asserted when an MSI is received
17d1523b52SThierry Reding- pex-clk-supply: Supply voltage for internal reference clock
18d1523b52SThierry Reding- vdd-supply: Power supply for controller (1.05V)
1994716cddSJay Agarwal- avdd-supply: Power supply for controller (1.05V) (not required for Tegra20)
20d1523b52SThierry Reding- bus-range: Range of bus numbers associated with this controller
21d1523b52SThierry Reding- #address-cells: Address representation for root ports (must be 3)
22d1523b52SThierry Reding  - cell 0 specifies the bus and device numbers of the root port:
23d1523b52SThierry Reding    [23:16]: bus number
24d1523b52SThierry Reding    [15:11]: device number
25d1523b52SThierry Reding  - cell 1 denotes the upper 32 address bits and should be 0
26d1523b52SThierry Reding  - cell 2 contains the lower 32 address bits and is used to translate to the
27d1523b52SThierry Reding    CPU address space
28d1523b52SThierry Reding- #size-cells: Size representation for root ports (must be 2)
29d1523b52SThierry Reding- ranges: Describes the translation of addresses for root ports and standard
30d1523b52SThierry Reding  PCI regions. The entries must be 6 cells each, where the first three cells
31d1523b52SThierry Reding  correspond to the address as described for the #address-cells property
32d1523b52SThierry Reding  above, the fourth cell is the physical CPU address to translate to and the
33d1523b52SThierry Reding  fifth and six cells are as described for the #size-cells property above.
34d1523b52SThierry Reding  - The first two entries are expected to translate the addresses for the root
35d1523b52SThierry Reding    port registers, which are referenced by the assigned-addresses property of
36d1523b52SThierry Reding    the root port nodes (see below).
37d1523b52SThierry Reding  - The remaining entries setup the mapping for the standard I/O, memory and
38d1523b52SThierry Reding    prefetchable PCI regions. The first cell determines the type of region
39d1523b52SThierry Reding    that is setup:
40d1523b52SThierry Reding    - 0x81000000: I/O memory region
41d1523b52SThierry Reding    - 0x82000000: non-prefetchable memory region
42d1523b52SThierry Reding    - 0xc2000000: prefetchable memory region
43d1523b52SThierry Reding  Please refer to the standard PCI bus binding document for a more detailed
44d1523b52SThierry Reding  explanation.
45d8f64797SStephen Warren- clocks: Must contain an entry for each entry in clock-names.
46d8f64797SStephen Warren  See ../clocks/clock-bindings.txt for details.
47d1523b52SThierry Reding- clock-names: Must include the following entries:
48d8f64797SStephen Warren  - pex
49d8f64797SStephen Warren  - afi
50d8f64797SStephen Warren  - pll_e
51d8f64797SStephen Warren  - cml (not required for Tegra20)
52*07999587SStephen Warren- resets: Must contain an entry for each entry in reset-names.
53*07999587SStephen Warren  See ../reset/reset.txt for details.
54*07999587SStephen Warren- reset-names: Must include the following entries:
55*07999587SStephen Warren  - pex
56*07999587SStephen Warren  - afi
57*07999587SStephen Warren  - pcie_x
58d1523b52SThierry Reding
59d1523b52SThierry RedingRoot ports are defined as subnodes of the PCIe controller node.
60d1523b52SThierry Reding
61d1523b52SThierry RedingRequired properties:
62d1523b52SThierry Reding- device_type: Must be "pci"
63d1523b52SThierry Reding- assigned-addresses: Address and size of the port configuration registers
64d1523b52SThierry Reding- reg: PCI bus address of the root port
65d1523b52SThierry Reding- #address-cells: Must be 3
66d1523b52SThierry Reding- #size-cells: Must be 2
67d1523b52SThierry Reding- ranges: Sub-ranges distributed from the PCIe controller node. An empty
68d1523b52SThierry Reding  property is sufficient.
69d1523b52SThierry Reding- nvidia,num-lanes: Number of lanes to use for this port. Valid combinations
70d1523b52SThierry Reding  are:
71d1523b52SThierry Reding  - Root port 0 uses 4 lanes, root port 1 is unused.
72d1523b52SThierry Reding  - Both root ports use 2 lanes.
73d1523b52SThierry Reding
74d1523b52SThierry RedingExample:
75d1523b52SThierry Reding
76d1523b52SThierry RedingSoC DTSI:
77d1523b52SThierry Reding
78d1523b52SThierry Reding	pcie-controller {
79d1523b52SThierry Reding		compatible = "nvidia,tegra20-pcie";
80d1523b52SThierry Reding		device_type = "pci";
81d1523b52SThierry Reding		reg = <0x80003000 0x00000800   /* PADS registers */
82d1523b52SThierry Reding		       0x80003800 0x00000200   /* AFI registers */
83d1523b52SThierry Reding		       0x90000000 0x10000000>; /* configuration space */
84d1523b52SThierry Reding		reg-names = "pads", "afi", "cs";
85d1523b52SThierry Reding		interrupts = <0 98 0x04   /* controller interrupt */
86d1523b52SThierry Reding		              0 99 0x04>; /* MSI interrupt */
87d1523b52SThierry Reding		interrupt-names = "intr", "msi";
88d1523b52SThierry Reding
89d1523b52SThierry Reding		bus-range = <0x00 0xff>;
90d1523b52SThierry Reding		#address-cells = <3>;
91d1523b52SThierry Reding		#size-cells = <2>;
92d1523b52SThierry Reding
93d1523b52SThierry Reding		ranges = <0x82000000 0 0x80000000 0x80000000 0 0x00001000   /* port 0 registers */
94d1523b52SThierry Reding			  0x82000000 0 0x80001000 0x80001000 0 0x00001000   /* port 1 registers */
95d1523b52SThierry Reding			  0x81000000 0 0          0x82000000 0 0x00010000   /* downstream I/O */
96d1523b52SThierry Reding			  0x82000000 0 0xa0000000 0xa0000000 0 0x10000000   /* non-prefetchable memory */
97d1523b52SThierry Reding			  0xc2000000 0 0xb0000000 0xb0000000 0 0x10000000>; /* prefetchable memory */
98d1523b52SThierry Reding
99*07999587SStephen Warren		clocks = <&tegra_car 70>, <&tegra_car 72>, <&tegra_car 118>;
100*07999587SStephen Warren		clock-names = "pex", "afi", "pll_e";
101*07999587SStephen Warren		resets = <&tegra_car 70>, <&tegra_car 72>, <&tegra_car 74>;
102*07999587SStephen Warren		reset-names = "pex", "afi", "pcie_x";
103d1523b52SThierry Reding		status = "disabled";
104d1523b52SThierry Reding
105d1523b52SThierry Reding		pci@1,0 {
106d1523b52SThierry Reding			device_type = "pci";
107d1523b52SThierry Reding			assigned-addresses = <0x82000800 0 0x80000000 0 0x1000>;
108d1523b52SThierry Reding			reg = <0x000800 0 0 0 0>;
109d1523b52SThierry Reding			status = "disabled";
110d1523b52SThierry Reding
111d1523b52SThierry Reding			#address-cells = <3>;
112d1523b52SThierry Reding			#size-cells = <2>;
113d1523b52SThierry Reding
114d1523b52SThierry Reding			ranges;
115d1523b52SThierry Reding
116d1523b52SThierry Reding			nvidia,num-lanes = <2>;
117d1523b52SThierry Reding		};
118d1523b52SThierry Reding
119d1523b52SThierry Reding		pci@2,0 {
120d1523b52SThierry Reding			device_type = "pci";
121d1523b52SThierry Reding			assigned-addresses = <0x82001000 0 0x80001000 0 0x1000>;
122d1523b52SThierry Reding			reg = <0x001000 0 0 0 0>;
123d1523b52SThierry Reding			status = "disabled";
124d1523b52SThierry Reding
125d1523b52SThierry Reding			#address-cells = <3>;
126d1523b52SThierry Reding			#size-cells = <2>;
127d1523b52SThierry Reding
128d1523b52SThierry Reding			ranges;
129d1523b52SThierry Reding
130d1523b52SThierry Reding			nvidia,num-lanes = <2>;
131d1523b52SThierry Reding		};
132d1523b52SThierry Reding	};
133d1523b52SThierry Reding
134d1523b52SThierry Reding
135d1523b52SThierry RedingBoard DTS:
136d1523b52SThierry Reding
137d1523b52SThierry Reding	pcie-controller {
138d1523b52SThierry Reding		status = "okay";
139d1523b52SThierry Reding
140d1523b52SThierry Reding		vdd-supply = <&pci_vdd_reg>;
141d1523b52SThierry Reding		pex-clk-supply = <&pci_clk_reg>;
142d1523b52SThierry Reding
143d1523b52SThierry Reding		/* root port 00:01.0 */
144d1523b52SThierry Reding		pci@1,0 {
145d1523b52SThierry Reding			status = "okay";
146d1523b52SThierry Reding
147d1523b52SThierry Reding			/* bridge 01:00.0 (optional) */
148d1523b52SThierry Reding			pci@0,0 {
149d1523b52SThierry Reding				reg = <0x010000 0 0 0 0>;
150d1523b52SThierry Reding
151d1523b52SThierry Reding				#address-cells = <3>;
152d1523b52SThierry Reding				#size-cells = <2>;
153d1523b52SThierry Reding
154d1523b52SThierry Reding				device_type = "pci";
155d1523b52SThierry Reding
156d1523b52SThierry Reding				/* endpoint 02:00.0 */
157d1523b52SThierry Reding				pci@0,0 {
158d1523b52SThierry Reding					reg = <0x020000 0 0 0 0>;
159d1523b52SThierry Reding				};
160d1523b52SThierry Reding			};
161d1523b52SThierry Reding		};
162d1523b52SThierry Reding	};
163d1523b52SThierry Reding
164d1523b52SThierry RedingNote that devices on the PCI bus are dynamically discovered using PCI's bus
165d1523b52SThierry Redingenumeration and therefore don't need corresponding device nodes in DT. However
166d1523b52SThierry Redingif a device on the PCI bus provides a non-probeable bus such as I2C or SPI,
167d1523b52SThierry Redingdevice nodes need to be added in order to allow the bus' children to be
168d1523b52SThierry Redinginstantiated at the proper location in the operating system's device tree (as
169d1523b52SThierry Redingillustrated by the optional nodes in the example above).
170