All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support
@ 2016-07-08 18:39 Florian Fainelli
  2016-07-08 18:39 ` [PATCH net-next 1/2] net: dsa: b53: Allow SRAB driver to specify platform data Florian Fainelli
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Florian Fainelli @ 2016-07-08 18:39 UTC (permalink / raw)
  To: netdev
  Cc: davem, jon.mason, andrew, zajec5, vivien.didelot,
	bcm-kernel-feedback-list, Florian Fainelli

Hi all,

This patch series updates the B53 driver to support Broadcom's Northstar Plus
Soc integrated switch.

Unlike the version of the core present in BCM5301x/Northstar, we cannot read the
full chip id of the switch, so we need to get the information about our switch
id from Device Tree.

Other than that, this is a regular Broadcom Ethernet switch which is register
compatible for all practical purposes with the existing switch driver.

Since DSA requires a working CPU Ethernet MAC driver this depends on Jon
Mason's AMAC/BGMAC driver changes to support NSP. Board specific changes depend
on patches present in Broadcom's ARM SoC branches and will be posted in a short
while.

Florian Fainelli (2):
  net: dsa: b53: Allow SRAB driver to specify platform data
  net: dsa: b53: Add support for BCM585xx/586xx/88312 integrated switch

 Documentation/devicetree/bindings/net/dsa/b53.txt |  9 +++++
 drivers/net/dsa/b53/b53_common.c                  | 12 ++++++
 drivers/net/dsa/b53/b53_priv.h                    |  1 +
 drivers/net/dsa/b53/b53_srab.c                    | 47 ++++++++++++++++++-----
 4 files changed, 59 insertions(+), 10 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next 1/2] net: dsa: b53: Allow SRAB driver to specify platform data
  2016-07-08 18:39 [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support Florian Fainelli
@ 2016-07-08 18:39 ` Florian Fainelli
  2016-07-08 18:39 ` [PATCH net-next 2/2] net: dsa: b53: Add support for BCM585xx/586xx/88312 integrated switch Florian Fainelli
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2016-07-08 18:39 UTC (permalink / raw)
  To: netdev
  Cc: davem, jon.mason, andrew, zajec5, vivien.didelot,
	bcm-kernel-feedback-list, Florian Fainelli

For Northstart Plus SoCs, we cannot detect the switch because only the
revision information is provied in the Management page, instead, rely on
Device Tree to tell us the chip id, and pass it down using the
b53_platform_data structure.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/b53/b53_srab.c | 39 +++++++++++++++++++++++++++++----------
 1 file changed, 29 insertions(+), 10 deletions(-)

diff --git a/drivers/net/dsa/b53/b53_srab.c b/drivers/net/dsa/b53/b53_srab.c
index 70fd47284535..de2b9e710041 100644
--- a/drivers/net/dsa/b53/b53_srab.c
+++ b/drivers/net/dsa/b53/b53_srab.c
@@ -21,6 +21,7 @@
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/platform_data/b53.h>
+#include <linux/of.h>
 
 #include "b53_priv.h"
 
@@ -356,12 +357,37 @@ static struct b53_io_ops b53_srab_ops = {
 	.write64 = b53_srab_write64,
 };
 
+static const struct of_device_id b53_srab_of_match[] = {
+	{ .compatible = "brcm,bcm53010-srab" },
+	{ .compatible = "brcm,bcm53011-srab" },
+	{ .compatible = "brcm,bcm53012-srab" },
+	{ .compatible = "brcm,bcm53018-srab" },
+	{ .compatible = "brcm,bcm53019-srab" },
+	{ .compatible = "brcm,bcm5301x-srab" },
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, b53_srab_of_match);
+
 static int b53_srab_probe(struct platform_device *pdev)
 {
+	struct b53_platform_data *pdata = pdev->dev.platform_data;
+	struct device_node *dn = pdev->dev.of_node;
+	const struct of_device_id *of_id = NULL;
 	struct b53_srab_priv *priv;
 	struct b53_device *dev;
 	struct resource *r;
 
+	if (dn)
+		of_id = of_match_node(b53_srab_of_match, dn);
+
+	if (of_id) {
+		pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+		if (!pdata)
+			return -ENOMEM;
+
+		pdata->chip_id = (u32)of_id->data;
+	}
+
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
@@ -375,6 +401,9 @@ static int b53_srab_probe(struct platform_device *pdev)
 	if (!dev)
 		return -ENOMEM;
 
+	if (pdata)
+		dev->pdata = pdata;
+
 	platform_set_drvdata(pdev, dev);
 
 	return b53_switch_register(dev);
@@ -390,16 +419,6 @@ static int b53_srab_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id b53_srab_of_match[] = {
-	{ .compatible = "brcm,bcm53010-srab" },
-	{ .compatible = "brcm,bcm53011-srab" },
-	{ .compatible = "brcm,bcm53012-srab" },
-	{ .compatible = "brcm,bcm53018-srab" },
-	{ .compatible = "brcm,bcm53019-srab" },
-	{ .compatible = "brcm,bcm5301x-srab" },
-	{ /* sentinel */ },
-};
-
 static struct platform_driver b53_srab_driver = {
 	.probe = b53_srab_probe,
 	.remove = b53_srab_remove,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next 2/2] net: dsa: b53: Add support for BCM585xx/586xx/88312 integrated switch
  2016-07-08 18:39 [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support Florian Fainelli
  2016-07-08 18:39 ` [PATCH net-next 1/2] net: dsa: b53: Allow SRAB driver to specify platform data Florian Fainelli
