2023-03-20 16:01:13

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH 0/4] net: dsa: b53: configure BCM63268 RGMII ports

BCM63268 need special configuration for their RGMII ports, so we need to be
able to identify them as a special BCM63xx switch.
In the meantime, let's add some missing BCM63xx SoCs to B53 MMAP device table.

This should be applied after "net: dsa: b53: add support for BCM63xx RGMIIs":
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

Álvaro Fernández Rojas (4):
dt-bindings: net: dsa: b53: add more 63xx SoCs
net: dsa: b53: mmap: add more BCM63xx SoCs
net: dsa: b53: mmap: allow passing a chip ID
net: dsa: b53: add BCM63268 RGMII configuration

.../devicetree/bindings/net/dsa/brcm,b53.yaml | 3 ++
drivers/net/dsa/b53/b53_common.c | 6 +++-
drivers/net/dsa/b53/b53_mmap.c | 29 +++++++++++++++----
drivers/net/dsa/b53/b53_priv.h | 9 +++++-
drivers/net/dsa/b53/b53_regs.h | 1 +
5 files changed, 40 insertions(+), 8 deletions(-)

--
2.30.2



2023-03-20 16:01:17

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH 1/4] dt-bindings: net: dsa: b53: add more 63xx SoCs

BCM6318, BCM6362 and BCM63268 are SoCs with a B53 MMAP switch.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
---
Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml | 3 +++
1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
index 5bef4128d175..57e0ef93b134 100644
--- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
@@ -57,8 +57,11 @@ properties:
- items:
- enum:
- brcm,bcm3384-switch
+ - brcm,bcm6318-switch
- brcm,bcm6328-switch
+ - brcm,bcm6362-switch
- brcm,bcm6368-switch
+ - brcm,bcm63268-switch
- const: brcm,bcm63xx-switch

required:
--
2.30.2


2023-03-20 19:50:17

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: net: dsa: b53: add more 63xx SoCs

On Mon, Mar 20, 2023 at 04:50:21PM +0100, Álvaro Fernández Rojas wrote:
> BCM6318, BCM6362 and BCM63268 are SoCs with a B53 MMAP switch.
>
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>

Reviewed-by: Simon Horman <[email protected]>


2023-03-20 19:52:14

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: net: dsa: b53: add more 63xx SoCs

On 3/20/23 08:50, Álvaro Fernández Rojas wrote:
> BCM6318, BCM6362 and BCM63268 are SoCs with a B53 MMAP switch.
>
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>

Reviewed-by: Florian Fainelli <[email protected]>
--
Florian


2023-03-21 07:15:20

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: net: dsa: b53: add more 63xx SoCs

On 20/03/2023 16:50, Álvaro Fernández Rojas wrote:
> BCM6318, BCM6362 and BCM63268 are SoCs with a B53 MMAP switch.
>
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>
> ---

Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof


2023-03-21 17:34:58

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH v2 0/4] net: dsa: b53: configure 6318 and 63268 RGMII ports

BCM6318 and BCM63268 need special configuration for their RGMII ports, so we
need to be able to identify them as a special BCM63xx switch.
In the meantime, let's add some missing BCM63xx SoCs to B53 MMAP device table.

This should be applied after "net: dsa: b53: add support for BCM63xx RGMIIs":
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

Álvaro Fernández Rojas (4):
dt-bindings: net: dsa: b53: add more 63xx SoCs
net: dsa: b53: mmap: add more 63xx SoCs
net: dsa: b53: mmap: allow passing a chip ID
net: dsa: b53: add BCM63268 RGMII configuration

.../devicetree/bindings/net/dsa/brcm,b53.yaml | 3 ++
drivers/net/dsa/b53/b53_common.c | 19 +++++++++++-
drivers/net/dsa/b53/b53_mmap.c | 29 +++++++++++++++----
drivers/net/dsa/b53/b53_priv.h | 9 +++++-
drivers/net/dsa/b53/b53_regs.h | 1 +
5 files changed, 53 insertions(+), 8 deletions(-)

--
2.30.2


2023-03-21 17:35:06

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH v2 1/4] dt-bindings: net: dsa: b53: add more 63xx SoCs

BCM6318, BCM6362 and BCM63268 are SoCs with a B53 MMAP switch.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
---
v2: no changes.

Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml | 3 +++
1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
index 5bef4128d175..57e0ef93b134 100644
--- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
@@ -57,8 +57,11 @@ properties:
- items:
- enum:
- brcm,bcm3384-switch
+ - brcm,bcm6318-switch
- brcm,bcm6328-switch
+ - brcm,bcm6362-switch
- brcm,bcm6368-switch
+ - brcm,bcm63268-switch
- const: brcm,bcm63xx-switch

required:
--
2.30.2


2023-03-21 17:35:10

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH v2 2/4] net: dsa: b53: mmap: add more 63xx SoCs

BCM6318, BCM6362 and BCM63268 are SoCs with a B53 MMAP switch.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
---
v2: no changes.

