Skip to content

Commit 4d96ea0

Browse files
elkablosmb49
authored andcommitted
arm64: dts: marvell: armada-37xx: Set pcie_reset_pin to gpio function
BugLink: https://bugs.launchpad.net/bugs/1956380 commit 7158780 upstream. 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 f4c7d05 ("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> Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 7c183f5 commit 4d96ea0

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

arch/arm64/boot/dts/marvell/armada-3720-db.dts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@
128128

129129
/* CON15(V2.0)/CON17(V1.4) : PCIe / CON15(V2.0)/CON12(V1.4) :mini-PCIe */
130130
&pcie0 {
131+
pinctrl-names = "default";
132+
pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>;
133+
reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>;
131134
status = "okay";
132135
};
133136

arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
phys = <&comphy1 0>;
6060
pinctrl-names = "default";
6161
pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>;
62+
reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>;
6263
};
6364

6465
/* J6 */

arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@
127127
};
128128
};
129129

130-
&pcie_reset_pins {
131-
function = "gpio";
132-
};
133-
134130
&pcie0 {
135131
pinctrl-names = "default";
136132
pinctrl-0 = <&pcie_reset_pins &pcie_clkreq_pins>;

arch/arm64/boot/dts/marvell/armada-37xx.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318

319319
pcie_reset_pins: pcie-reset-pins {
320320
groups = "pcie1";
321-
function = "pcie";
321+
function = "gpio";
322322
};
323323

324324
pcie_clkreq_pins: pcie-clkreq-pins {

0 commit comments

Comments
 (0)