@ 2016-07-08 18:39 ` Florian Fainelli
  2016-07-08 20:02 ` [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support Andrew Lunn
  2016-07-11 19:52 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2016-07-08 18:39 UTC (permalink / raw)
  To: netdev
  Cc: davem, jon.mason, andrew, zajec5, vivien.didelot,
	bcm-kernel-feedback-list, Florian Fainelli

Update the SRAB, core driver and binding document to support the
BCM585xx/586xx/88312 integrated switch (Northstar Plus SoCs family).

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 Documentation/devicetree/bindings/net/dsa/b53.txt |  9 +++++++++
 drivers/net/dsa/b53/b53_common.c                  | 12 ++++++++++++
 drivers/net/dsa/b53/b53_priv.h                    |  1 +
 drivers/net/dsa/b53/b53_srab.c                    |  8 ++++++++
 4 files changed, 30 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/dsa/b53.txt b/Documentation/devicetree/bindings/net/dsa/b53.txt
index ca752db14dff..d6c6e41648d4 100644
--- a/Documentation/devicetree/bindings/net/dsa/b53.txt
+++ b/Documentation/devicetree/bindings/net/dsa/b53.txt
@@ -20,6 +20,15 @@ Required properties:
       "brcm,bcm53018-srab"
       "brcm,bcm53019-srab" and the mandatory "brcm,bcm5301x-srab" string
 
+  For the BCM585xx/586XX/88312 SoCs with an integrated switch, must be one of:
+      "brcm,bcm58522-srab"
+      "brcm,bcm58523-srab"
+      "brcm,bcm58525-srab"
+      "brcm,bcm58622-srab"
+      "brcm,bcm58623-srab"
+      "brcm,bcm58625-srab"
+      "brcm,bcm88312-srab" and the mandatory "brcm,nsp-srab string
+
   For the BCM63xx/33xx SoCs with an integrated switch, must be one of:
       "brcm,bcm3384-switch"
       "brcm,bcm6328-switch"
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 444de66667b9..bda37d336736 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1581,6 +1581,18 @@ static const struct b53_chip_data b53_switch_chips[] = {
 		.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
 		.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
 	},
+	{
+		.chip_id = BCM58XX_DEVICE_ID,
+		.dev_name = "BCM585xx/586xx/88312",
+		.vlans	= 4096,
+		.enabled_ports = 0x1ff,
+		.arl_entries = 4,
+		.cpu_port = B53_CPU_PORT_25,
+		.vta_regs = B53_VTA_REGS,
+		.duplex_reg = B53_DUPLEX_STAT_GE,
+		.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
+		.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
+	},
 };
 
 static int b53_switch_init(struct b53_device *dev)
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
index 5d8c602fb877..835a744f206e 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -59,6 +59,7 @@ enum {
 	BCM53012_DEVICE_ID = 0x53012,
 	BCM53018_DEVICE_ID = 0x53018,
 	BCM53019_DEVICE_ID = 0x53019,
+	BCM58XX_DEVICE_ID = 0x5800,
 };
 
 #define B53_N_PORTS	9
