mirror of
				https://github.com/Ysurac/openmptcprouter.git
				synced 2025-03-09 15:40:20 +00:00 
			
		
		
		
	Refresh kernel 6.6 patches
This commit is contained in:
		
							parent
							
								
									4fed94fcee
								
							
						
					
					
						commit
						a4ee56638a
					
				
					 50 changed files with 11257 additions and 659 deletions
				
			
		| 
						 | 
				
			
			@ -1,120 +0,0 @@
 | 
			
		|||
From: Birger Koblitz <git@birger-koblitz.de>
 | 
			
		||||
Date: Sun, 5 Sep 2021 15:13:10 +0200
 | 
			
		||||
Subject: [PATCH] kernel: Add AQR113C and AQR813 support
 | 
			
		||||
 | 
			
		||||
This hack adds support for the Aquantia 4th generation, 10GBit
 | 
			
		||||
PHYs AQR113C and AQR813.
 | 
			
		||||
 | 
			
		||||
Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
 | 
			
		||||
 | 
			
		||||
--- a/drivers/net/phy/aquantia_main.c
 | 
			
		||||
+++ b/drivers/net/phy/aquantia_main.c
 | 
			
		||||
@@ -23,6 +23,7 @@
 | 
			
		||||
 #define PHY_ID_AQCS109	0x03a1b5c2
 | 
			
		||||
 #define PHY_ID_AQR405	0x03a1b4b0
 | 
			
		||||
 #define PHY_ID_AQR113C	0x31c31c12
 | 
			
		||||
+#define PHY_ID_AQR813	0x31c31cb2
 | 
			
		||||
 
 | 
			
		||||
 #define MDIO_PHYXS_VEND_IF_STATUS		0xe812
 | 
			
		||||
 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK	GENMASK(7, 3)
 | 
			
		||||
