Thread (16 messages) 16 messages, 6 authors, 2026-03-30

Re: [PATCH net-next] net: phy: bcm84881: add BCM84891/BCM84892 support

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-03-24 15:52:21

+static bool bcm84881_is_bcm8489x(struct phy_device *phydev)
+{
+	/* For C45 PHYs, phydev->phy_id is 0; match via the driver entry's
+	 * declared ID, which is what phy_bus_match() used to bind us.
+	 */
+	u32 id = phydev->drv->phy_id;
+
+	return (id & 0xfffffff0) == 0x35905080 ||
+	       (id & 0xfffffff0) == 0x359050a0;
phy_id_compare_model(). 
+/* BCM8489x speed LED control.
+ * Dev1:a83b bit 1 (0x0002) = green, bit 4 (0x0010) = amber.
+ * Dev1:a82f = 0x0020 gates amber on; green ignores the gate.
+ * Writes are best-effort (LED is cosmetic; this callback is void).
+ */
+static void bcm84881_link_change_notify(struct phy_device *phydev)
+{
+	if (phydev->link) {
+		/* 10G = green, else amber; matches vendor firmware */
+		u16 color = (phydev->speed == SPEED_10000) ? 0x0002 : 0x0010;
+
+		phy_write_mmd(phydev, MDIO_MMD_PMAPMD, BCM8489X_LED_GATE, 0x0020);
+		phy_modify_mmd(phydev, MDIO_MMD_PMAPMD, BCM8489X_LED_COLOR,
+			       0x0012, color);
+	} else {
+		phy_clear_bits_mmd(phydev, MDIO_MMD_PMAPMD,
+				   BCM8489X_LED_COLOR, 0x0012);
+	}
+}
What are the capabilities of the LEDs?

This is going to cause problems in the future if somebody implements
proper control of the LEDs via /sys/class/leds and the netdev trigger.
+	{
+		.phy_id		= 0x35905081,
+		.phy_id_mask	= 0xfffffff0,
PHY_ID_MATCH_MODEL()
+		.name		= "Broadcom BCM84891",
+		.inband_caps	= bcm84881_inband_caps,
+		.config_init	= bcm84881_config_init,
+		.probe		= bcm84881_probe,
+		.get_features	= bcm84881_get_features,
+		.config_aneg	= bcm84881_config_aneg,
+		.aneg_done	= bcm84881_aneg_done,
+		.read_status	= bcm84881_read_status,
+		.link_change_notify = bcm84881_link_change_notify,
+	},
+	{
+		.phy_id		= 0x359050a1,
+		.phy_id_mask	= 0xfffffff0,
PHY_ID_MATCH_MODEL()


    Andrew

---
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help