From patchwork Sat Jul 16 19:09:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sander Vanheule X-Patchwork-Id: 1657150 X-Patchwork-Delegate: sander@svanheule.net 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=oc7IJvVm; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=TP/3ICKz; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::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:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LldHw70dcz9s2R for ; Sun, 17 Jul 2022 05:16:28 +1000 (AEST) 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=jVCvJJ+d3T5VlPmwVimTf5nbBjyjQ578eqtrwCi0bMU=; b=oc7IJvVmEPTZIb 955zcmA6VhpVaov6G/VdZ8uUoaBpSvpnbhQ9dcDaiX6Op5LMSEbDXvFMxbXaFaK5nDSUvJDOLcrIH GfyuM8a8o9UmLsMCeWH3FZfzcPm8VSNQii56Jam+oyzQQnVZ0g6BSQ4nAHUoNenenXbmb+Tp4Mzkk RUkXRw5CchnPbWzDyV8SMgPbbMX7+Bn4IwAbt9UXu0Uesd7I1KxwQx5r2KZeZgT/H41hbKp5mDpZX ugb9DrJBtleESgg6VIG0sxFuUxVIHxm+h3CuG7pscJQeKMqu60N3kdytl5Qs8avmfDOygl+/ODnro hn41qLhFxjLDcqIFhgSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCnDA-000DDD-Mb; Sat, 16 Jul 2022 19:12:21 +0000 Received: from polaris.svanheule.net ([2a00:c98:2060:a004:1::200]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCnBK-000Cac-WB for openwrt-devel@lists.openwrt.org; Sat, 16 Jul 2022 19:10:28 +0000 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:eaf9:8401:aa9f:5d01:1b2a:e3cd]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id B6D822FBDD6; Sat, 16 Jul 2022 21:10:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1657998617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jvMGL7mQDlany8zI+ccCgQ/QJmQluOPj4lZ8dGM6AMc=; b=TP/3ICKzWf5ARBjk1Aw0PhIN94NdlWlM0bvhIBsc53zrzEJe4+g1wtUmyN055+k/FXmrNE Hx5eATAGjQFDSuJfcMidpxEfvLGldhyMAXezrZSBULDGhO7WbXBkBvtkGgE1b9JxMJV1FR VJ82cgAUh3O1zMXH/wJCDdfR2U7gZaLBTfCEn00Hai/kaTVTqU3vgmjaTW+KeCbJPtXEKw k+XvMjsqNLFyxsNOo5ruBVLmvcUEW2aUMbZDNO/nHzq+XapQtwAxLNl17dZp1E1Y6s0/L0 NHQc2MVhQIztbH+ND7bYgRl9JNCYv29t5RqvnB/KBunZLLRVW9B5BVMRP5TnHw== From: Sander Vanheule To: openwrt-devel@lists.openwrt.org Cc: Sander Vanheule Subject: [RFC PATCH 7/7] realtek: Netgear GS110TPPv1: define port LEDs Date: Sat, 16 Jul 2022 21:09:59 +0200 Message-Id: X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220716_121027_210033_6CB33307 X-CRM114-Status: UNSURE ( 7.24 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) 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: Add the port LEDs for lan1-lan8 to the device tree for the GS110TPP v1. To reproduce the same behaviour as stock firmware, green should be LINK/ACT 1G, and amber should be LINK/ACT 100M/10M: for i in $(seq 1 8); do echo 13 > /sys/class/leds/green:lan-$i/rtl_hw_trigger echo realtek-switchport > /sys/class/leds/green:lan-$i/trigger echo f > /sys/class/leds/amber:lan-$i/rtl_hw_trigger echo [...] Content analysis details: (-2.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2a00:c98:2060:a004:1:0:0:200 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -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 Add the port LEDs for lan1-lan8 to the device tree for the GS110TPP v1. To reproduce the same behaviour as stock firmware, green should be LINK/ACT 1G, and amber should be LINK/ACT 100M/10M: for i in $(seq 1 8); do echo 13 > /sys/class/leds/green:lan-$i/rtl_hw_trigger echo realtek-switchport > /sys/class/leds/green:lan-$i/trigger echo f > /sys/class/leds/amber:lan-$i/rtl_hw_trigger echo realtek-switchport > /sys/class/leds/amber:lan-$i/trigger done Signed-off-by: Sander Vanheule --- .../dts-5.10/rtl8380_netgear_gs110tpp-v1.dts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/target/linux/realtek/dts-5.10/rtl8380_netgear_gs110tpp-v1.dts b/target/linux/realtek/dts-5.10/rtl8380_netgear_gs110tpp-v1.dts index 1ff209cee363..897699bea2c3 100644 --- a/target/linux/realtek/dts-5.10/rtl8380_netgear_gs110tpp-v1.dts +++ b/target/linux/realtek/dts-5.10/rtl8380_netgear_gs110tpp-v1.dts @@ -43,3 +43,33 @@ &uart1 { status = "okay"; }; + +#define LAN_LED_LABEL(p, n) STRINGIZE(p ## n) +#define LED_LABEL_GREEN(p) LAN_LED_LABEL(green:lan-, p) +#define LED_LABEL_AMBER(p) LAN_LED_LABEL(amber:lan-, p) +#define NETGEAR_LED(_phy, _port) \ + led@ ## _phy ##.0 { \ + reg = < _phy 0 >; \ + label = LED_LABEL_GREEN(_port) ; \ + }; \ + led@ ## _phy ## .1 { \ + reg = < _phy 1 >; \ + label = LED_LABEL_AMBER(_port) ; \ + } + +&switchcore { + port-leds { + compatible = "realtek,rtl8380-port-led"; + #address-cells = <2>; + #size-cells = <0>; + + NETGEAR_LED(8,1); + NETGEAR_LED(9,2); + NETGEAR_LED(10,3); + NETGEAR_LED(11,4); + NETGEAR_LED(12,5); + NETGEAR_LED(13,6); + NETGEAR_LED(14,7); + NETGEAR_LED(15,8); + }; +};