Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp797467iob; Wed, 18 May 2022 13:14:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7+PWpGmmRxAQX/hogjts8s5Vl8cstnsSDxmgW910kONX7jsWoqyYc6vPRSZqcAfq3zV2O X-Received: by 2002:a62:1b06:0:b0:518:1649:bb6d with SMTP id b6-20020a621b06000000b005181649bb6dmr1251600pfb.25.1652904849586; Wed, 18 May 2022 13:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652904849; cv=none; d=google.com; s=arc-20160816; b=T7so8UyapD957C76W0/haejrTMRL7h+mZwORawKX+6noRKRr/jgEZQQEg1TCOhNsf6 /Lbi9PH6uQOLqABJ0Pg99Wqhy6CtweVMLC9WQa6wTgoIb3Np1a/24bGieJ1xXvn/34e4 KgyeE42Sm75/dfBHWs1GFX/5lXTxBWEPHIZ3wXilfAMTevGAgqAIXHnl4iOXi6xk4ArJ EWvQMLa+I2h6QIx9Mq33tVIHBjz1tAgsJJxicX0l7rHbzsIWvbU6KL1MYBQzS183f9uk qC8GrVTOYgGIPhzunWyQm9hzYfPU5YEfNXl0fOmnSU1cOpcBV78eSNdNWRRmlzS+JCv4 tQzQ== 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=gmIO/D4Ceaesv/SdaQGf7VpiPn4xB80QGFNJbqSVbYc=; b=mTPsHQm01uc5S6/23XWCl/fnTQd1zmVSTC0O9FHvDMPavuSke/Sp+PU2+jnJin/IEi nKUXTGi/dMspX7vQ7K6YzjFnEGl7BpPK758ADQ/FeiV3ywGG9Fkce6wCW0SegBvT3qDS tQtCb27M1CwtIl6eRsDC/evT9n2GjNcwTIJvPY3m5djf3C7ChC67YqEt1MNQtwzHJG+E aAS7snspFw2S8YD0WMuDlp7OMEQ98vut49vJ02uFyFUGPabOw8fAI7TIZ2k+TZxewUa4 GowGnty6kLdtqDvcfkvaofriiG9aUEzDxeP1Djh1t2MmilLVguJlPnppUMjHhJ1lbGD2 lssA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=vPcmgPS1; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id oc5-20020a17090b1c0500b001dd00f91fdbsi8578559pjb.146.2022.05.18.13.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 13:14:09 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=vPcmgPS1; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8526F3FD99; Wed, 18 May 2022 13:11:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242418AbiERUKN (ORCPT + 99 others); Wed, 18 May 2022 16:10:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242417AbiERUKF (ORCPT ); Wed, 18 May 2022 16:10:05 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E567239796 for ; Wed, 18 May 2022 13:09:54 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id m2-20020a1ca302000000b003943bc63f98so1609212wme.4 for ; Wed, 18 May 2022 13:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gmIO/D4Ceaesv/SdaQGf7VpiPn4xB80QGFNJbqSVbYc=; b=vPcmgPS1Zkav7EL8kAY3mLgR+8wgJTaoIpwtC8pZglq1poCcoa4VPa4pSJdm98yba3 Dc9i8L8D17fg1dDV1MciA85vi0SwtvTf0cIWWa0jaWi7FlHTh81D3xxtAYUio5a7q9yo oVb1izlVGPk2k31vczCTsEvwhVj4scccR45jYEXUJzfd+kt6Y1S3y8bdLsIML35boUm4 D/00jIZVyCNxRNFcViiyr0lvuZb2bnlheBghCO/T6idKUPOe+w2viE9ZGodiSxZ6rPym 6w1tRY/kpkOqM0ShsI/anVPC7SJgVvi0Sd3tKll0sY9mdRGB6Bc1w3QjAdiKooMiMpPO ODTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gmIO/D4Ceaesv/SdaQGf7VpiPn4xB80QGFNJbqSVbYc=; b=ceLDTs8DwlONgJ+CB45dj1+TyJzhLaEuYkT3EnpgffvFHcoTegc10j3kr35scKKld8 Fopdv86aTeqSnhvI8a/T+vnr6FZJHUg8qO9t/549fARknw0DkIgp8ezUwWt0w3JVH+W5 xxGtavNPo9YE2dozXL3SaWF+DRsdRa8lgoNgYv3SE8TA2xvCf5kTDprIAhYEsJfds13b fFQFeDNGu2SXJRMF0A3kljHZDcG8E1o69+2JsLPMd6YAVV2taYph8PtDEZpBJKGID66d XnHJc7ds1T37XU1SrLFpxgFZxE3QjL3d1rTIQEyGDmfL7gD/fLqcqw0RPAh9R7O46/34 84jg== X-Gm-Message-State: AOAM531Mm7b8K0wbO4H+7VyfbNCyjgthWIAAnZmnTMUu+Y50BrbKL/Hz r4qkGeJBvdhD6YgkBaW7kbRfCA== X-Received: by 2002:a05:600c:1c84:b0:394:5de0:2475 with SMTP id k4-20020a05600c1c8400b003945de02475mr888627wms.27.1652904592329; Wed, 18 May 2022 13:09:52 -0700 (PDT) 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 o23-20020a05600c511700b0039456c00ba7sm6859281wms.1.2022.05.18.13.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 13:09:51 -0700 (PDT) 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, =?UTF-8?q?Ond=C5=99ej=20Jirman?= , Corentin Labbe Subject: [PATCH v2 5/5] arm64: dts: allwinner: orange-pi-3: Enable ethernet Date: Wed, 18 May 2022 20:09:39 +0000 Message-Id: <20220518200939.689308-6-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220518200939.689308-1-clabbe@baylibre.com> References: <20220518200939.689308-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,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 c45d7b7fb39a..c3749b7302ba 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. + */ + regulators = <®_gmac_2v5>, <®_aldo2>; + regulator-names = "phy-io", "phy"; + + 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.35.1