From patchwork Tue Jun 24 20:21:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 2102236 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=UOcxxLCt; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=FwPUhjTT; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4bRfQk746Jz1yjK for ; Wed, 25 Jun 2025 08:15:26 +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: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:In-Reply-To:References: List-Owner; bh=tPeu2OdZW0U1w2l2Ia/L9/T7AQVeIQTL4Ig6OIaIkUQ=; b=UOcxxLCt8M6VNx tyjyhd2y47+4naUrknJoLQ4Y6kio0knZ6PTYy9dFQQ738IJ9XipZOpncQJFU87LXogfWxSecKf06T JbFO5l+WzYPQmGmnzz1oil8CWTYCJfGj+x3UH2mbaI/0LwMi+2bttXBwRNg35gT89WODlM45Ku9ep 1K9ab3Nlxdr2d6H2p4J+5HOjwMYPRWsi9Gq+I/CR6orFEv7GA1hB3D+4SsSbrtNfVsUkKb/zv8Agr /bSzQadzeZdibxhvsu00ehgmLej12zbfrgh5dW2q/bVDu4RHh0UPwcKuySk4Hwzzw1Y3YP1PoLJXt V7G5peFu3/2gjKltOk4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uUBuC-00000006xKq-2uck; Tue, 24 Jun 2025 22:14:16 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uUABT-00000006krH-4Auq for openwrt-devel@lists.openwrt.org; Tue, 24 Jun 2025 20:24:01 +0000 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-40669fd81b5so4173316b6e.1 for ; Tue, 24 Jun 2025 13:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750796638; x=1751401438; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=XUaq7B1LmCfO2o+YhAI4XD6ksRY8mO5KuflraoQ5mX8=; b=FwPUhjTTv9dEfk67LeI5NspQUScmiZJL119fzpTSwwjwwa0NWpyPKwgPmLIGPmI7B/ L3dmHIv5vYqR17h4Pjgt9GRQSgHwfZf48Y/xNtOMOE3RmXXqM0ntPl8ZtKe5Wd5ELbcR Ygn/ccbkpzXSDlY1dvsycqzMnzC2qXIdRoACwWxuj+aC8ukVZBctaLr9ZUCDUYECa9J1 PcalXBd9Ds2foW7nHS+j/TfRruVLnxwYatCokcDVfB30lnZvN1LDXGqKcmbmnc15fDmR BuXH0Sdg7PAhtZklS6IU04JZnZWU3+2VvTwWBnSWSICALoHFwoEAV0SuipeaOI2Fei6U qKjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750796638; x=1751401438; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XUaq7B1LmCfO2o+YhAI4XD6ksRY8mO5KuflraoQ5mX8=; b=eLOynoZvqWsIIgN9k+XxpUFddp7jypC/AwWcpBBnf4AGnIwFq+pk6TXCIUk3oqWiP2 fLtmnqC9AoOMqFwXg1t26/aroH/L0R+3nPmgzNHFgN3w2ElNQCh2j97+RpgvPiD+H/59 yGp5NOSaf/TBQggeo8NY1/9Nj2PC1iJE4n8GNgIG2YNI1EcXTxQfE5Hu5hjWzbMl50Ll FhuDZg+MlaQVqx0hxO92ZpxJHc4FR/1LAKMxg8e9EgQoWESjW5vGhUElB7dnaaKzXsx7 5HdADfUgHSSCEyqkOH+rpq2ElJAhlqaGhRN5Yp7nxVgfj4HZ3l0RGFBBOjq1ov8JLLNc fopg== X-Gm-Message-State: AOJu0YyxwX9e95aQjqzdsjnWTY+Ka/R4D9QRAKODKHo10RHfMy5qLcrV Q0KTc2RkbPUEbPnWRr3NbZh65B0KQglazwp8yAJpGxXuJJAXxvLeRF+1DEMF/w== X-Gm-Gg: ASbGncvUXN9R0jnI89vmWK4fg+SdXXifYRistsBuozQu3NqqlIm3Jii1W/KIV4Kptp5 Fy5EQ6SToXAdVeXrU7ncMrYG05s2vbWjNYq5Sx+EA5/jCaLvSZJlV6hYijdLrVh2NBt4J2UwoZB 9gqGK4xdJruwDaWOo+Us7QPqEPeKCqsHhn/uAYOz4BkShcr/UyrInffwebEgpGiLA26F4rGdTxi KiLZrnwXwnBmTr5EruL44kzMAPxoWcYVqfhkYtyErA+AZktLalWjmycXbA2bIfXw3V8p09wGsCs SmUZOHFhyeY/4W4WSlo6zcUa2BBfoBOg21H6KaeV8vVT8YwR3B6+FkXdS8Ykji3H3cRbs0wVMbU hP8SNuA== X-Google-Smtp-Source: AGHT+IFycl9tdFGEhsGRE0WG00KQ6RUOYVi3w1YEhE60Za8XsewYzO+hDjjxEuwcU0yrKR+Y4NxWww== X-Received: by 2002:a05:6870:c0d2:b0:2e9:8ed9:16fc with SMTP id 586e51a60fabf-2efb219c2a7mr545796fac.11.1750796638056; Tue, 24 Jun 2025 13:23:58 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bc0:ecf9:42fb:59a8:4355]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2ee664ba910sm2218002fac.8.2025.06.24.13.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jun 2025 13:23:57 -0700 (PDT) From: Chris Morgan To: openwrt-devel@lists.openwrt.org Cc: Chris Morgan , Chris Morgan Subject: [PATCH] mediatek: backport upstream v6.17 Potron SFP+ XGSPON patches Date: Tue, 24 Jun 2025 15:21:13 -0500 Message-ID: <20250624202113.1857334-1-macroalpha82@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250624_132400_043369_32AB6145 X-CRM114-Status: GOOD ( 16.03 ) X-Spam-Score: -1.8 (-) 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: From: Chris Morgan Backport fixes for the Potron SFP+ XGSPON ONU stick. These fixes allow the Potron SFP+ XGSPON ONU stick to work without manual workarounds to prevent UART activity on pins 2 and 7 to be interpreted as [...] Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:234 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.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [macroalpha82(at)gmail.com] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [macroalpha82(at)gmail.com] 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 From: Chris Morgan Backport fixes for the Potron SFP+ XGSPON ONU stick. These fixes allow the Potron SFP+ XGSPON ONU stick to work without manual workarounds to prevent UART activity on pins 2 and 7 to be interpreted as TX_FAULT or LOS signals on devices with support for these signals (such as the Banana Pi R4). [1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=dfec1c14aece Signed-off-by: Chris Morgan --- ...net-sfp-Add-quirk-for-SFP-ONU-XGSPON.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 target/linux/mediatek/patches-6.12/961-net-sfp-Add-quirk-for-SFP-ONU-XGSPON.patch diff --git a/target/linux/mediatek/patches-6.12/961-net-sfp-Add-quirk-for-SFP-ONU-XGSPON.patch b/target/linux/mediatek/patches-6.12/961-net-sfp-Add-quirk-for-SFP-ONU-XGSPON.patch new file mode 100644 index 0000000000..d83a91a589 --- /dev/null +++ b/target/linux/mediatek/patches-6.12/961-net-sfp-Add-quirk-for-SFP-ONU-XGSPON.patch @@ -0,0 +1,66 @@ +From d6899e971a19f525a2efe2d301c859e753462607 Mon Sep 17 00:00:00 2001 +From: Chris Morgan +Date: Thu, 5 Jun 2025 14:18:21 -0500 +Subject: [PATCH] net: sfp: add quirk for SFP-ONU-XGSPON module + +Add quirk for YV SFP+ONT-XGSPON module. + +This device uses pins 2 and 7 for UART communication, so disable +TX_FAULT and LOS. Additionally as it is an embedded system in an +SFP+ form factor provide it enough time to fully boot before we +attempt to use it. + +Signed-off-by: Chris Morgan +--- + drivers/net/phy/sfp.c | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c +index 347c1e0e94d9..7a070808ec46 100644 +--- a/drivers/net/phy/sfp.c ++++ b/drivers/net/phy/sfp.c +@@ -350,6 +350,11 @@ static void sfp_fixup_ignore_tx_fault(struct sfp *sfp) + sfp->tx_fault_ignore = true; + } + ++static void sfp_fixup_ignore_hw(struct sfp *sfp, unsigned int mask) ++{ ++ sfp->state_hw_mask &= ~mask; ++} ++ + // For 10GBASE-T short-reach modules + static void sfp_fixup_10gbaset_30m(struct sfp *sfp) + { +@@ -377,7 +377,19 @@ static void sfp_fixup_halny_gsfp(struct sfp *sfp) + * these are possibly used for other purposes on this + * module, e.g. a serial port. + */ +- sfp->state_hw_mask &= ~(SFP_F_TX_FAULT | SFP_F_LOS); ++ sfp_fixup_ignore_hw(sfp, (SFP_F_TX_FAULT | SFP_F_LOS)); ++} ++ ++static void sfp_fixup_potron(struct sfp *sfp) ++{ ++ /* ++ * The TX_FAULT and LOS pins on this device are used for serial ++ * communication, so ignore them. Additionally, provide extra ++ * time for this device to fully start up. ++ */ ++ ++ sfp_fixup_long_startup(sfp); ++ sfp_fixup_ignore_hw(sfp, (SFP_F_TX_FAULT | SFP_F_LOS)); + } + + static void sfp_fixup_rollball(struct sfp *sfp) +@@ -490,6 +502,8 @@ static const struct sfp_quirk sfp_quirks[] = { + SFP_QUIRK("FS", "GPON-ONU-34-20BI", sfp_quirk_2500basex, + sfp_fixup_ignore_tx_fault), + ++ SFP_QUIRK_F("YV", "SFP+ONU-XGSPON", sfp_fixup_potron), ++ + SFP_QUIRK_F("HALNy", "HL-GSFP", sfp_fixup_halny_gsfp), + + // HG MXPD-483II-F 2.5G supports 2500Base-X, but incorrectly reports +-- +2.43.0 +