generic: replace simple AQR hack patch with upstream version
authorChristian Marangi <ansuelsmth@gmail.com>
Thu, 15 Feb 2024 20:23:38 +0000 (21:23 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 21 Feb 2024 01:34:32 +0000 (02:34 +0100)
Simple AQR hack patch has been merged upstream, hence we can drop it from
hack directory and move it to backport.

The patch for 5.15 are correctly reworked to align to outdated API.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
18 files changed:
target/linux/generic/backport-5.15/738-v6.9-net-phy-aquantia-add-AQR111-and-AQR111B0-PHY-ID.patch [new file with mode: 0644]
target/linux/generic/backport-5.15/739-v6.9-net-phy-aquantia-add-AQR113-PHY-ID.patch [new file with mode: 0644]
target/linux/generic/backport-5.15/740-v6.9-net-phy-aquantia-add-AQR813-PHY-ID.patch [new file with mode: 0644]
target/linux/generic/backport-6.1/760-v6.9-net-phy-aquantia-add-AQR111-and-AQR111B0-PHY-ID.patch [new file with mode: 0644]
target/linux/generic/backport-6.1/761-v6.9-net-phy-aquantia-add-AQR113-PHY-ID.patch [new file with mode: 0644]
target/linux/generic/backport-6.1/762-v6.9-net-phy-aquantia-add-AQR813-PHY-ID.patch [new file with mode: 0644]
target/linux/generic/hack-5.15/720-net-phy-add-aqr-phys.patch [deleted file]
target/linux/generic/hack-5.15/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch
target/linux/generic/hack-5.15/723-net-phy-aquantia-fix-system-side-protocol-mi.patch
target/linux/generic/hack-5.15/724-net-phy-aquantia-Add-AQR113-driver-support.patch [deleted file]
target/linux/generic/hack-5.15/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch
target/linux/generic/hack-5.15/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch [deleted file]
target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch [deleted file]
target/linux/generic/hack-6.1/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch
target/linux/generic/hack-6.1/723-net-phy-aquantia-fix-system-side-protocol-mi.patch
target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch [deleted file]
target/linux/generic/hack-6.1/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch
target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch [deleted file]

diff --git a/target/linux/generic/backport-5.15/738-v6.9-net-phy-aquantia-add-AQR111-and-AQR111B0-PHY-ID.patch b/target/linux/generic/backport-5.15/738-v6.9-net-phy-aquantia-add-AQR111-and-AQR111B0-PHY-ID.patch
new file mode 100644 (file)
index 0000000..d130794
--- /dev/null
@@ -0,0 +1,100 @@
+From 038ba1dc4e54d51d953f5618d8eb5dd39bd9de25 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Tue, 13 Feb 2024 14:35:51 +0100
+Subject: [PATCH] net: phy: aquantia: add AQR111 and AQR111B0 PHY ID
+
+Add Aquantia AQR111 and AQR111B0 PHY ID. These PHY advertise 10G speed
+but actually supports up to 5G speed, hence some manual fixup is needed.
+
+The Aquantia AQR111B0 PHY is just a variant of the AQR111 with smaller
+chip size.
+
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Link: https://lore.kernel.org/r/20240213133558.1836-1-ansuelsmth@gmail.com
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+---
+ drivers/net/phy/aquantia/aquantia_main.c | 52 ++++++++++++++++++++++++
+ 1 file changed, 52 insertions(+)
+
+--- a/drivers/net/phy/aquantia/aquantia_main.c
++++ b/drivers/net/phy/aquantia/aquantia_main.c
+@@ -22,6 +22,8 @@
+ #define PHY_ID_AQR107 0x03a1b4e0
+ #define PHY_ID_AQCS109        0x03a1b5c2
+ #define PHY_ID_AQR405 0x03a1b4b0
++#define PHY_ID_AQR111 0x03a1b610
++#define PHY_ID_AQR111B0       0x03a1b612
+ #define PHY_ID_AQR113C        0x31c31c12
+ #define MDIO_PHYXS_VEND_IF_STATUS             0xe812
+@@ -672,6 +674,16 @@ static int aqr107_probe(struct phy_devic
+       return aqr_hwmon_probe(phydev);
+ }
++static int aqr111_config_init(struct phy_device *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_config_init(phydev);
++}
++
+ static struct phy_driver aqr_driver[] = {
+ {
+       PHY_ID_MATCH_MODEL(PHY_ID_AQ1202),
+@@ -746,6 +758,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_AQR405),
+       .name           = "Aquantia AQR405",
+       .config_aneg    = aqr_config_aneg,
+@@ -784,6 +832,8 @@ static struct mdio_device_id __maybe_unu
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR107) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
++      { PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
++      { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
+       { }
+ };
diff --git a/target/linux/generic/backport-5.15/739-v6.9-net-phy-aquantia-add-AQR113-PHY-ID.patch b/target/linux/generic/backport-5.15/739-v6.9-net-phy-aquantia-add-AQR113-PHY-ID.patch
new file mode 100644 (file)
index 0000000..5a46ab3
--- /dev/null
@@ -0,0 +1,59 @@
+From 71b605d32017e5b8d257db7344bc2f8e8fcc973e Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Thu, 15 Feb 2024 16:30:05 +0100
+Subject: [PATCH] net: phy: aquantia: add AQR113 PHY ID
+
+Add Aquantia AQR113 PHY ID. Aquantia AQR113 is just a chip size variant of
+the already supported AQR133C where the only difference is the PHY ID
+and the hw chip size.
+
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/phy/aquantia/aquantia_main.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+--- a/drivers/net/phy/aquantia/aquantia_main.c
++++ b/drivers/net/phy/aquantia/aquantia_main.c
+@@ -24,6 +24,7 @@
+ #define PHY_ID_AQR405 0x03a1b4b0
+ #define PHY_ID_AQR111 0x03a1b610
+ #define PHY_ID_AQR111B0       0x03a1b612
++#define PHY_ID_AQR113 0x31c31c40
+ #define PHY_ID_AQR113C        0x31c31c12
+ #define MDIO_PHYXS_VEND_IF_STATUS             0xe812
+@@ -802,6 +803,24 @@ static struct phy_driver aqr_driver[] =
+       .read_status    = aqr_read_status,
+ },
+ {
++      PHY_ID_MATCH_MODEL(PHY_ID_AQR113),
++      .name           = "Aquantia AQR113",
++      .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    = 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_AQR113C),
+       .name           = "Aquantia AQR113C",
+       .probe          = aqr107_probe,
+@@ -834,6 +853,7 @@ static struct mdio_device_id __maybe_unu
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
++      { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
+       { }
+ };
diff --git a/target/linux/generic/backport-5.15/740-v6.9-net-phy-aquantia-add-AQR813-PHY-ID.patch b/target/linux/generic/backport-5.15/740-v6.9-net-phy-aquantia-add-AQR813-PHY-ID.patch
new file mode 100644 (file)
index 0000000..49651a5
--- /dev/null
@@ -0,0 +1,58 @@
+From 6d47302a3f0ba31445478d518d98bd55918bc8ab Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Thu, 15 Feb 2024 22:43:30 +0100
+Subject: [PATCH] net: phy: aquantia: add AQR813 PHY ID
+
+Aquantia AQR813 is the Octal Port variant of the AQR113. Add PHY ID for
+it to provide support for it.
+
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/phy/aquantia/aquantia_main.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+--- a/drivers/net/phy/aquantia/aquantia_main.c
++++ b/drivers/net/phy/aquantia/aquantia_main.c
+@@ -26,6 +26,7 @@
+ #define PHY_ID_AQR111B0       0x03a1b612
+ #define PHY_ID_AQR113 0x31c31c40
+ #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)
+@@ -839,6 +840,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    = 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,
++},
+ };
+ module_phy_driver(aqr_driver);
+@@ -855,6 +874,7 @@ static struct mdio_device_id __maybe_unu
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
++      { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
+       { }
+ };
diff --git a/target/linux/generic/backport-6.1/760-v6.9-net-phy-aquantia-add-AQR111-and-AQR111B0-PHY-ID.patch b/target/linux/generic/backport-6.1/760-v6.9-net-phy-aquantia-add-AQR111-and-AQR111B0-PHY-ID.patch
new file mode 100644 (file)
index 0000000..32ac37e
--- /dev/null
@@ -0,0 +1,102 @@
+From 038ba1dc4e54d51d953f5618d8eb5dd39bd9de25 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Tue, 13 Feb 2024 14:35:51 +0100
+Subject: [PATCH] net: phy: aquantia: add AQR111 and AQR111B0 PHY ID
+
+Add Aquantia AQR111 and AQR111B0 PHY ID. These PHY advertise 10G speed
+but actually supports up to 5G speed, hence some manual fixup is needed.
+
+The Aquantia AQR111B0 PHY is just a variant of the AQR111 with smaller
+chip size.
+
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Link: https://lore.kernel.org/r/20240213133558.1836-1-ansuelsmth@gmail.com
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+---
+ drivers/net/phy/aquantia/aquantia_main.c | 52 ++++++++++++++++++++++++
+ 1 file changed, 52 insertions(+)
+
+--- a/drivers/net/phy/aquantia/aquantia_main.c
++++ b/drivers/net/phy/aquantia/aquantia_main.c
+@@ -22,6 +22,8 @@
+ #define PHY_ID_AQR107 0x03a1b4e0
+ #define PHY_ID_AQCS109        0x03a1b5c2
+ #define PHY_ID_AQR405 0x03a1b4b0
++#define PHY_ID_AQR111 0x03a1b610
++#define PHY_ID_AQR111B0       0x03a1b612
+ #define PHY_ID_AQR113C        0x31c31c12
+ #define MDIO_PHYXS_VEND_IF_STATUS             0xe812
+@@ -670,6 +672,16 @@ static int aqr107_probe(struct phy_devic
+       return aqr_hwmon_probe(phydev);
+ }
++static int aqr111_config_init(struct phy_device *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_config_init(phydev);
++}
++
+ static struct phy_driver aqr_driver[] = {
+ {
+       PHY_ID_MATCH_MODEL(PHY_ID_AQ1202),
+@@ -744,6 +756,44 @@ 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,
++      .get_rate_matching = aqr107_get_rate_matching,
++      .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,
++      .get_rate_matching = aqr107_get_rate_matching,
++      .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_AQR405),
+       .name           = "Aquantia AQR405",
+       .config_aneg    = aqr_config_aneg,
+@@ -782,6 +832,8 @@ static struct mdio_device_id __maybe_unu
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR107) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
++      { PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
++      { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
+       { }
+ };
diff --git a/target/linux/generic/backport-6.1/761-v6.9-net-phy-aquantia-add-AQR113-PHY-ID.patch b/target/linux/generic/backport-6.1/761-v6.9-net-phy-aquantia-add-AQR113-PHY-ID.patch
new file mode 100644 (file)
index 0000000..073bbbd
--- /dev/null
@@ -0,0 +1,60 @@
+From 71b605d32017e5b8d257db7344bc2f8e8fcc973e Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Thu, 15 Feb 2024 16:30:05 +0100
+Subject: [PATCH] net: phy: aquantia: add AQR113 PHY ID
+
+Add Aquantia AQR113 PHY ID. Aquantia AQR113 is just a chip size variant of
+the already supported AQR133C where the only difference is the PHY ID
+and the hw chip size.
+
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/phy/aquantia/aquantia_main.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+--- a/drivers/net/phy/aquantia/aquantia_main.c
++++ b/drivers/net/phy/aquantia/aquantia_main.c
+@@ -24,6 +24,7 @@
+ #define PHY_ID_AQR405 0x03a1b4b0
+ #define PHY_ID_AQR111 0x03a1b610
+ #define PHY_ID_AQR111B0       0x03a1b612
++#define PHY_ID_AQR113 0x31c31c40
+ #define PHY_ID_AQR113C        0x31c31c12
+ #define MDIO_PHYXS_VEND_IF_STATUS             0xe812
+@@ -802,6 +803,25 @@ static struct phy_driver aqr_driver[] =
+       .read_status    = aqr_read_status,
+ },
+ {
++      PHY_ID_MATCH_MODEL(PHY_ID_AQR113),
++      .name           = "Aquantia AQR113",
++      .probe          = aqr107_probe,
++      .get_rate_matching = aqr107_get_rate_matching,
++      .config_init    = aqr107_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_AQR113C),
+       .name           = "Aquantia AQR113C",
+       .probe          = aqr107_probe,
+@@ -834,6 +854,7 @@ static struct mdio_device_id __maybe_unu
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR111) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
++      { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
+       { }
+ };
diff --git a/target/linux/generic/backport-6.1/762-v6.9-net-phy-aquantia-add-AQR813-PHY-ID.patch b/target/linux/generic/backport-6.1/762-v6.9-net-phy-aquantia-add-AQR813-PHY-ID.patch
new file mode 100644 (file)
index 0000000..965b8c9
--- /dev/null
@@ -0,0 +1,59 @@
+From 6d47302a3f0ba31445478d518d98bd55918bc8ab Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Thu, 15 Feb 2024 22:43:30 +0100
+Subject: [PATCH] net: phy: aquantia: add AQR813 PHY ID
+
+Aquantia AQR813 is the Octal Port variant of the AQR113. Add PHY ID for
+it to provide support for it.
+
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/phy/aquantia/aquantia_main.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+--- a/drivers/net/phy/aquantia/aquantia_main.c
++++ b/drivers/net/phy/aquantia/aquantia_main.c
+@@ -26,6 +26,7 @@
+ #define PHY_ID_AQR111B0       0x03a1b612
+ #define PHY_ID_AQR113 0x31c31c40
+ #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)
+@@ -840,6 +841,25 @@ 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,
++      .get_rate_matching = aqr107_get_rate_matching,
++      .config_init    = aqr107_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,
++},
+ };
+ module_phy_driver(aqr_driver);
+@@ -856,6 +876,7 @@ static struct mdio_device_id __maybe_unu
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR111B0) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
++      { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
+       { }
+ };
diff --git a/target/linux/generic/hack-5.15/720-net-phy-add-aqr-phys.patch b/target/linux/generic/hack-5.15/720-net-phy-add-aqr-phys.patch
deleted file mode 100644 (file)
index c4a9159..0000000
+++ /dev/null
@@ -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/aquantia_main.c
-+++ b/drivers/net/phy/aquantia/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)
-@@ -360,6 +361,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;
-@@ -499,7 +543,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);
- }
-@@ -762,7 +806,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,
-@@ -772,6 +816,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);
-@@ -785,6 +847,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) },
-       { }
- };
index 6ec0db2526d6252bbfce91d916488ee8c2da24cf..d003291f755aea01411052eded0617c85e77f625 100644 (file)
@@ -15,8 +15,8 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
 
 --- a/drivers/net/phy/aquantia/aquantia_main.c
 +++ b/drivers/net/phy/aquantia/aquantia_main.c
