From patchwork Sat Jul 14 09:45:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 141955 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp391242ljj; Sat, 14 Jul 2018 02:48:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpci84O/+D93I666XurtCZCLvZcjygvQthRqUmx6XRqgXmeaicoNCZyttkz3ou/0uJSIMA+P X-Received: by 2002:a65:60d2:: with SMTP id r18-v6mr9108488pgv.306.1531561706395; Sat, 14 Jul 2018 02:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531561706; cv=none; d=google.com; s=arc-20160816; b=pHj5JS262qeSBfIu6qkbt9kx8qNxt6SjR69GhAsCmCpkMp7nmIfiXNmuzAbwswY6Yk YRs4ijEV29/lHxtkFsnp2kQbQKOaDgdiQFFooncdbrY+EPL+qrH+mvBOiuQ5XsGcVT/M 3rd3eMMKtMCBh5mzw4VBz3cHPQRe5vae2Xc9imAXPhDkD0+mdWfETXAW7s7h2cyExB1H DUkn/5UxJ8eW1uNHZNRqoJaZvubaazy4ovMnhUV3QsIbwn2Wuz8DyUGorbro09dymkcB hxREJD6/U7oHCO3EiscrtPbGJ8HTB0UrUAUVA1jhXZY/NQykW9z6VxSS2qHvIB8Levgs X2Nw== 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=NZZNX7sr9DWhvpF+2jXUTgCs+eT+3sGvjvrI/cnXY9U=; b=Z80frnPj+aoS9Z6XaxQVsF1tVy8n15pGUA432LIH5c1sPNPcuWpjuZDzF6uhUZH/V2 Ilp0Io5l1fYqwmFJK51Jt8oPrtz7t+Zd5dzNyTx00+JjAxsOqol+PJsWupTtrCfi0kdB 6DPb4OzKCDXy4MSRIOdc0ke1ha9iV6UnyQKiLHOdWXNEsCWDfX2COqukd4VPJuwrqeGg 3s83qwqeYsL2kB+nNTqJ7FVx5r935sdLXMFrsH7k2B4O0XQiadeNgVS34NDVavjLH0vB tlSvPJQJhIqaD4B19zf+1Rl/AF9LQ7bPWjqX1yQ5zTdQFomK+hI5TKfUb2WXhVXCDUcy bXXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="JsB/cu9m"; 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 x2-v6si23984365pgr.33.2018.07.14.02.48.26; Sat, 14 Jul 2018 02:48:26 -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="JsB/cu9m"; 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 S1729350AbeGNKGy (ORCPT + 10 others); Sat, 14 Jul 2018 06:06:54 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:37064 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728171AbeGNKGy (ORCPT ); Sat, 14 Jul 2018 06:06:54 -0400 Received: by mail-lj1-f193.google.com with SMTP id v9-v6so15886429ljk.4 for ; Sat, 14 Jul 2018 02:48:21 -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=NZZNX7sr9DWhvpF+2jXUTgCs+eT+3sGvjvrI/cnXY9U=; b=JsB/cu9mC9NdIg0Ns4qvvTg8OgU5kAe3VgHSV0h/uIxSdLs8QFY9rvXgRyY3cxluZh Y6veTO04a+0t48hwb+TmapPFQWlWMFAVeucn78jRufqJBf59eXIwGQ0R452cEY054Hiy hO9ut+3ZsyCdrnskrJI4dAjL19S2ngVGIptGA= 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=NZZNX7sr9DWhvpF+2jXUTgCs+eT+3sGvjvrI/cnXY9U=; b=EIutojjggIOsqOSGfW42d9z6I3fmfoYxFP5mBl3clPx5u1JGprhVf74wXu1ZlnlCqo JmCsjOELzBgEJdd00E1dbTaZ92ztBI19P8MDWw5XcksXjoZOpmnOnInZALUPCtzlyoAk /up0WmQLdW/myHTrkHTj294z8JZuGRgyAwjuD3PHaGu3lqBY0h0B1dgABsBn69Ewbsrc /xG5XPP0Je+j2rVk7aoBzsOQJWg7QBVavRfYnOdX68LsRZhPUHW3KIW68vjCSUqr0kAp kl+Cf2v3BgLvoXdspVr3pHNrfr9q7B+aLDbxna9U32ibtxZX+Kv2mZie2xxn4bEVK+Av t3Wg== X-Gm-Message-State: AOUpUlHSU/ildKqKiF07jdWVqBbGqxZIYSQmrLgT/VmKVELeppETUlCr jMcusiuOCLFgpNn5KW+9d6Cg0w== X-Received: by 2002:a2e:47c8:: with SMTP id u191-v6mr5288330lja.58.1531561700611; Sat, 14 Jul 2018 02:48:20 -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 i1-v6sm3854344ljg.43.2018.07.14.02.48.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Jul 2018 02:48:19 -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 v1] ARM: dts: Add ethernet and switch to D-Link DIR-685 Date: Sat, 14 Jul 2018 11:45:56 +0200 Message-Id: <20180714094556.30791-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180714094556.30791-1-linus.walleij@linaro.org> References: <20180714094556.30791-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 RFCv2->v1 - Use a fixed link on the ethernet port towards the router chip. ChangeLog RFCv1->RFCv2 - Rebased, use the new DT bindings --- arch/arm/boot/dts/gemini-dlink-dir-685.dts | 140 ++++++++++++++++++++- 1 file changed, 139 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/arch/arm/boot/dts/gemini-dlink-dir-685.dts b/arch/arm/boot/dts/gemini-dlink-dir-685.dts index fb5c954ab95a..6f258b50eb44 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,32 @@ groups = "gpio1bgrp"; }; }; + pinctrl-gmii { + mux { + function = "gmii"; + groups = "gmii_gmac0_grp"; + }; + conf0 { + pins = "V8 GMAC0 RXDV", "T10 GMAC1 RXDV", + "Y7 GMAC0 RXC", "Y11 GMAC1 RXC", + "T8 GMAC0 TXEN", "W11 GMAC1 TXEN", + "U8 GMAC0 TXC", "V11 GMAC1 TXC", + "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 */ + conf1 { + groups = "gmii_gmac0_grp"; + drive-strength = <16>; + }; + }; }; }; @@ -291,6 +413,22 @@ <0x6000 0 0 4 &pci_intc 2>; }; + ethernet@60000000 { + status = "okay"; + + ethernet-port@0 { + phy-mode = "rgmii"; + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; + }; + ethernet-port@1 { + /* Not used in this platform */ + }; + }; + ata@63000000 { status = "okay"; };