* [PATCH v4 0/2] Add support for Xilinx XDMA Soft IP as Root Port
@ 2024-08-11 2:23 Thippeswamy Havalige
2024-08-11 2:23 ` [PATCH v4 1/2] dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root Port Bridge Thippeswamy Havalige
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Thippeswamy Havalige @ 2024-08-11 2:23 UTC (permalink / raw)
To: bhelgaas, lpieralisi, kw, robh, krzk+dt, conor+dt, linux-pci,
devicetree, linux-kernel
Cc: michal.simek, linux-arm-kernel, Thippeswamy Havalige
This series of patch add support for Xilinx QDMA Soft IP as Root Port.
The Xilinx QDMA Soft IP support's 32 bit and 64bit BAR's.
As Root Port it supports MSI and legacy interrupts.
Thippeswamy Havalige (2):
dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root
Port Bridge
PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver
.../bindings/pci/xlnx,xdma-host.yaml | 36 ++++++++++++-
drivers/pci/controller/pcie-xilinx-dma-pl.c | 54 ++++++++++++++++++-
2 files changed, 87 insertions(+), 3 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v4 1/2] dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root Port Bridge
2024-08-11 2:23 [PATCH v4 0/2] Add support for Xilinx XDMA Soft IP as Root Port Thippeswamy Havalige
@ 2024-08-11 2:23 ` Thippeswamy Havalige
2024-08-11 2:23 ` [PATCH v4 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver Thippeswamy Havalige
2024-09-01 16:45 ` [PATCH v4 0/2] Add support for Xilinx XDMA Soft IP as Root Port Krzysztof Wilczyński
2 siblings, 0 replies; 7+ messages in thread
From: Thippeswamy Havalige @ 2024-08-11 2:23 UTC (permalink / raw)
To: bhelgaas, lpieralisi, kw, robh, krzk+dt, conor+dt, linux-pci,
devicetree, linux-kernel
Cc: michal.simek, linux-arm-kernel, Thippeswamy Havalige,
Conor Dooley
Add YAML devicetree schemas for Xilinx QDMA Soft IP PCIe Root Port
Bridge version 3.0.
Signed-off-by: Thippeswamy Havalige <thippesw@amd.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
.../bindings/pci/xlnx,xdma-host.yaml | 36 +++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
---
changes in v4
- update IP version
changes in v3
- constrain the new entry to only the new compatible.
- Remove example.
changes in v2
- update dt node label with pcie.
---
diff --git a/Documentation/devicetree/bindings/pci/xlnx,xdma-host.yaml b/Documentation/devicetree/bindings/pci/xlnx,xdma-host.yaml
index 2f59b3a73dd2..f1efd919c351 100644
--- a/Documentation/devicetree/bindings/pci/xlnx,xdma-host.yaml
+++ b/Documentation/devicetree/bindings/pci/xlnx,xdma-host.yaml
@@ -14,10 +14,21 @@ allOf:
properties:
compatible:
- const: xlnx,xdma-host-3.00
+ enum:
+ - xlnx,xdma-host-3.00
+ - xlnx,qdma-host-3.00
reg:
- maxItems: 1
+ items:
+ - description: configuration region and XDMA bridge register.
+ - description: QDMA bridge register.
+ minItems: 1
+
+ reg-names:
+ items:
+ - const: cfg
+ - const: breg
+ minItems: 1
ranges:
maxItems: 2
@@ -76,6 +87,27 @@ required:
- "#interrupt-cells"
- interrupt-controller
+if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - xlnx,qdma-host-3.00
+then:
+ properties:
+ reg:
+ minItems: 2
+ reg-names:
+ minItems: 2
+ required:
+ - reg-names
+else:
+ properties:
+ reg:
+ maxItems: 1
+ reg-names:
+ maxItems: 1
+
unevaluatedProperties: false
examples:
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v4 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver
2024-08-11 2:23 [PATCH v4 0/2] Add support for Xilinx XDMA Soft IP as Root Port Thippeswamy Havalige
2024-08-11 2:23 ` [PATCH v4 1/2] dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root Port Bridge Thippeswamy Havalige
@ 2024-08-11 2:23 ` Thippeswamy Havalige
2024-08-21 5:34 ` Havalige, Thippeswamy
2024-08-30 16:33 ` Manivannan Sadhasivam
2024-09-01 16:45 ` [PATCH v4 0/2] Add support for Xilinx XDMA Soft IP as Root Port Krzysztof Wilczyński
2 siblings, 2 replies; 7+ messages in thread
From: Thippeswamy Havalige @ 2024-08-11 2:23 UTC (permalink / raw)
To: bhelgaas, lpieralisi, kw, robh, krzk+dt, conor+dt, linux-pci,
devicetree, linux-kernel
Cc: michal.simek, linux-arm-kernel, Thippeswamy Havalige
Add support for Xilinx QDMA Soft IP core as Root Port.
The Versal Prime devices support QDMA soft IP module in programmable logic.
The integrated QDMA Soft IP block has integrated bridge function that can
act as PCIe Root Port.
Signed-off-by: Thippeswamy Havalige <thippesw@amd.com>
---
drivers/pci/controller/pcie-xilinx-dma-pl.c | 54 ++++++++++++++++++++-
1 file changed, 53 insertions(+), 1 deletion(-)
---
changes in v4:
- none
changes in v3:
- Modify macro value to lower case.
- Change return type based QDMA compatible.
changes in v2:
- Add description for struct pl_dma_pcie
---
diff --git a/drivers/pci/controller/pcie-xilinx-dma-pl.c b/drivers/pci/controller/pcie-xilinx-dma-pl.c
index 5be5dfd8398f..1ea6a1d265bb 100644
--- a/drivers/pci/controller/pcie-xilinx-dma-pl.c
+++ b/drivers/pci/controller/pcie-xilinx-dma-pl.c
@@ -13,6 +13,7 @@
#include <linux/msi.h>
#include <linux/of_address.h>
#include <linux/of_pci.h>
+#include <linux/of_platform.h>
#include "../pci.h"
#include "pcie-xilinx-common.h"
@@ -71,10 +72,24 @@
/* Phy Status/Control Register definitions */
#define XILINX_PCIE_DMA_REG_PSCR_LNKUP BIT(11)
+#define QDMA_BRIDGE_BASE_OFF 0xcd8
/* Number of MSI IRQs */
#define XILINX_NUM_MSI_IRQS 64
+enum xilinx_pl_dma_version {
+ XDMA,
+ QDMA,
+};
+
+/**
+ * struct xilinx_pl_dma_variant - PL DMA PCIe variant information
+ * @version: DMA version
+ */
+struct xilinx_pl_dma_variant {
+ enum xilinx_pl_dma_version version;
+};
+
struct xilinx_msi {
struct irq_domain *msi_domain;
unsigned long *bitmap;
@@ -88,6 +103,7 @@ struct xilinx_msi {
* struct pl_dma_pcie - PCIe port information
* @dev: Device pointer
* @reg_base: IO Mapped Register Base
+ * @cfg_base: IO Mapped Configuration Base
* @irq: Interrupt number
* @cfg: Holds mappings of config space window
* @phys_reg_base: Physical address of reg base
@@ -97,10 +113,12 @@ struct xilinx_msi {
* @msi: MSI information
* @intx_irq: INTx error interrupt number
* @lock: Lock protecting shared register access
+ * @variant: PL DMA PCIe version check pointer
*/
struct pl_dma_pcie {
struct device *dev;
void __iomem *reg_base;
+ void __iomem *cfg_base;
int irq;
struct pci_config_window *cfg;
phys_addr_t phys_reg_base;
@@ -110,16 +128,23 @@ struct pl_dma_pcie {
struct xilinx_msi msi;
int intx_irq;
raw_spinlock_t lock;
+ const struct xilinx_pl_dma_variant *variant;
};
static inline u32 pcie_read(struct pl_dma_pcie *port, u32 reg)
{
+ if (port->variant->version == QDMA)
+ return readl(port->reg_base + reg + QDMA_BRIDGE_BASE_OFF);
+
return readl(port->reg_base + reg);
}
static inline void pcie_write(struct pl_dma_pcie *port, u32 val, u32 reg)
{
- writel(val, port->reg_base + reg);
+ if (port->variant->version == QDMA)
+ writel(val, port->reg_base + reg + QDMA_BRIDGE_BASE_OFF);
+ else
+ writel(val, port->reg_base + reg);
}
static inline bool xilinx_pl_dma_pcie_link_up(struct pl_dma_pcie *port)
@@ -173,6 +198,9 @@ static void __iomem *xilinx_pl_dma_pcie_map_bus(struct pci_bus *bus,
if (!xilinx_pl_dma_pcie_valid_device(bus, devfn))
return NULL;
+ if (port->variant->version == QDMA)
+ return port->cfg_base + PCIE_ECAM_OFFSET(bus->number, devfn, where);
+
return port->reg_base + PCIE_ECAM_OFFSET(bus->number, devfn, where);
}
@@ -731,6 +759,15 @@ static int xilinx_pl_dma_pcie_parse_dt(struct pl_dma_pcie *port,
port->reg_base = port->cfg->win;
+ if (port->variant->version == QDMA) {
+ port->cfg_base = port->cfg->win;
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "breg");
+ port->reg_base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(port->reg_base))
+ return PTR_ERR(port->reg_base);
+ port->phys_reg_base = res->start;
+ }
+
err = xilinx_request_msi_irq(port);
if (err) {
pci_ecam_free(port->cfg);
@@ -760,6 +797,8 @@ static int xilinx_pl_dma_pcie_probe(struct platform_device *pdev)
if (!bus)
return -ENODEV;
+ port->variant = of_device_get_match_data(dev);
+
err = xilinx_pl_dma_pcie_parse_dt(port, bus->res);
if (err) {
dev_err(dev, "Parsing DT failed\n");
@@ -791,9 +830,22 @@ static int xilinx_pl_dma_pcie_probe(struct platform_device *pdev)
return err;
}
+static const struct xilinx_pl_dma_variant xdma_host = {
+ .version = XDMA,
+};
+
+static const struct xilinx_pl_dma_variant qdma_host = {
+ .version = QDMA,
+};
+
static const struct of_device_id xilinx_pl_dma_pcie_of_match[] = {
{
.compatible = "xlnx,xdma-host-3.00",
+ .data = &xdma_host,
+ },
+ {
+ .compatible = "xlnx,qdma-host-3.00",
+ .data = &qdma_host,
},
{}
};
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH v4 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver
2024-08-11 2:23 ` [PATCH v4 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver Thippeswamy Havalige
@ 2024-08-21 5:34 ` Havalige, Thippeswamy
2024-08-30 16:33 ` Manivannan Sadhasivam
1 sibling, 0 replies; 7+ messages in thread
From: Havalige, Thippeswamy @ 2024-08-21 5:34 UTC (permalink / raw)
To: Havalige, Thippeswamy, bhelgaas@google.com, lpieralisi@kernel.org,
kw@linux.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, linux-pci@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Simek, Michal, linux-arm-kernel@lists.infradead.org
Hi Bjorn,
Can you please update this patch.
Regards,
Thippeswamy H
> -----Original Message-----
> From: Thippeswamy Havalige <thippesw@amd.com>
> Sent: Sunday, August 11, 2024 7:54 AM
> To: bhelgaas@google.com; lpieralisi@kernel.org; kw@linux.com;
> robh@kernel.org; krzk+dt@kernel.org; conor+dt@kernel.org; linux-
> pci@vger.kernel.org; devicetree@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Cc: Simek, Michal <michal.simek@amd.com>; linux-arm-
> kernel@lists.infradead.org; Havalige, Thippeswamy
> <thippeswamy.havalige@amd.com>
> Subject: [PATCH v4 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver
>
> Add support for Xilinx QDMA Soft IP core as Root Port.
>
> The Versal Prime devices support QDMA soft IP module in programmable
> logic.
>
> The integrated QDMA Soft IP block has integrated bridge function that can
> act as PCIe Root Port.
>
> Signed-off-by: Thippeswamy Havalige <thippesw@amd.com>
> ---
> drivers/pci/controller/pcie-xilinx-dma-pl.c | 54 ++++++++++++++++++++-
> 1 file changed, 53 insertions(+), 1 deletion(-)
> ---
> changes in v4:
> - none
>
> changes in v3:
> - Modify macro value to lower case.
> - Change return type based QDMA compatible.
>
> changes in v2:
> - Add description for struct pl_dma_pcie
> ---
> diff --git a/drivers/pci/controller/pcie-xilinx-dma-pl.c
> b/drivers/pci/controller/pcie-xilinx-dma-pl.c
> index 5be5dfd8398f..1ea6a1d265bb 100644
> --- a/drivers/pci/controller/pcie-xilinx-dma-pl.c
> +++ b/drivers/pci/controller/pcie-xilinx-dma-pl.c
> @@ -13,6 +13,7 @@
> #include <linux/msi.h>
> #include <linux/of_address.h>
> #include <linux/of_pci.h>
> +#include <linux/of_platform.h>
>
> #include "../pci.h"
> #include "pcie-xilinx-common.h"
> @@ -71,10 +72,24 @@
>
> /* Phy Status/Control Register definitions */
> #define XILINX_PCIE_DMA_REG_PSCR_LNKUP BIT(11)
> +#define QDMA_BRIDGE_BASE_OFF 0xcd8
>
> /* Number of MSI IRQs */
> #define XILINX_NUM_MSI_IRQS 64
>
> +enum xilinx_pl_dma_version {
> + XDMA,
> + QDMA,
> +};
> +
> +/**
> + * struct xilinx_pl_dma_variant - PL DMA PCIe variant information
> + * @version: DMA version
> + */
> +struct xilinx_pl_dma_variant {
> + enum xilinx_pl_dma_version version;
> +};
> +
> struct xilinx_msi {
> struct irq_domain *msi_domain;
> unsigned long *bitmap;
> @@ -88,6 +103,7 @@ struct xilinx_msi {
> * struct pl_dma_pcie - PCIe port information
> * @dev: Device pointer
> * @reg_base: IO Mapped Register Base
> + * @cfg_base: IO Mapped Configuration Base
> * @irq: Interrupt number
> * @cfg: Holds mappings of config space window
> * @phys_reg_base: Physical address of reg base
> @@ -97,10 +113,12 @@ struct xilinx_msi {
> * @msi: MSI information
> * @intx_irq: INTx error interrupt number
> * @lock: Lock protecting shared register access
> + * @variant: PL DMA PCIe version check pointer
> */
> struct pl_dma_pcie {
> struct device *dev;
> void __iomem *reg_base;
> + void __iomem *cfg_base;
> int irq;
> struct pci_config_window *cfg;
> phys_addr_t phys_reg_base;
> @@ -110,16 +128,23 @@ struct pl_dma_pcie {
> struct xilinx_msi msi;
> int intx_irq;
> raw_spinlock_t lock;
> + const struct xilinx_pl_dma_variant *variant;
> };
>
> static inline u32 pcie_read(struct pl_dma_pcie *port, u32 reg)
> {
> + if (port->variant->version == QDMA)
> + return readl(port->reg_base + reg +
> QDMA_BRIDGE_BASE_OFF);
> +
> return readl(port->reg_base + reg);
> }
>
> static inline void pcie_write(struct pl_dma_pcie *port, u32 val, u32 reg)
> {
> - writel(val, port->reg_base + reg);
> + if (port->variant->version == QDMA)
> + writel(val, port->reg_base + reg +
> QDMA_BRIDGE_BASE_OFF);
> + else
> + writel(val, port->reg_base + reg);
> }
>
> static inline bool xilinx_pl_dma_pcie_link_up(struct pl_dma_pcie *port)
> @@ -173,6 +198,9 @@ static void __iomem
> *xilinx_pl_dma_pcie_map_bus(struct pci_bus *bus,
> if (!xilinx_pl_dma_pcie_valid_device(bus, devfn))
> return NULL;
>
> + if (port->variant->version == QDMA)
> + return port->cfg_base + PCIE_ECAM_OFFSET(bus->number,
> devfn, where);
> +
> return port->reg_base + PCIE_ECAM_OFFSET(bus->number, devfn,
> where);
> }
>
> @@ -731,6 +759,15 @@ static int xilinx_pl_dma_pcie_parse_dt(struct
> pl_dma_pcie *port,
>
> port->reg_base = port->cfg->win;
>
> + if (port->variant->version == QDMA) {
> + port->cfg_base = port->cfg->win;
> + res = platform_get_resource_byname(pdev,
> IORESOURCE_MEM, "breg");
> + port->reg_base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(port->reg_base))
> + return PTR_ERR(port->reg_base);
> + port->phys_reg_base = res->start;
> + }
> +
> err = xilinx_request_msi_irq(port);
> if (err) {
> pci_ecam_free(port->cfg);
> @@ -760,6 +797,8 @@ static int xilinx_pl_dma_pcie_probe(struct
> platform_device *pdev)
> if (!bus)
> return -ENODEV;
>
> + port->variant = of_device_get_match_data(dev);
> +
> err = xilinx_pl_dma_pcie_parse_dt(port, bus->res);
> if (err) {
> dev_err(dev, "Parsing DT failed\n");
> @@ -791,9 +830,22 @@ static int xilinx_pl_dma_pcie_probe(struct
> platform_device *pdev)
> return err;
> }
>
> +static const struct xilinx_pl_dma_variant xdma_host = {
> + .version = XDMA,
> +};
> +
> +static const struct xilinx_pl_dma_variant qdma_host = {
> + .version = QDMA,
> +};
> +
> static const struct of_device_id xilinx_pl_dma_pcie_of_match[] = {
> {
> .compatible = "xlnx,xdma-host-3.00",
> + .data = &xdma_host,
> + },
> + {
> + .compatible = "xlnx,qdma-host-3.00",
> + .data = &qdma_host,
> },
> {}
> };
> --
> 2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver
2024-08-11 2:23 ` [PATCH v4 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver Thippeswamy Havalige
2024-08-21 5:34 ` Havalige, Thippeswamy
@ 2024-08-30 16:33 ` Manivannan Sadhasivam
2024-09-01 16:46 ` Krzysztof Wilczyński
1 sibling, 1 reply; 7+ messages in thread
From: Manivannan Sadhasivam @ 2024-08-30 16:33 UTC (permalink / raw)
To: Thippeswamy Havalige
Cc: bhelgaas, lpieralisi, kw, robh, krzk+dt, conor+dt, linux-pci,
devicetree, linux-kernel, michal.simek, linux-arm-kernel
On Sun, Aug 11, 2024 at 07:53:45AM +0530, Thippeswamy Havalige wrote:
> Add support for Xilinx QDMA Soft IP core as Root Port.
>
> The Versal Prime devices support QDMA soft IP module in programmable logic.
>
> The integrated QDMA Soft IP block has integrated bridge function that can
> act as PCIe Root Port.
>
> Signed-off-by: Thippeswamy Havalige <thippesw@amd.com>
One comment below. With that addressed,
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
> drivers/pci/controller/pcie-xilinx-dma-pl.c | 54 ++++++++++++++++++++-
> 1 file changed, 53 insertions(+), 1 deletion(-)
> ---
> changes in v4:
> - none
>
> changes in v3:
> - Modify macro value to lower case.
> - Change return type based QDMA compatible.
>
> changes in v2:
> - Add description for struct pl_dma_pcie
> ---
> diff --git a/drivers/pci/controller/pcie-xilinx-dma-pl.c b/drivers/pci/controller/pcie-xilinx-dma-pl.c
> index 5be5dfd8398f..1ea6a1d265bb 100644
> --- a/drivers/pci/controller/pcie-xilinx-dma-pl.c
> +++ b/drivers/pci/controller/pcie-xilinx-dma-pl.c
> @@ -13,6 +13,7 @@
> #include <linux/msi.h>
> #include <linux/of_address.h>
> #include <linux/of_pci.h>
> +#include <linux/of_platform.h>
Looks like this header is not used.
- Mani
>
> #include "../pci.h"
> #include "pcie-xilinx-common.h"
> @@ -71,10 +72,24 @@
>
> /* Phy Status/Control Register definitions */
> #define XILINX_PCIE_DMA_REG_PSCR_LNKUP BIT(11)
> +#define QDMA_BRIDGE_BASE_OFF 0xcd8
>
> /* Number of MSI IRQs */
> #define XILINX_NUM_MSI_IRQS 64
>
> +enum xilinx_pl_dma_version {
> + XDMA,
> + QDMA,
> +};
> +
> +/**
> + * struct xilinx_pl_dma_variant - PL DMA PCIe variant information
> + * @version: DMA version
> + */
> +struct xilinx_pl_dma_variant {
> + enum xilinx_pl_dma_version version;
> +};
> +
> struct xilinx_msi {
> struct irq_domain *msi_domain;
> unsigned long *bitmap;
> @@ -88,6 +103,7 @@ struct xilinx_msi {
> * struct pl_dma_pcie - PCIe port information
> * @dev: Device pointer
> * @reg_base: IO Mapped Register Base
> + * @cfg_base: IO Mapped Configuration Base
> * @irq: Interrupt number
> * @cfg: Holds mappings of config space window
> * @phys_reg_base: Physical address of reg base
> @@ -97,10 +113,12 @@ struct xilinx_msi {
> * @msi: MSI information
> * @intx_irq: INTx error interrupt number
> * @lock: Lock protecting shared register access
> + * @variant: PL DMA PCIe version check pointer
> */
> struct pl_dma_pcie {
> struct device *dev;
> void __iomem *reg_base;
> + void __iomem *cfg_base;
> int irq;
> struct pci_config_window *cfg;
> phys_addr_t phys_reg_base;
> @@ -110,16 +128,23 @@ struct pl_dma_pcie {
> struct xilinx_msi msi;
> int intx_irq;
> raw_spinlock_t lock;
> + const struct xilinx_pl_dma_variant *variant;
> };
>
> static inline u32 pcie_read(struct pl_dma_pcie *port, u32 reg)
> {
> + if (port->variant->version == QDMA)
> + return readl(port->reg_base + reg + QDMA_BRIDGE_BASE_OFF);
> +
> return readl(port->reg_base + reg);
> }
>
> static inline void pcie_write(struct pl_dma_pcie *port, u32 val, u32 reg)
> {
> - writel(val, port->reg_base + reg);
> + if (port->variant->version == QDMA)
> + writel(val, port->reg_base + reg + QDMA_BRIDGE_BASE_OFF);
> + else
> + writel(val, port->reg_base + reg);
> }
>
> static inline bool xilinx_pl_dma_pcie_link_up(struct pl_dma_pcie *port)
> @@ -173,6 +198,9 @@ static void __iomem *xilinx_pl_dma_pcie_map_bus(struct pci_bus *bus,
> if (!xilinx_pl_dma_pcie_valid_device(bus, devfn))
> return NULL;
>
> + if (port->variant->version == QDMA)
> + return port->cfg_base + PCIE_ECAM_OFFSET(bus->number, devfn, where);
> +
> return port->reg_base + PCIE_ECAM_OFFSET(bus->number, devfn, where);
> }
>
> @@ -731,6 +759,15 @@ static int xilinx_pl_dma_pcie_parse_dt(struct pl_dma_pcie *port,
>
> port->reg_base = port->cfg->win;
>
> + if (port->variant->version == QDMA) {
> + port->cfg_base = port->cfg->win;
> + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "breg");
> + port->reg_base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(port->reg_base))
> + return PTR_ERR(port->reg_base);
> + port->phys_reg_base = res->start;
> + }
> +
> err = xilinx_request_msi_irq(port);
> if (err) {
> pci_ecam_free(port->cfg);
> @@ -760,6 +797,8 @@ static int xilinx_pl_dma_pcie_probe(struct platform_device *pdev)
> if (!bus)
> return -ENODEV;
>
> + port->variant = of_device_get_match_data(dev);
> +
> err = xilinx_pl_dma_pcie_parse_dt(port, bus->res);
> if (err) {
> dev_err(dev, "Parsing DT failed\n");
> @@ -791,9 +830,22 @@ static int xilinx_pl_dma_pcie_probe(struct platform_device *pdev)
> return err;
> }
>
> +static const struct xilinx_pl_dma_variant xdma_host = {
> + .version = XDMA,
> +};
> +
> +static const struct xilinx_pl_dma_variant qdma_host = {
> + .version = QDMA,
> +};
> +
> static const struct of_device_id xilinx_pl_dma_pcie_of_match[] = {
> {
> .compatible = "xlnx,xdma-host-3.00",
> + .data = &xdma_host,
> + },
> + {
> + .compatible = "xlnx,qdma-host-3.00",
> + .data = &qdma_host,
> },
> {}
> };
> --
> 2.34.1
>
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4 0/2] Add support for Xilinx XDMA Soft IP as Root Port
2024-08-11 2:23 [PATCH v4 0/2] Add support for Xilinx XDMA Soft IP as Root Port Thippeswamy Havalige
2024-08-11 2:23 ` [PATCH v4 1/2] dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root Port Bridge Thippeswamy Havalige
2024-08-11 2:23 ` [PATCH v4 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver Thippeswamy Havalige
@ 2024-09-01 16:45 ` Krzysztof Wilczyński
2 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Wilczyński @ 2024-09-01 16:45 UTC (permalink / raw)
To: Thippeswamy Havalige
Cc: bhelgaas, lpieralisi, robh, krzk+dt, conor+dt, linux-pci,
devicetree, linux-kernel, michal.simek, linux-arm-kernel
Hello,
> This series of patch add support for Xilinx QDMA Soft IP as Root Port.
>
> The Xilinx QDMA Soft IP support's 32 bit and 64bit BAR's.
> As Root Port it supports MSI and legacy interrupts.
Applied to controller/xilinx, thank you!
[01/02] dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root Port Bridge
https://git.kernel.org/pci/pci/c/899d54826110
[02/02] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver
https://git.kernel.org/pci/pci/c/6ac721795d73
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver
2024-08-30 16:33 ` Manivannan Sadhasivam
@ 2024-09-01 16:46 ` Krzysztof Wilczyński
0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Wilczyński @ 2024-09-01 16:46 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Thippeswamy Havalige, bhelgaas, lpieralisi, robh, krzk+dt,
conor+dt, linux-pci, devicetree, linux-kernel, michal.simek,
linux-arm-kernel
Hello,
[...]
> > +#include <linux/of_platform.h>
>
> Looks like this header is not used.
I removed it from the final version, thank you!
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-09-01 16:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-11 2:23 [PATCH v4 0/2] Add support for Xilinx XDMA Soft IP as Root Port Thippeswamy Havalige
2024-08-11 2:23 ` [PATCH v4 1/2] dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root Port Bridge Thippeswamy Havalige
2024-08-11 2:23 ` [PATCH v4 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver Thippeswamy Havalige
2024-08-21 5:34 ` Havalige, Thippeswamy
2024-08-30 16:33 ` Manivannan Sadhasivam
2024-09-01 16:46 ` Krzysztof Wilczyński
2024-09-01 16:45 ` [PATCH v4 0/2] Add support for Xilinx XDMA Soft IP as Root Port Krzysztof Wilczyński
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).