Skip to content

Commit ad3b717

Browse files
Thippeswamy Havaligekwilczynski
authored andcommitted
PCI: xilinx-cpm: Add support for Versal Net CPM5NC Root Port controller
The Versal Net ACAP (Adaptive Compute Acceleration Platform) devices incorporate the Coherency and PCIe Gen5 Module, specifically the Next-Generation Compact Module (CPM5NC). The integrated CPM5NC block, along with the built-in bridge, can function as a PCIe Root Port and supports the PCIe Gen5 protocol with data transfer rates of up to 32 GT/s, and is capable of supporting up to a x16 lane-width configuration. Bridge errors are managed using a specific interrupt line designed for CPM5N. The INTx interrupt support is not available. Currently in this commit platform specific bridge errors support is not added. Signed-off-by: Thippeswamy Havalige <[email protected]> [kwilczynski: commit log, squashed patch to fix an if-statement condition to ensure that xilinx_cpm_pcie_init_port() does not run on the CPM5NC_HOST variant from https://lore.kernel.org/linux-pci/[email protected]] Signed-off-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ce095c5 commit ad3b717

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

drivers/pci/controller/pcie-xilinx-cpm.c

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ enum xilinx_cpm_version {
8484
CPM,
8585
CPM5,
8686
CPM5_HOST1,
87+
CPM5NC_HOST,
8788
};
8889

8990
/**
@@ -478,6 +479,9 @@ static void xilinx_cpm_pcie_init_port(struct xilinx_cpm_pcie *port)
478479
{
479480
const struct xilinx_cpm_variant *variant = port->variant;
480481

482+
if (variant->version == CPM5NC_HOST)
483+
return;
484+
481485
if (cpm_pcie_link_up(port))
482486
dev_info(port->dev, "PCIe Link is UP\n");
483487
else
@@ -578,18 +582,20 @@ static int xilinx_cpm_pcie_probe(struct platform_device *pdev)
578582

579583
port->dev = dev;
580584

581-
err = xilinx_cpm_pcie_init_irq_domain(port);
582-
if (err)
583-
return err;
585+
port->variant = of_device_get_match_data(dev);
586+
587+
if (port->variant->version != CPM5NC_HOST) {
588+
err = xilinx_cpm_pcie_init_irq_domain(port);
589+
if (err)
590+
return err;
591+
}
584592

585593
bus = resource_list_first_type(&bridge->windows, IORESOURCE_BUS);
586594
if (!bus) {
587595
err = -ENODEV;
588596
goto err_free_irq_domains;
589597
}
590598

591-
port->variant = of_device_get_match_data(dev);
592-
593599
err = xilinx_cpm_pcie_parse_dt(port, bus->res);
594600
if (err) {
595601
dev_err(dev, "Parsing DT failed\n");
@@ -598,10 +604,12 @@ static int xilinx_cpm_pcie_probe(struct platform_device *pdev)
598604

599605
xilinx_cpm_pcie_init_port(port);
600606

601-
err = xilinx_cpm_setup_irq(port);
602-
if (err) {
603-
dev_err(dev, "Failed to set up interrupts\n");
604-
goto err_setup_irq;
607+
if (port->variant->version != CPM5NC_HOST) {
608+
err = xilinx_cpm_setup_irq(port);
609+
if (err) {
610+
dev_err(dev, "Failed to set up interrupts\n");
611+
goto err_setup_irq;
612+
}
605613
}
606614

607615
bridge->sysdata = port->cfg;
@@ -614,11 +622,13 @@ static int xilinx_cpm_pcie_probe(struct platform_device *pdev)
614622
return 0;
615623

616624
err_host_bridge:
617-
xilinx_cpm_free_interrupts(port);
625+
if (port->variant->version != CPM5NC_HOST)
626+
xilinx_cpm_free_interrupts(port);
618627
err_setup_irq:
619628
pci_ecam_free(port->cfg);
620629
err_free_irq_domains:
621-
xilinx_cpm_free_irq_domains(port);
630+
if (port->variant->version != CPM5NC_HOST)
631+
xilinx_cpm_free_irq_domains(port);
622632
return err;
623633
}
624634

@@ -641,6 +651,10 @@ static const struct xilinx_cpm_variant cpm5_host1 = {
641651
.ir_enable = XILINX_CPM_PCIE1_IR_ENABLE,
642652
};
643653

654+
static const struct xilinx_cpm_variant cpm5n_host = {
655+
.version = CPM5NC_HOST,
656+
};
657+
644658
static const struct of_device_id xilinx_cpm_pcie_of_match[] = {
645659
{
646660
.compatible = "xlnx,versal-cpm-host-1.00",
@@ -654,6 +668,10 @@ static const struct of_device_id xilinx_cpm_pcie_of_match[] = {
654668
.compatible = "xlnx,versal-cpm5-host1",
655669
.data = &cpm5_host1,
656670
},
671+
{
672+
.compatible = "xlnx,versal-cpm5nc-host",
673+
.data = &cpm5n_host,
674+
},
657675
{}
658676
};
659677

0 commit comments

Comments
 (0)