Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp455819yba; Fri, 3 May 2019 05:11:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqylTkb8yigV2+ovjdEFu02xAQiMlnrZRkLBraVo8Mcl25/TWiY2ZagQUnMg2/AaJKGT+mRw X-Received: by 2002:a62:30c2:: with SMTP id w185mr10333915pfw.175.1556885478205; Fri, 03 May 2019 05:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556885478; cv=none; d=google.com; s=arc-20160816; b=mmCfOUc8GmX3LA7TW43t92kICTQSajRthQRT25CD97epk1VOgNDX4b8yLOVZ8hPuJr 8ABkwI0b0kbqe0q+ktlvVdkhErphxj2pfPzopaSChTpi5aSmZoJ4UcdD0GGPGeHj3dJI r0L8Mc6ZLYJIoYvfABgiepFJzRM3L8ylIp3xxBRXKT2R8UcQBi5Q20aMCytjcc7bl7XZ DVVkzkZhL7bom6sT5bV6DtTMkX8JhUp0jKZin4YZUN6hvtctT2RuFSwxITTuKRjKlZQ8 H6C2OCJLv437GU2w9tiNg/G1mZA7IrrNX6sgboDLCwEf1eb+r7OltP8vaaSEs3yWSpTT 5Hdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vJmfFw0q35lTjOMKi7JKfHPrHE1C5yCWa/soMCMhwUs=; b=yvYeNdY1c/Gl3pDNHtksDceoFM3luj3nP/wWgktIBOg7PDHDcLhPZRCLXJUOy3E1sf d/I1pZqrvmOT7xYqmlgwloWUckQx5C4B+4ve92igYREVyxkLgX8zehCEKb/O9KM3t141 oXSG0bVk4ibq+pUTDHIIEEhLDRfJHXfSYhj5w0weBq8bBr0FPSh70/s3je3au3+QDH2Y tfGxDD//GpaF2PoJn3VjCUIQU80o058ov8aUEZYP5dYRmfXMj8S4Qy3rKPHOvfP0O+np zALR1QWsP8p+fGSLoG+epJ7GXO9WaLtlFKOfx0MXcuE65zbyq1H45ouD6LHIj4yPtyFX i4UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I7fOhnOZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y16si2051259plr.431.2019.05.03.05.11.02; Fri, 03 May 2019 05:11:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I7fOhnOZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727778AbfECL7t (ORCPT + 99 others); Fri, 3 May 2019 07:59:49 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:37991 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727492AbfECL7s (ORCPT ); Fri, 3 May 2019 07:59:48 -0400 Received: by mail-pg1-f196.google.com with SMTP id j26so2639446pgl.5 for ; Fri, 03 May 2019 04:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vJmfFw0q35lTjOMKi7JKfHPrHE1C5yCWa/soMCMhwUs=; b=I7fOhnOZJa+A0py26DsoUKzEdhCQ1Na8LcD3krdUX08liXV16VPm+vpVVvESTUGXqb raRABPxt/2QfdgUMAnAmMAZLdEoKSABgxP23+lYRierkNQgvlukHAOs1btvDIbNaZgzy dqWrouzbFseyrMB0cLM1C1o38DY6+iQEYa98Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vJmfFw0q35lTjOMKi7JKfHPrHE1C5yCWa/soMCMhwUs=; b=h4EQJE/fkESsddWYWh4nYmvuNGVVo/hFrGaaJ6/zvro+VaRKT6QR8xAqcgvskSdqrd dH0smVy0CsEO81mjqujl8BuMgDe4R8uwxvFwBFmAh6F4H2JfRoEm7L2vlgERRKMJ4+Ps /kBLXK+Cf3zTUmshCmTIKUpGFEoEazxfrO8Uf6MIwFSDb4iY7V5dO4qKpWqXkzledLxA ++ncyrfVEaVPjyNrFzHOnpE2dC/At3BXUvff5+mnmhpXBtf9Fioh2w2VzE9mV1HF4F2/ LIViMYmeo45x7s3en67h8XYs7IaAVXJHFzY8nu/8/s5rtUjoSegd5JQEibgDC8+nzO6R ZflA== X-Gm-Message-State: APjAAAWjq47XrHTCWv4AqwxMasBHAlvAq2z7VrF5/psAqvs61P800Khs RtAYtHZ3sqrS//4lixM3vrbBGQ== X-Received: by 2002:a63:1604:: with SMTP id w4mr9850811pgl.148.1556884787760; Fri, 03 May 2019 04:59:47 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.165]) by smtp.gmail.com with ESMTPSA id f5sm2235940pgo.75.2019.05.03.04.59.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 04:59:47 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Rutland Cc: Michael Trimarchi , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v2] arm64: allwinner: h6: orangepi-one-plus: Add Ethernet support Date: Fri, 3 May 2019 17:29:28 +0530 Message-Id: <20190503115928.27662-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add Ethernet support for orangepi-one-plus board, - Ethernet port connected via RTL8211E PHY - PHY suppiled with GMAC-2V5, fixed regulator with GMAC_EN pin via PD6 GMAC-3V, which is supplied by VCC3V3-MAC via aldo2 - RGMII-RESET pin connected via PD14 Signed-off-by: Jagan Teki --- Changes for v2: - emac changes on top of https://patchwork.kernel.org/cover/10899529/ series .../allwinner/sun50i-h6-orangepi-one-plus.dts | 8 ++++ .../dts/allwinner/sun50i-h6-orangepi.dtsi | 42 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts index 12e17567ab56..9e8ed1053715 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts @@ -9,4 +9,12 @@ / { model = "OrangePi One Plus"; compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + }; +}; + +&emac { + status = "okay"; }; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi index 62e27948a3fa..c48e24acaf8a 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi @@ -45,6 +45,48 @@ regulator-max-microvolt = <5000000>; regulator-always-on; }; + + /* + * 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. + */ + reg_gmac_2v5: gmac-2v5 { + compatible = "regulator-fixed"; + regulator-name = "gmac-2v5"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + startup-delay-us = <100000>; + enable-active-high; + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* GMAC_EN: PD6 */ + + /* The real parent of gmac-2v5 is reg_vcc5v, but we need to + * enable two regulators to power the phy. This is one way + * to achieve that. + */ + vin-supply = <®_aldo2>; /* VCC3V3-MAC: GMAC-3V */ + }; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rgmii_pins>; + phy-mode = "rgmii"; + phy-handle = <&ext_rgmii_phy>; + phy-supply = <®_gmac_2v5>; + allwinner,rx-delay-ps = <1500>; + allwinner,tx-delay-ps = <700>; +}; + +&mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + + reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* RGMII-RESET: PD14 */ + reset-assert-us = <15000>; + reset-deassert-us = <40000>; + }; }; &ehci0 { -- 2.18.0.321.gffc6fa0e3