Skip to contentSkip to conversation

PCI: keembay: Add support for Intel Keem Bay

PATCH Applied [email protected] 2 participants 7 messages Aug 5, 2021 – Aug 20, 2021

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

v11 cover PCI: keembay: Add support for Intel Keem Bay

From: Srikanth Thokala <[email protected]>

Hi,

The first patch is to document DT bindings for Keem Bay PCIe controller for both Root Complex and Endpoint modes.

The second patch is the driver file, a glue driver. Keem Bay PCIe controller is based on DesignWare PCIe IP.

The patch was tested with Keem Bay evaluation module board, with B0 stepping.

Kindly review.

Thanks!
Srikanth

Changes since v10:
- Added a comment to describe the deviation from standard DWC framework in handling MSI IRQ.
- Add 'Reviewed-by: Rob Herring <[email protected]>', thanks to Rob.
- Rebased to v5.14-rc4.

Changes since v9:
- Add 'Reviewed-by: Krzysztof Wilczyński <[email protected]>', thanks to Krzysztof.
- Rebased to v5.13-rc5.

Changes since v8:
- Use chained IRQ to handle MSIs, as suggested by Lorenzo Pieralisi.
- Rename *_setup_irq() to *_setup_msi_irq() to be more meaningful.
- Move *_setup_msi_irq() call to *_add_pcie_port() to make it invoke only when controller is in Root Complex mode. In Endpoint mode, IRQ will be setup by the respective driver which will be based on PCIe End Point Framework.

Changes since v7:
- Rename keembay_pcie_ltssm_enable() to align to its functionality.
- Fix other minor comments from "Krzysztof Wilczyński <[email protected]>"

Changes since v6:
- Arrange SoB in chronological order.
- Alphabetized and modified status of entry in MAINTAINERS.
- Added a comment to specify the PCIe spec section about the delay.

Changes since v5:
- Rebased to v5.11-rc4.
- Updated maintainers to add myself in DT binding documents.
- Fix checkpatch issues.

Changes since v4:
- Rebased to v5.11-rc1 and retest.

Changes since v3:
- Add Reviewed-by: Rob Herring <[email protected]> tag in dt-bindings patch.
- Remove the keembay_pcie_{readl,writel} wrappers. And replace them with readl() and writel().
- Remove the dead code related to unused irqs.
- Remove unused definition for unused irqs.
- In keembay_pcie_ep_init(), initialize enabled interrupts to known state.
- Rebased to next-20201215.

Changes since v2:
- In keembay_pcie_probe(), use return keembay_pcie_add_pcie_port(pcie, pdev); statement and remove return 0; at the end of the function.

Changes since v1:
- In dt-bindings patch.
- Fixed indent warning for compatible property.
- Rename interrupt-names to pcie, pcie_ev, pcie_err and pcie_mem_access, similar to the name used in datasheet.
- Remove device_type, #address-cells and #size-cells property.
- Remove num-viewport, num-ib-windows and num-ob-windows property.
- Replace additionalProperties with unevaluatedProperties, for RC only.
- Add dbi2 and atu property.
- Remove description for regs and interrupts property.
- Change enum value for num-lanes to 1 and 2 only.
- In driver patch.
- In Kconfig file, remove dependency on ARM64.
- Add new define, PCIE_REGS_PCIE_SII_LINK_UP.
- Remove PCIE_DBI2_MASK.
- In struct keembay_pcie, declare pci member as struct, not pointer. And remove irq number members.
- Rename and rework keembay_pcie_establish_link(), to keembay_pcie_start_link().
- Remove unneeded BAR disable steps.
- Remove unused interrupt handlers; keembay_pcie_ev_irq_handler(), keembay_pcie_err_irq_handler().
- Remove keembay_pcie_enable_interrupts().
- Rework keembay_pcie_setup_irq() and call it from keembay_pcie_probe().
- Remove keembay_pcie_host_init() and make keembay_pcie_host_ops empty.
- Keep and rework keembay_pcie_add_pcie_port() a little.
- Remove keembay_pcie_add_pcie_ep() and call dw_pcie_ep_init() from keembay_pcie_probe().
- In keembay_pcie_probe(), remove dbi setup as it will be handled in dwc common code.
- In keembay_pcie_link_up(), use return (val &

    PCIE_REGS_PCIE_SII_LINK_UP) == PCIE_REGS_PCIE_SII_LINK_UP.

