Skip to content

Commit bf2a952

Browse files
fancerjonmason
authored andcommitted
NTB: Add IDT 89HPESxNTx PCIe-switches support
IDT 89HPESxNTx device series is PCIe-switches, which support Non-Transparent bridging between domains connected to the device ports. Since new NTB API exposes multi-port interface and messaging API, the IDT NT-functions can be now supported in the kernel. This driver adds the following functionality: 1) Multi-port NTB API to have information of possible NT-functions activated in compliance with available device ports. 2) Memory windows of direct and look up table based address translation with all possible combinations of BARs setup. 3) Traditional doorbell NTB API. 4) One-on-one messaging NTB API. There are some IDT PCIe-switch setups, which must be done before any of the NTB peers started. It can be performed either by system BIOS via IDT SMBus-slave interface or by pre-initialized IDT PCIe-switch EEPROM: 1) NT-functions of corresponding ports must be activated using SWPARTxCTL and SWPORTxCTL registers. 2) BAR0 must be configured to expose NT-function configuration registers map. 3) The rest of the BARs must have at least one memory window configured, otherwise the driver will just return an error. Temperature sensor of IDT PCIe-switches can be also optionally activated by BIOS or EEPROM. (See IDT documentations for details of how the pre-initialization can be done) Signed-off-by: Serge Semin <fancer.lancer@gmail.com> Acked-by: Allen Hubbe <Allen.Hubbe@dell.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
1 parent 48ea021 commit bf2a952

File tree

7 files changed

+3901
-0
lines changed

7 files changed

+3901
-0
lines changed

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9122,6 +9122,12 @@ F: include/linux/ntb.h
91229122
F: include/linux/ntb_transport.h
91239123
F: tools/testing/selftests/ntb/
91249124

9125+
NTB IDT DRIVER
9126+
M: Serge Semin <fancer.lancer@gmail.com>
9127+
L: linux-ntb@googlegroups.com
9128+
S: Supported
9129+
F: drivers/ntb/hw/idt/
9130+
91259131
NTB INTEL DRIVER
91269132
M: Jon Mason <jdmason@kudzu.us>
91279133
M: Dave Jiang <dave.jiang@intel.com>

drivers/ntb/hw/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
source "drivers/ntb/hw/amd/Kconfig"
2+
source "drivers/ntb/hw/idt/Kconfig"
23
source "drivers/ntb/hw/intel/Kconfig"

drivers/ntb/hw/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
obj-$(CONFIG_NTB_AMD) += amd/
2+
obj-$(CONFIG_NTB_IDT) += idt/
23
obj-$(CONFIG_NTB_INTEL) += intel/

drivers/ntb/hw/idt/Kconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
config NTB_IDT
2+
tristate "IDT PCIe-switch Non-Transparent Bridge support"
3+
depends on PCI
4+
help
5+
This driver supports NTB of cappable IDT PCIe-switches.
6+
7+
Some of the pre-initializations must be made before IDT PCIe-switch
8+
exposes it NT-functions correctly. It should be done by either proper
9+
initialisation of EEPROM connected to master smbus of the switch or
10+
by BIOS using slave-SMBus interface changing corresponding registers
11+
value. Evidently it must be done before PCI bus enumeration is
12+
finished in Linux kernel.
13+
14+
First of all partitions must be activated and properly assigned to all
15+
the ports with NT-functions intended to be activated (see SWPARTxCTL
16+
and SWPORTxCTL registers). Then all NT-function BARs must be enabled
17+
with chosen valid aperture. For memory windows related BARs the
18+
aperture settings shall determine the maximum size of memory windows
19+
accepted by a BAR. Note that BAR0 must map PCI configuration space
20+
registers.
21+
22+
It's worth to note, that since a part of this driver relies on the
23+
BAR settings of peer NT-functions, the BAR setups can't be done over
24+
kernel PCI fixups. That's why the alternative pre-initialization
25+
techniques like BIOS using SMBus interface or EEPROM should be
26+
utilized. Additionally if one needs to have temperature sensor
27+
information printed to system log, the corresponding registers must
28+
be initialized within BIOS/EEPROM as well.
29+
30+
If unsure, say N.
31+

drivers/ntb/hw/idt/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-$(CONFIG_NTB_IDT) += ntb_hw_idt.o

0 commit comments

Comments
 (0)