Skip to contentSkip to conversation

net: pcs: airoha: add support for Airoha AN7583 SoC

RFC PATCH Superseded Christian Marangi 2 participants 2 messages Sep 11 – Sep 14

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 net: pcs: airoha: add support for Airoha AN7583 SoC

Add support for Airoha AN7583 PCS. This use a new analog PHY implementation that doesn't require manual calibration but makes use of internal algo to lock to the center of the band EYE.

---
This depends on series [1] and posed as reference for AN7583 integration.

[1] https://lore.kernel.org/all/[email protected]/

 drivers/net/pcs/airoha/Kconfig             |    7 +
 drivers/net/pcs/airoha/Makefile            |    3 +
 drivers/net/pcs/airoha/pcs-airoha-common.c |  173 +-
 drivers/net/pcs/airoha/pcs-airoha.h        |  450 ++++
 drivers/net/pcs/airoha/pcs-an7583.c        | 2349 ++++++++++++++++++++
 5 files changed, 2972 insertions(+), 10 deletions(-)
 create mode 100644 drivers/net/pcs/airoha/pcs-an7583.c
drivers/net/pcs/airoha/Kconfig +7 -0
index 1aa4c0d33b87..8153276b3424 100644
@@ -11,3 +11,10 @@ config PCS_AIROHA_AN7581
 	help
 	  This module provides helper to phylink for managing the Airoha
 	  AN7581 PCS for SoC Ethernet and PON SERDES.
+
+config PCS_AIROHA_AN7583
+	tristate "Airoha AN7583 PCS driver"
+	select PCS_AIROHA
+	help
+	  This module provides helper to phylink for managing the Airoha
+	  AN7583 PCS for SoC Ethernet and PON SERDES.
drivers/net/pcs/airoha/Makefile +3 -0
index c5201d5cc356..3fd5e446744f 100644
@@ -5,3 +5,6 @@ pcs-airoha-objs			:= pcs-airoha-common.o
 ifdef CONFIG_PCS_AIROHA_AN7581
 pcs-airoha-objs			+= pcs-an7581.o
 endif
+ifdef CONFIG_PCS_AIROHA_AN7583
+pcs-airoha-objs			+= pcs-an7583.o
+endif
drivers/net/pcs/airoha/pcs-airoha-common.c +163 -10

285 lines not on this page · raw message

drivers/net/pcs/airoha/pcs-airoha.h +450 -0

667 lines not on this page · raw message

drivers/net/pcs/airoha/pcs-an7583.c new file +2349 -0

2,032 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.53.0

Part of the diff is not shown here. View the raw message.

#1 lore raw
kernel test robot noticed the following build errors:

Hi Christian,

[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:

[auto build test ERROR on linux-review/Christian-Marangi/net-phylink-keep-and-use-MAC-supported_interfaces-in-phylink-struct/20260901-102916] [cannot apply to net-next/main net/main linus/master v7.3-rc3 next-20260911]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Christian-Marangi/net-pcs-airoha-add-support-for-Airoha-AN7583-SoC/20260911-092339
base:   https://github.com/intel-lab-lkp/linux Christian-Marangi/net-phylink-keep-and-use-MAC-supported_interfaces-in-phylink-struct/20260901-102916
patch link:    https://lore.kernel.org/r/20260911072340.107675-1-ansuelsmth%40gmail.com
patch subject: [RFC PATCH net-next] net: pcs: airoha: add support for Airoha AN7583 SoC
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20260914/[email protected]/config)
compiler: sh4-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260914/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/net/pcs/airoha/pcs-an7583.c:2266:5: error: redefinition of 'an7583_pcs_usb_phya_bringup'
    2266 | int an7583_pcs_usb_phya_bringup(struct airoha_pcs_priv *priv,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/net/pcs/airoha/pcs-an7583.c:10:
   drivers/net/pcs/airoha/pcs-airoha.h:1751:19: note: previous definition of 'an7583_pcs_usb_phya_bringup' with type 'int(struct airoha_pcs_priv *, int,  phy_interface_t)'
    1751 | static inline int an7583_pcs_usb_phya_bringup(struct airoha_pcs_priv *priv,
         |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/pcs/airoha/pcs-an7583.c:2278:5: error: redefinition of 'an7583_pcs_common_phya_bringup'
    2278 | int an7583_pcs_common_phya_bringup(struct airoha_pcs_priv *priv,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/pcs/airoha/pcs-airoha.h:1745:19: note: previous definition of 'an7583_pcs_common_phya_bringup' with type 'int(struct airoha_pcs_priv *, int,  phy_interface_t)'
    1745 | static inline int an7583_pcs_common_phya_bringup(struct airoha_pcs_priv *priv,
         |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/pcs/airoha/pcs-an7583.c:2299:6: error: redefinition of 'an7583_pcs_common_phya_link_up'

2299 | void an7583_pcs_common_phya_link_up(struct airoha_pcs_priv *priv, int index)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/pcs/airoha/pcs-airoha.h:1757:20: note: previous definition of 'an7583_pcs_common_phya_link_up' with type 'void(struct airoha_pcs_priv *, int)'
1757 | static inline void an7583_pcs_common_phya_link_up(struct airoha_pcs_priv *priv,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/an7583_pcs_usb_phya_bringup +2266 drivers/net/pcs/airoha/pcs-an7583.c

2265

> 2266	int an7583_pcs_usb_phya_bringup(struct airoha_pcs_priv *priv,
  2267					int index, phy_interface_t interface)
  2268	{
  2269		struct airoha_pcs_maps *maps = &priv->maps[index];
  2270	
  2271		regmap_set_bits(maps->multi_sgmii,
  2272				AIROHA_PCS_MULTI_SGMII_MSG_RX_LIK_STS_1,
  2273				AIROHA_PCS_PAUSE_STS_P2 | AIROHA_PCS_PAUSE_STS_P1);
  2274	
  2275		return phy_set_mode_ext(priv->phy, PHY_MODE_ETHERNET, interface);
  2276	}
  2277	
> 2278	int an7583_pcs_common_phya_bringup(struct airoha_pcs_priv *priv,
  2279					   int index, phy_interface_t interface)
  2280	{
  2281		if (priv->phy)
  2282			return an7583_pcs_usb_phya_bringup(priv, index, interface);
  2283	
  2284		an7583_pcs_dig_reset_hold(priv, index);
  2285	
  2286		an7583_pcs_cfg_phy_type(priv, index, interface);
  2287	
  2288		an7583_pcs_common_phya_txpll_on(priv, index);
  2289	
  2290		an7583_pcs_common_phya_tx_on(priv, index);
  2291	
  2292		an7583_pcs_first_plug_in(priv, index, interface);
  2293	
  2294		an7583_pcs_ana_reset_release(priv, index);
  2295	
  2296		return 0;
  2297	}
  2298	
> 2299	void an7583_pcs_common_phya_link_up(struct airoha_pcs_priv *priv, int index)

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki