xref: /openbmc/linux/Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt (revision d8f64797c5ff3351a54830bba2cbc7e0b00e4613)
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.
45*d8f64797SStephen Warren- clocks: Must contain an entry for each entry in clock-names.
46*d8f64797SStephen Warren  See ../clocks/clock-bindings.txt for details.
47d1523b52SThierry Reding- clock-names: Must include the following entries:
48*d8f64797SStephen Warren  - pex
49*d8f64797SStephen Warren  - afi
50*d8f64797SStephen Warren  - pcie_xclk
51*d8f64797SStephen Warren  - pll_e
52*d8f64797SStephen Warren  - cml (not required for Tegra20)
53d1523b52SThierry Reding
54d1523b52SThierry RedingRoot ports are defined as subnodes of the PCIe controller node.
55d1523b52SThierry Reding
56d1523b52SThierry RedingRequired properties:
57d1523b52SThierry Reding- device_type: Must be "pci"
58d1523b52SThierry Reding- assigned-addresses: Address and size of the port configuration registers
59d1523b52SThierry Reding- reg: PCI bus address of the root port
60d1523b52SThierry Reding- #address-cells: Must be 3
61d1523b52SThierry Reding- #size-cells: Must be 2
62d1523b52SThierry Reding- ranges: Sub-ranges distributed from the PCIe controller node. An empty
63d1523b52SThierry Reding  property is sufficient.
64d1523b52SThierry Reding- nvidia,num-lanes: Number of lanes to use for this port. Valid combinations
65d1523b52SThierry Reding  are:
66d1523b52SThierry Reding  - Root port 0 uses 4 lanes, root port 1 is unused.
67d1523b52SThierry Reding  - Both root ports use 2 lanes.
68d1523b52SThierry Reding
69d1523b52SThierry RedingExample:
70d1523b52SThierry Reding
71d1523b52SThierry RedingSoC DTSI:
72d1523b52SThierry Reding
73d1523b52SThierry Reding	pcie-controller {
74d1523b52SThierry Reding		compatible = "nvidia,tegra20-pcie";
75d1523b52SThierry Reding		device_type = "pci";
76d1523b52SThierry Reding		reg = <0x80003000 0x00000800   /* PADS registers */
77d1523b52SThierry Reding		       0x80003800 0x00000200   /* AFI registers */
78d1523b52SThierry Reding		       0x90000000 0x10000000>; /* configuration space */
79d1523b52SThierry Reding		reg-names = "pads", "afi", "cs";
80d1523b52SThierry Reding		interrupts = <0 98 0x04   /* controller interrupt */
81d1523b52SThierry Reding		              0 99 0x04>; /* MSI interrupt */
82d1523b52SThierry Reding		interrupt-names = "intr", "msi";
83d1523b52SThierry Reding
84d1523b52SThierry Reding		bus-range = <0x00 0xff>;
85d1523b52SThierry Reding		#address-cells = <3>;
86d1523b52SThierry Reding		#size-cells = <2>;
87d1523b52SThierry Reding
88d1523b52SThierry Reding		ranges = <0x82000000 0 0x80000000 0x80000000 0 0x00001000   /* port 0 registers */
89d1523b52SThierry Reding			  0x82000000 0 0x80001000 0x80001000 0 0x00001000   /* port 1 registers */
90d1523b52SThierry Reding			  0x81000000 0 0          0x82000000 0 0x00010000   /* downstream I/O */
91d1523b52SThierry Reding			  0x82000000 0 0xa0000000 0xa0000000 0 0x10000000   /* non-prefetchable memory */
92d1523b52SThierry Reding			  0xc2000000 0 0xb0000000 0xb0000000 0 0x10000000>; /* prefetchable memory */
93d1523b52SThierry Reding
94d1523b52SThierry Reding		clocks = <&tegra_car 70>, <&tegra_car 72>, <&tegra_car 74>,
95d1523b52SThierry Reding			 <&tegra_car 118>;
96d1523b52SThierry Reding		clock-names = "pex", "afi", "pcie_xclk", "pll_e";
97d1523b52SThierry Reding		status = "disabled";
98d1523b52SThierry Reding
99d1523b52SThierry Reding		pci@1,0 {
100d1523b52SThierry Reding			device_type = "pci";
101d1523b52SThierry Reding			assigned-addresses = <0x82000800 0 0x80000000 0 0x1000>;
102d1523b52SThierry Reding			reg = <0x000800 0 0 0 0>;
103d1523b52SThierry Reding			status = "disabled";
104d1523b52SThierry Reding
105d1523b52SThierry Reding			#address-cells = <3>;
106d1523b52SThierry Reding			#size-cells = <2>;
107d1523b52SThierry Reding
108d1523b52SThierry Reding			ranges;
109d1523b52SThierry Reding
110d1523b52SThierry Reding			nvidia,num-lanes = <2>;
111d1523b52SThierry Reding		};
112d1523b52SThierry Reding
113d1523b52SThierry Reding		pci@2,0 {
114d1523b52SThierry Reding			device_type = "pci";
115d1523b52SThierry Reding			assigned-addresses = <0x82001000 0 0x80001000 0 0x1000>;
116d1523b52SThierry Reding			reg = <0x001000 0 0 0 0>;
117d1523b52SThierry Reding			status = "disabled";
118d1523b52SThierry Reding
119d1523b52SThierry Reding			#address-cells = <3>;
120d1523b52SThierry Reding			#size-cells = <2>;
121d1523b52SThierry Reding
122d1523b52SThierry Reding			ranges;
123d1523b52SThierry Reding
124d1523b52SThierry Reding			nvidia,num-lanes = <2>;
125d1523b52SThierry Reding		};
126d1523b52SThierry Reding	};
127d1523b52SThierry Reding
128d1523b52SThierry Reding
129d1523b52SThierry RedingBoard DTS:
130d1523b52SThierry Reding
131d1523b52SThierry Reding	pcie-controller {
132d1523b52SThierry Reding		status = "okay";
133d1523b52SThierry Reding
134d1523b52SThierry Reding		vdd-supply = <&pci_vdd_reg>;
135d1523b52SThierry Reding		pex-clk-supply = <&pci_clk_reg>;
136d1523b52SThierry Reding
137d1523b52SThierry Reding		/* root port 00:01.0 */
138d1523b52SThierry Reding		pci@1,0 {
139d1523b52SThierry Reding			status = "okay";
140d1523b52SThierry Reding
141d1523b52SThierry Reding			/* bridge 01:00.0 (optional) */
142d1523b52SThierry Reding			pci@0,0 {
143d1523b52SThierry Reding				reg = <0x010000 0 0 0 0>;
144d1523b52SThierry Reding
145d1523b52SThierry Reding				#address-cells = <3>;
146d1523b52SThierry Reding				#size-cells = <2>;
147d1523b52SThierry Reding
148d1523b52SThierry Reding				device_type = "pci";
149d1523b52SThierry Reding
150d1523b52SThierry Reding				/* endpoint 02:00.0 */
151d1523b52SThierry Reding				pci@0,0 {
152d1523b52SThierry Reding					reg = <0x020000 0 0 0 0>;
153d1523b52SThierry Reding				};
154d1523b52SThierry Reding			};
155d1523b52SThierry Reding		};
156d1523b52SThierry Reding	};
157d1523b52SThierry Reding
158d1523b52SThierry RedingNote that devices on the PCI bus are dynamically discovered using PCI's bus
159d1523b52SThierry Redingenumeration and therefore don't need corresponding device nodes in DT. However
160d1523b52SThierry Redingif a device on the PCI bus provides a non-probeable bus such as I2C or SPI,
161d1523b52SThierry Redingdevice nodes need to be added in order to allow the bus' children to be
162d1523b52SThierry Redinginstantiated at the proper location in the operating system's device tree (as
163d1523b52SThierry Redingillustrated by the optional nodes in the example above).
164