- In keembay_pcie_ep_raise_irq(), rework error message for PCI_EPC_IRQ_LEGACY and default cases.
- Rebased to next-20201124, that has dwc pci refactoring,
https://lore.kernel.org/linux-pci/[email protected]/.

Srikanth Thokala (2):
dt-bindings: PCI: Add Intel Keem Bay PCIe controller
PCI: keembay: Add support for Intel Keem Bay

 .../bindings/pci/intel,keembay-pcie-ep.yaml   |  69 +++
 .../bindings/pci/intel,keembay-pcie.yaml      |  97 ++++
 MAINTAINERS                                   |   7 +
 drivers/pci/controller/dwc/Kconfig            |  28 ++
 drivers/pci/controller/dwc/Makefile           |   1 +
 drivers/pci/controller/dwc/pcie-keembay.c     | 460 ++++++++++++++++++
 6 files changed, 662 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/intel,keembay-pcie-ep.yaml
 create mode 100644 Documentation/devicetree/bindings/pci/intel,keembay-pcie.yaml
 create mode 100644 drivers/pci/controller/dwc/pcie-keembay.c

base-commit: c500bee1c5b2f1d59b1081ac879d73268ab0ff17

Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH v11 1/2 dt-bindings: PCI: Add Intel Keem Bay PCIe controller

From: Srikanth Thokala <[email protected]>

Document DT bindings for PCIe controller found on Intel Keem Bay SoC.

---
 .../bindings/pci/intel,keembay-pcie-ep.yaml   | 69 +++++++++++++
 .../bindings/pci/intel,keembay-pcie.yaml      | 97 +++++++++++++++++++
 2 files changed, 166 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/intel,keembay-pcie-ep.yaml
 create mode 100644 Documentation/devicetree/bindings/pci/intel,keembay-pcie.yaml
Documentation/devicetree/bindings/pci/intel,keembay-pcie-ep.yaml new file +69 -0
new file mode 100644
index 000000000000..e87ff27526ff
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/pci/intel,keembay-pcie-ep.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Intel Keem Bay PCIe controller Endpoint mode
+
+maintainers:
+  - Wan Ahmad Zainie <[email protected]>
+  - Srikanth Thokala <[email protected]>
+
+properties:
+  compatible:
+    const: intel,keembay-pcie-ep
+
+  reg:
+    maxItems: 5
+
+  reg-names:
+    items:
+      - const: dbi
+      - const: dbi2
+      - const: atu
+      - const: addr_space
+      - const: apb
+
+  interrupts:
+    maxItems: 4
+
+  interrupt-names:
+    items:
+      - const: pcie
+      - const: pcie_ev
+      - const: pcie_err
+      - const: pcie_mem_access
+
+  num-lanes:
+    description: Number of lanes to use.
+    enum: [ 1, 2 ]
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+  - interrupt-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    pcie-ep@37000000 {
+          compatible = "intel,keembay-pcie-ep";
+          reg = <0x37000000 0x00001000>,
+                <0x37100000 0x00001000>,
+                <0x37300000 0x00001000>,
+                <0x36000000 0x01000000>,
+                <0x37800000 0x00000200>;
+          reg-names = "dbi", "dbi2", "atu", "addr_space", "apb";
+          interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 108 IRQ_TYPE_EDGE_RISING>,
+                       <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
+          interrupt-names = "pcie", "pcie_ev", "pcie_err", "pcie_mem_access";
+          num-lanes = <2>;
+    };
Documentation/devicetree/bindings/pci/intel,keembay-pcie.yaml new file +97 -0

