From patchwork Mon May 28 17:47:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 137109 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3104033lji; Mon, 28 May 2018 10:51:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqQCiIS6dXeEq72LmnCa87h/hjj9AeRGeJZyE6Fl9lEZ20NycfuQI0AJwePF2kv/doYh8Tn X-Received: by 2002:a65:5308:: with SMTP id m8-v6mr11610309pgq.42.1527529914866; Mon, 28 May 2018 10:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527529914; cv=none; d=google.com; s=arc-20160816; b=FsBdK90aJ7THW2QUnVPd8r4E2z9CEjbN40xsfcwd7Lw9YR0JjuewifAzx+37nb3FT3 3pP/6luejv6zGorHYTRm5MxjaN86ygVAJNusLIqZhOK0Mkjq9DmJ/Xad/vWEVoaIOZIi 0/1O64xCiS2eT+kyBWBrZshDldIRB9+ScLoc0hi0M171bkybOaWTJeeJiOATrt6PqZqP tQrudGK80NP5sWAD7R2QQhHyL1tP624sfgLfXcgYjS90lsD2jADbaM8lxU0aXKA0Zref 3W3/jrTumopRVEelLE+2v/kNfm6NJddI5ziVVbke1/zlvLUQCts8c2x3Bxg5jHvrbdiP P/Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=dNKgnT31MpbL5y1Ktyw40QH3EYJIW6F8B5Qujk/z2jo=; b=TtatXr7cMcpl1KucuayGi29SK6qCeNiED+dIF/G4pkW/GVm1HYMfJFg0gNWGRcPf3Y UvXS3vhRZvQJXMaZsxch61CVjQYkSjHNIvWCRD08SMe342Zlb9mRiSm+99PxAOsTIzvD x66MfSKSI/k4ElLMv6faVV2ALx4M1KvqDfQJZW6lHh8KY9tQ8CPqEjxw2zweet1LcwOZ MNmv81ER9TNbmU3+KJD0x2ZpylnrjLWlR9KRUERAbkAeav9OMq0xGMmAj0e7XPV2kDmJ sS8wMOuRIHSD9HNCEXC64KGNneYgSlRORKwqX7N8nxWQYxl1u76IbCqyMGb+mgjPVf7l UBvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dtX/Dixr; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1-v6si30508755pld.3.2018.05.28.10.51.54; Mon, 28 May 2018 10:51:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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=@linaro.org header.s=google header.b=dtX/Dixr; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755607AbeE1Rvv (ORCPT + 9 others); Mon, 28 May 2018 13:51:51 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:51486 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754631AbeE1Rvs (ORCPT ); Mon, 28 May 2018 13:51:48 -0400 Received: by mail-wm0-f67.google.com with SMTP id r15-v6so6406239wmc.1 for ; Mon, 28 May 2018 10:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dNKgnT31MpbL5y1Ktyw40QH3EYJIW6F8B5Qujk/z2jo=; b=dtX/DixrL1gcWct1Z1B6FuiU+fmSG8F6HToqDqP6b9LFfU9xlX3f3+/rVE+E7a7UsC 9/rHopQMdBsgbLZEf85UlTuLVGCJaSV+2M8f0lb0fK8Wa6AsrGWHgC0/23v7U9/wv3Dm j22H3UXZ5ZNtAmiBm02ypQgVThaSoOHigyPuw= 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:in-reply-to :references; bh=dNKgnT31MpbL5y1Ktyw40QH3EYJIW6F8B5Qujk/z2jo=; b=Mgpe1s6BUcmGkn6WxitK5f8oVgMAAaIh9v9aKtG9LsP1v1VoX7bzx00K4qo2QB3xOK ulCnI8aYZAfQf50xIYm6gp1+d5KBJ/zNp6Wkl93DN/7bvNcrzr5jVy5s3EontcuihJc/ WfDnh2KFKrgJEC9M4bVsjXokGkBqKX1jF9gqEBcIfn51TGCHBTAkvkEiHgf7IcLUFPuq bEjaBbRNCYwD+StqdefaQ6DZGveVsKEG9h2lbkxkvHpkOIF0rIkLuQsCyMuQCMJ6PKZb DrnsMBLT2wJv8R1t4M6jFntbPUiqFofz4/zqXiLQNUAYVSv079Lb2QSFeFdWN3YzgfTm WChw== X-Gm-Message-State: ALKqPwdJP9NXnrVHDAinCjpa+s3nU3H+zEwwSbQWTsUFB/undKGqz65v JDDAIQd0z9Zg/o0L1aPzTae7sgbXc+A= X-Received: by 2002:a2e:1b52:: with SMTP id b79-v6mr8896209ljb.134.1527529906776; Mon, 28 May 2018 10:51:46 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id p76-v6sm6913861lfp.44.2018.05.28.10.51.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 May 2018 10:51:45 -0700 (PDT) From: Linus Walleij To: Andrew Lunn , Vivien Didelot , Florian Fainelli Cc: netdev@vger.kernel.org, openwrt-devel@lists.openwrt.org, LEDE Development List , Linus Walleij Subject: [PATCH 4/4 RFCv2] ARM: dts: Add ethernet and switch to D-Link DIR-685 Date: Mon, 28 May 2018 19:47:52 +0200 Message-Id: <20180528174752.6806-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528174752.6806-1-linus.walleij@linaro.org> References: <20180528174752.6806-1-linus.walleij@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This adds the Ethernet and Realtek switch device to the D-Link DIR-685 Gemini-based device. Signed-off-by: Linus Walleij --- ChangeLog RFCv1->RFCv2 - Rebased, use the new DT bindings --- arch/arm/boot/dts/gemini-dlink-dir-685.dts | 153 ++++++++++++++++++++- 1 file changed, 152 insertions(+), 1 deletion(-) -- 2.17.0 diff --git a/arch/arm/boot/dts/gemini-dlink-dir-685.dts b/arch/arm/boot/dts/gemini-dlink-dir-685.dts index fb5c954ab95a..ccbe03c05c2a 100644 --- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts +++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts @@ -156,6 +156,100 @@ }; }; + /* This is a RealTek RTL8366RB switch and PHY using SMI over GPIO */ + switch { + compatible = "realtek,rtl8366rb"; + /* 22 = MDIO (has input reads), 21 = MDC (clock, output only) */ + mdc-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; + mdio-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + realtek,disable-leds; + + switch_intc: interrupt-controller { + /* GPIO 15 provides the interrupt */ + interrupt-parent = <&gpio0>; + interrupts = <15 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan0"; + phy-handle = <&phy0>; + }; + port@1 { + reg = <1>; + label = "lan1"; + phy-handle = <&phy1>; + }; + port@2 { + reg = <2>; + label = "lan2"; + phy-handle = <&phy2>; + }; + port@3 { + reg = <3>; + label = "lan3"; + phy-handle = <&phy3>; + }; + port@4 { + reg = <4>; + label = "wan"; + phy-handle = <&phy4>; + }; + rtl8366rb_cpu_port: port@5 { + reg = <5>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "rgmii"; + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; + }; + + }; + + mdio { + compatible = "realtek,smi-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + phy0: phy@0 { + reg = <0>; + interrupt-parent = <&switch_intc>; + interrupts = <0>; + }; + phy1: phy@1 { + reg = <1>; + interrupt-parent = <&switch_intc>; + interrupts = <1>; + }; + phy2: phy@2 { + reg = <2>; + interrupt-parent = <&switch_intc>; + interrupts = <2>; + }; + phy3: phy@3 { + reg = <3>; + interrupt-parent = <&switch_intc>; + interrupts = <3>; + }; + phy4: phy@4 { + reg = <4>; + interrupt-parent = <&switch_intc>; + interrupts = <12>; + }; + }; + }; + soc { flash@30000000 { /* @@ -223,10 +317,12 @@ * gpio0bgrp cover line 7 used by WPS LED * gpio0cgrp cover line 8, 13 used by keys * and 11, 12 used by the HD LEDs + * and line 14, 15 used by RTL8366 + * RESET and phy ready * gpio0egrp cover line 16 used by VDISP * gpio0fgrp cover line 17 used by TK IRQ * gpio0ggrp cover line 20 used by panel CS - * gpio0hgrp cover line 21,22 used by RTL8366RB + * gpio0hgrp cover line 21,22 used by RTL8366RB MDIO */ gpio0_default_pins: pinctrl-gpio0 { mux { @@ -250,6 +346,49 @@ groups = "gpio1bgrp"; }; }; + pinctrl-gmii { + mux { + function = "gmii"; + groups = "gmii_gmac0_grp"; + }; + conf0 { + pins = "V8 GMAC0 RXDV", "T10 GMAC1 RXDV"; + skew-delay = <0>; + }; + conf1 { + pins = "Y7 GMAC0 RXC", "Y11 GMAC1 RXC"; + skew-delay = <15>; + }; + conf2 { + pins = "T8 GMAC0 TXEN", "W11 GMAC1 TXEN"; + skew-delay = <7>; + }; + conf3 { + pins = "U8 GMAC0 TXC"; + skew-delay = <11>; + }; + conf4 { + pins = "V11 GMAC1 TXC"; + skew-delay = <10>; + }; + conf5 { + /* The data lines all have default skew */ + pins = "W8 GMAC0 RXD0", "V9 GMAC0 RXD1", + "Y8 GMAC0 RXD2", "U9 GMAC0 RXD3", + "T7 GMAC0 TXD0", "U6 GMAC0 TXD1", + "V7 GMAC0 TXD2", "U7 GMAC0 TXD3", + "Y12 GMAC1 RXD0", "V12 GMAC1 RXD1", + "T11 GMAC1 RXD2", "W12 GMAC1 RXD3", + "U10 GMAC1 TXD0", "Y10 GMAC1 TXD1", + "W10 GMAC1 TXD2", "T9 GMAC1 TXD3"; + skew-delay = <7>; + }; + /* Set up drive strength on GMAC0 to 16 mA */ + conf6 { + groups = "gmii_gmac0_grp"; + drive-strength = <16>; + }; + }; }; }; @@ -291,6 +430,18 @@ <0x6000 0 0 4 &pci_intc 2>; }; + ethernet@60000000 { + status = "okay"; + + ethernet-port@0 { + phy-mode = "rgmii"; + phy-handle = <&rtl8366rb_cpu_port>; + }; + ethernet-port@1 { + /* Not used in this platform */ + }; + }; + ata@63000000 { status = "okay"; };