-@@ -24,6 +24,8 @@
- #define PHY_ID_AQR405 0x03a1b4b0
+@@ -27,6 +27,8 @@
+ #define PHY_ID_AQR113 0x31c31c40
  #define PHY_ID_AQR113C        0x31c31c12
  #define PHY_ID_AQR813 0x31c31cb2
 +#define PHY_ID_AQR112 0x03a1b662
@@ -24,7 +24,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
  
  #define MDIO_PHYXS_VEND_IF_STATUS             0xe812
  #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK   GENMASK(7, 3)
-@@ -96,6 +98,29 @@
+@@ -99,6 +101,29 @@
  #define AQR107_OP_IN_PROG_SLEEP               1000
  #define AQR107_OP_IN_PROG_TIMEOUT     100000
  
@@ -54,7 +54,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
  struct aqr107_hw_stat {
        const char *name;
        int reg;
-@@ -227,6 +252,51 @@ static int aqr_config_aneg(struct phy_de
+@@ -230,6 +255,51 @@ static int aqr_config_aneg(struct phy_de
        return genphy_c45_check_and_restart_aneg(phydev, changed);
  }
  
@@ -106,7 +106,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
  static int aqr_config_intr(struct phy_device *phydev)
  {
        bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED;
-@@ -834,6 +904,30 @@ static struct phy_driver aqr_driver[] =
+@@ -858,6 +928,30 @@ static struct phy_driver aqr_driver[] =
        .get_stats      = aqr107_get_stats,
        .link_change_notify = aqr107_link_change_notify,
  },
@@ -137,8 +137,8 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
  };
  
  module_phy_driver(aqr_driver);
-@@ -848,6 +942,8 @@ static struct mdio_device_id __maybe_unu
-       { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
+@@ -875,6 +969,8 @@ static struct mdio_device_id __maybe_unu
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
        { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
        { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
 +      { PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
index 33b182eab9255792dd4cf8f9c14b4a987720d867..72a70ebc140a9465daf04346dc6afdd4228861a5 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
 
 --- a/drivers/net/phy/aquantia/aquantia_main.c
 +++ b/drivers/net/phy/aquantia/aquantia_main.c
-@@ -285,10 +285,16 @@ static int aqr_config_aneg_set_prot(stru
+@@ -288,10 +288,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);
  
diff --git a/target/linux/generic/hack-5.15/724-net-phy-aquantia-Add-AQR113-driver-support.patch b/target/linux/generic/hack-5.15/724-net-phy-aquantia-Add-AQR113-driver-support.patch
deleted file mode 100644 (file)
index a31b327..0000000
+++ /dev/null
@@ -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/aquantia_main.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
---- a/drivers/net/phy/aquantia/aquantia_main.c
-+++ b/drivers/net/phy/aquantia/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)
-@@ -923,6 +924,14 @@ static struct phy_driver aqr_driver[] =
-       .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,
-+},
-+{
-       PHY_ID_MATCH_MODEL(PHY_ID_AQR412),
-       .name           = "Aquantia AQR412",
-       .probe          = aqr107_probe,
-@@ -950,6 +959,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) },
-       { }
- };
index b2f79f4d5862c75d1eed84a82e4832f5390a7dca..2193844e64a7846c99fcf760171454091f4d79e8 100644 (file)
@@ -12,17 +12,17 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 
 --- a/drivers/net/phy/aquantia/aquantia_main.c
 +++ b/drivers/net/phy/aquantia/aquantia_main.c
-@@ -27,6 +27,8 @@
+@@ -29,6 +29,8 @@
+ #define PHY_ID_AQR813 0x31c31cb2
  #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)
-@@ -924,6 +926,30 @@ static struct phy_driver aqr_driver[] =
-       .get_stats      = aqr107_get_stats,
+@@ -880,6 +882,30 @@ static struct phy_driver aqr_driver[] =
+       .read_status    = aqr_read_status,
  },
  {
 +      PHY_ID_MATCH_MODEL(PHY_ID_AQR112C),
@@ -51,11 +51,11 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +{
        PHY_ID_MATCH_MODEL(PHY_ID_AQR113),
        .name           = "Aquantia AQR113",
-       .config_aneg    = aqr_config_aneg,
-@@ -960,6 +986,8 @@ static struct mdio_device_id __maybe_unu
+       .probe          = aqr107_probe,
+@@ -977,6 +1003,8 @@ 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) },
 +      { PHY_ID_MATCH_MODEL(PHY_ID_AQR112C) },
 +      { PHY_ID_MATCH_MODEL(PHY_ID_AQR112R) },
        { }