@@ -415,6 +416,49 @@ static int aqr107_read_rate(struct phy_d
 | 
			
		||||
 	return 0;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
+static int aqr113c_read_status(struct phy_device *phydev)
 | 
			
		||||
+{
 | 
			
		||||
+	int val, ret;
 | 
			
		||||
+
 | 
			
		||||
+	ret = aqr_read_status(phydev);
 | 
			
		||||
+	if (ret)
 | 
			
		||||
+		return ret;
 | 
			
		||||
+
 | 
			
		||||
+	if (!phydev->link || phydev->autoneg == AUTONEG_DISABLE)
 | 
			
		||||
+		return 0;
 | 
			
		||||
+
 | 
			
		||||
+	// On AQR113C, the speed returned by aqr_read_status is wrong
 | 
			
		||||
+	aqr107_read_rate(phydev);
 | 
			
		||||
+
 | 
			
		||||
+	val = phy_read_mmd(phydev, MDIO_MMD_PHYXS, MDIO_PHYXS_VEND_IF_STATUS);
 | 
			
		||||
+	if (val < 0)
 | 
			
		||||
+		return val;
 | 
			
		||||
+
 | 
			
		||||
+	switch (FIELD_GET(MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK, val)) {
 | 
			
		||||
+	case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR:
 | 
			
		||||
+		phydev->interface = PHY_INTERFACE_MODE_10GKR;
 | 
			
		||||
+		break;
 | 
			
		||||
+	case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI:
 | 
			
		||||
+		phydev->interface = PHY_INTERFACE_MODE_10GBASER;
 | 
			
		||||
+		break;
 | 
			
		||||
+	case MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII:
 | 
			
		||||
+		phydev->interface = PHY_INTERFACE_MODE_USXGMII;
 | 
			
		||||
+		break;
 | 
			
		||||
+	case MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII:
 | 
			
		||||
+		phydev->interface = PHY_INTERFACE_MODE_SGMII;
 | 
			
		||||
+		break;
 | 
			
		||||
+	case MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII:
 | 
			
		||||
+		phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
 | 
			
		||||
+		break;
 | 
			
		||||
+	default:
 | 
			
		||||
+		phydev->interface = PHY_INTERFACE_MODE_NA;
 | 
			
		||||
+		break;
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	/* Read downshifted rate from vendor register */
 | 
			
		||||
+	return aqr107_read_rate(phydev);
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
 static int aqr107_read_status(struct phy_device *phydev)
 | 
			
		||||
 {
 | 
			
		||||
 	int val, ret;
 | 
			
		||||
@@ -554,7 +598,7 @@ static void aqr107_chip_info(struct phy_
 | 
			
		||||
 	build_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID, val);
 | 
			
		||||
 	prov_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val);
 | 
			
		||||
 
 | 
			
		||||
-	phydev_dbg(phydev, "FW %u.%u, Build %u, Provisioning %u\n",
 | 
			
		||||
+	phydev_info(phydev, "FW %u.%u, Build %u, Provisioning %u\n",
 | 
			
		||||
 		   fw_major, fw_minor, build_id, prov_id);
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
@@ -809,7 +853,7 @@ static struct phy_driver aqr_driver[] =
 | 
			
		||||
 	.config_aneg    = aqr_config_aneg,
 | 
			
		||||
 	.config_intr    = aqr_config_intr,
 | 
			
		||||
 	.handle_interrupt       = aqr_handle_interrupt,
 | 
			
		||||
-	.read_status    = aqr107_read_status,
 | 
			
		||||
+	.read_status    = aqr113c_read_status,
 | 
			
		||||
 	.get_tunable    = aqr107_get_tunable,
 | 
			
		||||
 	.set_tunable    = aqr107_set_tunable,
 | 
			
		||||
 	.suspend        = aqr107_suspend,
 | 
			
		||||
@@ -819,6 +863,24 @@ static struct phy_driver aqr_driver[] =
 | 
			
		||||
 	.get_stats      = aqr107_get_stats,
 | 
			
		||||
 	.link_change_notify = aqr107_link_change_notify,
 | 
			
		||||
 },
 | 
			
		||||
+{
 | 
			
		||||
+	PHY_ID_MATCH_MODEL(PHY_ID_AQR813),
 | 
			
		||||
+	.name		= "Aquantia AQR813",
 | 
			
		||||
+	.probe		= aqr107_probe,
 | 
			
		||||
+	.config_init	= aqr107_config_init,
 | 
			
		||||
+	.config_aneg    = aqr_config_aneg,
 | 
			
		||||
+	.config_intr	= aqr_config_intr,
 | 
			
		||||
+	.handle_interrupt = aqr_handle_interrupt,
 | 
			
		||||
+	.read_status	= aqr113c_read_status,
 | 
			
		||||
+	.get_tunable    = aqr107_get_tunable,
 | 
			
		||||
+	.set_tunable    = aqr107_set_tunable,
 | 
			
		||||
+	.suspend	= aqr107_suspend,
 | 
			
		||||
+	.resume		= aqr107_resume,
 | 
			
		||||
+	.get_sset_count	= aqr107_get_sset_count,
 | 
			
		||||
+	.get_strings	= aqr107_get_strings,
 | 
			
		||||
+	.get_stats	= aqr107_get_stats,
 | 
			
		||||
+	.link_change_notify = aqr107_link_change_notify,
 | 
			
		||||
+},
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
 module_phy_driver(aqr_driver);
 | 
			
		||||
@@ -832,6 +894,7 @@ static struct mdio_device_id __maybe_unu
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
 | 
			
		||||
+	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
 | 
			
		||||
 	{ }
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
| 
						 | 
				
			
			@ -1,148 +0,0 @@
 | 
			
		|||
From 5f62951fba63a9f9cfff564209426bdea5fcc371 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alex Marginean <alexandru.marginean@nxp.com>
 | 
			
		||||
Date: Tue, 27 Aug 2019 15:16:56 +0300
 | 
			
		||||
Subject: [PATCH] drivers: net: phy: aquantia: enable AQR112 and AQR412
 | 
			
		||||
 | 
			
		||||
Adds support for AQR112 and AQR412 which is mostly based on existing code
 | 
			
		||||
with the addition of code configuring the protocol on system side.
 | 
			
		||||
This allows changing the system side protocol without having to deploy a
 | 
			
		||||
different firmware on the PHY.
 | 
			
		||||
 | 
			
		||||
Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
 | 
			
		||||
---
 | 
			
		||||
 drivers/net/phy/aquantia_main.c | 88 +++++++++++++++++++++++++++++++++++++++++
 | 
			
		||||
 1 file changed, 88 insertions(+)
 | 
			
		||||
 | 
			
		||||
--- a/drivers/net/phy/aquantia_main.c
 | 
			
		||||
+++ b/drivers/net/phy/aquantia_main.c
 | 
			
		||||
@@ -24,6 +24,8 @@
 | 
			
		||||
 #define PHY_ID_AQR405	0x03a1b4b0
 | 
			
		||||
 #define PHY_ID_AQR113C	0x31c31c12
 | 
			
		||||
 #define PHY_ID_AQR813	0x31c31cb2
 | 
			
		||||
+#define PHY_ID_AQR112	0x03a1b662
 | 
			
		||||
+#define PHY_ID_AQR412	0x03a1b712
 | 
			
		||||
 
 | 
			
		||||
 #define MDIO_PHYXS_VEND_IF_STATUS		0xe812
 | 
			
		||||
 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK	GENMASK(7, 3)
 | 
			
		||||
@@ -151,6 +153,29 @@
 | 
			
		||||
 #define AQR107_OP_IN_PROG_SLEEP		1000
 | 
			
		||||
 #define AQR107_OP_IN_PROG_TIMEOUT	100000
 | 
			
		||||
 
 | 
			
		||||
+/* registers in MDIO_MMD_VEND1 region */
 | 
			
		||||
+#define AQUANTIA_VND1_GLOBAL_SC			0x000
 | 
			
		||||
+#define  AQUANTIA_VND1_GLOBAL_SC_LP		BIT(0xb)
 | 
			
		||||
+
 | 
			
		||||
+/* global start rate, the protocol associated with this speed is used by default
 | 
			
		||||
+ * on SI.
 | 
			
		||||
+ */
 | 
			
		||||
+#define AQUANTIA_VND1_GSTART_RATE		0x31a
 | 
			
		||||
+#define  AQUANTIA_VND1_GSTART_RATE_OFF		0
 | 
			
		||||
+#define  AQUANTIA_VND1_GSTART_RATE_100M		1
 | 
			
		||||
+#define  AQUANTIA_VND1_GSTART_RATE_1G		2
 | 
			
		||||
+#define  AQUANTIA_VND1_GSTART_RATE_10G		3
 | 
			
		||||
+#define  AQUANTIA_VND1_GSTART_RATE_2_5G		4
 | 
			
		||||
+#define  AQUANTIA_VND1_GSTART_RATE_5G		5
 | 
			
		||||
+
 | 
			
		||||
+/* SYSCFG registers for 100M, 1G, 2.5G, 5G, 10G */
 | 
			
		||||
+#define AQUANTIA_VND1_GSYSCFG_BASE		0x31b
 | 
			
		||||
+#define AQUANTIA_VND1_GSYSCFG_100M		0
 | 
			
		||||
+#define AQUANTIA_VND1_GSYSCFG_1G		1
 | 
			
		||||
+#define AQUANTIA_VND1_GSYSCFG_2_5G		2
 | 
			
		||||
+#define AQUANTIA_VND1_GSYSCFG_5G		3
 | 
			
		||||
+#define AQUANTIA_VND1_GSYSCFG_10G		4
 | 
			
		||||
+
 | 
			
		||||
 struct aqr107_hw_stat {
 | 
			
		||||
 	const char *name;
 | 
			
		||||
 	int reg;
 | 
			
		||||
@@ -282,6 +307,51 @@ static int aqr_config_aneg(struct phy_de
 | 
			
		||||
 	return genphy_c45_check_and_restart_aneg(phydev, changed);
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
+static struct {
 | 
			
		||||
+	u16 syscfg;
 | 
			
		||||
+	int cnt;
 | 
			
		||||
+	u16 start_rate;
 | 
			
		||||
+} aquantia_syscfg[PHY_INTERFACE_MODE_MAX] = {
 | 
			
		||||
+	[PHY_INTERFACE_MODE_SGMII] =      {0x04b, AQUANTIA_VND1_GSYSCFG_1G,
 | 
			
		||||
+					   AQUANTIA_VND1_GSTART_RATE_1G},
 | 
			
		||||
+	[PHY_INTERFACE_MODE_2500BASEX] = {0x144, AQUANTIA_VND1_GSYSCFG_2_5G,
 | 
			
		||||
+					   AQUANTIA_VND1_GSTART_RATE_2_5G},
 | 
			
		||||
+	[PHY_INTERFACE_MODE_XGMII] =      {0x100, AQUANTIA_VND1_GSYSCFG_10G,
 | 
			
		||||
+					   AQUANTIA_VND1_GSTART_RATE_10G},
 | 
			
		||||
+	[PHY_INTERFACE_MODE_USXGMII] =    {0x080, AQUANTIA_VND1_GSYSCFG_10G,
 | 
			
		||||
+					   AQUANTIA_VND1_GSTART_RATE_10G},
 | 
			
		||||
+};
 | 
			
		||||
+
 | 
			
		||||
+/* Sets up protocol on system side before calling aqr_config_aneg */
 | 
			
		||||
+static int aqr_config_aneg_set_prot(struct phy_device *phydev)
 | 
			
		||||
+{
 | 
			
		||||
+	int if_type = phydev->interface;
 | 
			
		||||
+	int i;
 | 
			
		||||
+
 | 
			
		||||
+	if (!aquantia_syscfg[if_type].cnt)
 | 
			
		||||
+		return 0;
 | 
			
		||||
+
 | 
			
		||||
+	/* set PHY in low power mode so we can configure protocols */
 | 
			
		||||
+	phy_write_mmd(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GLOBAL_SC,
 | 
			
		||||
+		      AQUANTIA_VND1_GLOBAL_SC_LP);
 | 
			
		||||
+	mdelay(10);
 | 
			
		||||
+
 | 
			
		||||
+	/* set the default rate to enable the SI link */
 | 
			
		||||
+	phy_write_mmd(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GSTART_RATE,
 | 
			
		||||
+		      aquantia_syscfg[if_type].start_rate);
 | 
			
		||||
+
 | 
			
		||||
+	for (i = 0; i <= aquantia_syscfg[if_type].cnt; i++)
 | 
			
		||||
+		phy_write_mmd(phydev, MDIO_MMD_VEND1,
 | 
			
		||||
+			      AQUANTIA_VND1_GSYSCFG_BASE + i,
 | 
			
		||||
+			      aquantia_syscfg[if_type].syscfg);
 | 
			
		||||
+
 | 
			
		||||
+	/* wake PHY back up */
 | 
			
		||||
+	phy_write_mmd(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GLOBAL_SC, 0);
 | 
			
		||||
+	mdelay(10);
 | 
			
		||||
+
 | 
			
		||||
+	return aqr_config_aneg(phydev);
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
 static int aqr_config_intr(struct phy_device *phydev)
 | 
			
		||||
 {
 | 
			
		||||
 	bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED;
 | 
			
		||||
@@ -881,6 +951,30 @@ static struct phy_driver aqr_driver[] =
 | 
			
		||||
 	.get_stats	= aqr107_get_stats,
 | 
			
		||||
 	.link_change_notify = aqr107_link_change_notify,
 | 
			
		||||
 },
 | 
			
		||||
+{
 | 
			
		||||
+	PHY_ID_MATCH_MODEL(PHY_ID_AQR112),
 | 
			
		||||
+	.name		= "Aquantia AQR112",
 | 
			
		||||
+	.probe		= aqr107_probe,
 | 
			
		||||
+	.config_aneg	= aqr_config_aneg_set_prot,
 | 
			
		||||
+	.config_intr	= aqr_config_intr,
 | 
			
		||||
+	.handle_interrupt = aqr_handle_interrupt,
 | 
			
		||||
+	.read_status	= aqr107_read_status,
 | 
			
		||||
+	.get_sset_count	= aqr107_get_sset_count,
 | 
			
		||||
+	.get_strings	= aqr107_get_strings,
 | 
			
		||||
+	.get_stats	= aqr107_get_stats,
 | 
			
		||||
+},
 | 
			
		||||
+{
 | 
			
		||||
+	PHY_ID_MATCH_MODEL(PHY_ID_AQR412),
 | 
			
		||||
+	.name		= "Aquantia AQR412",
 | 
			
		||||
+	.probe		= aqr107_probe,
 | 
			
		||||
+	.config_aneg	= aqr_config_aneg_set_prot,
 | 
			
		||||
+	.config_intr	= aqr_config_intr,
 | 
			
		||||
+	.handle_interrupt = aqr_handle_interrupt,
 | 
			
		||||
+	.read_status	= aqr107_read_status,
 | 
			
		||||
+	.get_sset_count	= aqr107_get_sset_count,
 | 
			
		||||
+	.get_strings	= aqr107_get_strings,
 | 
			
		||||
+	.get_stats	= aqr107_get_stats,
 | 
			
		||||
+},
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
 module_phy_driver(aqr_driver);
 | 
			
		||||
@@ -895,6 +989,8 @@ static struct mdio_device_id __maybe_unu
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
 | 
			
		||||
+	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
 | 
			
		||||
+	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
 | 
			
		||||
 	{ }
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
| 
						 | 
				
			
			@ -1,34 +0,0 @@
 | 
			
		|||
From 5f008cb22f60da4e10375f22266c1a4e20b1252e Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alex Marginean <alexandru.marginean@nxp.com>
 | 
			
		||||
Date: Fri, 20 Sep 2019 18:22:52 +0300
 | 
			
		||||
Subject: [PATCH] drivers: net: phy: aquantia: fix system side protocol
 | 
			
		||||
 misconfiguration
 | 
			
		||||
 | 
			
		||||
Do not set up protocols for speeds that are not supported by FW.  Enabling
 | 
			
		||||
these protocols leads to link issues on system side.
 | 
			
		||||
 | 
			
		||||
Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
 | 
			
		||||
---
 | 
			
		||||
 drivers/net/phy/aquantia_main.c | 8 +++++++-
 | 
			
		||||
 1 file changed, 7 insertions(+), 1 deletion(-)
 | 
			
		||||
 | 
			
		||||
--- a/drivers/net/phy/aquantia_main.c
 | 
			
		||||
+++ b/drivers/net/phy/aquantia_main.c
 | 
			
		||||
@@ -340,10 +340,16 @@ static int aqr_config_aneg_set_prot(stru
 | 
			
		||||
 	phy_write_mmd(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GSTART_RATE,
 | 
			
		||||
 		      aquantia_syscfg[if_type].start_rate);
 | 
			
		||||
 
 | 
			
		||||
-	for (i = 0; i <= aquantia_syscfg[if_type].cnt; i++)
 | 
			
		||||
+	for (i = 0; i <= aquantia_syscfg[if_type].cnt; i++) {
 | 
			
		||||
+		u16 reg = phy_read_mmd(phydev, MDIO_MMD_VEND1,
 | 
			
		||||
+				       AQUANTIA_VND1_GSYSCFG_BASE + i);
 | 
			
		||||
+		if (!reg)
 | 
			
		||||
+			continue;
 | 
			
		||||
+
 | 
			
		||||
 		phy_write_mmd(phydev, MDIO_MMD_VEND1,
 | 
			
		||||
 			      AQUANTIA_VND1_GSYSCFG_BASE + i,
 | 
			
		||||
 			      aquantia_syscfg[if_type].syscfg);
 | 
			
		||||
+	}
 | 
			
		||||
 
 | 
			
		||||
 	/* wake PHY back up */
 | 
			
		||||
 	phy_write_mmd(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GLOBAL_SC, 0);
 | 
			
		||||
| 
						 | 
				
			
			@ -1,43 +0,0 @@
 | 
			
		|||
From 2e677e4ae8f8330f68013163b060d0fda3a43095 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: "Langer, Thomas" <tlanger@maxlinear.com>
 | 
			
		||||
Date: Fri, 9 Jul 2021 17:36:46 +0200
 | 
			
		||||
Subject: [PATCH] PONRTSYS-8842: aquantia: Add AQR113 driver support
 | 
			
		||||
 | 
			
		||||
Add a new entry for AQR113 PHY_ID
 | 
			
		||||
---
 | 
			
		||||
 drivers/net/phy/aquantia_main.c | 10 ++++++++++
 | 
			
		||||
 1 file changed, 10 insertions(+)
 | 
			
		||||
 | 
			
		||||
--- a/drivers/net/phy/aquantia_main.c
 | 
			
		||||
+++ b/drivers/net/phy/aquantia_main.c
 | 
			
		||||
@@ -26,6 +26,7 @@
 | 
			
		||||
 #define PHY_ID_AQR813	0x31c31cb2
 | 
			
		||||
 #define PHY_ID_AQR112	0x03a1b662
 | 
			
		||||
 #define PHY_ID_AQR412	0x03a1b712
 | 
			
		||||
+#define PHY_ID_AQR113	0x31c31c40
 | 
			
		||||
 
 | 
			
		||||
 #define MDIO_PHYXS_VEND_IF_STATUS		0xe812
 | 
			
		||||
 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK	GENMASK(7, 3)
 | 
			
		||||
@@ -981,6 +982,14 @@ static struct phy_driver aqr_driver[] =
 | 
			
		||||
 	.get_strings	= aqr107_get_strings,
 | 
			
		||||
 	.get_stats	= aqr107_get_stats,
 | 
			
		||||
 },
 | 
			
		||||
+{
 | 
			
		||||
+	PHY_ID_MATCH_MODEL(PHY_ID_AQR113),
 | 
			
		||||
+	.name		= "Aquantia AQR113",
 | 
			
		||||
+	.config_aneg	= aqr_config_aneg,
 | 
			
		||||
+	.config_intr	= aqr_config_intr,
 | 
			
		||||
+	.handle_interrupt = aqr_handle_interrupt,
 | 
			
		||||
+	.read_status	= aqr107_read_status,
 | 
			
		||||
+},
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
 module_phy_driver(aqr_driver);
 | 
			
		||||
@@ -997,6 +1006,7 @@ static struct mdio_device_id __maybe_unu
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
 | 
			
		||||
+	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
 | 
			
		||||
 	{ }
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
| 
						 | 
				
			
			@ -1,63 +0,0 @@
 | 
			
		|||
From 3b92ee7b7899b6beffb2b484c58326e36612a873 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Daniel Golle <daniel@makrotopia.org>
 | 
			
		||||
Date: Thu, 23 Dec 2021 14:52:56 +0000
 | 
			
		||||
Subject: [PATCH] net: phy: aquantia: add PHY_ID for AQR112R
 | 
			
		||||
 | 
			
		||||
As advised by Ian Chang this PHY is used in Puzzle devices.
 | 
			
		||||
 | 
			
		||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 | 
			
		||||
---
 | 
			
		||||
 drivers/net/phy/aquantia_main.c | 10 ++++++++++
 | 
			
		||||
 1 file changed, 10 insertions(+)
 | 
			
		||||
 | 
			
		||||
--- a/drivers/net/phy/aquantia_main.c
 | 
			
		||||
+++ b/drivers/net/phy/aquantia_main.c
 | 
			
		||||
@@ -27,6 +27,8 @@
 | 
			
		||||
 #define PHY_ID_AQR112	0x03a1b662
 | 
			
		||||
 #define PHY_ID_AQR412	0x03a1b712
 | 
			
		||||
 #define PHY_ID_AQR113	0x31c31c40
 | 
			
		||||
+#define PHY_ID_AQR112C	0x03a1b790
 | 
			
		||||
+#define PHY_ID_AQR112R	0x31c31d12
 | 
			
		||||
 
 | 
			
		||||
 #define MDIO_PHYXS_VEND_IF_STATUS		0xe812
 | 
			
		||||
 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK	GENMASK(7, 3)
 | 
			
		||||
@@ -990,6 +992,30 @@ static struct phy_driver aqr_driver[] =
 | 
			
		||||
 	.handle_interrupt = aqr_handle_interrupt,
 | 
			
		||||
 	.read_status	= aqr107_read_status,
 | 
			
		||||
 },
 | 
			
		||||
+{
 | 
			
		||||
+	PHY_ID_MATCH_MODEL(PHY_ID_AQR112C),
 | 
			
		||||
+	.name		= "Aquantia AQR112C",
 | 
			
		||||
+	.probe		= aqr107_probe,
 | 
			
		||||
+	.config_aneg	= aqr_config_aneg_set_prot,
 | 
			
		||||
+	.config_intr	= aqr_config_intr,
 | 
			
		||||
+	.handle_interrupt = aqr_handle_interrupt,
 | 
			
		||||
+	.read_status	= aqr107_read_status,
 | 
			
		||||
+	.get_sset_count	= aqr107_get_sset_count,
 | 
			
		||||
+	.get_strings	= aqr107_get_strings,
 | 
			
		||||
+	.get_stats	= aqr107_get_stats,
 | 
			
		||||
+},
 | 
			
		||||
+{
 | 
			
		||||
+	PHY_ID_MATCH_MODEL(PHY_ID_AQR112R),
 | 
			
		||||
+	.name		= "Aquantia AQR112R",
 | 
			
		||||
+	.probe		= aqr107_probe,
 | 
			
		||||
+	.config_aneg	= aqr_config_aneg_set_prot,
 | 
			
		||||
+	.config_intr	= aqr_config_intr,
 | 
			
		||||
+	.handle_interrupt = aqr_handle_interrupt,
 | 
			
		||||
+	.read_status	= aqr107_read_status,
 | 
			
		||||
+	.get_sset_count	= aqr107_get_sset_count,
 | 
			
		||||
+	.get_strings	= aqr107_get_strings,
 | 
			
		||||
+	.get_stats	= aqr107_get_stats,
 | 
			
		||||
+},
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
 module_phy_driver(aqr_driver);
 | 
			
		||||
@@ -1007,6 +1033,8 @@ static struct mdio_device_id __maybe_unu
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
 | 
			
		||||
+	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112C) },
 | 
			
		||||
+	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112R) },
 | 
			
		||||
 	{ }
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
| 
						 | 
				
			
			@ -1,110 +0,0 @@
 | 
			
		|||
Author: Thomas Kupper <thomas.kupper@gmail.com>
 | 
			
		||||
Date:   Wed May 24 21:14:17 2023 +0200
 | 
			
		||||
 | 
			
		||||
kernel: phy: add Aquantia PHY AQR111 & AQR111B0
 | 
			
		||||
 | 
			
		||||
Add the IDs for Aquantia PHY AQR111 and AQR111B0 as found in the GPL sources
 | 
			
		||||
of the Netgear RAX120v2 firmware v1.2.8.40.
 | 
			
		||||
 | 
			
		||||
This is a 5GbE chip but it reports support for 10G. Implement config_init()
 | 
			
		||||
to set max speed to 5G.
 | 
			
		||||
 | 
			
		||||
Signed-off-by: Thomas Kupper <thomas.kupper@gmail.com>
 | 
			
		||||
--- a/drivers/net/phy/aquantia_main.c
 | 
			
		||||
+++ b/drivers/net/phy/aquantia_main.c
 | 
			
		||||
@@ -24,6 +24,8 @@
 | 
			
		||||
 #define PHY_ID_AQR405	0x03a1b4b0
 | 
			
		||||
 #define PHY_ID_AQR113C	0x31c31c12
 | 
			
		||||
 #define PHY_ID_AQR813	0x31c31cb2
 | 
			
		||||
+#define PHY_ID_AQR111	0x03a1b610
 | 
			
		||||
+#define PHY_ID_AQR111B0	0x03a1b612
 | 
			
		||||
 #define PHY_ID_AQR112	0x03a1b662
 | 
			
		||||
 #define PHY_ID_AQR412	0x03a1b712
 | 
			
		||||
 #define PHY_ID_AQR113	0x31c31c40
 | 
			
		||||
@@ -729,6 +731,34 @@ static int aqcs109_config_init(struct ph
 | 
			
		||||
 	return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT);
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
+static int aqr111_config_init(struct phy_device *phydev)
 | 
			
		||||
+{
 | 
			
		||||
+	int ret;
 | 
			
		||||
+
 | 
			
		||||
+	/* Check that the PHY interface type is compatible */
 | 
			
		||||
+	if (phydev->interface != PHY_INTERFACE_MODE_SGMII &&
 | 
			
		||||
+	    phydev->interface != PHY_INTERFACE_MODE_1000BASEKX &&
 | 
			
		||||
+	    phydev->interface != PHY_INTERFACE_MODE_2500BASEX &&
 | 
			
		||||
+	    phydev->interface != PHY_INTERFACE_MODE_XGMII &&
 | 
			
		||||
+	    phydev->interface != PHY_INTERFACE_MODE_USXGMII &&
 | 
			
		||||
+	    phydev->interface != PHY_INTERFACE_MODE_10GKR &&
 | 
			
		||||
+	    phydev->interface != PHY_INTERFACE_MODE_10GBASER &&
 | 
			
		||||
+	    phydev->interface != PHY_INTERFACE_MODE_XAUI &&
 | 
			
		||||
+	    phydev->interface != PHY_INTERFACE_MODE_RXAUI)
 | 
			
		||||
+		return -ENODEV;
 | 
			
		||||
+
 | 
			
		||||
+	WARN(phydev->interface == PHY_INTERFACE_MODE_XGMII,
 | 
			
		||||
+	     "Your devicetree is out of date, please update it. The AQR107 family doesn't support XGMII, maybe you mean USXGMII.\n");
 | 
			
		||||
+
 | 
			
		||||
+	ret = aqr107_wait_reset_complete(phydev);
 | 
			
		||||
+	if (!ret)
 | 
			
		||||
+		aqr107_chip_info(phydev);
 | 
			
		||||
+
 | 
			
		||||
+	/* AQR111 reports supporting speed up to 10G, however only speeds up to 5G are supported. */
 | 
			
		||||
+	phy_set_max_speed(phydev, SPEED_5000);
 | 
			
		||||
+
 | 
			
		||||
+	return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT);
 | 
			
		||||
+}
 | 
			
		||||
 static void aqr107_link_change_notify(struct phy_device *phydev)
 | 
			
		||||
 {
 | 
			
		||||
 	u8 fw_major, fw_minor;
 | 
			
		||||
@@ -961,6 +991,42 @@ static struct phy_driver aqr_driver[] =
 | 
			
		||||
 	.link_change_notify = aqr107_link_change_notify,
 | 
			
		||||
 },
 | 
			
		||||
 {
 | 
			
		||||
+	PHY_ID_MATCH_MODEL(PHY_ID_AQR111),
 | 
			
		||||
+	.name		= "Aquantia AQR111",
 | 
			
		||||
+	.probe		= aqr107_probe,
 | 
			
		||||
+	.config_init	= aqr111_config_init,
 | 
			
		||||
+	.config_aneg    = aqr_config_aneg,
 | 
			
		||||
+	.config_intr	= aqr_config_intr,
 | 
			
		||||
+	.handle_interrupt = aqr_handle_interrupt,
 | 
			
		||||
+	.read_status	= aqr107_read_status,
 | 
			
		||||
+	.get_tunable    = aqr107_get_tunable,
 | 
			
		||||
+	.set_tunable    = aqr107_set_tunable,
 | 
			
		||||
+	.suspend	= aqr107_suspend,
 | 
			
		||||
+	.resume		= aqr107_resume,
 | 
			
		||||
+	.get_sset_count	= aqr107_get_sset_count,
 | 
			
		||||
+	.get_strings	= aqr107_get_strings,
 | 
			
		||||
+	.get_stats	= aqr107_get_stats,
 | 
			
		||||
+	.link_change_notify = aqr107_link_change_notify,
 | 
			
		||||
+},
 | 
			
		||||