97 lines not on this page · raw message

Signature · 1 line
2.17.1
author maintainer
#2 lore raw

PATCH v11 2/2 PCI: keembay: Add support for Intel Keem Bay

In reply to [email protected]

From: Srikanth Thokala <[email protected]>

Add driver for Intel Keem Bay SoC PCIe controller. This controller is based on DesignWare PCIe core.

In Root Complex mode, only internal reference clock is possible for Keem Bay A0. For Keem Bay B0, external reference clock can be used and will be the default configuration. Currently, keembay_pcie_of_data structure has one member. It will be expanded later to handle this difference.

Endpoint mode link initialization is handled by the boot firmware.

---
 MAINTAINERS                               |   7 +
 drivers/pci/controller/dwc/Kconfig        |  28 ++
 drivers/pci/controller/dwc/Makefile       |   1 +
 drivers/pci/controller/dwc/pcie-keembay.c | 460 ++++++++++++++++++++++
 4 files changed, 496 insertions(+)
 create mode 100644 drivers/pci/controller/dwc/pcie-keembay.c
MAINTAINERS +7 -0
index c9467d2839f5..b5b466cc7efe 100644
@@ -14430,6 +14430,13 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/pci/hisilicon-histb-pcie.txt
 F:	drivers/pci/controller/dwc/pcie-histb.c
 
+PCIE DRIVER FOR INTEL KEEM BAY
+M:	Srikanth Thokala <[email protected]>
+L:	[email protected]
+S:	Supported
+F:	Documentation/devicetree/bindings/pci/intel,keembay-pcie*
+F:	drivers/pci/controller/dwc/pcie-keembay.c
+
 PCIE DRIVER FOR MEDIATEK
 M:	Ryder Lee <[email protected]>
 M:	Jianjun Wang <[email protected]>
drivers/pci/controller/dwc/Kconfig +28 -0
index 423d35872ce4..04430ddde8c4 100644
@@ -225,6 +225,34 @@ config PCIE_INTEL_GW
 	  The PCIe controller uses the DesignWare core plus Intel-specific
 	  hardware wrappers.
 
+config PCIE_KEEMBAY
+	bool
+
+config PCIE_KEEMBAY_HOST
+	bool "Intel Keem Bay PCIe controller - Host mode"
+	depends on ARCH_KEEMBAY || COMPILE_TEST
+	depends on PCI && PCI_MSI_IRQ_DOMAIN
+	select PCIE_DW_HOST
+	select PCIE_KEEMBAY
+	help
+	  Say 'Y' here to enable support for the PCIe controller in Keem Bay
+	  to work in host mode.
+	  The PCIe controller is based on DesignWare Hardware and uses
+	  DesignWare core functions.
+
+config PCIE_KEEMBAY_EP
+	bool "Intel Keem Bay PCIe controller - Endpoint mode"
+	depends on ARCH_KEEMBAY || COMPILE_TEST
+	depends on PCI && PCI_MSI_IRQ_DOMAIN
+	depends on PCI_ENDPOINT
+	select PCIE_DW_EP
+	select PCIE_KEEMBAY
+	help
+	  Say 'Y' here to enable support for the PCIe controller in Keem Bay
+	  to work in endpoint mode.
+	  The PCIe controller is based on DesignWare Hardware and uses
+	  DesignWare core functions.
+
 config PCIE_KIRIN
 	depends on OF && (ARM64 || COMPILE_TEST)
 	bool "HiSilicon Kirin series SoCs PCIe controllers"
