public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers
@ 2023-11-28  5:43 Siddharth Vadapalli
  2023-11-28  5:43 ` [PATCH v13 1/5] dt-bindings: PCI: ti,j721e-pci-*: add checks for num-lanes Siddharth Vadapalli
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Siddharth Vadapalli @ 2023-11-28  5:43 UTC (permalink / raw)
  To: lpieralisi, robh, kw, bhelgaas, krzysztof.kozlowski+dt, conor+dt,
	vigneshr, tjoseph
  Cc: linux-pci, devicetree, linux-kernel, linux-arm-kernel,
	r-gunasekaran, danishanwar, srk, nm, s-vadapalli

Hello,

This series adds support to the pci-j721e PCIe controller for up to 4x Lane
configuration supported by TI's J784S4 SoC. Bindings are also added for
the num-lanes property which shall be used by the driver. The compatible
for J784S4 SoC is added.

This series is based on linux-next tagged next-20231128.

Regards,
Siddharth.

---
v12:
https://patchwork.kernel.org/project/linux-pci/cover/20230401112633.2406604-1-a-verma1@ti.com/
Changes since v12:
- Rebased series on linux-next tagged next-20231128.
- Reordered patches with bindings patches first followed by driver
  patches.
- Collected Reviewed-by tag from
  Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  which was missed in the v12 series as pointed out at:
  https://patchwork.kernel.org/project/linux-pci/patch/20230401112633.2406604-2-a-verma1@ti.com/


Matt Ranostay (5):
  dt-bindings: PCI: ti,j721e-pci-*: add checks for num-lanes
  dt-bindings: PCI: ti,j721e-pci-*: add j784s4-pci-* compatible strings
  PCI: j721e: Add per platform maximum lane settings
  PCI: j721e: Add PCIe 4x lane selection support
  PCI: j721e: add j784s4 PCIe configuration

 .../bindings/pci/ti,j721e-pci-ep.yaml         | 39 ++++++++++++++--
 .../bindings/pci/ti,j721e-pci-host.yaml       | 39 ++++++++++++++--
 drivers/pci/controller/cadence/pci-j721e.c    | 45 ++++++++++++++++---
 3 files changed, 112 insertions(+), 11 deletions(-)

-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v13 1/5] dt-bindings: PCI: ti,j721e-pci-*: add checks for num-lanes
  2023-11-28  5:43 [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Siddharth Vadapalli
@ 2023-11-28  5:43 ` Siddharth Vadapalli
  2023-11-28  5:43 ` [PATCH v13 2/5] dt-bindings: PCI: ti,j721e-pci-*: add j784s4-pci-* compatible strings Siddharth Vadapalli
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Siddharth Vadapalli @ 2023-11-28  5:43 UTC (permalink / raw)
  To: lpieralisi, robh, kw, bhelgaas, krzysztof.kozlowski+dt, conor+dt,
	vigneshr, tjoseph
  Cc: linux-pci, devicetree, linux-kernel, linux-arm-kernel,
	r-gunasekaran, danishanwar, srk, nm, s-vadapalli

From: Matt Ranostay <mranostay@ti.com>

Add num-lanes schema checks based on compatible string on available lanes
for that platform.

Signed-off-by: Matt Ranostay <mranostay@ti.com>
Signed-off-by: Achal Verma <a-verma1@ti.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---
 .../bindings/pci/ti,j721e-pci-ep.yaml         | 27 ++++++++++++++++---
 .../bindings/pci/ti,j721e-pci-host.yaml       | 27 ++++++++++++++++---
 2 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml
index 62292185fe2e..162e5c2906e1 100644
--- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml
@@ -10,9 +10,6 @@ title: TI J721E PCI EP (PCIe Wrapper)
 maintainers:
   - Kishon Vijay Abraham I <kishon@ti.com>
 
-allOf:
-  - $ref: cdns-pcie-ep.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -65,6 +62,30 @@ properties:
     items:
       - const: link_state
 
+allOf:
+  - $ref: cdns-pcie-ep.yaml#
+  - if:
+      properties:
+        compatible:
+          enum:
+            - ti,am64-pcie-ep
+    then:
+      properties:
+        num-lanes:
+          const: 1
+
+  - if:
+      properties:
+        compatible:
+          enum:
+            - ti,j7200-pcie-ep
+            - ti,j721e-pcie-ep
+    then:
+      properties:
+        num-lanes:
+          minimum: 1
+          maximum: 2
+
 required:
   - compatible
   - reg
diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml
index a2c5eaea57f5..854dc9e08dcf 100644
--- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml
+++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml
@@ -10,9 +10,6 @@ title: TI J721E PCI Host (PCIe Wrapper)
 maintainers:
   - Kishon Vijay Abraham I <kishon@ti.com>
 
-allOf:
-  - $ref: cdns-pcie-host.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -94,6 +91,30 @@ properties:
       interrupts:
         maxItems: 1
 
+allOf:
+  - $ref: cdns-pcie-host.yaml#
+  - if:
+      properties:
+        compatible:
+          enum:
+            - ti,am64-pcie-host
+    then:
+      properties:
+        num-lanes:
+          const: 1
+
+  - if:
+      properties:
+        compatible:
+          enum:
+            - ti,j7200-pcie-host
+            - ti,j721e-pcie-host
+    then:
+      properties:
+        num-lanes:
+          minimum: 1
+          maximum: 2
+
 required:
   - compatible
   - reg
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v13 2/5] dt-bindings: PCI: ti,j721e-pci-*: add j784s4-pci-* compatible strings
  2023-11-28  5:43 [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Siddharth Vadapalli
  2023-11-28  5:43 ` [PATCH v13 1/5] dt-bindings: PCI: ti,j721e-pci-*: add checks for num-lanes Siddharth Vadapalli
