From 0bd694ea220aa8763979af4fb7a1d6f96a2f0a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Wed, 11 Jun 2025 09:46:44 +0200 Subject: [PATCH] generic: 6.12: backport accepted BCM5325 patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport accepted BCM5325 patches from net-next. These patches will be merged in the v6.17 kernel window. Signed-off-by: Álvaro Fernández Rojas --- package/kernel/linux/modules/netdevices.mk | 1 + ...3-prevent-BRCM_HDR-access-on-BCM5325.patch | 32 ----- ...ag_brcm-legacy-reorganize-functions.patch} | 7 +- ...rcm-add-support-for-legacy-FCS-tags.patch} | 53 ++++++--- ...net-dsa-b53-support-legacy-FCS-tags.patch} | 17 +-- ...-net-dsa-b53-detect-BCM5325-variants.patch | 112 ++++++++++++++++++ ...ort-for-FDB-operations-on-5325-5365.patch} | 40 +++---- ...-prevent-FAST_AGE-access-on-BCM5325.patch} | 11 +- ...event-SWITCH_CTRL-access-on-BCM5325.patch} | 12 +- ...53-fix-IP_MULTICAST_CTRL-on-BCM5325.patch} | 11 +- ...vent-DIS_LEARNING-access-on-BCM5325.patch} | 13 +- ...ent-BRCM_HDR-access-on-older-devices.patch | 33 ++++++ ...ORT_OVERRIDE_CTRL-access-on-BCM5325.patch} | 19 +-- ...icast-multicast-flooding-on-BCM5325.patch} | 27 ++--- ...-fix-b53_imp_vlan_setup-for-BCM5325.patch} | 11 +- ...b53-ensure-BCM5325-PHYs-are-enabled.patch} | 34 +++--- target/linux/generic/config-6.12 | 1 + ...crease-max-ports-for-rtl839x-rtl931x.patch | 4 +- target/linux/sunxi/cortexa7/config-6.12 | 1 + 19 files changed, 285 insertions(+), 154 deletions(-) delete mode 100644 target/linux/bmips/patches-6.12/135-net-dsa-b53-prevent-BRCM_HDR-access-on-BCM5325.patch rename target/linux/{bmips/patches-6.12/120-net-dsa-tag_brcm-legacy-reorganize-functions.patch => generic/backport-6.12/612-01-v6.17-net-dsa-tag_brcm-legacy-reorganize-functions.patch} (89%) rename target/linux/{bmips/patches-6.12/121-net-dsa-tag_brcm-add-support-for-legacy-FCS-tags.patch => generic/backport-6.12/612-02-v6.17-net-dsa-tag_brcm-add-support-for-legacy-FCS-tags.patch} (75%) rename target/linux/{bmips/patches-6.12/122-net-dsa-b53-support-legacy-FCS-tags.patch => generic/backport-6.12/612-03-v6.17-net-dsa-b53-support-legacy-FCS-tags.patch} (71%) create mode 100644 target/linux/generic/backport-6.12/612-04-v6.17-net-dsa-b53-detect-BCM5325-variants.patch rename target/linux/{bmips/patches-6.12/130-net-dsa-b53-add-support-for-FDB-operations-on-5325-5365.patch => generic/backport-6.12/612-05-v6.17-net-dsa-b53-add-support-for-FDB-operations-on-5325-5365.patch} (84%) rename target/linux/{bmips/patches-6.12/131-net-dsa-b53-prevent-FAST_AGE-access-on-BCM5325.patch => generic/backport-6.12/612-06-v6.17-net-dsa-b53-prevent-FAST_AGE-access-on-BCM5325.patch} (77%) rename target/linux/{bmips/patches-6.12/132-net-dsa-b53-prevent-SWITCH_CTRL-access-on-BCM5325.patch => generic/backport-6.12/612-07-v6.17-net-dsa-b53-prevent-SWITCH_CTRL-access-on-BCM5325.patch} (80%) rename target/linux/{bmips/patches-6.12/133-net-dsa-b53-fix-IP_MULTICAST_CTRL-on-BCM5325.patch => generic/backport-6.12/612-08-v6.17-net-dsa-b53-fix-IP_MULTICAST_CTRL-on-BCM5325.patch} (84%) rename target/linux/{bmips/patches-6.12/134-net-dsa-b53-prevent-DIS_LEARNING-access-on-BCM5325.patch => generic/backport-6.12/612-09-v6.17-net-dsa-b53-prevent-DIS_LEARNING-access-on-BCM5325.patch} (71%) create mode 100644 target/linux/generic/backport-6.12/612-10-v6.17-net-dsa-b53-prevent-BRCM_HDR-access-on-older-devices.patch rename target/linux/{bmips/patches-6.12/136-net-dsa-b53-prevent-GMII_PORT_OVERRIDE_CTRL-access-on-BCM5325.patch => generic/backport-6.12/612-11-v6.17-net-dsa-b53-prevent-GMII_PORT_OVERRIDE_CTRL-access-on-BCM5325.patch} (80%) rename target/linux/{bmips/patches-6.12/137-net-dsa-b53-fix-unicast-multicast-flooding-on-BCM5325.patch => generic/backport-6.12/612-12-v6.17-net-dsa-b53-fix-unicast-multicast-flooding-on-BCM5325.patch} (86%) rename target/linux/{bmips/patches-6.12/138-net-dsa-b53-fix-b53_imp_vlan_setup-for-BCM5325.patch => generic/backport-6.12/612-13-v6.17-net-dsa-b53-fix-b53_imp_vlan_setup-for-BCM5325.patch} (70%) rename target/linux/{bmips/patches-6.12/139-net-dsa-b53-ensure-BCM5325-PHYs-are-enabled.patch => generic/backport-6.12/612-14-v6.17-net-dsa-b53-ensure-BCM5325-PHYs-are-enabled.patch} (55%) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 58732b14d86..e6f37de9917 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -579,6 +579,7 @@ define KernelPackage/dsa-b53 KCONFIG:=CONFIG_B53 \ CONFIG_NET_DSA_TAG_BRCM \ CONFIG_NET_DSA_TAG_BRCM_LEGACY \ + CONFIG_NET_DSA_TAG_BRCM_LEGACY_FCS \ CONFIG_NET_DSA_TAG_BRCM_PREPEND FILES:= \ $(LINUX_DIR)/drivers/net/dsa/b53/b53_common.ko \ diff --git a/target/linux/bmips/patches-6.12/135-net-dsa-b53-prevent-BRCM_HDR-access-on-BCM5325.patch b/target/linux/bmips/patches-6.12/135-net-dsa-b53-prevent-BRCM_HDR-access-on-BCM5325.patch deleted file mode 100644 index 22899cac949..00000000000 --- a/target/linux/bmips/patches-6.12/135-net-dsa-b53-prevent-BRCM_HDR-access-on-BCM5325.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 2497ff2da6b938544868e49f6017bdbe56773d80 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Fri, 30 May 2025 23:18:03 +0200 -Subject: [RFC PATCH net-next v2 06/10] net: dsa: b53: prevent BRCM_HDR access - on BCM5325 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -BCM5325 doesn't implement BRCM_HDR register so we should avoid reading or -writing it. - -Fixes: b409a9efa183 ("net: dsa: b53: Move Broadcom header setup to b53") -Signed-off-by: Álvaro Fernández Rojas -Reviewed-by: Florian Fainelli ---- - drivers/net/dsa/b53/b53_common.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/net/dsa/b53/b53_common.c -+++ b/drivers/net/dsa/b53/b53_common.c -@@ -730,6 +730,10 @@ void b53_brcm_hdr_setup(struct dsa_switc - hdr_ctl |= GC_FRM_MGMT_PORT_M; - b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, hdr_ctl); - -+ /* B53_BRCM_HDR not present on BCM5325 */ -+ if (is5325(dev)) -+ return; -+ - /* Enable Broadcom tags for IMP port */ - b53_read8(dev, B53_MGMT_PAGE, B53_BRCM_HDR, &hdr_ctl); - if (tag_en) diff --git a/target/linux/bmips/patches-6.12/120-net-dsa-tag_brcm-legacy-reorganize-functions.patch b/target/linux/generic/backport-6.12/612-01-v6.17-net-dsa-tag_brcm-legacy-reorganize-functions.patch similarity index 89% rename from target/linux/bmips/patches-6.12/120-net-dsa-tag_brcm-legacy-reorganize-functions.patch rename to target/linux/generic/backport-6.12/612-01-v6.17-net-dsa-tag_brcm-legacy-reorganize-functions.patch index fbc91219dfc..23d4929eaad 100644 --- a/target/linux/bmips/patches-6.12/120-net-dsa-tag_brcm-legacy-reorganize-functions.patch +++ b/target/linux/generic/backport-6.12/612-01-v6.17-net-dsa-tag_brcm-legacy-reorganize-functions.patch @@ -1,6 +1,6 @@ -From f4ed3dc77c598151a892b3c7622da4e8313bde2c Mon Sep 17 00:00:00 2001 +From a4daaf063f8269a5881154c5b77c5ef6639d65d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Fri, 30 May 2025 17:10:11 +0200 +Date: Sat, 14 Jun 2025 09:59:47 +0200 Subject: [PATCH] net: dsa: tag_brcm: legacy: reorganize functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -9,7 +9,10 @@ Content-Transfer-Encoding: 8bit Move brcm_leg_tag_rcv() definition to top. This function is going to be shared between two different tags. +Reviewed-by: Florian Fainelli Signed-off-by: Álvaro Fernández Rojas +Link: https://patch.msgid.link/20250614080000.1884236-2-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- net/dsa/tag_brcm.c | 64 +++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/target/linux/bmips/patches-6.12/121-net-dsa-tag_brcm-add-support-for-legacy-FCS-tags.patch b/target/linux/generic/backport-6.12/612-02-v6.17-net-dsa-tag_brcm-add-support-for-legacy-FCS-tags.patch similarity index 75% rename from target/linux/bmips/patches-6.12/121-net-dsa-tag_brcm-add-support-for-legacy-FCS-tags.patch rename to target/linux/generic/backport-6.12/612-02-v6.17-net-dsa-tag_brcm-add-support-for-legacy-FCS-tags.patch index d8ff205c014..9f6b71ff648 100644 --- a/target/linux/bmips/patches-6.12/121-net-dsa-tag_brcm-add-support-for-legacy-FCS-tags.patch +++ b/target/linux/generic/backport-6.12/612-02-v6.17-net-dsa-tag_brcm-add-support-for-legacy-FCS-tags.patch @@ -1,6 +1,6 @@ -From fa4bb7220eb7b2f0d985dd9d1f60ba8bd84a8870 Mon Sep 17 00:00:00 2001 +From ef07df397a621707903ef0d294a7df11f80cf206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Mon, 17 Apr 2023 18:38:05 +0200 +Date: Sat, 14 Jun 2025 09:59:48 +0200 Subject: [PATCH] net: dsa: tag_brcm: add support for legacy FCS tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -14,11 +14,14 @@ Adding the original FCS value and length to DSA_TAG_PROTO_BRCM_LEGACY would impact performance of BCM63xx switches, so it's better to create a new tag. Signed-off-by: Álvaro Fernández Rojas +Reviewed-by: Florian Fainelli +Link: https://patch.msgid.link/20250614080000.1884236-3-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- include/net/dsa.h | 2 ++ - net/dsa/Kconfig | 8 ++++++ - net/dsa/tag_brcm.c | 71 +++++++++++++++++++++++++++++++++++++++++++++- - 3 files changed, 80 insertions(+), 1 deletion(-) + net/dsa/Kconfig | 16 ++++++++-- + net/dsa/tag_brcm.c | 73 +++++++++++++++++++++++++++++++++++++++++++++- + 3 files changed, 88 insertions(+), 3 deletions(-) --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -38,21 +41,33 @@ Signed-off-by: Álvaro Fernández Rojas DSA_TAG_PROTO_EDSA = DSA_TAG_PROTO_EDSA_VALUE, --- a/net/dsa/Kconfig +++ b/net/dsa/Kconfig -@@ -49,6 +49,14 @@ config NET_DSA_TAG_BRCM_LEGACY - Broadcom legacy switches which place the tag after the MAC source - address. +@@ -42,12 +42,24 @@ config NET_DSA_TAG_BRCM + Broadcom switches which place the tag after the MAC source address. + config NET_DSA_TAG_BRCM_LEGACY +- tristate "Tag driver for Broadcom legacy switches using in-frame headers" ++ tristate "Tag driver for BCM63xx legacy switches using in-frame headers" + select NET_DSA_TAG_BRCM_COMMON + help + Say Y if you want to enable support for tagging frames for the +- Broadcom legacy switches which place the tag after the MAC source ++ BCM63xx legacy switches which place the tag after the MAC source + address. ++ This tag is used in BCM63xx legacy switches which work without the ++ original FCS and length before the tag insertion. ++ +config NET_DSA_TAG_BRCM_LEGACY_FCS -+ tristate "Tag driver for Broadcom legacy switches using in-frame headers, FCS and length" ++ tristate "Tag driver for BCM53xx legacy switches using in-frame headers" + select NET_DSA_TAG_BRCM_COMMON + help + Say Y if you want to enable support for tagging frames for the -+ Broadcom legacy switches which place the tag after the MAC source -+ address and require the original FCS and length. -+ ++ BCM53xx legacy switches which place the tag after the MAC source ++ address. ++ This tag is used in BCM53xx legacy switches which expect original ++ FCS and length before the tag insertion to be present. + config NET_DSA_TAG_BRCM_PREPEND tristate "Tag driver for Broadcom switches using prepended headers" - select NET_DSA_TAG_BRCM_COMMON --- a/net/dsa/tag_brcm.c +++ b/net/dsa/tag_brcm.c @@ -15,6 +15,7 @@ @@ -104,23 +119,23 @@ Signed-off-by: Álvaro Fernández Rojas +{ + struct dsa_port *dp = dsa_user_to_port(dev); + unsigned int fcs_len; -+ u32 fcs_val; ++ __le32 fcs_val; + u8 *brcm_tag; + + /* The Ethernet switch we are interfaced with needs packets to be at + * least 64 bytes (including FCS) otherwise they will be discarded when + * they enter the switch port logic. When Broadcom tags are enabled, we -+ * need to make sure that packets are at least 70 bytes -+ * (including FCS and tag) because the length verification is done after -+ * the Broadcom tag is stripped off the ingress packet. ++ * need to make sure that packets are at least 70 bytes (including FCS ++ * and tag) because the length verification is done after the Broadcom ++ * tag is stripped off the ingress packet. + * -+ * Let dsa_user_xmit() free the SKB ++ * Let dsa_user_xmit() free the SKB. + */ + if (__skb_put_padto(skb, ETH_ZLEN + BRCM_LEG_TAG_LEN, false)) + return NULL; + + fcs_len = skb->len; -+ fcs_val = swab32(crc32(~0, skb->data, fcs_len) ^ ~0); ++ fcs_val = cpu_to_le32(crc32_le(~0, skb->data, fcs_len) ^ ~0); + + skb_push(skb, BRCM_LEG_TAG_LEN); + diff --git a/target/linux/bmips/patches-6.12/122-net-dsa-b53-support-legacy-FCS-tags.patch b/target/linux/generic/backport-6.12/612-03-v6.17-net-dsa-b53-support-legacy-FCS-tags.patch similarity index 71% rename from target/linux/bmips/patches-6.12/122-net-dsa-b53-support-legacy-FCS-tags.patch rename to target/linux/generic/backport-6.12/612-03-v6.17-net-dsa-b53-support-legacy-FCS-tags.patch index 661d071c91a..3535f564f6f 100644 --- a/target/linux/bmips/patches-6.12/122-net-dsa-b53-support-legacy-FCS-tags.patch +++ b/target/linux/generic/backport-6.12/612-03-v6.17-net-dsa-b53-support-legacy-FCS-tags.patch @@ -1,17 +1,20 @@ -From acd751e9fe048cb51e9aee3c780f019c5e9732ec Mon Sep 17 00:00:00 2001 +From c3cf059a4d419b9c888ce7e9952fa13ba7569b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Fri, 30 May 2025 17:31:39 +0200 +Date: Sat, 14 Jun 2025 09:59:49 +0200 Subject: [PATCH] net: dsa: b53: support legacy FCS tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Commit 46c5176c586c ("net: dsa: b53: support legacy tags") introduced support -for legacy tags, but it turns out that BCM5325 and BCM5365 switches require -the original FCS value and length, so they have to be treated differently. +Commit 46c5176c586c ("net: dsa: b53: support legacy tags") introduced +support for legacy tags, but it turns out that BCM5325 and BCM5365 +switches require the original FCS value and length, so they have to be +treated differently. -Fixes: 46c5176c586c ("net: dsa: b53: support legacy tags") +Reviewed-by: Florian Fainelli Signed-off-by: Álvaro Fernández Rojas +Link: https://patch.msgid.link/20250614080000.1884236-4-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- drivers/net/dsa/b53/Kconfig | 1 + drivers/net/dsa/b53/b53_common.c | 7 +++++-- @@ -29,7 +32,7 @@ Signed-off-by: Álvaro Fernández Rojas This driver adds support for Broadcom managed switch chips. It supports --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c -@@ -2244,8 +2244,11 @@ enum dsa_tag_protocol b53_get_tag_protoc +@@ -2245,8 +2245,11 @@ enum dsa_tag_protocol b53_get_tag_protoc goto out; } diff --git a/target/linux/generic/backport-6.12/612-04-v6.17-net-dsa-b53-detect-BCM5325-variants.patch b/target/linux/generic/backport-6.12/612-04-v6.17-net-dsa-b53-detect-BCM5325-variants.patch new file mode 100644 index 00000000000..0a0da33171f --- /dev/null +++ b/target/linux/generic/backport-6.12/612-04-v6.17-net-dsa-b53-detect-BCM5325-variants.patch @@ -0,0 +1,112 @@ +From 0cbec9aef5a86194117a956546dc1aec95031f37 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Sat, 14 Jun 2025 09:59:50 +0200 +Subject: [PATCH] net: dsa: b53: detect BCM5325 variants +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We need to be able to differentiate the BCM5325 variants because: +- BCM5325M switches lack the ARLIO_PAGE->VLAN_ID_IDX register. +- BCM5325E have less 512 ARL buckets instead of 1024. + +Signed-off-by: Álvaro Fernández Rojas +Reviewed-by: Florian Fainelli +Link: https://patch.msgid.link/20250614080000.1884236-5-noltari@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/b53/b53_common.c | 24 +++++++++++++++++++++--- + drivers/net/dsa/b53/b53_priv.h | 19 +++++++++++++++++++ + 2 files changed, 40 insertions(+), 3 deletions(-) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1778,7 +1778,8 @@ static int b53_arl_op(struct b53_device + + /* Perform a read for the given MAC and VID */ + b53_write48(dev, B53_ARLIO_PAGE, B53_MAC_ADDR_IDX, mac); +- b53_write16(dev, B53_ARLIO_PAGE, B53_VLAN_ID_IDX, vid); ++ if (!is5325m(dev)) ++ b53_write16(dev, B53_ARLIO_PAGE, B53_VLAN_ID_IDX, vid); + + /* Issue a read operation for this MAC */ + ret = b53_arl_rw_op(dev, 1); +@@ -2844,6 +2845,9 @@ static int b53_switch_init(struct b53_de + } + } + ++ if (is5325e(dev)) ++ dev->num_arl_buckets = 512; ++ + dev->num_ports = fls(dev->enabled_ports); + + dev->ds->num_ports = min_t(unsigned int, dev->num_ports, DSA_MAX_PORTS); +@@ -2945,10 +2949,24 @@ int b53_switch_detect(struct b53_device + b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_TABLE_ACCESS_25, 0xf); + b53_read16(dev, B53_VLAN_PAGE, B53_VLAN_TABLE_ACCESS_25, &tmp); + +- if (tmp == 0xf) ++ if (tmp == 0xf) { ++ u32 phy_id; ++ int val; ++ + dev->chip_id = BCM5325_DEVICE_ID; +- else ++ ++ val = b53_phy_read16(dev->ds, 0, MII_PHYSID1); ++ phy_id = (val & 0xffff) << 16; ++ val = b53_phy_read16(dev->ds, 0, MII_PHYSID2); ++ phy_id |= (val & 0xfff0); ++ ++ if (phy_id == 0x00406330) ++ dev->variant_id = B53_VARIANT_5325M; ++ else if (phy_id == 0x0143bc30) ++ dev->variant_id = B53_VARIANT_5325E; ++ } else { + dev->chip_id = BCM5365_DEVICE_ID; ++ } + break; + case BCM5389_DEVICE_ID: + case BCM5395_DEVICE_ID: +--- a/drivers/net/dsa/b53/b53_priv.h ++++ b/drivers/net/dsa/b53/b53_priv.h +@@ -84,6 +84,12 @@ enum { + BCM53134_DEVICE_ID = 0x5075, + }; + ++enum b53_variant_id { ++ B53_VARIANT_NONE = 0, ++ B53_VARIANT_5325E, ++ B53_VARIANT_5325M, ++}; ++ + struct b53_pcs { + struct phylink_pcs pcs; + struct b53_device *dev; +@@ -118,6 +124,7 @@ struct b53_device { + + /* chip specific data */ + u32 chip_id; ++ enum b53_variant_id variant_id; + u8 core_rev; + u8 vta_regs[3]; + u8 duplex_reg; +@@ -165,6 +172,18 @@ static inline int is5325(struct b53_devi + return dev->chip_id == BCM5325_DEVICE_ID; + } + ++static inline int is5325e(struct b53_device *dev) ++{ ++ return is5325(dev) && ++ dev->variant_id == B53_VARIANT_5325E; ++} ++ ++static inline int is5325m(struct b53_device *dev) ++{ ++ return is5325(dev) && ++ dev->variant_id == B53_VARIANT_5325M; ++} ++ + static inline int is5365(struct b53_device *dev) + { + #ifdef CONFIG_BCM47XX diff --git a/target/linux/bmips/patches-6.12/130-net-dsa-b53-add-support-for-FDB-operations-on-5325-5365.patch b/target/linux/generic/backport-6.12/612-05-v6.17-net-dsa-b53-add-support-for-FDB-operations-on-5325-5365.patch similarity index 84% rename from target/linux/bmips/patches-6.12/130-net-dsa-b53-add-support-for-FDB-operations-on-5325-5365.patch rename to target/linux/generic/backport-6.12/612-05-v6.17-net-dsa-b53-add-support-for-FDB-operations-on-5325-5365.patch index 25b2a74dd85..099638131cc 100644 --- a/target/linux/bmips/patches-6.12/130-net-dsa-b53-add-support-for-FDB-operations-on-5325-5365.patch +++ b/target/linux/generic/backport-6.12/612-05-v6.17-net-dsa-b53-add-support-for-FDB-operations-on-5325-5365.patch @@ -1,8 +1,7 @@ -From 1cd53b29d573aef79ea69f6f502517a71e3f04a7 Mon Sep 17 00:00:00 2001 +From c45655386e532c85ff1d679fc2aa40b3aaff9916 Mon Sep 17 00:00:00 2001 From: Florian Fainelli -Date: Sat, 9 Sep 2017 16:41:26 -0700 -Subject: [RFC PATCH net-next v2 01/10] net: dsa: b53: add support for FDB - operations on 5325/5365 +Date: Sat, 14 Jun 2025 09:59:51 +0200 +Subject: [PATCH] net: dsa: b53: add support for FDB operations on 5325/5365 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -15,15 +14,17 @@ converting ARL entries in both directions. Signed-off-by: Florian Fainelli Signed-off-by: Álvaro Fernández Rojas +Link: https://patch.msgid.link/20250614080000.1884236-6-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- - drivers/net/dsa/b53/b53_common.c | 104 +++++++++++++++++++++++++------ + drivers/net/dsa/b53/b53_common.c | 101 +++++++++++++++++++++++++------ drivers/net/dsa/b53/b53_priv.h | 29 +++++++++ drivers/net/dsa/b53/b53_regs.h | 7 ++- - 3 files changed, 117 insertions(+), 23 deletions(-) + 3 files changed, 115 insertions(+), 22 deletions(-) --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c -@@ -1763,6 +1763,45 @@ static int b53_arl_read(struct b53_devic +@@ -1764,6 +1764,45 @@ static int b53_arl_read(struct b53_devic return *idx >= dev->num_arl_bins ? -ENOSPC : -ENOENT; } @@ -69,16 +70,7 @@ Signed-off-by: Álvaro Fernández Rojas static int b53_arl_op(struct b53_device *dev, int op, int port, const unsigned char *addr, u16 vid, bool is_valid) { -@@ -1777,14 +1816,18 @@ static int b53_arl_op(struct b53_device - - /* Perform a read for the given MAC and VID */ - b53_write48(dev, B53_ARLIO_PAGE, B53_MAC_ADDR_IDX, mac); -- b53_write16(dev, B53_ARLIO_PAGE, B53_VLAN_ID_IDX, vid); -+ if (!is5325(dev)) -+ b53_write16(dev, B53_ARLIO_PAGE, B53_VLAN_ID_IDX, vid); - - /* Issue a read operation for this MAC */ - ret = b53_arl_rw_op(dev, 1); +@@ -1786,7 +1825,10 @@ static int b53_arl_op(struct b53_device if (ret) return ret; @@ -90,7 +82,7 @@ Signed-off-by: Álvaro Fernández Rojas /* If this is a read, just finish now */ if (op) -@@ -1828,12 +1871,17 @@ static int b53_arl_op(struct b53_device +@@ -1830,12 +1872,17 @@ static int b53_arl_op(struct b53_device ent.is_static = true; ent.is_age = false; memcpy(ent.mac, addr, ETH_ALEN); @@ -111,7 +103,7 @@ Signed-off-by: Álvaro Fernández Rojas return b53_arl_rw_op(dev, 0); } -@@ -1845,12 +1893,6 @@ int b53_fdb_add(struct dsa_switch *ds, i +@@ -1847,12 +1894,6 @@ int b53_fdb_add(struct dsa_switch *ds, i struct b53_device *priv = ds->priv; int ret; @@ -124,7 +116,7 @@ Signed-off-by: Álvaro Fernández Rojas mutex_lock(&priv->arl_mutex); ret = b53_arl_op(priv, 0, port, addr, vid, true); mutex_unlock(&priv->arl_mutex); -@@ -1877,10 +1919,15 @@ EXPORT_SYMBOL(b53_fdb_del); +@@ -1879,10 +1920,15 @@ EXPORT_SYMBOL(b53_fdb_del); static int b53_arl_search_wait(struct b53_device *dev) { unsigned int timeout = 1000; @@ -142,7 +134,7 @@ Signed-off-by: Álvaro Fernández Rojas if (!(reg & ARL_SRCH_STDN)) return 0; -@@ -1897,13 +1944,24 @@ static void b53_arl_search_rd(struct b53 +@@ -1899,13 +1945,24 @@ static void b53_arl_search_rd(struct b53 struct b53_arl_entry *ent) { u64 mac_vid; @@ -173,7 +165,7 @@ Signed-off-by: Álvaro Fernández Rojas } static int b53_fdb_copy(int port, const struct b53_arl_entry *ent, -@@ -1924,14 +1982,20 @@ int b53_fdb_dump(struct dsa_switch *ds, +@@ -1926,14 +1983,20 @@ int b53_fdb_dump(struct dsa_switch *ds, struct b53_device *priv = ds->priv; struct b53_arl_entry results[2]; unsigned int count = 0; @@ -197,7 +189,7 @@ Signed-off-by: Álvaro Fernández Rojas ret = b53_arl_search_wait(priv); --- a/drivers/net/dsa/b53/b53_priv.h +++ b/drivers/net/dsa/b53/b53_priv.h -@@ -298,6 +298,19 @@ static inline void b53_arl_to_entry(stru +@@ -317,6 +317,19 @@ static inline void b53_arl_to_entry(stru ent->vid = mac_vid >> ARLTBL_VID_S; } @@ -217,7 +209,7 @@ Signed-off-by: Álvaro Fernández Rojas static inline void b53_arl_from_entry(u64 *mac_vid, u32 *fwd_entry, const struct b53_arl_entry *ent) { -@@ -312,6 +325,22 @@ static inline void b53_arl_from_entry(u6 +@@ -331,6 +344,22 @@ static inline void b53_arl_from_entry(u6 *fwd_entry |= ARLTBL_AGE; } diff --git a/target/linux/bmips/patches-6.12/131-net-dsa-b53-prevent-FAST_AGE-access-on-BCM5325.patch b/target/linux/generic/backport-6.12/612-06-v6.17-net-dsa-b53-prevent-FAST_AGE-access-on-BCM5325.patch similarity index 77% rename from target/linux/bmips/patches-6.12/131-net-dsa-b53-prevent-FAST_AGE-access-on-BCM5325.patch rename to target/linux/generic/backport-6.12/612-06-v6.17-net-dsa-b53-prevent-FAST_AGE-access-on-BCM5325.patch index 892594a26ba..492c701a2ba 100644 --- a/target/linux/bmips/patches-6.12/131-net-dsa-b53-prevent-FAST_AGE-access-on-BCM5325.patch +++ b/target/linux/generic/backport-6.12/612-06-v6.17-net-dsa-b53-prevent-FAST_AGE-access-on-BCM5325.patch @@ -1,8 +1,7 @@ -From ccf1ce36586c922cf41d0bd41cd74804e6c1a7bc Mon Sep 17 00:00:00 2001 +From 9b6c767c312b4709e9aeb2314a6b47863e7fb72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Fri, 30 May 2025 22:44:47 +0200 -Subject: [RFC PATCH net-next v2 02/10] net: dsa: b53: prevent FAST_AGE access - on BCM5325 +Date: Sat, 14 Jun 2025 09:59:52 +0200 +Subject: [PATCH] net: dsa: b53: prevent FAST_AGE access on BCM5325 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -10,8 +9,10 @@ Content-Transfer-Encoding: 8bit BCM5325 doesn't implement FAST_AGE registers so we should avoid reading or writing them. -Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch") Signed-off-by: Álvaro Fernández Rojas +Reviewed-by: Florian Fainelli +Link: https://patch.msgid.link/20250614080000.1884236-7-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- drivers/net/dsa/b53/b53_common.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target/linux/bmips/patches-6.12/132-net-dsa-b53-prevent-SWITCH_CTRL-access-on-BCM5325.patch b/target/linux/generic/backport-6.12/612-07-v6.17-net-dsa-b53-prevent-SWITCH_CTRL-access-on-BCM5325.patch similarity index 80% rename from target/linux/bmips/patches-6.12/132-net-dsa-b53-prevent-SWITCH_CTRL-access-on-BCM5325.patch rename to target/linux/generic/backport-6.12/612-07-v6.17-net-dsa-b53-prevent-SWITCH_CTRL-access-on-BCM5325.patch index f2d1ced37b3..275c120fdc4 100644 --- a/target/linux/bmips/patches-6.12/132-net-dsa-b53-prevent-SWITCH_CTRL-access-on-BCM5325.patch +++ b/target/linux/generic/backport-6.12/612-07-v6.17-net-dsa-b53-prevent-SWITCH_CTRL-access-on-BCM5325.patch @@ -1,8 +1,7 @@ -From 6c08487730e4ac1c45daa87a5c836aecc9508299 Mon Sep 17 00:00:00 2001 +From 22ccaaca43440e90a3b68d2183045b42247dc4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Fri, 30 May 2025 22:57:06 +0200 -Subject: [RFC PATCH net-next v2 03/10] net: dsa: b53: prevent SWITCH_CTRL - access on BCM5325 +Date: Sat, 14 Jun 2025 09:59:53 +0200 +Subject: [PATCH] net: dsa: b53: prevent SWITCH_CTRL access on BCM5325 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -10,9 +9,10 @@ Content-Transfer-Encoding: 8bit BCM5325 doesn't implement SWITCH_CTRL register so we should avoid reading or writing it. -Fixes: a424f0de6163 ("net: dsa: b53: Include IMP/CPU port in dumb forwarding mode") -Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Florian Fainelli +Signed-off-by: Álvaro Fernández Rojas +Link: https://patch.msgid.link/20250614080000.1884236-8-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- drivers/net/dsa/b53/b53_common.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/target/linux/bmips/patches-6.12/133-net-dsa-b53-fix-IP_MULTICAST_CTRL-on-BCM5325.patch b/target/linux/generic/backport-6.12/612-08-v6.17-net-dsa-b53-fix-IP_MULTICAST_CTRL-on-BCM5325.patch similarity index 84% rename from target/linux/bmips/patches-6.12/133-net-dsa-b53-fix-IP_MULTICAST_CTRL-on-BCM5325.patch rename to target/linux/generic/backport-6.12/612-08-v6.17-net-dsa-b53-fix-IP_MULTICAST_CTRL-on-BCM5325.patch index 6f701268cd4..e5b13f60a5a 100644 --- a/target/linux/bmips/patches-6.12/133-net-dsa-b53-fix-IP_MULTICAST_CTRL-on-BCM5325.patch +++ b/target/linux/generic/backport-6.12/612-08-v6.17-net-dsa-b53-fix-IP_MULTICAST_CTRL-on-BCM5325.patch @@ -1,16 +1,17 @@ -From 566c3b4e4ad6167c5a2fb4357e75eb5ba8d94f64 Mon Sep 17 00:00:00 2001 +From 044d5ce2788b165798bfd173548e61bf7b6baf4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Fri, 30 May 2025 23:00:55 +0200 -Subject: [RFC PATCH net-next v2 04/10] net: dsa: b53: fix IP_MULTICAST_CTRL on - BCM5325 +Date: Sat, 14 Jun 2025 09:59:54 +0200 +Subject: [PATCH] net: dsa: b53: fix IP_MULTICAST_CTRL on BCM5325 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BCM5325 doesn't implement B53_UC_FWD_EN, B53_MC_FWD_EN or B53_IPMC_FWD_EN. -Fixes: 53568438e381 ("net: dsa: b53: Add support for port_egress_floods callback") +Reviewed-by: Florian Fainelli Signed-off-by: Álvaro Fernández Rojas +Link: https://patch.msgid.link/20250614080000.1884236-9-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- drivers/net/dsa/b53/b53_common.c | 18 +++++++++++------- drivers/net/dsa/b53/b53_regs.h | 1 + diff --git a/target/linux/bmips/patches-6.12/134-net-dsa-b53-prevent-DIS_LEARNING-access-on-BCM5325.patch b/target/linux/generic/backport-6.12/612-09-v6.17-net-dsa-b53-prevent-DIS_LEARNING-access-on-BCM5325.patch similarity index 71% rename from target/linux/bmips/patches-6.12/134-net-dsa-b53-prevent-DIS_LEARNING-access-on-BCM5325.patch rename to target/linux/generic/backport-6.12/612-09-v6.17-net-dsa-b53-prevent-DIS_LEARNING-access-on-BCM5325.patch index d70a4f2497c..c098e541405 100644 --- a/target/linux/bmips/patches-6.12/134-net-dsa-b53-prevent-DIS_LEARNING-access-on-BCM5325.patch +++ b/target/linux/generic/backport-6.12/612-09-v6.17-net-dsa-b53-prevent-DIS_LEARNING-access-on-BCM5325.patch @@ -1,8 +1,7 @@ -From 2c09136c63be15b91cf39b52a707b3be8eb1fe71 Mon Sep 17 00:00:00 2001 +From 800728abd9f83bda4de62a30ce62a8b41c242020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Fri, 30 May 2025 23:13:01 +0200 -Subject: [RFC PATCH net-next v2 05/10] net: dsa: b53: prevent DIS_LEARNING - access on BCM5325 +Date: Sat, 14 Jun 2025 09:59:55 +0200 +Subject: [PATCH] net: dsa: b53: prevent DIS_LEARNING access on BCM5325 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -10,8 +9,10 @@ Content-Transfer-Encoding: 8bit BCM5325 doesn't implement DIS_LEARNING register so we should avoid reading or writing it. -Fixes: f9b3827ee66c ("net: dsa: b53: Support setting learning on port") +Reviewed-by: Florian Fainelli Signed-off-by: Álvaro Fernández Rojas +Link: https://patch.msgid.link/20250614080000.1884236-10-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- drivers/net/dsa/b53/b53_common.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) @@ -28,7 +29,7 @@ Signed-off-by: Álvaro Fernández Rojas b53_read16(dev, B53_CTRL_PAGE, B53_DIS_LEARNING, ®); if (learning) reg &= ~BIT(port); -@@ -2246,7 +2249,13 @@ int b53_br_flags_pre(struct dsa_switch * +@@ -2247,7 +2250,13 @@ int b53_br_flags_pre(struct dsa_switch * struct switchdev_brport_flags flags, struct netlink_ext_ack *extack) { diff --git a/target/linux/generic/backport-6.12/612-10-v6.17-net-dsa-b53-prevent-BRCM_HDR-access-on-older-devices.patch b/target/linux/generic/backport-6.12/612-10-v6.17-net-dsa-b53-prevent-BRCM_HDR-access-on-older-devices.patch new file mode 100644 index 00000000000..6d058f8561f --- /dev/null +++ b/target/linux/generic/backport-6.12/612-10-v6.17-net-dsa-b53-prevent-BRCM_HDR-access-on-older-devices.patch @@ -0,0 +1,33 @@ +From e17813968b08b1b09bf80699223dea48851cbd07 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Sat, 14 Jun 2025 09:59:56 +0200 +Subject: [PATCH] net: dsa: b53: prevent BRCM_HDR access on older devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Older switches don't implement BRCM_HDR register so we should avoid +reading or writing it. + +Reviewed-by: Florian Fainelli +Signed-off-by: Álvaro Fernández Rojas +Link: https://patch.msgid.link/20250614080000.1884236-11-noltari@gmail.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/dsa/b53/b53_common.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -730,6 +730,11 @@ void b53_brcm_hdr_setup(struct dsa_switc + hdr_ctl |= GC_FRM_MGMT_PORT_M; + b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, hdr_ctl); + ++ /* B53_BRCM_HDR not present on devices with legacy tags */ ++ if (dev->tag_protocol == DSA_TAG_PROTO_BRCM_LEGACY || ++ dev->tag_protocol == DSA_TAG_PROTO_BRCM_LEGACY_FCS) ++ return; ++ + /* Enable Broadcom tags for IMP port */ + b53_read8(dev, B53_MGMT_PAGE, B53_BRCM_HDR, &hdr_ctl); + if (tag_en) diff --git a/target/linux/bmips/patches-6.12/136-net-dsa-b53-prevent-GMII_PORT_OVERRIDE_CTRL-access-on-BCM5325.patch b/target/linux/generic/backport-6.12/612-11-v6.17-net-dsa-b53-prevent-GMII_PORT_OVERRIDE_CTRL-access-on-BCM5325.patch similarity index 80% rename from target/linux/bmips/patches-6.12/136-net-dsa-b53-prevent-GMII_PORT_OVERRIDE_CTRL-access-on-BCM5325.patch rename to target/linux/generic/backport-6.12/612-11-v6.17-net-dsa-b53-prevent-GMII_PORT_OVERRIDE_CTRL-access-on-BCM5325.patch index 8b4936d77f0..7f412a2b0ec 100644 --- a/target/linux/bmips/patches-6.12/136-net-dsa-b53-prevent-GMII_PORT_OVERRIDE_CTRL-access-on-BCM5325.patch +++ b/target/linux/generic/backport-6.12/612-11-v6.17-net-dsa-b53-prevent-GMII_PORT_OVERRIDE_CTRL-access-on-BCM5325.patch @@ -1,8 +1,8 @@ -From 4eecebbe332e3cfd8d0aaeb39d764748f25259f1 Mon Sep 17 00:00:00 2001 +From 37883bbc45a8555d6eca88d3a9730504d2dac86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Fri, 30 May 2025 23:33:13 +0200 -Subject: [RFC PATCH net-next v2 07/10] net: dsa: b53: prevent - GMII_PORT_OVERRIDE_CTRL access on BCM5325 +Date: Sat, 14 Jun 2025 09:59:57 +0200 +Subject: [PATCH] net: dsa: b53: prevent GMII_PORT_OVERRIDE_CTRL access on + BCM5325 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -12,9 +12,10 @@ avoid reading or writing it. PORT_OVERRIDE_RX_FLOW and PORT_OVERRIDE_TX_FLOW aren't defined on BCM5325 and we should use PORT_OVERRIDE_LP_FLOW_25 instead. -Fixes: 5e004460f874 ("net: dsa: b53: Add helper to set link parameters") -Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Florian Fainelli +Signed-off-by: Álvaro Fernández Rojas +Link: https://patch.msgid.link/20250614080000.1884236-12-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- drivers/net/dsa/b53/b53_common.c | 21 +++++++++++++++++---- drivers/net/dsa/b53/b53_regs.h | 1 + @@ -22,7 +23,7 @@ Reviewed-by: Florian Fainelli --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c -@@ -1278,6 +1278,8 @@ static void b53_force_link(struct b53_de +@@ -1279,6 +1279,8 @@ static void b53_force_link(struct b53_de if (port == dev->imp_port) { off = B53_PORT_OVERRIDE_CTRL; val = PORT_OVERRIDE_EN; @@ -31,7 +32,7 @@ Reviewed-by: Florian Fainelli } else { off = B53_GMII_PORT_OVERRIDE_CTRL(port); val = GMII_PO_EN; -@@ -1302,6 +1304,8 @@ static void b53_force_port_config(struct +@@ -1303,6 +1305,8 @@ static void b53_force_port_config(struct if (port == dev->imp_port) { off = B53_PORT_OVERRIDE_CTRL; val = PORT_OVERRIDE_EN; @@ -40,7 +41,7 @@ Reviewed-by: Florian Fainelli } else { off = B53_GMII_PORT_OVERRIDE_CTRL(port); val = GMII_PO_EN; -@@ -1332,10 +1336,19 @@ static void b53_force_port_config(struct +@@ -1333,10 +1337,19 @@ static void b53_force_port_config(struct return; } diff --git a/target/linux/bmips/patches-6.12/137-net-dsa-b53-fix-unicast-multicast-flooding-on-BCM5325.patch b/target/linux/generic/backport-6.12/612-12-v6.17-net-dsa-b53-fix-unicast-multicast-flooding-on-BCM5325.patch similarity index 86% rename from target/linux/bmips/patches-6.12/137-net-dsa-b53-fix-unicast-multicast-flooding-on-BCM5325.patch rename to target/linux/generic/backport-6.12/612-12-v6.17-net-dsa-b53-fix-unicast-multicast-flooding-on-BCM5325.patch index 69af6b30830..9044909bc63 100644 --- a/target/linux/bmips/patches-6.12/137-net-dsa-b53-fix-unicast-multicast-flooding-on-BCM5325.patch +++ b/target/linux/generic/backport-6.12/612-12-v6.17-net-dsa-b53-fix-unicast-multicast-flooding-on-BCM5325.patch @@ -1,8 +1,7 @@ -From e087a6480f0601d2eb2823b2c920ba7929ffafc4 Mon Sep 17 00:00:00 2001 +From 651c9e71ffe44e99b5a9b011271c2117f0353b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Sat, 31 May 2025 09:31:55 +0200 -Subject: [RFC PATCH net-next v2 08/10] net: dsa: b53: fix unicast/multicast - flooding on BCM5325 +Date: Sat, 14 Jun 2025 09:59:58 +0200 +Subject: [PATCH] net: dsa: b53: fix unicast/multicast flooding on BCM5325 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -11,12 +10,14 @@ BCM5325 doesn't implement UC_FLOOD_MASK, MC_FLOOD_MASK and IPMC_FLOOD_MASK registers. This has to be handled differently with other pages and registers. -Fixes: a8b659e7ff75 ("net: dsa: act as passthrough for bridge port flags") Signed-off-by: Álvaro Fernández Rojas +Reviewed-by: Florian Fainelli +Link: https://patch.msgid.link/20250614080000.1884236-13-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- drivers/net/dsa/b53/b53_common.c | 60 ++++++++++++++++++++++---------- - drivers/net/dsa/b53/b53_regs.h | 16 +++++++++ - 2 files changed, 58 insertions(+), 18 deletions(-) + drivers/net/dsa/b53/b53_regs.h | 13 +++++++ + 2 files changed, 55 insertions(+), 18 deletions(-) --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -106,17 +107,7 @@ Signed-off-by: Álvaro Fernández Rojas /* PHY Registers */ #define B53_PORT_MII_PAGE(i) (0x10 + (i)) /* Port i MII Registers */ -@@ -47,6 +48,9 @@ - /* VLAN Registers */ - #define B53_VLAN_PAGE 0x34 - -+/* Rate Control Registers */ -+#define B53_RATE_CTL_PAGE 0x35 -+ - /* Jumbo Frame Registers */ - #define B53_JUMBO_PAGE 0x40 - -@@ -369,6 +373,18 @@ +@@ -369,6 +370,18 @@ #define B53_ARL_SRCH_RSTL(x) (B53_ARL_SRCH_RSTL_0 + ((x) * 0x10)) /************************************************************************* diff --git a/target/linux/bmips/patches-6.12/138-net-dsa-b53-fix-b53_imp_vlan_setup-for-BCM5325.patch b/target/linux/generic/backport-6.12/612-13-v6.17-net-dsa-b53-fix-b53_imp_vlan_setup-for-BCM5325.patch similarity index 70% rename from target/linux/bmips/patches-6.12/138-net-dsa-b53-fix-b53_imp_vlan_setup-for-BCM5325.patch rename to target/linux/generic/backport-6.12/612-13-v6.17-net-dsa-b53-fix-b53_imp_vlan_setup-for-BCM5325.patch index 6433ccb7d74..9d7dcd84028 100644 --- a/target/linux/bmips/patches-6.12/138-net-dsa-b53-fix-b53_imp_vlan_setup-for-BCM5325.patch +++ b/target/linux/generic/backport-6.12/612-13-v6.17-net-dsa-b53-fix-b53_imp_vlan_setup-for-BCM5325.patch @@ -1,8 +1,7 @@ -From dd2bda07009f5c376a11b14c9445ccd11083c024 Mon Sep 17 00:00:00 2001 +From c00df1018791185ea398f78af415a2a0aaa0c79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Sat, 31 May 2025 11:11:42 +0200 -Subject: [RFC PATCH net-next v2 09/10] net: dsa: b53: fix b53_imp_vlan_setup - for BCM5325 +Date: Sat, 14 Jun 2025 09:59:59 +0200 +Subject: [PATCH] net: dsa: b53: fix b53_imp_vlan_setup for BCM5325 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -10,8 +9,10 @@ Content-Transfer-Encoding: 8bit CPU port should be B53_CPU_PORT instead of B53_CPU_PORT_25 for B53_PVLAN_PORT_MASK register. -Fixes: ff39c2d68679 ("net: dsa: b53: Add bridge support") +Reviewed-by: Florian Fainelli Signed-off-by: Álvaro Fernández Rojas +Link: https://patch.msgid.link/20250614080000.1884236-14-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- drivers/net/dsa/b53/b53_common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/bmips/patches-6.12/139-net-dsa-b53-ensure-BCM5325-PHYs-are-enabled.patch b/target/linux/generic/backport-6.12/612-14-v6.17-net-dsa-b53-ensure-BCM5325-PHYs-are-enabled.patch similarity index 55% rename from target/linux/bmips/patches-6.12/139-net-dsa-b53-ensure-BCM5325-PHYs-are-enabled.patch rename to target/linux/generic/backport-6.12/612-14-v6.17-net-dsa-b53-ensure-BCM5325-PHYs-are-enabled.patch index 5af2429b848..f9bea6133a5 100644 --- a/target/linux/bmips/patches-6.12/139-net-dsa-b53-ensure-BCM5325-PHYs-are-enabled.patch +++ b/target/linux/generic/backport-6.12/612-14-v6.17-net-dsa-b53-ensure-BCM5325-PHYs-are-enabled.patch @@ -1,8 +1,7 @@ -From 4368d82cccd1bdd9339a4aac1ce78873ef0d0031 Mon Sep 17 00:00:00 2001 +From 966a83df36c6f27476ac3501771422e7852098bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Sat, 31 May 2025 11:20:13 +0200 -Subject: [RFC PATCH net-next v2 10/10] net: dsa: b53: ensure BCM5325 PHYs are - enabled +Date: Sat, 14 Jun 2025 10:00:00 +0200 +Subject: [PATCH] net: dsa: b53: ensure BCM5325 PHYs are enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -13,10 +12,13 @@ Only ports 1-4 can be enabled or disabled and the datasheet is explicit about not toggling BIT(0) since it disables the PLL power and the switch. Signed-off-by: Álvaro Fernández Rojas +Reviewed-by: Florian Fainelli +Link: https://patch.msgid.link/20250614080000.1884236-15-noltari@gmail.com +Signed-off-by: Jakub Kicinski --- drivers/net/dsa/b53/b53_common.c | 13 +++++++++++++ - drivers/net/dsa/b53/b53_regs.h | 2 ++ - 2 files changed, 15 insertions(+) + drivers/net/dsa/b53/b53_regs.h | 5 ++++- + 2 files changed, 17 insertions(+), 1 deletion(-) --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -25,15 +27,15 @@ Signed-off-by: Álvaro Fernández Rojas b53_set_eap_mode(dev, port, EAP_MODE_SIMPLIFIED); + if (is5325(dev) && -+ (port >= B53_PD_MODE_PORT_MIN) && -+ (port <= B53_PD_MODE_PORT_MAX)) { ++ in_range(port, 1, 4)) { + u8 reg; + + b53_read8(dev, B53_CTRL_PAGE, B53_PD_MODE_CTRL_25, ®); ++ reg &= ~PD_MODE_POWER_DOWN_PORT(0); + if (dsa_is_unused_port(ds, port)) -+ reg |= BIT(port); ++ reg |= PD_MODE_POWER_DOWN_PORT(port); + else -+ reg &= ~BIT(port); ++ reg &= ~PD_MODE_POWER_DOWN_PORT(port); + b53_write8(dev, B53_CTRL_PAGE, B53_PD_MODE_CTRL_25, reg); + } + @@ -42,12 +44,16 @@ Signed-off-by: Álvaro Fernández Rojas EXPORT_SYMBOL(b53_setup_port); --- a/drivers/net/dsa/b53/b53_regs.h +++ b/drivers/net/dsa/b53/b53_regs.h -@@ -108,6 +108,8 @@ +@@ -103,8 +103,11 @@ + #define PORT_OVERRIDE_SPEED_2000M BIT(6) /* BCM5301X only, requires setting 1000M */ + #define PORT_OVERRIDE_EN BIT(7) /* Use the register contents */ - /* Power-down mode control */ +-/* Power-down mode control */ ++/* Power-down mode control (8 bit) */ #define B53_PD_MODE_CTRL_25 0x0f -+#define B53_PD_MODE_PORT_MIN 1 -+#define B53_PD_MODE_PORT_MAX 4 ++#define PD_MODE_PORT_MASK 0x1f ++/* Bit 0 also powers down the switch. */ ++#define PD_MODE_POWER_DOWN_PORT(i) BIT(i) /* IP Multicast control (8 bit) */ #define B53_IP_MULTICAST_CTRL 0x21 diff --git a/target/linux/generic/config-6.12 b/target/linux/generic/config-6.12 index 60d8edde004..d7919cac781 100644 --- a/target/linux/generic/config-6.12 +++ b/target/linux/generic/config-6.12 @@ -4071,6 +4071,7 @@ CONFIG_NET_CORE=y # CONFIG_NET_DSA_TAG_AR9331 is not set # CONFIG_NET_DSA_TAG_BRCM is not set # CONFIG_NET_DSA_TAG_BRCM_LEGACY is not set +# CONFIG_NET_DSA_TAG_BRCM_LEGACY_FCS is not set # CONFIG_NET_DSA_TAG_BRCM_PREPEND is not set # CONFIG_NET_DSA_TAG_DSA is not set # CONFIG_NET_DSA_TAG_EDSA is not set diff --git a/target/linux/realtek/patches-6.12/700-dsa-mdio-increase-max-ports-for-rtl839x-rtl931x.patch b/target/linux/realtek/patches-6.12/700-dsa-mdio-increase-max-ports-for-rtl839x-rtl931x.patch index 1485b79263f..f7d2371554e 100644 --- a/target/linux/realtek/patches-6.12/700-dsa-mdio-increase-max-ports-for-rtl839x-rtl931x.patch +++ b/target/linux/realtek/patches-6.12/700-dsa-mdio-increase-max-ports-for-rtl839x-rtl931x.patch @@ -70,7 +70,7 @@ Signed-off-by: Markus Stockhausen struct dsa_chip_data { --- a/include/net/dsa.h +++ b/include/net/dsa.h -@@ -473,7 +473,7 @@ struct dsa_switch { +@@ -475,7 +475,7 @@ struct dsa_switch { /* * User mii_bus and devices for the individual ports. */ @@ -79,7 +79,7 @@ Signed-off-by: Markus Stockhausen struct mii_bus *user_mii_bus; /* Ageing Time limits in msecs */ -@@ -609,24 +609,24 @@ static inline bool dsa_is_user_port(stru +@@ -611,24 +611,24 @@ static inline bool dsa_is_user_port(stru dsa_switch_for_each_port_continue_reverse((_dp), (_ds)) \ if (dsa_port_is_cpu((_dp))) diff --git a/target/linux/sunxi/cortexa7/config-6.12 b/target/linux/sunxi/cortexa7/config-6.12 index c1e2882f354..1ecc69bc69e 100644 --- a/target/linux/sunxi/cortexa7/config-6.12 +++ b/target/linux/sunxi/cortexa7/config-6.12 @@ -16,6 +16,7 @@ CONFIG_NET_DSA=y CONFIG_NET_DSA_TAG_BRCM=y CONFIG_NET_DSA_TAG_BRCM_COMMON=y CONFIG_NET_DSA_TAG_BRCM_LEGACY=y +CONFIG_NET_DSA_TAG_BRCM_LEGACY_FCS=y CONFIG_NET_DSA_TAG_BRCM_PREPEND=y CONFIG_NOP_USB_XCEIV=y CONFIG_RTC_DRV_SUN6I=y