Skip to content

Commit 028ffe6

Browse files
committed
NVIDIA: SAUCE: MEDIATEK: pinctrl: mediatek: Add EINT Driver for CX7 hot plug on DGX Spark
This driver is used to manage PCIe link for NVIDIA ConnectX-7 (CX7) hot-plug/unplug on DGX Spark. We need to disable PCIe link when CX7 cable plug out happens and enable pcie link when CX7 cable plug in happens. It also creates a sysfs entry to emulate cable plug in/out behavior as below: plug in - echo 1 > /sys/devices/platform/MTKP0001:00/cx7_dbg/plugin plug out - echo 0 > /sys/devices/platform/MTKP0001:00/cx7_dbg/plugin We also implement uevent to notify user-space applications when a cable is plugged in or removed. Below are the details of our process: * cable plug-in: Report plug-in uevent (driver) Power on CX7 Enable PCIe link (application) Rescan CX7 devices (application) * cable removal: Report removal uevent (driver) Remove CX7 devices (application) Disable PCIe link (application) Power off CX7 Signed-off-by: Vaibhav Vyas <[email protected]> Signed-off-by: Jerry.Guo <[email protected]> Signed-off-by: Yenchia Chen <[email protected]> Signed-off-by: Shubhi Garg <[email protected]> Signed-off-by: Abhishek Sahu <[email protected]> Signed-off-by: Surabhi Chythanya Kumar <[email protected]>
1 parent 4bf663b commit 028ffe6

File tree

4 files changed

+970
-0
lines changed

4 files changed

+970
-0
lines changed

debian.nvidia-6.17/config/annotations

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT policy<{'amd64': '-', 'arm64': '
207207
CONFIG_CC_VERSION_TEXT policy<{'amd64': '"x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"', 'arm64': '"aarch64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"'}>
208208
CONFIG_CORESIGHT_CTCU policy<{'arm64': 'm'}>
209209
CONFIG_CPUFREQ_DT_RUST policy<{'arm64': '-'}>
210+
CONFIG_EINT_MTK_HP policy<{'arm64': 'm'}>
210211
CONFIG_DRM_NOUVEAU_CH7006 policy<{'amd64': '-', 'arm64': '-'}>
211212
CONFIG_DRM_NOUVEAU_SIL164 policy<{'amd64': '-', 'arm64': '-'}>
212213
CONFIG_DRM_NOVA policy<{'amd64': '-', 'arm64': '-'}>

drivers/pinctrl/mediatek/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ config EINT_MTK
1010
default y if PINCTRL_MTK || PINCTRL_MTK_MOORE
1111
default PINCTRL_MTK_PARIS
1212

13+
config EINT_MTK_HP
14+
tristate "MediaTek HP Driver"
15+
depends on EINT_MTK
16+
help
17+
Say yes here to support NICs cable plug in/out test.
18+
It will disable pcie link when plug out and enable
19+
pcie link after plug in cable.
20+
This is particularly useful for MediaTek MT8901 SoC.
21+
1322
config PINCTRL_MTK
1423
bool
1524
depends on OF

drivers/pinctrl/mediatek/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
# Core
33
obj-$(CONFIG_EINT_MTK) += mtk-eint.o
4+
obj-$(CONFIG_EINT_MTK_HP) += mtk-eint-hotplug.o
45
obj-$(CONFIG_PINCTRL_MTK) += pinctrl-mtk-common.o
56
obj-$(CONFIG_PINCTRL_MTK_V2) += pinctrl-mtk-common-v2.o
67
obj-$(CONFIG_PINCTRL_MTK_MTMIPS) += pinctrl-mtmips.o

0 commit comments

Comments
 (0)