@ 2023-11-28  5:43 ` Siddharth Vadapalli
  2023-11-28  5:44 ` [PATCH v13 3/5] PCI: j721e: Add per platform maximum lane settings Siddharth Vadapalli
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Siddharth Vadapalli @ 2023-11-28  5:43 UTC (permalink / raw)
  To: lpieralisi, robh, kw, bhelgaas, krzysztof.kozlowski+dt, conor+dt,
	vigneshr, tjoseph
  Cc: linux-pci, devicetree, linux-kernel, linux-arm-kernel,
	r-gunasekaran, danishanwar, srk, nm, s-vadapalli

From: Matt Ranostay <mranostay@ti.com>

Add definition for j784s4-pci-ep + j784s4-pci-host devices along with
schema checks for num-lanes.

Signed-off-by: Matt Ranostay <mranostay@ti.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Achal Verma <a-verma1@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---
 .../devicetree/bindings/pci/ti,j721e-pci-ep.yaml     | 12 ++++++++++++
 .../devicetree/bindings/pci/ti,j721e-pci-host.yaml   | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml
index 162e5c2906e1..97f2579ea908 100644
--- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml
@@ -14,6 +14,7 @@ properties:
   compatible:
     oneOf:
       - const: ti,j721e-pcie-ep
+      - const: ti,j784s4-pcie-ep
       - description: PCIe EP controller in AM64
         items:
           - const: ti,am64-pcie-ep
@@ -86,6 +87,17 @@ allOf:
           minimum: 1
           maximum: 2
 
+  - if:
+      properties:
+        compatible:
+          enum:
+            - ti,j784s4-pcie-ep
+    then:
+      properties:
+        num-lanes:
+          minimum: 1
+          maximum: 4
+
 required:
   - compatible
   - reg
diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml
index 854dc9e08dcf..b7a534cef24d 100644
--- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml
+++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml
@@ -14,6 +14,7 @@ properties:
   compatible:
     oneOf:
       - const: ti,j721e-pcie-host
+      - const: ti,j784s4-pcie-host
       - description: PCIe controller in AM64
         items:
           - const: ti,am64-pcie-host
@@ -115,6 +116,17 @@ allOf:
           minimum: 1
           maximum: 2
 
