All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mx6cuboxi: Fix Ethernet after DT sync with Linux
@ 2024-03-30 21:35 Fabio Estevam
  2024-04-01 10:13 ` Christian Gmeiner
  2024-04-05 16:48 ` Fabio Estevam
  0 siblings, 2 replies; 5+ messages in thread
From: Fabio Estevam @ 2024-03-30 21:35 UTC (permalink / raw
  To: festevam; +Cc: baruch, trini, josua, u-boot, cgmeiner

From: Josua Mayer <josua@solid-run.com>

The i.MX6 Cubox-i and HummingBoards can have different PHYs at varying
addresses. U-Boot needs to auto-detect which phy is actually present,
and at which address it is responding.

Auto-detection from multiple phy nodes specified in device-tree does not
currently work correct. As a work-around merge all three possible phys
into one node with the special address 0xffffffff which indicates to the
generic phy driver to probe all addresses.

Signed-off-by: Josua Mayer <josua@solid-run.com>
[fabio: Added the changes to imx6qdl-sr-som-u-boot.dtsi.]
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Christian Gmeiner <cgmeiner@igalia.com>
---
Changes since v1:
- Disable ethernet-phy at addresses 0, 1 and 4.
- Remove the fixup of the fake 0xffffff address before booting Linux.

Josua and Christian,

I got access to a imx6 humming board and I was able to test it.

This is the minimal fix I came up based on your suggestions.

There is no need to fixup of the fake 0xffffff address before booting Linux,
as this fake address does not exist in Linux.

Successfully tested Ethernet in U-Boot and in the kernel.

Given that Ethernet is currently broken, I suggest we go with this
version to restore Ethernet for 2024.04.

What do you think?

 ...qdl-hummingboard2-emmc-som-v15-u-boot.dtsi |  1 +
 arch/arm/dts/imx6qdl-sr-som-u-boot.dtsi       | 49 +++++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 arch/arm/dts/imx6qdl-sr-som-u-boot.dtsi

diff --git a/arch/arm/dts/imx6qdl-hummingboard2-emmc-som-v15-u-boot.dtsi b/arch/arm/dts/imx6qdl-hummingboard2-emmc-som-v15-u-boot.dtsi
index e9b188ed6587..358cf8abc4ff 100644
--- a/arch/arm/dts/imx6qdl-hummingboard2-emmc-som-v15-u-boot.dtsi
+++ b/arch/arm/dts/imx6qdl-hummingboard2-emmc-som-v15-u-boot.dtsi
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 
 #include "imx6qdl-u-boot.dtsi"
+#include "imx6qdl-sr-som-u-boot.dtsi"
 
 / {
 	board-detect {
diff --git a/arch/arm/dts/imx6qdl-sr-som-u-boot.dtsi b/arch/arm/dts/imx6qdl-sr-som-u-boot.dtsi
new file mode 100644
index 000000000000..0bd7df02dd66
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-sr-som-u-boot.dtsi
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+#include <dt-bindings/gpio/gpio.h>
+
+&fec {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_microsom_enet_ar8035>;
+	phy-handle = <&phy>;
+	phy-mode = "rgmii-id";
+
+	/*
+	 * The PHY seems to require a long-enough reset duration to avoid
+	 * some rare issues where the PHY gets stuck in an inconsistent and
+	 * non-functional state at boot-up. 10ms proved to be fine .
+	 */
+	phy-reset-duration = <10>;
+	phy-reset-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
+	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethernet-phy@0 {
+			status = "disabled";
+		};
+
+		ethernet-phy@1 {
+			status = "disabled";
+		};
+
+		ethernet-phy@4 {
+			status = "disabled";
+		};
+
+		phy: ethernet-phy@ffffffff {
+			/*
+			 * The PHY can appear either:
+			 * - AR8035: at address 0 or 4
+			 * - ADIN1300: at address 1
+			 * Actual address being detected at runtime.
+			 */
+			reg = <0xffffffff>;
+			qca,clk-out-frequency = <125000000>;
+			qca,smarteee-tw-us-1g = <24>;
+			adi,phy-output-clock = "125mhz-free-running";
+		};
+	};
+};
-- 
2.34.1


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

* Re: [PATCH v2] mx6cuboxi: Fix Ethernet after DT sync with Linux
  2024-03-30 21:35 [PATCH v2] mx6cuboxi: Fix Ethernet after DT sync with Linux Fabio Estevam
@ 2024-04-01 10:13 ` Christian Gmeiner
  2024-04-01 11:51   ` Fabio Estevam
  2024-04-02 17:25   ` Josua Mayer
  2024-04-05 16:48 ` Fabio Estevam
  1 sibling, 2 replies; 5+ messages in thread
From: Christian Gmeiner @ 2024-04-01 10:13 UTC (permalink / raw
  To: Fabio Estevam; +Cc: baruch, trini, josua, u-boot

Hi Fabio

> From: Josua Mayer <josua@solid-run.com>
> 
> The i.MX6 Cubox-i and HummingBoards can have different PHYs at varying
> addresses. U-Boot needs to auto-detect which phy is actually present,
> and at which address it is responding.
> 
> Auto-detection from multiple phy nodes specified in device-tree does not
> currently work correct. As a work-around merge all three possible phys
> into one node with the special address 0xffffffff which indicates to the
> generic phy driver to probe all addresses.
> 
> Signed-off-by: Josua Mayer <josua@solid-run.com>
> [fabio: Added the changes to imx6qdl-sr-som-u-boot.dtsi.]
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> Tested-by: Christian Gmeiner <cgmeiner@igalia.com>
> ---
> Changes since v1:
> - Disable ethernet-phy at addresses 0, 1 and 4.
> - Remove the fixup of the fake 0xffffff address before booting Linux.
> 
> Josua and Christian,
> 
> I got access to a imx6 humming board and I was able to test it.
> 
> This is the minimal fix I came up based on your suggestions.
> 
> There is no need to fixup of the fake 0xffffff address before booting Linux,
> as this fake address does not exist in Linux.
> 
> Successfully tested Ethernet in U-Boot and in the kernel.
> 
> Given that Ethernet is currently broken, I suggest we go with this
> version to restore Ethernet for 2024.04.
> 
> What do you think?
> 

I am happy with the patch and love the idea to fix Ethernet for 2024.04.

Tested-by: Christian Gmeiner <cgmeiner@igalia.com>

Thanks & Regards,
Christian

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

* Re: [PATCH v2] mx6cuboxi: Fix Ethernet after DT sync with Linux
  2024-04-01 10:13 ` Christian Gmeiner
@ 2024-04-01 11:51   ` Fabio Estevam
  2024-04-02 17:25   ` Josua Mayer
  1 sibling, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2024-04-01 11:51 UTC (permalink / raw
  To: Christian Gmeiner, trini; +Cc: baruch, josua, u-boot

Hi Tom,

On Mon, Apr 1, 2024 at 7:13 AM Christian Gmeiner <cgmeiner@igalia.com> wrote:

> I am happy with the patch and love the idea to fix Ethernet for 2024.04.
>
> Tested-by: Christian Gmeiner <cgmeiner@igalia.com>

Could you please pick this one directly for 2024.04?

It fixes an Ethernet regression on mx6cuboxi.

Christian has tested it on i.MX6 Cuboxi and I tested it on i.MX6 Hummingboard.

Thanks

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

* Re: [PATCH v2] mx6cuboxi: Fix Ethernet after DT sync with Linux
  2024-04-01 10:13 ` Christian Gmeiner
  2024-04-01 11:51   ` Fabio Estevam
@ 2024-04-02 17:25   ` Josua Mayer
  1 sibling, 0 replies; 5+ messages in thread
From: Josua Mayer @ 2024-04-02 17:25 UTC (permalink / raw
  To: Christian Gmeiner, Fabio Estevam
  Cc: baruch@tkos.co.il, trini@konsulko.com, u-boot@lists.denx.de

Hi Fabio,

Am 01.04.24 um 12:13 schrieb Christian Gmeiner:
> Hi Fabio
>
>> From: Josua Mayer <josua@solid-run.com>
>>
>> The i.MX6 Cubox-i and HummingBoards can have different PHYs at varying
>> addresses. U-Boot needs to auto-detect which phy is actually present,
>> and at which address it is responding.
>>
>> Auto-detection from multiple phy nodes specified in device-tree does not
>> currently work correct. As a work-around merge all three possible phys
>> into one node with the special address 0xffffffff which indicates to the
>> generic phy driver to probe all addresses.
>>
>> Signed-off-by: Josua Mayer <josua@solid-run.com>
>> [fabio: Added the changes to imx6qdl-sr-som-u-boot.dtsi.]
>> Signed-off-by: Fabio Estevam <festevam@gmail.com>
>> Tested-by: Christian Gmeiner <cgmeiner@igalia.com>
>> ---
>> Changes since v1:
>> - Disable ethernet-phy at addresses 0, 1 and 4.
>> - Remove the fixup of the fake 0xffffff address before booting Linux.
>>
>> Josua and Christian,
>>
>> I got access to a imx6 humming board and I was able to test it.
>>
>> This is the minimal fix I came up based on your suggestions.
>>
>> There is no need to fixup of the fake 0xffffff address before booting Linux,
>> as this fake address does not exist in Linux.
>>
>> Successfully tested Ethernet in U-Boot and in the kernel.
>>
>> Given that Ethernet is currently broken, I suggest we go with this
>> version to restore Ethernet for 2024.04.
>>
>> What do you think?
>>
> I am happy with the patch and love the idea to fix Ethernet for 2024.04.
>
> Tested-by: Christian Gmeiner <cgmeiner@igalia.com>
>
Patch looks good to me, too (however I don't have the hardware handy
for testing version with new phy)!

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

* Re: [PATCH v2] mx6cuboxi: Fix Ethernet after DT sync with Linux
  2024-03-30 21:35 [PATCH v2] mx6cuboxi: Fix Ethernet after DT sync with Linux Fabio Estevam
  2024-04-01 10:13 ` Christian Gmeiner
@ 2024-04-05 16:48 ` Fabio Estevam
  1 sibling, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2024-04-05 16:48 UTC (permalink / raw
  To: festevam; +Cc: baruch, trini, josua, u-boot, cgmeiner

On Sat, Mar 30, 2024 at 6:36 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> From: Josua Mayer <josua@solid-run.com>
>
> The i.MX6 Cubox-i and HummingBoards can have different PHYs at varying
> addresses. U-Boot needs to auto-detect which phy is actually present,
> and at which address it is responding.
>
> Auto-detection from multiple phy nodes specified in device-tree does not
> currently work correct. As a work-around merge all three possible phys
> into one node with the special address 0xffffffff which indicates to the
> generic phy driver to probe all addresses.
>
> Signed-off-by: Josua Mayer <josua@solid-run.com>
> [fabio: Added the changes to imx6qdl-sr-som-u-boot.dtsi.]
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> Tested-by: Christian Gmeiner <cgmeiner@igalia.com>

Applied, thanks.

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

end of thread, other threads:[~2024-04-05 16:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-30 21:35 [PATCH v2] mx6cuboxi: Fix Ethernet after DT sync with Linux Fabio Estevam
2024-04-01 10:13 ` Christian Gmeiner
2024-04-01 11:51   ` Fabio Estevam
2024-04-02 17:25   ` Josua Mayer
2024-04-05 16:48 ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.