generic: Support Altima AMI101L PHY
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 23 Oct 2023 06:43:05 +0000 (08:43 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 25 Oct 2023 09:27:50 +0000 (11:27 +0200)
This is a backport of the patch to support the Altima AMI101L
PHY which is merged for the v6.7 kernel. This PHY is used in the
IXP4xx-based USRobotics USR8200.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
target/linux/generic/backport-6.1/832-v6.7-net-phy-amd-Support-the-Altima-AMI101L.patch [new file with mode: 0644]

diff --git a/target/linux/generic/backport-6.1/832-v6.7-net-phy-amd-Support-the-Altima-AMI101L.patch b/target/linux/generic/backport-6.1/832-v6.7-net-phy-amd-Support-the-Altima-AMI101L.patch
new file mode 100644 (file)
index 0000000..c2ecc5b
--- /dev/null
@@ -0,0 +1,82 @@
+From 49e5663b505070424e18099841943f34342aa405 Mon Sep 17 00:00:00 2001
+From: Linus Walleij <linus.walleij@linaro.org>
+Date: Sun, 24 Sep 2023 01:09:01 +0200
+Subject: [PATCH] net: phy: amd: Support the Altima AMI101L
+
+The Altima AC101L is obviously compatible with the AMD PHY,
+as seen by reading the datasheet.
+
+Datasheet: https://docs.broadcom.com/doc/AC101L-DS05-405-RDS.pdf
+
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+---
+ drivers/net/phy/Kconfig |  4 ++--
+ drivers/net/phy/amd.c   | 33 +++++++++++++++++++++++----------
+ 2 files changed, 25 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/phy/Kconfig
++++ b/drivers/net/phy/Kconfig
+@@ -146,9 +146,9 @@ endif # RTL8366_SMI
+ comment "MII PHY device drivers"
+ config AMD_PHY
+-      tristate "AMD PHYs"
++      tristate "AMD and Altima PHYs"
+       help
+-        Currently supports the am79c874
++        Currently supports the AMD am79c874 and Altima AC101L.
+ config MESON_GXL_PHY
+       tristate "Amlogic Meson GXL Internal PHY"
+--- a/drivers/net/phy/amd.c
++++ b/drivers/net/phy/amd.c
+@@ -13,6 +13,7 @@
+ #include <linux/mii.h>
+ #include <linux/phy.h>
++#define PHY_ID_AC101L         0x00225520
+ #define PHY_ID_AM79C874               0x0022561b
+ #define MII_AM79C_IR          17      /* Interrupt Status/Control Register */
+@@ -87,19 +88,31 @@ static irqreturn_t am79c_handle_interrup
+       return IRQ_HANDLED;
+ }
+-static struct phy_driver am79c_driver[] = { {
+-      .phy_id         = PHY_ID_AM79C874,
+-      .name           = "AM79C874",
+-      .phy_id_mask    = 0xfffffff0,
+-      /* PHY_BASIC_FEATURES */
+-      .config_init    = am79c_config_init,
+-      .config_intr    = am79c_config_intr,
+-      .handle_interrupt = am79c_handle_interrupt,
+-} };
++static struct phy_driver am79c_drivers[] = {
++      {
++              .phy_id         = PHY_ID_AM79C874,
++              .name           = "AM79C874",
++              .phy_id_mask    = 0xfffffff0,
++              /* PHY_BASIC_FEATURES */
++              .config_init    = am79c_config_init,
++              .config_intr    = am79c_config_intr,
++              .handle_interrupt = am79c_handle_interrupt,
++      },
++      {
++              .phy_id         = PHY_ID_AC101L,
++              .name           = "AC101L",
++              .phy_id_mask    = 0xfffffff0,
++              /* PHY_BASIC_FEATURES */
++              .config_init    = am79c_config_init,
++              .config_intr    = am79c_config_intr,
++              .handle_interrupt = am79c_handle_interrupt,
++      },
++};
+-module_phy_driver(am79c_driver);
++module_phy_driver(am79c_drivers);
+ static struct mdio_device_id __maybe_unused amd_tbl[] = {
++      { PHY_ID_AC101L, 0xfffffff0 },
+       { PHY_ID_AM79C874, 0xfffffff0 },
+       { }
+ };