+  - if:
+      properties:
+        compatible:
+          enum:
+            - ti,j784s4-pcie-host
+    then:
+      properties:
+        num-lanes:
+          minimum: 1
+          maximum: 4
+
 required:
   - compatible
   - reg
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v13 3/5] PCI: j721e: Add per platform maximum lane settings
  2023-11-28  5:43 [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Siddharth Vadapalli
  2023-11-28  5:43 ` [PATCH v13 1/5] dt-bindings: PCI: ti,j721e-pci-*: add checks for num-lanes Siddharth Vadapalli
  2023-11-28  5:43 ` [PATCH v13 2/5] dt-bindings: PCI: ti,j721e-pci-*: add j784s4-pci-* compatible strings Siddharth Vadapalli
@ 2023-11-28  5:44 ` Siddharth Vadapalli
  2023-12-05  5:12   ` Ravi Gunasekaran
  2023-11-28  5:44 ` [PATCH v13 4/5] PCI: j721e: Add PCIe 4x lane selection support Siddharth Vadapalli
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Siddharth Vadapalli @ 2023-11-28  5:44 UTC (permalink / raw)
  To: lpieralisi, robh, kw, bhelgaas, krzysztof.kozlowski+dt, conor+dt,
	vigneshr, tjoseph
  Cc: linux-pci, devicetree, linux-kernel, linux-arm-kernel,
	r-gunasekaran, danishanwar, srk, nm, s-vadapalli

From: Matt Ranostay <mranostay@ti.com>

Various platforms have different maximum amount of lanes that can be
selected. Add max_lanes to struct j721e_pcie to allow for detection of this
which is needed to calculate the needed bitmask size for the possible lane
count.

Signed-off-by: Matt Ranostay <mranostay@ti.com>
Signed-off-by: Achal Verma <a-verma1@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---
 drivers/pci/controller/cadence/pci-j721e.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c
index 2c87e7728a65..63c758b14314 100644
--- a/drivers/pci/controller/cadence/pci-j721e.c
+++ b/drivers/pci/controller/cadence/pci-j721e.c
@@ -47,8 +47,6 @@ enum link_status {
 
 #define GENERATION_SEL_MASK		GENMASK(1, 0)
 
-#define MAX_LANES			2
-
 struct j721e_pcie {
 	struct cdns_pcie	*cdns_pcie;
 	struct clk		*refclk;
@@ -71,6 +69,7 @@ struct j721e_pcie_data {
 	unsigned int		quirk_disable_flr:1;
 	u32			linkdown_irq_regfield;
 	unsigned int		byte_access_allowed:1;
+	unsigned int		max_lanes;
 };
 
 static inline u32 j721e_pcie_user_readl(struct j721e_pcie *pcie, u32 offset)
@@ -290,11 +289,13 @@ static const struct j721e_pcie_data j721e_pcie_rc_data = {
 	.quirk_retrain_flag = true,
 	.byte_access_allowed = false,
 	.linkdown_irq_regfield = LINK_DOWN,
+	.max_lanes = 2,
 };
 
 static const struct j721e_pcie_data j721e_pcie_ep_data = {
 	.mode = PCI_MODE_EP,
 	.linkdown_irq_regfield = LINK_DOWN,
+	.max_lanes = 2,
 };
 
 static const struct j721e_pcie_data j7200_pcie_rc_data = {
@@ -302,23 +303,27 @@ static const struct j721e_pcie_data j7200_pcie_rc_data = {
 	.quirk_detect_quiet_flag = true,
 	.linkdown_irq_regfield = J7200_LINK_DOWN,
 	.byte_access_allowed = true,
+	.max_lanes = 2,
 };
 
 static const struct j721e_pcie_data j7200_pcie_ep_data = {
 	.mode = PCI_MODE_EP,
 	.quirk_detect_quiet_flag = true,
 	.quirk_disable_flr = true,
+	.max_lanes = 2,
 };
 
 static const struct j721e_pcie_data am64_pcie_rc_data = {
 	.mode = PCI_MODE_RC,
 	.linkdown_irq_regfield = J7200_LINK_DOWN,
 	.byte_access_allowed = true,
+	.max_lanes = 1,
 };
 
 static const struct j721e_pcie_data am64_pcie_ep_data = {
 	.mode = PCI_MODE_EP,
 	.linkdown_irq_regfield = J7200_LINK_DOWN,
+	.max_lanes = 1,
 };
 
 static const struct of_device_id of_j721e_pcie_match[] = {
@@ -432,8 +437,10 @@ static int j721e_pcie_probe(struct platform_device *pdev)
 	pcie->user_cfg_base = base;
 
 	ret = of_property_read_u32(node, "num-lanes", &num_lanes);
-	if (ret || num_lanes > MAX_LANES)
+	if (ret || num_lanes > data->max_lanes) {
+		dev_warn(dev, "num-lanes property not provided or invalid, setting num-lanes to 1\n");
 		num_lanes = 1;
+	}
 	pcie->num_lanes = num_lanes;
 
 	if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48)))
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v13 4/5] PCI: j721e: Add PCIe 4x lane selection support
  2023-11-28  5:43 [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Siddharth Vadapalli
                   ` (2 preceding siblings ...)
  2023-11-28  5:44 ` [PATCH v13 3/5] PCI: j721e: Add per platform maximum lane settings Siddharth Vadapalli
@ 2023-11-28  5:44 ` Siddharth Vadapalli
  2023-11-28  5:44 ` [PATCH v13 5/5] PCI: j721e: add j784s4 PCIe configuration Siddharth Vadapalli
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Siddharth Vadapalli @ 2023-11-28  5:44 UTC (permalink / raw)
  To: lpieralisi, robh, kw, bhelgaas, krzysztof.kozlowski+dt, conor+dt,
	vigneshr, tjoseph
  Cc: linux-pci, devicetree, linux-kernel, linux-arm-kernel,
	r-gunasekaran, danishanwar, srk, nm, s-vadapalli

From: Matt Ranostay <mranostay@ti.com>

Add support for setting of two-bit field that allows selection of 4x lane
PCIe which was previously limited to only 2x lanes.

Signed-off-by: Matt Ranostay <mranostay@ti.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Achal Verma <a-verma1@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---
 drivers/pci/controller/cadence/pci-j721e.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c
index 63c758b14314..645597856a1d 100644
--- a/drivers/pci/controller/cadence/pci-j721e.c
+++ b/drivers/pci/controller/cadence/pci-j721e.c
@@ -42,7 +42,6 @@ enum link_status {
 };
 
 #define J721E_MODE_RC			BIT(7)
-#define LANE_COUNT_MASK			BIT(8)
 #define LANE_COUNT(n)			((n) << 8)
 
 #define GENERATION_SEL_MASK		GENMASK(1, 0)
@@ -52,6 +51,7 @@ struct j721e_pcie {
 	struct clk		*refclk;
 	u32			mode;
 	u32			num_lanes;
+	u32			max_lanes;
 	void __iomem		*user_cfg_base;
 	void __iomem		*intd_cfg_base;
 	u32			linkdown_irq_regfield;
@@ -205,11 +205,15 @@ static int j721e_pcie_set_lane_count(struct j721e_pcie *pcie,
 {
 	struct device *dev = pcie->cdns_pcie->dev;
 	u32 lanes = pcie->num_lanes;
+	u32 mask = BIT(8);
 	u32 val = 0;
 	int ret;
 
+	if (pcie->max_lanes == 4)
+		mask = GENMASK(9, 8);
+
 	val = LANE_COUNT(lanes - 1);
-	ret = regmap_update_bits(syscon, offset, LANE_COUNT_MASK, val);
+	ret = regmap_update_bits(syscon, offset, mask, val);
 	if (ret)
 		dev_err(dev, "failed to set link count\n");
 
@@ -441,7 +445,9 @@ static int j721e_pcie_probe(struct platform_device *pdev)
 		dev_warn(dev, "num-lanes property not provided or invalid, setting num-lanes to 1\n");
 		num_lanes = 1;
 	}
+
 	pcie->num_lanes = num_lanes;
+	pcie->max_lanes = data->max_lanes;
 
 	if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48)))
 		return -EINVAL;
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v13 5/5] PCI: j721e: add j784s4 PCIe configuration
  2023-11-28  5:43 [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Siddharth Vadapalli
                   ` (3 preceding siblings ...)
  2023-11-28  5:44 ` [PATCH v13 4/5] PCI: j721e: Add PCIe 4x lane selection support Siddharth Vadapalli
@ 2023-11-28  5:44 ` Siddharth Vadapalli
  2023-12-11  8:57 ` [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Maxime Ripard
  2023-12-13 19:05 ` Krzysztof Wilczyński
  6 siblings, 0 replies; 10+ messages in thread
From: Siddharth Vadapalli @ 2023-11-28  5:44 UTC (permalink / raw)
  To: lpieralisi, robh, kw, bhelgaas, krzysztof.kozlowski+dt, conor+dt,
	vigneshr, tjoseph
  Cc: linux-pci, devicetree, linux-kernel, linux-arm-kernel,
	r-gunasekaran, danishanwar, srk, nm, s-vadapalli

From: Matt Ranostay <mranostay@ti.com>

Add PCIe configuration for j784s4 platform which has 4x lane support.

Tested-by: Achal Verma <a-verma1@ti.com>
Signed-off-by: Matt Ranostay <mranostay@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Achal Verma <a-verma1@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---
 drivers/pci/controller/cadence/pci-j721e.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c
index 645597856a1d..85718246016b 100644
--- a/drivers/pci/controller/cadence/pci-j721e.c
+++ b/drivers/pci/controller/cadence/pci-j721e.c
@@ -330,6 +330,20 @@ static const struct j721e_pcie_data am64_pcie_ep_data = {
 	.max_lanes = 1,
 };
 
+static const struct j721e_pcie_data j784s4_pcie_rc_data = {
+	.mode = PCI_MODE_RC,
+	.quirk_retrain_flag = true,
+	.byte_access_allowed = false,
+	.linkdown_irq_regfield = LINK_DOWN,
+	.max_lanes = 4,
+};
+
+static const struct j721e_pcie_data j784s4_pcie_ep_data = {
+	.mode = PCI_MODE_EP,
+	.linkdown_irq_regfield = LINK_DOWN,
+	.max_lanes = 4,
+};
+
 static const struct of_device_id of_j721e_pcie_match[] = {
 	{
 		.compatible = "ti,j721e-pcie-host",
@@ -355,6 +369,14 @@ static const struct of_device_id of_j721e_pcie_match[] = {
 		.compatible = "ti,am64-pcie-ep",
 		.data = &am64_pcie_ep_data,
 	},
+	{
+		.compatible = "ti,j784s4-pcie-host",
+		.data = &j784s4_pcie_rc_data,
+	},
+	{
+		.compatible = "ti,j784s4-pcie-ep",
+		.data = &j784s4_pcie_ep_data,
+	},
 	{},
 };
 
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v13 3/5] PCI: j721e: Add per platform maximum lane settings
  2023-11-28  5:44 ` [PATCH v13 3/5] PCI: j721e: Add per platform maximum lane settings Siddharth Vadapalli
@ 2023-12-05  5:12   ` Ravi Gunasekaran
  0 siblings, 0 replies; 10+ messages in thread
From: Ravi Gunasekaran @ 2023-12-05  5:12 UTC (permalink / raw)
  To: Siddharth Vadapalli, lpieralisi, robh, kw, bhelgaas,
	krzysztof.kozlowski+dt, conor+dt, vigneshr, tjoseph
  Cc: linux-pci, devicetree, linux-kernel, linux-arm-kernel,
	danishanwar, srk, nm, Ravi Gunasekaran



On 11/28/23 11:14 AM, Siddharth Vadapalli wrote:
> From: Matt Ranostay <mranostay@ti.com>
> 
> Various platforms have different maximum amount of lanes that can be
> selected. Add max_lanes to struct j721e_pcie to allow for detection of this
> which is needed to calculate the needed bitmask size for the possible lane
> count.
> 
> Signed-off-by: Matt Ranostay <mranostay@ti.com>
> Signed-off-by: Achal Verma <a-verma1@ti.com>
> Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
> ---
>  drivers/pci/controller/cadence/pci-j721e.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c
> index 2c87e7728a65..63c758b14314 100644
> --- a/drivers/pci/controller/cadence/pci-j721e.c
> +++ b/drivers/pci/controller/cadence/pci-j721e.c
> @@ -47,8 +47,6 @@ enum link_status {
>  
>  #define GENERATION_SEL_MASK		GENMASK(1, 0)
>  
> -#define MAX_LANES			2
> -
>  struct j721e_pcie {
>  	struct cdns_pcie	*cdns_pcie;
>  	struct clk		*refclk;
> @@ -71,6 +69,7 @@ struct j721e_pcie_data {
>  	unsigned int		quirk_disable_flr:1;
>  	u32			linkdown_irq_regfield;
>  	unsigned int		byte_access_allowed:1;
> +	unsigned int		max_lanes;
>  };
>  
>  static inline u32 j721e_pcie_user_readl(struct j721e_pcie *pcie, u32 offset)
> @@ -290,11 +289,13 @@ static const struct j721e_pcie_data j721e_pcie_rc_data = {
>  	.quirk_retrain_flag = true,
>  	.byte_access_allowed = false,
>  	.linkdown_irq_regfield = LINK_DOWN,
> +	.max_lanes = 2,
>  };
>  
>  static const struct j721e_pcie_data j721e_pcie_ep_data = {
>  	.mode = PCI_MODE_EP,
>  	.linkdown_irq_regfield = LINK_DOWN,
> +	.max_lanes = 2,
>  };
>  
>  static const struct j721e_pcie_data j7200_pcie_rc_data = {
> @@ -302,23 +303,27 @@ static const struct j721e_pcie_data j7200_pcie_rc_data = {
>  	.quirk_detect_quiet_flag = true,
>  	.linkdown_irq_regfield = J7200_LINK_DOWN,
>  	.byte_access_allowed = true,
> +	.max_lanes = 2,
>  };
>  
>  static const struct j721e_pcie_data j7200_pcie_ep_data = {
>  	.mode = PCI_MODE_EP,
>  	.quirk_detect_quiet_flag = true,
>  	.quirk_disable_flr = true,
> +	.max_lanes = 2,
>  };
>  
>  static const struct j721e_pcie_data am64_pcie_rc_data = {
>  	.mode = PCI_MODE_RC,
>  	.linkdown_irq_regfield = J7200_LINK_DOWN,
>  	.byte_access_allowed = true,
> +	.max_lanes = 1,
>  };
>  
>  static const struct j721e_pcie_data am64_pcie_ep_data = {
>  	.mode = PCI_MODE_EP,
>  	.linkdown_irq_regfield = J7200_LINK_DOWN,
> +	.max_lanes = 1,
>  };
>  
>  static const struct of_device_id of_j721e_pcie_match[] = {
> @@ -432,8 +437,10 @@ static int j721e_pcie_probe(struct platform_device *pdev)
>  	pcie->user_cfg_base = base;
>  
>  	ret = of_property_read_u32(node, "num-lanes", &num_lanes);
> -	if (ret || num_lanes > MAX_LANES)
> +	if (ret || num_lanes > data->max_lanes) {
> +		dev_warn(dev, "num-lanes property not provided or invalid, setting num-lanes to 1\n");
>  		num_lanes = 1;
> +	}
>  	pcie->num_lanes = num_lanes;
>  
>  	if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48)))

Reviewed-by: Ravi Gunasekaran <r-gunasekaran@ti.com>

-- 
Regards,
Ravi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers
  2023-11-28  5:43 [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Siddharth Vadapalli
                   ` (4 preceding siblings ...)
  2023-11-28  5:44 ` [PATCH v13 5/5] PCI: j721e: add j784s4 PCIe configuration Siddharth Vadapalli
@ 2023-12-11  8:57 ` Maxime Ripard
  2023-12-13 19:13   ` Krzysztof Wilczyński
  2023-12-13 19:05 ` Krzysztof Wilczyński
  6 siblings, 1 reply; 10+ messages in thread
From: Maxime Ripard @ 2023-12-11  8:57 UTC (permalink / raw)
  To: lpieralisi, robh, kw, bhelgaas
  Cc: Siddharth Vadapalli, krzysztof.kozlowski+dt, conor+dt, vigneshr,
	tjoseph, linux-pci, devicetree, linux-kernel, linux-arm-kernel,
	r-gunasekaran, danishanwar, srk, nm


[-- Attachment #1.1: Type: text/plain, Size: 780 bytes --]

Hi Bjorn, Krzysztof, Lorenzo, Rob,

On Tue, Nov 28, 2023 at 11:13:57AM +0530, Siddharth Vadapalli wrote:
> This series adds support to the pci-j721e PCIe controller for up to 4x Lane
> configuration supported by TI's J784S4 SoC. Bindings are also added for
> the num-lanes property which shall be used by the driver. The compatible
> for J784S4 SoC is added.
> 
> This series is based on linux-next tagged next-20231128.

These patches have been floating around for a long time (v12 was almost
identical and was submitted back in April, without any review back then
already [1]), and it looks like reviewers are happy with it.

Could you merge them to get them in 6.8?

Thanks!
Maxime

1: https://lore.kernel.org/lkml/20230401112633.2406604-1-a-verma1@ti.com/

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers
  2023-11-28  5:43 [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Siddharth Vadapalli
                   ` (5 preceding siblings ...)
  2023-12-11  8:57 ` [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Maxime Ripard
@ 2023-12-13 19:05 ` Krzysztof Wilczyński
  6 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Wilczyński @ 2023-12-13 19:05 UTC (permalink / raw)
  To: Siddharth Vadapalli
  Cc: lpieralisi, robh, bhelgaas, krzysztof.kozlowski+dt, conor+dt,
	vigneshr, tjoseph, linux-pci, devicetree, linux-kernel,
	linux-arm-kernel, r-gunasekaran, danishanwar, srk, nm

Hello,

> This series adds support to the pci-j721e PCIe controller for up to 4x Lane
> configuration supported by TI's J784S4 SoC. Bindings are also added for
> the num-lanes property which shall be used by the driver. The compatible
> for J784S4 SoC is added.
> 
> This series is based on linux-next tagged next-20231128.

Applied to controller/cadence, thank you!

[01/05] dt-bindings: PCI: ti,j721e-pci-*: Add checks for num-lanes
        https://git.kernel.org/pci/pci/c/b3ba0f6e82cb
[02/05] dt-bindings: PCI: ti,j721e-pci-*: Add j784s4-pci-* compatible strings
        https://git.kernel.org/pci/pci/c/adc14d44d7cb
[03/05] PCI: j721e: Add per platform maximum lane settings
        https://git.kernel.org/pci/pci/c/3ac7f14084f5
[04/05] PCI: j721e: Add PCIe 4x lane selection support
        https://git.kernel.org/pci/pci/c/4490f559f755
[05/05] PCI: j721e: Add j784s4 PCIe configuration
        https://git.kernel.org/pci/pci/c/9ca59b45ecf3

	Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers
  2023-12-11  8:57 ` [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Maxime Ripard
@ 2023-12-13 19:13   ` Krzysztof Wilczyński
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Wilczyński @ 2023-12-13 19:13 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: lpieralisi, robh, bhelgaas, Siddharth Vadapalli,
	krzysztof.kozlowski+dt, conor+dt, vigneshr, tjoseph, linux-pci,
	devicetree, linux-kernel, linux-arm-kernel, r-gunasekaran,
	danishanwar, srk, nm

Hi Maxime,

> > This series adds support to the pci-j721e PCIe controller for up to 4x Lane
> > configuration supported by TI's J784S4 SoC. Bindings are also added for
> > the num-lanes property which shall be used by the driver. The compatible
> > for J784S4 SoC is added.
> > 
> > This series is based on linux-next tagged next-20231128.
> 
> These patches have been floating around for a long time (v12 was almost
> identical and was submitted back in April, without any review back then
> already [1]), and it looks like reviewers are happy with it.

Having a glance, it looks good to me, too.

> Could you merge them to get them in 6.8?


Applied, so it should make it to 6.8.  Apologies for the delay.

	Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-12-13 19:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-28  5:43 [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Siddharth Vadapalli
2023-11-28  5:43 ` [PATCH v13 1/5] dt-bindings: PCI: ti,j721e-pci-*: add checks for num-lanes Siddharth Vadapalli
2023-11-28  5:43 ` [PATCH v13 2/5] dt-bindings: PCI: ti,j721e-pci-*: add j784s4-pci-* compatible strings Siddharth Vadapalli
2023-11-28  5:44 ` [PATCH v13 3/5] PCI: j721e: Add per platform maximum lane settings Siddharth Vadapalli
2023-12-05  5:12   ` Ravi Gunasekaran
2023-11-28  5:44 ` [PATCH v13 4/5] PCI: j721e: Add PCIe 4x lane selection support Siddharth Vadapalli
2023-11-28  5:44 ` [PATCH v13 5/5] PCI: j721e: add j784s4 PCIe configuration Siddharth Vadapalli
2023-12-11  8:57 ` [PATCH v13 0/5] PCI: add 4x lane support for pci-j721e controllers Maxime Ripard
2023-12-13 19:13   ` Krzysztof Wilczyński
2023-12-13 19:05 ` 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