Thread (16 messages) 16 messages, 3 authors, 2025-06-11

Re: [RFC PATCH net-next v2 10/10] net: dsa: b53: ensure BCM5325 PHYs are enabled

From: Florian Fainelli <florian.fainelli@broadcom.com>
Date: 2025-06-04 18:20:13
Also in: lkml

On 6/3/25 13:48, Álvaro Fernández Rojas wrote:
According to the datasheet, BCM5325 uses B53_PD_MODE_CTRL_25 register to
disable clocking to individual PHYs.
Only ports 1-4 can be enabled or disabled and the datasheet is explicit
about not toggling BIT(0) since it disables the PLL power and the switch.
 > > Signed-off-by: Álvaro Fernández Rojas [off-list ref]
quoted hunk ↗ jump to hunk
---
  drivers/net/dsa/b53/b53_common.c | 13 +++++++++++++
  drivers/net/dsa/b53/b53_regs.h   |  2 ++
  2 files changed, 15 insertions(+)

  v2: add changes requested by Florian:
   - Move B53_PD_MODE_CTRL_25 to b53_setup_port().
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index a9b19451ffb30..38c08f6278d27 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -659,6 +659,19 @@ int b53_setup_port(struct dsa_switch *ds, int port)
  	if (dsa_is_user_port(ds, port))
  		b53_set_eap_mode(dev, port, EAP_MODE_SIMPLIFIED);
  
+	if (is5325(dev) &&
+	    (port >= B53_PD_MODE_PORT_MIN) &&
+	    (port <= B53_PD_MODE_PORT_MAX)) {
This would be a candidate for the in_range() helper?
-- 
Florian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help