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