mirror of
https://github.com/VIKINGYFY/immortalwrt.git
synced 2025-12-16 09:10:38 +00:00
These patches have been accepted for linux v6.18. e57723fe536f net: dsa: b53: properly bound ARL searches for < 4 ARL bin chips 674b34c4c770 net: dsa: b53: fix ageing time for BCM53101 89eb9a62aed7 net: dsa: b53: fix reserved register access in b53_fdb_dump() 61730ac10ba9 net: dsa: b53: mmap: Implement bcm63268 gphy power control 7f95f04fe190 net: dsa: b53: mmap: Add gphy port to phy info for bcm63268 5ac00023852d net: dsa: b53: mmap: Implement bcm63xx ephy power control e8e13073dff7 net: dsa: b53: mmap: Add register layout for bcm6368 c251304ab021 net: dsa: b53: mmap: Add register layout for bcm6318 aed2aaa3c963 net: dsa: b53: mmap: Add syscon reference and register layout for bcm63268 fcf02a462fab net: dsa: b53: Define chip IDs for more bcm63xx SoCs be7a79145d85 net: dsa: b53: Add phy_enable(), phy_disable() methods 762e7e174da9 net: dsa: tag_brcm: do not mark link local traffic as offloaded Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
78 lines
2.4 KiB
Diff
78 lines
2.4 KiB
Diff
From 61730ac10ba90c52563861a0119504f6a9be9868 Mon Sep 17 00:00:00 2001
|
|
From: Kyle Hendry <kylehendrydev@gmail.com>
|
|
Date: Wed, 13 Aug 2025 17:25:28 -0700
|
|
Subject: [PATCH] net: dsa: b53: mmap: Implement bcm63268 gphy power control
|
|
|
|
Add check for gphy in enable/disable phy calls and set power bits
|
|
in gphy control register.
|
|
|
|
Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
|
|
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
|
Link: https://patch.msgid.link/20250814002530.5866-3-kylehendrydev@gmail.com
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
---
|
|
drivers/net/dsa/b53/b53_mmap.c | 33 +++++++++++++++++++++++++++++----
|
|
1 file changed, 29 insertions(+), 4 deletions(-)
|
|
|
|
--- a/drivers/net/dsa/b53/b53_mmap.c
|
|
+++ b/drivers/net/dsa/b53/b53_mmap.c
|
|
@@ -29,6 +29,10 @@
|
|
#include "b53_priv.h"
|
|
|
|
#define BCM63XX_EPHY_REG 0x3C
|
|
+#define BCM63268_GPHY_REG 0x54
|
|
+
|
|
+#define GPHY_CTRL_LOW_PWR BIT(3)
|
|
+#define GPHY_CTRL_IDDQ_BIAS BIT(0)
|
|
|
|
struct b53_phy_info {
|
|
u32 gphy_port_mask;
|
|
@@ -292,13 +296,30 @@ static int bcm63xx_ephy_set(struct b53_d
|
|
return regmap_update_bits(gpio_ctrl, BCM63XX_EPHY_REG, mask, val);
|
|
}
|
|
|
|
+static int bcm63268_gphy_set(struct b53_device *dev, bool enable)
|
|
+{
|
|
+ struct b53_mmap_priv *priv = dev->priv;
|
|
+ struct regmap *gpio_ctrl = priv->gpio_ctrl;
|
|
+ u32 mask = GPHY_CTRL_IDDQ_BIAS | GPHY_CTRL_LOW_PWR;
|
|
+ u32 val = 0;
|
|
+
|
|
+ if (!enable)
|
|
+ val = mask;
|
|
+
|
|
+ return regmap_update_bits(gpio_ctrl, BCM63268_GPHY_REG, mask, val);
|
|
+}
|
|
+
|
|
static void b53_mmap_phy_enable(struct b53_device *dev, int port)
|
|
{
|
|
struct b53_mmap_priv *priv = dev->priv;
|
|
int ret = 0;
|
|
|
|
- if (priv->phy_info && (BIT(port) & priv->phy_info->ephy_port_mask))
|
|
- ret = bcm63xx_ephy_set(dev, port, true);
|
|
+ if (priv->phy_info) {
|
|
+ if (BIT(port) & priv->phy_info->ephy_port_mask)
|
|
+ ret = bcm63xx_ephy_set(dev, port, true);
|
|
+ else if (BIT(port) & priv->phy_info->gphy_port_mask)
|
|
+ ret = bcm63268_gphy_set(dev, true);
|
|
+ }
|
|
|
|
if (!ret)
|
|
priv->phys_enabled |= BIT(port);
|
|
@@ -309,8 +330,12 @@ static void b53_mmap_phy_disable(struct
|
|
struct b53_mmap_priv *priv = dev->priv;
|
|
int ret = 0;
|
|
|
|
- if (priv->phy_info && (BIT(port) & priv->phy_info->ephy_port_mask))
|
|
- ret = bcm63xx_ephy_set(dev, port, false);
|
|
+ if (priv->phy_info) {
|
|
+ if (BIT(port) & priv->phy_info->ephy_port_mask)
|
|
+ ret = bcm63xx_ephy_set(dev, port, false);
|
|
+ else if (BIT(port) & priv->phy_info->gphy_port_mask)
|
|
+ ret = bcm63268_gphy_set(dev, false);
|
|
+ }
|
|
|
|
if (!ret)
|
|
priv->phys_enabled &= ~BIT(port);
|