+{
 | 
			
		||||
+	PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0),
 | 
			
		||||
+	.name		= "Aquantia AQR111B0",
 | 
			
		||||
+	.probe		= aqr107_probe,
 | 
			
		||||
+	.config_init	= aqr111_config_init,
 | 
			
		||||
+	.config_aneg    = aqr_config_aneg,
 | 
			
		||||
+	.config_intr	= aqr_config_intr,
 | 
			
		||||
+	.handle_interrupt = aqr_handle_interrupt,
 | 
			
		||||
+	.read_status	= aqr107_read_status,
 | 
			
		||||
+	.get_tunable    = aqr107_get_tunable,
 | 
			
		||||
+	.set_tunable    = aqr107_set_tunable,
 | 
			
		||||
+	.suspend	= aqr107_suspend,
 | 
			
		||||
+	.resume		= aqr107_resume,
 | 
			
		||||
+	.get_sset_count	= aqr107_get_sset_count,
 | 
			
		||||
+	.get_strings	= aqr107_get_strings,
 | 
			
		||||
+	.get_stats	= aqr107_get_stats,
 | 
			
		||||
+	.link_change_notify = aqr107_link_change_notify,
 | 
			
		||||
+},
 | 
			
		||||
+{
 | 
			
		||||
 	PHY_ID_MATCH_MODEL(PHY_ID_AQR112),
 | 
			
		||||
 	.name		= "Aquantia AQR112",
 | 
			
		||||
 	.probe		= aqr107_probe,
 | 
			
		||||
@@ -1030,6 +1096,8 @@ static struct mdio_device_id __maybe_unu
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
 | 
			
		||||
+	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
 | 
			
		||||
+	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR412) },
 | 
			
		||||
 	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue