Commit Graph

16 Commits

Author SHA1 Message Date
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
Laxman Dewangan
1cf1d3f858 pcie: private-soc: Add dummy driver for soc specific pcie driver
The L4T packaging needs the soc specific dummy driver to be
available always. However, it is not available in generic build and
it creates the packaging/configuration fail.

Add soc specific dummy driver for pcie so that the respective binary
should be available always.

Bug 4695516

Change-Id: Ic40e60a12de35cebc7e9acec9b09e39aa267276b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3154314
Tested-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2024-06-13 10:15:06 -07:00
Manikanta Maddireddy
6afc085f93 PCI: Create a empty Makefile as a placeholder
Create a empty Makefile as a placeholder to copy priviate SoC PCIe driver.

Bug 4000789

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Change-Id: I38a900eacb8ada86b387e01bb4bfe7f40d08043b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2870780
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-04 21:43:45 -07:00