From patchwork Wed Nov 4 16:47:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1394274 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=sTuaaIo1; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRCL74m5hz9sVK for ; Thu, 5 Nov 2020 03:49:35 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=avquWsDAQ9NueTkUoffPJgid3wFFVa0J9CSkB5DE4os=; b=sTuaaIo1M6H649k3MKLYAoCEF 8871l5KZ+4v4tJHpT1jlhLHLArOvR9YIJGd38se0PYR0LNyH2k4xpKCjZz38xaZYaGhteawFoU/eC RX5nnaZ8KFYwLNmB5ckGkkxpuEssKW5sl1sncPsNbvPp5Mi6lgGcabV1TMXThpD1CPC/uu+0YSFqr NGBfw6+chKpa4k0BV1BgEvp2YMfc7/XSVHZmymPv8V4rrd4C6MiXLZj+bR0XUcHAzVet0rRGGtJEg MWxj9cXSDxxOz+nQYuZMczDLkz++iSTnIr8q4bs8GSJqVf3be/jtEia5dce9LUx9bRZtINrFz9Yrb UaG4iGOSA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwh-0007D0-Bi; Wed, 04 Nov 2020 16:47:39 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwc-0007AD-55 for openwrt-devel@lists.openwrt.org; Wed, 04 Nov 2020 16:47:35 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 98416189E0; Wed, 4 Nov 2020 17:47:31 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 73e2633a; Wed, 4 Nov 2020 17:47:13 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2 1/6] rtl838x: clean whitespace issues in rtl8382_d-link_dgs-1210-16.dts Date: Wed, 4 Nov 2020 17:47:20 +0100 Message-Id: <20201104164725.4549-2-ynezz@true.cz> In-Reply-To: <20201104164725.4549-1-ynezz@true.cz> References: <20201104164725.4549-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_114734_378434_7B49BE51 X-CRM114-Status: GOOD ( 15.86 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org So it's tidy. Signed-off-by: Petr Štetiar --- target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts index 2d7abc00db1b..3fb3cfb35346 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts @@ -12,7 +12,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - }; + }; chosen { bootargs = "console=ttyS0,115200"; @@ -90,7 +90,7 @@ regmap = <ðernet0>; #address-cells = <1>; #size-cells = <0>; - + /* External phy RTL8218B */ phy0: ethernet-phy@0 { reg = <0>; @@ -166,7 +166,7 @@ compatible = "ethernet-phy-ieee802.3-c22"; phy-is-integrated; }; - + /* External phy: RTL8214FC */ phy24: ethernet-phy@24 { compatible = "ethernet-phy-ieee802.3-c22"; @@ -248,7 +248,6 @@ phy-handle = <&phy7>; phy-mode = "qsgmii"; }; - port@8 { reg = <8>; label = "lan9"; From patchwork Wed Nov 4 16:47:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1394275 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=uyqLKyK3; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRCL75f4Yz9sVM for ; Thu, 5 Nov 2020 03:49:35 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=D6vKRkStdmYOy+5jvg8XGDHecHWqzNtpKFi+XiHv87E=; b=uyqLKyK3g0dwPLOhUyO2opgkU xUZm5NtreiOdHCACHbpEBn6DkfEWYMwbZoZZb3NPFyJxJotW+mmDVj+iKnYc+dGFlRUDvSbjzN88w wR0iL2WwGraZKxWFbTt3uk4hDwCj4Yib1jI2waYAlr/HLUPdZjTyF5o5lctHhP7jHm7XKnKOSmfxp uwAhT8rnGUY8WZuNkGZGeVe3wMm/9UKZKc7FukhuyR9DgNPA6oAh3DI4Cz9GhSPKFS05jhLl/+BfJ 6U8mlK6+FrtSVrhqpPtLUy8zRItomEmV+aJWxMhEzhl443swO8viNPEeYhaq9t8qzbecvyI5GjqLo VUaUM56Ng==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwn-0007EW-7n; Wed, 04 Nov 2020 16:47:45 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwc-0007AF-58 for openwrt-devel@lists.openwrt.org; Wed, 04 Nov 2020 16:47:37 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id B5C0B189E1; Wed, 4 Nov 2020 17:47:31 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 8941a49f; Wed, 4 Nov 2020 17:47:14 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2 2/6] rtl838x: d-link_dgs-1210: refactor common family bits Date: Wed, 4 Nov 2020 17:47:21 +0100 Message-Id: <20201104164725.4549-3-ynezz@true.cz> In-Reply-To: <20201104164725.4549-1-ynezz@true.cz> References: <20201104164725.4549-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_114734_587352_D74634F5 X-CRM114-Status: GOOD ( 21.34 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org So the common bits can be easily shared with other boards in the family and while at it add missing SPDX license identifiers into the DTS files and fixed alphabetic sorting of the devices in the images. Signed-off-by: Petr Štetiar --- .../dts/rtl8382_d-link_dgs-1210-10p.dts | 2 + .../dts/rtl8382_d-link_dgs-1210-16.dts | 81 +----------------- .../rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi | 84 +++++++++++++++++++ target/linux/rtl838x/image/Makefile | 16 ++-- 4 files changed, 97 insertions(+), 86 deletions(-) create mode 100644 target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts index d7c6cbfc7c41..89e3746ad5af 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + #include "rtl838x.dtsi" #include diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts index 3fb3cfb35346..3843af1371a7 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts @@ -1,87 +1,10 @@ -#include "rtl838x.dtsi" +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include -#include +#include "rtl8382_d-link_dgs-1210.dtsi" / { compatible = "d-link,dgs-1210-16", "realtek,rtl838x-soc"; model = "D-Link DGS-1210-16"; - - aliases { - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyS0,115200"; - }; - - leds { - compatible = "gpio-leds"; - - led_power: power { - label = "green:power"; - gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&gpio0 { - indirect-access-bus-id = <0>; -}; - -&spi0 { - status = "okay"; - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x00000000 0x80000>; - read-only; - }; - partition@80000 { - label = "u-boot-env"; - reg = <0x00080000 0x40000>; - read-only; - }; - partition@c0000 { - label = "u-boot-env2"; - reg = <0x000c0000 0x40000>; - read-only; - }; - partition@280000 { - label = "firmware"; - compatible = "denx,uimage"; - reg = <0x00100000 0xd80000>; - }; - partition@be80000 { - label = "kernel2"; - reg = <0x00e80000 0x180000>; - }; - partition@1000000 { - label = "sysinfo"; - reg = <0x01000000 0x40000>; - }; - partition@1040000 { - label = "rootfs2"; - reg = <0x01040000 0xc00000>; - }; - partition@1c40000 { - label = "jffs2"; - reg = <0x01c40000 0x3c0000>; - }; - }; - }; }; ðernet0 { diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi new file mode 100644 index 000000000000..74043c097af8 --- /dev/null +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl838x.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio0 { + indirect-access-bus-id = <0>; +}; + +&spi0 { + status = "okay"; + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x00000000 0x80000>; + read-only; + }; + partition@80000 { + label = "u-boot-env"; + reg = <0x00080000 0x40000>; + read-only; + }; + partition@c0000 { + label = "u-boot-env2"; + reg = <0x000c0000 0x40000>; + read-only; + }; + partition@280000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x00100000 0xd80000>; + }; + partition@be80000 { + label = "kernel2"; + reg = <0x00e80000 0x180000>; + }; + partition@1000000 { + label = "sysinfo"; + reg = <0x01000000 0x40000>; + }; + partition@1040000 { + label = "rootfs2"; + reg = <0x01040000 0xc00000>; + }; + partition@1c40000 { + label = "jffs2"; + reg = <0x01c40000 0x3c0000>; + }; + }; + }; +}; diff --git a/target/linux/rtl838x/image/Makefile b/target/linux/rtl838x/image/Makefile index f490fa7ffe92..cd384c534522 100644 --- a/target/linux/rtl838x/image/Makefile +++ b/target/linux/rtl838x/image/Makefile @@ -41,22 +41,24 @@ define Device/allnet_all-sg8208m endef TARGET_DEVICES += allnet_all-sg8208m -define Device/d-link_dgs-1210-16 +define Device/d-link_dgs-1210 SOC := rtl8382 IMAGE_SIZE := 13824k DEVICE_VENDOR := D-Link - DEVICE_MODEL := DGS-1210-16 DEVICE_PACKAGES := ip-full ip-bridge ethtool tc endef -TARGET_DEVICES += d-link_dgs-1210-16 define Device/d-link_dgs-1210-10p - SOC := rtl8382 - IMAGE_SIZE := 13824k - DEVICE_VENDOR := D-Link + $(Device/d-link_dgs-1210) DEVICE_MODEL := DGS-1210-10P - DEVICE_PACKAGES := ip-full ip-bridge ethtool tc lua-rs232 + DEVICE_PACKAGES += lua-rs232 endef TARGET_DEVICES += d-link_dgs-1210-10p +define Device/d-link_dgs-1210-16 + $(Device/d-link_dgs-1210) + DEVICE_MODEL := DGS-1210-16 +endef +TARGET_DEVICES += d-link_dgs-1210-16 + $(eval $(call BuildImage)) From patchwork Wed Nov 4 16:47:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1394277 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=LOJTbh6B; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRCLB6lxNz9sRR for ; Thu, 5 Nov 2020 03:49:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lLCDHkoVUdYqx2WiAfp8n40tKUPsthpZ5FLJNoCJ9Ko=; b=LOJTbh6BhSC2ZsecJb8vbwiVG 0hxqVkdX5tpLkxWEn5EvZvVPxR/SGdxssKbcAiLiWnWu7VTKneh4FOveQ5Iw5vVypUX1qUEj6/1iN 5FgST4JBcGADcZsUBun8rIcOpOYsA4WKHr2QJwYSh6k7YihcodrIfvU/EjtBe5F1T1avryQ4rCVgs zQ5Ve2jSLt+U1ly9MfXoWC1K+thAA+0B4aQXCqwfq2IcuX3S0fhhssXsAybC6MdzkPDmX/gaCHl/M Cd9IaayeBVmT+KTCAoXCMeyODENZSyZEwYu802w7ADGCixQS+uvIa8GEZf2LcP6rdfQsHeQvW0sYE PZhl/9JJw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwp-0007Ew-1C; Wed, 04 Nov 2020 16:47:47 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwc-0007AG-59 for openwrt-devel@lists.openwrt.org; Wed, 04 Nov 2020 16:47:37 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id D35EE189E2; Wed, 4 Nov 2020 17:47:31 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 288ee3de; Wed, 4 Nov 2020 17:47:14 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2 3/6] rtl838x: add support for D-Link DGS-1210-28 Date: Wed, 4 Nov 2020 17:47:22 +0100 Message-Id: <20201104164725.4549-4-ynezz@true.cz> In-Reply-To: <20201104164725.4549-1-ynezz@true.cz> References: <20201104164725.4549-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_114734_591941_09A6D6F5 X-CRM114-Status: GOOD ( 21.71 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Hardware specification ---------------------- * RTL8382M SoC, 1 MIPS 4KEc core @ 500MHz * 128MB DRAM * 32MB NOR Flash (MX25L25635E) * 24 x 10/100/1000BASE-T ports - Internal PHY with 8 ports (RTL8218B) - Two external PHYs with 8 ports each (RTL8218B) * 4 x Gigabit RJ45/SFP Combo ports - External PHY with 4 SFP ports (RTL8214FC) * Power LED * Reset button on front panel * UART (115200 8N1) via unpopulated standard 0.1" pin header marked J6 UART pinout ----------- [oooo]J3 [o]ooo|J6 | ^ ||`------ GND | | |`------- RX | | `-------- TX | `---------- Vcc (3V3) | `------------------ J3 is power input connector nearby J6 UART Boot initramfs image from U-Boot -------------------------------- 1. Press Escape key during `Hit Esc key to stop autoboot` prompt 2. Press CTRL+C keys to get into real U-Boot prompt 3. Init network with `rtk network on` command 4. Load image with `tftpboot 0x8f000000 openwrt-rtl838x-generic-d-link_dgs-1210-16-initramfs-kernel.bin` command 5. Boot the image with `bootm` command To install, upload the sysupgrade image to the OEM webpage or sysupgrade from the system running from initramfs image. It has been developed and tested on device with F1 revision. Signed-off-by: Petr Štetiar --- .../dts/rtl8382_d-link_dgs-1210-28.dts | 339 ++++++++++++++++++ target/linux/rtl838x/image/Makefile | 5 + 2 files changed, 344 insertions(+) create mode 100644 target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts new file mode 100644 index 000000000000..f154ca963d1c --- /dev/null +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts @@ -0,0 +1,339 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl8382_d-link_dgs-1210.dtsi" + +/ { + compatible = "d-link,dgs-1210-28", "realtek,rtl838x-soc"; + model = "D-Link DGS-1210-28"; +}; + +ðernet0 { + mdio: mdio-bus { + compatible = "realtek,rtl838x-mdio"; + regmap = <ðernet0>; + #address-cells = <1>; + #size-cells = <0>; + + /* External phy RTL8218B */ + phy0: ethernet-phy@0 { + reg = <0>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy1: ethernet-phy@1 { + reg = <1>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy2: ethernet-phy@2 { + reg = <2>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy3: ethernet-phy@3 { + reg = <3>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy4: ethernet-phy@4 { + reg = <4>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy5: ethernet-phy@5 { + reg = <5>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy6: ethernet-phy@6 { + reg = <6>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy7: ethernet-phy@7 { + reg = <7>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + + /* Internal phy RTL8218B */ + phy8: ethernet-phy@8 { + reg = <8>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy9: ethernet-phy@9 { + reg = <9>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy10: ethernet-phy@10 { + reg = <10>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy11: ethernet-phy@11 { + reg = <11>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy12: ethernet-phy@12 { + reg = <12>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy13: ethernet-phy@13 { + reg = <13>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy14: ethernet-phy@14 { + reg = <14>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy15: ethernet-phy@15 { + reg = <15>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + + /* External phy RTL8218B */ + phy16: ethernet-phy@16 { + reg = <16>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy17: ethernet-phy@17 { + reg = <17>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy18: ethernet-phy@18 { + reg = <18>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy19: ethernet-phy@19 { + reg = <19>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy20: ethernet-phy@20 { + reg = <20>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy21: ethernet-phy@21 { + reg = <21>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy22: ethernet-phy@22 { + reg = <22>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy23: ethernet-phy@23 { + reg = <23>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + + /* External phy: RTL8214FC */ + phy24: ethernet-phy@24 { + compatible = "ethernet-phy-ieee802.3-c22"; + sfp; + media = "fibre"; + reg = <24>; + }; + phy25: ethernet-phy@25 { + compatible = "ethernet-phy-ieee802.3-c22"; + sfp; + media = "fibre"; + reg = <25>; + }; + phy26: ethernet-phy@26 { + compatible = "ethernet-phy-ieee802.3-c22"; + sfp; + media = "fibre"; + reg = <26>; + }; + phy27: ethernet-phy@27 { + compatible = "ethernet-phy-ieee802.3-c22"; + sfp; + media = "fibre"; + reg = <27>; + }; + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + phy-handle = <&phy0>; + phy-mode = "qsgmii"; + }; + port@1 { + reg = <1>; + label = "lan2"; + phy-handle = <&phy1>; + phy-mode = "qsgmii"; + }; + port@2 { + reg = <2>; + label = "lan3"; + phy-handle = <&phy2>; + phy-mode = "qsgmii"; + }; + port@3 { + reg = <3>; + label = "lan4"; + phy-handle = <&phy3>; + phy-mode = "qsgmii"; + }; + port@4 { + reg = <4>; + label = "lan5"; + phy-handle = <&phy4>; + phy-mode = "qsgmii"; + }; + port@5 { + reg = <5>; + label = "lan6"; + phy-handle = <&phy5>; + phy-mode = "qsgmii"; + }; + port@6 { + reg = <6>; + label = "lan7"; + phy-handle = <&phy6>; + phy-mode = "qsgmii"; + }; + port@7 { + reg = <7>; + label = "lan8"; + phy-handle = <&phy7>; + phy-mode = "qsgmii"; + }; + port@8 { + reg = <8>; + label = "lan9"; + phy-handle = <&phy8>; + phy-mode = "internal"; + }; + port@9 { + reg = <9>; + label = "lan10"; + phy-handle = <&phy9>; + phy-mode = "internal"; + }; + port@10 { + reg = <10>; + label = "lan11"; + phy-handle = <&phy10>; + phy-mode = "internal"; + }; + port@11 { + reg = <11>; + label = "lan12"; + phy-handle = <&phy11>; + phy-mode = "internal"; + }; + port@12 { + reg = <12>; + label = "lan13"; + phy-handle = <&phy12>; + phy-mode = "internal"; + }; + port@13 { + reg = <13>; + label = "lan14"; + phy-handle = <&phy13>; + phy-mode = "internal"; + }; + port@14 { + reg = <14>; + label = "lan15"; + phy-handle = <&phy14>; + phy-mode = "internal"; + }; + port@15 { + reg = <15>; + label = "lan16"; + phy-handle = <&phy15>; + phy-mode = "internal"; + }; + port@16 { + reg = <16>; + label = "lan17"; + phy-handle = <&phy16>; + phy-mode = "qsgmii"; + }; + port@17 { + reg = <17>; + label = "lan18"; + phy-handle = <&phy17>; + phy-mode = "qsgmii"; + }; + port@18 { + reg = <18>; + label = "lan19"; + phy-handle = <&phy18>; + phy-mode = "qsgmii"; + }; + port@19 { + reg = <19>; + label = "lan20"; + phy-handle = <&phy19>; + phy-mode = "qsgmii"; + }; + port@20 { + reg = <20>; + label = "lan21"; + phy-handle = <&phy20>; + phy-mode = "qsgmii"; + }; + port@21 { + reg = <21>; + label = "lan22"; + phy-handle = <&phy21>; + phy-mode = "qsgmii"; + }; + port@22 { + reg = <22>; + label = "lan23"; + phy-handle = <&phy22>; + phy-mode = "qsgmii"; + }; + port@23 { + reg = <23>; + label = "lan24"; + phy-handle = <&phy23>; + phy-mode = "qsgmii"; + }; + + port@24 { + reg = <24>; + label = "lan25"; + phy-handle = <&phy24>; + phy-mode = "qsgmii"; + }; + port@25 { + reg = <25>; + label = "lan26"; + phy-handle = <&phy25>; + phy-mode = "qsgmii"; + }; + port@26 { + reg = <26>; + label = "lan27"; + phy-handle = <&phy26>; + phy-mode = "qsgmii"; + }; + port@27 { + reg = <27>; + label = "lan28"; + phy-handle = <&phy27>; + phy-mode = "qsgmii"; + }; + port@28 { + ethernet = <ðernet0>; + reg = <28>; + phy-mode = "internal"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/target/linux/rtl838x/image/Makefile b/target/linux/rtl838x/image/Makefile index cd384c534522..51acd41c7621 100644 --- a/target/linux/rtl838x/image/Makefile +++ b/target/linux/rtl838x/image/Makefile @@ -61,4 +61,9 @@ define Device/d-link_dgs-1210-16 endef TARGET_DEVICES += d-link_dgs-1210-16 +define Device/d-link_dgs-1210-28 + $(Device/d-link_dgs-1210) + DEVICE_MODEL := DGS-1210-28 +endef +TARGET_DEVICES += d-link_dgs-1210-28 $(eval $(call BuildImage)) From patchwork Wed Nov 4 16:47:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1394273 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=lxXlNOh2; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRCL96Y5Mz9sVN for ; Thu, 5 Nov 2020 03:49:37 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2++UAMfxtIcRrvgNgDIP0VYkVIw4RjYKyLzuUTnPo38=; b=lxXlNOh2prge9y02f1ossekMb TrTu1ScOMqEttBELHad6HEbM9pvyD0ZaFckOexjT7ztAkaX1KGCowNrAQ3JhUWDDACuFrvAHZLx4I 77VltZMCyBWWDnbmQEav/2FyaLCwzOijbaaqRh6cEt71k706yxBdh2rM+0cbBZkOUTJ4v0+ZAuS3s dxoezJVNcs5wLTzqyH7nJ023F1Igip0VAa3+K81QE8Rd6giIYwWqvJfJitOH8FZtbChm7AMi4wziJ 7p47cvdYtfLKOdepQN/fr3flliCaUt4ttFnDD/Mc75TGyCVnHGVyvqquoA3iq3gbbnoNzE+xvA8vp itD3FlnBA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwi-0007Dg-I3; Wed, 04 Nov 2020 16:47:40 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwc-0007AH-59 for openwrt-devel@lists.openwrt.org; Wed, 04 Nov 2020 16:47:35 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 1541E189E3; Wed, 4 Nov 2020 17:47:32 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 00a3c6ce; Wed, 4 Nov 2020 17:47:14 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2 4/6] rtl838x: rtl838x.dtsi: remove reg property from root node Date: Wed, 4 Nov 2020 17:47:23 +0100 Message-Id: <20201104164725.4549-5-ynezz@true.cz> In-Reply-To: <20201104164725.4549-1-ynezz@true.cz> References: <20201104164725.4549-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_114734_529612_F6C224C9 X-CRM114-Status: GOOD ( 16.12 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Fixes following dtc warning: ../dts/rtl838x.dtsi:38.3-145.3: Warning (reg_format): /: Root node has a "reg" property Signed-off-by: Petr Štetiar --- target/linux/rtl838x/dts/rtl838x.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/rtl838x/dts/rtl838x.dtsi b/target/linux/rtl838x/dts/rtl838x.dtsi index 5d562063ea7f..699a621f62fb 100644 --- a/target/linux/rtl838x/dts/rtl838x.dtsi +++ b/target/linux/rtl838x/dts/rtl838x.dtsi @@ -7,7 +7,6 @@ #size-cells = <1>; compatible = "realtek,rtl838x-soc"; - reg = <0xbb000000 0xa000>; cpus { #address-cells = <1>; From patchwork Wed Nov 4 16:47:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1394276 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=zKmhm2J0; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRCL744B5z9sT6 for ; Thu, 5 Nov 2020 03:49:34 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cR7/x2GjHh7/cM1WLXm7LGPucSyFCx9NH2Xh5Tcp4PA=; b=zKmhm2J0yc+L7TjWXxXbVdfwR lkST1PnL1eSxwHjIVky4yfG4t8JCfGe56El+hgXOyz7UOZkagGqAj7wbINWhY3vCr/rH+T1PkHXiF dvEpV0G28DdIz66vTMi2mGXPT0aL1heeni8BAmsvXmE2mEhZWUDvKo+3x7KDajDg8YnDp9vM83Y2T mJbUWL/BUvJ1VFaRQ2wStsMC5AfSaXmDL+6+Cnh1e0OCQqhyOhiBoEZVlAFGqegRGhqkeOL8aIaed Yy1vJWil8VEnqPU36UMRkHc5BZZ8JYrGU2boRuLdnkAnCY/ktZ3OmSPAz6tuNYpHCTqXFn4NP6S3O b6YkmD7eg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwq-0007FB-Av; Wed, 04 Nov 2020 16:47:48 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwe-0007C8-Bh for openwrt-devel@lists.openwrt.org; Wed, 04 Nov 2020 16:47:37 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 4B9D5189E4; Wed, 4 Nov 2020 17:47:32 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id dd8a4876; Wed, 4 Nov 2020 17:47:15 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2 5/6] rtl838x: rtl838x.dtsi: fix missing interrupt-parent for uart0 Date: Wed, 4 Nov 2020 17:47:24 +0100 Message-Id: <20201104164725.4549-6-ynezz@true.cz> In-Reply-To: <20201104164725.4549-1-ynezz@true.cz> References: <20201104164725.4549-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_114736_570294_13B0B4F1 X-CRM114-Status: GOOD ( 15.95 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Fixes following dtc warning: Warning (interrupts_property): /uart@b8002000: Missing interrupt-parent Signed-off-by: Petr Štetiar --- target/linux/rtl838x/dts/rtl838x.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/rtl838x/dts/rtl838x.dtsi b/target/linux/rtl838x/dts/rtl838x.dtsi index 699a621f62fb..99c324bf52d2 100644 --- a/target/linux/rtl838x/dts/rtl838x.dtsi +++ b/target/linux/rtl838x/dts/rtl838x.dtsi @@ -53,6 +53,8 @@ reg = <0xb8002000 0x100>; clock-frequency = <200000000>; + + interrupt-parent = <&cpuintc>; interrupts = <31>; reg-io-width = <1>; From patchwork Wed Nov 4 16:47:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1394278 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=3b0ioPVd; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRCLC6Fdzz9sVS for ; Thu, 5 Nov 2020 03:49:39 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ii8OK5BC6K534Q1oWMqtVuSL8vvNo9uRY3vTo5H0BVQ=; b=3b0ioPVdQex8oAWpuU34wqGxU pxoVTG4D0irDRsk9MitqaJZoT3v3o904417kh2/XrcJAky6/kCpmsFIJvU3fsZxh12anpalu9UnPr r+0rSb2q6uUvvSZ4+dTFmXjc564RvxySnQifFFMDoZZOVXuViNEwoynS4AmTveaCKu50G8SfuWh3x N/M8SiUKkzAOpA7piIaRLM78pemA8D5jOKY0ysaj3/yFmGf2rCx6NZ6m+pGopmOy9fKoslMFSRwB2 Ab+tY3LKa8VhAU14W+CU+XPRphqgC9BTTIkkpj54BgTrxh55ixDgRSjqMkDBHNzDrT6JWTW0ma51I YQ8xiu5dQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwt-0007Fx-3n; Wed, 04 Nov 2020 16:47:51 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLwe-0007C7-BN for openwrt-devel@lists.openwrt.org; Wed, 04 Nov 2020 16:47:38 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 86049189E5; Wed, 4 Nov 2020 17:47:33 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 35e960c1; Wed, 4 Nov 2020 17:47:15 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2 6/6] rtl838x: dts: use macros for phy and switch definitions Date: Wed, 4 Nov 2020 17:47:25 +0100 Message-Id: <20201104164725.4549-7-ynezz@true.cz> In-Reply-To: <20201104164725.4549-1-ynezz@true.cz> References: <20201104164725.4549-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_114736_697738_5242DB46 X-CRM114-Status: GOOD ( 16.37 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org It's quite more readable, saves some tedious copy&pasting, more error prone etc. Signed-off-by: Petr Štetiar --- .../dts/rtl8382_allnet_all-sg8208m.dts | 111 +----- .../dts/rtl8382_d-link_dgs-1210-10p.dts | 125 +----- .../dts/rtl8382_d-link_dgs-1210-16.dts | 261 ++----------- .../dts/rtl8382_d-link_dgs-1210-28.dts | 359 +++--------------- target/linux/rtl838x/dts/rtl838x.dtsi | 33 ++ 5 files changed, 170 insertions(+), 719 deletions(-) diff --git a/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts b/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts index 5433b7f37286..a5dd3be0a4ab 100644 --- a/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts +++ b/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts @@ -103,46 +103,14 @@ #address-cells = <1>; #size-cells = <0>; - /* Internal phy */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) }; }; @@ -151,61 +119,14 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <8>; - label = "lan1"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - - port@1 { - reg = <9>; - label = "lan2"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - - port@2 { - reg = <10>; - label = "lan3"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - - port@3 { - reg = <11>; - label = "lan4"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - - port@4 { - reg = <12>; - label = "lan5"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - - port@5 { - reg = <13>; - label = "lan6"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - - port@6 { - reg = <14>; - label = "lan7"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - - port@7 { - reg = <15>; - label = "lan8"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; + SWITCH_PORT(8, 1, internal) + SWITCH_PORT(9, 2, internal) + SWITCH_PORT(10, 3, internal) + SWITCH_PORT(11, 4, internal) + SWITCH_PORT(12, 5, internal) + SWITCH_PORT(13, 6, internal) + SWITCH_PORT(14, 7, internal) + SWITCH_PORT(15, 8, internal) port@28 { ethernet = <ðernet0>; diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts index 89e3746ad5af..9987316c21a9 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts @@ -99,8 +99,6 @@ }; }; - - ðernet0 { mdio: mdio-bus { compatible = "realtek,rtl838x-mdio"; @@ -108,49 +106,16 @@ #address-cells = <1>; #size-cells = <0>; - /* Internal phy */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy24: ethernet-phy@24 { - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - reg = <24>; - }; - phy26: ethernet-phy@26 { - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - reg = <26>; - }; + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + INTERNAL_PHY(24) + INTERNAL_PHY(26) }; }; @@ -159,67 +124,17 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <8>; - label = "lan1"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - port@1 { - reg = <9>; - label = "lan2"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - port@2 { - reg = <10>; - label = "lan3"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - port@3 { - reg = <11>; - label = "lan4"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - port@4 { - reg = <12>; - label = "lan5"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - port@5 { - reg = <13>; - label = "lan6"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - port@6 { - reg = <14>; - label = "lan7"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - port@7 { - reg = <15>; - label = "lan8"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; + SWITCH_PORT(8, 1, internal) + SWITCH_PORT(9, 2, internal) + SWITCH_PORT(10, 3, internal) + SWITCH_PORT(11, 4, internal) + SWITCH_PORT(12, 5, internal) + SWITCH_PORT(13, 6, internal) + SWITCH_PORT(14, 7, internal) + SWITCH_PORT(15, 8, internal) + SWITCH_PORT(24, 9, internal) + SWITCH_PORT(26, 10, internal) - port@24 { - reg = <24>; - label = "lan9"; - phy-mode = "internal"; - phy-handle = <&phy24>; - }; - port@26 { - reg = <26>; - label = "lan10"; - phy-mode = "internal"; - phy-handle = <&phy26>; - }; port@28 { ethernet = <ðernet0>; reg = <28>; diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts index 3843af1371a7..ac51185ed034 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts @@ -14,107 +14,28 @@ #address-cells = <1>; #size-cells = <0>; - /* External phy RTL8218B */ - phy0: ethernet-phy@0 { - reg = <0>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy1: ethernet-phy@1 { - reg = <1>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy2: ethernet-phy@2 { - reg = <2>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy3: ethernet-phy@3 { - reg = <3>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy4: ethernet-phy@4 { - reg = <4>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy5: ethernet-phy@5 { - reg = <5>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy6: ethernet-phy@6 { - reg = <6>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy7: ethernet-phy@7 { - reg = <7>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) - /* Internal phy RTL8218B */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) - /* External phy: RTL8214FC */ - phy24: ethernet-phy@24 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <24>; - }; - phy25: ethernet-phy@25 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <25>; - }; - phy26: ethernet-phy@26 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <26>; - }; - phy27: ethernet-phy@27 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <27>; - }; + EXTERNAL_SFP_PHY(24) + EXTERNAL_SFP_PHY(25) + EXTERNAL_SFP_PHY(26) + EXTERNAL_SFP_PHY(27) }; }; @@ -123,127 +44,29 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <0>; - label = "lan1"; - phy-handle = <&phy0>; - phy-mode = "qsgmii"; - }; - port@1 { - reg = <1>; - label = "lan2"; - phy-handle = <&phy1>; - phy-mode = "qsgmii"; - }; - port@2 { - reg = <2>; - label = "lan3"; - phy-handle = <&phy2>; - phy-mode = "qsgmii"; - }; - port@3 { - reg = <3>; - label = "lan4"; - phy-handle = <&phy3>; - phy-mode = "qsgmii"; - }; - port@4 { - reg = <4>; - label = "lan5"; - phy-handle = <&phy4>; - phy-mode = "qsgmii"; - }; - port@5 { - reg = <5>; - label = "lan6"; - phy-handle = <&phy5>; - phy-mode = "qsgmii"; - }; - port@6 { - reg = <6>; - label = "lan7"; - phy-handle = <&phy6>; - phy-mode = "qsgmii"; - }; - port@7 { - reg = <7>; - label = "lan8"; - phy-handle = <&phy7>; - phy-mode = "qsgmii"; - }; - port@8 { - reg = <8>; - label = "lan9"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - port@9 { - reg = <9>; - label = "lan10"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - port@10 { - reg = <10>; - label = "lan11"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - port@11 { - reg = <11>; - label = "lan12"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - port@12 { - reg = <12>; - label = "lan13"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - port@13 { - reg = <13>; - label = "lan14"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - port@14 { - reg = <14>; - label = "lan15"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - port@15 { - reg = <15>; - label = "lan16"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, internal) + SWITCH_PORT(9, 10, internal) + SWITCH_PORT(10, 11, internal) + SWITCH_PORT(11, 12, internal) + SWITCH_PORT(12, 13, internal) + SWITCH_PORT(13, 14, internal) + SWITCH_PORT(14, 15, internal) + SWITCH_PORT(15, 16, internal) + + SWITCH_PORT(24, 17, qsgmii) + SWITCH_PORT(25, 18, qsgmii) + SWITCH_PORT(26, 19, qsgmii) + SWITCH_PORT(27, 20, qsgmii) - port@24 { - reg = <24>; - label = "lan17"; - phy-handle = <&phy24>; - phy-mode = "qsgmii"; - }; - port@25 { - reg = <25>; - label = "lan18"; - phy-handle = <&phy25>; - phy-mode = "qsgmii"; - }; - port@26 { - reg = <26>; - label = "lan19"; - phy-handle = <&phy26>; - phy-mode = "qsgmii"; - }; - port@27 { - reg = <27>; - label = "lan20"; - phy-handle = <&phy27>; - phy-mode = "qsgmii"; - }; port@28 { ethernet = <ðernet0>; reg = <28>; diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts index f154ca963d1c..edd4fb140f6a 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts @@ -14,141 +14,37 @@ #address-cells = <1>; #size-cells = <0>; - /* External phy RTL8218B */ - phy0: ethernet-phy@0 { - reg = <0>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy1: ethernet-phy@1 { - reg = <1>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy2: ethernet-phy@2 { - reg = <2>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy3: ethernet-phy@3 { - reg = <3>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy4: ethernet-phy@4 { - reg = <4>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy5: ethernet-phy@5 { - reg = <5>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy6: ethernet-phy@6 { - reg = <6>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy7: ethernet-phy@7 { - reg = <7>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) - /* Internal phy RTL8218B */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) - /* External phy RTL8218B */ - phy16: ethernet-phy@16 { - reg = <16>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy17: ethernet-phy@17 { - reg = <17>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy18: ethernet-phy@18 { - reg = <18>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy19: ethernet-phy@19 { - reg = <19>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy20: ethernet-phy@20 { - reg = <20>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy21: ethernet-phy@21 { - reg = <21>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy22: ethernet-phy@22 { - reg = <22>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy23: ethernet-phy@23 { - reg = <23>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; + EXTERNAL_PHY(16) + EXTERNAL_PHY(17) + EXTERNAL_PHY(18) + EXTERNAL_PHY(19) + EXTERNAL_PHY(20) + EXTERNAL_PHY(21) + EXTERNAL_PHY(22) + EXTERNAL_PHY(23) - /* External phy: RTL8214FC */ - phy24: ethernet-phy@24 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <24>; - }; - phy25: ethernet-phy@25 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <25>; - }; - phy26: ethernet-phy@26 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <26>; - }; - phy27: ethernet-phy@27 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <27>; - }; + EXTERNAL_SFP_PHY(24) + EXTERNAL_SFP_PHY(25) + EXTERNAL_SFP_PHY(26) + EXTERNAL_SFP_PHY(27) }; }; @@ -157,175 +53,38 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <0>; - label = "lan1"; - phy-handle = <&phy0>; - phy-mode = "qsgmii"; - }; - port@1 { - reg = <1>; - label = "lan2"; - phy-handle = <&phy1>; - phy-mode = "qsgmii"; - }; - port@2 { - reg = <2>; - label = "lan3"; - phy-handle = <&phy2>; - phy-mode = "qsgmii"; - }; - port@3 { - reg = <3>; - label = "lan4"; - phy-handle = <&phy3>; - phy-mode = "qsgmii"; - }; - port@4 { - reg = <4>; - label = "lan5"; - phy-handle = <&phy4>; - phy-mode = "qsgmii"; - }; - port@5 { - reg = <5>; - label = "lan6"; - phy-handle = <&phy5>; - phy-mode = "qsgmii"; - }; - port@6 { - reg = <6>; - label = "lan7"; - phy-handle = <&phy6>; - phy-mode = "qsgmii"; - }; - port@7 { - reg = <7>; - label = "lan8"; - phy-handle = <&phy7>; - phy-mode = "qsgmii"; - }; - port@8 { - reg = <8>; - label = "lan9"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - port@9 { - reg = <9>; - label = "lan10"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - port@10 { - reg = <10>; - label = "lan11"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - port@11 { - reg = <11>; - label = "lan12"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - port@12 { - reg = <12>; - label = "lan13"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - port@13 { - reg = <13>; - label = "lan14"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - port@14 { - reg = <14>; - label = "lan15"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - port@15 { - reg = <15>; - label = "lan16"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; - port@16 { - reg = <16>; - label = "lan17"; - phy-handle = <&phy16>; - phy-mode = "qsgmii"; - }; - port@17 { - reg = <17>; - label = "lan18"; - phy-handle = <&phy17>; - phy-mode = "qsgmii"; - }; - port@18 { - reg = <18>; - label = "lan19"; - phy-handle = <&phy18>; - phy-mode = "qsgmii"; - }; - port@19 { - reg = <19>; - label = "lan20"; - phy-handle = <&phy19>; - phy-mode = "qsgmii"; - }; - port@20 { - reg = <20>; - label = "lan21"; - phy-handle = <&phy20>; - phy-mode = "qsgmii"; - }; - port@21 { - reg = <21>; - label = "lan22"; - phy-handle = <&phy21>; - phy-mode = "qsgmii"; - }; - port@22 { - reg = <22>; - label = "lan23"; - phy-handle = <&phy22>; - phy-mode = "qsgmii"; - }; - port@23 { - reg = <23>; - label = "lan24"; - phy-handle = <&phy23>; - phy-mode = "qsgmii"; - }; + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, internal) + SWITCH_PORT(9, 10, internal) + SWITCH_PORT(10, 11, internal) + SWITCH_PORT(11, 12, internal) + SWITCH_PORT(12, 13, internal) + SWITCH_PORT(13, 14, internal) + SWITCH_PORT(14, 15, internal) + SWITCH_PORT(15, 16, internal) + + SWITCH_PORT(16, 17, qsgmii) + SWITCH_PORT(17, 18, qsgmii) + SWITCH_PORT(18, 19, qsgmii) + SWITCH_PORT(19, 20, qsgmii) + SWITCH_PORT(20, 21, qsgmii) + SWITCH_PORT(21, 22, qsgmii) + SWITCH_PORT(22, 23, qsgmii) + SWITCH_PORT(23, 24, qsgmii) + + SWITCH_PORT(24, 25, qsgmii) + SWITCH_PORT(25, 26, qsgmii) + SWITCH_PORT(26, 27, qsgmii) + SWITCH_PORT(27, 28, qsgmii) - port@24 { - reg = <24>; - label = "lan25"; - phy-handle = <&phy24>; - phy-mode = "qsgmii"; - }; - port@25 { - reg = <25>; - label = "lan26"; - phy-handle = <&phy25>; - phy-mode = "qsgmii"; - }; - port@26 { - reg = <26>; - label = "lan27"; - phy-handle = <&phy26>; - phy-mode = "qsgmii"; - }; - port@27 { - reg = <27>; - label = "lan28"; - phy-handle = <&phy27>; - phy-mode = "qsgmii"; - }; port@28 { ethernet = <ðernet0>; reg = <28>; diff --git a/target/linux/rtl838x/dts/rtl838x.dtsi b/target/linux/rtl838x/dts/rtl838x.dtsi index 99c324bf52d2..37bbcefd441e 100644 --- a/target/linux/rtl838x/dts/rtl838x.dtsi +++ b/target/linux/rtl838x/dts/rtl838x.dtsi @@ -2,6 +2,39 @@ /dts-v1/; +#define STRINGIZE(s) #s +#define LAN_LABEL(p, s) STRINGIZE(p ## s) +#define SWITCH_PORT_LABEL(n) LAN_LABEL(lan, n) + +#define INTERNAL_PHY(n) \ + phy##n: ethernet-phy@##n { \ + reg = <##n>; \ + compatible = "ethernet-phy-ieee802.3-c22"; \ + phy-is-integrated; \ + }; + +#define EXTERNAL_PHY(n) \ + phy##n: ethernet-phy@##n { \ + reg = <##n>; \ + compatible = "ethernet-phy-ieee802.3-c22"; \ + }; + +#define EXTERNAL_SFP_PHY(n) \ + phy##n: ethernet-phy@##n { \ + compatible = "ethernet-phy-ieee802.3-c22"; \ + sfp; \ + media = "fibre"; \ + reg = <##n>; \ + }; + +#define SWITCH_PORT(n, s, m) \ + port@##n { \ + reg = <##n>; \ + label = SWITCH_PORT_LABEL(s) ; \ + phy-handle = <&phy##n>; \ + phy-mode = #m ; \ + }; + / { #address-cells = <1>; #size-cells = <1>;