diff --git a/target/linux/generic/hack-5.15/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch b/target/linux/generic/hack-5.15/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch
deleted file mode 100644 (file)
index 3d2c861..0000000
+++ /dev/null
@@ -1,109 +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/aquantia_main.c
-+++ b/drivers/net/phy/aquantia/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
-@@ -676,6 +678,33 @@ 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_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)
-+              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. */
-+      ret = phy_set_max_speed(phydev, SPEED_5000);
-+      if (ret)
-+              return ret;
-+
-+      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;
-@@ -914,6 +943,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,
-@@ -983,6 +1048,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) },
diff --git a/target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch b/target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch
deleted file mode 100644 (file)
index df04511..0000000
+++ /dev/null
@@ -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/aquantia_main.c
-+++ b/drivers/net/phy/aquantia/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)
-@@ -360,6 +361,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;
-@@ -499,7 +543,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);
- }
-@@ -760,7 +804,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,
-@@ -770,6 +814,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);
-@@ -783,6 +845,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) },
-       { }
- };
index 3823050e341d7a9c9278c7bb902e8b1b8003b9e1..faaa40f9bda7c773afa83c5d4ecad5537bca94d0 100644 (file)
@@ -15,8 +15,8 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
 
 --- a/drivers/net/phy/aquantia/aquantia_main.c
 +++ b/drivers/net/phy/aquantia/aquantia_main.c