drivers/net/dsa/b53/b53_mmap.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c
index e968322dfbf0..f63aebd445e8 100644
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -331,8 +331,11 @@ static void b53_mmap_shutdown(struct platform_device *pdev)

static const struct of_device_id b53_mmap_of_table[] = {
{ .compatible = "brcm,bcm3384-switch" },
+ { .compatible = "brcm,bcm6318-switch" },
{ .compatible = "brcm,bcm6328-switch" },
+ { .compatible = "brcm,bcm6362-switch" },
{ .compatible = "brcm,bcm6368-switch" },
+ { .compatible = "brcm,bcm63268-switch" },
{ .compatible = "brcm,bcm63xx-switch" },
{ /* sentinel */ },
};
--
2.30.2


2023-03-21 17:35:14

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH v2 3/4] net: dsa: b53: mmap: allow passing a chip ID

BCM6318 and BCM63268 SoCs require a special handling for their RGMIIs, so we
should be able to identify them as a special BCM63xx switch.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
---
v2:
- Add missing chip to b53_switch_chips[].
- Fix device_get_match_data() casting warning.
- Add BCM63268_DEVICE_ID to BCM6318 too.
- Add BCM6318 in commit description.

drivers/net/dsa/b53/b53_common.c | 13 +++++++++++++
drivers/net/dsa/b53/b53_mmap.c | 32 +++++++++++++++++++++++---------
drivers/net/dsa/b53/b53_priv.h | 9 ++++++++-
3 files changed, 44 insertions(+), 10 deletions(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 6e212f6f1cb9..97327d7a6760 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2465,6 +2465,19 @@ static const struct b53_chip_data b53_switch_chips[] = {
.jumbo_pm_reg = B53_JUMBO_PORT_MASK_63XX,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE_63XX,
},
+ {
+ .chip_id = BCM63268_DEVICE_ID,
+ .dev_name = "BCM63268",
+ .vlans = 4096,
+ .enabled_ports = 0, /* pdata must provide them */
+ .arl_bins = 4,
+ .arl_buckets = 1024,
+ .imp_port = 8,
+ .vta_regs = B53_VTA_REGS_63XX,
+ .duplex_reg = B53_DUPLEX_STAT_63XX,
+ .jumbo_pm_reg = B53_JUMBO_PORT_MASK_63XX,
+ .jumbo_size_reg = B53_JUMBO_MAX_SIZE_63XX,
+ },
{
.chip_id = BCM53010_DEVICE_ID,
.dev_name = "BCM53010",
diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c
index f63aebd445e8..a83a0c9d6939 100644
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -248,7 +248,7 @@ static int b53_mmap_probe_of(struct platform_device *pdev,
return -ENOMEM;

pdata->regs = mem;
- pdata->chip_id = BCM63XX_DEVICE_ID;
+ pdata->chip_id = (u32)(unsigned long)device_get_match_data(dev);
pdata->big_endian = of_property_read_bool(np, "big-endian");

of_ports = of_get_child_by_name(np, "ports");
@@ -330,14 +330,28 @@ static void b53_mmap_shutdown(struct platform_device *pdev)
}

static const struct of_device_id b53_mmap_of_table[] = {
- { .compatible = "brcm,bcm3384-switch" },
- { .compatible = "brcm,bcm6318-switch" },
- { .compatible = "brcm,bcm6328-switch" },
- { .compatible = "brcm,bcm6362-switch" },
- { .compatible = "brcm,bcm6368-switch" },
- { .compatible = "brcm,bcm63268-switch" },
- { .compatible = "brcm,bcm63xx-switch" },
- { /* sentinel */ },
+ {
+ .compatible = "brcm,bcm3384-switch",
+ .data = (void *)BCM63XX_DEVICE_ID,
+ }, {
+ .compatible = "brcm,bcm6318-switch",
+ .data = (void *)BCM63268_DEVICE_ID,
+ }, {
+ .compatible = "brcm,bcm6328-switch",
+ .data = (void *)BCM63XX_DEVICE_ID,
+ }, {
+ .compatible = "brcm,bcm6362-switch",
+ .data = (void *)BCM63XX_DEVICE_ID,
+ }, {
+ .compatible = "brcm,bcm6368-switch",
+ .data = (void *)BCM63XX_DEVICE_ID,
+ }, {
+ .compatible = "brcm,bcm63268-switch",
+ .data = (void *)BCM63268_DEVICE_ID,
+ }, {
+ .compatible = "brcm,bcm63xx-switch",
+ .data = (void *)BCM63XX_DEVICE_ID,
+ }, { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, b53_mmap_of_table);

diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
index 4cf9f540696e..a689a6950189 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -70,6 +70,7 @@ enum {
BCM53125_DEVICE_ID = 0x53125,
BCM53128_DEVICE_ID = 0x53128,
BCM63XX_DEVICE_ID = 0x6300,
+ BCM63268_DEVICE_ID = 0x63268,
BCM53010_DEVICE_ID = 0x53010,
BCM53011_DEVICE_ID = 0x53011,
BCM53012_DEVICE_ID = 0x53012,
@@ -191,7 +192,13 @@ static inline int is531x5(struct b53_device *dev)

static inline int is63xx(struct b53_device *dev)
{
- return dev->chip_id == BCM63XX_DEVICE_ID;
+ return dev->chip_id == BCM63XX_DEVICE_ID ||
+ dev->chip_id == BCM63268_DEVICE_ID;
+}
+
+static inline int is63268(struct b53_device *dev)
+{
+ return dev->chip_id == BCM63268_DEVICE_ID;
}

static inline int is5301x(struct b53_device *dev)
--
2.30.2


2023-03-21 17:35:17

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH v2 4/4] net: dsa: b53: add BCM63268 RGMII configuration

BCM63268 requires special RGMII configuration to work.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
---
v2: no changes.

drivers/net/dsa/b53/b53_common.c | 6 +++++-
drivers/net/dsa/b53/b53_regs.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 97327d7a6760..1f9b251a5452 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1240,8 +1240,12 @@ static void b53_adjust_63xx_rgmii(struct dsa_switch *ds, int port,
break;
}

- if (port != dev->imp_port)
+ if (port != dev->imp_port) {
+ if (is63268(dev))
+ rgmii_ctrl |= RGMII_CTRL_MII_OVERRIDE;
+
rgmii_ctrl |= RGMII_CTRL_ENABLE_GMII;
+ }

b53_write8(dev, B53_CTRL_PAGE, off, rgmii_ctrl);

diff --git a/drivers/net/dsa/b53/b53_regs.h b/drivers/net/dsa/b53/b53_regs.h
index b2c539a42154..bfbcb66bef66 100644
--- a/drivers/net/dsa/b53/b53_regs.h
+++ b/drivers/net/dsa/b53/b53_regs.h
@@ -138,6 +138,7 @@

#define B53_RGMII_CTRL_IMP 0x60
#define RGMII_CTRL_ENABLE_GMII BIT(7)
+#define RGMII_CTRL_MII_OVERRIDE BIT(6)
#define RGMII_CTRL_TIMING_SEL BIT(2)
#define RGMII_CTRL_DLL_RXC BIT(1)
#define RGMII_CTRL_DLL_TXC BIT(0)
--
2.30.2


2023-03-21 18:19:48

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH v2 3/4] net: dsa: b53: mmap: allow passing a chip ID

On 3/21/23 10:33, Álvaro Fernández Rojas wrote:
> BCM6318 and BCM63268 SoCs require a special handling for their RGMIIs, so we
> should be able to identify them as a special BCM63xx switch.
>
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>

Reviewed-by: Florian Fainelli <[email protected]>
--
Florian


2023-03-22 11:24:51

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH v2 2/4] net: dsa: b53: mmap: add more 63xx SoCs

On Tue, Mar 21, 2023 at 06:33:57PM +0100, Álvaro Fernández Rojas wrote:
> BCM6318, BCM6362 and BCM63268 are SoCs with a B53 MMAP switch.
>
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>
> Reviewed-by: Florian Fainelli <[email protected]>

Reviewed-by: Simon Horman <[email protected]>

2023-03-22 11:25:17

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH v2 3/4] net: dsa: b53: mmap: allow passing a chip ID

