Commit Graph

98 Commits

Author SHA1 Message Date
Srishti Goel
825083f3d6 pci: xdma: Polling on XDMA debug reg to restart if DMA hung
Polling on XDMA_CHANNEL_DEBUG_REGISTER_4 for atmost 10msecs in the IRQ handler and restart the channel if the XDMA_CHANNEL_DEBUG_REGISTER_4_INTR_ENGINE_MSI_CHAN_MSI_DISP_FSM is non-zero at the end of this.

Bug 4787071

Change-Id: I215065a1bf7ae35c89c4b3c4df9a21f7bea5ebe9
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330655
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:18 +00:00
Nagarjuna Kristam
6dbef270d8 PCI: tegra264: dma: Add poll to disarm MSI
To avoid getting spurious interrupts during XDMA channel reset,
Add polling of MSI states for NV_XDMA_CHANNEL_DEBUG_REGISTER_4_0
register once channel is disabled.

Bug 4742850

Change-Id: Id39e53f0fd33faa4358a3648e6baea8cc96c187c
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330634
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:17 +00:00
Prakhar Srivastava
2e68d82f52 PCI: tegra264: Remove private-soc directory
Move files from private-soc to parent controller directory.

Bug 5054840

Change-Id: I8ec5e5b34f2226bbbd051f4313033153a096e5c1
Signed-off-by: Prakhar Srivastava <prasrivastav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3312461
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
2025-07-24 10:19:17 +00:00
Nagarjuna Kristam
56278bff69 PCI: dma-test: Update conditions for tests
Update all test logs as  *condition -<condition>- (Passed|Failed)*.
This format is parsed in the script to identify pass or fail for
corresponding test cases.

JIRA NET-3009

Change-Id: I6e7b37d5205a421d3c62142b268bfc646e89a08e
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3323877
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:17 +00:00
Nagarjuna Kristam
f61c2ced6d PCI: tegra264: ep: Fix ICD mis-matches in code
Add state checks for set_bar, map_addr and unmap_addr API's.

Bug 5132823

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Change-Id: Ifb17259229a74289703f18b34e223fed18ead1eb
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3314131
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:16 +00:00
Nagarjuna Kristam
ab18e366eb PCI: epf: dma-test: Add negative tests for EP and DMA
Add negative tests for EP API's set_bar and clear_bar.
Add negative tests for all DMA API's

JIRA NET-2400

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Change-Id: If1b171f67b4c0a372e2a515704893609b7d11b76
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3313976
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:16 +00:00
Nagarjuna Kristam
c451280883 PCI: tegra264: dma: Fix mis-matches with ICD
Fix tegra_pcie_dma_stop() return type to bool instead of tegra_pcie_dma_status_t.
Add NULL checks and atleast one DMA channel enable status in
tegra_pcie_dma_initialize().

Bug 5132823

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Change-Id: Ie4363a9a63942256f136d018d17af488948e37a1
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3314130
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:16 +00:00
Jon Hunter
23e3912ef7 PCI: tegra264: Fix build issues using conftest
The Tegra264 PCIe drivers don't build for kernels that don't have:

1. The structure mrq_pcie_request_req defined
2. The function pci_epc_deinit_notify() present

This is currently being handling by building a dummy driver for kernels
that don't have these. To simplify this, use conftest to detect if the
above are present and modify the Tegra264 PCIe driver accordingly if
they are not present. By using conftest we can remove the Makefile
variable 'NV_OOT_PCIE_T264_SOC_SKIP_BUILD' and ccflag
'DNV_CONFIG_PCIE_TEGRA_DMA_DISABLE'.

Finally, the PCIe drivers are always built as modules so simplify the
Makefile and remove the usage of 'CONFIG_TEGRA_OOT_MODULE'.

Bug 4911768

Change-Id: Id282497b8607a732b5e6c90e1e7c1436589a0b5f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3245592
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:16 +00:00
Srishti Goel
529f22ea6a PCI: tegra264: Remove XAL mem registers programming
Remove the XAL memory register programming from the Linux driver, since
this is done by the BPMP-FW for all controllers.

Bug 5033472

Change-Id: I64ec6347d59d77125c34ae52ac3b24413e1f5479
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3304008
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:16 +00:00
Nagarjuna Kristam
ce0a05749b pci: tegra264-ep: Fix set_bar and map_addr ICD
- set_bar when called post controller initialization should be rejected.
- map_addr outcome is to be able to access remote memory rather than
  register update.

Update API documentation information accordingly.

JIRA NET-2663