-@@ -24,6 +24,8 @@
- #define PHY_ID_AQR405 0x03a1b4b0
+@@ -27,6 +27,8 @@
+ #define PHY_ID_AQR113 0x31c31c40
  #define PHY_ID_AQR113C        0x31c31c12
  #define PHY_ID_AQR813 0x31c31cb2
 +#define PHY_ID_AQR112 0x03a1b662
@@ -24,7 +24,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
  
  #define MDIO_PHYXS_VEND_IF_STATUS             0xe812
  #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK   GENMASK(7, 3)
-@@ -96,6 +98,29 @@
+@@ -99,6 +101,29 @@
  #define AQR107_OP_IN_PROG_SLEEP               1000
  #define AQR107_OP_IN_PROG_TIMEOUT     100000
  
@@ -54,7 +54,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
  struct aqr107_hw_stat {
        const char *name;
        int reg;
-@@ -227,6 +252,51 @@ static int aqr_config_aneg(struct phy_de
+@@ -230,6 +255,51 @@ static int aqr_config_aneg(struct phy_de
        return genphy_c45_check_and_restart_aneg(phydev, changed);
  }
  
@@ -106,7 +106,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
  static int aqr_config_intr(struct phy_device *phydev)
  {
        bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED;
-@@ -832,6 +902,30 @@ static struct phy_driver aqr_driver[] =
+@@ -860,6 +930,30 @@ static struct phy_driver aqr_driver[] =
        .get_stats      = aqr107_get_stats,
        .link_change_notify = aqr107_link_change_notify,
  },
@@ -137,8 +137,8 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
  };
  
  module_phy_driver(aqr_driver);
-@@ -846,6 +940,8 @@ static struct mdio_device_id __maybe_unu
-       { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
+@@ -877,6 +971,8 @@ static struct mdio_device_id __maybe_unu
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) },
        { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
        { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
 +      { PHY_ID_MATCH_MODEL(PHY_ID_AQR112) },
index 33b182eab9255792dd4cf8f9c14b4a987720d867..72a70ebc140a9465daf04346dc6afdd4228861a5 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
 
 --- a/drivers/net/phy/aquantia/aquantia_main.c
 +++ b/drivers/net/phy/aquantia/aquantia_main.c
-@@ -285,10 +285,16 @@ static int aqr_config_aneg_set_prot(stru
+@@ -288,10 +288,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);
  
diff --git a/target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch b/target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch
deleted file mode 100644 (file)
index f59a88a..0000000
+++ /dev/null
@@ -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/aquantia_main.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
---- a/drivers/net/phy/aquantia/aquantia_main.c
-+++ b/drivers/net/phy/aquantia/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)
-@@ -932,6 +933,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);
-@@ -948,6 +957,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) },
-       { }
- };
index c29c36aa22aad899d4f112f37f1304a98363374d..d83cc48a33ae5756ccb9c6b344ce0c526f666a9f 100644 (file)
@@ -12,18 +12,18 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 
 --- a/drivers/net/phy/aquantia/aquantia_main.c
 +++ b/drivers/net/phy/aquantia/aquantia_main.c
