Skip to contentSkip to conversation

net/axgbe: added marvel m88e1512 PHY support

PATCH In review Ashok Kumar Natarajan 2 participants 2 messages Feb 16 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/axgbe: added marvel m88e1512 PHY support

Added marvel m88e1512 1G PHY support in amd axgbe driver

---
 .mailmap                           |   1 +
 drivers/net/axgbe/axgbe_ethdev.h   |   4 +
 drivers/net/axgbe/axgbe_mdio.c     |   4 +-
 drivers/net/axgbe/axgbe_phy.h      |  32 +++
 drivers/net/axgbe/axgbe_phy_impl.c | 309 ++++++++++++++++++++++++++++-
 5 files changed, 343 insertions(+), 7 deletions(-)
.mailmap +1 -0
index 8bbfcc1703..6f951bcd92 100644
@@ -165,6 +165,7 @@ Ashish Paul <[email protected]>
 Ashish Sadanandan <[email protected]>
 Ashish Shah <[email protected]>
 Ashok Kaladi <[email protected]>
+Ashok Kumar Natarajan <[email protected]>
 Ashwin Sekhar T K <[email protected]> <[email protected]>
 Asim Jamshed <[email protected]>
 Atul Patel <[email protected]>
drivers/net/axgbe/axgbe_ethdev.h +4 -0
index b94a7f3562..3a9dc81691 100644
@@ -276,6 +276,7 @@ struct axgbe_phy {
 	int pause_autoneg;
 	int tx_pause;
 	int rx_pause;
+	int id;
 };
 
 enum axgbe_i2c_cmd {
@@ -398,6 +399,9 @@ struct axgbe_phy_impl_if {
 	/* Pre/Post KR training enablement support */
 	void (*kr_training_pre)(struct axgbe_port *);
 	void (*kr_training_post)(struct axgbe_port *);
+
+	int (*read)(struct axgbe_port *port, int addr, int reg);
+	int (*write)(struct axgbe_port *port, int addr, int reg, u16 val);
 };
 
 struct axgbe_phy_if {
drivers/net/axgbe/axgbe_mdio.c +2 -2
index 952a0add62..a37cd8b80d 100644
@@ -155,8 +155,8 @@ static void axgbe_sgmii_10_mode(struct axgbe_port *pdata)
 static void axgbe_sgmii_100_mode(struct axgbe_port *pdata)
 {
 
-	/* Set MAC to 1G speed */
-	pdata->hw_if.set_speed(pdata, SPEED_1000);
+	/* Set MAC to 100M speed */
+	pdata->hw_if.set_speed(pdata, SPEED_100);
 
 	/* Call PHY implementation support to complete rate change */
 	pdata->phy_if.phy_impl.set_mode(pdata, AXGBE_MODE_SGMII_100);
drivers/net/axgbe/axgbe_phy.h +32 -0
index eee3afc370..ef02488adf 100644
@@ -63,6 +63,29 @@
 #define BMCR_RESET		0x8000	/* Reset to default state      */
 #define BMCR_SPEED10		0x0000	/* Select 10Mbps               */
 
+/* Advertisement control register. */
+#define ADVERTISE_SLCT          0x001f  /* Selector bits               */
+#define ADVERTISE_CSMA          0x0001  /* Only selector supported     */
+#define ADVERTISE_10HALF        0x0020  /* Try for 10mbps half-duplex  */
+#define ADVERTISE_1000XFULL     0x0020  /* Try for 1000BASE-X full-duplex */
+#define ADVERTISE_10FULL        0x0040  /* Try for 10mbps full-duplex  */
+#define ADVERTISE_1000XHALF     0x0040  /* Try for 1000BASE-X half-duplex */
+#define ADVERTISE_100HALF       0x0080  /* Try for 100mbps half-duplex */
+#define ADVERTISE_1000XPAUSE    0x0080  /* Try for 1000BASE-X pause    */
+#define ADVERTISE_100FULL       0x0100  /* Try for 100mbps full-duplex */
+#define ADVERTISE_1000XPSE_ASYM 0x0100  /* Try for 1000BASE-X asym pause */
+#define ADVERTISE_100BASE4      0x0200  /* Try for 100mbps 4k packets  */
+#define ADVERTISE_PAUSE_CAP     0x0400  /* Try for pause               */
+#define ADVERTISE_PAUSE_ASYM    0x0800  /* Try for asymmetric pause     */
+#define ADVERTISE_RESV          0x1000  /* Unused...                   */
+#define ADVERTISE_RFAULT        0x2000  /* Say we can detect faults    */
+#define ADVERTISE_LPACK         0x4000  /* Ack link partners response  */
+#define ADVERTISE_NPAGE         0x8000  /* Next page bit               */
+
+#define ADVERTISE_FULL          (ADVERTISE_100FULL | ADVERTISE_10FULL | \
+		ADVERTISE_CSMA)
+#define ADVERTISE_ALL           (ADVERTISE_10HALF | ADVERTISE_10FULL | \
+		ADVERTISE_100HALF | ADVERTISE_100FULL)
 
 /* MDIO Manageable Devices (MMDs). */
 #define MDIO_MMD_PMAPMD		1	/* Physical Medium Attachment
@@ -114,6 +137,15 @@
 #define MDIO_AN_10GBT_CTRL	32	/* 10GBASE-T auto-negotiation control */
 #define MDIO_AN_10GBT_STAT	33	/* 10GBASE-T auto-negotiation status */
 
+#define AXGBE_M88E1512_PAGE_ADDR	0x0016
+#define AXGBE_M88E1512_CFG_REG_1	0x0010
+#define AXGBE_M88E1512_CFG_REG_2	0x0011
+#define AXGBE_M88E1512_CFG_REG_3	0x0007
+#define AXGBE_M88E1512_MODE		0x0014
+
+#define AXGBE_M88E1512_SCR		0x10
+
+
 /* Control register 1. */
 /* Enable extended speed selection */
 #define MDIO_CTRL1_SPEEDSELEXT		(BMCR_SPEED1000 | BMCR_SPEED100)
drivers/net/axgbe/axgbe_phy_impl.c +304 -5

390 lines not on this page · raw message

Signature · 1 line
2.34.1
#1 lore raw
Quoted 3 lines · On Mon, 16 Feb 2026 14:24:31 +0530 Ashok Kumar Natarajan…

Added marvel m88e1512 1G PHY support in amd axgbe driver

Multiple CI build failures. Fix and resubmit.
FAILED: drivers/libtmp_rte_net_axgbe.a.p/net_axgbe_axgbe_phy_impl.c.o
clang -Idrivers/libtmp_rte_net_axgbe.a.p -Idrivers -I../drivers -Idrivers/net/axgbe -I../drivers/net/axgbe -Ilib/ethdev -I../lib/ethdev -Ilib/eal/common -I../lib/eal/common -I. -I.. -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include -I../lib/eal/linux/include -Ilib/eal/x86/include -I../lib/eal/x86/include -I../kernel/linux -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs -Ilib/log -I../lib/log -Ilib/metrics -I../lib/metrics -Ilib/telemetry -I../lib/telemetry -Ilib/argparse -I../lib/argparse -Ilib/net -I../lib/net -Ilib/mbuf -I../lib/mbuf -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring -Ilib/meter -I../lib/meter -Idrivers/bus/pci -I../drivers/bus/pci -I../drivers/bus/pci/linux -Ilib/pci -I../lib/pci -Idrivers/bus/vdev -I../drivers/bus/vdev -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -include rte_config.h -Wvla -Wcast-qual -Wcomma -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC -march=native -mrtm -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation -Wno-address-of-packed-member -Wno-comma -Wno-cast-qual -Wno-shadow -DRTE_LOG_DEFAULT_LOGTYPE=pmd.net.axgbe -DRTE_ANNOTATE_LOCKS -Wthread-safety -MD -MQ drivers/libtmp_rte_net_axgbe.a.p/net_axgbe_axgbe_phy_impl.c.o -MF drivers/libtmp_rte_net_axgbe.a.p/net_axgbe_axgbe_phy_impl.c.o.d -o drivers/libtmp_rte_net_axgbe.a.p/net_axgbe_axgbe_phy_impl.c.o -c ../drivers/net/axgbe/axgbe_phy_impl.c ../drivers/net/axgbe/axgbe_phy_impl.c:2359:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
2359 | if (bmcr == -1)

      |             ^~~~~~~~~~

../drivers/net/axgbe/axgbe_phy_impl.c:2368:9: note: uninitialized use occurs here
2368 | return ret;
| ^~~
../drivers/net/axgbe/axgbe_phy_impl.c:2359:2: note: remove the 'if' if its condition is always false

 2359 |         if (bmcr == -1)
      |         ^~~~~~~~~~~~~~~
 2360 |                 goto out;
      |                 ~~~~~~~~
../drivers/net/axgbe/axgbe_phy_impl.c:2356:9: note: initialize the variable 'ret' to silence this warning
 2356 |         int ret;
      |                ^
      |                 = 0