drivers/pci/controller/dwc/Makefile +1 -0
index 9e6ce0dc2f53..8b3e7176b4bf 100644
@@ -15,6 +15,7 @@ obj-$(CONFIG_PCIE_QCOM) += pcie-qcom.o
 obj-$(CONFIG_PCIE_ARMADA_8K) += pcie-armada8k.o
 obj-$(CONFIG_PCIE_ARTPEC6) += pcie-artpec6.o
 obj-$(CONFIG_PCIE_INTEL_GW) += pcie-intel-gw.o
+obj-$(CONFIG_PCIE_KEEMBAY) += pcie-keembay.o
 obj-$(CONFIG_PCIE_KIRIN) += pcie-kirin.o
 obj-$(CONFIG_PCIE_HISI_STB) += pcie-histb.o
 obj-$(CONFIG_PCI_MESON) += pci-meson.o
drivers/pci/controller/dwc/pcie-keembay.c new file +460 -0

460 lines not on this page · raw message

Signature · 1 line
2.17.1
#3 lore raw

On Fri, Aug 06, 2021 at 02:40:10AM +0530, [email protected] wrote:

[...]

Quoted 5 lines
drivers/pci/controller/dwc/pcie-keembay.c new file +5 -0
+static int keembay_pcie_add_pcie_port(struct keembay_pcie *pcie,
+				      struct platform_device *pdev)
+{
+	struct dw_pcie *pci = &pcie->pci;
+	struct pcie_port *pp = &pci->pp;

drivers/pci/controller/dwc/pcie-keembay.c line 345

Quoted 10 lines
drivers/pci/controller/dwc/pcie-keembay.c new file +10 -0
+	struct device *dev = &pdev->dev;
+	u32 val;
+	int ret;
+
+	pp->ops = &keembay_pcie_host_ops;
+	pp->msi_irq = -ENODEV;
+
+	ret = keembay_pcie_setup_msi_irq(pcie);
+	if (ret)
+		return ret;

May I ask you (and DWC maintainers) please why we need to resort to setting

pp->msi_irq = -ENODEV;

while we *could* (?) just use pp->ops->msi_host_init() (ie which I believe can be keembay_pcie_setup_msi_irq() revisited ?)

I would like to understand how this choice can be made by a DWC developer that has to add an incantation specific MSI logic handling glue.

Other than that we can merge this code but I would like to understand the rationale behind the question above - it is not obvious to me.

Thanks,
Lorenzo

Quoted 118 lines
drivers/pci/controller/dwc/pcie-keembay.c new file +115 -0
+
+	pcie->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(pcie->reset))
+		return PTR_ERR(pcie->reset);
+
+	ret = keembay_pcie_probe_clocks(pcie);
+	if (ret)
+		return ret;
+
+	val = readl(pcie->apb_base + PCIE_REGS_PCIE_PHY_CNTL);
+	val |= PHY0_SRAM_BYPASS;
+	writel(val, pcie->apb_base + PCIE_REGS_PCIE_PHY_CNTL);
+
+	writel(PCIE_DEVICE_TYPE, pcie->apb_base + PCIE_REGS_PCIE_CFG);
+
+	ret = keembay_pcie_pll_init(pcie);
+	if (ret)
+		return ret;
+
+	val = readl(pcie->apb_base + PCIE_REGS_PCIE_CFG);
+	writel(val | PCIE_RSTN, pcie->apb_base + PCIE_REGS_PCIE_CFG);
+	keembay_ep_reset_deassert(pcie);
+
+	ret = dw_pcie_host_init(pp);
+	if (ret) {
+		keembay_ep_reset_assert(pcie);
+		dev_err(dev, "Failed to initialize host: %d\n", ret);
+		return ret;
+	}
+
+	val = readl(pcie->apb_base + PCIE_REGS_INTERRUPT_ENABLE);
+	if (IS_ENABLED(CONFIG_PCI_MSI))
+		val |= MSI_CTRL_INT_EN;
+	writel(val, pcie->apb_base + PCIE_REGS_INTERRUPT_ENABLE);
+
+	return 0;
+}
+
+static int keembay_pcie_probe(struct platform_device *pdev)
+{
+	const struct keembay_pcie_of_data *data;
+	struct device *dev = &pdev->dev;
+	struct keembay_pcie *pcie;
+	struct dw_pcie *pci;
+	enum dw_pcie_device_mode mode;
+
+	data = device_get_match_data(dev);
+	if (!data)
+		return -ENODEV;
+
+	mode = (enum dw_pcie_device_mode)data->mode;
+
+	pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
+	if (!pcie)
+		return -ENOMEM;
+
+	pci = &pcie->pci;
+	pci->dev = dev;
+	pci->ops = &keembay_pcie_ops;
+
+	pcie->mode = mode;
+
+	pcie->apb_base = devm_platform_ioremap_resource_byname(pdev, "apb");
+	if (IS_ERR(pcie->apb_base))
+		return PTR_ERR(pcie->apb_base);
+
+	platform_set_drvdata(pdev, pcie);
+
+	switch (pcie->mode) {
+	case DW_PCIE_RC_TYPE:
+		if (!IS_ENABLED(CONFIG_PCIE_KEEMBAY_HOST))
+			return -ENODEV;
+
+		return keembay_pcie_add_pcie_port(pcie, pdev);
+	case DW_PCIE_EP_TYPE:
+		if (!IS_ENABLED(CONFIG_PCIE_KEEMBAY_EP))
+			return -ENODEV;
+
+		pci->ep.ops = &keembay_pcie_ep_ops;
+		return dw_pcie_ep_init(&pci->ep);
+	default:
+		dev_err(dev, "Invalid device type %d\n", pcie->mode);
+		return -ENODEV;
+	}
+}
+
+static const struct keembay_pcie_of_data keembay_pcie_rc_of_data = {
+	.mode = DW_PCIE_RC_TYPE,
+};
+
+static const struct keembay_pcie_of_data keembay_pcie_ep_of_data = {
+	.mode = DW_PCIE_EP_TYPE,
+};
+
+static const struct of_device_id keembay_pcie_of_match[] = {
+	{
+		.compatible = "intel,keembay-pcie",
+		.data = &keembay_pcie_rc_of_data,
+	},
+	{
+		.compatible = "intel,keembay-pcie-ep",
+		.data = &keembay_pcie_ep_of_data,
+	},
+	{}
+};
+
+static struct platform_driver keembay_pcie_driver = {
+	.driver = {
+		.name = "keembay-pcie",
+		.of_match_table = keembay_pcie_of_match,
+		.suppress_bind_attrs = true,
+	},
+	.probe  = keembay_pcie_probe,
+};
+builtin_platform_driver(keembay_pcie_driver);
Signature · 1 line
2.17.1
author maintainer
#4 lore raw

