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=1796132679; b=JnyUKhFdcMsFw18ptzPM23wl40rjSH9/d8VXmlnWC3CUG8OrxtQpj/dOzliN4vY58f1A CPddvSA8khVOrXFnbymtART5AVSoVoPnn8fM71SaJ9xfamNXanRGuMjLRV0JH8p+0MLIC eqB0L4kHkLHJG1/M+z3De+RvlrpYwwJ2x/tJt52EYnYD8fW2yjQxHuBTzJynnnzaEM8YJ USl6LAdeToQzULlKikHM1vSuuiI1D9V9ud6g6HJ0q1E/i7WZW1xslMNmGGlVWFbEaS0Lt PKEio6704hnoKV5MKJGQFESf6ftWnipxT53dHKxSAnzYfqFjS11qzMf1sUMpwT4W76g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796132679; 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=ZjJT59x9T+ub7qPMYTpDDdbsxgBgyg3HFqBU8aaZg1tZfHcWRbqUAi9G2SjRlLGqZZ4y MdNz1eeCejkDY6kwHI+j7A8K8oHwpRrSboRKsUJH4pruYg0Qej45bi35eLZJml0uoibvx ke+US44a9VbcSuXcgjhKlwNDUX0TxQNRTVyE+/z4vY98rEatl6HIg1QP/w9HMJ4AVz6pK NMe9fjzuwvilMUhKLgxmRwfX3HoZB/t4751/TP8myVobOsscs1Vm+05D/vs9cA0Mre/oA gfkLrpMaxN9e0AWQvIfosuA4hS++8xxI7c5kx9FDzxX3KC7VlQxXPq0JqMKkPqdWXOw== 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 5BF26606A31A for ; Tue, 1 Dec 2026 13:44:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5BF26606A31A 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-4a5b2be99a8so91882845e9.2 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=yiegp7WDAy2B+a04J3to/VGqSsu+0GgHdRVKSRb7PYVRLZsnWcvQzCuARdcX8B5UcF GR92Ji8BPNaP3oKt0tE+ye10mZEmQ74vXJ04PDn6JH0ERNqQE9mhg2sJOo3N49eTaVRa 1AM7HKpWJUx7nnmQSZZxHhdWwaFzQDiP5U29D72jVUPMUZiVRH/ph6FVhOplg7/4qSae wdYGtxufG+gXFeNAAqSvO1xsPzur4G8Pr0N6jevyzCSjQ4EBqkBQ44MUTXOCNCFapBZe RFRpOEwFPiOPQpt5npKx7ML4XJvU6j6fncB/OIqtEWlu2kcVEDcwzN6kUyZ7Hg1Di5jT qg6g== X-Forwarded-Encrypted: i=1; AL+hErHWJihAOamWeeHXVxcXtcXok0s1+E9NeIVBIwAkAl31+wd6MqJevi/xZGx/NiI1MfdHxyL+1pk=@vger.kernel.org X-Gm-Message-State: APuU4Z9Y3aiIPA6TWmNvT5edh0Fhalgw+Qfl5CzBXLXmJqo4SWiXXAN6 l8iPmOxagyOinCVesIw4idDn6KYgkHCPeyc0It5WrX9ez8p2LrB+lip3 X-Gm-Gg: AZFdTZfhbPVltuZ175oCNXjSMhsXvkmZXgPNeUG9IM4/e1AA3xdXOxYYzm+yx6jBRSG xbYr8ryOaQhe2qcV/P0Y3P0MechzyWRkLFPqCI2N93hBhS/LzByC5bimXlha1TJElcinEyFiQwd HZqluWYx+icTA9zNkOinAQH4Vb783dzbziefGhCspHLenxoDsUakWUn6kVLPNfGPiQzoxLF6Xx4 VPqdbdYPsLhhuyL756A/H0DoCewJ0JqRnqBKrv+HBoo8uTDofMCDi0uFF/EkCMtqYIY+Hpyc+N7 ogICdpZX2tGv9SJEFgzqQqElWCo1b+3zja1ejqi/zwX0seJ9ZLhlkwyUF157Bn/ORILfefgzuxQ F1b8XB23iRLxOg6o/NqulYSKswjVgxjOjuxi7urcyTpx4Gw1Kty6x864m+5At+wK2y6TQVJlqbM db0GTACF/x/l4xheFyJZ+y4n5R3ri5hj/RtDY7oDo3D41YtUvkiJ2EALq8bsQT7+GO+kGQCOZc5 vdbmhe2WoA3KBCeGTtI7jMH9CZ/9fEiRtagBl7m9mRwTGhQ4EAeRWHwbItdyya4CEZ5ju5PyLcj vOd9hLJNMPaA0Rd6hwVlmEwPg856B5x9jJeI5MPArBBWckfZ//GuFVxeiEvksu7vj9OjA299Fd4 E7g76kdGELWmjBGs+jw== 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: netdev@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