kernel: bump 6.1 to 6.1.60
[openwrt/openwrt.git] / target / linux / generic / backport-6.1 / 832-v6.7-net-phy-amd-Support-the-Altima-AMI101L.patch
1 From 49e5663b505070424e18099841943f34342aa405 Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Sun, 24 Sep 2023 01:09:01 +0200
4 Subject: [PATCH] net: phy: amd: Support the Altima AMI101L
5
6 The Altima AC101L is obviously compatible with the AMD PHY,
7 as seen by reading the datasheet.
8
9 Datasheet: https://docs.broadcom.com/doc/AC101L-DS05-405-RDS.pdf
10
11 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
12 ---
13 drivers/net/phy/Kconfig | 4 ++--
14 drivers/net/phy/amd.c | 33 +++++++++++++++++++++++----------
15 2 files changed, 25 insertions(+), 12 deletions(-)
16
17 --- a/drivers/net/phy/Kconfig
18 +++ b/drivers/net/phy/Kconfig
19 @@ -72,9 +72,9 @@ config SFP
20 comment "MII PHY device drivers"
21
22 config AMD_PHY
23 - tristate "AMD PHYs"
24 + tristate "AMD and Altima PHYs"
25 help
26 - Currently supports the am79c874
27 + Currently supports the AMD am79c874 and Altima AC101L.
28
29 config MESON_GXL_PHY
30 tristate "Amlogic Meson GXL Internal PHY"
31 --- a/drivers/net/phy/amd.c
32 +++ b/drivers/net/phy/amd.c
33 @@ -13,6 +13,7 @@
34 #include <linux/mii.h>
35 #include <linux/phy.h>
36
37 +#define PHY_ID_AC101L 0x00225520
38 #define PHY_ID_AM79C874 0x0022561b
39
40 #define MII_AM79C_IR 17 /* Interrupt Status/Control Register */
41 @@ -87,19 +88,31 @@ static irqreturn_t am79c_handle_interrup
42 return IRQ_HANDLED;
43 }
44
45 -static struct phy_driver am79c_driver[] = { {
46 - .phy_id = PHY_ID_AM79C874,
47 - .name = "AM79C874",
48 - .phy_id_mask = 0xfffffff0,
49 - /* PHY_BASIC_FEATURES */
50 - .config_init = am79c_config_init,
51 - .config_intr = am79c_config_intr,
52 - .handle_interrupt = am79c_handle_interrupt,
53 -} };
54 +static struct phy_driver am79c_drivers[] = {
55 + {
56 + .phy_id = PHY_ID_AM79C874,
57 + .name = "AM79C874",
58 + .phy_id_mask = 0xfffffff0,
59 + /* PHY_BASIC_FEATURES */
60 + .config_init = am79c_config_init,
61 + .config_intr = am79c_config_intr,
62 + .handle_interrupt = am79c_handle_interrupt,
63 + },
64 + {
65 + .phy_id = PHY_ID_AC101L,
66 + .name = "AC101L",
67 + .phy_id_mask = 0xfffffff0,
68 + /* PHY_BASIC_FEATURES */
69 + .config_init = am79c_config_init,
70 + .config_intr = am79c_config_intr,
71 + .handle_interrupt = am79c_handle_interrupt,
72 + },
73 +};
74
75 -module_phy_driver(am79c_driver);
76 +module_phy_driver(am79c_drivers);
77
78 static struct mdio_device_id __maybe_unused amd_tbl[] = {
79 + { PHY_ID_AC101L, 0xfffffff0 },
80 { PHY_ID_AM79C874, 0xfffffff0 },
81 { }
82 };