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 CC1CAC433F5 for ; Sun, 1 May 2022 12:42:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ACAB783F1C; Sun, 1 May 2022 14:41:55 +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="WRE2afQs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CE5E083F25; Sun, 1 May 2022 14:41:50 +0200 (CEST) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 D368D83F0E for ; Sun, 1 May 2022 14:41:44 +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-x435.google.com with SMTP id v12so16436341wrv.10 for ; Sun, 01 May 2022 05:41:44 -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=YeJchmewqKTHpqwAVoFsV/4rPN2J1AkNNr8t5F6CkB8=; b=WRE2afQsiVg1MrecnYk+CRS/W5/Iukbl8JGSqHKLV5c0fOyFOTjAUZJgoJ7QylGwGX Kk/DPmv5jA6NHpfmLwEWV23KkgFLYOYb8OvtkfJS2H/gHCxZHppkuj9T80uCZUwZZ+3x BKwwUDrDAClRiFJmAq3ipBMLmlx+l/GC0QJ4UOYK0Y0pcYA9t3FQoHWejJCg8BoAZE/M LdlqdyH2FMVEXDEvkypG01IYM0GSFJFHb4v+6dZcCc2zqnqJTAUUBvDEpi/272LNbgGh CQDX6Z7GS+7JOekjYVDZPhZQNORU1DBeqIhoABCdY4z4uvZcQMUvl3E+cl3tggVgcOvD zvMA== 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=YeJchmewqKTHpqwAVoFsV/4rPN2J1AkNNr8t5F6CkB8=; b=Q5uI59t0wUtLUMmPbvHj9CCAQmejZ4bbb5TydphVJaZe0Vsh+DW0HK2E+a6MDhBZyZ GqKgRfwI4J5cH8RciP1PaAIIS2BtehsxZQAa5wAercCZDkjuX471XUnAiymz0wLY0T3v FNi7xgbCJSZ07Wp4c5oFkxNNZrri15J+Br/mm9S7CTXenRIYx8C3L/EQbXmXtJnZ9G2g y41gsQLoLZt8HJPi2szFWGmGdjR5na+yyRIFlZT1N37cA/gX1HhvD/3OMK7kApGYDJIA Ub79EFFgey61M9tkLOdfOIO6lx41G6FqmRXmB/zJaniHD3BjIWRaYrt6/s1Zn3SRO0S0 IZ/Q== X-Gm-Message-State: AOAM531lP/1+cnGyrXd3QSpQDLNAiL8B0IlsIKIaNFXIcMgmS+irsBSp 0qb7mvuGmoqfOWhMqMM4EJOgydBeUCAtcA== X-Google-Smtp-Source: ABdhPJxefNG2zblhv3rsHAaO/KdM4WieZiqH9cApSowDEBNWdVADotIl6Eqe9X4nE4u6aqKoF4bC4w== X-Received: by 2002:adf:ec89:0:b0:20a:c0a4:e4a3 with SMTP id z9-20020adfec89000000b0020ac0a4e4a3mr6123638wrn.98.1651408904010; Sun, 01 May 2022 05:41:44 -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 c13-20020adfa70d000000b0020c5253d8e8sm4615238wrd.52.2022.05.01.05.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 May 2022 05:41:43 -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 3/5] ARM: dts: imx6qdl-sr-som: add support for alternate phy addresses Date: Sun, 1 May 2022 15:41:29 +0300 Message-Id: <20220501124131.30614-4-josua@solid-run.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220501124131.30614-1-josua@solid-run.com> References: <20220501124131.30614-1-josua@solid-run.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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"; }; }; }; -- 2.34.1