Skip to contentSkip to conversation

Move tx-deempth and tx swing to pci.txt

PATCH In review Ansuel Smith 4 participants 14 messages Apr 10, 2020 – Apr 14, 2020

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Move tx-deempth and tx swing to pci.txt

In pushing some fixes to pcie qcom driver, one of the patch had to make some fixes to tx deempth and tx swing. It was suggested to propose this to the generic pci.txt as they are actually standard parameter than can be tuned per board. I also notice these property are already used in imx6 driver so this would also help to generalize it.

Ansuel Smith (4):
devicetree: bindings: pci: document tx-deempth tx swing and rx-eq
property
drivers: pci: dwc: pci-imx6: update binding to generic name
arm: dts: imx6: update pci binding to generic name
devicetree: bindings: pci: fsl,imx6q-pcie: rename tx deemph and swing

 .../devicetree/bindings/pci/fsl,imx6q-pcie.txt | 12 ++++++------
 Documentation/devicetree/bindings/pci/pci.txt  | 18 ++++++++++++++++++
 arch/arm/boot/dts/imx6q-ba16.dtsi              |  4 ++--
 arch/arm/boot/dts/imx6qdl-var-dart.dtsi        |  4 ++--
 arch/arm/boot/dts/imx7d.dtsi                   |  2 +-
 drivers/pci/controller/dwc/pci-imx6.c          | 12 ++++++------
 6 files changed, 35 insertions(+), 17 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/4 devicetree: bindings: pci: document tx-deempth tx swing and rx-eq property

Document tx-deempth, tx swing and rx-eq property property used on some device (qcom ipq806x or imx6q) to tune and fix init error of the pci bridge.

---
 Documentation/devicetree/bindings/pci/pci.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Documentation/devicetree/bindings/pci/pci.txt +18 -0
index 29bcbd88f457..df37486f1853 100644
@@ -24,6 +24,24 @@ driver implementation may support the following properties:
    unsupported link speed, for instance, trying to do training for
    unsupported link speed, etc.  Must be '4' for gen4, '3' for gen3, '2'
    for gen2, and '1' for gen1. Any other values are invalid.
+- tx-deemph-gen1
+   If present this property will tune the Transmit De-Emphasis level for GEN1 if
+   supported by the driver.
+- tx-deemph-gen2-3p5db
+   If present this property will tune the Transmit De-Emphasis level for GEN2 in
+   3.5db band if supported by the driver.
+- tx-deempth-gen2-6db
+   If present this property will tune the Transmit De-Emphasis level for GEN2 in
+   6db band if supported by the driver.
+- tx-swing-full
+   If present this property will tune the Tx Swing Full value if supported by the
+   driver.
+- tx-swing-low
+   If present this property will tune the Tx Swing Low value if supported by the
+   driver.
+- rx-equalization
+   If present this property will tune the Rx equalization value if supported by
+   the driver.
 - reset-gpios:
    If present this property specifies PERST# GPIO. Host drivers can parse the
    GPIO and apply fundamental reset to endpoints.
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/4] devicetree: bindings: pci: document tx-deempth tx swing and rx-eq property

Quoted 3 lines · Ansuel Smith

Document tx-deempth, tx swing and rx-eq property property used on some device (qcom ipq806x or imx6q) to tune and fix init error of the pci bridge.

Those properties are not specific to the host bridge per-se, but to the PCIe PHY, therefore, one would expect to find those properties within the PCIe PHY node if it exists. Given you want this binding to be generic, this is an important thing to correct here.

Signature · 1 line
Florian
#3 lore raw

R: [PATCH 1/4] devicetree: bindings: pci: document tx-deempth tx swing and rx-eq property

Quoted 6 lines · Ansuel Smith
Quoted 1 line

Document tx-deempth, tx swing and rx-eq property property used on

some

Quoted 2 lines

device (qcom ipq806x or imx6q) to tune and fix init error of the pci bridge.

Quoted 6 lines

Those properties are not specific to the host bridge per-se, but to the PCIe PHY, therefore, one would expect to find those properties within the PCIe PHY node if it exists. Given you want this binding to be generic, this is an important thing to correct here.
--
Florian

