From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E85C5606A339 for ; Tue, 1 Dec 2026 13:45:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Y9q9EAEC; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=e7OBMiRL DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=Nmu8n20yj/qqwca01MOQSMIYeMYLuGBXqLokeXj7ZUM=; b=Y9q9EAEC/FgdrsIpR8uMLZvFiR iS2bXY3urSqJ8nTjxVV0WwKAsRW+VMIx0WXleIThJLrv5kJJ97bGUscUBq+5Z0V780BsIBhSk5vdb qe+GpU/TlEdLlDOPB5X0YRxniHJm9xeKzKUsH2vmccFsuj95Ct4+XVuc/zJYmG8LbNmu/jc/S5rhW Xf/P0q4ODbkIIaGfxXaNNxf03+dsHi9d492tablEjVYRlGqUiPyKUWgqbJSbBK/IKKmWVBu0jaiOv /HS42yGLMIk+YUKa/kjR5OHOoly0SWhQAiksV05tAPBSJidIti+R32NrlUc7dcRYBdFGKExsy388r 5CtstVow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYO9y-00000008IYl-28Zi; Tue, 01 Dec 2026 13:44:42 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYO9v-00000008IXF-3C8k for linux-arm-kernel@lists.infradead.org; Tue, 01 Dec 2026 13:44:41 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4bb702a7548so107953525e9.1 for ; Tue, 01 Dec 2026 05:44:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796132678; x=1796737478; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=Nmu8n20yj/qqwca01MOQSMIYeMYLuGBXqLokeXj7ZUM=; b=e7OBMiRLhVd06BpE9GNTdvP7jg/b29TpVxDg/kgAV61AWVtAapBOGdGcD162v8vrjo bDfQfaIA3VKC+9o7YrM0PyjR+4LIYGsNxhdKvCi6CMioivt3BY1OJQUxfKDujrxaYVqh KrAFNNTbxwvUAstnwnOLJxTHLd+s7AqQfJyYhED0NXd72DZuvI8TY00BB0bcAhsVl8ym l7g8II96a1lqqwNdwU4SWftqZEHTAryowe0/emqNI9xDJ6RDKfkU4SiwMJYxgD5YKGxE 2mX1doCRjffwlcGomlAv7yY0yoLtZdFnD/27ouOvFcmnSRruN+qA3Y3ZXUn68iGTTl6b pR5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796132678; x=1796737478; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=Nmu8n20yj/qqwca01MOQSMIYeMYLuGBXqLokeXj7ZUM=; b=gkYFR16TJEQSNmFlK2VqkoERrLOQQC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iAo+f1gmO+4Fm6V94b7kEc 6UenRKKsqr60emRtkvTIBGATixDa2tDtIdcYV02u652bGgH7/OB2ArLTWCfkG7eefIE2WOyimQ0 Gl3nH6cqIdbAeiCgaIJs2dwVBt0MEWEDLM/OF1+r0z2rT0kEvyg76FhHKwPzSlFLA1WaeFNS+M2 eZUaG8yiSPczMHLhCFg== X-Received: by 2002:a05:600c:1d86:b0:4bb:6a5a:7824 with SMTP id 5b1f17b1804b1-4bb8892099amr783666275e9.30.1796132677455; Tue, 01 Dec 2026 05:44:37 -0800 (PST) Received: from Ansuel-XPS24 (93-34-92-103.ip49.fastwebnet.it. [93.34.92.103]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-4ab65cb4341sm70195987f8f.4.2026.12.01.05.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 05:44:36 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Russell King , Christian Marangi , Daniel Golle , Qingfang Deng , SkyLake Huang , Matthias Brugger , AngeloGioacchino Del Regno , Ahmed Naseef , Joris Vaisvila , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v6 0/6] net: phy: mediatek: calibration for AN7581/3 Date: Tue, 1 Dec 2026 14:42:01 +0100 Message-ID: <20261201134415.137116-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.55.0 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261201_054439_838957_D6BE3D17 X-CRM114-Status: GOOD ( 18.83 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 This small series adds calibration support for Airoha AN7581 and AN7583 integrated PHYs. The calibration logic is quite big so I decided to split the driver from the mediatek one to keep things organized. Minor change were needed and just additional symbol to use what is common between mediatek and airoha PHYs. I followed the naming pattern of mtk by calling the new source airoha-ge-soc and related config. The calibration use lots of static table and software calibration at runtime instead of using efuse to calibrate. There is one pecularity where some register and calibration needs to be done on port0 first and then with the related port. This is O.K. as port0 presence is mandatory for the functionality of the integrated switch and it's assumed to be always present on the MDIO bus. MAINTAINERS is updated to reflect the changed code. (this was tested from a long time and also verified by Airoha for correct order of calibration) Changes v6: - Fix deadlock with phy_package - Lock the bus when using the MMD package OPs - Better clear and handle cross PHY register - Fix non negative offset in calib table - Add imply for Airoha SoC DSA driver - Fix wrong documentation description for function Changes v5: - Add review tag - Add additional helper for phy package - Use __phy_package helper instead of phydev_p0 - Better use lock and unlock for phy package - Configure base address for the phy package Changes v4: - Fix typo in Kconfig - Prevent out-of-bounds for zcal_ctrl - Protect concurrent rext_sw_calib_done - Validate port 0 presence for calibration - Correctly set shared local variable - Use phy_package_init_once for shared tables - Better handle early exit restore - Better handle phy_select_page Changes v3: - Address comments from sashiko bot - Apply review and suggested changes from Airoha - Rebase on top of net-next Changes v2: - Split header register patch from cal_cycle part - Fix missing EXPORT_SYMBOL_GPL Christian Marangi (6): net: phy: mediatek: move MTK GE SoC registers define to dedicated header net: phy: add additional helper for PHY package net: phy: mediatek: split Airoha code to dedicated source net: dsa: mt7530: mmio: Impl AIROHA_GE_SOC_PHY for Airoha SoC net: phy: mediatek: add calibration logic for AN7581 net: phy: mediatek: add calibration logic for AN7583 MAINTAINERS | 9 + drivers/net/dsa/Kconfig | 1 + drivers/net/phy/mediatek/Kconfig | 23 +- drivers/net/phy/mediatek/Makefile | 1 + drivers/net/phy/mediatek/airoha-ge-soc.c | 2014 ++++++++++++++++++++++ drivers/net/phy/mediatek/mtk-ge-soc.c | 523 +----- drivers/net/phy/mediatek/mtk-ge-soc.h | 374 ++++ drivers/net/phy/mediatek/mtk-phy-lib.c | 72 + drivers/net/phy/mediatek/mtk.h | 13 + drivers/net/phy/phy_package.c | 59 + drivers/net/phy/phylib.h | 78 + 11 files changed, 2638 insertions(+), 529 deletions(-) create mode 100644 drivers/net/phy/mediatek/airoha-ge-soc.c create mode 100644 drivers/net/phy/mediatek/mtk-ge-soc.h -- 2.55.0