Add support for Xilinx XDMA Soft IP as Root Port
Subsystems (4)
cover Add support for Xilinx XDMA Soft IP as Root Port
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
.../devicetree/bindings/pci/xlnx,xdma-host.yaml | 41 +++++++++++++++- drivers/pci/controller/pcie-xilinx-dma-pl.c | 56 ++++++++++++++++++++-- 2 files changed, 92 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/2 dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root Port Bridge
Add YAML devicetree schemas for Xilinx QDMA Soft IP PCIe Root Port Bridge.
--- .../devicetree/bindings/pci/xlnx,xdma-host.yaml | 41 ++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/pci/xlnx,xdma-host.yaml +39 -2
@@ -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
@@ -111,4 +122,30 @@ examples: interrupt-controller; }; }; + + axi-pcie@80000000 { + compatible = "xlnx,qdma-host-3.00"; + reg = <0x0 0x80000000 0x0 0x10000000>, <0x0 0x90000000 0x0 0x10000000>; + reg-names = "cfg", "breg"; + ranges = <0x2000000 0x0 0xa8000000 0x0 0xa8000000 0x0 0x8000000>, + <0x43000000 0x4 0x80000000 0x4 0x80000000 0x0 0x40000000>; + #address-cells = <3>; + #interrupt-cells = <1>; + #size-cells = <2>; + device_type = "pci"; + interrupt-parent = <&gic>; + interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "misc", "msi0", "msi1"; + interrupt-map-mask = <0x0 0x0 0x0 0x7>; + interrupt-map = <0 0 0 1 &pcie_intc_0 0>, + <0 0 0 2 &pcie_intc_0 1>, + <0 0 0 3 &pcie_intc_0 2>, + <0 0 0 4 &pcie_intc_0 3>; + pcie_intc_1: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; };
Signature · 1 line
1.8.3.1
Rob Herring (Arm)
maintainerRe: [PATCH 1/2] dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root Port Bridge
Quoted 7 lines · Thippeswamy Havalige
Add YAML devicetree schemas for Xilinx QDMA Soft IP PCIe Root Port Bridge.
Signed-off-by Thippeswamy Havalige <[email protected]>--- .../devicetree/bindings/pci/xlnx,xdma-host.yaml | 41 ++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-)
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/pci/xlnx,xdma-host.example.dts:55.31-79.15: Warning (pci_bridge): /example-0/soc/axi-pcie@80000000: node name is not "pci" or "pcie" Documentation/devicetree/bindings/pci/xlnx,xdma-host.example.dtb: Warning (unit_address_format): Failed prerequisite 'pci_bridge' Documentation/devicetree/bindings/pci/xlnx,xdma-host.example.dtb: Warning (pci_device_reg): Failed prerequisite 'pci_bridge' Documentation/devicetree/bindings/pci/xlnx,xdma-host.example.dtb: Warning (pci_device_bus_num): Failed prerequisite 'pci_bridge' /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/xlnx,xdma-host.example.dtb: axi-pcie@80000000: $nodename:0: 'axi-pcie@80000000' does not match '^pcie?@'
from schema $id: http://devicetree.org/schemas/pci/xlnx,xdma-host.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/xlnx,xdma-host.example.dtb: axi-pcie@80000000: Unevaluated properties are not allowed ('#address-cells', '#size-cells', 'device_type' were unexpected)
from schema $id: http://devicetree.org/schemas/pci/xlnx,xdma-host.yaml#
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
PATCH 2/2 PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver
In reply to Thippeswamy HavaligeAdd 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.
--- drivers/pci/controller/pcie-xilinx-dma-pl.c | 56 +++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-)
drivers/pci/controller/pcie-xilinx-dma-pl.c +53 -3
@@ -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 - CPM 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;
@@ -101,6 +116,7 @@ struct xilinx_msi {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 +126,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) { -return readl (port->reg_base + reg); +if (port->variant->version ==XDMA ) +return readl (port->reg_base + reg); +else +return readl (port->reg_base + reg +QDMA_BRIDGE_BASE_OFF ); }static inline void pcie_write (struct pl_dma_pcie *port,u32 val,u32 reg) { -writel (val, port->reg_base + reg); +if (port->variant->version ==XDMA ) +writel (val, port->reg_base + reg); +else +writel (val, port->reg_base + reg +QDMA_BRIDGE_BASE_OFF ); }static inline bool xilinx_pl_dma_pcie_link_up (struct pl_dma_pcie *port)
@@ -173,7 +196,10 @@ static void __iomem *xilinx_pl_dma_pcie_map_bus(struct pci_bus *bus,if (!xilinx_pl_dma_pcie_valid_device (bus, devfn))return NULL ; -return port->reg_base +PCIE_ECAM_OFFSET (bus->number, devfn, where); +if (port->variant->version ==XDMA ) +return port->reg_base +PCIE_ECAM_OFFSET (bus->number, devfn, where); +else +return port->cfg_base +PCIE_ECAM_OFFSET (bus->number, devfn, where); }/* PCIe operations */
@@ -731,6 +757,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 +795,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 +828,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, }, {} };
Signature · 1 line
1.8.3.1
kernel test robot
build botRe: [PATCH 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver
kernel test robot noticed the following build warnings:
Hi Thippeswamy,
kernel test robot noticed the following build warnings:
[auto build test WARNING on pci/next]
[also build test WARNING on pci/for-linus linus/master v6.10-rc5 next-20240625] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Thippeswamy-Havalige/dt-bindings-PCI-xilinx-xdma-Add-schemas-for-Xilinx-QDMA-PCIe-Root-Port-Bridge/20240626-052852 base: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next patch link: https://lore.kernel.org/r/20240624104239.132159-3-thippesw%40amd.com patch subject: [PATCH 2/2] PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20240627/[email protected]/config) compiler: loongarch64-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240627/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/pci/controller/pcie-xilinx-dma-pl.c:130: warning: Function parameter or struct member 'cfg_base' not described in 'pl_dma_pcie' >> drivers/pci/controller/pcie-xilinx-dma-pl.c:130: warning: Function parameter or struct member 'variant' not described in 'pl_dma_pcie'
vim +130 drivers/pci/controller/pcie-xilinx-dma-pl.c
8d786149d78c77 Thippeswamy Havalige 2023-10-03 101
8d786149d78c77 Thippeswamy Havalige 2023-10-03 102 /**
8d786149d78c77 Thippeswamy Havalige 2023-10-03 103 * struct pl_dma_pcie - PCIe port information
8d786149d78c77 Thippeswamy Havalige 2023-10-03 104 * @dev: Device pointer
8d786149d78c77 Thippeswamy Havalige 2023-10-03 105 * @reg_base: IO Mapped Register Base
8d786149d78c77 Thippeswamy Havalige 2023-10-03 106 * @irq: Interrupt number
8d786149d78c77 Thippeswamy Havalige 2023-10-03 107 * @cfg: Holds mappings of config space window
8d786149d78c77 Thippeswamy Havalige 2023-10-03 108 * @phys_reg_base: Physical address of reg base
8d786149d78c77 Thippeswamy Havalige 2023-10-03 109 * @intx_domain: Legacy IRQ domain pointer
8d786149d78c77 Thippeswamy Havalige 2023-10-03 110 * @pldma_domain: PL DMA IRQ domain pointer
8d786149d78c77 Thippeswamy Havalige 2023-10-03 111 * @resources: Bus Resources
8d786149d78c77 Thippeswamy Havalige 2023-10-03 112 * @msi: MSI information
8d786149d78c77 Thippeswamy Havalige 2023-10-03 113 * @intx_irq: INTx error interrupt number
8d786149d78c77 Thippeswamy Havalige 2023-10-03 114 * @lock: Lock protecting shared register access
8d786149d78c77 Thippeswamy Havalige 2023-10-03 115 */
8d786149d78c77 Thippeswamy Havalige 2023-10-03 116 struct pl_dma_pcie {
8d786149d78c77 Thippeswamy Havalige 2023-10-03 117 struct device *dev;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 118 void __iomem *reg_base;
21ff31dc400101 Thippeswamy Havalige 2024-06-24 119 void __iomem *cfg_base;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 120 int irq;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 121 struct pci_config_window *cfg;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 122 phys_addr_t phys_reg_base;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 123 struct irq_domain *intx_domain;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 124 struct irq_domain *pldma_domain;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 125 struct list_head resources;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 126 struct xilinx_msi msi;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 127 int intx_irq;
8d786149d78c77 Thippeswamy Havalige 2023-10-03 128 raw_spinlock_t lock;
21ff31dc400101 Thippeswamy Havalige 2024-06-24 129 const struct xilinx_pl_dma_variant *variant;8d786149d78c77 Thippeswamy Havalige 2023-10-03 @130 }; 8d786149d78c77 Thippeswamy Havalige 2023-10-03 131
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki