From patchwork Wed Jan 6 12:57:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stijn Segers X-Patchwork-Id: 1422930 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=fail (p=none dis=none) header.from=volatilesystems.org 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=ZnLMfnpl; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=volatilesystems.org header.i=@volatilesystems.org header.a=rsa-sha256 header.s=mail header.b=ZEBK/4qU; dkim=fail reason="signature verification failed" (1024-bit key) header.d=volatilesystems.org header.i=@volatilesystems.org header.a=rsa-sha256 header.s=mail header.b=K318nGVB; 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 4D9qHj6Zgzz9sVx for ; Thu, 7 Jan 2021 00:01:21 +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: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:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=82iLNjC4LGVMg+i2u+ttNNlSDb4MeuM/us7cpwDNVoQ=; b=ZnLMfnpl5rUQGPPKm/fxezM6/N OQHsS304p/rQW7vaePaGIG6ZgMCVBd2iW6GSzA85SuidX4tZm8RO4fFk56u93N1EEiS7DCtmtN1gc hkLtgqDYRGdQmoDog9unmzLjB33q8XoHPxgdTiWayALn37RVHGqpxeNV6wFA+8vyx8mVlEim7TpUI KB/7ZU7rdJzoAe1/tDHc+in3KuboiUSHRcNGJ1iLmLoDveW+OFrsC5lP+mPL412Cc0rCZbrN4GuRI evOJASrTr0ITNTDLP7o/srHgH8ou6+tgejHF+EG3LFmK0UhpTeBEvlcdry3nZI9Y28nI8J8DKNxbe 0z9O5tBg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kx8PJ-0002og-VK; Wed, 06 Jan 2021 12:59:22 +0000 Received: from volatilesystems.org ([51.91.248.52]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kx8PC-0002nY-G8 for openwrt-devel@lists.openwrt.org; Wed, 06 Jan 2021 12:59:16 +0000 Received: by volatilesystems.org (Postfix, from userid 112) id ABC2AFA2DA; Wed, 6 Jan 2021 13:59:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=volatilesystems.org; s=mail; t=1609937953; bh=j63KaA0Z3dnKjvND+j7hAyFHtoP5uMCfX+36FO4MMWo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZEBK/4qUcV2aNqAtc9vZbjliLxLlJUKGH89waPDCfuEMQblH5X9A+MQwrtl5xYNWe /3C54C5R33rGwAK8WmzbQt3QpciFiDyxIgwqS6RRK4yUnRSfkpd/HhPRHwxy1hWASM oTiJZQZAHyizodo/TPyAaHdZNYGZzz0M2AoGZkRk= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on atalanta X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from okeanos.lan (213.219.168.47.adsl.dyn.edpnet.net [213.219.168.47]) by volatilesystems.org (Postfix) with ESMTPSA id 99EBAFA2D5 for ; Wed, 6 Jan 2021 13:59:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=volatilesystems.org; s=mail; t=1609937952; bh=j63KaA0Z3dnKjvND+j7hAyFHtoP5uMCfX+36FO4MMWo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=K318nGVBnlOIOBf4536fTiCpQcfDacTkE3iiO+ciN0LZcJSQeVL4wu6WOwdYfGoOk HBXcX7y+aBsbvdUhYLX3vrsph3K54a9KrFWa9QqkzDkSPTvpuux1JQFIoienf88kGj UqAvItnz2saCkT71So4Bcne7xiVQY8RVcZiWV+Do= From: Stijn Segers To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2 2/3] realtek: introduce common DTSI for ZyXEL GS1900-10HP and GS1900-8HP. Date: Wed, 6 Jan 2021 13:57:36 +0100 Message-Id: <20210106125736.2561-2-foss@volatilesystems.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210106125736.2561-1-foss@volatilesystems.org> References: <20210106125736.2561-1-foss@volatilesystems.org> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at atalanta X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210106_075914_735179_A4834B32 X-CRM114-Status: GOOD ( 18.20 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The ZyXEL GS1900-8HP v1, v2 and GS1900-10HP are all built on a similar Realtek RTL8380M platform. Create a common DTSI in preparation for GS1900-8HP support, and switch to the macros defined in rtl838x.dtsi. Memory node is moved out of the rtl838x.dtsi and into the device DTS as well (or series DTSI, when multiple devices belong to a single family), reflecting upstream practices. We also uppercase the vendor name like they carry it themselves (ZyXEL) and like used elsewhere in the OpenWrt tree. Signed-off-by: Stijn Segers --- .../dts/rtl8380_netgear_gs110tpp-v1.dts | 5 + .../realtek/dts/rtl8380_zyxel_gs1900-10hp.dts | 232 +----------------- .../realtek/dts/rtl8380_zyxel_gs1900.dtsi | 148 +++++++++++ .../dts/rtl8382_allnet_all-sg8208m.dts | 5 + .../realtek/dts/rtl8382_d-link_dgs-1210.dtsi | 5 + target/linux/realtek/dts/rtl838x.dtsi | 5 - target/linux/realtek/image/Makefile | 2 +- 7 files changed, 170 insertions(+), 232 deletions(-) create mode 100644 target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi diff --git a/target/linux/realtek/dts/rtl8380_netgear_gs110tpp-v1.dts b/target/linux/realtek/dts/rtl8380_netgear_gs110tpp-v1.dts index 1bf175b7bf..fe196b5e9f 100644 --- a/target/linux/realtek/dts/rtl8380_netgear_gs110tpp-v1.dts +++ b/target/linux/realtek/dts/rtl8380_netgear_gs110tpp-v1.dts @@ -10,6 +10,11 @@ compatible = "netgear,gs110tpp-v1", "realtek,rtl838x-soc"; model = "Netgear GS110TPP"; + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + chosen { bootargs = "console=ttyS0,115200"; }; diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp.dts b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp.dts index 4458acee2e..8a04505835 100644 --- a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp.dts +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp.dts @@ -1,55 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-or-later /dts-v1/; -#include "rtl838x.dtsi" - -#include -#include +#include "rtl8380_zyxel_gs1900.dtsi" / { compatible = "zyxel,gs1900-10hp", "realtek,rtl838x-soc"; - model = "Zyxel GS1900-10HP Switch"; - - aliases { - led-boot = &led_sys; - led-failsafe = &led_sys; - led-running = &led_sys; - led-upgrade = &led_sys; - }; - - chosen { - bootargs = "console=ttyS0,115200"; - }; - - gpio1: rtl8231-gpio { - status = "okay"; - - poe_enable { - gpio-hog; - gpios = <13 0>; - output-high; - }; - }; - - keys { - compatible = "gpio-keys-polled"; - poll-interval = <20>; - - reset { - label = "reset"; - gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_sys: sys { - label = "gs1900:green:sys"; - gpios = <&gpio0 47 GPIO_ACTIVE_HIGH>; - }; - }; + model = "ZyXEL GS1900-10HP Switch"; /* i2c of the left SFP cage: port 9 */ i2c0: i2c-gpio-0 { @@ -91,192 +47,16 @@ }; -&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 = <0x0 0x40000>; - read-only; - }; - partition@40000 { - label = "u-boot-env"; - reg = <0x40000 0x10000>; - read-only; - }; - partition@50000 { - label = "u-boot-env2"; - reg = <0x50000 0x10000>; - read-only; - }; - partition@60000 { - label = "jffs"; - reg = <0x60000 0x100000>; - }; - partition@160000 { - label = "jffs2"; - reg = <0x160000 0x100000>; - }; - partition@b260000 { - label = "firmware"; - reg = <0x260000 0x6d0000>; - compatible = "denx,uimage"; - }; - partition@930000 { - label = "runtime2"; - reg = <0x930000 0x6d0000>; - }; - }; - }; -}; - ðernet0 { mdio: mdio-bus { - compatible = "realtek,rtl838x-mdio"; - regmap = <ðernet0>; - #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"; - reg = <24>; - }; - phy26: ethernet-phy@26 { - compatible = "ethernet-phy-ieee802.3-c22"; - reg = <26>; - }; + INTERNAL_PHY(24) + INTERNAL_PHY(26) }; }; &switch0 { ports { - #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"; - }; - port@24 { - reg = <24>; - label = "lan9"; - phy-mode = "rgmii-id"; - phy-handle = <&phy24>; - sfp = <&sfp0>; - - fixed-link { - speed = <1000>; - full-duplex; - pause; - }; - }; - port@26 { - reg = <26>; - label = "lan10"; - phy-mode = "rgmii-id"; - phy-handle = <&phy26>; - sfp = <&sfp1>; - - fixed-link { - speed = <1000>; - full-duplex; - pause; - }; - }; - port@28 { - ethernet = <ðernet0>; - reg = <28>; - phy-mode = "internal"; - fixed-link { - speed = <1000>; - full-duplex; - }; - }; + SWITCH_SFP_PORT(24, 9, rgmii-id) + SWITCH_SFP_PORT(26, 10, rgmii-id) }; }; diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi b/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi new file mode 100644 index 0000000000..2c38c8ba21 --- /dev/null +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/dts-v1/; + +#include "rtl838x.dtsi" + +#include +#include + +/ { + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio1: rtl8231-gpio { + status = "okay"; + + poe_enable { + gpio-hog; + gpios = <13 0>; + output-high; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_sys: sys { + label = "gs1900:green:sys"; + gpios = <&gpio0 47 GPIO_ACTIVE_HIGH>; + }; + }; + +}; + +&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 = <0x0 0x40000>; + read-only; + }; + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + read-only; + }; + partition@50000 { + label = "u-boot-env2"; + reg = <0x50000 0x10000>; + read-only; + }; + partition@60000 { + label = "jffs"; + reg = <0x60000 0x100000>; + }; + partition@160000 { + label = "jffs2"; + reg = <0x160000 0x100000>; + }; + partition@b260000 { + label = "firmware"; + reg = <0x260000 0x6d0000>; + compatible = "denx,uimage"; + }; + partition@930000 { + label = "runtime2"; + reg = <0x930000 0x6d0000>; + }; + }; + }; +}; + +ðernet0 { + mdio: mdio-bus { + compatible = "realtek,rtl838x-mdio"; + regmap = <ðernet0>; + #address-cells = <1>; + #size-cells = <0>; + + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + 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>; + reg = <28>; + phy-mode = "internal"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts b/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts index a5dd3be0a4..939db72e38 100644 --- a/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts +++ b/target/linux/realtek/dts/rtl8382_allnet_all-sg8208m.dts @@ -9,6 +9,11 @@ compatible = "allnet,all-sg8208m", "realtek,rtl838x-soc"; model = "ALLNET ALL-SG8208M"; + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + aliases { led-boot = &led_sys; led-failsafe = &led_sys; diff --git a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210.dtsi b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210.dtsi index 74043c097a..480f84e3f5 100644 --- a/target/linux/realtek/dts/rtl8382_d-link_dgs-1210.dtsi +++ b/target/linux/realtek/dts/rtl8382_d-link_dgs-1210.dtsi @@ -6,6 +6,11 @@ #include / { + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + aliases { led-boot = &led_power; led-failsafe = &led_power; diff --git a/target/linux/realtek/dts/rtl838x.dtsi b/target/linux/realtek/dts/rtl838x.dtsi index 15d518578b..36d8847a15 100644 --- a/target/linux/realtek/dts/rtl838x.dtsi +++ b/target/linux/realtek/dts/rtl838x.dtsi @@ -64,11 +64,6 @@ }; }; - memory@0 { - device_type = "memory"; - reg = <0x0 0x8000000>; - }; - chosen { bootargs = "console=ttyS0,38400"; }; diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile index 85b30aae1e..765e516a0a 100644 --- a/target/linux/realtek/image/Makefile +++ b/target/linux/realtek/image/Makefile @@ -68,7 +68,7 @@ TARGET_DEVICES += netgear_gs110tpp-v1 define Device/zyxel_gs1900-10hp SOC := rtl8380 IMAGE_SIZE := 6976k - DEVICE_VENDOR := Zyxel + DEVICE_VENDOR := ZyXEL DEVICE_MODEL := GS1900-10HP endef TARGET_DEVICES += zyxel_gs1900-10hp