Subject: [PATCH net-next 2/2] net: phy: broadcom: support "brcm,master-mode" DT property

From: Rafał Miłecki <[email-masked]>
Date: Mon, 13 Oct 2025 22:29:44 +0200

From: Rafał Miłecki <[email-masked]>

Specifying master mode as required is now possible using DT property
which is a much nicer way. It allows clean per-device hardware
description instead of runtime detection in specific Ethernet drivers.

Signed-off-by: Rafał Miłecki <[email-masked]>
---
 drivers/net/phy/broadcom.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 3459a0e9d8b9..d66b79ea1c38 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -110,11 +110,13 @@ static int bcm54xx_config_clock_delay(struct phy_device *phydev)
 
 static int bcm54210e_config_init(struct phy_device *phydev)
 {
+	struct device_node *np = phydev->mdio.dev.of_node;
 	int val;
 
 	bcm54xx_config_clock_delay(phydev);
 
-	if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) {
+	if (of_property_read_bool(np, "brcm,master-mode") ||
+	    phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) {
 		val = phy_read(phydev, MII_CTRL1000);
 		val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;
 		phy_write(phydev, MII_CTRL1000, val);
-- 
2.51.0