Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6564485rwb; Mon, 14 Nov 2022 23:48:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf4x2AEbeHtIwg1qr4Se4MxgCVlwXcuRiJ7MUmvAq0on95VxD6Teu3TVr5HbjibwWL1WwEZY X-Received: by 2002:a05:6402:378:b0:461:c3d9:c6a3 with SMTP id s24-20020a056402037800b00461c3d9c6a3mr13875144edw.154.1668498535994; Mon, 14 Nov 2022 23:48:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668498535; cv=none; d=google.com; s=arc-20160816; b=D2v5HbEFIMittw+PM4Z66M3jFRNBxpLFDDVukAxDnBny4JIVhmKdh/yVtIkA4B1ytQ pF1s06gSToONAM7G7aCzLuZ6UGNr9kDi80froMU8bBb7B1nuLdaORbE9fEMtiwoMecy6 wCJOCKAlFrIvxw8+JqHewVKpV158Z3d3fC6qe/K6u6VpcgDgG4MWSh1+81xi3uZu4Nen Nlh/MtFWrEyB0lwM0QhFNCRI9IeBD+RzypL1djIT8r1/mye0gCzkSFa0zwo6d+tjhabg GPhhTw+V6mPih7HuLWJ7UdTTYX6tA0uRHNX4SBD/jsg43VMozs5NbxExutpDcoZ/hONt TbSw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a50d749000000b0045ccd2c9944si8234089edj.233.2022.11.14.23.48.33; Mon, 14 Nov 2022 23:48:55 -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 + 88 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=20Jirman?= , 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 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=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 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 */ -- 2.37.4