Change-Id: Ie4e1b029200fa8e61685e97ba3a0f029c3e6fe9d
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3310942
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:16 +00:00
Nagarjuna Kristam
4dce44a907 PCI: tegra: Add common DMA IRQ
IRQ is external interface for DMA driver. Use one IRQ handler callbacks
to register and call SoC specific handler them based on SoC type.
Add ICD documentation for common IRQ API's

JIRA NET-2663

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Change-Id: I51137489ebe071e2e4a3edc3c5e3fefb84c994fa
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3305091
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
2025-07-24 10:19:15 +00:00
Nagarjuna Kristam
330ecd452b pci: tegra264: Remove MSI info from ICD
MSI API are not supported via GuestOs decomposition. Disable documentation
for the same during ICD compilation.

JIRA NET-2663

Change-Id: Ie1a0ca75b91e848152d0748f8f49735bedd0be70
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3305090
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:15 +00:00
Nagarjuna Kristam
789e70d35e pci: tegra264: Add EP driver ICD documentation
JIRA NET-2663

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Change-Id: I5855c28c7834fe6ca8f0571321b04a4997dc6185
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3293557
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:15 +00:00
Manish Bhardwaj
b6c2cf9a34 nvidia-oot: check dependency of pci driver on host1x
Bug 4936618

Change-Id: I9c8d98b43cffa6cff4ea06d7bb38acf0b42819fb
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3257441
Reviewed-by: Bharath H S <bhs@nvidia.com>
Tested-by: Hyong Bin Kim <hyongbink@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: Hyong Bin Kim <hyongbink@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:13 +00:00
Srishti Goel
eeb5d6e7a2 pci: epf: Correct deviceid in DMA test app
Correct device ID in the DMA test app to 0x22D7

Bug 4938994

Change-Id: Ibf8d5bc0a7bc6cc299fd92daa8fcc1bb4e2e116d
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3275919
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:12 +00:00
Manikanta Maddireddy
1f56aa1d73 PCI: tegra264: Add IO BAR support
PCI supports IO BAR with 32-bit address, however XAL HW module provide
a way to use 64-bit MMIO address as a CPU address and a 32-bit PCI
address for IO BAR. Program 64-bit MMIO address in XAL registers,
when sending the TLP over the bus, XAL truncates it to 32-bit address.

Bug 4883004

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Change-Id: Idf2fdfa9d345ae7d0630d4ab9b1074422a9f68f4
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3256977
Reviewed-by: Ankit Patel (SW-TEGRA) <anpatel@nvidia.com>
Tested-by: Ankit Patel (SW-TEGRA) <anpatel@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
Nagarjuna Kristam
276faff8d4 pci: tegra264: turn off controller when no link
When Link up fails during driver probe, controller is kept powered
on, even when controller is not configured as hot plug capable.
This results in more power consumption. Turn off controller when
no link detected during driver probe, only when controller does not
have hot-plug capability.
Ignore resume and remove AI's when no link during probe for no
hot-pluggable controllers.
Ignore Link state check for VDK, on which it cannot be detected.

Bug 4688706

Change-Id: I80a2b5845d48b07f25f65dc7cf5509aeb5778399
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3246221
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:11 +00:00
Srishti Goel
5a0c14c4df Revert "PCI: endpoint: Add DMA sanity test function driver"
This reverts commit f22862928ad7bd08df0008fa40074df850aaec12.

Reason for revert: Changing this to tests-oot directory

Bug 4865361

Change-Id: I7f0c9d6466e21c34bd6d1be3b32401eb68db637d
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3246558
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:10 +00:00
Srishti Goel
64e63a9ca3 Revert "PCI: endpoint: Fix DMA sanity for Linux v6.11"
This reverts commit 2f3e25b601c241bf50a30b07a0aaa64413c57925.

Reason for revert: Changing this to tests-oot directory

Bug 4865361

Change-Id: I19002466616450cf073e2a66a1dd27da9e3409a2
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3246783
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:10 +00:00
Jon Hunter
f51248fd49 PCI: endpoint: Fix DMA sanity for Linux v6.11
The Tegra PCI endpoint DMA sanity driver build fails for Linux v6.11
because the 'core_init' callback was renamed to 'epc_init'. Update the
driver accordingly to fix the build for Linux v6.11.

Bug 4749580

Change-Id: I66a3c848f3f01b607d045c221bcc2ed21ac3df61
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3242701
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Srishti Goel <srgoel@nvidia.com>
2025-07-24 10:19:10 +00:00
Srishti Goel
9c40df022c PCI: endpoint: Add DMA sanity test function driver
Added a sanity DMA testing driver which submits 2 descriptors of 0.5MB,
2.5MB and 6.25MB each. Repeats this 10 times and captures the perf,
bit-transfer errors and time taken.

