From patchwork Mon Sep 5 23:56:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ren X-Patchwork-Id: 12966631 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26C2BECAAA1 for ; Mon, 5 Sep 2022 23:58:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/IwU6kbLx07tZ6hxjgAoYPrUxtXjFRXy2pBzOvbJwv8=; b=mnGuiMnW6aZnuF 4s3osAZqf2VZZt/b6t7crf0tG1YJk9DUou8BGe/2Dy6+fEkqHDOZyWLFh8d5Z0iIH98/1tEzS9DIK fq+FKJYXLB6elKjFqi0ittvQZUMKQnLvY8WCRDqBE0Vb8yoYb1094CQJZSE/uKEY7A9XseYyRxHTk WKGYWsW20a1Z37iQ97tsi+zgg28I/7hGWtJoWIh4XHdPGo2q3QLUeTHcwg0XVU6pne91bc/TOxshX 6XQ0pVDWttpr2tktMFuz2Au8QfB/GgK4xRdXgdPVtVPAr7kY20QRnytkxByzXtwZM+DbdAcITL1He jfsrwXWfKQEZnC5aem0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVLxe-000TTM-B2; Mon, 05 Sep 2022 23:57:02 +0000 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVLxY-000TRU-Of for linux-arm-kernel@lists.infradead.org; Mon, 05 Sep 2022 23:56:58 +0000 Received: by mail-pg1-x531.google.com with SMTP id 202so9127286pgc.8 for ; Mon, 05 Sep 2022 16:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=HxSa1nifl/BjX4IHSZwDFpkRT1uZIgkAl2NNuJKauFc=; b=igHu4PgNQHWwp544lo/os2ZQ09E310HyxSJoqP/7Oo8TMGEf6ZlVucL7lBaJpcT0Yd EpZZUZubSRzixOsaWplXxMB9pxcJeD5cf6KOqO8FREFIGdDLaPzlQDnj9Y4yDvunkv98 62ZZ8WmcVC44VFm3ayQxZOj0dcMzU4a2ijXT20A/OreUOFgCLzkyQqGFQhJuw24RIdTF y5hrVuJ/byp5Uw1pf3Ouhqx2t6vE6DzliOdrlTeIpPKlMBVSiI/4lfQ6GuJvytBf/NIo YcrgvnJpT7j9Xmzo6eoE2Se9U6vqmbwzjBO10AEq/lwxcq5Tu2JscuYck6CG5wqEgm4h Q5DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=HxSa1nifl/BjX4IHSZwDFpkRT1uZIgkAl2NNuJKauFc=; b=L505onUJG/J6cb8J1Wvk49qutKOujmu/tdxRrqiLLgUisPfhMWQyEiH3V/xfbWW2me eBBIU6egmtb9xYYrin8Hp2zZGFbrB7UKIDcIA2nPQlvZ+mtWFQdaFH99urv44RAUwHVB Yr/UV4+KL7esPFGpz9Cm4lQS7zsO/lqXmopLUpGL5hZ1Bs7ZbyDjAL7X1cSIUYnc78v3 ip8982JK+GdLIAjuOyK8Qh/So6LZWUM0onzi+gQw7ooRt3qYK0/ylQYz50z7gV365FEo oM4SgsEZp1DT/g75DT3g1ofTYa4UNK4fU16eYNOI+AZdGy/nsop2hWnQTQ5V3UY22JDr nMJw== X-Gm-Message-State: ACgBeo0buzqbZTgYVhGkNBUzeQJdShoiSqmI3B3ut+5xUHtY+lLTtEi8 mnNpU+vzKEHkAODzXLeWSRA9M7coQxnryg== X-Google-Smtp-Source: AA6agR6AalO/X1wxUzxRBt1wOQhvPR3J3uYbqv142JppgLbGvt7zZWNTHzEuMhAdTbmTglc7fVcY4Q== X-Received: by 2002:aa7:9e12:0:b0:53e:27d8:b71b with SMTP id y18-20020aa79e12000000b0053e27d8b71bmr238339pfq.46.1662422213841; Mon, 05 Sep 2022 16:56:53 -0700 (PDT) Received: from localhost.localdomain ([76.132.249.1]) by smtp.gmail.com with ESMTPSA id g26-20020aa79dda000000b00537f13d217bsm8405530pfq.76.2022.09.05.16.56.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 16:56:53 -0700 (PDT) From: rentao.bupt@gmail.com To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heyi Guo , Dylan Hung , Guangbin Huang , Liang He , Hao Chen , Rob Herring , Krzysztof Kozlowski , Joel Stanley , Andrew Jeffery , Tao Ren , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Tao Ren Subject: [PATCH net-next 1/2] net: ftgmac100: support fixed link Date: Mon, 5 Sep 2022 16:56:33 -0700 Message-Id: <20220905235634.20957-2-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220905235634.20957-1-rentao.bupt@gmail.com> References: <20220905235634.20957-1-rentao.bupt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_165656_823386_DE252F0A X-CRM114-Status: GOOD ( 15.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Tao Ren Support fixed link in ftgmac100 driver. Fixed link is used on several Meta OpenBMC platforms, such as Elbert (AST2620) and Wedge400 (AST2520). Signed-off-by: Tao Ren Reviewed-by: Andrew Lunn --- drivers/net/ethernet/faraday/ftgmac100.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index 9277d5fb5052..da04beee5865 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1701,10 +1701,14 @@ static int ftgmac100_setup_mdio(struct net_device *netdev) static void ftgmac100_phy_disconnect(struct net_device *netdev) { + struct ftgmac100 *priv = netdev_priv(netdev); + if (!netdev->phydev) return; phy_disconnect(netdev->phydev); + if (of_phy_is_fixed_link(priv->dev->of_node)) + of_phy_deregister_fixed_link(priv->dev->of_node); } static void ftgmac100_destroy_mdio(struct net_device *netdev) @@ -1867,6 +1871,26 @@ static int ftgmac100_probe(struct platform_device *pdev) err = -EINVAL; goto err_phy_connect; } + } else if (np && of_phy_is_fixed_link(np)) { + struct phy_device *phy; + + err = of_phy_register_fixed_link(np); + if (err) { + dev_err(&pdev->dev, "Failed to register fixed PHY\n"); + goto err_phy_connect; + } + + phy = of_phy_get_and_connect(priv->netdev, np, + &ftgmac100_adjust_link); + if (!phy) { + dev_err(&pdev->dev, "Failed to connect to fixed PHY\n"); + of_phy_deregister_fixed_link(np); + err = -EINVAL; + goto err_phy_connect; + } + + /* Display what we found */ + phy_attached_info(phy); } else if (np && of_get_property(np, "phy-handle", NULL)) { struct phy_device *phy; From patchwork Mon Sep 5 23:56:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ren X-Patchwork-Id: 12966632 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13B18ECAAD3 for ; Mon, 5 Sep 2022 23:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BtoJv0b8Yd+BEpceuhPb1NkxV9OyGCcr5tprDkt1h+c=; b=ob4YYSKlmWkckx PEKVB3he5VH0gJkSBQgF8uan/7TTrGPZ/juhG46I1sga/K232y3xzxGm4V1Ac/4C+9G4YBes2QD43 sT82CxAmPpU/y37F6BqwzKTfsBG8ckaNyM80y+hhfDTw2yc79a05rZ9A21WiDZDhwYfx6yM2djO9+ mCMZ0LuEY4CLOSTMTDg6LpykvBb1dXhS01j2cw7V7/mNdfmVPUP/SPvs+Ox/yRPXGo5P2PkTlNyaE rkKqeNbO6anmkL0CVQ+VX0PvCH/yLbQp1OtmwhCSEdBUmbttId2yOk07phCi8fTGfFfDhAYk6boWc Dke/UfyDAVF/UUs6d3mQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVLxn-000TW2-Lz; Mon, 05 Sep 2022 23:57:11 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVLxe-000TSl-0q for linux-arm-kernel@lists.infradead.org; Mon, 05 Sep 2022 23:57:03 +0000 Received: by mail-pj1-x102b.google.com with SMTP id p1-20020a17090a2d8100b0020040a3f75eso4856296pjd.4 for ; Mon, 05 Sep 2022 16:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=jfgoG65m8y92e/I+R1FFZjCqYowE45KYPw1MG3KYwPc=; b=CYxNR3IMSrHOPWsxZDepJUS65bRt7H6VcpeRt6MM10aBzWg18CnbBImh4Yyi9KLWw8 TCcKEKkFMN+ZT8bfJ1xJ7lOYzEM10+4b0CtDytAZ6kI6X7zpYchrxlos4bEG3pUIN3IJ QFW1ERQC+oOoGlwAZVoByqoM72Vc8EnTN0xwkARrR6/0+U9GudrnHmj9wEwXiO7nUH7N s6k9XUHi1UPZBVqjSRcUqeGs/bZvK8doV1RXnUn9P1Hs2RYa8p6ZtPptwK8w2cL9HsJp WGAiarK3Y8av7ozoIkdBB2xHK3L+sRVsNwYqPkVely/kzpWstBARDbYEGBPuag7QbyhD MXFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=jfgoG65m8y92e/I+R1FFZjCqYowE45KYPw1MG3KYwPc=; b=UpEnL079DFMwwf+CBu4nizF+kgfGTL0pa3lV7QPNZb7K5+9e7PAFPHIA6zKiR+5bI6 FJU30x2WkyNAexCHfJARrRl893RH/DMkehvU/x444nTVapSdNQnW2lIIF3rq66merNeY 8A+099nFuCHPU9w9xb7/nzYUH2npegb+bZLk+wvwOSkQ5Cb+Mxr5GfHOTc3vAxsvH8We rMUno7U00B9A76a7UY76KV5kynvzAkTO6PgoUtoz+uSd+yyDNdY7HojHPgIN3O+Lp2x5 RTmdXVJBZywlVuH4h9PUmM2YoXLvjK0OBQ0A5qomMZkjo0sQyMqoqn0hRzMxrbwsLA7I NPbg== X-Gm-Message-State: ACgBeo0feubR7ws9v+Pvz2U4bb7XoO8WvIgxbGq/K+XMIRQ8EHQK4dRD XfXpy3L9eW450jmQWOBc+tE= X-Google-Smtp-Source: AA6agR5GLHFYb6BNlPh/lb13Sdr8yCGnsYNTWWtx0r29gyDFpyv1zsHWc/cDmHgS4l3hGgJz5T39yg== X-Received: by 2002:a17:90b:1804:b0:1fb:141:a09d with SMTP id lw4-20020a17090b180400b001fb0141a09dmr21524677pjb.170.1662422219891; Mon, 05 Sep 2022 16:56:59 -0700 (PDT) Received: from localhost.localdomain ([76.132.249.1]) by smtp.gmail.com with ESMTPSA id g26-20020aa79dda000000b00537f13d217bsm8405530pfq.76.2022.09.05.16.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 16:56:59 -0700 (PDT) From: rentao.bupt@gmail.com To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heyi Guo , Dylan Hung , Guangbin Huang , Liang He , Hao Chen , Rob Herring , Krzysztof Kozlowski , Joel Stanley , Andrew Jeffery , Tao Ren , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Tao Ren Subject: [PATCH net-next 2/2] ARM: dts: aspeed: elbert: Enable mac3 controller Date: Mon, 5 Sep 2022 16:56:34 -0700 Message-Id: <20220905235634.20957-3-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220905235634.20957-1-rentao.bupt@gmail.com> References: <20220905235634.20957-1-rentao.bupt@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_165702_122759_729CA9EF X-CRM114-Status: GOOD ( 11.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Tao Ren Enable mac3 controller in Elbert dts: Elbert MAC3 is connected to the onboard switch directly (fixed link). Signed-off-by: Tao Ren --- arch/arm/boot/dts/aspeed-bmc-facebook-elbert.dts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-elbert.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-elbert.dts index 27b43fe099f1..52cb617783ac 100644 --- a/arch/arm/boot/dts/aspeed-bmc-facebook-elbert.dts +++ b/arch/arm/boot/dts/aspeed-bmc-facebook-elbert.dts @@ -183,3 +183,14 @@ imux31: i2c@7 { &i2c11 { status = "okay"; }; + +&mac3 { + status = "okay"; + phy-mode = "rgmii"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rgmii4_default>; + fixed-link { + speed = <1000>; + full-duplex; + }; +};