Hi Lorenzo,

Quoted 36 lines

-----Original Message-----
From: Lorenzo Pieralisi <[email protected]>
Sent: Friday, August 13, 2021 10:01 PM
To: Thokala, Srikanth <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH v11 2/2] PCI: keembay: Add support for Intel Keem Bay

On Fri, Aug 06, 2021 at 02:40:10AM +0530, [email protected] wrote:

[...]

Quoted 5 lines
drivers/pci/controller/dwc/pcie-keembay.c new file +5 -0
+static int keembay_pcie_add_pcie_port(struct keembay_pcie *pcie,
+				      struct platform_device *pdev)
+{
+	struct dw_pcie *pci = &pcie->pci;
+	struct pcie_port *pp = &pci->pp;

drivers/pci/controller/dwc/pcie-keembay.c line 345

Quoted 10 lines
drivers/pci/controller/dwc/pcie-keembay.c new file +10 -0
+	struct device *dev = &pdev->dev;
+	u32 val;
+	int ret;
+
+	pp->ops = &keembay_pcie_host_ops;
+	pp->msi_irq = -ENODEV;
+
+	ret = keembay_pcie_setup_msi_irq(pcie);
+	if (ret)
+		return ret;

May I ask you (and DWC maintainers) please why we need to resort to setting

Quoted 8 lines

pp->msi_irq = -ENODEV;

while we *could* (?) just use pp->ops->msi_host_init() (ie which I believe can be keembay_pcie_setup_msi_irq() revisited ?)

I would like to understand how this choice can be made by a DWC developer that has to add an incantation specific MSI logic handling glue.

'pp->msi_irq = -ENODEV' is set to
1) Re-use DWC logic (as part of dw_pcie_host_init()) to create MSI domain and map MSI page
2) Register Keem Bay platform-specific MSI handler as IP has given additional registers to control MSI interrupts.

