Documentation: PCI: Add specification for the PCI vNTB function device
[platform/kernel/linux-rpi.git] / Documentation / PCI / endpoint / pci-vntb-function.rst
1 .. SPDX-License-Identifier: GPL-2.0
2
3 =================
4 PCI vNTB Function
5 =================
6
7 :Author: Frank Li <Frank.Li@nxp.com>
8
9 The difference between PCI NTB function and PCI vNTB function is
10
11 PCI NTB function need at two endpoint instances and connect HOST1
12 and HOST2.
13
14 PCI vNTB function only use one host and one endpoint(EP), use NTB
15 connect EP and PCI host
16
17 .. code-block:: text
18
19
20   +------------+         +---------------------------------------+
21   |            |         |                                       |
22   +------------+         |                        +--------------+
23   | NTB        |         |                        | NTB          |
24   | NetDev     |         |                        | NetDev       |
25   +------------+         |                        +--------------+
26   | NTB        |         |                        | NTB          |
27   | Transfer   |         |                        | Transfer     |
28   +------------+         |                        +--------------+
29   |            |         |                        |              |
30   |  PCI NTB   |         |                        |              |
31   |    EPF     |         |                        |              |
32   |   Driver   |         |                        | PCI Virtual  |
33   |            |         +---------------+        | NTB Driver   |
34   |            |         | PCI EP NTB    |<------>|              |
35   |            |         |  FN Driver    |        |              |
36   +------------+         +---------------+        +--------------+
37   |            |         |               |        |              |
38   |  PCI BUS   | <-----> |  PCI EP BUS   |        |  Virtual PCI |
39   |            |  PCI    |               |        |     BUS      |
40   +------------+         +---------------+--------+--------------+
41       PCI RC                        PCI EP
42
43 Constructs used for Implementing vNTB
44 =====================================
45
46         1) Config Region
47         2) Self Scratchpad Registers
48         3) Peer Scratchpad Registers
49         4) Doorbell (DB) Registers
50         5) Memory Window (MW)
51
52
53 Config Region:
54 --------------
55
56 It is same as PCI NTB Function driver
57
58 Scratchpad Registers:
59 ---------------------
60
61   It is appended after Config region.
62
63   +--------------------------------------------------+ Base
64   |                                                  |
65   |                                                  |
66   |                                                  |
67   |          Common Config Register                  |
68   |                                                  |
69   |                                                  |
70   |                                                  |
71   +-----------------------+--------------------------+ Base + span_offset
72   |                       |                          |
73   |    Peer Span Space    |    Span Space            |
74   |                       |                          |
75   |                       |                          |
76   +-----------------------+--------------------------+ Base + span_offset
77   |                       |                          |      + span_count * 4
78   |                       |                          |
79   |     Span Space        |   Peer Span Space        |
80   |                       |                          |
81   +-----------------------+--------------------------+
82         Virtual PCI             Pcie Endpoint
83         NTB Driver               NTB Driver
84
85
86 Doorbell Registers:
87 -------------------
88
89   Doorbell Registers are used by the hosts to interrupt each other.
90
91 Memory Window:
92 --------------
93
94   Actual transfer of data between the two hosts will happen using the
95   memory window.
96
97 Modeling Constructs:
98 ====================
99
100 32-bit BARs.
101
102 ======  ===============
103 BAR NO  CONSTRUCTS USED
104 ======  ===============
105 BAR0    Config Region
106 BAR1    Doorbell
107 BAR2    Memory Window 1
108 BAR3    Memory Window 2
109 BAR4    Memory Window 3
110 BAR5    Memory Window 4
111 ======  ===============
112
113 64-bit BARs.
114
115 ======  ===============================
116 BAR NO  CONSTRUCTS USED
117 ======  ===============================
118 BAR0    Config Region + Scratchpad
119 BAR1
120 BAR2    Doorbell
121 BAR3
122 BAR4    Memory Window 1
123 BAR5
124 ======  ===============================
125
126