Bug 4865361

Change-Id: Ibda3d55d848c918bb3b97412b0cbb33b0a460f6e
Signed-off-by: Srishti Goel <srgoel@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3220195
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:10 +00:00
Jon Hunter
a813cd8c7f PCI: tegra264: Don't initialise core_init_notifier
The 'core_init_notifier' has been removed from the pci_epc_features
structure in Linux v6.10. Given that this is a static structure and it
is initialised as 'false', we don't need to explicitly initialise this
because it will always be initialised as 'false' by default for kernels
that support this.

Bug 4787193
Bug 4593750

Change-Id: Ic2abaa3d2ab1a5c766a805936fd8ab394214bf42
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233999
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
7ca94a27fa PCI: tegra264: Use conftest
Building the Tegra264 PCI Endpoint driver fails with certain kernel
versions such as Linux v6.7. Use the existing conftest definitions for
detecting differences between kernel versions instead of relying on
kernel version itself.

Bug 4911768

Change-Id: I1a755c9f2bc4a58e15c6caf1ecde261faebd57bb
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3234750
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
cded4cedac PCI: tegra264: Add missing module.h header
The Tegra264 PCIe Endpoint driver is missing the module.h header and
when compiling on some Linux kernel versions the build fails because
the various module functions and macros prototypes are not defined.

Bug 4911768

Change-Id: I4bd83bd1bb8049ad7828aa4ce452fe2ecbbc6be7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3234210
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
87799bf046 PCI: tegra264: Fix build for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update the Tegra264 PCI drivers
as necessary to ensure that they can be built for Linux v6.11+ kernels.

Bug 4749580
Bug 4911768

Change-Id: I9081f7cb61e9020ec8c1462a3c1b21118d7025bc
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233981
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
f01227d4ea drivers: Drop inline from driver remove wrapper
The driver remove function is a function pointer and therefore, it does
not make sense to define the function as an 'inline'. Update the
coccinelle script and drivers to remove the inline statement.

Bug 4749580

Change-Id: Ia03691b75c4edffe609f27468b911a92a5ddbd68
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233980
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:08 +00:00
Laxman Dewangan
17ef98bafa pcie: T264: Skip build of T264 specific PCIE driver for few kernel
Skip T264 PCIE drivers for the few kernels like jammy-src, rhivos-1 and
stable.

Bug 4911768

Change-Id: I198fb279712594a69950b72d6b8f14a9ef151e5f
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2025-07-24 10:19:08 +00:00
Laxman Dewangan
1e0bef1f51 pci: Implement function of tegra_pcie if proper config is selected
To avoid the duplicate function defintion between the header and
source, use the proper config to protect it.

Bug 4911768

Change-Id: I8d6880833c122eb2eb7194929eb5ea2cb78a9c45
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2025-07-24 10:19:08 +00:00
ruppala
3909cff8d5 PCI: tegra264: Add support for PEX WAKE GPIO
Add support for handling the PEX WAKE GPIO (pex_wake_gpiod) by
parsing the pex-wake GPIO from the device tree and setup the
interrupt line.

Enable and disable the wake-up interrupt during system
suspend/resume.

Bug 4788812

Change-Id: Ie8936aa9cc551db1a5d24b277b091de5fbc0439e
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3212875
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
2025-07-24 10:19:08 +00:00
Nagarjuna Kristam
f4df943461 PCI: tegra264-ep: Disable SW PME_TO_ACK
SW PME_TO_ACK is no longer used as BLCG is applied for EP
between L2 and controller powergate.

Bug 4844371

Change-Id: Ibc5c0735aa1e46b91a3a0dfa828cf72ce16e6e12
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3208143
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
2025-07-24 10:19:08 +00:00
Manikanta Maddireddy
a558aeb624 PCI: tegra264: On EP_RESET poll for detect reset LTSSM
When Root port applies secondary bus reset(SBR) or link disable, EP_RESET
interrupt is received at Endpoint. On EP_RESET poll for detect reset LTSSM
state which confirms that SBR reset released or link disable is cleared.
After polling perform Endpoint controller cold reset.

Due to HW bug 4777981, C2 x2/x1 LTSSM state doesn't move to detect reset
when SBR reset is released, instead it stays in hot reset state. In this
case perform Endpoint controller cold reset after poll timeout. PCIe link
still comes up in this case.