Thanks!
Srikanth

Quoted 126 lines

Other than that we can merge this code but I would like to understand the rationale behind the question above - it is not obvious to me.

Thanks,
Lorenzo

Quoted 53 lines
drivers/pci/controller/dwc/pcie-keembay.c new file +53 -0
+
+	pcie->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(pcie->reset))
+		return PTR_ERR(pcie->reset);
+
+	ret = keembay_pcie_probe_clocks(pcie);
+	if (ret)
+		return ret;
+
+	val = readl(pcie->apb_base + PCIE_REGS_PCIE_PHY_CNTL);
+	val |= PHY0_SRAM_BYPASS;
+	writel(val, pcie->apb_base + PCIE_REGS_PCIE_PHY_CNTL);
+
+	writel(PCIE_DEVICE_TYPE, pcie->apb_base + PCIE_REGS_PCIE_CFG);
+
+	ret = keembay_pcie_pll_init(pcie);
+	if (ret)
+		return ret;
+
+	val = readl(pcie->apb_base + PCIE_REGS_PCIE_CFG);
+	writel(val | PCIE_RSTN, pcie->apb_base + PCIE_REGS_PCIE_CFG);
+	keembay_ep_reset_deassert(pcie);
+
+	ret = dw_pcie_host_init(pp);
+	if (ret) {
+		keembay_ep_reset_assert(pcie);
+		dev_err(dev, "Failed to initialize host: %d\n", ret);
+		return ret;
+	}
+
+	val = readl(pcie->apb_base + PCIE_REGS_INTERRUPT_ENABLE);
+	if (IS_ENABLED(CONFIG_PCI_MSI))
+		val |= MSI_CTRL_INT_EN;
+	writel(val, pcie->apb_base + PCIE_REGS_INTERRUPT_ENABLE);
+
+	return 0;
+}
+
+static int keembay_pcie_probe(struct platform_device *pdev)
+{
+	const struct keembay_pcie_of_data *data;
+	struct device *dev = &pdev->dev;
+	struct keembay_pcie *pcie;
+	struct dw_pcie *pci;
+	enum dw_pcie_device_mode mode;
+
+	data = device_get_match_data(dev);
+	if (!data)
+		return -ENODEV;
+
+	mode = (enum dw_pcie_device_mode)data->mode;
+
+	pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);

drivers/pci/controller/dwc/pcie-keembay.c

Quoted 10 lines
drivers/pci/controller/dwc/pcie-keembay.c new file +10 -0
+	if (!pcie)
+		return -ENOMEM;
+
+	pci = &pcie->pci;
+	pci->dev = dev;
+	pci->ops = &keembay_pcie_ops;
+
+	pcie->mode = mode;
+
+	pcie->apb_base = devm_platform_ioremap_resource_byname(pdev,

"apb");

