From patchwork Tue Oct 5 19:40:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Fertser X-Patchwork-Id: 1536904 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=DnMrNr0R; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=bl7BWpGx; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HP7LN4zQCz9sP7 for ; Wed, 6 Oct 2021 06:43:40 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cRe3t1q8R1lzQ9P8BK4xjDnwbugqr5Pk3G1rvWLWCuY=; b=DnMrNr0RGkrtsv l90uFUv3tVqAemymYGVMiG3/eKWI/v5ALdaOJgeF4b2G4DXg6Rro+H0UwV1yjvMGOZjfW6psd6qQ6 EFMez7UdITPA4JwRL3BoL+oidpSrZobMHwyaA63HSLkwAEvnGzPGRyQhu3vsN8dG36e+1H4j2w/rV mosn/Sv+bpIp9hfQGdeB5LX5y6Ye7Dab7dkx6CjALblffzT0hu9uWyjQjtx9uRF/LNvEJOpqgiMGW GG2A2POuTmVFUNMCu4HlC8AUk6Y2MZKlCp/59PzjDoEL4U2LXMxylnDJOB5g7ezuzBgh/utWwf3hz ZBY/scLc4cGyAs4ifBHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXqJw-00Bfjx-Ui; Tue, 05 Oct 2021 19:41:49 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXqJ3-00BfZu-Vo for openwrt-devel@lists.openwrt.org; Tue, 05 Oct 2021 19:40:55 +0000 Received: by mail-lf1-x130.google.com with SMTP id b20so584899lfv.3 for ; Tue, 05 Oct 2021 12:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NxZ53kuXN1Qzlnq2pOy7oHvr3Wys0XR/R5bk1ac/nQ8=; b=bl7BWpGxBuLYFa7SDwOheKUXG+wc5bNXl0uMlexEzM+vnj+INfomyz/mdMxY0TWPRq HrE1v30iBJqILesKQ5+CawnG4aiY1cP2wFN77TuWqyYN7lv/0HQSM7P2kaEBclGh9igb TWfNtBgjEIQeZfdtJgYNUSoWVNGdPoPyCwmlxDtsIEyUcV6SsSUvQnKMzslReZli5u9I eme/Sd0cz8ZPe2YZJ23J95ZbWuvknIudd5IObBNHCo4YEMmQHZ4gtHeH/cwdHDLn43yR sDsGbBvh2qqjn8gRJ2BmOo0l0Y4515hD4sGIePmyZzvQ4VEwIIZbc+wwg0H8al9kjqTX U2lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NxZ53kuXN1Qzlnq2pOy7oHvr3Wys0XR/R5bk1ac/nQ8=; b=dk4RhnnpocWXG8E5VoCgmYrisSYCajgoxwClzcxWVYX+GkVe/M6XyoIgL//ueZX6MR uB9/9MUQBtmYmS1nsQa61If0T67qGUI0fjwFXA693GVtSiRoQXa2+bN9XfAcvCwT32XK nWa6gHDYHG+wAJ1BcZkFaSxLGsm0VZ3nAC9xrI/hvSxTLbnMGnyPH8kM77e07pI5XXXW t5IHw0FoQu/Bj+SIRtnRYPumJiRFhR0XPAL5BbKgPQW31EWK9EbKKvDiOCs4JrYOk02Q 6I0iSBLBxDfBFgZ6YQj/AMgIiP9CCKn6x7aShijPWIGRd/NzjCmiqqrKrk+j6xae8g52 L48g== X-Gm-Message-State: AOAM5336KIAIUkL65bCBV2ZHQXBxyKxydtcSKJxKCxesOR5/BiqLzTKl SPMietp/gzXH8ncxNOXHVclonbj/h50= X-Google-Smtp-Source: ABdhPJwq37RtY/o5C+734NXm03WwJD1xVs3UHsqDkmQVbcY+UIVJQxSV37rmtLi7ViS+uRkoAiSjsw== X-Received: by 2002:ac2:4c51:: with SMTP id o17mr5296087lfk.457.1633462852287; Tue, 05 Oct 2021 12:40:52 -0700 (PDT) Received: from home.paul.comp (paulfertser.info. [2001:470:26:54b:226:9eff:fe70:80c2]) by smtp.gmail.com with ESMTPSA id h9sm903879lfl.42.2021.10.05.12.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 12:40:51 -0700 (PDT) Received: from home.paul.comp (home.paul.comp [IPv6:0:0:0:0:0:0:0:1]) by home.paul.comp (8.15.2/8.15.2/Debian-14~deb10u1) with ESMTP id 195JenmD031966; Tue, 5 Oct 2021 22:40:50 +0300 Received: (from paul@localhost) by home.paul.comp (8.15.2/8.15.2/Submit) id 195JenQJ031965; Tue, 5 Oct 2021 22:40:49 +0300 From: Paul Fertser To: openwrt-devel@lists.openwrt.org Cc: Paul Fertser Subject: [RFT 4/5] realtek: support D-Link DGS-1210-10P H/W:R1 Date: Tue, 5 Oct 2021 22:40:23 +0300 Message-Id: <20211005194024.31909-5-fercerpav@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211005194024.31909-1-fercerpav@gmail.com> References: <20211005194024.31909-1-fercerpav@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211005_124054_049006_6A5C7F07 X-CRM114-Status: GOOD ( 16.49 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This is an 8 port 1000BASE-T + 2 1000BASE-X SFP gigabit switch with PoE+ support, 65 W budget (using 54 V * 1.574 A = 85 W power supply). In order to manipulate the PoE+ one needs the realtek-poe package [0]. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:130 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [fercerpav[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 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 This is an 8 port 1000BASE-T + 2 1000BASE-X SFP gigabit switch with PoE+ support, 65 W budget (using 54 V * 1.574 A = 85 W power supply). In order to manipulate the PoE+ one needs the realtek-poe package [0]. Specifications -------------- * SoC: Realtek RTL8380M 500 MHz MIPS 4KEc * Flash: Macronix MX25L25645GMI-08G 32 MiB * RAM: Nanya NT5CC256M8JQ-EK 256 MiB DDR3(L) SDRAM * Ethernet: 8x 10/100/1000 1000BASE-T 2x 1000BASE-X SFP * PoE+: Broadcom BCM59121B0KMLG (IEEE 802.3at-2009 compliant) Controlled by Nuvoton M0516LDE MCU talking undocumented protocol to the Realtek's second UART * Buttons: Mode ("lights_toggle") and Reset * LEDs: Power, PoE Max, Link and PoE software-controlled; per-port link indication LEDs hardware-controlled * UART: 2.54 mm header with populated standard pin connector J8 Pin 1: Vcc (3.3 V) Pin 2: Tx Pin 3: Rx Pin 4: GND Baud and framing: 115200 8n1 Installation ------------ * Configure your client with static 10.90.90.91/24 address. * Set up a TFTP server on your client and make it serve the initramfs image. Connect it to port 1 of the switch. * Connect serial, power up the switch, interrupt U-boot by hitting Escape after seeing "Power on self test" message * Download the image onto the device and boot from it: > tftpboot 0x8f000000 10.90.90.91:openwrt-realtek-generic-d-link_dgs-1210-10p-r1-initramfs-kernel.bin > bootm * Once OpenWrt has booted reconfigure your client to use VID 100 and DHCP, scp the sysupgrade image to /tmp and run sysupgrade. [0] https://patchwork.ozlabs.org/project/openwrt/patch/20210511152243.1167160-1-john@phrozen.org/ Signed-off-by: Paul Fertser --- .../realtek/base-files/etc/board.d/02_network | 7 ++ .../rtl8380_d-link_dgs-1210-10p-r1.dts | 67 +++++++++++++++++++ target/linux/realtek/image/Makefile | 11 +++ 3 files changed, 85 insertions(+) create mode 100644 target/linux/realtek/dts-5.10/rtl8380_d-link_dgs-1210-10p-r1.dts diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 58461c9c995f..e7c45de92328 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -48,6 +48,13 @@ done [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac case $board in +d-link,dgs-1210-10p-f1|\ +d-link,dgs-1210-10p-r1) + ucidef_set_poe 65 "$lan_list" + # once PoE board data is standardised it should also include + # max per-port power: 30 W + # PoE id numbers: inversed, e.g. lan2 is id 7 + ;; netgear,gs110tpp-v1) ucidef_set_poe 130 "$lan_list" ;; diff --git a/target/linux/realtek/dts-5.10/rtl8380_d-link_dgs-1210-10p-r1.dts b/target/linux/realtek/dts-5.10/rtl8380_d-link_dgs-1210-10p-r1.dts new file mode 100644 index 000000000000..379e0140bdf0 --- /dev/null +++ b/target/linux/realtek/dts-5.10/rtl8380_d-link_dgs-1210-10p-r1.dts @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl8380_d-link_dgs-1210-10.dtsi" + +/ { + compatible = "d-link,dgs-1210-10p-r1", "realtek,rtl838x-soc"; + model = "D-Link DGS-1210-10P R1"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x10000000>; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x00000000 0x0080000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env"; + reg = <0x00080000 0x0040000>; + read-only; + }; + + partition@c0000 { + label = "u-boot-env2"; + reg = <0x000c0000 0x0040000>; + }; + + partition@100000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x00100000 0x0e80000>; + }; + + partition@f80000 { + label = "kernel2"; + reg = <0x00f80000 0x0180000>; + }; + + partition@1100000 { + label = "rootfs2"; + reg = <0x01100000 0x0d00000>; + }; + + partition@1e00000 { + label = "jffs2"; + reg = <0x01e00000 0x0200000>; + }; + }; + }; +}; diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile index 903ad3815690..c7238494606e 100644 --- a/target/linux/realtek/image/Makefile +++ b/target/linux/realtek/image/Makefile @@ -69,6 +69,17 @@ define Device/d-link_dgs-1210-10p-f1 endef TARGET_DEVICES += d-link_dgs-1210-10p-f1 +define Device/d-link_dgs-1210-10p-r1 + $(Device/d-link_dgs-1210) + SOC := rtl8380 + IMAGE_SIZE := 14848k + DEVICE_MODEL := DGS-1210-10P + DEVICE_VARIANT := R1 + # TODO + # DEVICE_PACKAGES += realtek-poe +endef +TARGET_DEVICES += d-link_dgs-1210-10p-r1 + define Device/d-link_dgs-1210-16 $(Device/d-link_dgs-1210) DEVICE_MODEL := DGS-1210-16