So where should I put these? If I understand this properly I should move this to the PHY directory but no PCIe PHY node exist for both imx6q and ipq806x. How I should proceed?
It would be better to just drop this and add qcom specific binding to the driver?

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw

Re: [PATCH 1/4] devicetree: bindings: pci: document tx-deempth tx swing and rx-eq property

In reply to Ansuel Smith

Looks like "dt-bindings: PCI: " is the convention here.

  $ git log --oneline Documentation/devicetree/bindings/pci/
  11be8af70d86 dt-bindings: PCI: Convert PCIe Host/Endpoint in Cadence platform to DT schema
  69501078fc60 dt-bindings: PCI: cadence: Add PCIe RC/EP DT schema for Cadence PCIe
  847dbf4e1aba dt-bindings: PCI: Add PCI Endpoint Controller Schema
  f9f711efd441 arm64: tegra: Fix Tegra194 PCIe compatible string
  9f04d18b1edf dt-bindings: PCI: tegra: Add DT support for PCIe EP nodes in Tegra194
  6e5f77031cc9 dt-bindings: PCI: meson: Update PCIE bindings documentation
  3edeb49525bb dt-bindings: PCI: Add NXP Layerscape SoCs PCIe Gen4 controller
  34129bb831cc dt-bindings: PCI: intel: Fix dt_binding_check compilation failure
Quoted 3 lines · Ansuel Smith

Document tx-deempth, tx swing and rx-eq property property used on some device (qcom ipq806x or imx6q) to tune and fix init error of the pci bridge.

s/tx-deempth/tx-deemph/ (in subject and commit log) s/tx swing/tx-swing/ (both places also) s/rx-eq/rx-equalization/ (ditto)
s/property property/properties/
s/pci/PCI/ in English text (not C variables, function names, etc).

If these are made generic, remove the "qcom ipq806x or imx6q" part.

Quoted 17 lines
---
 Documentation/devicetree/bindings/pci/pci.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Documentation/devicetree/bindings/pci/pci.txt +4 -0
index 29bcbd88f457..df37486f1853 100644
@@ -24,6 +24,24 @@ driver implementation may support the following properties:
    unsupported link speed, for instance, trying to do training for
    unsupported link speed, etc.  Must be '4' for gen4, '3' for gen3, '2'
    for gen2, and '1' for gen1. Any other values are invalid.
+- tx-deemph-gen1
+   If present this property will tune the Transmit De-Emphasis level for GEN1 if
+   supported by the driver.
+- tx-deemph-gen2-3p5db

Documentation/devicetree/bindings/pci/pci.txt driver implementation may support the following properties: · line 40

Quoted 10 lines
Documentation/devicetree/bindings/pci/pci.txt +10 -0
+   If present this property will tune the Transmit De-Emphasis level for GEN2 in
+   3.5db band if supported by the driver.
+- tx-deempth-gen2-6db
+   If present this property will tune the Transmit De-Emphasis level for GEN2 in
+   6db band if supported by the driver.
+- tx-swing-full
+   If present this property will tune the Tx Swing Full value if supported by the
+   driver.
+- tx-swing-low
+   If present this property will tune the Tx Swing Low value if supported by the

Wrap all of these to fit in 78 columns. Some of them fit in 80 columns, which is sort of OK. This one is 81, which is definitely too long.

Quoted 10 lines
Documentation/devicetree/bindings/pci/pci.txt +4 -0
+   driver.
+- rx-equalization
+   If present this property will tune the Rx equalization value if supported by
+   the driver.
 - reset-gpios:
    If present this property specifies PERST# GPIO. Host drivers can parse the
    GPIO and apply fundamental reset to endpoints.
Signature · 1 line
2.25.1
#5 lore raw

PATCH 2/4 drivers: pci: dwc: pci-imx6: update binding to generic name

In reply to Ansuel Smith

Rename specific bindings to generic name.

---
 drivers/pci/controller/dwc/pci-imx6.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +6 -6
index acfbd34032a8..4ac140e007b4 100644
@@ -1146,28 +1146,28 @@ static int imx6_pcie_probe(struct platform_device *pdev)
 	}
 
 	/* Grab PCIe PHY Tx Settings */