diff --git a/drivers/net/dsa/b53/b53_srab.c b/drivers/net/dsa/b53/b53_srab.c
index de2b9e710041..2b304eaeb8e8 100644
--- a/drivers/net/dsa/b53/b53_srab.c
+++ b/drivers/net/dsa/b53/b53_srab.c
@@ -364,6 +364,14 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm53018-srab" },
 	{ .compatible = "brcm,bcm53019-srab" },
 	{ .compatible = "brcm,bcm5301x-srab" },
+	{ .compatible = "brcm,bcm58522-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,bcm58525-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,bcm58535-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,bcm58622-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,bcm58623-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,bcm58625-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,bcm88312-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,nsp-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, b53_srab_of_match);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support
  2016-07-08 18:39 [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support Florian Fainelli
  2016-07-08 18:39 ` [PATCH net-next 1/2] net: dsa: b53: Allow SRAB driver to specify platform data Florian Fainelli
  2016-07-08 18:39 ` [PATCH net-next 2/2] net: dsa: b53: Add support for BCM585xx/586xx/88312 integrated switch Florian Fainelli
@ 2016-07-08 20:02 ` Andrew Lunn
  2016-07-11 19:52 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2016-07-08 20:02 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, davem, jon.mason, zajec5, vivien.didelot,
	bcm-kernel-feedback-list

On Fri, Jul 08, 2016 at 11:39:11AM -0700, Florian Fainelli wrote:
> Hi all,
> 
> This patch series updates the B53 driver to support Broadcom's Northstar Plus
> Soc integrated switch.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support
  2016-07-08 18:39 [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support Florian Fainelli
                   ` (2 preceding siblings ...)
  2016-07-08 20:02 ` [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support Andrew Lunn
@ 2016-07-11 19:52 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-07-11 19:52 UTC (permalink / raw)
  To: f.fainelli
  Cc: netdev, jon.mason, andrew, zajec5, vivien.didelot,
	bcm-kernel-feedback-list

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri,  8 Jul 2016 11:39:11 -0700

> This patch series updates the B53 driver to support Broadcom's Northstar Plus
> Soc integrated switch.
> 
> Unlike the version of the core present in BCM5301x/Northstar, we cannot read the
> full chip id of the switch, so we need to get the information about our switch
> id from Device Tree.
> 
> Other than that, this is a regular Broadcom Ethernet switch which is register
> compatible for all practical purposes with the existing switch driver.
> 
> Since DSA requires a working CPU Ethernet MAC driver this depends on Jon
> Mason's AMAC/BGMAC driver changes to support NSP. Board specific changes depend
> on patches present in Broadcom's ARM SoC branches and will be posted in a short
> while.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-07-11 19:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 18:39 [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support Florian Fainelli
2016-07-08 18:39 ` [PATCH net-next 1/2] net: dsa: b53: Allow SRAB driver to specify platform data Florian Fainelli
2016-07-08 18:39 ` [PATCH net-next 2/2] net: dsa: b53: Add support for BCM585xx/586xx/88312 integrated switch Florian Fainelli
2016-07-08 20:02 ` [PATCH net-next 0/2] net: dsa: b53: Add Broadcom NSP switch support Andrew Lunn
2016-07-11 19:52 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.