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>
70 lines
2.1 KiB
Diff
70 lines
2.1 KiB
Diff
From aed2aaa3c963f8aabbfa061a177022fee826ebfb Mon Sep 17 00:00:00 2001
|
|
From: Kyle Hendry <kylehendrydev@gmail.com>
|
|
Date: Wed, 23 Jul 2025 20:52:43 -0700
|
|
Subject: [PATCH] net: dsa: b53: mmap: Add syscon reference and register layout
|
|
for bcm63268
|
|
|
|
On bcm63xx SoCs there are registers that control the PHYs in
|
|
the GPIO controller. Allow the b53 driver to access them
|
|
by passing in the syscon through the device tree.
|
|
|
|
Add a structure to describe the ephy control register
|
|
and add register info for bcm63268.
|
|
|
|
Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
|
|
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
|
Link: https://patch.msgid.link/20250724035300.20497-5-kylehendrydev@gmail.com
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
---
|
|
drivers/net/dsa/b53/b53_mmap.c | 25 +++++++++++++++++++++++++
|
|
1 file changed, 25 insertions(+)
|
|
|
|
--- a/drivers/net/dsa/b53/b53_mmap.c
|
|
+++ b/drivers/net/dsa/b53/b53_mmap.c
|
|
@@ -21,13 +21,32 @@
|
|
#include <linux/module.h>
|
|
#include <linux/of.h>
|
|
#include <linux/io.h>
|
|
+#include <linux/mfd/syscon.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/platform_data/b53.h>
|
|
|
|
#include "b53_priv.h"
|
|
|
|
+struct b53_phy_info {
|
|
+ u32 ephy_enable_mask;
|
|
+ u32 ephy_port_mask;
|
|
+ u32 ephy_bias_bit;
|
|
+ const u32 *ephy_offset;
|
|
+};
|
|
+
|
|
struct b53_mmap_priv {
|
|
void __iomem *regs;
|
|
+ struct regmap *gpio_ctrl;
|
|
+ const struct b53_phy_info *phy_info;
|
|
+};
|
|
+
|
|
+static const u32 bcm63268_ephy_offsets[] = {4, 9, 14};
|
|
+
|
|
+static const struct b53_phy_info bcm63268_ephy_info = {
|
|
+ .ephy_enable_mask = GENMASK(4, 0),
|
|
+ .ephy_port_mask = GENMASK((ARRAY_SIZE(bcm63268_ephy_offsets) - 1), 0),
|
|
+ .ephy_bias_bit = 24,
|
|
+ .ephy_offset = bcm63268_ephy_offsets,
|
|
};
|
|
|
|
static int b53_mmap_read8(struct b53_device *dev, u8 page, u8 reg, u8 *val)
|
|
@@ -313,6 +332,12 @@ static int b53_mmap_probe(struct platfor
|
|
|
|
priv->regs = pdata->regs;
|
|
|
|
+ priv->gpio_ctrl = syscon_regmap_lookup_by_phandle(np, "brcm,gpio-ctrl");
|
|
+ if (!IS_ERR(priv->gpio_ctrl)) {
|
|
+ if (pdata->chip_id == BCM63268_DEVICE_ID)
|
|
+ priv->phy_info = &bcm63268_ephy_info;
|
|
+ }
|
|
+
|
|
dev = b53_switch_alloc(&pdev->dev, &b53_mmap_ops, priv);
|
|
if (!dev)
|
|
return -ENOMEM;
|