Message ID | 20221115073603.3425396-1-clabbe@baylibre.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2571333wru; Mon, 14 Nov 2022 23:37:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf4+6DEwfsHW7HkmB29EtfXWpJgyEW42oyLG0vWZGOhyXDO/xVFlWfWDK9OremLc00kNtfvy X-Received: by 2002:a05:6402:d68:b0:467:b88c:f3af with SMTP id ec40-20020a0564020d6800b00467b88cf3afmr7901552edb.24.1668497847454; Mon, 14 Nov 2022 23:37:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668497847; cv=none; d=google.com; s=arc-20160816; b=xyJDSsEPicvPF70jD9d7iou4w5FfugpjLvp8R3B2O/Bk8z1aVyd6EWgB7xoxfHTwn6 yZ3LUtcU+wVgQyg+D2WMMqAgYJsTJUPeh0nOjhsy0CIPbtgkp8V3me25I2IZWDox6r7u LwrKpaHgg4xgM8FzcaoqjDI+AONH1OLNemwSMtzghvtdcceKFtaZnBzPrpk6PuzIe3XY 6sF/vNICBlAX7Q3zC3SHEE5iZZLtbYaA4NsyzpZ5OjYNEwSjskTo3HlRRLgvDWyVL2tG eofznW+nfno+SH/ETCoESmvXuPKkgM1duAkcgMoIbP5ChR3ij8OBEJZkINU00vNzPpDj jK2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=behpqgNTXreSZukfyARZq1T8Bw0AtPtkMcPJmTi9xoI=; b=YcL+GRo93bxuBX20s7XY81VDwMRKYMXXSGFgHcPjrOX0giF+EUteZULg5zPbfrzUlc 0dwFcwyygs0//xUjbjgsinD3IJuL2CLTqPTvlw7MSAl+JlACmdAgbviqY3H7Ekjv5vjv JPFQ8R2PDk3Ik+NjVo1NO6gm0VLS+vdqYFnGrt+rdplWcGdzONLr+ggOTTQRa1LdvwSh 9P+ziqVKUBmNvcSS+d4QZopRsst3c13R/Guk8YGJgF8TUVkmDZkC2dQip8UJ0n8WDjAL RreJXVZaSTZQ8oRbchCtRLqXILQ3jBVGphEv1yVySA1p/0dIjv0eDd16Adz7qbK2GCOW fwwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=FuYvOmmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id co2-20020a0564020c0200b0045d25cf222csi10090463edb.362.2022.11.14.23.37.03; Mon, 14 Nov 2022 23:37:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=FuYvOmmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229455AbiKOHgU (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Tue, 15 Nov 2022 02:36:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231966AbiKOHgO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 15 Nov 2022 02:36:14 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2409120995 for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 23:36:13 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id v7so9084854wmn.0 for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 23:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=behpqgNTXreSZukfyARZq1T8Bw0AtPtkMcPJmTi9xoI=; b=FuYvOmmzTyXyt+6y7IakaZ7B5oewGa4eSDsx0PQNoyZ652p85IY2AmgRcnKDzeL3hQ TE1xgJRBwg5lnn/uEZ/nQfAxywv47e1X4ZTAR+qZlrmP9a46M673+9HHny5YS+rLGEBZ Wjr+exnPowaX0+gx1X8ukUDWlGf3eHYJzbwd+DKWnVud45pyT8DMD/NQNs56KQaj9KeI UFpmKQmODMRXTbje5I+2z0oJnnL3lydwURT/iar3nJwt2GXZsfxgp0z/lV7bpQun6ZaJ J/NxDx3DzDqtUyvZ0T6UeiaiYEr4shR1xWIt3f+/EJ5qPPvFgYQez8K+wNZ4KnOEgwVX +Peg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=behpqgNTXreSZukfyARZq1T8Bw0AtPtkMcPJmTi9xoI=; b=d5r2Nt4yhz0u0vRqWA7oYyh3wyhb9S9vU6yRq6iknlfZCERegDrlNqRezQBVFyP5QC +hG98SyKFGBAmtyGtPI4gPkbjJb6oBcWUGPZskxnnUC0EiCLgEZHpH/rR0cZWp7p2VUT z5Jk+/17R4P6Rsi3k+yN/LXvmmrPlt/+2B2aCPcUQzUjcwWf/tP9ppHLKxI+NuL++4yq Q9Sn1SKp/MV4fWSXySGCsyxU8RXrsdekoEp6g/puDaKLXaouzKoM9hgb7+Y84PghjDz+ iWNIwURM+HsyPHBpafcspboHL1WhxhoAvwJ/wNzNUjEI4pyXicpbGRTyEfBHMOC8B5ba di0g== X-Gm-Message-State: ANoB5pk12DVQR9hUJzkUmNfuPnW77qiOnDu5nHoDCcz8ajOSgRczRozp FRgfOg2yD+A/GGN322fxDJHaR/cNzXTW+Q== X-Received: by 2002:a05:600c:4e04:b0:3cf:a4a6:a048 with SMTP id b4-20020a05600c4e0400b003cfa4a6a048mr59983wmq.202.1668497771567; Mon, 14 Nov 2022 23:36:11 -0800 (PST) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id j13-20020a5d452d000000b0022cbf4cda62sm13836811wra.27.2022.11.14.23.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 23:36:10 -0800 (PST) From: Corentin Labbe <clabbe@baylibre.com> To: andrew@lunn.ch, broonie@kernel.org, calvin.johnson@oss.nxp.com, davem@davemloft.net, edumazet@google.com, hkallweit1@gmail.com, jernej.skrabec@gmail.com, krzysztof.kozlowski+dt@linaro.org, kuba@kernel.org, lgirdwood@gmail.com, linux@armlinux.org.uk, pabeni@redhat.com, robh+dt@kernel.org, samuel@sholland.org, wens@csie.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, netdev@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe <clabbe@baylibre.com> Subject: [PATCH v4 0/3] arm64: add ethernet to orange pi 3 Date: Tue, 15 Nov 2022 07:36:00 +0000 Message-Id: <20221115073603.3425396-1-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749546798792932518?= X-GMAIL-MSGID: =?utf-8?q?1749546798792932518?= |
Series |
arm64: add ethernet to orange pi 3
|
|
Message
Corentin LABBE
Nov. 15, 2022, 7:36 a.m. UTC
Hello 2 sunxi board still does not have ethernet working, orangepi 1+ and orangepi 3. This is due to the fact thoses boards have a PHY which need 2 regulators. A first attempt by Ondřej Jirman was made to support them was made by adding support in stmmac driver: https://lore.kernel.org/lkml/20190820145343.29108-6-megous@megous.com/ Proposal rejected, since regulators need to be handled by the PHY core. My first tentative was to just add handling of phy and phy-io in phy-core: https://lore.kernel.org/netdev/20220509074857.195302-7-clabbe@baylibre.com/T/ But having hard-coded phy names was rejected. Second tentative tryed the same path than clocks and clock-names for regulators. https://lore.kernel.org/netdev/0518eef1-75a6-fbfe-96d8-bb1fc4e5178a@linaro.org/t/ But using this was rejected by DT maintainers. So v3 use a new regulator_bulk_get_all() which grab all supplies properties in a DT node. But this way could have some problem, a netdev driver could handle already its PHY (like dwmac-sun8i already do) and so both phy-core and the netdev will use both. It is why phy-supply was renamed in ephy-supply in patch #3. This serie was tested on whole range of board and PHY architecture: - internal PHY * sun8i-h3-orangepi-pc - external PHY * sun50i-h6-pine-h64 * sun8i-r40-bananapi-m2-ultra * sun8i-a83t-bananapi-m3 * sun50i-a64-bananapi-m64 * sun50i-h6-orangepi-3 * sun50i-h5-nanopi-neo-plus2 The resume/suspend of PHY was tested. Regards changes since v1: - Add regulator_bulk_get_all for ease handling of PHY regulators - Removed all convertion patchs to keep DT compatibility. Changes since v2: - removed use of regulator-names and regulators list. Changes since v3: - fixes kbuild robot report Corentin Labbe (2): regulator: Add of_regulator_bulk_get_all phy: handle optional regulator for PHY Ondřej Jirman (1): arm64: dts: allwinner: orange-pi-3: Enable ethernet .../dts/allwinner/sun50i-h6-orangepi-3.dts | 38 ++++++++ drivers/net/mdio/fwnode_mdio.c | 31 ++++++- drivers/net/phy/phy_device.c | 10 ++ drivers/regulator/of_regulator.c | 92 +++++++++++++++++++ include/linux/phy.h | 3 + include/linux/regulator/consumer.h | 8 ++ 6 files changed, 181 insertions(+), 1 deletion(-)
Comments
> But this way could have some problem, a netdev driver could handle > already its PHY (like dwmac-sun8i already do) and so both phy-core and > the netdev will use both. > It is why phy-supply was renamed in ephy-supply in patch #3. A MAC driver will put its DT properties in the MAC node. A PHY will put its DT properties in the PHY node of the MDIO bus. Since they are in different locations, they can use the same name. So please keep with phy-supply. Please also update Documentation/devicetree/bindings/net/ethernet-phy.yaml with these new properties. Andrew
On Tue, 15 Nov 2022 07:36:00 +0000, Corentin Labbe wrote: > 2 sunxi board still does not have ethernet working, orangepi 1+ and > orangepi 3. > This is due to the fact thoses boards have a PHY which need 2 regulators. > > A first attempt by Ondřej Jirman was made to support them was made by adding support in > stmmac driver: > https://lore.kernel.org/lkml/20190820145343.29108-6-megous@megous.com/ > Proposal rejected, since regulators need to be handled by the PHY core. > > [...] Applied to broonie/regulator.git for-next Thanks! [1/3] regulator: Add of_regulator_bulk_get_all commit: 27b9ecc7a9ba1d0014779bfe5a6dbf630899c6e7 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark