From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796132680; b=xD2rPE7hkjH8Ukc0vI1LcVrEZQgCLyvloH6eyBQy6QvF4JEXdhz7K4gRxKRfLLzV2p5K Y9bbm0SDGYNEpKiQzmV60aYukgL/hsq75YQAIPF6PvGreSjyor9+2v57MBK3yqm9kkgtl vw2zwJTFNvewDvOwFRjbcUxXlWgi9tuq0DneLWvPfgUUJGGChxBOQhB3nudhCAyq7rbU3 x5ARcV5yPxCFgP90MTWeNBEhdrtNsxGHFiHtUO2ehOsMJF5KmoHVqyS0qk4ygRQwr3tZy lBBInxP8vVcCEkURsKQoClfw+W+AK2krXhOGbKwerU0YVArXIyNGo2mvXzBXqEWhfMQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796132680; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=Nmu8n20yj/qqwca01MOQSMIYeMYLuGBXqLokeXj7ZUM=; b=lbBcJwjZhsVNr9+dHZPtB/zXoiB6rqGW8IcL3/DGNlsVDBcuPbbb8Qvh2/IaN7ksVVaQ /Dy9pVY9uitq0GwKVUJ8Fjen2wmA2URJscxJsX9o9XHTeg2JVy7WJWBTgUnOxo4WvqsVS o+OdBgC+6KxK8u1SONJTzXFV9CVVUcLS7uyXI5OrZIoIkJCzfAuVkfmaOEnEg/+d8zWu9 wsu+ed276VkRfXQpydDREMrGCK15NXIcQzYTzsceGI6POi+gDz78RkZ0AXCDXFUOFbBUP WIDr1TOmjNErHcT2g7ADpu9VIefLvSIS6abKq72xtWc9x+wTUxIu+KPDwn/7Am1i5QQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="I//wWFAi"; arc=none smtp.remote-ip=209.85.128.45 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BF47606A325 for ; Tue, 1 Dec 2026 13:44:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5BF47606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=I//wWFAi Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4bb606491faso61298735e9.3 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=vger.kernel.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=I//wWFAi967ig+jkxUHW3LoHpPWWX1MUr3rfdaqPEAdIEHFrjwW79M7IcPuQpDGXtK ehVAUC8TGINNuckseNXm7Bzs663L3FgrW/qWc+udOisZGkUTbtu8TB4Bt3rFa6TJwd6E BhxBeTtUfStHlmXN5gH0CuWkVRR1kF0hzYVOjZRY+ApIGwD6B7vcoehTbwhGHGe+mxaC 9rtn8e+vYiCR0Fs3ALdRUyy3yAv/UwW20YD+lpedwfkADpMVYWBygX/aNUMhU9qaEGsx subNs5MmRo3M05pH1hl9JkIAfFyzx7DA/QqPTued5ulJMCWxht6VCpfVlUB19LisIhg5 58pQ== 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=VzvigK3yZG4One3FKC4bK6D7qNMFv9L13cyXLC2spWAGVg2Ux9UdvvVwYmFQQLI7UJ 3OxJShVn45MngnISgFOneOFlQcv5TBilfoF+YX8/ZkqMAEJ8L4lC9ASzWGP2HU1lhieI g/qvSmZ+3jFS1HTQWK/MemQWHGEc9u2GloAT9AHexkN9eAwuqET2D/Iw5GdrosgY4NYH YO+fAc7UgYfJOzwZpIz7bj537sXWbZa64saio6KdxxTjNDeQxeoICQ/HjilmNkWskRkT CoygwnD6Kmn7b72CrNJPSZwUJeKyLUdPBbcqUqnJTDXewFHeu8cm0cmbz6b02cuLmXCE 5fzg== X-Forwarded-Encrypted: i=1; AL+hErEUjOlp8XnXqXU2IlG+5cfcjFo58I5bgbVG3C5BXqRlXIG0Jd2JUoJDC8o/T4Ii/fXM/hwsTfZOgn0+Pis=@vger.kernel.org X-Gm-Message-State: APuU4Z8GhIgES6mhtOl1OzsuQ/DMPC3Z2z5I/8/JUG9Y30GJ8J6yMbav tF6DzAyZni0p1MpqGmx64+RJ8i+0V3/k08+9g9XqlZzWBK3FdkyM+lJO X-Gm-Gg: AZFdTZdnNraYCO+WO9pSrIA5XqlQ/XLfrZILAI8PbhJU/ptRVj7NuE2+s9jHoQQ1DYX /QVuJ5YXO4tIc/iJ0RcaWLvrDnOpNZS9U0rStfRGVcqwi3MiCKXKTiQyLvftZZd8RSm3OcrLmEE lUuUhF10h0eMSVKzog8Qh0m5NNQ5t/1TYB9DOKxXedIX4Fe35rCl1NRiTku4VIcDyfumBhRXnAs DK2iAcbxfMtDciKj6uF7erW/jRsenwwZlq8OYbOtXUQ8xnHzPLX9GcL/s53rtv84OChc2N5p6EV Mdi2b8LtJHko7Ygy3wSTfMsbHPKGoeOc/nYoWvnoINqOPtvqiOyQo3EnDmeEZxP/WG+bLhlh89q GR1gL+BSuLLu/GINAMl2CXM90P+nKkBGgWxUWibZlYDtZufVuQIWhtVFnAqCV7zvky+1MzimJvk 0HpeYsqP6srVrp3wdRgYw7Wwn9fWs0ZOO+FKlrwiUBx5kLtpU0GiTBf7pJTtw6tsLh1UgIRoU8R H6jjMJnMGafHl0vXyLhGq5eBqokJUeTVmZex4DrFBCBUHSatJsbx+TyCYTbIDn2M/5rfX9v1oB3 jiCF0rI/yK98ZN6gPw22gMEm/ic4+tzxQXaS3AfmASZFs7F0hxdRwNkEQHr1m/OoEQ6iQdASQqm zu1QliWDrQLn1at08PA== 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-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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