Bug 4777981
Bug 4785875

Change-Id: I89402aa7c963082510170b88a1f7a4ec481162be
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3197116
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-07-24 10:19:08 +00:00
Nagarjuna Kristam
216461effa PCI: tegra264: Add pinctl support
Configure pinmux settings if any available in DT.

Bug 3191308

Change-Id: I79b1965dfe95f39322828ce5ea9acb22d2cb43e1
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3191308
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:08 +00:00
Nagarjuna Kristam
49f357d6e1 pci: t264-xdma: Fix MSI error handling
Issue:
When XDMA interrupt is received and only error is set, interrupt is not
processed resulting in DMA HW halt and no further transfers working.

Fix:
Process XDMA irq, when either transfer complete or error status is set.

Bug 4747322

Change-Id: Ic71f3bf93343e986a1f4be9b570bcc36f03afeeb
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3175952
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Nagarjuna Kristam
8774bd321b pci: t264: xdma: Fix MSI for local and remote
Use different MSI channels for local and remote use case to avoid
configuring same registers with different info.

Bug 4779415

Change-Id: I13fab912589d47484881cd862fc9eaf0f602e64e
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3186319
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Manikanta Maddireddy
c51582e26e PCI: Enable CONFIG_PCIE_TEGRA_DMA flag in header file
Tegra DMA driver functions are defined in nvidia-t264 repo and these
functions are used in nvidia-oot repo. Prototypes of these functions
are defined in nvidia-oot repo header file tegra-pcie-dma.h. Enable
CONFIG_PCIE_TEGRA_DMA flag to expose the function prototypes to the
drivers in nvidia-oot repo. This functions should be exposed only if
nvidia-t264 drivers are included in kernel compilation.

Bug 4712065

Change-Id: I74bb98bd9efbf2e36ed05aae866760a92a4ee7dd
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3164961
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
2025-07-24 10:19:08 +00:00
Nagarjuna Kristam
bb8ac1d6be PCI: tegra264: Update EP state change handling
When Thor EP is connected to Thor RP, PERST# signal don't get toggle
post Thor RP boot.
- When EP start is triggered, de-assert EP if RP PERST# is released.
- When EP stop is triggered, assert EP directly.

Bug 4567932

Change-Id: I86e9251205a7c19dd32789052a10669fc3b48098
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3170657
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:08 +00:00
Manikanta Maddireddy
4ab2bfd19c PCI: Fix crash in PCIe dma test deinit
PCIe deinit function tegra_pcie_dma_deinit() takes cookie double pointer
as argument. Add null check for pointer stored in double pointer variable
to avoid crash in tegra_pcie_dma_deinit().

Bug 4712065

Change-Id: Ib272058f558738c7e6b5a20c6f2ba85c2bf2a781
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3163949
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
2025-07-24 10:19:08 +00:00
Manikanta Maddireddy
f439ffe285 PCI: tegra264: Fix kernel crash during outbound map
Kernel crash is observed during outbound mapping since memory is not
allocated for ob_addr pointer. Tegra264 support fixed 8 outbound channels,
so change ob_addr pointer as a static array to fix the kernel crash.

Bug 4705050

Change-Id: Ibf675c1d00abcbd8596f9be9b76ae7ef19d2fd38
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3163948
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Nagarjuna Kristam <nkristam@nvidia.com>
2025-07-24 10:19:08 +00:00
Manikanta Maddireddy
e9881b2cee PCI: tegra264: Add link disable and SBR support
When PCIe link is disabled or secondary bus reset is done by RP,
EP LTSSM state goes to link disable or hot reset respectively.
Update the LTSSM state check accordingly to support link disable
and secondary bus reset.

XTL_EP_PRI_BAR_CONFIG and XTL_EP_PRI_RESIZE_BAR1 are part of
hot reset domain, when link is going through hot reset, these
registers are not accessible. So, remove these register programming
in tegra264_pcie_ep_clear_bar(). After hot reset these registers
come back with reset values.

Bug 4712053

Change-Id: Ieaf37ed9fed6722db8a16027947121b1cfd1ef4c
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3163927
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Manikanta Maddireddy
d091253965 PCI: tegra264: Add driver unbind support
Add remove callback function support driver unbind.

Bug 4712048

Change-Id: I9c855d6403f187de1c93c00ba8cc270e4fed37f4
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3163926
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Manikanta Maddireddy
26c5dc150d PCI: Fix XDMA reset flow
When XDMA error is observed driver resets the XDMA engine.
xdma_ll_ch_init() function is called to reinitialize the
XDMA engine. Incorrect value is passed as the argument for
channel type. Fix this issue by using correct variable for
channel type.

