diff options
author | Wesley Yung <wesley.yung@microchip.com> | 2018-10-10 10:42:55 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-10-11 12:28:53 -0400 |
commit | fb513f60ea58f096be7006f899e2181762af37cb (patch) | |
tree | ce4065ac97a0e6124637b68fdc30dfc7dee9d94d | |
parent | 742bbe1ee35b5699c092541f97c7cec326556bb1 (diff) |
NTB: switchtec_ntb: Update switchtec documentation with prerequisites for NTB
The ntb_hw_switchtec driver has requirements on kernel configuration so add
these notes to the documentation and also clean up a few other sentences in
the documentation.
Signed-off-by: Wesley Yung <wesley.yung@microchip.com>
Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com>
Signed-off-by: Wesley Sheng <wesley.sheng@microchip.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
-rw-r--r-- | Documentation/switchtec.txt | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/Documentation/switchtec.txt b/Documentation/switchtec.txt index f788264921ff..30d6a64e53f7 100644 --- a/Documentation/switchtec.txt +++ b/Documentation/switchtec.txt | |||
@@ -23,7 +23,7 @@ The primary means of communicating with the Switchtec management firmware is | |||
23 | through the Memory-mapped Remote Procedure Call (MRPC) interface. | 23 | through the Memory-mapped Remote Procedure Call (MRPC) interface. |
24 | Commands are submitted to the interface with a 4-byte command | 24 | Commands are submitted to the interface with a 4-byte command |
25 | identifier and up to 1KB of command specific data. The firmware will | 25 | identifier and up to 1KB of command specific data. The firmware will |
26 | respond with a 4 bytes return code and up to 1KB of command specific | 26 | respond with a 4-byte return code and up to 1KB of command-specific |
27 | data. The interface only processes a single command at a time. | 27 | data. The interface only processes a single command at a time. |
28 | 28 | ||
29 | 29 | ||
@@ -36,8 +36,8 @@ device: /dev/switchtec#, one for each management endpoint in the system. | |||
36 | The char device has the following semantics: | 36 | The char device has the following semantics: |
37 | 37 | ||
38 | * A write must consist of at least 4 bytes and no more than 1028 bytes. | 38 | * A write must consist of at least 4 bytes and no more than 1028 bytes. |
39 | The first four bytes will be interpreted as the command to run and | 39 | The first 4 bytes will be interpreted as the Command ID and the |
40 | the remainder will be used as the input data. A write will send the | 40 | remainder will be used as the input data. A write will send the |
41 | command to the firmware to begin processing. | 41 | command to the firmware to begin processing. |
42 | 42 | ||
43 | * Each write must be followed by exactly one read. Any double write will | 43 | * Each write must be followed by exactly one read. Any double write will |
@@ -45,9 +45,9 @@ The char device has the following semantics: | |||
45 | produce an error. | 45 | produce an error. |
46 | 46 | ||
47 | * A read will block until the firmware completes the command and return | 47 | * A read will block until the firmware completes the command and return |
48 | the four bytes of status plus up to 1024 bytes of output data. (The | 48 | the 4-byte Command Return Value plus up to 1024 bytes of output |
49 | length will be specified by the size parameter of the read call -- | 49 | data. (The length will be specified by the size parameter of the read |
50 | reading less than 4 bytes will produce an error. | 50 | call -- reading less than 4 bytes will produce an error.) |
51 | 51 | ||
52 | * The poll call will also be supported for userspace applications that | 52 | * The poll call will also be supported for userspace applications that |
53 | need to do other things while waiting for the command to complete. | 53 | need to do other things while waiting for the command to complete. |
@@ -83,10 +83,20 @@ The following IOCTLs are also supported by the device: | |||
83 | Non-Transparent Bridge (NTB) Driver | 83 | Non-Transparent Bridge (NTB) Driver |
84 | =================================== | 84 | =================================== |
85 | 85 | ||
86 | An NTB driver is provided for the switchtec hardware in switchtec_ntb. | 86 | An NTB hardware driver is provided for the Switchtec hardware in |
87 | Currently, it only supports switches configured with exactly 2 | 87 | ntb_hw_switchtec. Currently, it only supports switches configured with |
88 | partitions. It also requires the following configuration settings: | 88 | exactly 2 NT partitions and zero or more non-NT partitions. It also requires |
89 | the following configuration settings: | ||
89 | 90 | ||
90 | * Both partitions must be able to access each other's GAS spaces. | 91 | * Both NT partitions must be able to access each other's GAS spaces. |
91 | Thus, the bits in the GAS Access Vector under Management Settings | 92 | Thus, the bits in the GAS Access Vector under Management Settings |
92 | must be set to support this. | 93 | must be set to support this. |
94 | * Kernel configuration MUST include support for NTB (CONFIG_NTB needs | ||
95 | to be set) | ||
96 | |||
97 | NT EP BAR 2 will be dynamically configured as a Direct Window, and | ||
98 | the configuration file does not need to configure it explicitly. | ||
99 | |||
100 | Please refer to Documentation/ntb.txt in Linux source tree for an overall | ||
101 | understanding of the Linux NTB stack. ntb_hw_switchtec works as an NTB | ||
102 | Hardware Driver in this stack. | ||