-@@ -27,6 +27,8 @@
+@@ -29,6 +29,8 @@
+ #define PHY_ID_AQR813 0x31c31cb2
  #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)
-@@ -941,6 +943,30 @@ static struct phy_driver aqr_driver[] =
-       .handle_interrupt = aqr_handle_interrupt,
-       .read_status    = aqr107_read_status,
+@@ -960,6 +962,30 @@ static struct phy_driver aqr_driver[] =
+       .get_strings    = aqr107_get_strings,
+       .get_stats      = aqr107_get_stats,
  },
 +{
 +      PHY_ID_MATCH_MODEL(PHY_ID_AQR112C),
@@ -52,10 +52,10 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  };
  
  module_phy_driver(aqr_driver);
-@@ -958,6 +984,8 @@ static struct mdio_device_id __maybe_unu
+@@ -979,6 +1005,8 @@ 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) },
 +      { PHY_ID_MATCH_MODEL(PHY_ID_AQR112C) },
 +      { PHY_ID_MATCH_MODEL(PHY_ID_AQR112R) },
        { }
diff --git a/target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch b/target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch
deleted file mode 100644 (file)
index dbae8f5..0000000
+++ /dev/null
@@ -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/aquantia_main.c
-+++ b/drivers/net/phy/aquantia/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
-@@ -674,6 +676,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;
-@@ -912,6 +942,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,
-@@ -981,6 +1047,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) },