From patchwork Thu May 19 09:31:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josua Mayer X-Patchwork-Id: 1633136 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=solid-run-com.20210112.gappssmtp.com header.i=@solid-run-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=q0y9GRVv; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L3l552t43z9tky for ; Thu, 19 May 2022 19:32:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DA40F83D0C; Thu, 19 May 2022 11:32:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=solid-run.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=solid-run-com.20210112.gappssmtp.com header.i=@solid-run-com.20210112.gappssmtp.com header.b="q0y9GRVv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9918083D53; Thu, 19 May 2022 11:32:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 F0E8E83D61 for ; Thu, 19 May 2022 11:32:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=solid-run.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=josua@solid-run.com Received: by mail-wr1-x42b.google.com with SMTP id u27so5460896wru.8 for ; Thu, 19 May 2022 02:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=solid-run-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YGKjQExsPPsjKjvu2RgCkAEabSrSfkhXiHKqKULGODo=; b=q0y9GRVvwwkCmzme55i0ZaGqRPddmA2eYjdqrrCxiL93qNrkYer2jZLwunEvuws93J m0/IhngSVhAhcYau3d0ln/adXkZxHTZ+e7Yc1qo7SvJrIAbWtvjyMr5IIWCByssgS5NH zp6Xg3H0yLne10n+D/yy+zJ5mLIAUqGnn4cGgQYNlmZaTv0sxYHr+qTSFH9u2sEcR+7J /tXPP0+1XLl+Jy5mxWXFcst6KRm0qn3Hzjdu2vOlK6hW8hEKs+FWDY+KFrOD94trcsir Qsjd93KhuWiS2FmfCX4bTbkec6c2jvqXG97dU4L9d27SEzexGssiaT81TnwwW4Gaf1YL QWmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YGKjQExsPPsjKjvu2RgCkAEabSrSfkhXiHKqKULGODo=; b=lPmM29Qcu686mAZ6kYngoSyJm1XRuCLELgw6ELMMmSamgYJIsywKHBU8uca2L4+AG1 L6T5t25ynFNd98TnENcEJfZHw10RZcuPpv9DbVRjs0pAcPhN3Pj9Lq9ul30rKo1nYqdG cHYKIKYyRo2vrNDqXdjxJR6mTsYH3jTFiWwRAoKgHCePqHu/+5gjHaDPJoUbg2csY/28 pl9fsbzn0I/iKdT3EBT+lurV0rhrvbQaaQ6XfsqenqYFVipUwJVw2NufAm1mAirV/Qla zQfB/p1SPmH7qCS3GQEX5MECdx4j4sO1kIP1v+sxR7UEOikGPDb2eTrwvYqj1CyffmW/ Z5jw== X-Gm-Message-State: AOAM533VpWoV/F65WI/QmjdssQePWDJKxccQeddJpYDs3SxNpIKFZvtT 8iDIP75FGH6TTHlX99A6+2D/oEngoJGSFpjU X-Google-Smtp-Source: ABdhPJxI+v0wrxdCd0FMhwqXpZAjH9HqLXPN3Cp5xNAU2cXkv7cMbW2U9TwBE54HW+3lP/sJVs2RXQ== X-Received: by 2002:adf:d1cf:0:b0:20c:6030:d6f0 with SMTP id b15-20020adfd1cf000000b0020c6030d6f0mr3234341wrd.298.1652952730192; Thu, 19 May 2022 02:32:10 -0700 (PDT) Received: from josua-work.lan (bzq-82-81-222-124.cablep.bezeqint.net. [82.81.222.124]) by smtp.gmail.com with ESMTPSA id q9-20020adf9dc9000000b0020d02ddf4d5sm4390595wre.5.2022.05.19.02.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 02:32:09 -0700 (PDT) From: Josua Mayer To: u-boot@lists.denx.de Cc: alvaro.karsz@solid-run.com, Josua Mayer , Stefano Babic , Fabio Estevam , "NXP i.MX U-Boot Team" Subject: [PATCH v2 3/5] ARM: dts: imx6qdl-sr-som: add support for alternate phy addresses Date: Thu, 19 May 2022 12:31:58 +0300 Message-Id: <20220519093200.20571-4-josua@solid-run.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220519093200.20571-1-josua@solid-run.com> References: <20220519093200.20571-1-josua@solid-run.com> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean 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-josua@solid-run.com/ Signed-off-by: Josua Mayer --- arch/arm/dts/imx6qdl-sr-som.dtsi | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/imx6qdl-sr-som.dtsi b/arch/arm/dts/imx6qdl-sr-som.dtsi index b06577808f..c20bed2721 100644 --- a/arch/arm/dts/imx6qdl-sr-som.dtsi +++ b/arch/arm/dts/imx6qdl-sr-som.dtsi @@ -55,7 +55,13 @@ pinctrl-0 = <&pinctrl_microsom_enet_ar8035>; phy-handle = <&phy>; phy-mode = "rgmii-id"; - phy-reset-duration = <2>; + + /* + * 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"; @@ -64,8 +70,15 @@ #size-cells = <0>; phy: ethernet-phy@0 { - reg = <0>; + /* + * 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>; + adi,phy-output-clock = "125mhz-free-running"; }; }; };