Quoted 55 lines
drivers/pci/controller/dwc/pcie-keembay.c new file +52 -1
+	if (IS_ERR(pcie->apb_base))
+		return PTR_ERR(pcie->apb_base);
+
+	platform_set_drvdata(pdev, pcie);
+
+	switch (pcie->mode) {
+	case DW_PCIE_RC_TYPE:
+		if (!IS_ENABLED(CONFIG_PCIE_KEEMBAY_HOST))
+			return -ENODEV;
+
+		return keembay_pcie_add_pcie_port(pcie, pdev);
+	case DW_PCIE_EP_TYPE:
+		if (!IS_ENABLED(CONFIG_PCIE_KEEMBAY_EP))
+			return -ENODEV;
+
+		pci->ep.ops = &keembay_pcie_ep_ops;
+		return dw_pcie_ep_init(&pci->ep);
+	default:
+		dev_err(dev, "Invalid device type %d\n", pcie->mode);
+		return -ENODEV;
+	}
+}
+
+static const struct keembay_pcie_of_data keembay_pcie_rc_of_data = {
+	.mode = DW_PCIE_RC_TYPE,
+};
+
+static const struct keembay_pcie_of_data keembay_pcie_ep_of_data = {
+	.mode = DW_PCIE_EP_TYPE,
+};
+
+static const struct of_device_id keembay_pcie_of_match[] = {
+	{
+		.compatible = "intel,keembay-pcie",
+		.data = &keembay_pcie_rc_of_data,
+	},
+	{
+		.compatible = "intel,keembay-pcie-ep",
+		.data = &keembay_pcie_ep_of_data,
+	},
+	{}
+};
+
+static struct platform_driver keembay_pcie_driver = {
+	.driver = {
+		.name = "keembay-pcie",
+		.of_match_table = keembay_pcie_of_match,
+		.suppress_bind_attrs = true,
+	},
+	.probe  = keembay_pcie_probe,
+};
+builtin_platform_driver(keembay_pcie_driver);
--

2.17.1

#5 lore raw
In reply to [email protected]
Quoted 10 lines · On Fri, 6 Aug 2021 02:40:08 +0530, [email protected] wrote:

The first patch is to document DT bindings for Keem Bay PCIe controller for both Root Complex and Endpoint modes.

The second patch is the driver file, a glue driver. Keem Bay PCIe controller is based on DesignWare PCIe IP.

The patch was tested with Keem Bay evaluation module board, with B0 stepping.

[...]

Applied to pci/keembay, thanks!

[1/2] dt-bindings: PCI: Add Intel Keem Bay PCIe controller

      https://git.kernel.org/lpieralisi/pci/c/33d2f8e4ff
[2/2] PCI: keembay: Add support for Intel Keem Bay
      https://git.kernel.org/lpieralisi/pci/c/0c87f90b4c

Thanks,
Lorenzo

author maintainer
#6 lore raw
Quoted 22 lines

-----Original Message-----
From: Lorenzo Pieralisi <[email protected]>
Sent: Friday, August 20, 2021 6:18 PM
To: Thokala, Srikanth <[email protected]>; [email protected]
Cc: Lorenzo Pieralisi <[email protected]>; [email protected]; [email protected]; Sangannavar, Mallikarjunappa <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v11 0/2] PCI: keembay: Add support for Intel Keem Bay

Quoted 1 line · On Fri, 6 Aug 2021 02:40:08 +0530, [email protected] wrote:

The first patch is to document DT bindings for Keem Bay PCIe

controller

Quoted 5 lines

for both Root Complex and Endpoint modes.

The second patch is the driver file, a glue driver. Keem Bay PCIe controller is based on DesignWare PCIe IP.

Quoted 6 lines
Quoted 4 lines

The patch was tested with Keem Bay evaluation module board, with B0 stepping.

[...]

Applied to pci/keembay, thanks!

Thank you Lorenzo.

Srikanth

Quoted 8 lines

[1/2] dt-bindings: PCI: Add Intel Keem Bay PCIe controller

      https://git.kernel.org/lpieralisi/pci/c/33d2f8e4ff
[2/2] PCI: keembay: Add support for Intel Keem Bay
      https://git.kernel.org/lpieralisi/pci/c/0c87f90b4c

Thanks,
Lorenzo