From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B438C04A68 for ; Thu, 28 Jul 2022 11:16:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4EB5383F36; Thu, 28 Jul 2022 13:16:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="kSeezJds"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3A0EF83EA0; Thu, 28 Jul 2022 13:16:34 +0200 (CEST) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DBD9A84009 for ; Thu, 28 Jul 2022 13:16:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x733.google.com with SMTP id o21so1160642qkm.10 for ; Thu, 28 Jul 2022 04:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hZnSCuBbAuqiRuNVlKW4wAwCPZOOXPdqm6lcBWRyoak=; b=kSeezJds4WpjHpou7pMfYwe73EmjilHG8QduwWNH1tBVOY2Qmj9S3gGp9/N8ZObcFk FzZcEtgJvmsy3ZwclcB7fU2hApELEo//HiW8pEALN5YJVH4aKMu54I55V/SHVlFiSExZ iNdq4hS6h0/o2vXtKQeHNBJ9gyTh442fuIC+s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hZnSCuBbAuqiRuNVlKW4wAwCPZOOXPdqm6lcBWRyoak=; b=2stWAZ8AHWKEeMu8J5D/pLd/DF3H6SR50SRwYmLwlfHc8rDli1PvX2Ej0+AGUWwGvc JzvyvDaI+msOzmWNjFEqOzuhELlz6WO7pnR7xnfsWPX4rkSymlF2hqEXYzvGfNxt+Be+ s36whaC7JWg/QqSBR2idUVzi7Zf9kE1XXLGrjr9GAB7EWd4uO3QABWwwuwH3WPTIQymv naz9M9zh/n00ehO5XpHbF53ZJa93KjIkc7gLY2lRHKwPIuvzpO278h04e4Ix5Mm3VRFi i7ewkTv8DaZt9SgOHZhAJ0/20JEJZfBzunUwwyExkIzlT2nAWFFrOkaQDoWxCpvyZgIp ac+A== X-Gm-Message-State: AJIora+S1Bs+a7W0c+pNtOwr+lEsG5FGjevY2HW/BugUUfolaqJDq4Zz kHGSVOm2jXTrnwL6CQxiBAs0PQ== X-Google-Smtp-Source: AGRyM1vte+kDX6Kw/YyXjyA7hUW952CznC6yQK4I2fOjLSpVqVbNVM9kmefVZtgbGaEaaKrm0xjmSQ== X-Received: by 2002:a05:620a:4514:b0:6b5:e33d:32b6 with SMTP id t20-20020a05620a451400b006b5e33d32b6mr19639348qkp.66.1659006988473; Thu, 28 Jul 2022 04:16:28 -0700 (PDT) Received: from bill-the-cat (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id a10-20020ac844aa000000b0031eb5342520sm300960qto.15.2022.07.28.04.16.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 04:16:27 -0700 (PDT) Date: Thu, 28 Jul 2022 07:16:25 -0400 From: Tom Rini To: Josua Mayer Cc: u-boot@lists.denx.de, Yazan Shhady , Stefano Babic , Fabio Estevam , "NXP i.MX U-Boot Team" , Baruch Siach , Marcel Ziswiler Subject: Re: [PATCH] mx6cuboxi: fix ethernet after synchronise device-tree Message-ID: <20220728111625.GD1146598@bill-the-cat> References: <20220728070540.28554-1-josua@solid-run.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PJZsqiKZJVWqUoDR" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean --PJZsqiKZJVWqUoDR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 28, 2022 at 07:08:35AM +0000, Josua Mayer wrote: > Please hold off merging this patch until someone tested it, I can not do = so > this week. > @Tom Can you confirm if this fixes the networking on your Cubox? > Also note that the phy-handle property may or may not be required, I am n= ot > sure. Ah, the patch email itself seems to have gotten lost, can you resend and I'll test? Thanks. >=20 > sincerely > Josua Mayer >=20 > On Thu, Jul 28, 2022 at 7:05 AM Josua Mayer wrote: >=20 > > 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. > > Also fixup this fake address before booting Linux, *if* booting with > > U-Boot's internal dtb. > > > > Signed-off-by: Josua Mayer > > Fixes: d0399a46e7cd > > --- > > arch/arm/dts/imx6qdl-sr-som.dtsi | 30 +++++++++------------------- > > board/solidrun/mx6cuboxi/mx6cuboxi.c | 6 +++++- > > 2 files changed, 14 insertions(+), 22 deletions(-) > > > > diff --git a/arch/arm/dts/imx6qdl-sr-som.dtsi > > b/arch/arm/dts/imx6qdl-sr-som.dtsi > > index ce543e325c..2d7cbc26b3 100644 > > --- a/arch/arm/dts/imx6qdl-sr-som.dtsi > > +++ b/arch/arm/dts/imx6qdl-sr-som.dtsi > > @@ -53,6 +53,7 @@ > > &fec { > > pinctrl-names =3D "default"; > > pinctrl-0 =3D <&pinctrl_microsom_enet_ar8035>; > > + phy-handle =3D <&phy>; > > phy-mode =3D "rgmii-id"; > > > > /* > > @@ -68,30 +69,17 @@ > > #address-cells =3D <1>; > > #size-cells =3D <0>; > > > > - /* > > - * The PHY can appear at either address 0 or 4 due to t= he > > - * configuration (LED) pin not being pulled sufficientl= y. > > - */ > > - ethernet-phy@0 { > > - reg =3D <0>; > > + phy: ethernet-phy@0 { > > + /* > > + * The PHY can appear either: > > + * - AR8035: at address 0 or 4 > > + * - ADIN1300: at address 1 > > + * Actual address being detected at runtime. > > + */ > > + reg =3D <0xffffffff>; > > qca,clk-out-frequency =3D <125000000>; > > qca,smarteee-tw-us-1g =3D <24>; > > - }; > > - > > - ethernet-phy@4 { > > - reg =3D <4>; > > - qca,clk-out-frequency =3D <125000000>; > > - qca,smarteee-tw-us-1g =3D <24>; > > - }; > > - > > - /* > > - * ADIN1300 (som rev 1.9 or later) is always at address= 1. > > It > > - * will be enabled automatically by U-Boot if detected. > > - */ > > - ethernet-phy@1 { > > - reg =3D <1>; > > adi,phy-output-clock =3D "125mhz-free-running"; > > - status =3D "disabled"; > > }; > > }; > > }; > > diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c > > b/board/solidrun/mx6cuboxi/mx6cuboxi.c > > index debf4f6a3b..52172a03b1 100644 > > --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c > > +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c > > @@ -446,7 +446,7 @@ static int find_ethernet_phy(void) > > */ > > int ft_board_setup(void *fdt, struct bd_info *bd) > > { > > - int node_phy0, node_phy1, node_phy4; > > + int node_phy, node_phy0, node_phy1, node_phy4; > > int ret, phy; > > bool enable_phy0 =3D false, enable_phy1 =3D false, enable_phy4 = =3D false; > > enum board_type board; > > @@ -478,6 +478,10 @@ int ft_board_setup(void *fdt, struct bd_info *bd) > > return 0; > > } > > > > + // update U-Boot's own unified phy node phy address, if present > > + node_phy =3D fdt_path_offset(fdt, "/soc/bus@2100000/ethernet@21= 88000 > > /mdio/phy"); > > + ret =3D fdt_setprop_u32(fdt, node_phy, "reg", phy); > > + > > // update all phy nodes status > > node_phy0 =3D fdt_path_offset(fdt, "/soc/bus@2100000 > > /ethernet@2188000/mdio/ethernet-phy@0"); > > ret =3D fdt_setprop_string(fdt, node_phy0, "status", enable_phy= 0 ? > > "okay" : "disabled"); > > -- > > 2.37.1 > > > > --=20 Tom --PJZsqiKZJVWqUoDR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmLicAYACgkQFHw5/5Y0 tyy+rwv+OfbIfFv1QSwXpO4A1zFRL+l1MsDH0FL14/zYiQV5Z+o0tDaq/g9uJb+o 3rCjzNR32Hi4MX9varrvGGMK4b2TCcQENLubaMTf/UIuTSZ59OTULoIZI5ck1v+b 6aQn7kp4UA9BX1c7Rr8MXw28aJ+7Unq0v+o5hA7Jtg5iQuJAqZDXfOY5x8yr6Zy8 PjCBL27SM9suG4Lnzo5sUmmZNMWkOe8NBlhKFN5MqorkjgzFbaHeueznrqn/CBrN 40dwE9QpKhRftG7EjuEtCKe3vsIU0I1NZVT0z8E5g9gp/XISFgsN5W46LgJKYOzQ oHeY12EZbkZTQkSpc4cY9kamyuxCPsn9OuQ6Tz+M1maAlk4N4mYctjwdjtwwNS7z GAs4ycrY1ncmnv/ZJSrXRX0rEZm3P3hOn/m0hOxDqJOtwbFzCM/OLBl2rJ3tcF7H J9jCutpZwJETsrFkMpLSoNozNoAIKIReJfQvugBr+XedByUYA8VYC23zqZ8v4eDB aVO9CKLX =aEv2 -----END PGP SIGNATURE----- --PJZsqiKZJVWqUoDR--