summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/pci/pci-ep.yaml
blob: 1868a10d5b10dbffcbf14b5737e51353f55b98d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pci/pci-ep.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: PCI Endpoint Controller

description: |
  Common properties for PCI Endpoint Controller Nodes.

maintainers:
  - Kishon Vijay Abraham I <kishon@kernel.org>
  - Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

properties:
  $nodename:
    pattern: "^pcie-ep@"

  iommu-map:
    $ref: /schemas/types.yaml#/definitions/uint32-matrix
    items:
      items:
        - description: Device ID (see msi-map) base
          maximum: 0x7ffff
        - description: phandle to IOMMU
        - description: IOMMU specifier base (currently always 1 cell)
        - description: Number of Device IDs
          maximum: 0x80000

  iommu-map-mask:
    description:
      A mask to be applied to each Device ID prior to being mapped to an
      IOMMU specifier per the iommu-map property.
    $ref: /schemas/types.yaml#/definitions/uint32
    maximum: 0x7ffff

  max-functions:
    description: Maximum number of functions that can be configured
    $ref: /schemas/types.yaml#/definitions/uint8
    minimum: 1
    default: 1
    maximum: 255

  max-virtual-functions:
    description: Array representing the number of virtual functions corresponding to each physical
      function
    $ref: /schemas/types.yaml#/definitions/uint8-array
    minItems: 1
    maxItems: 255

  max-link-speed:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [ 1, 2, 3, 4, 5, 6 ]

  msi-map:
    description: |
      Maps a Device ID to an MSI and associated MSI specifier data.

      A PCI Endpoint (EP) can use MSI as a doorbell function. This is achieved by
      mapping the MSI controller's address into PCI BAR<n>. The PCI Root Complex
      can write to this BAR<n>, triggering the EP to generate IRQ. This notifies
      the EP-side driver of an event, eliminating the need for the driver to
      continuously poll for status changes.

      However, the EP cannot rely on Requester ID (RID) because the RID is
      determined by the PCI topology of the host system. Since the EP may be
      connected to different PCI hosts, the RID can vary between systems and is
      therefore not a reliable identifier.

      Each EP can support up to 8 physical functions and up to 65,536 virtual
      functions. To uniquely identify each child device, a device ID is defined
      as
         - Bits [2:0] for the function number (func)
         - Bits [18:3] for the virtual function index (vfunc)

      The resulting device ID is computed as:

        (func & 0x7) | (vfunc << 3)

      The property is an arbitrary number of tuples of
      (device-id-base, msi, msi-base,length).

      Any Device ID id in the interval [id-base, id-base + length) is
      associated with the listed MSI, with the MSI specifier
      (id - id-base + msi-base).
    $ref: /schemas/types.yaml#/definitions/uint32-matrix
    items:
      items:
        - description: The Device ID base matched by the entry
          maximum: 0x7ffff
        - description: phandle to msi-controller node
        - description: (optional) The msi-specifier produced for the first
            Device ID matched by the entry. Currently, msi-specifier is 0 or
            1 cells.
        - description: The length of consecutive Device IDs following the
            Device ID base
          maximum: 0x80000

  msi-map-mask:
    description: A mask to be applied to each Device ID prior to being
      mapped to an msi-specifier per the msi-map property.
    $ref: /schemas/types.yaml#/definitions/uint32
    maximum: 0x7ffff

  num-lanes:
    description: maximum number of lanes
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 1
    default: 1
    maximum: 16

  linux,pci-domain:
    description:
      If present this property assigns a fixed PCI domain number to a PCI
      Endpoint Controller, otherwise an unstable (across boots) unique number
      will be assigned. It is required to either not set this property at all
      or set it for all PCI endpoint controllers in the system, otherwise
      potentially conflicting domain numbers may be assigned to endpoint
      controllers. The domain number for each endpoint controller in the system
      must be unique.
    $ref: /schemas/types.yaml#/definitions/uint32

required:
  - compatible

additionalProperties: true