
Hi Fabio, Marcel, Tom,
The intuitive way to make ethernet work in case we do not know which phy is assembled,and at what address it will be available, is having 3 phy nodes in the dts, and setting all of their status fields to "okay" - so that they would be probed in order until one succeeds. This approach does work in Linux, but the maintainers there have rejected it for producing unnecessary errors in the boot log. For U-Boot imo this approach would be acceptable.
HOWEVER U-Boot does not currently work that way. Back when I developed my patch I noticed a strange problem where U-Boot would detect one of the PHYs, but then pass the *wrong* device-tree node to the driver. Therefore I intentionally merged them all into one phy node, as a workaround.
I see that the phy-handle property has also been dropped. This may or may not be triggering the situation Tom is reporting on - I did not look deep enough.
So I would suggest to partially undo Marcels change by restoring the single phy node as I had described it, for now. It may also be beneficial to tweak the device-tree patching inside the board-file to make this merged phy node compatible with Linux.
I can probably draft a patch to test this theory, later today.
sincerely Josua Mayer
On Wed, Jul 27, 2022 at 12:14 PM Fabio Estevam festevam@gmail.com wrote:
[Adding Josua]
On Tue, Jul 26, 2022 at 3:12 PM Tom Rini trini@konsulko.com wrote:
So, funny issue here now. With: commit d0399a46e7cda63c07e3eb8558bef84cfb068028 Author: Marcel Ziswiler marcel.ziswiler@toradex.com Date: Thu Jul 21 15:27:26 2022 +0200
imx6dl/imx6qdl: synchronise device trees with linux Synchronise device trees with linux-next next-20220708. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
This breaks ethernet on my mx6cuboxi board, which in reality is an MX6 Hummingboard. I think this means that we need some further tweak in the board.c file, given the past history I recall of "oops, ethernet broke again" here. Since I don't want to block everything else and after re-reading that commit, I don't think this is some systemic breakage but more likely board specific, I have applied the PR. I am hopeful that we can resolve this issue fairly quickly.
The sync with imx6 upstream DT undoes some of the changes from:
commit 17baba4682001cc11446ff8406c63850b46edf72 Author: Josua Mayer josua@solid-run.com Date: Thu May 19 12:31:58 2022 +0300
ARM: dts: imx6qdl-sr-som: add support for alternate phy addresses The Cubox has an unstable phy address - which can appear at either address 0 (intended) or 4 (unintended). SoM revision 1.9 has replaced the ar8035 phy with an adin1300, which will always appear at address 1. Change the reg property of the phy node to the magic value 0xffffffff, which indicates to the generic phy driver that all addresses should be probed. That allows the same node (which is pinned by phy-handle) to
match either the AR8035 PHY at both possible addresses, as well as the new one at address 1. Also add the new adi,phy-output-clock property for enabling the 125MHz clock used by the fec ethernet controller, as submitted to Linux [1].
Linux solves this problem differently: For the ar8035 phy it will probe both phy nodes in device-tree in
order, and use the one that succeeds. For the new adin1300 it expects U-Boot to patch the status field in the DTB before booting
While at it also sync the reset-delay with the upstream Linux dtb. [1]
https://patchwork.kernel.org/project/netdevbpf/patch/20220428082848.12191-4-...
Signed-off-by: Josua Mayer <josua@solid-run.com>
Josua, could you please take a look?