-	if (of_property_read_u32(node, "fsl,tx-deemph-gen1",
+	if (of_property_read_u32(node, "tx-deemph-gen1",
 				 &imx6_pcie->tx_deemph_gen1))
 		imx6_pcie->tx_deemph_gen1 = 0;
 
-	if (of_property_read_u32(node, "fsl,tx-deemph-gen2-3p5db",
+	if (of_property_read_u32(node, "tx-deemph-gen2-3p5db",
 				 &imx6_pcie->tx_deemph_gen2_3p5db))
 		imx6_pcie->tx_deemph_gen2_3p5db = 0;
 
-	if (of_property_read_u32(node, "fsl,tx-deemph-gen2-6db",
+	if (of_property_read_u32(node, "tx-deemph-gen2-6db",
 				 &imx6_pcie->tx_deemph_gen2_6db))
 		imx6_pcie->tx_deemph_gen2_6db = 20;
 
-	if (of_property_read_u32(node, "fsl,tx-swing-full",
+	if (of_property_read_u32(node, "tx-swing-full",
 				 &imx6_pcie->tx_swing_full))
 		imx6_pcie->tx_swing_full = 127;
 
-	if (of_property_read_u32(node, "fsl,tx-swing-low",
+	if (of_property_read_u32(node, "tx-swing-low",
 				 &imx6_pcie->tx_swing_low))
 		imx6_pcie->tx_swing_low = 127;
 
 	/* Limit link speed */
-	ret = of_property_read_u32(node, "fsl,max-link-speed",
+	ret = of_property_read_u32(node, "max-link-speed",
 				   &imx6_pcie->link_gen);
 	if (ret)
 		imx6_pcie->link_gen = 1;
Signature · 1 line
2.25.1
reviewer
#6 lore raw

Re: [PATCH 2/4] drivers: pci: dwc: pci-imx6: update binding to generic name

Hi Ansuel,

Quoted 13 lines · Ansuel Smith

Rename specific bindings to generic name.

---
 drivers/pci/controller/dwc/pci-imx6.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +0 -0
index acfbd34032a8..4ac140e007b4 100644

drivers/pci/controller/dwc/pci-imx6.c static int imx6_pcie_probe(struct platform_device *pdev) · line 1149

Quoted 5 lines
drivers/pci/controller/dwc/pci-imx6.c +1 -1
@@ -1146,28 +1146,28 @@ static int imx6_pcie_probe(struct platform_device *pdev)
        }
 
        /* Grab PCIe PHY Tx Settings */
-       if (of_property_read_u32(node, "fsl,tx-deemph-gen1",
+       if (of_property_read_u32(node, "tx-deemph-gen1",

This breaks compatibility with older dtbs.

#7 lore raw

R: [PATCH 2/4] drivers: pci: dwc: pci-imx6: update binding to generic name

Quoted 19 lines

Hi Ansuel,

Review

Quoted 9 lines · Ansuel Smith

Rename specific bindings to generic name.

---
 drivers/pci/controller/dwc/pci-imx6.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
(quoted diff) +0 -0

b/drivers/pci/controller/dwc/pci-imx6.c

drivers/pci/controller/dwc/pci-imx6.c static int imx6_pcie_probe(struct

Quoted 4 lines

index acfbd34032a8..4ac140e007b4 100644

drivers/pci/controller/dwc/pci-imx6.c +0 -0
@@ -1146,28 +1146,28 @@ static int imx6_pcie_probe(struct

platform_device *pdev)

Quoted 7 lines

drivers/pci/controller/dwc/pci-imx6.c static int imx6_pcie_probe(struct platform_device *pdev) · line 1149

Quoted 5 lines
drivers/pci/controller/dwc/pci-imx6.c +1 -1
        }
 
        /* Grab PCIe PHY Tx Settings */
-       if (of_property_read_u32(node, "fsl,tx-deemph-gen1",
+       if (of_property_read_u32(node, "tx-deemph-gen1",

This breaks compatibility with older dtbs.

so no chance of changing this?

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

reviewer
#8 lore raw

Re: [PATCH 2/4] drivers: pci: dwc: pci-imx6: update binding to generic name

Hi Ansuel,

Quoted 1 line · On Fri, Apr 10, 2020 at 8:07 AM <[email protected]> wrote:

so no chance of changing this?

Reading the commit log I don't see any explanation as to why you need to change the current bindings.

What is the motivation for doing this? Is this really worth it?

#9 lore raw

R: [PATCH 2/4] drivers: pci: dwc: pci-imx6: update binding to generic name

Quoted 10 lines

Hi Ansuel,

Quoted 1 line · On Fri, Apr 10, 2020 at 8:07 AM <[email protected]> wrote:

so no chance of changing this?

Reading the commit log I don't see any explanation as to why you need to change the current bindings.

What is the motivation for doing this? Is this really worth it?

It's really to not have the same exact binding to 2 different driver. If this would cause problem I will use qcom,tx-deemph...... but still it looks wrong to me having this. How should I proceed?

reviewer
#10 lore raw

Re: [PATCH 2/4] drivers: pci: dwc: pci-imx6: update binding to generic name

Quoted 3 lines · On Fri, Apr 10, 2020 at 9:40 AM <[email protected]> wrote:

It's really to not have the same exact binding to 2 different driver. If this would cause problem I will use qcom,tx-deemph...... but still it looks wrong to me having this. How should I proceed?

You could make the imx6 PCI driver to accept both the new and old binding versions.

This way we can keep compatibility with old dtb's.

Also, if you respin this, please state the motivation that you explained here in the commit log.

#11 lore raw

Re: [PATCH 2/4] drivers: pci: dwc: pci-imx6: update binding to generic name

In reply to Ansuel Smith

If/when you repost this, please update the subject to match the convention:

  $ git log --oneline drivers/pci/controller/dwc/pci-imx6.c
  2170a09fb4b0 PCI: imx6: Propagate errors for optional regulators
  075af61c19cd PCI: imx6: Limit DBI register length
  1b8df7aa7874 PCI: imx6: Allow asynchronous probing
  87cb312777b5 PCI: imx6: Use usleep_range() in imx6_pcie_enable_ref_clk()

As Fabio pointed out, we can't break backward compatibility without a good reason.

Quoted 49 lines · Ansuel Smith

Rename specific bindings to generic name.

---
 drivers/pci/controller/dwc/pci-imx6.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +6 -6
index acfbd34032a8..4ac140e007b4 100644
@@ -1146,28 +1146,28 @@ static int imx6_pcie_probe(struct platform_device *pdev)
 	}
 
 	/* Grab PCIe PHY Tx Settings */
-	if (of_property_read_u32(node, "fsl,tx-deemph-gen1",
+	if (of_property_read_u32(node, "tx-deemph-gen1",
 				 &imx6_pcie->tx_deemph_gen1))
 		imx6_pcie->tx_deemph_gen1 = 0;
 
-	if (of_property_read_u32(node, "fsl,tx-deemph-gen2-3p5db",
+	if (of_property_read_u32(node, "tx-deemph-gen2-3p5db",
 				 &imx6_pcie->tx_deemph_gen2_3p5db))
 		imx6_pcie->tx_deemph_gen2_3p5db = 0;
 
-	if (of_property_read_u32(node, "fsl,tx-deemph-gen2-6db",
+	if (of_property_read_u32(node, "tx-deemph-gen2-6db",
 				 &imx6_pcie->tx_deemph_gen2_6db))
 		imx6_pcie->tx_deemph_gen2_6db = 20;
 
-	if (of_property_read_u32(node, "fsl,tx-swing-full",
+	if (of_property_read_u32(node, "tx-swing-full",
 				 &imx6_pcie->tx_swing_full))
 		imx6_pcie->tx_swing_full = 127;
 
-	if (of_property_read_u32(node, "fsl,tx-swing-low",
+	if (of_property_read_u32(node, "tx-swing-low",
 				 &imx6_pcie->tx_swing_low))
 		imx6_pcie->tx_swing_low = 127;
 
 	/* Limit link speed */
-	ret = of_property_read_u32(node, "fsl,max-link-speed",
+	ret = of_property_read_u32(node, "max-link-speed",
 				   &imx6_pcie->link_gen);
 	if (ret)
 		imx6_pcie->link_gen = 1;
Signature · 1 line
2.25.1
#12 lore raw

PATCH 3/4 arm: dts: imx6: update pci binding to generic name

In reply to Ansuel Smith

Rename specific pcie property to generic name.

---
 arch/arm/boot/dts/imx6q-ba16.dtsi       | 4 ++--
 arch/arm/boot/dts/imx6qdl-var-dart.dtsi | 4 ++--
 arch/arm/boot/dts/imx7d.dtsi            | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/imx6q-ba16.dtsi +2 -2
index 37c63402157b..55bf77fdd65b 100644
@@ -328,8 +328,8 @@ &pcie {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_pcie>;
 	reset-gpio = <&gpio7 12 GPIO_ACTIVE_LOW>;
-	fsl,tx-swing-full = <103>;
-	fsl,tx-swing-low = <103>;
+	tx-swing-full = <103>;
+	tx-swing-low = <103>;
 	status = "okay";
 };
 
arch/arm/boot/dts/imx6qdl-var-dart.dtsi +2 -2
index c41cac502bac..45c7edea94da 100644
@@ -392,8 +392,8 @@ MX6QDL_PAD_SD3_DAT3__SD3_DATA3	0x17059
 };
 
 &pcie {
-	fsl,tx-swing-full = <103>;
-	fsl,tx-swing-low = <103>;
+	tx-swing-full = <103>;
+	tx-swing-low = <103>;
 	reset-gpio = <&gpio4 11 GPIO_ACTIVE_LOW>;
 	status = "disabled";
 };
arch/arm/boot/dts/imx7d.dtsi +1 -1
index 4c22828df55f..0ab55f66ea79 100644
@@ -190,7 +190,7 @@ pcie: pcie@33800000 {
 		assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_250M_CLK>,
 					 <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
 
-		fsl,max-link-speed = <2>;
+		max-link-speed = <2>;
 		power-domains = <&pgc_pcie_phy>;
 		resets = <&src IMX7_RESET_PCIEPHY>,
 			 <&src IMX7_RESET_PCIE_CTRL_APPS_EN>,
Signature · 1 line
2.25.1
#13 lore raw

PATCH 4/4 devicetree: bindings: pci: fsl,imx6q-pcie: rename tx deemph and swing

In reply to Ansuel Smith

TX Deemph and TX Swing are now defined in pci.txt, rename them to follow the new name.

---
 .../devicetree/bindings/pci/fsl,imx6q-pcie.txt       | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt +6 -6
index de4b2baf91e8..937442a4c2ab 100644
@@ -19,12 +19,12 @@ Required properties:
 	- "pcie_phy"
 
 Optional properties:
-- fsl,tx-deemph-gen1: Gen1 De-emphasis value. Default: 0
-- fsl,tx-deemph-gen2-3p5db: Gen2 (3.5db) De-emphasis value. Default: 0
-- fsl,tx-deemph-gen2-6db: Gen2 (6db) De-emphasis value. Default: 20
-- fsl,tx-swing-full: Gen2 TX SWING FULL value. Default: 127
-- fsl,tx-swing-low: TX launch amplitude swing_low value. Default: 127
-- fsl,max-link-speed: Specify PCI gen for link capability. Must be '2' for
+- tx-deemph-gen1: Gen1 De-emphasis value. Default: 0
+- tx-deemph-gen2-3p5db: Gen2 (3.5db) De-emphasis value. Default: 0
+- tx-deemph-gen2-6db: Gen2 (6db) De-emphasis value. Default: 20
+- tx-swing-full: Gen2 TX SWING FULL value. Default: 127
+- tx-swing-low: TX launch amplitude swing_low value. Default: 127
+- max-link-speed: Specify PCI gen for link capability. Must be '2' for
   gen2, otherwise will default to gen1. Note that the IMX6 LVDS clock outputs
   do not meet gen2 jitter requirements and thus for gen2 capability a gen2
   compliant clock generator should be used and configured.
Signature · 1 line
2.25.1