1 From 983d96a9116a328668601555d96736261d33170c Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Thu, 16 Sep 2021 14:03:51 +0200
4 Subject: [PATCH] net: dsa: b53: Include all ports in "enabled_ports"
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Make "enabled_ports" bitfield contain all available switch ports
10 including a CPU port. This way there is no need for fixup during
13 For BCM53010, BCM53018 and BCM53019 include also other available ports.
15 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
17 Tested-by: Florian Fainelli <f.fainelli@gmail.com>
18 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
20 drivers/net/dsa/b53/b53_common.c | 23 +++++++++++------------
21 1 file changed, 11 insertions(+), 12 deletions(-)
23 --- a/drivers/net/dsa/b53/b53_common.c
24 +++ b/drivers/net/dsa/b53/b53_common.c
25 @@ -2300,7 +2300,7 @@ static const struct b53_chip_data b53_sw
26 .chip_id = BCM5325_DEVICE_ID,
27 .dev_name = "BCM5325",
29 - .enabled_ports = 0x1f,
30 + .enabled_ports = 0x3f,
34 @@ -2311,7 +2311,7 @@ static const struct b53_chip_data b53_sw
35 .chip_id = BCM5365_DEVICE_ID,
36 .dev_name = "BCM5365",
38 - .enabled_ports = 0x1f,
39 + .enabled_ports = 0x3f,
43 @@ -2322,7 +2322,7 @@ static const struct b53_chip_data b53_sw
44 .chip_id = BCM5389_DEVICE_ID,
45 .dev_name = "BCM5389",
47 - .enabled_ports = 0x1f,
48 + .enabled_ports = 0x11f,
52 @@ -2336,7 +2336,7 @@ static const struct b53_chip_data b53_sw
53 .chip_id = BCM5395_DEVICE_ID,
54 .dev_name = "BCM5395",
56 - .enabled_ports = 0x1f,
57 + .enabled_ports = 0x11f,
61 @@ -2350,7 +2350,7 @@ static const struct b53_chip_data b53_sw
62 .chip_id = BCM5397_DEVICE_ID,
63 .dev_name = "BCM5397",
65 - .enabled_ports = 0x1f,
66 + .enabled_ports = 0x11f,
70 @@ -2364,7 +2364,7 @@ static const struct b53_chip_data b53_sw
71 .chip_id = BCM5398_DEVICE_ID,
72 .dev_name = "BCM5398",
74 - .enabled_ports = 0x7f,
75 + .enabled_ports = 0x17f,
79 @@ -2378,7 +2378,7 @@ static const struct b53_chip_data b53_sw
80 .chip_id = BCM53115_DEVICE_ID,
81 .dev_name = "BCM53115",
83 - .enabled_ports = 0x1f,
84 + .enabled_ports = 0x11f,
87 .vta_regs = B53_VTA_REGS,
88 @@ -2392,7 +2392,7 @@ static const struct b53_chip_data b53_sw
89 .chip_id = BCM53125_DEVICE_ID,
90 .dev_name = "BCM53125",
92 - .enabled_ports = 0xff,
93 + .enabled_ports = 0x1ff,
97 @@ -2434,7 +2434,7 @@ static const struct b53_chip_data b53_sw
98 .chip_id = BCM53010_DEVICE_ID,
99 .dev_name = "BCM53010",
101 - .enabled_ports = 0x1f,
102 + .enabled_ports = 0x1bf,
106 @@ -2476,7 +2476,7 @@ static const struct b53_chip_data b53_sw
107 .chip_id = BCM53018_DEVICE_ID,
108 .dev_name = "BCM53018",
110 - .enabled_ports = 0x1f,
111 + .enabled_ports = 0x1bf,
115 @@ -2490,7 +2490,7 @@ static const struct b53_chip_data b53_sw
116 .chip_id = BCM53019_DEVICE_ID,
117 .dev_name = "BCM53019",
119 - .enabled_ports = 0x1f,
120 + .enabled_ports = 0x1bf,
124 @@ -2632,7 +2632,6 @@ static int b53_switch_init(struct b53_de
128 - dev->enabled_ports |= BIT(dev->cpu_port);
129 dev->num_ports = fls(dev->enabled_ports);
131 dev->ds->num_ports = min_t(unsigned int, dev->num_ports, DSA_MAX_PORTS);