]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio function
authorMarek Behún <marek.behun@nic.cz>
Thu, 30 Apr 2020 08:06:23 +0000 (10:06 +0200)
committerGregory CLEMENT <gregory.clement@bootlin.com>
Sun, 17 May 2020 15:51:43 +0000 (17:51 +0200)
We found out that we are unable to control the PERST# signal via the
default pin dedicated to be PERST# pin (GPIO2[3] pin) on A3700 SOC when
this pin is in EP_PCIE1_Resetn mode. There is a register in the PCIe
register space called PERSTN_GPIO_EN (D0088004[3]), but changing the
value of this register does not change the pin output when measuring
with voltmeter.

We do not know if this is a bug in the SOC, or if it works only when
PCIe controller is in a certain state.

Commit f4c7d053d7f7 ("PCI: aardvark: Wait for endpoint to be ready
before training link") says that when this pin changes pinctrl mode
from EP_PCIE1_Resetn to GPIO, the PERST# signal is asserted for a brief
moment.

So currently the situation is that on A3700 boards the PERST# signal is
asserted in U-Boot (because the code in U-Boot issues reset via this pin
via GPIO mode), and then in Linux by the obscure and undocumented
mechanism described by the above mentioned commit.

We want to issue PERST# signal in a known way, therefore this patch
changes the pcie_reset_pin function from "pcie" to "gpio" and adds the
reset-gpios property to the PCIe node in device tree files of
EspressoBin and Armada 3720 Dev Board (Turris Mox device tree already
has this property and uDPU does not have a PCIe port).

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Remi Pommarel <repk@triplefau.lt>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
arch/arm64/boot/dts/marvell/armada-3720-db.dts
arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi
arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
arch/arm64/boot/dts/marvell/armada-37xx.dtsi

index f2cc00594d64a7672d0935785470141fa57dece5..3e5789f372069164fddd2ef2a078ad3cf5508e1f 100644 (file)
 
 /* CON15(V2.0)/CON17(V1.4) : PCIe / CON15(V2.0)/CON12(V1.4) :mini-PCIe */
 &pcie0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>;
+       reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>;
        status = "okay";
 };
 
index 42e992f9c8a54413eceaa87d7b23f3b0bb021bf7..c92ad664cb0ec3f718c30691ec41e60d733a510f 100644 (file)
@@ -47,6 +47,7 @@
        phys = <&comphy1 0>;
        pinctrl-names = "default";
        pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>;
+       reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>;
 };
 
 /* J6 */
index bb42d1e6a4e92a6deb8d163d0d927b6148d78ccc..e496bd9d47374f9c4001b2e538dcff2321a38f5b 100644 (file)
        };
 };
 
-&pcie_reset_pins {
-       function = "gpio";
-};
-
 &pcie0 {
        pinctrl-names = "default";
        pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>;
index 000c135e39b73cdc52edb211bf14cc1ebd68771e..7909c146eabf72fb4d8f96f17f3e88d2fb1ac3ae 100644 (file)
 
                                pcie_reset_pins: pcie-reset-pins {
                                        groups = "pcie1";
-                                       function = "pcie";
+                                       function = "gpio";
                                };
 
                                pcie_clkreq_pins: pcie-clkreq-pins {