linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: dsa: bcm_sf2: Additional DT changes
@ 2020-09-22 20:03 Florian Fainelli
  2020-09-22 20:03 ` [PATCH net-next 1/2] net: dsa: bcm_sf2: Disallow port 5 to be a DSA CPU port Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Florian Fainelli @ 2020-09-22 20:03 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S. Miller,
	Jakub Kicinski, open list

Hi David,

This patch series includes some additional changes to the bcm_sf2 in
order to support the Device Tree firmwares provided on such platforms.

Florian Fainelli (2):
  net: dsa: bcm_sf2: Disallow port 5 to be a DSA CPU port
  net: dsa: bcm_sf2: Include address 0 for MDIO diversion

 drivers/net/dsa/bcm_sf2.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

-- 
2.25.1


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

* [PATCH net-next 1/2] net: dsa: bcm_sf2: Disallow port 5 to be a DSA CPU port
  2020-09-22 20:03 [PATCH net-next 0/2] net: dsa: bcm_sf2: Additional DT changes Florian Fainelli
@ 2020-09-22 20:03 ` Florian Fainelli
  2020-09-22 20:03 ` [PATCH net-next 2/2] net: dsa: bcm_sf2: Include address 0 for MDIO diversion Florian Fainelli
  2020-09-24  0:51 ` [PATCH net-next 0/2] net: dsa: bcm_sf2: Additional DT changes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2020-09-22 20:03 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S. Miller,
	Jakub Kicinski, open list

While the switch driver is written such that port 5 or 8 could be CPU
ports, the use case on Broadcom STB chips is to use port 8 exclusively.
The platform firmware does make port 5 comply to a proper DSA CPU port
binding by specifiying an "ethernet" phandle. This is undesirable for
now until we have an user-space configuration mechanism (such as
devlink) which could support dynamically changing the port flavor at
run time.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/bcm_sf2.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 723820603107..2bd52b03de38 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -457,6 +457,7 @@ static void bcm_sf2_identify_ports(struct bcm_sf2_priv *priv,
 {
 	struct device_node *port;
 	unsigned int port_num;
+	struct property *prop;
 	phy_interface_t mode;
 	int err;
 
@@ -483,6 +484,16 @@ static void bcm_sf2_identify_ports(struct bcm_sf2_priv *priv,
 
 		if (of_property_read_bool(port, "brcm,use-bcm-hdr"))
 			priv->brcm_tag_mask |= 1 << port_num;
+
+		/* Ensure that port 5 is not picked up as a DSA CPU port
+		 * flavour but a regular port instead. We should be using
+		 * devlink to be able to set the port flavour.
+		 */
+		if (port_num == 5 && priv->type == BCM7278_DEVICE_ID) {
+			prop = of_find_property(port, "ethernet", NULL);
+			if (prop)
+				of_remove_property(port, prop);
+		}
 	}
 }
 
-- 
2.25.1


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

* [PATCH net-next 2/2] net: dsa: bcm_sf2: Include address 0 for MDIO diversion
  2020-09-22 20:03 [PATCH net-next 0/2] net: dsa: bcm_sf2: Additional DT changes Florian Fainelli
  2020-09-22 20:03 ` [PATCH net-next 1/2] net: dsa: bcm_sf2: Disallow port 5 to be a DSA CPU port Florian Fainelli
@ 2020-09-22 20:03 ` Florian Fainelli
  2020-09-24  0:51 ` [PATCH net-next 0/2] net: dsa: bcm_sf2: Additional DT changes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2020-09-22 20:03 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S. Miller,
	Jakub Kicinski, open list

We need to include MDIO address 0, which is how our Device Tree blobs
indicate where to find the external BCM53125 switches.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/bcm_sf2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 2bd52b03de38..0b5b2b33b3b6 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -538,7 +538,7 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds)
 	 * driver.
 	 */
 	if (of_machine_is_compatible("brcm,bcm7445d0"))
-		priv->indir_phy_mask |= (1 << BRCM_PSEUDO_PHY_ADDR);
+		priv->indir_phy_mask |= (1 << BRCM_PSEUDO_PHY_ADDR) | (1 << 0);
 	else
 		priv->indir_phy_mask = 0;
 
-- 
2.25.1


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

* Re: [PATCH net-next 0/2] net: dsa: bcm_sf2: Additional DT changes
  2020-09-22 20:03 [PATCH net-next 0/2] net: dsa: bcm_sf2: Additional DT changes Florian Fainelli
  2020-09-22 20:03 ` [PATCH net-next 1/2] net: dsa: bcm_sf2: Disallow port 5 to be a DSA CPU port Florian Fainelli
  2020-09-22 20:03 ` [PATCH net-next 2/2] net: dsa: bcm_sf2: Include address 0 for MDIO diversion Florian Fainelli
@ 2020-09-24  0:51 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-09-24  0:51 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, andrew, vivien.didelot, kuba, linux-kernel

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 22 Sep 2020 13:03:54 -0700

> This patch series includes some additional changes to the bcm_sf2 in
> order to support the Device Tree firmwares provided on such platforms.

Series applied, thanks Florian.

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

end of thread, other threads:[~2020-09-24  0:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 20:03 [PATCH net-next 0/2] net: dsa: bcm_sf2: Additional DT changes Florian Fainelli
2020-09-22 20:03 ` [PATCH net-next 1/2] net: dsa: bcm_sf2: Disallow port 5 to be a DSA CPU port Florian Fainelli
2020-09-22 20:03 ` [PATCH net-next 2/2] net: dsa: bcm_sf2: Include address 0 for MDIO diversion Florian Fainelli
2020-09-24  0:51 ` [PATCH net-next 0/2] net: dsa: bcm_sf2: Additional DT changes David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).