d80b5db714bc215488bf6528c4383dfba5b4ef3c
[openwrt/staging/ldir.git] / target / linux / generic / backport-5.10 / 743-v5.16-0001-net-dsa-b53-Include-all-ports-in-enabled_ports.patch
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"
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Make "enabled_ports" bitfield contain all available switch ports
10 including a CPU port. This way there is no need for fixup during
11 initialization.
12
13 For BCM53010, BCM53018 and BCM53019 include also other available ports.
14
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>
19 ---
20 drivers/net/dsa/b53/b53_common.c | 23 +++++++++++------------
21 1 file changed, 11 insertions(+), 12 deletions(-)
22
23 --- a/drivers/net/dsa/b53/b53_common.c
24 +++ b/drivers/net/dsa/b53/b53_common.c
25 @@ -2288,7 +2288,7 @@ static const struct b53_chip_data b53_sw
26 .chip_id = BCM5325_DEVICE_ID,
27 .dev_name = "BCM5325",
28 .vlans = 16,
29 - .enabled_ports = 0x1f,
30 + .enabled_ports = 0x3f,
31 .arl_bins = 2,
32 .arl_buckets = 1024,
33 .imp_port = 5,
34 @@ -2299,7 +2299,7 @@ static const struct b53_chip_data b53_sw
35 .chip_id = BCM5365_DEVICE_ID,
36 .dev_name = "BCM5365",
37 .vlans = 256,
38 - .enabled_ports = 0x1f,
39 + .enabled_ports = 0x3f,
40 .arl_bins = 2,
41 .arl_buckets = 1024,
42 .imp_port = 5,
43 @@ -2310,7 +2310,7 @@ static const struct b53_chip_data b53_sw
44 .chip_id = BCM5389_DEVICE_ID,
45 .dev_name = "BCM5389",
46 .vlans = 4096,
47 - .enabled_ports = 0x1f,
48 + .enabled_ports = 0x11f,
49 .arl_bins = 4,
50 .arl_buckets = 1024,
51 .imp_port = 8,
52 @@ -2324,7 +2324,7 @@ static const struct b53_chip_data b53_sw
53 .chip_id = BCM5395_DEVICE_ID,
54 .dev_name = "BCM5395",
55 .vlans = 4096,
56 - .enabled_ports = 0x1f,
57 + .enabled_ports = 0x11f,
58 .arl_bins = 4,
59 .arl_buckets = 1024,
60 .imp_port = 8,
61 @@ -2338,7 +2338,7 @@ static const struct b53_chip_data b53_sw
62 .chip_id = BCM5397_DEVICE_ID,
63 .dev_name = "BCM5397",
64 .vlans = 4096,
65 - .enabled_ports = 0x1f,
66 + .enabled_ports = 0x11f,
67 .arl_bins = 4,
68 .arl_buckets = 1024,
69 .imp_port = 8,
70 @@ -2352,7 +2352,7 @@ static const struct b53_chip_data b53_sw
71 .chip_id = BCM5398_DEVICE_ID,
72 .dev_name = "BCM5398",
73 .vlans = 4096,
74 - .enabled_ports = 0x7f,
75 + .enabled_ports = 0x17f,
76 .arl_bins = 4,
77 .arl_buckets = 1024,
78 .imp_port = 8,
79 @@ -2366,7 +2366,7 @@ static const struct b53_chip_data b53_sw
80 .chip_id = BCM53115_DEVICE_ID,
81 .dev_name = "BCM53115",
82 .vlans = 4096,
83 - .enabled_ports = 0x1f,
84 + .enabled_ports = 0x11f,
85 .arl_bins = 4,
86 .arl_buckets = 1024,
87 .vta_regs = B53_VTA_REGS,
88 @@ -2380,7 +2380,7 @@ static const struct b53_chip_data b53_sw
89 .chip_id = BCM53125_DEVICE_ID,
90 .dev_name = "BCM53125",
91 .vlans = 4096,
92 - .enabled_ports = 0xff,
93 + .enabled_ports = 0x1ff,
94 .arl_bins = 4,
95 .arl_buckets = 1024,
96 .imp_port = 8,
97 @@ -2422,7 +2422,7 @@ static const struct b53_chip_data b53_sw
98 .chip_id = BCM53010_DEVICE_ID,
99 .dev_name = "BCM53010",
100 .vlans = 4096,
101 - .enabled_ports = 0x1f,
102 + .enabled_ports = 0x1bf,
103 .arl_bins = 4,
104 .arl_buckets = 1024,
105 .imp_port = 8,
106 @@ -2464,7 +2464,7 @@ static const struct b53_chip_data b53_sw
107 .chip_id = BCM53018_DEVICE_ID,
108 .dev_name = "BCM53018",
109 .vlans = 4096,
110 - .enabled_ports = 0x1f,
111 + .enabled_ports = 0x1bf,
112 .arl_bins = 4,
113 .arl_buckets = 1024,
114 .imp_port = 8,
115 @@ -2478,7 +2478,7 @@ static const struct b53_chip_data b53_sw
116 .chip_id = BCM53019_DEVICE_ID,
117 .dev_name = "BCM53019",
118 .vlans = 4096,
119 - .enabled_ports = 0x1f,
120 + .enabled_ports = 0x1bf,
121 .arl_bins = 4,
122 .arl_buckets = 1024,
123 .imp_port = 8,
124 @@ -2605,7 +2605,6 @@ static int b53_switch_init(struct b53_de
125 dev->cpu_port = 5;
126 }
127
128 - dev->enabled_ports |= BIT(dev->cpu_port);
129 dev->num_ports = fls(dev->enabled_ports);
130
131 dev->ds->num_ports = min_t(unsigned int, dev->num_ports, DSA_MAX_PORTS);