* [PATCH v3 1/4] PCI: endpoint: Add reserved region type for MSI-X Table and PBA
2026-03-24 8:08 [PATCH v3 0/4] PCI: endpoint: Add Tegra194/234 BAR layout and pci_endpoint_test support Manikanta Maddireddy
@ 2026-03-24 8:08 ` Manikanta Maddireddy
2026-03-24 8:08 ` [PATCH v3 2/4] PCI: tegra194: Make BAR0 programmable and remove 1MB size limit Manikanta Maddireddy
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Manikanta Maddireddy @ 2026-03-24 8:08 UTC (permalink / raw)
To: bhelgaas, lpieralisi, kwilczynski, mani, robh, krzk+dt, conor+dt,
thierry.reding, jonathanh, kishon, arnd, gregkh, Frank.Li, den,
hongxing.zhu, jingoohan1, vidyas, cassel, 18255117159
Cc: linux-pci, linux-tegra, linux-kernel, Manikanta Maddireddy
Add PCI_EPC_BAR_RSVD_MSIX_TBL_RAM and PCI_EPC_BAR_RSVD_MSIX_PBA_RAM to
enum pci_epc_bar_rsvd_region_type so that Endpoint controllers can
describe hardware-owned MSI-X Table and PBA (Pending Bit Array) regions
behind a BAR_RESERVED BAR.
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
---
v3: Change 'PBA structures' to 'PBA structure'
v2: Split MSI-X pci_epc_bar_rsvd_region_type for both MSI-X table and PBA
include/linux/pci-epc.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h
index 334c2b7578d0..1eca1264815b 100644
--- a/include/linux/pci-epc.h
+++ b/include/linux/pci-epc.h
@@ -211,6 +211,8 @@ enum pci_epc_bar_type {
/**
* enum pci_epc_bar_rsvd_region_type - type of a fixed subregion behind a BAR
* @PCI_EPC_BAR_RSVD_DMA_CTRL_MMIO: Integrated DMA controller MMIO window
+ * @PCI_EPC_BAR_RSVD_MSIX_TBL_RAM: MSI-X table structure
+ * @PCI_EPC_BAR_RSVD_MSIX_PBA_RAM: MSI-X PBA structure
*
* BARs marked BAR_RESERVED are owned by the SoC/EPC hardware and must not be
* reprogrammed by EPF drivers. Some of them still expose fixed subregions that
@@ -218,6 +220,8 @@ enum pci_epc_bar_type {
*/
enum pci_epc_bar_rsvd_region_type {
PCI_EPC_BAR_RSVD_DMA_CTRL_MMIO = 0,
+ PCI_EPC_BAR_RSVD_MSIX_TBL_RAM,
+ PCI_EPC_BAR_RSVD_MSIX_PBA_RAM,
};
/**
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v3 2/4] PCI: tegra194: Make BAR0 programmable and remove 1MB size limit
2026-03-24 8:08 [PATCH v3 0/4] PCI: endpoint: Add Tegra194/234 BAR layout and pci_endpoint_test support Manikanta Maddireddy
2026-03-24 8:08 ` [PATCH v3 1/4] PCI: endpoint: Add reserved region type for MSI-X Table and PBA Manikanta Maddireddy
@ 2026-03-24 8:08 ` Manikanta Maddireddy
2026-03-24 8:08 ` [PATCH v3 3/4] PCI: tegra194: Expose BAR2 (MSI-X) and BAR4 (DMA) as 64-bit BAR_RESERVED Manikanta Maddireddy
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Manikanta Maddireddy @ 2026-03-24 8:08 UTC (permalink / raw)
To: bhelgaas, lpieralisi, kwilczynski, mani, robh, krzk+dt, conor+dt,
thierry.reding, jonathanh, kishon, arnd, gregkh, Frank.Li, den,
hongxing.zhu, jingoohan1, vidyas, cassel, 18255117159
Cc: linux-pci, linux-tegra, linux-kernel, Manikanta Maddireddy
The Tegra194/234 Endpoint does not support the Resizable BAR capability,
but BAR0 can be programmed to different sizes via the DBI2 BAR registers
in dw_pcie_ep_set_bar_programmable(). The BAR0 size is set once during
initialization.
Remove the fixed 1MB limit from pci_epc_features so Endpoint function
drivers can configure the BAR0 size they need.
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
---
v3: Rebased on pci/endpoint
v2: drop .type init for BAR_0
drivers/pci/controller/dwc/pcie-tegra194.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 6881f0b94c73..c5381ffdf1eb 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1978,12 +1978,12 @@ static int tegra_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
return 0;
}
+/* Tegra EP: BAR0 = 64-bit programmable BAR */
static const struct pci_epc_features tegra_pcie_epc_features = {
DWC_EPC_COMMON_FEATURES,
.linkup_notifier = true,
.msi_capable = true,
- .bar[BAR_0] = { .type = BAR_FIXED, .fixed_size = SZ_1M,
- .only_64bit = true, },
+ .bar[BAR_0] = { .only_64bit = true, },
.bar[BAR_2] = { .type = BAR_DISABLED, },
.bar[BAR_3] = { .type = BAR_DISABLED, },
.bar[BAR_4] = { .type = BAR_DISABLED, },
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v3 3/4] PCI: tegra194: Expose BAR2 (MSI-X) and BAR4 (DMA) as 64-bit BAR_RESERVED
2026-03-24 8:08 [PATCH v3 0/4] PCI: endpoint: Add Tegra194/234 BAR layout and pci_endpoint_test support Manikanta Maddireddy
2026-03-24 8:08 ` [PATCH v3 1/4] PCI: endpoint: Add reserved region type for MSI-X Table and PBA Manikanta Maddireddy
2026-03-24 8:08 ` [PATCH v3 2/4] PCI: tegra194: Make BAR0 programmable and remove 1MB size limit Manikanta Maddireddy
@ 2026-03-24 8:08 ` Manikanta Maddireddy
2026-03-24 8:08 ` [PATCH v3 4/4] misc: pci_endpoint_test: Add Tegra194 and Tegra234 device table entries Manikanta Maddireddy
2026-04-04 10:47 ` [PATCH v3 0/4] PCI: endpoint: Add Tegra194/234 BAR layout and pci_endpoint_test support Manivannan Sadhasivam
4 siblings, 0 replies; 6+ messages in thread
From: Manikanta Maddireddy @ 2026-03-24 8:08 UTC (permalink / raw)
To: bhelgaas, lpieralisi, kwilczynski, mani, robh, krzk+dt, conor+dt,
thierry.reding, jonathanh, kishon, arnd, gregkh, Frank.Li, den,
hongxing.zhu, jingoohan1, vidyas, cassel, 18255117159
Cc: linux-pci, linux-tegra, linux-kernel, Manikanta Maddireddy
Tegra Endpoint exposes three 64-bit BARs at indices 0, 2, and 4:
- BAR0+BAR1: EPF test/data (programmable 64-bit BAR)
- BAR2+BAR3: MSI-X table (hardware-backed)
- BAR4+BAR5: DMA registers (hardware-backed)
Update tegra_pcie_epc_features so that BAR2 is BAR_RESERVED with
PCI_EPC_BAR_RSVD_MSIX_TBL_RAM (64 KB) & PCI_EPC_BAR_RSVD_MSIX_PBA_RAM (64 KB)
and BAR4 is BAR_RESERVED with PCI_EPC_BAR_RSVD_DMA_CTRL_MMIO (4KB).
This keeps CONSECUTIVE_BAR_TEST working while allowing the host to use
64-bit BAR2 (MSI-X) and BAR4 (DMA).
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
---
v3: Rebased on pci/endpoint
v2: Split MSI-X table and PBA reserved region
drivers/pci/controller/dwc/pcie-tegra194.c | 42 +++++++++++++++++++---
1 file changed, 37 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index c5381ffdf1eb..ea7a6256450c 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1978,16 +1978,48 @@ static int tegra_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
return 0;
}
-/* Tegra EP: BAR0 = 64-bit programmable BAR */
+static const struct pci_epc_bar_rsvd_region tegra194_bar2_rsvd[] = {
+ {
+ /* MSI-X table structure */
+ .type = PCI_EPC_BAR_RSVD_MSIX_TBL_RAM,
+ .offset = 0x0,
+ .size = SZ_64K,
+ },
+ {
+ /* MSI-X PBA structure */
+ .type = PCI_EPC_BAR_RSVD_MSIX_PBA_RAM,
+ .offset = 0x10000,
+ .size = SZ_64K,
+ },
+};
+
+static const struct pci_epc_bar_rsvd_region tegra194_bar4_rsvd[] = {
+ {
+ /* DMA_CAP (BAR4: DMA Port Logic Structure) */
+ .type = PCI_EPC_BAR_RSVD_DMA_CTRL_MMIO,
+ .offset = 0x0,
+ .size = SZ_4K,
+ },
+};
+
+/* Tegra EP: BAR0 = 64-bit programmable BAR, BAR2 = 64-bit MSI-X table, BAR4 = 64-bit DMA regs. */
static const struct pci_epc_features tegra_pcie_epc_features = {
DWC_EPC_COMMON_FEATURES,
.linkup_notifier = true,
.msi_capable = true,
.bar[BAR_0] = { .only_64bit = true, },
- .bar[BAR_2] = { .type = BAR_DISABLED, },
- .bar[BAR_3] = { .type = BAR_DISABLED, },
- .bar[BAR_4] = { .type = BAR_DISABLED, },
- .bar[BAR_5] = { .type = BAR_DISABLED, },
+ .bar[BAR_2] = {
+ .type = BAR_RESERVED,
+ .only_64bit = true,
+ .nr_rsvd_regions = ARRAY_SIZE(tegra194_bar2_rsvd),
+ .rsvd_regions = tegra194_bar2_rsvd,
+ },
+ .bar[BAR_4] = {
+ .type = BAR_RESERVED,
+ .only_64bit = true,
+ .nr_rsvd_regions = ARRAY_SIZE(tegra194_bar4_rsvd),
+ .rsvd_regions = tegra194_bar4_rsvd,
+ },
.align = SZ_64K,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v3 4/4] misc: pci_endpoint_test: Add Tegra194 and Tegra234 device table entries
2026-03-24 8:08 [PATCH v3 0/4] PCI: endpoint: Add Tegra194/234 BAR layout and pci_endpoint_test support Manikanta Maddireddy
` (2 preceding siblings ...)
2026-03-24 8:08 ` [PATCH v3 3/4] PCI: tegra194: Expose BAR2 (MSI-X) and BAR4 (DMA) as 64-bit BAR_RESERVED Manikanta Maddireddy
@ 2026-03-24 8:08 ` Manikanta Maddireddy
2026-04-04 10:47 ` [PATCH v3 0/4] PCI: endpoint: Add Tegra194/234 BAR layout and pci_endpoint_test support Manivannan Sadhasivam
4 siblings, 0 replies; 6+ messages in thread
From: Manikanta Maddireddy @ 2026-03-24 8:08 UTC (permalink / raw)
To: bhelgaas, lpieralisi, kwilczynski, mani, robh, krzk+dt, conor+dt,
thierry.reding, jonathanh, kishon, arnd, gregkh, Frank.Li, den,
hongxing.zhu, jingoohan1, vidyas, cassel, 18255117159
Cc: linux-pci, linux-tegra, linux-kernel, Manikanta Maddireddy
Add PCI device IDs for Tegra194 (0x1ad4) and Tegra234(0x229b) Endpoint
controllers, so that pci_endpoint_test can bind and run on these
controllers.
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
---
v3: Fix review comment in v2
v2: Remove pci_endpoint_test_data
drivers/misc/pci_endpoint_test.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
index 55e128ed82f0..63f1e874719a 100644
--- a/drivers/misc/pci_endpoint_test.c
+++ b/drivers/misc/pci_endpoint_test.c
@@ -114,6 +114,9 @@
#define PCI_DEVICE_ID_ROCKCHIP_RK3588 0x3588
+#define PCI_DEVICE_ID_NVIDIA_TEGRA194_EP 0x1ad4
+#define PCI_DEVICE_ID_NVIDIA_TEGRA234_EP 0x229b
+
#define PCI_ENDPOINT_TEST_BAR_SUBRANGE_NSUB 2
static DEFINE_IDA(pci_endpoint_test_ida);
@@ -1438,6 +1441,8 @@ static const struct pci_device_id pci_endpoint_test_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_ROCKCHIP, PCI_DEVICE_ID_ROCKCHIP_RK3588),
.driver_data = (kernel_ulong_t)&rk3588_data,
},
+ { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TEGRA194_EP),},
+ { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_TEGRA234_EP),},
{ }
};
MODULE_DEVICE_TABLE(pci, pci_endpoint_test_tbl);
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v3 0/4] PCI: endpoint: Add Tegra194/234 BAR layout and pci_endpoint_test support
2026-03-24 8:08 [PATCH v3 0/4] PCI: endpoint: Add Tegra194/234 BAR layout and pci_endpoint_test support Manikanta Maddireddy
` (3 preceding siblings ...)
2026-03-24 8:08 ` [PATCH v3 4/4] misc: pci_endpoint_test: Add Tegra194 and Tegra234 device table entries Manikanta Maddireddy
@ 2026-04-04 10:47 ` Manivannan Sadhasivam
4 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam @ 2026-04-04 10:47 UTC (permalink / raw)
To: bhelgaas, lpieralisi, kwilczynski, robh, krzk+dt, conor+dt,
thierry.reding, jonathanh, kishon, arnd, gregkh, Frank.Li, den,
hongxing.zhu, jingoohan1, vidyas, cassel, 18255117159,
Manikanta Maddireddy
Cc: linux-pci, linux-tegra, linux-kernel
On Tue, 24 Mar 2026 13:38:53 +0530, Manikanta Maddireddy wrote:
> This series is on top of https://lore.kernel.org/linux-pci/20260312130229.2282001-12-cassel@kernel.org/T/#u
>
> This series wires up Tegra194 and Tegra234 PCI endpoint controllers to the
> shared PCI endpoint and test infrastructure:
>
> 1. Add a new reserved-region type for MSI-X (Table and PBA) so EPC drivers
> can describe hardware-owned MSI-X regions behind a BAR_RESERVED BAR.
>
> [...]
Applied, thanks!
[1/4] PCI: endpoint: Add reserved region type for MSI-X Table and PBA
commit: 5f352433ea39171e19fbb3a7e18d983510176854
[2/4] PCI: tegra194: Make BAR0 programmable and remove 1MB size limit
commit: 5aec1f18b326ddc455ae9d9d0f5394efc20eee9b
[3/4] PCI: tegra194: Expose BAR2 (MSI-X) and BAR4 (DMA) as 64-bit BAR_RESERVED
commit: 12a22fb38cbba1991a3f174912b343cdb6afa186
[4/4] misc: pci_endpoint_test: Add Tegra194 and Tegra234 device table entries
commit: 5ab7a225888baa5474def18ba3b0a298d27e6ba0
Best regards,
--
Manivannan Sadhasivam <mani@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread