From patchwork Tue Nov 15 07:36:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 20229 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2572065wru; Mon, 14 Nov 2022 23:39:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf7vpSKFIL8/Aa0rte9e2OkbHwUbTPOLE9oabrRzdtyjSi2LEpp0PObRYn0JSIYg0ZfYMQcB X-Received: by 2002:a17:90a:520d:b0:212:f4f1:96ee with SMTP id v13-20020a17090a520d00b00212f4f196eemr843033pjh.72.1668497980508; Mon, 14 Nov 2022 23:39:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668497980; cv=none; d=google.com; s=arc-20160816; b=n6OkwDsDv4yVDGT68qUB3vj9XJxw8GXfKKM/F4ccq/zJCTCy9SbEoypAVY2FRbNzW6 P8u+1EdDJOrrMYLxnBLpodmOH7+8dpi1yh2d98wN+O8vkCUX0hFhF5gSyzf7yK5lJKaJ wZVScto9t55vKGKrTtegfC0vBsuxDzuk4nUm87gnlCztS93cd4K520uO+B9FlJUCV2tw b56QpLMjGYONspG+dylmCclBngH7uBi+nUIv+yJKqfKnwrMNt2S41bGCUXvy3mOkhA9h hrqfdi2X/fuVJ80A45wvUzw6OVMs6TTcZLs1xHUOWzBW6nhwC6XRaZlwO4zaHcTHEeTU HwlA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CSDVCUIFMlfZ7nF9KUJuPkMn+99GuqCPirWDXaDIqPw=; b=XImGIm8CIM5jW3Lmi99Eot2ivOLZ35u0Zo5mUm7h7M8OqtN9LbC5FUDJAosNJPtcIt MRCBOvl2AaMVpJqPTzRDtCuYhuaW95L1d3oBDpY0zmpnDZ91hxeAPWnFsRChySxqCL3U FAYeu8knapq0eMlHyGW5bu5aMDFiXstBVY60zvruoI9v/pSn1zR2RIauH9TybdclYRbw X/POGgxeOgGRNRAf21ZjK9flTOXfPk6KqieXMRsjqMIHgQRxDU4kOab15nmrJOnGOpVH VOe4PU9UexXq95EgF8zpyVdCaBdtdfYSLzsKVMavX76aiHSwQ2ey010CQEI0aEDuN6ok WAnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=lOwSFJwI; 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 o4-20020a056a001bc400b0056ec686183fsi10368126pfw.366.2022.11.14.23.39.27; Mon, 14 Nov 2022 23:39:40 -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=lOwSFJwI; 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 S232558AbiKOHgg (ORCPT + 99 others); Tue, 15 Nov 2022 02:36:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231704AbiKOHgS (ORCPT ); Tue, 15 Nov 2022 02:36:18 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E5DC18B30 for ; Mon, 14 Nov 2022 23:36:16 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id ay14-20020a05600c1e0e00b003cf6ab34b61so12462975wmb.2 for ; Mon, 14 Nov 2022 23:36:16 -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:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CSDVCUIFMlfZ7nF9KUJuPkMn+99GuqCPirWDXaDIqPw=; b=lOwSFJwIzEoH9+BBlsV8ydJ8KFWxhnO/GNq6VadaMp8sZTEOlX4BPNGNaeJnzIi/Xt Hfh19SvvnzbwgS5c3uyGDzfyDi8OWtaOmeqs+zLuz2h7IW1isXGZ98sMl+Q0yMTeJK+w pMdu5rlXLrAAgP4iMPPPheHaN1JToL4kfYHgIhb+IQKUW5mVYoRgI9ZxU8h68z4QQDTT /8QHLCsHmJhvP5JTTxUbteVbS6fdRWB15waJ0AT7O9Od9p5GUjceBEFzM3UXdkR2uh8S qNXWaF+Lop2CJA8VmNfJviN4sIcaLNVoTm4BljVNj2E6yiORQRjnSm2kLQYGY92g9pzh vp7g== 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:message-id:reply-to; bh=CSDVCUIFMlfZ7nF9KUJuPkMn+99GuqCPirWDXaDIqPw=; b=tB2fXuQwz/2e5c1tFaP6TE+kkgySGWYp0pH05KNuTLKCUv3jh8ufX0ShBg2W4mdm1H SX67mhie46+31sZQYUaJpv8FzqlXQqpXuQcc2SJgwdbkg4bNQBBo4JfJ66bsSuoI5Yzd fDPfpeO5eW3ccmfIxF9ITZZwctk0Adi6b/OjFC7Okmd7TS3fAUn5jWzai41MRfw/B6Qx 10XgptpaRyRxH4mQXxZ2UEZp9zThzGxPCtCpwf6pd6hbSdtB4vvM2eEaxckk6A83ubJO CzFIGvxupA2KvuDQSqtgX6oduQpU9fmL08+NzxMKFfCVXHQlCwaPe1tmNZ89HiTONV9k TPIg== X-Gm-Message-State: ANoB5pnJ5GBEw/E6kQqJphTWPsIhVDpX3OuCiqlFL8kRetbj7jUVVhyM 1g+rKA9e8nm4j0p8PA1clnddbg== X-Received: by 2002:a1c:720f:0:b0:3cf:6f77:375 with SMTP id n15-20020a1c720f000000b003cf6f770375mr20265wmc.102.1668497775128; Mon, 14 Nov 2022 23:36:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 23:36:14 -0800 (PST) From: Corentin Labbe 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, =?utf-8?q?Ond=C5=99ej?= =?utf-8?q?_Jirman?= , Corentin Labbe Subject: [PATCH v4 3/3] arm64: dts: allwinner: orange-pi-3: Enable ethernet Date: Tue, 15 Nov 2022 07:36:03 +0000 Message-Id: <20221115073603.3425396-4-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221115073603.3425396-1-clabbe@baylibre.com> References: <20221115073603.3425396-1-clabbe@baylibre.com> MIME-Version: 1.0 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=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749546938536259979?= X-GMAIL-MSGID: =?utf-8?q?1749546938536259979?= From: OndÅ™ej Jirman Orange Pi 3 has two regulators that power the Realtek RTL8211E PHY. According to the datasheet, both regulators need to be enabled at the same time, or that "phy-io" should be enabled slightly earlier than "phy" regulator. RTL8211E/RTL8211EG datasheet says: Note 4: 2.5V (or 1.8/1.5V) RGMII power should be risen simultaneously or slightly earlier than 3.3V power. Rising 2.5V (or 1.8/1.5V) power later than 3.3V power may lead to errors. The timing is set in DT via startup-delay-us. Signed-off-by: Ondrej Jirman Signed-off-by: Corentin Labbe --- .../dts/allwinner/sun50i-h6-orangepi-3.dts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts index 6fc65e8db220..081b004f26ea 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts @@ -13,6 +13,7 @@ / { compatible = "xunlong,orangepi-3", "allwinner,sun50i-h6"; aliases { + ethernet0 = &emac; serial0 = &uart0; serial1 = &uart1; }; @@ -55,6 +56,15 @@ led-1 { }; }; + reg_gmac_2v5: gmac-2v5 { + compatible = "regulator-fixed"; + regulator-name = "gmac-2v5"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + enable-active-high; + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */ + }; + reg_vcc5v: vcc5v { /* board wide 5V supply directly from the DC jack */ compatible = "regulator-fixed"; @@ -113,6 +123,33 @@ &ehci3 { status = "okay"; }; +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rgmii_pins>; + phy-mode = "rgmii-id"; + phy-handle = <&ext_rgmii_phy>; + status = "okay"; +}; + +&mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + /* + * The board uses 2.5V RGMII signalling. Power sequence to enable + * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails + * at the same time and to wait 100ms. The driver enables phy-io + * first. Delay is achieved with enable-ramp-delay on reg_aldo2. + */ + phy-io-supply = <®_gmac_2v5>; + ephy-supply = <®_aldo2>; + + reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* PD14 */ + reset-assert-us = <15000>; + reset-deassert-us = <40000>; + }; +}; + &gpu { mali-supply = <®_dcdcc>; status = "okay"; @@ -211,6 +248,7 @@ reg_aldo2: aldo2 { regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-name = "vcc33-audio-tv-ephy-mac"; + regulator-enable-ramp-delay = <100000>; }; /* ALDO3 is shorted to CLDO1 */