From patchwork Fri Jan 14 12:08:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1580007 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=swf1+5jM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jb0SJ4g23z9sP7 for ; Fri, 14 Jan 2022 23:08:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A7B558338C; Fri, 14 Jan 2022 13:08:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="swf1+5jM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2B7D883394; Fri, 14 Jan 2022 13:08:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 0D420811B3 for ; Fri, 14 Jan 2022 13:08:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x536.google.com with SMTP id b13so34417710edn.0 for ; Fri, 14 Jan 2022 04:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cv0g/8SZ2MOBDOH5WsDwJKKmx/66pKGvMGznjV1/iYU=; b=swf1+5jMYeQ7Xc94rEklp4nCfizOyfXu4X6ZZcPUJPUovlC9I70+iwkukWfoJ3PyUH YpwpNLwFI7sqE2EmTDF9u5JMN3/Pfg+0VZvd5a/26e7OsJn3n58oyJ8RqMEv3LbvfIxS a0xQ8NuBM4avTf8ARp4WERnA1Twi7264JLsrRCuctQz5VhFQZtFuahtkw3mHuV2LGbrb EbQPlDBdnKt/7E/g75MJIPcUFwt+9pFYClsRh29RId1bceXW/YWMjJbCnqAlPaHGYPJr CYWR1OkJKODtlskoL3IL/br56+ZJajS+MMSs1nWwXxw0C1QjYIXgjsmb1RQ9LVUJrOfq zC5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=cv0g/8SZ2MOBDOH5WsDwJKKmx/66pKGvMGznjV1/iYU=; b=jt0rObPHiCB5PjHfqJSlfWN75qhDK69DpI7NQF4Gcf2OaimGHkdM6W4N026YZVClEX V1nrczn9leJPlvwYHWiZp5sR6reWdt2wAlx08Cr+LFD/FrtHNqjNpPhjsWJoHzBAlahO SGuVD0537HWUobt+821zMChcVzpyB062Ym+n5abuBuAG5+2D7gMIO14mNGGwPvi1Iry5 6wu5sSGPPxdnqU/wsJQeS/tnPfGD5kUJcLPcX5VO18TwIeP0ekyntayk1CgNmcTFiFoH Toegk2AVxkVQ+KhuyiFreAYdwC9fzf7lpBvAihP8Xi23CLQu9zI+GaNvnr9Jyb46o5OE UjGw== X-Gm-Message-State: AOAM5338RFC5gNbZl2JaH+r9R+BKqMFu7ALVKKcg0I0ng1pmnFyZx9vK rKcZXRfVpwGfUvmknfn/R5wwsdC7D10Mpv1S X-Google-Smtp-Source: ABdhPJyoqrvYLfNF3lWAwqtBOpLmtQKdxQB3gIBWs5Wgi1ElybL3M9fw4XU6M061uF8q73OdEIBurw== X-Received: by 2002:a17:906:328d:: with SMTP id 13mr3454368ejw.28.1642162088507; Fri, 14 Jan 2022 04:08:08 -0800 (PST) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id o25sm2292045edr.20.2022.01.14.04.08.08 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jan 2022 04:08:08 -0800 (PST) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Ashok Reddy Soma , Joe Hershberger , Ramon Fried Subject: [PATCH] net: gem: Workaround gmii2rgmii bridge DT node issue Date: Fri, 14 Jan 2022 13:08:07 +0100 Message-Id: <641eb13425ffe80e0743f60cf90d0f940577b9e9.1642162085.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.34.1 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.2 at phobos.denx.de X-Virus-Status: Clean From: Ashok Reddy Soma For configurations with gmii2rgmii and external phy the DT nodes link should be gem->gmii2rgmii->phy. But due to limitation in Linux driver the DT is mentioned as gem->phy and gmii2rgmii->phy as shown in below DT. ethernet@ff0c0000 { compatible = "cdns,zynqmp-gem\0cdns,gem"; status = "okay"; interrupt-parent = <0x04>; interrupts = <0x00 0x3b 0x04 0x00 0x3b 0x04>; reg = <0x00 0xff0c0000 0x00 0x1000>; clock-names = "pclk\0hclk\0tx_clk\0rx_clk\0tsu_clk"; #address-cells = <0x01>; #size-cells = <0x00>; #stream-id-cells = <0x01>; iommus = <0x0d 0x875>; power-domains = <0x0c 0x1e>; clocks = <0x03 0x1f 0x03 0x69 0x03 0x2e 0x03 0x32 0x03 0x2c>; phy-handle = <0x0e>; phy-mode = "gmii"; xlnx,ptp-enet-clock = <0x00>; local-mac-address = [ff ff ff ff ff ff]; phandle = <0x4d>; mdio { #address-cells = <0x01>; #size-cells = <0x00>; phandle = <0x4e>; ethernet-phy@1 { reg = <0x01>; rxc-skew-ps = <0x708>; txc-skew-ps = <0x708>; phandle = <0x0e>; }; gmii_to_rgmii_0@8 { compatible = "xlnx,gmii-to-rgmii-1.0"; phy-handle = <0x0e>; reg = <0x08>; phandle = <0x4f>; }; }; }; Since same DT is used in Linux and U-Boot we need to workaround this issue by using the gmii2rgmii node which points to phy and we should ignore the gem pointing to phy directly. Do this workaround by updating priv->phydev->node value with priv->phy_of_node only if it is not valid node. Signed-off-by: Ashok Reddy Soma Signed-off-by: Michal Simek Reviewed-by: Ramon Fried --- drivers/net/zynq_gem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index b751d28e611f..f238811786c6 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -338,7 +338,8 @@ static int zynq_phy_init(struct udevice *dev) ADVERTISED_Asym_Pause; priv->phydev->advertising = priv->phydev->supported; - priv->phydev->node = priv->phy_of_node; + if (!ofnode_valid(priv->phydev->node)) + priv->phydev->node = priv->phy_of_node; return phy_config(priv->phydev); }