c69c0334c749e3185f0b9770d05fa3f6aa497ea0
[openwrt/staging/pepe2k.git] /
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 @@ -2303,7 +2303,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 @@ -2314,7 +2314,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 @@ -2325,7 +2325,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 @@ -2339,7 +2339,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 @@ -2353,7 +2353,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 @@ -2367,7 +2367,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 @@ -2381,7 +2381,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 @@ -2395,7 +2395,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 @@ -2437,7 +2437,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 @@ -2479,7 +2479,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 @@ -2493,7 +2493,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 @@ -2635,7 +2635,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);