Skip to content

Commit 5150b00

Browse files
committed
NVIDIA: SAUCE: MEDIATEK: pinctrl: mediatek: Add eint hotplug driver
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) enable pcie link (application) rescan devices (application) * cable removal: report removal uevent (driver) remove devices (application) disable pcie link (application) Signed-off-by: Vaibhav Vyasvavyas@nvidia.com Signed-off-by: Jerry.Guo jerry.guo@mediatek.com Signed-off-by: Yenchia Chen yenchia.chen@mediatek.com Signed-off-by: Shubhi Garg shgarg@nvidia.com Signed-off-by: Abhishek Sahu abhsahu@nvidia.com
1 parent be01c90 commit 5150b00

File tree

4 files changed

+970
-0
lines changed

4 files changed

+970
-0
lines changed

debian.nvidia-6.14/config/annotations

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ CONFIG_CC_HAS_SIGN_RETURN_ADDRESS policy<{'arm64': '-'}>
224224
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"'}>
225225
CONFIG_CGROUP_RESCTRL policy<{'amd64': '-', 'arm64': '-'}>
226226
CONFIG_CPUFREQ_ARCH_CUR_FREQ policy<{'amd64': 'y'}>
227+
CONFIG_EINT_MTK_HP policy<{'arm64': 'm'}>
227228
CONFIG_DRM_PANIC_SCREEN_QR_CODE policy<{'amd64': '-', 'arm64': '-'}>
228229
CONFIG_EC_HUAWEI_GAOKUN policy<{'arm64': 'n'}>
229230
CONFIG_FTRACE_SORT_STARTUP_TEST policy<{'amd64': 'n', 'arm64': 'n'}>

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)