linux-brain/drivers/net/dsa/b53
Rafał Miłecki b79204169d net: dsa: b53: Fix calculating number of switch ports
[ Upstream commit cdb067d31c0fe4cce98b9d15f1f2ef525acaa094 ]

It isn't true that CPU port is always the last one. Switches BCM5301x
have 9 ports (port 6 being inactive) and they use port 5 as CPU by
default (depending on design some other may be CPU ports too).

A more reliable way of determining number of ports is to check for the
last set bit in the "enabled_ports" bitfield.

This fixes b53 internal state, it will allow providing accurate info to
the DSA and is required to fix BCM5301x support.

Fixes: 967dd82ffc ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-22 12:26:45 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile net: dsa: b53: Add SerDes support 2018-09-06 07:48:34 -07:00
b53_common.c net: dsa: b53: Fix calculating number of switch ports 2021-09-22 12:26:45 +02:00
b53_mdio.c net: dsa: b53: Add BCM5389 support 2018-06-01 11:15:42 -04:00
b53_mmap.c net: dsa: b53: Fix sparse warnings in b53_mmap.c 2018-04-04 11:15:27 -04:00
b53_priv.h net: dsa: b53: Add support for port_egress_floods callback 2019-09-16 09:06:12 +02:00
b53_regs.h net: dsa: b53: Support setting learning on port 2021-03-20 10:39:47 +01:00
b53_serdes.c net: dsa: b53: Don't assign autonegotiation enabled 2018-09-21 19:57:03 -07:00
b53_serdes.h net: dsa: b53: Use the correct style for SPDX License Identifier 2019-09-22 15:24:51 -07:00
b53_spi.c
b53_srab.c net: dsa: b53: use devm_platform_ioremap_resource() to simplify code 2019-08-01 13:10:34 -04:00