Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: phy: bcm84881: add BCM84891/BCM84892 support

The BCM84891 and BCM84892 are 10GBASE-T PHYs in the same family as the
BCM84881, sharing the register map and most callbacks. They add USXGMII
as a host interface mode.

bcm8489x_config_init() is separate from bcm84881_config_init(): it
allows only USXGMII (the only host mode available on the tested
hardware) and clears MDIO_CTRL1_LPOWER, which is set at boot on the
tested platform. Does not recur on ifdown/ifup, cable events, or
link-partner advertisement changes, so config_init is sufficient.

For USXGMII, read_status() skips the 0x4011 host-mode register: it
returns the same value regardless of negotiated copper speed (USXGMII
symbol replication). Speed comes from phy_resolve_aneg_linkmode() via
standard C45 AN resolution.

Tested on TRENDnet TEG-S750 (RTL9303 + 1x BCM84891 + 4x BCM84892)
running OpenWrt, where the MDIO controller driver is currently
OpenWrt-specific. Link verified at 100M, 1G, 2.5G, 10G.

Signed-off-by: Daniel Wagner <wagner.daniel.t@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20260330225310.2801264-1-wagner.daniel.t@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Daniel Wagner and committed by
Jakub Kicinski
75171eef e9abf1da

+47 -1
+47 -1
drivers/net/phy/bcm84881.c
··· 54 54 return 0; 55 55 } 56 56 57 + static int bcm8489x_config_init(struct phy_device *phydev) 58 + { 59 + __set_bit(PHY_INTERFACE_MODE_USXGMII, phydev->possible_interfaces); 60 + 61 + if (phydev->interface != PHY_INTERFACE_MODE_USXGMII) 62 + return -ENODEV; 63 + 64 + /* MDIO_CTRL1_LPOWER is set at boot on the tested platform. Does not 65 + * recur on ifdown/ifup, cable events, or link-partner advertisement 66 + * changes; clear it once. 67 + */ 68 + return phy_clear_bits_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL1, 69 + MDIO_CTRL1_LPOWER); 70 + } 71 + 57 72 static int bcm84881_probe(struct phy_device *phydev) 58 73 { 59 74 /* This driver requires PMAPMD and AN blocks */ ··· 216 201 return 0; 217 202 } 218 203 204 + /* BCM84891/92 on USXGMII: the host interface mode doesn't change 205 + * with copper speed (USXGMII symbol replication; the MAC receives 206 + * the negotiated copper speed, not 10G, so no rate adaptation). 207 + * Skip 0x4011; phy_resolve_aneg_linkmode() above already set the 208 + * speed. Only bcm8489x_config_init() allows USXGMII. 209 + */ 210 + if (phydev->interface == PHY_INTERFACE_MODE_USXGMII) 211 + return genphy_c45_read_mdix(phydev); 212 + 219 213 /* Set the host link mode - we set the phy interface mode and 220 214 * the speed according to this register so that downshift works. 221 215 * We leave the duplex setting as per the resolution from the ··· 280 256 .config_aneg = bcm84881_config_aneg, 281 257 .aneg_done = bcm84881_aneg_done, 282 258 .read_status = bcm84881_read_status, 259 + }, { 260 + PHY_ID_MATCH_MODEL(0x35905080), 261 + .name = "Broadcom BCM84891", 262 + .inband_caps = bcm84881_inband_caps, 263 + .config_init = bcm8489x_config_init, 264 + .probe = bcm84881_probe, 265 + .get_features = bcm84881_get_features, 266 + .config_aneg = bcm84881_config_aneg, 267 + .aneg_done = bcm84881_aneg_done, 268 + .read_status = bcm84881_read_status, 269 + }, { 270 + PHY_ID_MATCH_MODEL(0x359050a0), 271 + .name = "Broadcom BCM84892", 272 + .inband_caps = bcm84881_inband_caps, 273 + .config_init = bcm8489x_config_init, 274 + .probe = bcm84881_probe, 275 + .get_features = bcm84881_get_features, 276 + .config_aneg = bcm84881_config_aneg, 277 + .aneg_done = bcm84881_aneg_done, 278 + .read_status = bcm84881_read_status, 283 279 }, 284 280 }; 285 281 ··· 308 264 /* FIXME: module auto-loading for Clause 45 PHYs seems non-functional */ 309 265 static const struct mdio_device_id __maybe_unused bcm84881_tbl[] = { 310 266 { 0xae025150, 0xfffffff0 }, 267 + { PHY_ID_MATCH_MODEL(0x35905080) }, 268 + { PHY_ID_MATCH_MODEL(0x359050a0) }, 311 269 { }, 312 270 }; 313 271 MODULE_AUTHOR("Russell King"); 314 - MODULE_DESCRIPTION("Broadcom BCM84881 PHY driver"); 272 + MODULE_DESCRIPTION("Broadcom BCM84881/BCM84891/BCM84892 PHY driver"); 315 273 MODULE_DEVICE_TABLE(mdio, bcm84881_tbl); 316 274 MODULE_LICENSE("GPL");