From patchwork Thu Aug 7 14:39:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 2120419 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=4c43BvuR; 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=WAdusvdF; 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 4byVLS1SYqz1xwc for ; Fri, 8 Aug 2025 00:44:47 +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=30OCwVKG3pFc5wyG3iRkJ8DqblCNZye7uDhf6X+RDUc=; b=4c43BvuRI8LuBQ kRKJ+y2DttArtiOnJHgPfw1ywIAleoD7jljKbL+lAdqsWxbluGPsz7qaHzuSzFbmcmwiDa9bx+7fM UE10lpOt89BNLH1fOnJjxdxAH/mPmWNj+VyyIRXI0AVtJir2Qo0Jrc622WgKV9PbA4x+0NhgXiM2i 5Z++2p3rJ4KTU7ZsR6LFPRpxvgmzJdxTpauPjimPCm/1VZmCibJOcdzSqU/AZv4PkZ0IClp4+ej2Z lY+RpCxCN1bZgJ8pUEo1MEpCealGXibIGAEkDnD5J6cG9aHNmEu1+8nAgwv0h5bcR3OKiqYXt4U8Z EF/BZsCm+V9+vO4NGKiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uk1pq-00000000qfB-2p3N; Thu, 07 Aug 2025 14:43:14 +0000 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uk1oW-00000000qPA-2zDR for openwrt-devel@lists.openwrt.org; Thu, 07 Aug 2025 14:41:53 +0000 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-433f681befbso394597b6e.3 for ; Thu, 07 Aug 2025 07:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754577711; x=1755182511; 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=e+jmQbHx1t506Erp1W9KXchuwh7Aq1zmFLHMRB4gCfw=; b=WAdusvdFdBHpHjKqUUQWu+0CK7h9rkyqsfx/lWQwI9QnRR0fAkXwYYkXuie8l5Ps9J 6Kz5+xT21XYnU3ynaz5wi423aMLNULVtNYXD51hwoXhvVCWW7wVjh08Qarc6OrEbrLOH ZlCiWFwY40QwIGBSLNrW55aHqf2/EXgBExHlXDSz/vPjJtubaULDwewgY9rRX6D3nWRO 6qOY37toCKaCjuTOGSjhQ1uOCPuOBafR1aZDl8friFaQHaAlWicje4azNdYQ5rZsHImd SYCnRyODhaIDFVa4zvKnOh/Jfa3TLUGJmdk0dUY5oXAg97DxvYddSbKnMDbohmPoYvGq cbvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754577711; x=1755182511; 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=e+jmQbHx1t506Erp1W9KXchuwh7Aq1zmFLHMRB4gCfw=; b=ZR77jaYwxpIGhC/YwmrE9AZT+2YDBOmhk2MVKP9f9drfDrnRIMYVNvzjyPvfJ2Q9u6 QIeJupf4mdzA0/EVAvnrsvZzmrP8UzxdijgK00vjfgqnL+5r8zD/IY5tJtF4Ebn6fyGI Jrm9So2nFEpl55SAp9UgCUHl4niUvhZYiVBmXKodvZMfa/yDFhDP0qjp/jcYu9TDePSg SsnkQVSfY+tbjClAFgfD0GMVDWl+C113HOaow5VDgHEerJhuX5mLTtooQMg03DjWTJnx de+OZgWA4MD5WmX6FqXaxV3PFGuoNsCzdAQAuhLlzgchg9IESvA8HrsX+KSZwiUPVqIY pZ5A== X-Gm-Message-State: AOJu0YzUDEM2xbpi8zGr/obpdkO5XjuNplGFULm1ZXW5Trn2nLY9d3Jq yu0Hzr5lPRfHO+sKCmOrs7QgbqFdWgeIc/VLSq/ARRiU9WDbZsf8e3g1ZxH/1Q== X-Gm-Gg: ASbGncskrUHm2tW+uQlHChFlCNUOy6OQq08NzONOssmFRZ09d03Fom3Z9ZQuaIP6D+o x/n64iUdw+3QooFiu1hNfLtPUJ1518uwxQF7b06zghYokHrhcLvA82vscZL5bqfxvX0SGscT+L8 e+aqJBrEDK9lhD+bIU3oH9WLgigsIga/ChjfwLT9buQ1W2zXBD/0eds1f7icOTcZnqamfOo/g86 UK8NEACryXbGg7SxFKY4ucUpOUdxMqPUGF0LfpCggoFg1PSCd6VYM9d09iwq/FgeKZxN/wMW5L5 wfBmZXSXRnByzrR1sfFDPuHtObioLP3moYEPht5LulohYCeEWzeaA2eTHKzkbyssvMgp5IynkiH LSAybOtZblrH236QE9F+DB5kgf4FxxX4lQBIZPTnb X-Google-Smtp-Source: AGHT+IEE+YmgkAibDvqk+2V5kZLnvM2dwezZdBpJaUm/CyzRHfTY+hEDiGjC0KZlcltoLh8MlnMG5g== X-Received: by 2002:a05:6808:2207:b0:41e:8566:1486 with SMTP id 5614622812f47-4357a0e2d53mr4037860b6e.36.1754577710979; Thu, 07 Aug 2025 07:41:50 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:fb0:1bc0:80e:91e0:8713:cbd5]) by smtp.gmail.com with ESMTPSA id 5614622812f47-43402543879sm2316794b6e.31.2025.08.07.07.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Aug 2025 07:41:50 -0700 (PDT) From: Chris Morgan To: openwrt-devel@lists.openwrt.org Cc: hauke@hauke-m.de, Chris Morgan , Chris Morgan Subject: [PATCH V2] mediatek: backport upstream v6.17 Potron SFP+ XGSPON patches Date: Thu, 7 Aug 2025 09:39:11 -0500 Message-ID: <20250807143911.1618-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-20250807_074152_772658_5BAE7B59 X-CRM114-Status: GOOD ( 16.70 ) 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:22d listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 -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 --- Changes since V1: - Moved patch to target/linux/generic/backport-6.12. - Renamed patch to be consistent with naming of other patches. --- ...phy-sfp-Add-quirk-for-SFP-ONU-XGSPON.patch | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 target/linux/generic/backport-6.12/730-06-v6.17-net-phy-sfp-Add-quirk-for-SFP-ONU-XGSPON.patch diff --git a/target/linux/generic/backport-6.12/730-06-v6.17-net-phy-sfp-Add-quirk-for-SFP-ONU-XGSPON.patch b/target/linux/generic/backport-6.12/730-06-v6.17-net-phy-sfp-Add-quirk-for-SFP-ONU-XGSPON.patch new file mode 100644 index 0000000000..f65e9da50a --- /dev/null +++ b/target/linux/generic/backport-6.12/730-06-v6.17-net-phy-sfp-Add-quirk-for-SFP-ONU-XGSPON.patch @@ -0,0 +1,61 @@ +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(-) + +--- a/drivers/net/phy/sfp.c ++++ b/drivers/net/phy/sfp.c +@@ -366,6 +366,11 @@ static void sfp_fixup_nokia(struct sfp * + sfp_fixup_ignore_los(sfp); + } + ++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) + { +@@ -408,7 +413,19 @@ static void sfp_fixup_halny_gsfp(struct + * 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_cc(struct sfp *sfp) +@@ -489,6 +506,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