Bug 4707453

Change-Id: Ic06563d599bfd7c0979c9db0a20cebeaa18fe3c8
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3163925
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Manikanta Maddireddy
c1de5ba655 PCI: Add Tegra264 PCIe DMA driver
Copy T234 DMA driver and add Tegra264 PCIe DMA driver with common wrapper
to support both T264 and T234 PCIe DMA.

Bug 4549851

Change-Id: Ie4f55021aadd4c4f9b468b49fe34a562cdf3fa6c
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3124399
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Jon Hunter
4d4e8e54eb PCI: tegra264: Fix build for Linux v6.9
The pci_epc_features structure was updated in Linux v6.9 to move various
fields under a new pci_epc_bar_desc structure. Use conftest to determine
if the new pci_epc_bar_desc structure is present.

Finally, add the endpoint alignment for the inbound ATU on Tegra264
which is 64kB.

Bug 4627271

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I074e19ca53cea0e13d9872b240a023dd83779ae7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3129630
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Manikanta Maddireddy
0bf232b1d8 PCI: tegra264: Add PCIe EP controller driver
Register Tegra264 PCIe EP controller platform driver. Handle PERST#
deassert and send MRQ call to initialize PCIe HW. Register with EPC
core driver and define EPC core ops callback functions.

Bug 4549851

Change-Id: I353209852d0162d8219fa66b523a3cb3daf642a7
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/2994454
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Jon Hunter
c81c525baf PCI: tegra264: Remove private headers
The only functions needed from the private pci.h header are
pci_dev_is_disconnected() and of_get_pci_domain_nr().

Starting with Linux v6.9, pci_dev_is_disconnected() has been moved to
the public header and now the private header conflicts with the public
due to multiple definitions. It is better to remove the private pci.h
header file and backport the upstream change that moves the definition
of pci_dev_is_disconnected() to the public header.

With regard to the function of_get_pci_domain_nr(), just declare an
extern for the function prototype in the driver file rather than
copying the entire kernel header.

Bug 4471899

Change-Id: I10e7c3c6a92e9ba87153b2682cc3e69ced8c1a31
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3117272
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:07 +00:00
Manikanta Maddireddy
f0ec6ab5f5 PCI: tegra264: Add PCIe resume support
Per PCIe r5.0, 6.6.1 wait for 100 ms after DLL up. Optimize PCIe link up
poll logic. Add resume_noirq() callback back function in PCIe driver and
call tegra264_pcie_init() to deassert PERST# and get PCIe link up.
Also, fix minor coding style issues.

Bug 4404453

Change-Id: Iad2d22166eb0c80a20b74ada2ee2766f8d3e174f
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3107413
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2025-07-24 10:19:07 +00:00
Manikanta Maddireddy
ef4d11362e PCI: tegra264: Move driver file to new dir t264
nvidia-t264 drivers are copied to nvidia-oot path and compile them to
create out-of-the-tree driver modules. Create new directory to avoid
replacing exisiting Makefile in out-of-the-tree repo.

Bug 4000789

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Change-Id: I8040a86102b164feae6e1fd2251c69d3dc039dde
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/2870776
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Laxman Dewangan
050b888cca pcie: remove private-soc makefile to prepare to merge T264 pcie drivers
Remvoe the existing makefile as preparation to merge T264 specific
PCIE drivers into core repo.

Bug 4911768

Change-Id: Ifa65e36b5253bf2dc4ab62fe8caaf10a53e7cff3
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2025-07-24 10:19:07 +00:00
Nagarjuna Kristam
b55db09752 pci: epf: dma-test: Fix free_irq during remove
Issue: epf-dma-test driver uses MSI IRQ for CRC handling, however, different
IRQ is used when free the same.

Fix: Correct IRQ number to free. Correct ordering of free_irq and
platform MSI irq free.

Bug 4820157

Change-Id: Idbbaed61ddbd45a52e8e833e76c6b64f0fd3e48f
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3204910
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:07 +00:00
Jon Hunter
951b2423a8 drivers: Fix platform_driver remove for Linux v6.11
In Linux v6.11, the 'platform_driver' structure 'remove' callback was
updated to return void instead of 'int'. Update all the impacted drivers
as necessary to fix this.

Bug 4749580

Change-Id: I3bb5c549777f7ccad0e3f870373fdd25726ad7ed
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3182878
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-08-11 17:20:34 -07:00