Skip to contentSkip to conversation

arm64: dts: armada-3720-espressobin: fix COMPHY nodes

PATCH New Marek Behún 4 participants 9 messages Aug 19, 2020 – Aug 31, 2020 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: armada-3720-espressobin: fix COMPHY nodes

This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada 37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver. The lanes are defined in comphy_a3700.c as described in functional specification, that is:
lane 0 is SGMII1 or USB3
lane 1 is PCIe or SGMII0
lane 2 is SATA or USB3

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on lane 1, which is wrong in the sense of the specification and doesn't work with the comphy_mux code, which is 2 years now (the aardvark driver causes synchronous abort in U-Boot).

It worked till the above mentioned commit, because the code for powering up PCIe PHY doesn't work with lane number at all, and the code for powering up USB3 PHY works differently only if USB3 is on lane 2, ie. the check goes like:
if (lane == 2)
something
else
something else
so it does not differentiate between lanes 0 and 1.

In the future I shall post patches that remove the comphy_a3700 driver and add comphy driver which uses calls to ATF, like Linux' driver does. This will have the advantage of same DTS bindings as Linux', but till this is done, we need this patch.

---
 arch/arm/dts/armada-3720-espressobin.dts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/armada-3720-espressobin.dts +4 -4
index 84e2c2adba..50381e979e 100644
@@ -72,13 +72,13 @@
 &comphy {
 	max-lanes = <3>;
 	phy0 {
-		phy-type = <PHY_TYPE_PEX0>;
-		phy-speed = <PHY_SPEED_2_5G>;
+		phy-type = <PHY_TYPE_USB3_HOST0>;
+		phy-speed = <PHY_SPEED_5G>;
 	};
 
 	phy1 {
-		phy-type = <PHY_TYPE_USB3_HOST0>;
-		phy-speed = <PHY_SPEED_5G>;
+		phy-type = <PHY_TYPE_PEX0>;
+		phy-speed = <PHY_SPEED_2_5G>;
 	};
 
 	phy2 {
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/1 arm64: dts: armada-3720-espressobin: fix COMPHY nodes

Quoted 75 lines

-----Original Message-----
From: Marek Beh?n <[email protected]>
Sent: Wednesday, August 19, 2020 12:57
To: u-boot at lists.denx.de
Cc: Kostya Porotchkin <[email protected]>; Marek Beh?n <[email protected]>; Pali Roh?r <[email protected]>; Stefan Roese <[email protected]>
Subject: [EXT] [PATCH u-boot-marvell] arm64: dts: armada-3720-espressobin:
fix COMPHY nodes

External Email

----------------------------------------------------------------------
This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada 37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver. The lanes are defined in comphy_a3700.c as described in functional specification, that is:
lane 0 is SGMII1 or USB3
lane 1 is PCIe or SGMII0
lane 2 is SATA or USB3

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on lane 1, which is wrong in the sense of the specification and doesn't work with the comphy_mux code, which is 2 years now (the aardvark driver causes synchronous abort in U-Boot).

It worked till the above mentioned commit, because the code for powering up PCIe PHY doesn't work with lane number at all, and the code for powering up USB3 PHY works differently only if USB3 is on lane 2, ie. the check goes like:
if (lane == 2)
something
else
something else
so it does not differentiate between lanes 0 and 1.

In the future I shall post patches that remove the comphy_a3700 driver and add comphy driver which uses calls to ATF, like Linux' driver does. This will have the advantage of same DTS bindings as Linux', but till this is done, we need this patch.

---
 arch/arm/dts/armada-3720-espressobin.dts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/armada-3720-espressobin.dts +4 -5
index 84e2c2adba..50381e979e 100644
@@ -72,13 +72,13 @@
 &comphy {
 	max-lanes = <3>;
 	phy0 {
-		phy-type = <PHY_TYPE_PEX0>;
-		phy-speed = <PHY_SPEED_2_5G>;
+		phy-type = <PHY_TYPE_USB3_HOST0>;
+		phy-speed = <PHY_SPEED_5G>;
 	};
 
 	phy1 {
-		phy-type = <PHY_TYPE_USB3_HOST0>;
-		phy-speed = <PHY_SPEED_5G>;
+		phy-type = <PHY_TYPE_PEX0>;
+		phy-speed = <PHY_SPEED_2_5G>;
 	};
 
 	phy2 {
--
Quoted 1 line

2.26.2

Reviewed by Konstantin Porotchkin <[email protected]>

#2 lore raw

PATCH 1/1 arm64: dts: armada-3720-espressobin: fix COMPHY nodes

In reply to Marek Behún
Quoted 23 lines · Marek Beh?n

This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada 37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver. The lanes are defined in comphy_a3700.c as described in functional specification, that is:
lane 0 is SGMII1 or USB3
lane 1 is PCIe or SGMII0
lane 2 is SATA or USB3

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on lane 1, which is wrong in the sense of the specification and doesn't work with the comphy_mux code, which is 2 years now (the aardvark driver causes synchronous abort in U-Boot).

It worked till the above mentioned commit, because the code for powering up PCIe PHY doesn't work with lane number at all, and the code for powering up USB3 PHY works differently only if USB3 is on lane 2, ie. the check goes like:

   if (lane == 2)
     something
   else
     something else
Quoted 5 lines

so it does not differentiate between lanes 0 and 1.

In the future I shall post patches that remove the comphy_a3700 driver and add comphy driver which uses calls to ATF, like Linux' driver does. This will have the advantage of same DTS bindings as Linux',

That's good. Thanks.

Quoted 6 lines

but till
this is done, we need this patch.

Thanks,
Stefan

Quoted 17 lines
---
  arch/arm/dts/armada-3720-espressobin.dts | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/armada-3720-espressobin.dts +2 -2
index 84e2c2adba..50381e979e 100644
@@ -72,13 +72,13 @@
  &comphy {
  	max-lanes = <3>;
  	phy0 {
-		phy-type = <PHY_TYPE_PEX0>;
-		phy-speed = <PHY_SPEED_2_5G>;
+		phy-type = <PHY_TYPE_USB3_HOST0>;
+		phy-speed = <PHY_SPEED_5G>;

arch/arm/dts/armada-3720-espressobin.dts line 84

Quoted 10 lines
arch/arm/dts/armada-3720-espressobin.dts +2 -2
  	};
 
  	phy1 {
-		phy-type = <PHY_TYPE_USB3_HOST0>;
-		phy-speed = <PHY_SPEED_5G>;
+		phy-type = <PHY_TYPE_PEX0>;
+		phy-speed = <PHY_SPEED_2_5G>;
  	};
 
  	phy2 {

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#3 lore raw

PATCH 1/1 arm64: dts: armada-3720-espressobin: fix COMPHY nodes

In reply to Marek Behún
Quoted 25 lines · Marek Beh?n

This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada 37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver. The lanes are defined in comphy_a3700.c as described in functional specification, that is:
lane 0 is SGMII1 or USB3
lane 1 is PCIe or SGMII0
lane 2 is SATA or USB3

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on lane 1, which is wrong in the sense of the specification and doesn't work with the comphy_mux code, which is 2 years now (the aardvark driver causes synchronous abort in U-Boot).

It worked till the above mentioned commit, because the code for powering up PCIe PHY doesn't work with lane number at all, and the code for powering up USB3 PHY works differently only if USB3 is on lane 2, ie. the check goes like:

   if (lane == 2)
     something
   else
     something else

so it does not differentiate between lanes 0 and 1.

Quoted 8 lines

In the future I shall post patches that remove the comphy_a3700 driver and add comphy driver which uses calls to ATF, like Linux' driver does. This will have the advantage of same DTS bindings as Linux', but till this is done, we need this patch.

Nice, thank you!

I remember getting these data aborts more than a year ago...

Andre

#4 lore raw

PATCH 1/1 arm64: dts: armada-3720-espressobin: fix COMPHY nodes

In reply to Marek Behún

Hi Marek,

Quoted 25 lines · Marek Beh?n

This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada 37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver. The lanes are defined in comphy_a3700.c as described in functional specification, that is:
lane 0 is SGMII1 or USB3
lane 1 is PCIe or SGMII0
lane 2 is SATA or USB3

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on lane 1, which is wrong in the sense of the specification and doesn't work with the comphy_mux code, which is 2 years now (the aardvark driver causes synchronous abort in U-Boot).

It worked till the above mentioned commit, because the code for powering up PCIe PHY doesn't work with lane number at all, and the code for powering up USB3 PHY works differently only if USB3 is on lane 2, ie. the check goes like:

   if (lane == 2)
     something
   else
     something else

so it does not differentiate between lanes 0 and 1.

Quoted 8 lines

In the future I shall post patches that remove the comphy_a3700 driver and add comphy driver which uses calls to ATF, like Linux' driver does. This will have the advantage of same DTS bindings as Linux', but till this is done, we need this patch.

now that I have a working mainline firmware, I think I have a related
problem: my sata ssd doesn't get detected, I just get this:

TIM-1.0
WTMI-devel-18.12.1-

WTMI: system early-init
CPU VDD voltage default value: 1.108V
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL1: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL2
NOTICE:  BL2: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL2: Built : 06:12:46, Aug 26 2020
NOTICE:  BL1: Booting BL31
NOTICE:  BL31: v2.3(): (Marvell-devel-18.12.0)
NOTICE:  BL31: Built : 06:12:46

U-Boot 2020.07 (Aug 26 2020 - 06:12:46 +0000)

DRAM: 1 GiB
Comphy-0: USB3_HOST0 5 Gbps
Comphy-1: PEX0 2.5 Gbps
Comphy-2: SATA0 5 Gbps
SATA link 0 timeout.

Any idea what's missing here? Do you think this may also be comphy related?

Please cc: me on your comphy/atf patches, I'd be willing to test those!

Thanks,
Andre

#5 lore raw

PATCH 1/1 arm64: dts: armada-3720-espressobin: fix COMPHY nodes

Quoted 62 lines · Andre Heider

Hi Marek,

Quoted 25 lines · Marek Beh?n

This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada 37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver. The lanes are defined in comphy_a3700.c as described in functional specification, that is:
?? lane 0 is SGMII1 or USB3
?? lane 1 is PCIe or SGMII0
?? lane 2 is SATA or USB3

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on lane 1, which is wrong in the sense of the specification and doesn't work with the comphy_mux code, which is 2 years now (the aardvark driver causes synchronous abort in U-Boot).

It worked till the above mentioned commit, because the code for powering up PCIe PHY doesn't work with lane number at all, and the code for powering up USB3 PHY works differently only if USB3 is on lane 2, ie. the check goes like:
?? if (lane == 2)
???? something
?? else
???? something else
so it does not differentiate between lanes 0 and 1.

Quoted 8 lines

In the future I shall post patches that remove the comphy_a3700 driver and add comphy driver which uses calls to ATF, like Linux' driver does. This will have the advantage of same DTS bindings as Linux', but till this is done, we need this patch.

now that I have a working mainline firmware, I think I have a related
problem: my sata ssd doesn't get detected, I just get this:

TIM-1.0
WTMI-devel-18.12.1-
WTMI: system early-init
CPU VDD voltage default value: 1.108V
NOTICE:? Booting Trusted Firmware
NOTICE:? BL1: v2.3(): (Marvell-devel-18.12.0)
NOTICE:? BL1: Built : 06:12:46, Aug 26 2020
NOTICE:? BL1: Booting BL2
NOTICE:? BL2: v2.3(): (Marvell-devel-18.12.0)
NOTICE:? BL2: Built : 06:12:46, Aug 26 2020
NOTICE:? BL1: Booting BL31
NOTICE:? BL31: v2.3(): (Marvell-devel-18.12.0)
NOTICE:? BL31: Built : 06:12:46

U-Boot 2020.07 (Aug 26 2020 - 06:12:46 +0000)

DRAM:? 1 GiB
Comphy-0: USB3_HOST0??? 5 Gbps
Comphy-1: PEX0????????? 2.5 Gbps
Comphy-2: SATA0???????? 5 Gbps
SATA link 0 timeout.

Quoted 3 lines

Any idea what's missing here? Do you think this may also be comphy related?

Please cc: me on your comphy/atf patches, I'd be willing to test those!

Nevermind, Pali figured it out:
https://patchwork.ozlabs.org/project/uboot/patch/20200828145629.540954-1-a.heider at gmail.com/

Regards,
Andre

#6 lore raw

PATCH 1/1 arm64: dts: armada-3720-espressobin: fix COMPHY nodes

In reply to Marek Behún

Hi Marek,

Quoted 10 lines · Marek Beh?n

This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada 37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver. The lanes are defined in comphy_a3700.c as described in functional specification, that is:
lane 0 is SGMII1 or USB3
lane 1 is PCIe or SGMII0
lane 2 is SATA or USB3

Quoted 4 lines

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on lane 1, which is wrong in the sense of the specification and doesn't work with the comphy_mux code, which is 2 years now (the aardvark driver causes synchronous abort in U-Boot).

I think armada-3720-db.dts requires the same fix?

Regards,
Andre

#7 lore raw

PATCH 1/1 arm64: dts: armada-3720-espressobin: fix COMPHY nodes

Quoted 18 lines · On Sun, 30 Aug 2020 08:38:32 +0200 Andre Heider <[email protected]> wrote:

Hi Marek,

Quoted 10 lines · Marek Beh?n

This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada 37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver. The lanes are defined in comphy_a3700.c as described in functional specification, that is:
lane 0 is SGMII1 or USB3
lane 1 is PCIe or SGMII0
lane 2 is SATA or USB3

Quoted 4 lines

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on lane 1, which is wrong in the sense of the specification and doesn't work with the comphy_mux code, which is 2 years now (the aardvark driver causes synchronous abort in U-Boot).

Quoted 4 lines

I think armada-3720-db.dts requires the same fix?

Regards,
Andre

You are right. Sigh :( ....

#8 lore raw

PATCH 1/1 arm64: dts: armada-3720-espressobin: fix COMPHY nodes

In reply to Marek Behún
Quoted 25 lines · Marek Beh?n

This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada 37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver. The lanes are defined in comphy_a3700.c as described in functional specification, that is:
lane 0 is SGMII1 or USB3
lane 1 is PCIe or SGMII0
lane 2 is SATA or USB3

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on lane 1, which is wrong in the sense of the specification and doesn't work with the comphy_mux code, which is 2 years now (the aardvark driver causes synchronous abort in U-Boot).

It worked till the above mentioned commit, because the code for powering up PCIe PHY doesn't work with lane number at all, and the code for powering up USB3 PHY works differently only if USB3 is on lane 2, ie. the check goes like:

   if (lane == 2)
     something
   else
     something else

so it does not differentiate between lanes 0 and 1.

Quoted 8 lines

In the future I shall post patches that remove the comphy_a3700 driver and add comphy driver which uses calls to ATF, like Linux' driver does. This will have the advantage of same DTS bindings as Linux', but till this is done, we need this patch.

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 17 lines
---
  arch/arm/dts/armada-3720-espressobin.dts | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/armada-3720-espressobin.dts +2 -2
index 84e2c2adba..50381e979e 100644
@@ -72,13 +72,13 @@
  &comphy {
  	max-lanes = <3>;
  	phy0 {
-		phy-type = <PHY_TYPE_PEX0>;
-		phy-speed = <PHY_SPEED_2_5G>;
+		phy-type = <PHY_TYPE_USB3_HOST0>;
+		phy-speed = <PHY_SPEED_5G>;

arch/arm/dts/armada-3720-espressobin.dts line 84

Quoted 10 lines
arch/arm/dts/armada-3720-espressobin.dts +2 -2
  	};
 
  	phy1 {
-		phy-type = <PHY_TYPE_USB3_HOST0>;
-		phy-speed = <PHY_SPEED_5G>;
+		phy-type = <PHY_TYPE_PEX0>;
+		phy-speed = <PHY_SPEED_2_5G>;
  	};
 
  	phy2 {

Viele Gr??e,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de