On Tue, Mar 21, 2023 at 06:33:58PM +0100, Álvaro Fernández Rojas wrote:
> BCM6318 and BCM63268 SoCs require a special handling for their RGMIIs, so we
> should be able to identify them as a special BCM63xx switch.
>
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>

Reviewed-by: Simon Horman <[email protected]>

2023-03-23 04:52:44

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] net: dsa: b53: configure 6318 and 63268 RGMII ports

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <[email protected]>:

On Tue, 21 Mar 2023 18:33:55 +0100 you wrote:
> BCM6318 and BCM63268 need special configuration for their RGMII ports, so we
> need to be able to identify them as a special BCM63xx switch.
> In the meantime, let's add some missing BCM63xx SoCs to B53 MMAP device table.
>
> This should be applied after "net: dsa: b53: add support for BCM63xx RGMIIs":
> https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
>
> [...]

Here is the summary with links:
- [v2,1/4] dt-bindings: net: dsa: b53: add more 63xx SoCs
https://git.kernel.org/netdev/net-next/c/3ec5ac3133b5
- [v2,2/4] net: dsa: b53: mmap: add more 63xx SoCs
https://git.kernel.org/netdev/net-next/c/a2b212fe5c32
- [v2,3/4] net: dsa: b53: mmap: allow passing a chip ID
https://git.kernel.org/netdev/net-next/c/260887c770eb
- [v2,4/4] net: dsa: b53: add BCM63268 RGMII configuration
https://git.kernel.org/netdev/net-next/c/594c6c2e3ea2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html