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