From 2b0cce92ae3cd58a96c407d1908693deec6fdf6b Mon Sep 17 00:00:00 2001 From: Eric ZHANG Date: Sun, 2 Mar 2025 15:54:37 +0800 Subject: [PATCH 01/15] dnsmasq: fix handlers for options `filter_rr` and `cache_rr` According to: - https://github.com/openwrt/luci/blob/master/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js#L700 - https://github.com/openwrt/luci/blob/master/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js#L402 These two options should be of type `MultiValue` but here there're used as single value. This results in dnsmasq crashes when either of these options are set with multiple values, which leads to an invalid space-separated value. As these options are designed to take multiple values, I think it's better to use list format eg. `list filter_rr 'AAAA'`, instead of `option filter_rr 'AAAA,HTTPS'`. See: https://forum.openwrt.org/t/selecting-more-than-one-filter-arbitrary-rr-or-cache-arbitrary-rr-in-v24-10-0-crashes-dnsmasq/225801 Tested on 24.10.0 Signed-off-by: Eric ZHANG Link: https://github.com/openwrt/openwrt/pull/18149 Signed-off-by: Christian Marangi (cherry picked from commit d136c24f7cc9f7b5ac72259ccf9193683f4ced74) --- package/network/services/dnsmasq/files/dnsmasq.init | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index b864ea9069..e9afcc78d3 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -226,6 +226,14 @@ append_interface_name() { xappend "--interface-name=$1,$2" } +append_filter_rr() { + xappend "--filter-rr=$1" +} + +append_cache_rr() { + xappend "--cache-rr=$1" +} + filter_dnsmasq() { local cfg="$1" func="$2" match_cfg="$3" found_cfg @@ -1000,8 +1008,8 @@ dnsmasq_start() # deprecate or remove filter-X in favor of filter-rr? append_bool "$cfg" filter_aaaa "--filter-AAAA" append_bool "$cfg" filter_a "--filter-A" - append_parm "$cfg" filter_rr "--filter-rr" - append_parm "$cfg" cache_rr "--cache-rr" + config_list_foreach "$cfg" filter_rr append_filter_rr + config_list_foreach "$cfg" cache_rr append_cache_rr append_parm "$cfg" logfacility "--log-facility" config_get logfacility "$cfg" "logfacility" From 7f512e602aaceddb2f871d8a22de4cf48d7daefd Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sat, 1 Mar 2025 17:41:50 +0100 Subject: [PATCH 02/15] ramips: mt7621: 02_network optimization Merging repeating blocks inside the ramips_setup_interfaces() function. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/18146 (cherry picked from commit a0449f8cf3a53f746c409ce033a6c78065c5edde) Link: https://github.com/openwrt/openwrt/pull/18205 Signed-off-by: Hauke Mehrtens --- .../mt7621/base-files/etc/board.d/02_network | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index f40e9616d0..650fef62a8 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -1,4 +1,3 @@ - . /lib/functions.sh . /lib/functions/uci-defaults.sh . /lib/functions/system.sh @@ -23,6 +22,7 @@ ramips_setup_interfaces() mercusys,mr70x-v1|\ netgear,wax202|\ sim,simax1800t|\ + tplink,mr600-v2-eu|\ xiaomi,mi-router-3-pro|\ xiaomi,mi-router-ac2100|\ xiaomi,mi-router-cr6606|\ @@ -68,12 +68,18 @@ ramips_setup_interfaces() ucidef_set_interface_lan "lan" ;; asiarf,ap7621-001|\ + comfast,cf-e390ax|\ + comfast,cf-ew72-v2|\ + cudy,m1800|\ dna,valokuitu-plus-ex400|\ humax,e10|\ keenetic,kn-3510|\ + meig,slt866|\ openfi,5pro|\ wavlink,ws-wn572hp3-4g|\ - winstars,ws-wn583a6) + winstars,ws-wn583a6|\ + yuncore,ax820|\ + zyxel,nr7101) ucidef_set_interfaces_lan_wan "lan" "wan" ;; asiarf,ap7621-nv1|\ @@ -105,11 +111,6 @@ ramips_setup_interfaces() uci add_list firewall.@zone[1].network='eth_data' uci add_list firewall.@zone[1].network='eth_om' ;; - cudy,m1800|\ - yuncore,ax820|\ - zyxel,nr7101) - ucidef_set_interfaces_lan_wan "lan" "wan" - ;; dlink,covr-x1860-a1) ucidef_set_interfaces_lan_wan "ethernet" "internet" ;; @@ -155,9 +156,6 @@ ramips_setup_interfaces() tplink,tl-wpa8631p-v3) ucidef_set_interface_lan "lan1 lan2 lan3 plc0" ;; - tplink,mr600-v2-eu) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" - ;; ubnt,edgerouter-x) ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4" "eth0" ;; @@ -178,11 +176,6 @@ ramips_setup_interfaces() ruijie,rg-ew1200g-pro-v1.1) ucidef_set_interfaces_lan_wan "lan3 lan2 lan1" "wan" ;; - comfast,cf-e390ax|\ - comfast,cf-ew72-v2|\ - meig,slt866) - ucidef_set_interfaces_lan_wan "lan" "wan" - ;; *) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; From ff5b9059b43ca9dde465206698923224678a1010 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 27 Feb 2025 11:05:26 +0100 Subject: [PATCH 03/15] libpcap: add missing PKG_CONFIG_DEPENDS entries Currently, enabling USB, BT or Netfilter support after initial compilation will not trigger a rebuild, so add the missing PKG_CONFIG_DEPENDS so that rebuild gets triggered. Signed-off-by: Robert Marko (cherry picked from commit fe37574be63ef7c6c1c1e611f052ed25c99a8aa1) --- package/libs/libpcap/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 09aab0981c..14b97f902a 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -22,7 +22,11 @@ PKG_CPE_ID:=cpe:/a:tcpdump:libpcap PKG_ASLR_PIE_REGULAR:=1 -PKG_CONFIG_DEPENDS := CONFIG_PACKAGE_rpcapd +PKG_CONFIG_DEPENDS := \ + CONFIG_PACKAGE_rpcapd \ + CONFIG_PCAP_HAS_USB \ + CONFIG_PCAP_HAS_BT \ + CONFIG_PCAP_HAS_NETFILTER include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk From 3da9786da3b259a83587a766c5c4e53131bc5cfa Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 3 Mar 2025 13:27:15 +0000 Subject: [PATCH 04/15] libpcap: backport support for various DSA tags Trying to tcpdump DSA conduits results in errors such as "unsupported DSA tag: mtk". Backport two commits adding support for various DSA tags to libpcap. Signed-off-by: Daniel Golle (cherry picked from commit fad94e8cda573389164827dc74e583d10eeae2e5) --- package/libs/libpcap/Makefile | 2 +- ...pport-for-Realtek-Ethertype-DSA-data.patch | 28 ++ .../002-Linux-handle-other-DSA-tags.patch | 322 ++++++++++++++++++ 3 files changed, 351 insertions(+), 1 deletion(-) create mode 100644 package/libs/libpcap/patches/001-Add-support-for-Realtek-Ethertype-DSA-data.patch create mode 100644 package/libs/libpcap/patches/002-Linux-handle-other-DSA-tags.patch diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 14b97f902a..052358b1f5 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libpcap PKG_VERSION:=1.10.5 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.tcpdump.org/release/ diff --git a/package/libs/libpcap/patches/001-Add-support-for-Realtek-Ethertype-DSA-data.patch b/package/libs/libpcap/patches/001-Add-support-for-Realtek-Ethertype-DSA-data.patch new file mode 100644 index 0000000000..5ec0e22afa --- /dev/null +++ b/package/libs/libpcap/patches/001-Add-support-for-Realtek-Ethertype-DSA-data.patch @@ -0,0 +1,28 @@ +From fcb2cbc3a306afcf7785a60a74dbea431e609d76 Mon Sep 17 00:00:00 2001 +From: Luiz Angelo Daros de Luca +Date: Thu, 6 Jan 2022 15:51:54 -0300 +Subject: [PATCH 1/2] Add support for Realtek (Ethertype) DSA data + +Realtek switchtag rtl4a (4 bytes long, protocol 0xA) and rtl8_4 (8 bytes +long, protocol 0x04) are Ethertype DSA tags, inserted in the Ethernet +header similar to an 802.1Q tag. Both shares the same Ethertype 0x8899 +as other Realtek proprietary protocols. + +Realtek switchtag rtl8_4t is identical to rtl8_4 but positioned before +the CRC, at the end of the Ethernet frame. +--- + pcap-linux.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/pcap-linux.c ++++ b/pcap-linux.c +@@ -5281,6 +5281,9 @@ static struct dsa_proto { + { "brcm-prepend", DLT_DSA_TAG_BRCM_PREPEND }, + { "dsa", DLT_DSA_TAG_DSA }, + { "edsa", DLT_DSA_TAG_EDSA }, ++ { "rtl4a", DLT_EN10MB }, ++ { "rtl8_4", DLT_EN10MB }, ++ { "rtl8_4t", DLT_EN10MB }, + }; + + static int diff --git a/package/libs/libpcap/patches/002-Linux-handle-other-DSA-tags.patch b/package/libs/libpcap/patches/002-Linux-handle-other-DSA-tags.patch new file mode 100644 index 0000000000..dc87d4010d --- /dev/null +++ b/package/libs/libpcap/patches/002-Linux-handle-other-DSA-tags.patch @@ -0,0 +1,322 @@ +From 7d298976beff0cce310fb53a430f82b53f43a394 Mon Sep 17 00:00:00 2001 +From: Guy Harris +Date: Fri, 14 Feb 2025 19:12:24 -0800 +Subject: [PATCH 2/2] Linux: handle other DSA tags. + +Many of those entries need their own LINKTYPE_/DLT_? values, including +tcpdump and Wireshark support for same, but at least this lets you see +raw hex data from a capture. + +Fixes #1367. + +Supercedes #1451. +--- + pcap-linux.c | 284 ++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 280 insertions(+), 4 deletions(-) + +--- a/pcap-linux.c ++++ b/pcap-linux.c +@@ -5267,23 +5267,299 @@ iface_get_offload(pcap_t *handle _U_) + } + #endif /* SIOCETHTOOL */ + ++/* ++ * As per ++ * ++ * https://www.kernel.org/doc/html/latest/networking/dsa/dsa.html#switch-tagging-protocols ++ * ++ * Type 1 means that the tag is prepended to the Ethernet packet. ++ * LINKTYPE_ETHERNET/DLT_EN10MB doesn't work, as it would try to ++ * dissect the tag data as the Ethernet header. These should get ++ * their own LINKTYPE_DLT_ values. ++ * ++ * Type 2 means that the tag is inserted into the Ethernet header ++ * after the source address and before the type/length field. ++ * ++ * Type 3 means that tag is a packet trailer. LINKTYPE_ETHERNET/DLT_EN10MB ++ * works, unless the next-layer protocol has no length field of its own, ++ * so that the tag might be treated as part of the payload. These should ++ * get their own LINKTYPE_/DLT_ values. ++ * ++ * If you get an "unsupported DSA tag" error, please add the tag to here, ++ * complete with a full comment indicating whether it's type 1, 2, or 3, ++ * and, for type 2, indicating whether it has an Ethertype and, if so ++ * what that type is, and whether it's registered with the IEEE or is ++ * self-assigned. Also, point to *something* that indicates the format ++ * of the tag. ++ */ + static struct dsa_proto { + const char *name; + bpf_u_int32 linktype; + } dsa_protos[] = { + /* +- * None is special and indicates that the interface does not have +- * any tagging protocol configured, and is therefore a standard +- * Ethernet interface. ++ * Type 1. See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_ar9331.c ++ */ ++ { "ar9331", DLT_EN10MB }, ++ ++ /* ++ * Type 2, without an Ethertype at the beginning, ++ * assigned a LINKTYPE_/DLT_ value. + */ +- { "none", DLT_EN10MB }, + { "brcm", DLT_DSA_TAG_BRCM }, ++ ++ /* ++ * Type 2, with Ethertype 0x8874, assigned to Broadcom. ++ * ++ * This doies not require a LINKTYPE_/DLT_ value, it ++ * just requires that Ethertype 0x8874 be dissected ++ * properly. ++ */ ++ { "brcm-legacy", DLT_EN10MB }, ++ ++ /* ++ * Type 1. ++ */ + { "brcm-prepend", DLT_DSA_TAG_BRCM_PREPEND }, ++ ++ /* ++ * Type 2, without an Etherype at he beginning, ++ * assigned a LINKTYPE_/DLT_ value. ++ */ + { "dsa", DLT_DSA_TAG_DSA }, ++ ++ /* ++ * Type 2, with an Ethertype field, but without ++ * an assigned Ethertype value that can be relied ++ * on; assigned a LINKTYPE_/DLT_ value. ++ */ + { "edsa", DLT_DSA_TAG_EDSA }, ++ ++ /* ++ * Type 1, with different transmit and receive headers, ++ * so can't really be handled well with the current ++ * libpcap API and with pcap files. Use DLT_LINUX_SLL, ++ * to get the direction? ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_gswip.c ++ */ ++ { "gswip", DLT_EN10MB }, ++ ++ /* ++ * Type 3. See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_hellcreek.c ++ */ ++ { "hellcreek", DLT_EN10MB }, ++ ++ /* ++ * Type 3, with different transmit and receive headers, ++ * so can't really be handled well with the current ++ * libpcap API and with pcap files. Use DLT_LINUX_SLL, ++ * to get the direction? ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_ksz.c#L102 ++ */ ++ { "ksz8795", DLT_EN10MB }, ++ ++ /* ++ * Type 3, with different transmit and receive headers, ++ * so can't really be handled well with the current ++ * libpcap API and with pcap files. Use DLT_LINUX_SLL, ++ * to get the direction? ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_ksz.c#L160 ++ */ ++ { "ksz9477", DLT_EN10MB }, ++ ++ /* ++ * Type 3, with different transmit and receive headers, ++ * so can't really be handled well with the current ++ * libpcap API and with pcap files. Use DLT_LINUX_SLL, ++ * to get the direction? ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_ksz.c#L341 ++ */ ++ { "ksz9893", DLT_EN10MB }, ++ ++ /* ++ * Type 3, with different transmit and receive headers, ++ * so can't really be handled well with the current ++ * libpcap API and with pcap files. Use DLT_LINUX_SLL, ++ * to get the direction? ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_ksz.c#L386 ++ */ ++ { "lan937x", DLT_EN10MB }, ++ ++ /* ++ * Type 2, with Ethertype 0x8100; the VID can be interpreted ++ * as per ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_lan9303.c#L24 ++ * ++ * so giving its own LINKTYPE_/DLT_ value would allow a ++ * dissector to do so. ++ */ ++ { "lan9303", DLT_EN10MB }, ++ ++ /* ++ * Type 2, without an Etherype at he beginning, ++ * should be assigned a LINKTYPE_/DLT_ value. ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_mtk.c#L15 ++ */ ++ { "mtk", DLT_EN10MB }, ++ ++ /* ++ * None is special and indicates that the interface does not have ++ * any tagging protocol configured, and is therefore a standard ++ * Ethernet interface. ++ */ ++ { "none", DLT_EN10MB }, ++ ++ /* ++ * Type 1. ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_ocelot.c ++ */ ++ { "ocelot", DLT_EN10MB }, ++ ++ /* ++ * Type 1. ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_ocelot.c ++ */ ++ { "seville", DLT_EN10MB }, ++ ++ /* ++ * Type 2, with Ethertype 0x8100; the VID can be interpreted ++ * as per ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_8021q.c#L15 ++ * ++ * so giving its own LINKTYPE_/DLT_ value would allow a ++ * dissector to do so. ++ */ ++ { "ocelot-8021q", DLT_EN10MB }, ++ ++ /* ++ * Type 2, without an Etherype at he beginning, ++ * should be assigned a LINKTYPE_/DLT_ value. ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_qca.c ++ */ ++ { "qca", DLT_EN10MB }, ++ ++ /* ++ * Type 2, with Ethertype 0x8899, assigned to Realtek; ++ * they use it for several on-the-Ethernet protocols ++ * as well, but there are fields that allow the two ++ * tag formats, and all the protocols in question, ++ * to be distinguiished from one another. ++ * ++ * This doies not require a LINKTYPE_/DLT_ value, it ++ * just requires that Ethertype 0x8899 be dissected ++ * properly. ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_rtl4_a.c ++ * ++ * http://realtek.info/pdf/rtl8306sd%28m%29_datasheet_1.1.pdf ++ * ++ * and various pages in tcpdump's print-realtek.c and Wireshark's ++ * epan/dissectors/packet-realtek.c for the other protocols. ++ */ + { "rtl4a", DLT_EN10MB }, ++ ++ /* ++ * Type 2, with Ethertype 0x8899, assigned to Realtek; ++ * see above. ++ */ + { "rtl8_4", DLT_EN10MB }, ++ ++ /* ++ * Type 3, with the same tag format as rtl8_4. ++ */ + { "rtl8_4t", DLT_EN10MB }, ++ ++ /* ++ * Type 2, with Ethertype 0xe001; that's probably ++ * self-assigned, so this really should ahve its ++ * own LINKTYPE_/DLT_ value. ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_rzn1_a5psw.c ++ */ ++ { "a5psw", DLT_EN10MB }, ++ ++ /* ++ * Type 2, with Ethertype 0x8100 or the self-assigned ++ * 0xdadb, so this really should ahve its own ++ * LINKTYPE_/DLT_ value; that would also allow the ++ * VID of the tag to be dissected as per ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_8021q.c#L15 ++ */ ++ { "sja1105", DLT_EN10MB }, ++ ++ /* ++ * Type "none of the above", with both a header and trailer, ++ * with different transmit and receive tags. Has ++ * Ethertype 0xdadc, which is probably self-assigned. ++ * This should really have its own LINKTYPE_/DLT_ value. ++ */ ++ { "sja1110", DLT_EN10MB }, ++ ++ /* ++ * Type 3, as the name suggests. ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_trailer.c ++ */ ++ { "trailer", DLT_EN10MB }, ++ ++ /* ++ * Type 2, with Ethertype 0x8100; the VID can be interpreted ++ * as per ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_8021q.c#L15 ++ * ++ * so giving its own LINKTYPE_/DLT_ value would allow a ++ * dissector to do so. ++ */ ++ { "vsc73xx-8021q", DLT_EN10MB }, ++ ++ /* ++ * Type 3. ++ * ++ * See ++ * ++ * https://elixir.bootlin.com/linux/v6.13.2/source/net/dsa/tag_xrs700x.c ++ */ ++ { "xrs700x", DLT_EN10MB }, + }; + + static int From df8679e29ff490660ec13d5fac9d09256f78e01b Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 26 Feb 2025 21:52:53 +0800 Subject: [PATCH 05/15] mediatek: add support for CMCC A10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This board is also as known as SuperElectron ZN-M5 and ZN-M8. However, for ZN-M5 and ZN-M8, there's another version uses ZX279128 as CPU chip, which is unsupported. You can check it in "高级设置" > "系统日志" > "内核日志" page from webUI. Hardware specification: SoC: MediaTek MT7981B 2x A53 Flash: 128 MB SPI-NAND RAM: 256MB Ethernet: 4x 10/100/1000 Mbps Switch: MediaTek MT7531AE WiFi: MediaTek MT7976C Button: Reset, WPS Power: DC 12V 1A Stock layout flash instructions: Login into webUI and upload sysupgrade firmware in "系统管理" > "升级固件" page. Remember to unselect "保留配置" ("Keep configurations") first before doing that. OpenWrt U-Boot layout flash instructions: 1. Flash stock layout firmware first. 2. Connect to the device via SSH, and backup everything, especially 'Factory' partition. 3. Unlock MTD partitions: opkg update && opkg install kmod-mtd-rw insmod mtd-rw i_want_a_brick=1 4. Write new BL2 and FIP: mtd write openwrt-mediatek-filogic-cmcc_a10-ubootmod-preloader.bin BL2 mtd write openwrt-mediatek-filogic-cmcc_a10-ubootmod-bl31-uboot.fip FIP 5. Set static IP on your PC: IP 192.168.1.254/24, GW 192.168.1.1 6. Serve OpenWrt initramfs image using TFTP server. 7. Cut off the power and re-engage, wait for TFTP recovery to complete. 8. After OpenWrt has booted, perform sysupgrade. Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/18121 (cherry picked from commit 96c6608346758ceffebf30d74cab00db58874bb9) [sync uboot defconfigs with 24.10 branch, change apk to opkg] Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/18218 Signed-off-by: Hauke Mehrtens --- .../uboot-envtools/files/mediatek_filogic | 1 + package/boot/uboot-mediatek/Makefile | 13 + .../patches/446-add-cmcc_a10.patch | 327 ++++++++++++++++++ .../mediatek/dts/mt7981b-cmcc-a10-stock.dts | 40 +++ .../dts/mt7981b-cmcc-a10-ubootmod.dts | 28 ++ .../linux/mediatek/dts/mt7981b-cmcc-a10.dtsi | 254 ++++++++++++++ .../filogic/base-files/etc/board.d/02_network | 2 + .../base-files/lib/upgrade/platform.sh | 1 + target/linux/mediatek/image/filogic.mk | 55 +++ 9 files changed, 721 insertions(+) create mode 100644 package/boot/uboot-mediatek/patches/446-add-cmcc_a10.patch create mode 100644 target/linux/mediatek/dts/mt7981b-cmcc-a10-stock.dts create mode 100644 target/linux/mediatek/dts/mt7981b-cmcc-a10-ubootmod.dts create mode 100644 target/linux/mediatek/dts/mt7981b-cmcc-a10.dtsi diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 730a28841e..67363b0f42 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -34,6 +34,7 @@ ubootenv_add_ubi_default() { case "$board" in abt,asr3000|\ +cmcc,a10-ubootmod|\ h3c,magic-nx30-pro|\ jcg,q30-pro|\ mercusys,mr90x-v1-ubi|\ diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index 8fda29afa6..b1285f9ca3 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -231,6 +231,18 @@ define U-Boot/mt7981_abt_asr3000 DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3 endef +define U-Boot/mt7981_cmcc_a10 + NAME:=CMCC A10 + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=cmcc_a10-ubootmod + UBOOT_CONFIG:=mt7981_cmcc_a10 + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=spim-nand + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr3 + DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3 +endef + define U-Boot/mt7981_cmcc_rax3000m-emmc NAME:=CMCC RAX3000M BUILD_SUBTARGET:=filogic @@ -832,6 +844,7 @@ UBOOT_TARGETS := \ mt7628_ravpower_rp-wd009 \ mt7629_rfb \ mt7981_abt_asr3000 \ + mt7981_cmcc_a10 \ mt7981_cmcc_rax3000m-emmc \ mt7981_cmcc_rax3000m-nand \ mt7981_gatonetworks_gdsp \ diff --git a/package/boot/uboot-mediatek/patches/446-add-cmcc_a10.patch b/package/boot/uboot-mediatek/patches/446-add-cmcc_a10.patch new file mode 100644 index 0000000000..b6165a797b --- /dev/null +++ b/package/boot/uboot-mediatek/patches/446-add-cmcc_a10.patch @@ -0,0 +1,327 @@ +--- /dev/null ++++ b/configs/mt7981_cmcc_a10_defconfig +@@ -0,0 +1,107 @@ ++CONFIG_ARM=y ++CONFIG_SYS_HAS_NONCACHED_MEMORY=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TEXT_BASE=0x41e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DEFAULT_DEVICE_TREE="mt7981-cmcc-a10" ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_TARGET_MT7981=y ++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00 ++CONFIG_DEBUG_UART_BASE=0x11002000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_SYS_LOAD_ADDR=0x46000000 ++CONFIG_DEBUG_UART=y ++CONFIG_FIT=y ++CONFIG_BOOTDELAY=30 ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_MENU_SHOW=y ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-cmcc-a10.dtb" ++CONFIG_LOGLEVEL=7 ++CONFIG_PRE_CONSOLE_BUFFER=y ++CONFIG_LOG=y ++CONFIG_BOARD_LATE_INIT=y ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_PROMPT="MT7981> " ++CONFIG_CMD_CPU=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_BOOTMENU=y ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_ENV_FLAGS=y ++CONFIG_CMD_STRINGS=y ++CONFIG_CMD_DM=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_PART=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_RARP=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_CDP=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_CACHE=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_UUID=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_SMC=y ++CONFIG_CMD_UBI=y ++CONFIG_CMD_UBI_RENAME=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_UBI=y ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_ENV_UBI_PART="ubi" ++CONFIG_ENV_UBI_VOLUME="ubootenv" ++CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2" ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_USE_DEFAULT_ENV_FILE=y ++CONFIG_DEFAULT_ENV_FILE="cmcc_a10_env" ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_VERSION_VARIABLE=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_NETCONSOLE=y ++CONFIG_USE_IPADDR=y ++CONFIG_IPADDR="192.168.1.1" ++CONFIG_USE_SERVERIP=y ++CONFIG_SERVERIP="192.168.1.254" ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_BUTTON=y ++CONFIG_BUTTON_GPIO=y ++CONFIG_CLK=y ++CONFIG_GPIO_HOG=y ++CONFIG_LED=y ++CONFIG_LED_BLINK=y ++CONFIG_LED_GPIO=y ++# CONFIG_MMC is not set ++CONFIG_MTD=y ++CONFIG_DM_MTD=y ++CONFIG_MTD_SPI_NAND=y ++CONFIG_MTD_UBI_FASTMAP=y ++CONFIG_PHY_FIXED=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PHY=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7981=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_REGULATOR_GPIO=y ++CONFIG_RAM=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SPI=y ++CONFIG_DM_SPI=y ++CONFIG_MTK_SPIM=y ++CONFIG_ZSTD=y ++CONFIG_HEXDUMP=y ++CONFIG_LMB_MAX_REGIONS=64 +--- /dev/null ++++ b/arch/arm/dts/mt7981-cmcc-a10.dts +@@ -0,0 +1,157 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++ ++/dts-v1/; ++#include "mt7981.dtsi" ++#include ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "CMCC A10"; ++ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb"; ++ ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x10000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ ++ button-reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ button-wps { ++ label = "wps"; ++ linux,code = ; ++ gpios = <&gpio 0 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ label = "blue:status"; ++ gpios = <&gpio 9 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ ++ running_led: led-1 { ++ label = "green:status"; ++ gpios = <&gpio 10 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ ++ boot_led: led-2 { ++ label = "red:status"; ++ gpios = <&gpio 11 GPIO_ACTIVE_LOW>; ++ default-state = "on"; ++ }; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <0>; ++ phy-mode = "2500base-x"; ++ mediatek,switch = "mt7531"; ++ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ }; ++}; ++ ++&pinctrl { ++ spi_flash_pins: spi0-pins-func-1 { ++ mux { ++ function = "flash"; ++ groups = "spi0", "spi0_wp_hold"; ++ }; ++ ++ conf-pu { ++ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-pd { ++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ }; ++}; ++ ++&spi0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi_flash_pins>; ++ status = "okay"; ++ must_tx; ++ enhance_timing; ++ dma_ext; ++ ipm_design; ++ support_quad; ++ tick_dly = <2>; ++ sample_sel = <0>; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-max-frequency = <52000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "bl2"; ++ reg = <0x0 0x100000>; ++ }; ++ ++ partition@100000 { ++ label = "u-boot-env"; ++ reg = <0x100000 0x80000>; ++ }; ++ ++ partition@180000 { ++ label = "factory"; ++ reg = <0x180000 0x200000>; ++ }; ++ ++ partition@380000 { ++ label = "fip"; ++ reg = <0x380000 0x200000>; ++ }; ++ ++ partition@580000 { ++ label = "ubi"; ++ reg = <0x580000 0x7a80000>; ++ compatible = "linux,ubi"; ++ }; ++ }; ++ }; ++}; ++ ++&uart0 { ++ mediatek,force-highspeed; ++ status = "okay"; ++}; ++ ++&watchdog { ++ status = "disabled"; ++}; +--- /dev/null ++++ b/cmcc_a10_env +@@ -0,0 +1,54 @@ ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi ++bootconf=config-1 ++bootdelay=0 ++bootfile=openwrt-mediatek-filogic-cmcc_a10-ubootmod-initramfs-recovery.itb ++bootfile_bl2=openwrt-mediatek-filogic-cmcc_a10-ubootmod-preloader.bin ++bootfile_fip=openwrt-mediatek-filogic-cmcc_a10-ubootmod-bl31-uboot.fip ++bootfile_upg=openwrt-mediatek-filogic-cmcc_a10-ubootmod-squashfs-sysupgrade.itb ++bootled_pwr=red:status ++bootled_rec=blue:status ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) ++bootmenu_0=Initialize environment.=run _firstboot ++bootmenu_0d=Run default boot command.=run boot_default ++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return ++bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return ++bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return ++bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return ++bootmenu_8=Reboot.=reset ++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset ++boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu ++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever ++boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off ++boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off ++boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever ++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done ++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf ++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory ++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2 ++reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800 ++mtd_write_fip=mtd erase fip && mtd write fip $loadaddr ++mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr ++ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format ++ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset ++ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi ++ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs ++ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery ++ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data ++ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize ++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize ++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-a10-stock.dts b/target/linux/mediatek/dts/mt7981b-cmcc-a10-stock.dts new file mode 100644 index 0000000000..96627f8bfb --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cmcc-a10-stock.dts @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7981b-cmcc-a10.dtsi" + +/ { + model = "CMCC A10 (stock layout)"; + compatible = "cmcc,a10-stock", "mediatek,mt7981"; +}; + +&partitions { + partition@580000 { + label = "ubi"; + reg = <0x580000 0x4000000>; + }; + + partition@4580000 { + label = "firmware_backup"; + reg = <0x4580000 0x2000000>; + read-only; + }; + + partition@6580000 { + label = "zrsave"; + reg = <0x6580000 0x100000>; + read-only; + }; + + partition@6680000 { + label = "config2"; + reg = <0x6680000 0x100000>; + read-only; + }; +}; + +&spi_nand { + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; +}; diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-a10-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cmcc-a10-ubootmod.dts new file mode 100644 index 0000000000..f8a1c7f665 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cmcc-a10-ubootmod.dts @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7981b-cmcc-a10.dtsi" + +/ { + model = "CMCC A10 (OpenWrt U-Boot layout)"; + compatible = "cmcc,a10-ubootmod", "mediatek,mt7981"; +}; + +&chosen { + bootargs = "root=/dev/fit0 rootwait"; + rootdisk = <&ubi_rootdisk>; +}; + +&partitions { + partition@580000 { + compatible = "linux,ubi"; + label = "ubi"; + reg = <0x580000 0x7a80000>; + + volumes { + ubi_rootdisk: ubi-volume-fit { + volname = "fit"; + }; + }; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-a10.dtsi b/target/linux/mediatek/dts/mt7981b-cmcc-a10.dtsi new file mode 100644 index 0000000000..fe132aa66a --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cmcc-a10.dtsi @@ -0,0 +1,254 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (C) 2023 Tianling Shen + */ + +/dts-v1/; +#include +#include +#include +#include "mt7981.dtsi" + +/ { + aliases { + led-boot = &boot_led; + led-failsafe = &boot_led; + led-running = &running_led; + led-upgrade = &running_led; + serial0 = &uart0; + }; + + chosen: chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@40000000 { + reg = <0 0x40000000 0 0x10000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + button-wps { + label = "wps"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led-0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + running_led: led-1 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + boot_led: led-2 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cells = <&macaddr_factory_2a 0>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "BL2"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + partition@180000 { + label = "Factory"; + reg = <0x180000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_a: macaddr@a { + compatible = "mac-base"; + reg = <0xa 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_24: macaddr@24 { + compatible = "mac-base"; + reg = <0x24 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_2a: macaddr@2a { + compatible = "mac-base"; + reg = <0x2a 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x200000>; + read-only; + }; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan3"; + }; + + port@4 { + reg = <4>; + label = "wan"; + + nvmem-cells = <&macaddr_factory_24 0>; + nvmem-cell-names = "mac-address"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + status = "okay"; + + band@1 { + reg = <1>; + nvmem-cells = <&macaddr_factory_a 0>; + nvmem-cell-names = "mac-address"; + }; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index b976463cff..6da6316823 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -30,6 +30,8 @@ mediatek_setup_interfaces() ;; asus,rt-ax59u|\ cetron,ct3003|\ + cmcc,a10-stock|\ + cmcc,a10-ubootmod|\ confiabits,mt7981|\ cudy,wr3000-v1|\ jcg,q30-pro|\ diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 11bfad2e7b..a13b46d4c1 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -71,6 +71,7 @@ platform_do_upgrade() { bananapi,bpi-r3-mini|\ bananapi,bpi-r4|\ bananapi,bpi-r4-poe|\ + cmcc,a10-ubootmod|\ cmcc,rax3000m|\ gatonetworks,gdsp|\ h3c,magic-nx30-pro|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index e8a2888ee0..0de101df99 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -500,6 +500,61 @@ define Device/cetron_ct3003 endef TARGET_DEVICES += cetron_ct3003 +define Device/cmcc_a10-stock + DEVICE_VENDOR := CMCC + DEVICE_MODEL := A10 (stock layout) + DEVICE_ALT0_VENDOR := SuperElectron + DEVICE_ALT0_MODEL := ZN-M5 (stock layout) + DEVICE_ALT1_VENDOR := SuperElectron + DEVICE_ALT1_MODEL := ZN-M8 (stock layout) + DEVICE_DTS := mt7981b-cmcc-a10-stock + DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_IN_UBI := 1 + IMAGES += factory.bin + IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + KERNEL = kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_INITRAMFS = kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd +endef +TARGET_DEVICES += cmcc_a10-stock + +define Device/cmcc_a10-ubootmod + DEVICE_VENDOR := CMCC + DEVICE_MODEL := A10 (OpenWrt U-Boot layout) + DEVICE_ALT0_VENDOR := SuperElectron + DEVICE_ALT0_MODEL := ZN-M5 (OpenWrt U-Boot layout) + DEVICE_ALT1_VENDOR := SuperElectron + DEVICE_ALT1_MODEL := ZN-M8 (OpenWrt U-Boot layout) + DEVICE_DTS := mt7981b-cmcc-a10-ubootmod + DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES += cmcc,a10 + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.itb := append-kernel | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 + ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot cmcc_a10 +endef +TARGET_DEVICES += cmcc_a10-ubootmod + define Device/cmcc_rax3000m DEVICE_VENDOR := CMCC DEVICE_MODEL := RAX3000M From 40d36ac96021a93bcee5d869b8342f1f4c75dd39 Mon Sep 17 00:00:00 2001 From: Coia Prant Date: Tue, 11 Mar 2025 11:21:33 +0800 Subject: [PATCH 06/15] mac80211: rt2x00: load the eeprom data from devicetree embedded data on Ralink SoCs It will allow loading eeprom from eeprom-data embedded in device tree. Ported from mediatek mt76 wireless driver (drivers/net/wireless/mediatek/mt76/eeprom.c) Signed-off-by: Coia Prant Link: https://github.com/openwrt/openwrt/pull/17472 Link: https://github.com/openwrt/openwrt/pull/18221 Signed-off-by: Hauke Mehrtens (cherry picked from commit 5d266b55ed4c4c4efe2e150b8b2326bb13bb6fb0) --- ...EEPROM-from-devicetree-embedded-data.patch | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 package/kernel/mac80211/patches/rt2x00/603-wifi-rt2x00-Add-support-for-loading-EEPROM-from-devicetree-embedded-data.patch diff --git a/package/kernel/mac80211/patches/rt2x00/603-wifi-rt2x00-Add-support-for-loading-EEPROM-from-devicetree-embedded-data.patch b/package/kernel/mac80211/patches/rt2x00/603-wifi-rt2x00-Add-support-for-loading-EEPROM-from-devicetree-embedded-data.patch new file mode 100644 index 0000000000..0ef946a6cb --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/603-wifi-rt2x00-Add-support-for-loading-EEPROM-from-devicetree-embedded-data.patch @@ -0,0 +1,76 @@ +From adf957124a115bdf3e4728e1ea8c70a632648cf0 Mon Sep 17 00:00:00 2001 +From: Coia Prant +Date: Fri, 14 Feb 2025 15:49:55 +0800 +Subject: [PATCH] wifi: rt2x00: Add support for loading EEPROM from devicetree + embedded data + +This patch allows rt2x00 to load eeprom from devicetree embedded data. + +Example: + +/* load eeprom from embedded data 'eeprom-data' */ +&wmac { + ralink,eeprom-data = <0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff>; +}; + +Signed-off-by: Coia Prant +--- + .../net/wireless/ralink/rt2x00/rt2x00eeprom.c | 25 +++++++++++++++++++ + 1 file changed, 25 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +@@ -33,6 +33,27 @@ static void rt2800lib_eeprom_swap(struct + rt2x00dev->eeprom[i] = swab16(rt2x00dev->eeprom[i]); + } + ++static int rt2800lib_read_eeprom_data(struct rt2x00_dev *rt2x00dev) ++{ ++ struct device_node *np = rt2x00dev->dev->of_node; ++ unsigned int len = rt2x00dev->ops->eeprom_size; ++ const void *data; ++ int size; ++ ++ data = of_get_property(np, "ralink,eeprom-data", &size); ++ if (!data) ++ return -ENOENT; ++ ++ if (size != len) { ++ dev_err(rt2x00dev->dev, "invalid eeprom size, required: 0x%04x\n", len); ++ return -EINVAL; ++ } ++ ++ memcpy(rt2x00dev->eeprom, data, size); ++ ++ return 0; ++} ++ + #if IS_ENABLED(CONFIG_MTD) + static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev) + { +@@ -193,6 +214,10 @@ int rt2x00lib_read_eeprom(struct rt2x00_ + { + int ret; + ++ ret = rt2800lib_read_eeprom_data(rt2x00dev); ++ if (!ret) ++ return 0; ++ + #if IS_ENABLED(CONFIG_MTD) + ret = rt2800lib_read_eeprom_mtd(rt2x00dev); + if (!ret) From 55e8ac531249097e74ab4b25f47f53dfe47ddb40 Mon Sep 17 00:00:00 2001 From: Coia Prant Date: Tue, 11 Mar 2025 11:33:00 +0800 Subject: [PATCH 07/15] ramips: add support for Hongdian H8922 v30 This is an industrial 4G router equipped with OpenWrt 14.07 OEM customized version WARNING: The original firmware device tree is common to multiple boards, and the device tree name is H9350. This submitted device tree is a modified version, which deletes the non-this-device parts and adds GPIO watchdog. Specification: - SoC: MediaTek MT7620A - Flash: 16 MB - RAM: 128 MB - Power: DC 5V-36V 1.5A - Ethernet: 1x WAN, 4x LAN (10/100 Mbps) - Wireless radio: 802.11n 2.4g-only - LED: System/Power (RUN): GPIO/26 active-low Ethernet: 1x WAN, 4x LAN Modem 1: GPIO/66 active-low RF 1 (Modem 1 Signal): GPIO/67 active-low Modem 2: GPIO 71 active-low RF 2 (Modem 2 Signal): GPIO/24 active-low WLAN: GPIO/72 active-low WPS: GPIO/12 active-low - Button: WPS / RESET: GPIO/34 active-low - UART: 1x UART on PCB - 115200 8N1 - GPIO Watchdog: GPIO/62 mode=toggle timeout=1s - PCIe: 2x miniPCIe for modem - SIM Slots: 2x SIM Slots Issue: - No factory partition, eeprom is located at /lib/firmware/mt7620a.eeprom Flash instruction: Using UART: 1. Configure PC with a static IP address and setup an TFTP server. 2. Put rootfs into the tftp directory. 3. Connect the UART line as described on the PCB. 4. Power up the device and press Ctrl+C to break auto boot. 5. Use `system 6` command and follow the instruction to set device and tftp server IP address and input the rootfs file name. U-boot will then load the rootfs and write it into the flash. 6. Use `system 1` command and follow the instruction to set device and tftp server IP address and input the firmware file name. U-boot will then load the firmware once. 7. Login to LuCI and use LuCI upgrade firmware. Original Firmware Dump / More details: https://blog.gov.cooking/archives/research-hongdian-h8922-and-flash.html Signed-off-by: Coia Prant Tested-by: Coia Prant Link: https://github.com/openwrt/openwrt/pull/17472 Link: https://github.com/openwrt/openwrt/pull/18221 Signed-off-by: Hauke Mehrtens (cherry picked from commit 6a1bdcf545eec8f9ed5130e7f5794fca6ee54cb3) --- package/boot/uboot-envtools/files/ramips | 1 + .../ramips/dts/mt7620a_hongdian_h8922-v30.dts | 189 ++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 12 ++ .../mt7620/base-files/etc/board.d/02_network | 1 + 4 files changed, 203 insertions(+) create mode 100644 target/linux/ramips/dts/mt7620a_hongdian_h8922-v30.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 341687625c..0b17a0c47e 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -19,6 +19,7 @@ alfa-network,r36m-e4g|\ alfa-network,tube-e4g|\ engenius,epg600|\ engenius,esr600h|\ +hongdian,h8922-v30|\ linksys,re7000|\ meig,slt866|\ sitecom,wlr-4100-v1-002|\ diff --git a/target/linux/ramips/dts/mt7620a_hongdian_h8922-v30.dts b/target/linux/ramips/dts/mt7620a_hongdian_h8922-v30.dts new file mode 100644 index 0000000000..d983f5f854 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_hongdian_h8922-v30.dts @@ -0,0 +1,189 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a.dtsi" + +#include +#include +#include + +/ { + compatible = "hongdian,h8922-v30", "ralink,mt7620a-soc"; + model = "Hongdian H8922 v30"; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led-wps { + gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WPS; + }; + + led-rf-2 { + gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; + color = ; + function = "rf"; + function-enumerator = <2>; + }; + + led_sys: led-sys { + gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_POWER; + default-state = "on"; + }; + + led-net-1 { + gpios = <&gpio2 26 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_MOBILE; + function-enumerator = <1>; + }; + + led-rf-1 { + gpios = <&gpio2 27 GPIO_ACTIVE_LOW>; + color = ; + function = "rf"; + function-enumerator = <1>; + }; + + led-net-2 { + gpios = <&gpio2 31 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_MOBILE; + function-enumerator = <2>; + }; + + led-wlan { + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_WLAN; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + + gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>; + hw_algo = "toggle"; + hw_margin_ms = <600>; + always-running; + }; +}; + +&watchdog { + status = "disabled"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x2f000>; + read-only; + }; + + partition@2f000 { + label = "u-boot-env"; + reg = <0x2f000 0x1000>; + read-only; + }; + + partition@30000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x30000 0xffd000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "wled", "rgmii1", "rgmii2"; + function = "gpio"; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&ephy_pins>; + + mediatek,portmap = "llllw"; +}; + +&pcie { + status = "okay"; +}; + +&wmac { + ralink,eeprom-data = <0x20760501 0x000c4376 0x2058ffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0x000c4376 0x2077000c 0x43762066 0x220c0000 0xffffb701 0x5577a8aa + 0x8c88ffff 0x0a000000 0x00000000 0x0000ffff 0xffff0a0a 0x0a0a0808 0x08080808 0x08080808 + 0x0e0e0e0e 0x0e0e0e0e 0x0e0e0e0e 0x0e0e80ff 0xffff80ff 0xffff0000 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0x20ffffff 0xffffffff 0xffffffff 0xffff0606 + 0x06060402 0x06060400 0x06060400 0x07070400 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff + 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff>; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 6cf65ad119..310cff692e 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -604,6 +604,18 @@ define Device/hnet_c108 endef TARGET_DEVICES += hnet_c108 +define Device/hongdian_h8922-v30 + SOC := mt7620a + IMAGE_SIZE := 15808k + DEVICE_VENDOR := Hongdian + DEVICE_MODEL := H8922 + DEVICE_VARIANT := v30 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi uboot-envtools + IMAGES += rootfs.bin + IMAGE/rootfs.bin := append-rootfs | check-size 10560k +endef +TARGET_DEVICES += hongdian_h8922-v30 + define Device/humax_e2 SOC := mt7620a IMAGE_SIZE := 7744k diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 577f77cb93..f07ce73e82 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -15,6 +15,7 @@ ramips_setup_interfaces() dlink,dwr-921-c1|\ dlink,dwr-922-e2|\ dovado,tiny-ac|\ + hongdian,h8922-v30|\ ohyeah,oy-0001|\ phicomm,psg1208|\ planex,db-wrt01|\ From 6e27a132058f4f60ba1aa68989e4a4de366a6557 Mon Sep 17 00:00:00 2001 From: Andreas Gnau Date: Tue, 7 Jan 2025 23:04:30 +0100 Subject: [PATCH 08/15] ramips: mt7621: Move common DNA EX400 defs to dtsi Move common definitions for DNA Valokuitu Plus EX400 to a dtsi include. This is in preparation of adding the non-branded variant of the device produced by Genexis / Inteno in the next commit. The device with DNA branding differs in the LED labling on the device. Signed-off-by: Andreas Gnau Link: https://github.com/openwrt/openwrt/pull/17551 (cherry picked from commit e8603f3b5a15856fccee2e02a5406ca9c8b2ba1d) Link: https://github.com/openwrt/openwrt/pull/18238 Signed-off-by: Hauke Mehrtens --- .../dts/mt7621_dna_valokuitu-plus-ex400.dts | 125 +---------------- .../mt7621_genexis_pulse-ex400-common.dtsi | 128 ++++++++++++++++++ 2 files changed, 129 insertions(+), 124 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi diff --git a/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts b/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts index cc5b4b71d0..9bbe91beef 100644 --- a/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts +++ b/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts @@ -1,131 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621.dtsi" - -#include -#include -#include +#include "mt7621_genexis_pulse-ex400-common.dtsi" / { compatible = "dna,valokuitu-plus-ex400", "mediatek,mt7621-soc"; model = "DNA Valokuitu Plus EX400"; - - aliases { - ethernet0 = &gmac0; - label-mac-device = &gmac0; - led-boot = &led_status_red; - led-failsafe = &led_status_red; - led-running = &led_status_green; - led-upgrade = &led_update_green; - }; - - chosen { - bootargs-override = "console=ttyS0,115200 rootfstype=squashfs,jffs2"; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_status_green: led-0 { - color = ; - function = LED_FUNCTION_STATUS; - gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - }; - - led_status_red: led-1 { - color = ; - function = LED_FUNCTION_STATUS; - gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; - }; - - led_update_green: led-2 { - color = ; - function = LED_FUNCTION_PROGRAMMING; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&pcie { - status = "okay"; -}; - -&nand { - status = "okay"; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - reg = <0x00 0x100000>; - label = "uboot"; - read-only; - }; - - partition@100000 { - reg = <0x100000 0xff00000>; - label = "ubi"; - compatible = "linux,ubi"; - - volumes { - ubi-volume-env1 { - volname = "env1"; - - nvmem-layout { - compatible = "u-boot,env-redundant-count"; - - ethaddr: ethaddr { - #nvmem-cell-cells = <1>; - }; - }; - }; - }; - }; - }; -}; - -&gmac1 { - label = "wan"; - phy-handle = <ðphy0>; - nvmem-cells = <ðaddr 1>; - nvmem-cell-names = "mac-address"; - status = "okay"; -}; - -&i2c { - status = "okay"; -}; - -ðphy0 { - /delete-property/ interrupts; -}; - -&state_default { - gpio { - groups = "uart2", "uart3"; - function = "gpio"; - }; -}; - -&switch0 { - ports { - port@1 { - label = "lan"; - nvmem-cells = <ðaddr 0>; - nvmem-cell-names = "mac-address"; - status = "okay"; - }; - }; }; diff --git a/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi new file mode 100644 index 0000000000..dddc381fe8 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + aliases { + ethernet0 = &gmac0; + label-mac-device = &gmac0; + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_update_green; + }; + + chosen { + bootargs-override = "console=ttyS0,115200 rootfstype=squashfs,jffs2"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: led-0 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_status_red: led-1 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + }; + + led_update_green: led-2 { + color = ; + function = LED_FUNCTION_PROGRAMMING; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x00 0x100000>; + label = "uboot"; + read-only; + }; + + partition@100000 { + reg = <0x100000 0xff00000>; + label = "ubi"; + compatible = "linux,ubi"; + + volumes { + ubi-volume-env1 { + volname = "env1"; + + nvmem-layout { + compatible = "u-boot,env-redundant-count"; + + ethaddr: ethaddr { + #nvmem-cell-cells = <1>; + }; + }; + }; + }; + }; + }; +}; + +&gmac1 { + label = "wan"; + phy-handle = <ðphy0>; + nvmem-cells = <ðaddr 1>; + nvmem-cell-names = "mac-address"; + status = "okay"; +}; + +&i2c { + status = "okay"; +}; + +ðphy0 { + /delete-property/ interrupts; +}; + +&state_default { + gpio { + groups = "uart2", "uart3"; + function = "gpio"; + }; +}; + +&switch0 { + ports { + port@1 { + label = "lan"; + nvmem-cells = <ðaddr 0>; + nvmem-cell-names = "mac-address"; + status = "okay"; + }; + }; +}; From dd0c2839a81bb3c5067be99b02ec5c0adff93ac6 Mon Sep 17 00:00:00 2001 From: Andreas Gnau Date: Tue, 7 Jan 2025 23:55:12 +0100 Subject: [PATCH 09/15] ramips: Add support for Genexis / Inteno Pulse EX400 Add support for Genexis Pulse EX400 / Inteno Pulse EX400. A branded variant for the Finnish ISP DNA has already been added in fea2264d9fdd (ramips: mt7621: Add DNA Valokuitu Plus EX400, 2023-07-31). This commit adds support for the generic variants with Inteno and Genexis branding. Inteno changed its name to Genexis and both brandings exist. In terms of electronics, there is no difference between the DNA-branded version and other brandings. LED markings on the case are different, though. While the DNA-version has a "software-update" LED, the other versions have a WPS LED. To reduce user confusion, create a separate image. Add the different device-tree with the different LED and rename things to work the same way for both variants. Specifications: - Device: Genexis Pulse EX400 / Inteno Pulse EX400 - SoC: MT7621A - Flash: 256 MB NAND - RAM: 256 MB - Ethernet: Built-in, 2 x 1 GbE - Wifi: MT7603 2.4 GHz 2x2 MIMO, MT7615 5 GHz 4x4 MU-MIMO - USB: 1x 2.0 - LEDs (GPIO): green/red status, green WPS - LEDs (SX9512, unsupported): Broadband, Wi-Fi 2.4G, Wi-Fi 5G - Buttons (GPIO): Reset - Buttons (SX9512, unsupported): Wi-Fi 2.4G, Wi-Fi 5G, WPS MAC addresses: - LAN: U-Boot 'ethaddr' (label) - WAN: label + 1 - 2.4 GHz: label + 6 - 5 GHz: label + 7 Serial: There is a black block connector next to the red ethernet connector. It is accessible also through holes in the casing. Pinout (TTL 3.3V) +---+---+ |Tx |Rx | +---+---+ |Vcc|Gnd| +---+---+ Firmware: The vendor firmware is a fork of OpenWrt (Reboot) with a kernel version 4.4.93. The flash is arranged as below and there is a dual boot mechanism alternating between rootfs_0 and rootfs_1. +-------+------+------+-----------+-----------+ | | env1 | env2 | rootfs_0 | rootfs_1 | | +------+------+-----------+-----------+ | | UBI volumes | +-------+-------------------------------------+ |U-Boot | UBI | +-------+-------------------------------------+ |mtd0 | mtd1 | +-------+-------------------------------------+ | NAND | +---------------------------------------------+ In OpenWrt rootfs_0 will be used as a boot partition that will contain the kernel and the dtb. The squashfs rootfs and overlay are standard OpenWrt behaviour. +-------+------+------+-----------+--------+------------+ | | env1 | env2 | rootfs_0 | rootfs | rootfs_data| | +------+------+-----------+--------+------------+ | | UBI volumes | +-------+-----------------------------------------------+ |U-Boot | UBI | +-------+-----------------------------------------------+ |mtd0 | mtd1 | +-------+-----------------------------------------------+ | NAND | +-------------------------------------------------------+ U-boot: With proper serial access, booting can be halted to U-boot by pressing any key. TFTP and flash writes are available, but only the first one has been tested. NOTE: Recovery mode can be accessed by holding down the reset button while powering on the device. The led 'Update' will show a solid green light once ready. A web server will be running at 192.168.1.1:80 and it will allow flashing a firmware package. You can cycle between rootfs_0 and rootfs_1 by pressing the reset button once. Root password: With the vendor web UI create a backup of your settings and download the archive to your computer. Within the archive in the file /etc/shadow replace the password hash for root with that of a password you know. Restore the configuration with the vendor web UI and you will have changed the root password. SSH access: You might need to enable the SSH service for LAN interface as by default it's enabled for WAN only. Installing OpenWrt: With the vendor web UI, or from the U-Boot recovery UI, install the OpenWrt factory image. Alternatively, ssh to the device and use sysupgrade -n from cli. Finalize by installing the OpenWrt sysupgrade image to get a fully functioning system. Reverting to the vendor firmware: Boot with OpenWrt initramfs image - Remove volumes rootfs_0, rootfs and rootfs_data and create vendor volumes. ubirmvol /dev/ubi0 -n 2 ubirmvol /dev/ubi0 -n 3 ubirmvol /dev/ubi0 -n 4 ubimkvol /dev/ubi0 -N rootfs_0 -S 990 ubimkvol /dev/ubi0 -N rootfs_1 -S 990 Power off and enter to the U-boot recovery to install the vendor firmware. Signed-off-by: Andreas Gnau Link: https://github.com/openwrt/openwrt/pull/17551 (cherry picked from commit 3e7337feead8e0a0f5a05f5b91d7d0fd7f14ec56) Link: https://github.com/openwrt/openwrt/pull/18238 Signed-off-by: Hauke Mehrtens --- package/boot/uboot-envtools/files/ramips | 3 +- .../dts/mt7621_dna_valokuitu-plus-ex400.dts | 15 ++++++ .../mt7621_genexis_pulse-ex400-common.dtsi | 12 +---- .../ramips/dts/mt7621_genexis_pulse-ex400.dts | 23 +++++++++ target/linux/ramips/image/mt7621.mk | 47 ++++++++++++------- .../mt7621/base-files/etc/board.d/02_network | 1 + .../mt7621/base-files/etc/init.d/bootcount | 3 +- .../lib/upgrade/{dna.sh => inteno.sh} | 13 +++-- .../mt7621/base-files/lib/upgrade/platform.sh | 5 +- 9 files changed, 87 insertions(+), 35 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_genexis_pulse-ex400.dts rename target/linux/ramips/mt7621/base-files/lib/upgrade/{dna.sh => inteno.sh} (79%) diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 0b17a0c47e..d6124745da 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -148,7 +148,8 @@ xiaomi,mi-router-cr6608|\ xiaomi,mi-router-cr6609) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000" ;; -dna,valokuitu-plus-ex400) +dna,valokuitu-plus-ex400|\ +genexis,pulse-ex400) ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1" ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1" ;; diff --git a/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts b/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts index 9bbe91beef..e06da71d76 100644 --- a/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts +++ b/target/linux/ramips/dts/mt7621_dna_valokuitu-plus-ex400.dts @@ -5,4 +5,19 @@ / { compatible = "dna,valokuitu-plus-ex400", "mediatek,mt7621-soc"; model = "DNA Valokuitu Plus EX400"; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_update_green; + }; +}; + +&leds { + led_update_green: led-2 { + color = ; + function = LED_FUNCTION_PROGRAMMING; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; }; diff --git a/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi index dddc381fe8..a3bc70e8ce 100644 --- a/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi +++ b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400-common.dtsi @@ -10,10 +10,6 @@ aliases { ethernet0 = &gmac0; label-mac-device = &gmac0; - led-boot = &led_status_red; - led-failsafe = &led_status_red; - led-running = &led_status_green; - led-upgrade = &led_update_green; }; chosen { @@ -30,7 +26,7 @@ }; }; - leds { + leds: leds { compatible = "gpio-leds"; led_status_green: led-0 { @@ -44,12 +40,6 @@ function = LED_FUNCTION_STATUS; gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; }; - - led_update_green: led-2 { - color = ; - function = LED_FUNCTION_PROGRAMMING; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; }; }; diff --git a/target/linux/ramips/dts/mt7621_genexis_pulse-ex400.dts b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400.dts new file mode 100644 index 0000000000..2ec6498322 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_genexis_pulse-ex400.dts @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_genexis_pulse-ex400-common.dtsi" + +/ { + compatible = "genexis,pulse-ex400", "mediatek,mt7621-soc"; + model = "Genexis/Inteno Pulse EX400"; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; +}; + +&leds { + led_wps_green: led-2 { + color = ; + function = LED_FUNCTION_WPS; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 02b09b3fe1..c1acada2fa 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -51,7 +51,7 @@ define Build/arcadyan-trx rm $@.hsqs $@.tail endef -define Build/dna-header +define Build/inteno-y3-header BC='$(STAGING_DIR_HOST)/bin/bc' ;\ ubifsofs="1024" ;\ ubifs="$$(stat -c%s $@)" ;\ @@ -91,7 +91,7 @@ define Build/dna-header mv $@.tmp $@ endef -define Build/dna-bootfs +define Build/inteno-bootfs mkdir -p $@.ubifs-dir/boot # populate the boot fs with the dtb and the kernel image @@ -1058,23 +1058,11 @@ define Device/d-team_pbr-m1 endef TARGET_DEVICES += d-team_pbr-m1 +# Branded version of Genexis / Inteno EX400 (difference is one LED) define Device/dna_valokuitu-plus-ex400 - $(Device/dsa-migration) - IMAGE_SIZE := 117m - PAGESIZE := 2048 - MKUBIFS_OPTS := --min-io-size=$$(PAGESIZE) --leb-size=124KiB --max-leb-cnt=96 \ - --log-lebs=2 --space-fixup --squash-uids + $(Device/genexis_pulse-ex400/common) DEVICE_VENDOR := DNA DEVICE_MODEL := Valokuitu Plus EX400 - KERNEL := kernel-bin | lzma | uImage lzma - KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma - IMAGES += factory.bin - IMAGE/factory.bin := append-image-stage initramfs-kernel.bin | \ - dna-bootfs | dna-header | append-md5sum-ascii-salted - IMAGE/sysupgrade.bin := append-kernel | dna-bootfs | \ - sysupgrade-tar kernel=$$$$@ | check-size | append-metadata - DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(2) - DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware kmod-usb3 endef TARGET_DEVICES += dna_valokuitu-plus-ex400 @@ -1379,6 +1367,33 @@ define Device/gemtek_wvrtm-130acn endef TARGET_DEVICES += gemtek_wvrtm-130acn +# Common definitions shared between genexis_pulse-ex400 and dna_valokuitu-plus-ex400 +define Device/genexis_pulse-ex400/common + $(Device/dsa-migration) + IMAGE_SIZE := 117m + PAGESIZE := 2048 + MKUBIFS_OPTS := --min-io-size=$$(PAGESIZE) --leb-size=124KiB --max-leb-cnt=96 \ + --log-lebs=2 --space-fixup --squash-uids + KERNEL := kernel-bin | lzma | uImage lzma + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma + IMAGES += factory.bin + IMAGE/factory.bin := append-image-stage initramfs-kernel.bin | \ + inteno-bootfs | inteno-y3-header | append-md5sum-ascii-salted + IMAGE/sysupgrade.bin := append-kernel | inteno-bootfs | \ + sysupgrade-tar kernel=$$$$@ | check-size | append-metadata + DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(2) + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware kmod-usb3 +endef + +define Device/genexis_pulse-ex400 + $(Device/genexis_pulse-ex400/common) + DEVICE_VENDOR := Genexis + DEVICE_MODEL := Pulse EX400 + DEVICE_ALT0_VENDOR := Inteno + DEVICE_ALT0_MODEL := Pulse EX400 +endef +TARGET_DEVICES += genexis_pulse-ex400 + define Device/glinet_gl-mt1300 $(Device/dsa-migration) IMAGE_SIZE := 32448k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 650fef62a8..af5e4a8403 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -72,6 +72,7 @@ ramips_setup_interfaces() comfast,cf-ew72-v2|\ cudy,m1800|\ dna,valokuitu-plus-ex400|\ + genexis,pulse-ex400|\ humax,e10|\ keenetic,kn-3510|\ meig,slt866|\ diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount index b83223e7dd..2c88d68051 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -32,7 +32,8 @@ boot() { samknows,whitebox-v8) fw_setenv bootcount 0 ;; - dna,valokuitu-plus-ex400) + dna,valokuitu-plus-ex400|\ + genexis,pulse-ex400) fw_setenv boot_cnt_primary 0 fw_setenv boot_cnt_alt 0 ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/dna.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh similarity index 79% rename from target/linux/ramips/mt7621/base-files/lib/upgrade/dna.sh rename to target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh index d699516ff6..677000f6b1 100644 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/dna.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/inteno.sh @@ -16,11 +16,16 @@ . /lib/functions.sh . /lib/upgrade/nand.sh -dna_do_upgrade () { - tar -xaf $1 +inteno_do_upgrade () { + local tar_file=$1 + local cmd=cat + # WARNING: This fails if tar contains more than one 'sysupgrade-*' directory. + local board_dir="$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$')" + board_dir="${board_dir%/}" + tar -xaf "$tar_file" # get the size of the new bootfs - local _bootfs_size=$(wc -c < ./sysupgrade-dna_valokuitu-plus-ex400/kernel) + local _bootfs_size=$(wc -c < "$board_dir/kernel") [ -n "$_bootfs_size" -a "$_bootfs_size" -gt "0" ] || nand_do_upgrade_failed # remove existing rootfses and recreate rootfs_0 @@ -32,7 +37,7 @@ dna_do_upgrade () { # update the rootfs_0 contents local _kern_ubivol=$( nand_find_volume "ubi0" "rootfs_0" ) - ubiupdatevol /dev/${_kern_ubivol} sysupgrade-dna_valokuitu-plus-ex400/kernel + ubiupdatevol "/dev/$_kern_ubivol" "$board_dir/kernel" fw_setenv root_vol rootfs_0 fw_setenv boot_cnt_primary 0 diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 17532f795b..33f8ccd4ce 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -156,8 +156,9 @@ platform_do_upgrade() { buffalo,wsr-2533dhpls) buffalo_do_upgrade "$1" ;; - dna,valokuitu-plus-ex400) - dna_do_upgrade "$1" + dna,valokuitu-plus-ex400|\ + genexis,pulse-ex400) + inteno_do_upgrade "$1" ;; elecom,wrc-x1800gs) [ "$(fw_printenv -n bootmenu_delay)" != "0" ] || \ From 76565015f56cd18b757b42b53667478d20753672 Mon Sep 17 00:00:00 2001 From: Andreas Gnau Date: Fri, 10 Jan 2025 22:42:03 +0100 Subject: [PATCH 10/15] ramips: mt7621: Reduce hardcoded metadata for Inteno Y3 imgs Instead of hardcoded metadata, put some sensible data instead. Signed-off-by: Andreas Gnau Link: https://github.com/openwrt/openwrt/pull/17551 (cherry picked from commit 4e3342f5f17d5d227f036b4b16e2a3721a2e8493) Link: https://github.com/openwrt/openwrt/pull/18238 Signed-off-by: Hauke Mehrtens --- target/linux/ramips/image/mt7621.mk | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index c1acada2fa..37e6ce1b71 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -67,12 +67,12 @@ define Build/inteno-y3-header echo "IntenoIopY" > $@.tmp ;\ echo "version 5" >> $@.tmp ;\ echo "integrity MD5SUM" >> $@.tmp ;\ - echo "board EX400" >> $@.tmp ;\ - echo "chip 7621" >> $@.tmp ;\ - echo "arch all mipsel_1004kc" >> $@.tmp ;\ - echo "model EX400" >> $@.tmp ;\ - echo "release EX400-X-DNA-4.3.6.100-R-210518_0935" >> $@.tmp ;\ - echo "customer DNA" >> $@.tmp ;\ + echo "board $(word 1,$(1))" >> $@.tmp ;\ + echo "chip $(patsubst mt%,%,$(SOC:bcm%=%))" >> $@.tmp ;\ + echo "arch all $(CONFIG_TARGET_ARCH_PACKAGES)" >> $@.tmp ;\ + echo "model $(word 1,$(1))" >> $@.tmp ;\ + echo "release $(DEVICE_IMG_PREFIX)" >> $@.tmp ;\ + echo "customer $(if $(CONFIG_VERSION_DIST),$(CONFIG_VERSION_DIST),OpenWrt)" >> $@.tmp ;\ echo "ubifsofs $${ubifsofs}" >> $@.tmp ;\ echo "ubifs $${ubifs}" >> $@.tmp ;\ echo "pkginfoofs $${pkginfoofs}" >> $@.tmp ;\ @@ -1378,7 +1378,7 @@ define Device/genexis_pulse-ex400/common KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma IMAGES += factory.bin IMAGE/factory.bin := append-image-stage initramfs-kernel.bin | \ - inteno-bootfs | inteno-y3-header | append-md5sum-ascii-salted + inteno-bootfs | inteno-y3-header EX400 | append-md5sum-ascii-salted IMAGE/sysupgrade.bin := append-kernel | inteno-bootfs | \ sysupgrade-tar kernel=$$$$@ | check-size | append-metadata DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(2) From 2304486d600b3cdaef17602786251218e2317afe Mon Sep 17 00:00:00 2001 From: Michael Trinidad Date: Sun, 16 Feb 2025 18:44:03 -0500 Subject: [PATCH 11/15] mwlwifi: update to version 10.4.11-20250206 The fixes are only for the WRT1900X and WRT1200AC. It contains: Deletes the driver's ability to modify the debit table. Remove skb_get(done_skb) in txdone Reworking ISR clean code Napi replaces tasklet Add rx_decrypt feature Signed-off-by: Michael Trinidad Link: https://github.com/openwrt/openwrt/pull/17997 Signed-off-by: Christian Marangi Link: https://github.com/openwrt/openwrt/pull/18145 Signed-off-by: Hauke Mehrtens --- package/kernel/mwlwifi/Makefile | 8 +- ...memcpy-in-mwl_fwcmd_get_fw_core_dump.patch | 2 +- ...-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch | 2 +- ...Use-zu-and-zd-for-ssize_t-and-size_t.patch | 2 +- ...CIe-DT-node-null-pointer-dereference.patch | 31 ------ .../mwlwifi/patches/020-mac80211_update.patch | 96 +++++++++---------- 6 files changed, 55 insertions(+), 86 deletions(-) delete mode 100644 package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 3f2d5e0949..07c3acc5f9 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,16 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_RELEASE=2 +PKG_RELEASE=1 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-04-19 -PKG_SOURCE_VERSION:=a737d348ef4fe00434b2bc44b2b6a68ea833d95b -PKG_MIRROR_HASH:=d55f69c2fa48d02ba535b72b108fc77f5f13a52b29130a631489a053f1670d2c +PKG_SOURCE_DATE:=2025-02-06 +PKG_SOURCE_VERSION:=db97edf20fadea2617805006f5230665fadc6a8c +PKG_MIRROR_HASH:=b5464cf6d57d87f6ce5f13bd2320c7e7e671a3152a74f4ef004382f898b89ecf PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch b/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch index 4b0feeb17e..20e1cce382 100644 --- a/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch +++ b/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch @@ -20,7 +20,7 @@ Signed-off-by: Christian Marangi --- a/hif/fwcmd.c +++ b/hif/fwcmd.c -@@ -3622,11 +3622,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ie +@@ -3624,11 +3624,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ie core_dump->context = pcmd->cmd_data.coredump.context; core_dump->size_kb = pcmd->cmd_data.coredump.size_kb; core_dump->flags = pcmd->cmd_data.coredump.flags; diff --git a/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch b/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch index f204e9fe73..f6c398cf66 100644 --- a/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch +++ b/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch @@ -19,7 +19,7 @@ Signed-off-by: Christian Marangi --- a/hif/pcie/pcie.c +++ b/hif/pcie/pcie.c -@@ -1466,8 +1466,8 @@ static void pcie_bf_mimo_ctrl_decode(str +@@ -1449,8 +1449,8 @@ static void pcie_bf_mimo_ctrl_decode(str &fp_data->f_pos); filp_close(fp_data, current->files); } else { diff --git a/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch b/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch index d615e13380..816fb222c0 100644 --- a/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch +++ b/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch @@ -14,7 +14,7 @@ Signed-off-by: Christian Marangi --- a/debugfs.c +++ b/debugfs.c -@@ -1342,7 +1342,7 @@ done: +@@ -1394,7 +1394,7 @@ done: priv->reg_value); else len += scnprintf(p + len, size - len, diff --git a/package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch b/package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch deleted file mode 100644 index f37d2f8171..0000000000 --- a/package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8e809b241695252e397bf0d7fc5f36e115c38831 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Fri, 5 Mar 2021 11:47:59 +0100 -Subject: [PATCH] mwlwifi: fix PCIe DT node null pointer dereference - -pci_bus_to_OF_node() used to get the PCI bus DT node -returns node if found or NULL if none is found. - -Since the return of pci_bus_to_OF_node() is not checked in -the DT node name print it will cause a null pointer -dereference and crash the kernel. - -So first check whether the node is not NULL and then print. - -Signed-off-by: Robert Marko ---- - hif/pcie/pcie.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/hif/pcie/pcie.c -+++ b/hif/pcie/pcie.c -@@ -685,7 +685,8 @@ static struct device_node *pcie_get_devi - struct device_node *dev_node; - - dev_node = pci_bus_to_OF_node(pcie_priv->pdev->bus); -- wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name); -+ if (dev_node) -+ wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name); - - return dev_node; - } diff --git a/package/kernel/mwlwifi/patches/020-mac80211_update.patch b/package/kernel/mwlwifi/patches/020-mac80211_update.patch index 1c5d581939..1d4afabb51 100644 --- a/package/kernel/mwlwifi/patches/020-mac80211_update.patch +++ b/package/kernel/mwlwifi/patches/020-mac80211_update.patch @@ -13,7 +13,7 @@ --- a/debugfs.c +++ b/debugfs.c -@@ -498,9 +498,9 @@ static ssize_t mwl_debugfs_vif_read(stru +@@ -550,9 +550,9 @@ static ssize_t mwl_debugfs_vif_read(stru switch (vif->type) { case NL80211_IFTYPE_AP: len += scnprintf(p + len, size - len, "type: ap\n"); @@ -26,7 +26,7 @@ len += scnprintf(p + len, size - len, "ssid: %s\n", ssid); len += scnprintf(p + len, size - len, -@@ -522,8 +522,8 @@ static ssize_t mwl_debugfs_vif_read(stru +@@ -574,8 +574,8 @@ static ssize_t mwl_debugfs_vif_read(stru "type: unknown\n"); break; } @@ -37,7 +37,7 @@ len += scnprintf(p + len, size - len, "channel: %d: width: %d\n", chan_def->chan->hw_value, -@@ -596,18 +596,18 @@ static ssize_t mwl_debugfs_sta_read(stru +@@ -648,18 +648,18 @@ static ssize_t mwl_debugfs_sta_read(stru sta_info->wds ? "true" : "false", sta_info->ba_hist.enable ? "enable" : "disable", sta_info->is_amsdu_allowed ? sta_info->amsdu_ctrl.cap : 0 , @@ -68,7 +68,7 @@ sta->tdls, sta->tdls_initiator, sta->wme, -@@ -1158,7 +1158,7 @@ static ssize_t mwl_debugfs_dfs_radar_wri +@@ -1210,7 +1210,7 @@ static ssize_t mwl_debugfs_dfs_radar_wri struct mwl_priv *priv = (struct mwl_priv *)file->private_data; wiphy_info(priv->hw->wiphy, "simulate radar detected\n"); @@ -127,7 +127,7 @@ a_band = true; else return -EINVAL; -@@ -2090,7 +2094,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021 +@@ -2092,7 +2096,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021 if (mwl_fwcmd_set_wsc_ie(hw, b_inf->ie_wsc_len, b_inf->ie_wsc_ptr)) goto err; @@ -136,7 +136,7 @@ goto err; if (b_inf->cap_info & WLAN_CAPABILITY_SPECTRUM_MGMT) -@@ -2152,38 +2156,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee +@@ -2154,38 +2158,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee ether_addr_copy(pcmd->mac_addr, sta->addr); if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) @@ -189,7 +189,7 @@ } pcmd->is_qos_sta = sta->wme; -@@ -2239,38 +2243,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct +@@ -2241,38 +2245,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct ether_addr_copy(pcmd->mac_addr, sta->addr); if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) @@ -242,7 +242,7 @@ } pcmd->is_qos_sta = sta->wme; -@@ -2787,9 +2791,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 +@@ -2789,9 +2793,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 pcmd->ba_info.create_params.flags = cpu_to_le32(ba_flags); pcmd->ba_info.create_params.queue_id = stream->idx; pcmd->ba_info.create_params.param_info = @@ -254,7 +254,7 @@ IEEE80211_HT_AMPDU_PARM_DENSITY); if (direction == BA_FLAG_DIRECTION_UP) { pcmd->ba_info.create_params.reset_seq_no = 0; -@@ -2799,9 +2803,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 +@@ -2801,9 +2805,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 pcmd->ba_info.create_params.current_seq = cpu_to_le16(0); } if (priv->chip_type == MWL8964 && @@ -268,16 +268,16 @@ } --- a/hif/pcie/8864/tx.c +++ b/hif/pcie/8864/tx.c -@@ -490,7 +490,7 @@ static void pcie_non_pfu_tx_done(struct - } else - memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); - skb_pull(done_skb, sizeof(*dma_data) - hdrlen); -- ieee80211_tx_status(priv->hw, done_skb); -+ ieee80211_tx_status_skb(priv->hw, done_skb); - dev_kfree_skb_any(done_skb); - done_skb = NULL; - } -@@ -743,7 +743,7 @@ void pcie_8864_tx_xmit(struct ieee80211_ +@@ -478,7 +478,7 @@ static void pcie_non_pfu_tx_done(struct + } else + memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); + skb_pull(done_skb, sizeof(*dma_data) - hdrlen); +- ieee80211_tx_status(priv->hw, done_skb); ++ ieee80211_tx_status_skb(priv->hw, done_skb); + next: + tx_hndl = tx_hndl->pnext; + tx_desc = tx_hndl->pdesc; +@@ -730,7 +730,7 @@ void pcie_8864_tx_xmit(struct ieee80211_ index = SYSADPT_TX_WMM_QUEUES - index - 1; txpriority = index; @@ -286,7 +286,7 @@ !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && ieee80211_is_data_qos(wh->frame_control)) { tid = qos & 0xf; -@@ -925,4 +925,4 @@ void pcie_8864_tx_del_sta_amsdu_pkts(str +@@ -912,4 +912,4 @@ void pcie_8864_tx_del_sta_amsdu_pkts(str } } spin_unlock_bh(&sta_info->amsdu_lock); @@ -313,7 +313,7 @@ bypass_ack: if (++tx_done_tail >= MAX_TX_RING_DONE_SIZE) -@@ -596,13 +596,13 @@ void pcie_tx_xmit_ndp(struct ieee80211_h +@@ -593,13 +593,13 @@ void pcie_tx_xmit_ndp(struct ieee80211_h ack_skb = skb_copy(skb, GFP_ATOMIC); ack_info = IEEE80211_SKB_CB(ack_skb); pcie_tx_prepare_info(priv, 0, ack_info); @@ -340,16 +340,16 @@ pcie_priv->txbd_ring_size); for (num = 0; num < PCIE_MAX_TXRX_BD; num++) { -@@ -444,7 +444,7 @@ static void pcie_pfu_tx_done(struct mwl_ - } else - memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); - skb_pull(done_skb, sizeof(*pfu_dma) - hdrlen); -- ieee80211_tx_status(priv->hw, done_skb); -+ ieee80211_tx_status_skb(priv->hw, done_skb); - } +@@ -431,7 +431,7 @@ static void pcie_pfu_tx_done(struct mwl_ + } else + memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); + skb_pull(done_skb, sizeof(*pfu_dma) - hdrlen); +- ieee80211_tx_status(priv->hw, done_skb); ++ ieee80211_tx_status_skb(priv->hw, done_skb); } next: -@@ -694,7 +694,7 @@ void pcie_8997_tx_xmit(struct ieee80211_ + memset(data_buf, 0, sizeof(*data_buf)); +@@ -682,7 +682,7 @@ void pcie_8997_tx_xmit(struct ieee80211_ index = SYSADPT_TX_WMM_QUEUES - index - 1; txpriority = index; @@ -358,7 +358,7 @@ !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && ieee80211_is_data_qos(wh->frame_control)) { tid = qos & 0xf; -@@ -875,4 +875,4 @@ void pcie_8997_tx_del_sta_amsdu_pkts(str +@@ -863,4 +863,4 @@ void pcie_8997_tx_del_sta_amsdu_pkts(str } } spin_unlock_bh(&sta_info->amsdu_lock); @@ -376,7 +376,7 @@ { mwl_fwcmd_radio_disable(hw); -@@ -368,15 +368,15 @@ static void mwl_mac80211_bss_info_change +@@ -390,15 +390,15 @@ static void mwl_mac80211_bss_info_change } } @@ -395,7 +395,7 @@ { struct mwl_priv *priv = hw->priv; struct mwl_vif *mwl_vif; -@@ -426,8 +426,8 @@ static void mwl_mac80211_bss_info_change +@@ -448,8 +448,8 @@ static void mwl_mac80211_bss_info_change if (changed & (BSS_CHANGED_BEACON_INT | BSS_CHANGED_BEACON)) { struct sk_buff *skb; @@ -406,7 +406,7 @@ (!info->hidden_ssid)) { if (mwl_vif->broadcast_ssid != true) { mwl_fwcmd_broadcast_ssid_enable(hw, vif, true); -@@ -441,7 +441,7 @@ static void mwl_mac80211_bss_info_change +@@ -463,7 +463,7 @@ static void mwl_mac80211_bss_info_change } if (!mwl_vif->set_beacon) { @@ -415,7 +415,7 @@ if (skb) { mwl_fwcmd_set_beacon(hw, vif, skb->data, skb->len); -@@ -458,7 +458,7 @@ static void mwl_mac80211_bss_info_change +@@ -480,7 +480,7 @@ static void mwl_mac80211_bss_info_change static void mwl_mac80211_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, @@ -424,7 +424,7 @@ { switch (vif->type) { case NL80211_IFTYPE_AP: -@@ -583,10 +583,10 @@ static int mwl_mac80211_sta_add(struct i +@@ -605,10 +605,10 @@ static int mwl_mac80211_sta_add(struct i if (vif->type == NL80211_IFTYPE_MESH_POINT) sta_info->is_mesh_node = true; @@ -437,7 +437,7 @@ sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_8K; sta_info->amsdu_ctrl.amsdu_allow_size = SYSADPT_AMSDU_8K_MAX_SIZE; } -@@ -670,7 +670,7 @@ static int mwl_mac80211_sta_remove(struc +@@ -692,7 +692,7 @@ static int mwl_mac80211_sta_remove(struc static int mwl_mac80211_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, @@ -446,7 +446,7 @@ const struct ieee80211_tx_queue_params *params) { struct mwl_priv *priv = hw->priv; -@@ -934,4 +934,9 @@ const struct ieee80211_ops mwl_mac80211_ +@@ -956,4 +956,9 @@ const struct ieee80211_ops mwl_mac80211_ .pre_channel_switch = mwl_mac80211_chnl_switch, .sw_scan_start = mwl_mac80211_sw_scan_start, .sw_scan_complete = mwl_mac80211_sw_scan_complete, @@ -502,16 +502,7 @@ case TX_RATE_FORMAT_LEGACY: --- a/hif/pcie/pcie.c +++ b/hif/pcie/pcie.c -@@ -546,7 +546,7 @@ static irqreturn_t pcie_isr_8864(struct - - if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { - wiphy_info(hw->wiphy, "radar detected by firmware\n"); -- ieee80211_radar_detected(hw); -+ ieee80211_radar_detected(hw, NULL); - } - - if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) ieee80211_queue_work(hw, &priv->chnl_switch_handle); -@@ -593,7 +593,7 @@ static irqreturn_t pcie_isr_8997(struct +@@ -533,7 +533,7 @@ static irqreturn_t pcie_isr_8864(struct if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { wiphy_info(hw->wiphy, "radar detected by firmware\n"); @@ -520,7 +511,16 @@ } if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) -@@ -1071,7 +1071,7 @@ static irqreturn_t pcie_isr_ndp(struct i +@@ -575,7 +575,7 @@ static irqreturn_t pcie_isr_8997(struct + + if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { + wiphy_info(hw->wiphy, "radar detected by firmware\n"); +- ieee80211_radar_detected(hw); ++ ieee80211_radar_detected(hw, NULL); + } + + if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) +@@ -1053,7 +1053,7 @@ static irqreturn_t pcie_isr_ndp(struct i if (int_status & MACREG_A2HRIC_NEWDP_DFS) { wiphy_info(hw->wiphy, "radar detected by firmware\n"); From b16b75efbac2900ea48fc3302a0e28b80e6b70a6 Mon Sep 17 00:00:00 2001 From: Roland Reinl Date: Fri, 28 Feb 2025 06:11:01 +0100 Subject: [PATCH 12/15] ramips: Add support for Cudy M1300 v2 The M1300 v2 is similar to the WR1300 series from Cudy. Differences: - Only 1 LAN port - No USB Specifications: - MT7621 - MT7603E (2.4G b/g/n) and MT7613BE (5G ac/n) wifi - 128 MB RAM - 16 MB flash MAC Addresses: - There is one on the label, e.g. xx:xx:xx:xx:xx:1C - LAN (bottom connector) is the same as the label, e.g. xx:xx:xx:xx:xx:1C - WAN (top connector) is label +2, e.g. xx:xx:xx:xx:xx:1E - WLAN (2.4G) is the same as the label, e.g. xx:xx:xx:xx:xx:1C - WLAN (5G) is the same as WAN, e.g. xx:xx:xx:xx:xx:1E UART: - is available via the pin holes on the board - From inner to outer pin: TX, RX, GND, VCC - Do NOT connect VCC - Settings: 3.3V, 115200, 8N1 GPIO: - There are two LEDs: Red (GPIO 3) and White (GPIO 4) - There are two buttons: Reset (GPIO 8) and WPS (GPIO 10) Migration to OpenWrt: - Download the migration image from the Cudy website (it should be available as soon as OpenWrt officially supports the device) - The migration image is also available here until a image is provided by Cudy: https://github.com/RolandoMagico/openwrt-build/releases/tag/M1300_Build_20240222 - File: openwrt-ramips-mt7621-cudy_m1300-v2-squashfs-flash-signed.bin - Connect computer to LAN (bottom connector) and flash the migration image via OEM web interface - In the migration image, LAN and WAN are swapped. Computer must be connected to the other port after flashing - OpenWrt is now accessible via 192.168.1.1 - After flashing an up to date OpenWrt image, LAN and WAN settings are again the same as in the OEM firmware - So use the other connector again Revert back to OEM firmware: - Set up a TFTP server on IP 192.168.1.88 and connect to the LAN port (lower port) - Provide the Cudy firmware as recovery.bin in the TFTP server - Press the reset button while powering on the device - Recovery process is started now - When recovery process is done, OEM firmware is accessible via 192.168.10.1 again General information: - No possibility to load a initramfs image via U-Boot because there is no option to interrupt U-Boot Signed-off-by: Roland Reinl Link: https://github.com/openwrt/openwrt/pull/18139 (cherry picked from commit 8a7863767056ca0dec69a6b383b6e0c0d5fc3af7) Link: https://github.com/openwrt/openwrt/pull/18204 Signed-off-by: Hauke Mehrtens --- .../linux/ramips/dts/mt7621_cudy_m1300-v2.dts | 201 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 13 ++ .../mt7621/base-files/etc/board.d/02_network | 1 + 3 files changed, 215 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_cudy_m1300-v2.dts diff --git a/target/linux/ramips/dts/mt7621_cudy_m1300-v2.dts b/target/linux/ramips/dts/mt7621_cudy_m1300-v2.dts new file mode 100644 index 0000000000..f988b3375b --- /dev/null +++ b/target/linux/ramips/dts/mt7621_cudy_m1300-v2.dts @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "cudy,m1300-v2", "mediatek,mt7621-soc"; + model = "Cudy M1300 v2"; +}; + +/ { + aliases { + led-boot = &led_status_white; + led-failsafe = &led_status_red; + led-running = &led_status_white; + led-upgrade = &led_status_red; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: led-status-red { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + led_status_white: led-status-white { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xf80000>; + }; + + partition@fd0000 { + label = "debug"; + reg = <0xfd0000 0x10000>; + read-only; + }; + + partition@fe0000 { + label = "backup"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + partition@ff0000 { + label = "bdinfo"; + reg = <0xff0000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00 0>; + nvmem-cell-names = "eeprom", "mac-address"; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00 2>; + nvmem-cell-names = "eeprom", "mac-address"; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + + +&gmac0 { + nvmem-cells = <&macaddr_bdinfo_de00 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_bdinfo_de00 2>; + nvmem-cell-names = "mac-address"; +}; + +ðphy4 { + /delete-property/ interrupts; +}; + +&switch0 { + ports { + port@3 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&state_default { + gpio { + groups = "wdt", "jtag"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 37e6ce1b71..7674d0274d 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -685,6 +685,19 @@ define Device/confiabits_mt7621-v1 endef TARGET_DEVICES += confiabits_mt7621-v1 +define Device/cudy_m1300-v2 + $(Device/dsa-migration) + IMAGE_SIZE := 15872k + DEVICE_VENDOR := Cudy + DEVICE_MODEL := M1300 + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \ + -uboot-envtools + UIMAGE_NAME := R15 + SUPPORTED_DEVICES += R15 +endef +TARGET_DEVICES += cudy_m1300-v2 + define Device/cudy_m1800 $(Device/dsa-migration) DEVICE_VENDOR := Cudy diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index af5e4a8403..8d94cd592d 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -70,6 +70,7 @@ ramips_setup_interfaces() asiarf,ap7621-001|\ comfast,cf-e390ax|\ comfast,cf-ew72-v2|\ + cudy,m1300-v2|\ cudy,m1800|\ dna,valokuitu-plus-ex400|\ genexis,pulse-ex400|\ From 41613c0f7bf1bfa12a2cb23817c11d7bb7a1e84a Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 27 Feb 2025 15:06:51 -0500 Subject: [PATCH 13/15] kernel: bump 6.6 to 6.6.80 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.80 Removed upstreamed: generic/backport-6.6/819-v6.8-0002-nvmem-Create-a-header-for-internal-sharing.patch[1] generic/backport-6.6/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch[2] generic/backport-6.6/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch[3] All other patches automatically rebased. 1. https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.80&id=39dfc17a38f77b14f7cb2619bd3488a18d797d5d 2. https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.80&id=276dae17ad9757c3813d9e736a0210f05ccdf8b7 3. https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.80&id=a0ee898a5024f12572e4ce45202df9b149dadc05 Build system: x86/64 Build-tested: bcm27xx/bcm2712, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: bcm27xx/bcm2712, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/18140 Signed-off-by: Robert Marko (cherry picked from commit 86fd00b0fb83300ed7bd39af137a495c61253713) Link: https://github.com/openwrt/openwrt/pull/18208 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 +- .../900-unaligned_access_hacks.patch | 2 +- ...rs-remove-legacy_cursor_update-hacks.patch | 2 +- ...tional-threaded-NAPI-wakeup-based-on.patch | 6 +- ...-to-use-SMP-threads-for-backlog-NAPI.patch | 22 +-- ...klog-NAPI-to-clean-up-the-defer_list.patch | 4 +- ...-net-Rename-rps_lock-to-backlog_lock.patch | 18 +- ...-net-Make-USO-depend-on-CSUM-offload.patch | 6 +- ...64-if-device-if-driver-is-configured.patch | 2 +- ...-create-a-dummy-net_device-allocator.patch | 8 +- ...t-introduce-napi_is_scheduled-helper.patch | 2 +- ...4-Revert-nvmem-add-new-config-option.patch | 6 +- ...mem_layout_get_container-in-another-.patch | 4 +- ...Create-a-header-for-internal-sharing.patch | 91 ---------- ...03-nvmem-Simplify-the-add_cells-hook.patch | 79 -------- ...vmem-Move-and-rename-fixup_cell_info.patch | 169 ------------------ ...1-nvmem-imx-ocotp-ele-support-i.MX95.patch | 2 +- ...et-free_netdev-exit-earlier-if-dummy.patch | 2 +- .../721-net-add-packet-mangeling.patch | 2 +- ...680-net-add-TCP-fraglist-GRO-support.patch | 2 +- ...are-qcom_scm-disable-SDI-if-required.patch | 2 +- ...qcom_scm-Clear-download-bit-during-r.patch | 2 +- .../810-uvc-add-iPassion-iP2970-support.patch | 2 +- 23 files changed, 50 insertions(+), 389 deletions(-) delete mode 100644 target/linux/generic/backport-6.6/819-v6.8-0002-nvmem-Create-a-header-for-internal-sharing.patch delete mode 100644 target/linux/generic/backport-6.6/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch delete mode 100644 target/linux/generic/backport-6.6/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 2e70a47f1d..1c34069947 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .79 -LINUX_KERNEL_HASH-6.6.79 = 07a6f904470da1a099aa1683e3025a999dd82f2438f78b006b80c6ae2e9dfe8d +LINUX_VERSION-6.6 = .80 +LINUX_KERNEL_HASH-6.6.80 = 6cf911d01324f45c9dd2f44cf06f55bda0ecf383bc498f132a0c549768531327 diff --git a/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch b/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch index 51f4f542d8..91e39d7d24 100644 --- a/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch @@ -751,7 +751,7 @@ SVN-Revision: 35130 EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4262,14 +4262,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -4268,14 +4268,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/bcm27xx/patches-6.6/950-0025-drm-atomic-helpers-remove-legacy_cursor_update-hacks.patch b/target/linux/bcm27xx/patches-6.6/950-0025-drm-atomic-helpers-remove-legacy_cursor_update-hacks.patch index 97bc25b565..4c3ff50b8c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0025-drm-atomic-helpers-remove-legacy_cursor_update-hacks.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0025-drm-atomic-helpers-remove-legacy_cursor_update-hacks.patch @@ -89,7 +89,7 @@ Signed-off-by: Maxime Ripard commit->event = kzalloc(sizeof(*commit->event), --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c -@@ -7280,6 +7280,19 @@ int intel_atomic_commit(struct drm_devic +@@ -7298,6 +7298,19 @@ int intel_atomic_commit(struct drm_devic state->base.legacy_cursor_update = false; } diff --git a/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch b/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch index a6164c8238..afaa5328ca 100644 --- a/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch +++ b/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch @@ -32,7 +32,7 @@ Signed-off-by: Paolo Abeni --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4483,13 +4483,7 @@ static inline void ____napi_schedule(str +@@ -4514,13 +4514,7 @@ static inline void ____napi_schedule(str */ thread = READ_ONCE(napi->thread); if (thread) { @@ -47,7 +47,7 @@ Signed-off-by: Paolo Abeni wake_up_process(thread); return; } -@@ -6645,8 +6639,6 @@ static int napi_poll(struct napi_struct +@@ -6676,8 +6670,6 @@ static int napi_poll(struct napi_struct static int napi_thread_wait(struct napi_struct *napi) { @@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni set_current_state(TASK_INTERRUPTIBLE); while (!kthread_should_stop()) { -@@ -6655,15 +6647,13 @@ static int napi_thread_wait(struct napi_ +@@ -6686,15 +6678,13 @@ static int napi_thread_wait(struct napi_ * Testing SCHED bit is not enough because SCHED bit might be * set by some other busy poll thread or by napi_disable(). */ diff --git a/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch b/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch index 3de258f953..98cd35ed84 100644 --- a/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch +++ b/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch @@ -108,7 +108,7 @@ Signed-off-by: Paolo Abeni static inline void rps_lock_irqsave(struct softnet_data *sd, unsigned long *flags) { -@@ -4451,6 +4477,7 @@ EXPORT_SYMBOL(__dev_direct_xmit); +@@ -4482,6 +4508,7 @@ EXPORT_SYMBOL(__dev_direct_xmit); /************************************************************************* * Receiver routines *************************************************************************/ @@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni int netdev_max_backlog __read_mostly = 1000; EXPORT_SYMBOL(netdev_max_backlog); -@@ -4483,12 +4510,16 @@ static inline void ____napi_schedule(str +@@ -4514,12 +4541,16 @@ static inline void ____napi_schedule(str */ thread = READ_ONCE(napi->thread); if (thread) { @@ -133,7 +133,7 @@ Signed-off-by: Paolo Abeni list_add_tail(&napi->poll_list, &sd->poll_list); WRITE_ONCE(napi->list_owner, smp_processor_id()); /* If not called from net_rx_action() -@@ -4734,6 +4765,11 @@ static void napi_schedule_rps(struct sof +@@ -4765,6 +4796,11 @@ static void napi_schedule_rps(struct sof #ifdef CONFIG_RPS if (sd != mysd) { @@ -145,7 +145,7 @@ Signed-off-by: Paolo Abeni sd->rps_ipi_next = mysd->rps_ipi_list; mysd->rps_ipi_list = sd; -@@ -5957,7 +5993,7 @@ static void net_rps_action_and_irq_enabl +@@ -5988,7 +6024,7 @@ static void net_rps_action_and_irq_enabl #ifdef CONFIG_RPS struct softnet_data *remsd = sd->rps_ipi_list; @@ -154,7 +154,7 @@ Signed-off-by: Paolo Abeni sd->rps_ipi_list = NULL; local_irq_enable(); -@@ -5972,7 +6008,7 @@ static void net_rps_action_and_irq_enabl +@@ -6003,7 +6039,7 @@ static void net_rps_action_and_irq_enabl static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) { #ifdef CONFIG_RPS @@ -163,7 +163,7 @@ Signed-off-by: Paolo Abeni #else return false; #endif -@@ -6016,7 +6052,7 @@ static int process_backlog(struct napi_s +@@ -6047,7 +6083,7 @@ static int process_backlog(struct napi_s * We can use a plain write instead of clear_bit(), * and we dont need an smp_mb() memory barrier. */ @@ -172,7 +172,7 @@ Signed-off-by: Paolo Abeni again = false; } else { skb_queue_splice_tail_init(&sd->input_pkt_queue, -@@ -6682,43 +6718,48 @@ static void skb_defer_free_flush(struct +@@ -6713,43 +6749,48 @@ static void skb_defer_free_flush(struct } } @@ -250,7 +250,7 @@ Signed-off-by: Paolo Abeni return 0; } -@@ -11303,7 +11344,7 @@ static int dev_cpu_dead(unsigned int old +@@ -11334,7 +11375,7 @@ static int dev_cpu_dead(unsigned int old list_del_init(&napi->poll_list); if (napi->poll == process_backlog) @@ -259,7 +259,7 @@ Signed-off-by: Paolo Abeni else ____napi_schedule(sd, napi); } -@@ -11311,12 +11352,14 @@ static int dev_cpu_dead(unsigned int old +@@ -11342,12 +11383,14 @@ static int dev_cpu_dead(unsigned int old raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); @@ -278,7 +278,7 @@ Signed-off-by: Paolo Abeni /* Process offline CPU's input_pkt_queue */ while ((skb = __skb_dequeue(&oldsd->process_queue))) { -@@ -11579,6 +11622,38 @@ static struct pernet_operations __net_in +@@ -11610,6 +11653,38 @@ static struct pernet_operations __net_in * */ @@ -317,7 +317,7 @@ Signed-off-by: Paolo Abeni /* * This is called single threaded during boot, so no need * to take the rtnl semaphore. -@@ -11629,7 +11704,10 @@ static int __init net_dev_init(void) +@@ -11660,7 +11735,10 @@ static int __init net_dev_init(void) init_gro_hash(&sd->backlog); sd->backlog.poll = process_backlog; sd->backlog.weight = weight_p; diff --git a/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch b/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch index 9af345002a..d38231684d 100644 --- a/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch +++ b/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch @@ -36,7 +36,7 @@ Signed-off-by: Paolo Abeni --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -3306,6 +3306,7 @@ static inline void dev_xmit_recursion_de +@@ -3308,6 +3308,7 @@ static inline void dev_xmit_recursion_de __this_cpu_dec(softnet_data.xmit.recursion); } @@ -82,7 +82,7 @@ Signed-off-by: Paolo Abeni spin_unlock_irq(&sd->input_pkt_queue.lock); else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) local_irq_enable(); -@@ -4784,6 +4784,23 @@ static void napi_schedule_rps(struct sof +@@ -4815,6 +4815,23 @@ static void napi_schedule_rps(struct sof __napi_schedule_irqoff(&mysd->backlog); } diff --git a/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch b/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch index a6199cd250..33ebe5d2a6 100644 --- a/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch +++ b/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch @@ -67,7 +67,7 @@ Signed-off-by: Paolo Abeni { if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) spin_unlock_irq(&sd->input_pkt_queue.lock); -@@ -4789,12 +4789,12 @@ void kick_defer_list_purge(struct softne +@@ -4820,12 +4820,12 @@ void kick_defer_list_purge(struct softne unsigned long flags; if (use_backlog_threads()) { @@ -82,7 +82,7 @@ Signed-off-by: Paolo Abeni } else if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) { smp_call_function_single_async(cpu, &sd->defer_csd); -@@ -4856,7 +4856,7 @@ static int enqueue_to_backlog(struct sk_ +@@ -4887,7 +4887,7 @@ static int enqueue_to_backlog(struct sk_ reason = SKB_DROP_REASON_NOT_SPECIFIED; sd = &per_cpu(softnet_data, cpu); @@ -91,7 +91,7 @@ Signed-off-by: Paolo Abeni if (!netif_running(skb->dev)) goto drop; qlen = skb_queue_len(&sd->input_pkt_queue); -@@ -4865,7 +4865,7 @@ static int enqueue_to_backlog(struct sk_ +@@ -4896,7 +4896,7 @@ static int enqueue_to_backlog(struct sk_ enqueue: __skb_queue_tail(&sd->input_pkt_queue, skb); input_queue_tail_incr_save(sd, qtail); @@ -100,7 +100,7 @@ Signed-off-by: Paolo Abeni return NET_RX_SUCCESS; } -@@ -4880,7 +4880,7 @@ enqueue: +@@ -4911,7 +4911,7 @@ enqueue: drop: sd->dropped++; @@ -109,7 +109,7 @@ Signed-off-by: Paolo Abeni dev_core_stats_rx_dropped_inc(skb->dev); kfree_skb_reason(skb, reason); -@@ -5911,7 +5911,7 @@ static void flush_backlog(struct work_st +@@ -5942,7 +5942,7 @@ static void flush_backlog(struct work_st local_bh_disable(); sd = this_cpu_ptr(&softnet_data); @@ -118,7 +118,7 @@ Signed-off-by: Paolo Abeni skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->input_pkt_queue); -@@ -5919,7 +5919,7 @@ static void flush_backlog(struct work_st +@@ -5950,7 +5950,7 @@ static void flush_backlog(struct work_st input_queue_head_incr(sd); } } @@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { -@@ -5937,14 +5937,14 @@ static bool flush_required(int cpu) +@@ -5968,14 +5968,14 @@ static bool flush_required(int cpu) struct softnet_data *sd = &per_cpu(softnet_data, cpu); bool do_flush; @@ -144,7 +144,7 @@ Signed-off-by: Paolo Abeni return do_flush; #endif -@@ -6059,7 +6059,7 @@ static int process_backlog(struct napi_s +@@ -6090,7 +6090,7 @@ static int process_backlog(struct napi_s } @@ -153,7 +153,7 @@ Signed-off-by: Paolo Abeni if (skb_queue_empty(&sd->input_pkt_queue)) { /* * Inline a custom version of __napi_complete(). -@@ -6075,7 +6075,7 @@ static int process_backlog(struct napi_s +@@ -6106,7 +6106,7 @@ static int process_backlog(struct napi_s skb_queue_splice_tail_init(&sd->input_pkt_queue, &sd->process_queue); } diff --git a/target/linux/generic/backport-6.6/611-02-v6.11-net-Make-USO-depend-on-CSUM-offload.patch b/target/linux/generic/backport-6.6/611-02-v6.11-net-Make-USO-depend-on-CSUM-offload.patch index 6cd162ff1c..0ccf0e30d6 100644 --- a/target/linux/generic/backport-6.6/611-02-v6.11-net-Make-USO-depend-on-CSUM-offload.patch +++ b/target/linux/generic/backport-6.6/611-02-v6.11-net-Make-USO-depend-on-CSUM-offload.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -9765,6 +9765,15 @@ static void netdev_sync_lower_features(s +@@ -9796,6 +9796,15 @@ static void netdev_sync_lower_features(s } } @@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski static netdev_features_t netdev_fix_features(struct net_device *dev, netdev_features_t features) { -@@ -9846,15 +9855,9 @@ static netdev_features_t netdev_fix_feat +@@ -9877,15 +9886,9 @@ static netdev_features_t netdev_fix_feat features &= ~NETIF_F_LRO; } @@ -55,7 +55,7 @@ Signed-off-by: Jakub Kicinski } if ((features & NETIF_F_HW_TLS_RX) && !(features & NETIF_F_RXCSUM)) { -@@ -9862,6 +9865,11 @@ static netdev_features_t netdev_fix_feat +@@ -9893,6 +9896,11 @@ static netdev_features_t netdev_fix_feat features &= ~NETIF_F_HW_TLS_RX; } diff --git a/target/linux/generic/backport-6.6/612-v6.9-net-get-stats64-if-device-if-driver-is-configured.patch b/target/linux/generic/backport-6.6/612-v6.9-net-get-stats64-if-device-if-driver-is-configured.patch index 21ba0acc5b..c27ccc1942 100644 --- a/target/linux/generic/backport-6.6/612-v6.9-net-get-stats64-if-device-if-driver-is-configured.patch +++ b/target/linux/generic/backport-6.6/612-v6.9-net-get-stats64-if-device-if-driver-is-configured.patch @@ -18,7 +18,7 @@ Signed-off-by: Paolo Abeni --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -10672,6 +10672,8 @@ struct rtnl_link_stats64 *dev_get_stats( +@@ -10703,6 +10703,8 @@ struct rtnl_link_stats64 *dev_get_stats( ops->ndo_get_stats64(dev, storage); } else if (ops->ndo_get_stats) { netdev_stats_to_stats64(storage, ops->ndo_get_stats(dev)); diff --git a/target/linux/generic/backport-6.6/700-v6.10-net-create-a-dummy-net_device-allocator.patch b/target/linux/generic/backport-6.6/700-v6.10-net-create-a-dummy-net_device-allocator.patch index 8b562a0f61..dd0640e2ee 100644 --- a/target/linux/generic/backport-6.6/700-v6.10-net-create-a-dummy-net_device-allocator.patch +++ b/target/linux/generic/backport-6.6/700-v6.10-net-create-a-dummy-net_device-allocator.patch @@ -37,7 +37,7 @@ Signed-off-by: David S. Miller --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -4567,6 +4567,9 @@ static inline void netif_addr_unlock_bh( +@@ -4569,6 +4569,9 @@ static inline void netif_addr_unlock_bh( void ether_setup(struct net_device *dev); @@ -49,7 +49,7 @@ Signed-off-by: David S. Miller unsigned char name_assign_type, --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -10359,25 +10359,12 @@ err_free_name: +@@ -10390,25 +10390,12 @@ err_free_name: } EXPORT_SYMBOL(register_netdevice); @@ -79,7 +79,7 @@ Signed-off-by: David S. Miller /* make sure we BUG if trying to hit standard * register/unregister code path */ -@@ -10397,12 +10384,32 @@ int init_dummy_netdev(struct net_device +@@ -10428,12 +10415,32 @@ int init_dummy_netdev(struct net_device * because users of this 'device' dont need to change * its refcount. */ @@ -113,7 +113,7 @@ Signed-off-by: David S. Miller /** * register_netdev - register a network device * @dev: device to register -@@ -10996,6 +11003,19 @@ void free_netdev(struct net_device *dev) +@@ -11027,6 +11034,19 @@ void free_netdev(struct net_device *dev) EXPORT_SYMBOL(free_netdev); /** diff --git a/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch b/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch index 2bf136e18a..319bc3e47b 100644 --- a/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch +++ b/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch @@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni /** --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6612,7 +6612,7 @@ static int __napi_poll(struct napi_struc +@@ -6643,7 +6643,7 @@ static int __napi_poll(struct napi_struc * accidentally calling ->poll() when NAPI is not scheduled. */ work = 0; diff --git a/target/linux/generic/backport-6.6/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch b/target/linux/generic/backport-6.6/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch index 36d15248b8..9c22568f72 100644 --- a/target/linux/generic/backport-6.6/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch +++ b/target/linux/generic/backport-6.6/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch @@ -48,7 +48,7 @@ Signed-off-by: Greg Kroah-Hartman mtd->nvmem = nvmem_register(&config); --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -940,7 +940,7 @@ struct nvmem_device *nvmem_register(cons +@@ -918,7 +918,7 @@ struct nvmem_device *nvmem_register(cons nvmem->nkeepout = config->nkeepout; if (config->of_node) nvmem->dev.of_node = config->of_node; @@ -59,7 +59,7 @@ Signed-off-by: Greg Kroah-Hartman switch (config->id) { --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h -@@ -89,7 +89,6 @@ struct nvmem_cell_info { +@@ -91,7 +91,6 @@ struct nvmem_cell_info { * @read_only: Device is read-only. * @root_only: Device is accessibly to root only. * @of_node: If given, this will be used instead of the parent's of_node. @@ -67,7 +67,7 @@ Signed-off-by: Greg Kroah-Hartman * @reg_read: Callback to read data. * @reg_write: Callback to write data. * @size: Device size. -@@ -122,7 +121,6 @@ struct nvmem_config { +@@ -126,7 +125,6 @@ struct nvmem_config { bool ignore_wp; struct nvmem_layout *layout; struct device_node *of_node; diff --git a/target/linux/generic/backport-6.6/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch b/target/linux/generic/backport-6.6/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch index 0290d64898..c1f5ecf665 100644 --- a/target/linux/generic/backport-6.6/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch +++ b/target/linux/generic/backport-6.6/819-v6.8-0001-nvmem-Move-of_nvmem_layout_get_container-in-another-.patch @@ -25,7 +25,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -846,14 +846,6 @@ static int nvmem_add_cells_from_layout(s +@@ -823,14 +823,6 @@ static int nvmem_add_cells_from_layout(s } #if IS_ENABLED(CONFIG_OF) @@ -65,7 +65,7 @@ Signed-off-by: Greg Kroah-Hartman #endif /* ifndef _LINUX_NVMEM_CONSUMER_H */ --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h -@@ -244,6 +244,27 @@ nvmem_layout_get_match_data(struct nvmem +@@ -241,6 +241,27 @@ nvmem_layout_get_match_data(struct nvmem #endif /* CONFIG_NVMEM */ diff --git a/target/linux/generic/backport-6.6/819-v6.8-0002-nvmem-Create-a-header-for-internal-sharing.patch b/target/linux/generic/backport-6.6/819-v6.8-0002-nvmem-Create-a-header-for-internal-sharing.patch deleted file mode 100644 index b03ce68092..0000000000 --- a/target/linux/generic/backport-6.6/819-v6.8-0002-nvmem-Create-a-header-for-internal-sharing.patch +++ /dev/null @@ -1,91 +0,0 @@ -From ec9c08a1cb8dc5e8e003f95f5f62de41dde235bb Mon Sep 17 00:00:00 2001 -From: Miquel Raynal -Date: Fri, 15 Dec 2023 11:15:29 +0000 -Subject: [PATCH] nvmem: Create a header for internal sharing - -Before adding all the NVMEM layout bus infrastructure to the core, let's -move the main nvmem_device structure in an internal header, only -available to the core. This way all the additional code can be added in -a dedicated file in order to keep the current core file tidy. - -Signed-off-by: Miquel Raynal -Signed-off-by: Srinivas Kandagatla -Link: https://lore.kernel.org/r/20231215111536.316972-4-srinivas.kandagatla@linaro.org -Signed-off-by: Greg Kroah-Hartman ---- - drivers/nvmem/core.c | 24 +----------------------- - drivers/nvmem/internals.h | 35 +++++++++++++++++++++++++++++++++++ - 2 files changed, 36 insertions(+), 23 deletions(-) - create mode 100644 drivers/nvmem/internals.h - ---- a/drivers/nvmem/core.c -+++ b/drivers/nvmem/core.c -@@ -19,29 +19,7 @@ - #include - #include - --struct nvmem_device { -- struct module *owner; -- struct device dev; -- int stride; -- int word_size; -- int id; -- struct kref refcnt; -- size_t size; -- bool read_only; -- bool root_only; -- int flags; -- enum nvmem_type type; -- struct bin_attribute eeprom; -- struct device *base_dev; -- struct list_head cells; -- const struct nvmem_keepout *keepout; -- unsigned int nkeepout; -- nvmem_reg_read_t reg_read; -- nvmem_reg_write_t reg_write; -- struct gpio_desc *wp_gpio; -- struct nvmem_layout *layout; -- void *priv; --}; -+#include "internals.h" - - #define to_nvmem_device(d) container_of(d, struct nvmem_device, dev) - ---- /dev/null -+++ b/drivers/nvmem/internals.h -@@ -0,0 +1,35 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+ -+#ifndef _LINUX_NVMEM_INTERNALS_H -+#define _LINUX_NVMEM_INTERNALS_H -+ -+#include -+#include -+#include -+ -+struct nvmem_device { -+ struct module *owner; -+ struct device dev; -+ struct list_head node; -+ int stride; -+ int word_size; -+ int id; -+ struct kref refcnt; -+ size_t size; -+ bool read_only; -+ bool root_only; -+ int flags; -+ enum nvmem_type type; -+ struct bin_attribute eeprom; -+ struct device *base_dev; -+ struct list_head cells; -+ const struct nvmem_keepout *keepout; -+ unsigned int nkeepout; -+ nvmem_reg_read_t reg_read; -+ nvmem_reg_write_t reg_write; -+ struct gpio_desc *wp_gpio; -+ struct nvmem_layout *layout; -+ void *priv; -+}; -+ -+#endif /* ifndef _LINUX_NVMEM_INTERNALS_H */ diff --git a/target/linux/generic/backport-6.6/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch b/target/linux/generic/backport-6.6/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch deleted file mode 100644 index dac691e117..0000000000 --- a/target/linux/generic/backport-6.6/819-v6.8-0003-nvmem-Simplify-the-add_cells-hook.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 1b7c298a4ecbc28cc6ee94005734bff55eb83d22 Mon Sep 17 00:00:00 2001 -From: Miquel Raynal -Date: Fri, 15 Dec 2023 11:15:30 +0000 -Subject: [PATCH] nvmem: Simplify the ->add_cells() hook - -The layout entry is not used and will anyway be made useless by the new -layout bus infrastructure coming next, so drop it. While at it, clarify -the kdoc entry. - -Signed-off-by: Miquel Raynal -Signed-off-by: Srinivas Kandagatla -Link: https://lore.kernel.org/r/20231215111536.316972-5-srinivas.kandagatla@linaro.org -Signed-off-by: Greg Kroah-Hartman ---- - drivers/nvmem/core.c | 2 +- - drivers/nvmem/layouts/onie-tlv.c | 3 +-- - drivers/nvmem/layouts/sl28vpd.c | 3 +-- - include/linux/nvmem-provider.h | 8 +++----- - 4 files changed, 6 insertions(+), 10 deletions(-) - ---- a/drivers/nvmem/core.c -+++ b/drivers/nvmem/core.c -@@ -815,7 +815,7 @@ static int nvmem_add_cells_from_layout(s - int ret; - - if (layout && layout->add_cells) { -- ret = layout->add_cells(&nvmem->dev, nvmem, layout); -+ ret = layout->add_cells(&nvmem->dev, nvmem); - if (ret) - return ret; - } ---- a/drivers/nvmem/layouts/onie-tlv.c -+++ b/drivers/nvmem/layouts/onie-tlv.c -@@ -182,8 +182,7 @@ static bool onie_tlv_crc_is_valid(struct - return true; - } - --static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem, -- struct nvmem_layout *layout) -+static int onie_tlv_parse_table(struct device *dev, struct nvmem_device *nvmem) - { - struct onie_tlv_hdr hdr; - size_t table_len, data_len, hdr_len; ---- a/drivers/nvmem/layouts/sl28vpd.c -+++ b/drivers/nvmem/layouts/sl28vpd.c -@@ -80,8 +80,7 @@ static int sl28vpd_v1_check_crc(struct d - return 0; - } - --static int sl28vpd_add_cells(struct device *dev, struct nvmem_device *nvmem, -- struct nvmem_layout *layout) -+static int sl28vpd_add_cells(struct device *dev, struct nvmem_device *nvmem) - { - const struct nvmem_cell_info *pinfo; - struct nvmem_cell_info info = {0}; ---- a/include/linux/nvmem-provider.h -+++ b/include/linux/nvmem-provider.h -@@ -156,9 +156,8 @@ struct nvmem_cell_table { - * - * @name: Layout name. - * @of_match_table: Open firmware match table. -- * @add_cells: Will be called if a nvmem device is found which -- * has this layout. The function will add layout -- * specific cells with nvmem_add_one_cell(). -+ * @add_cells: Called to populate the layout using -+ * nvmem_add_one_cell(). - * @fixup_cell_info: Will be called before a cell is added. Can be - * used to modify the nvmem_cell_info. - * @owner: Pointer to struct module. -@@ -172,8 +171,7 @@ struct nvmem_cell_table { - struct nvmem_layout { - const char *name; - const struct of_device_id *of_match_table; -- int (*add_cells)(struct device *dev, struct nvmem_device *nvmem, -- struct nvmem_layout *layout); -+ int (*add_cells)(struct device *dev, struct nvmem_device *nvmem); - void (*fixup_cell_info)(struct nvmem_device *nvmem, - struct nvmem_layout *layout, - struct nvmem_cell_info *cell); diff --git a/target/linux/generic/backport-6.6/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch b/target/linux/generic/backport-6.6/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch deleted file mode 100644 index 0a614fc13d..0000000000 --- a/target/linux/generic/backport-6.6/819-v6.8-0004-nvmem-Move-and-rename-fixup_cell_info.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 1172460e716784ac7e1049a537bdca8edbf97360 Mon Sep 17 00:00:00 2001 -From: Miquel Raynal -Date: Fri, 15 Dec 2023 11:15:31 +0000 -Subject: [PATCH] nvmem: Move and rename ->fixup_cell_info() - -This hook is meant to be used by any provider and instantiating a layout -just for this is useless. Let's instead move this hook to the nvmem -device and add it to the config structure to be easily shared by the -providers. - -While at moving this hook, rename it ->fixup_dt_cell_info() to clarify -its main intended purpose. - -Signed-off-by: Miquel Raynal -Signed-off-by: Srinivas Kandagatla -Link: https://lore.kernel.org/r/20231215111536.316972-6-srinivas.kandagatla@linaro.org -Signed-off-by: Greg Kroah-Hartman ---- - drivers/nvmem/core.c | 6 +++--- - drivers/nvmem/imx-ocotp.c | 11 +++-------- - drivers/nvmem/internals.h | 2 ++ - drivers/nvmem/mtk-efuse.c | 11 +++-------- - include/linux/nvmem-provider.h | 9 ++++----- - 5 files changed, 15 insertions(+), 24 deletions(-) - ---- a/drivers/nvmem/core.c -+++ b/drivers/nvmem/core.c -@@ -674,7 +674,6 @@ static int nvmem_validate_keepouts(struc - - static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np) - { -- struct nvmem_layout *layout = nvmem->layout; - struct device *dev = &nvmem->dev; - struct device_node *child; - const __be32 *addr; -@@ -704,8 +703,8 @@ static int nvmem_add_cells_from_dt(struc - - info.np = of_node_get(child); - -- if (layout && layout->fixup_cell_info) -- layout->fixup_cell_info(nvmem, layout, &info); -+ if (nvmem->fixup_dt_cell_info) -+ nvmem->fixup_dt_cell_info(nvmem, &info); - - ret = nvmem_add_one_cell(nvmem, &info); - kfree(info.name); -@@ -894,6 +893,7 @@ struct nvmem_device *nvmem_register(cons - - kref_init(&nvmem->refcnt); - INIT_LIST_HEAD(&nvmem->cells); -+ nvmem->fixup_dt_cell_info = config->fixup_dt_cell_info; - - nvmem->owner = config->owner; - if (!nvmem->owner && config->dev->driver) ---- a/drivers/nvmem/imx-ocotp.c -+++ b/drivers/nvmem/imx-ocotp.c -@@ -583,17 +583,12 @@ static const struct of_device_id imx_oco - }; - MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids); - --static void imx_ocotp_fixup_cell_info(struct nvmem_device *nvmem, -- struct nvmem_layout *layout, -- struct nvmem_cell_info *cell) -+static void imx_ocotp_fixup_dt_cell_info(struct nvmem_device *nvmem, -+ struct nvmem_cell_info *cell) - { - cell->read_post_process = imx_ocotp_cell_pp; - } - --static struct nvmem_layout imx_ocotp_layout = { -- .fixup_cell_info = imx_ocotp_fixup_cell_info, --}; -- - static int imx_ocotp_probe(struct platform_device *pdev) - { - struct device *dev = &pdev->dev; -@@ -619,7 +614,7 @@ static int imx_ocotp_probe(struct platfo - imx_ocotp_nvmem_config.size = 4 * priv->params->nregs; - imx_ocotp_nvmem_config.dev = dev; - imx_ocotp_nvmem_config.priv = priv; -- imx_ocotp_nvmem_config.layout = &imx_ocotp_layout; -+ imx_ocotp_nvmem_config.fixup_dt_cell_info = &imx_ocotp_fixup_dt_cell_info; - - priv->config = &imx_ocotp_nvmem_config; - ---- a/drivers/nvmem/internals.h -+++ b/drivers/nvmem/internals.h -@@ -23,6 +23,8 @@ struct nvmem_device { - struct bin_attribute eeprom; - struct device *base_dev; - struct list_head cells; -+ void (*fixup_dt_cell_info)(struct nvmem_device *nvmem, -+ struct nvmem_cell_info *cell); - const struct nvmem_keepout *keepout; - unsigned int nkeepout; - nvmem_reg_read_t reg_read; ---- a/drivers/nvmem/mtk-efuse.c -+++ b/drivers/nvmem/mtk-efuse.c -@@ -45,9 +45,8 @@ static int mtk_efuse_gpu_speedbin_pp(voi - return 0; - } - --static void mtk_efuse_fixup_cell_info(struct nvmem_device *nvmem, -- struct nvmem_layout *layout, -- struct nvmem_cell_info *cell) -+static void mtk_efuse_fixup_dt_cell_info(struct nvmem_device *nvmem, -+ struct nvmem_cell_info *cell) - { - size_t sz = strlen(cell->name); - -@@ -61,10 +60,6 @@ static void mtk_efuse_fixup_cell_info(st - cell->read_post_process = mtk_efuse_gpu_speedbin_pp; - } - --static struct nvmem_layout mtk_efuse_layout = { -- .fixup_cell_info = mtk_efuse_fixup_cell_info, --}; -- - static int mtk_efuse_probe(struct platform_device *pdev) - { - struct device *dev = &pdev->dev; -@@ -91,7 +86,7 @@ static int mtk_efuse_probe(struct platfo - econfig.priv = priv; - econfig.dev = dev; - if (pdata->uses_post_processing) -- econfig.layout = &mtk_efuse_layout; -+ econfig.fixup_dt_cell_info = &mtk_efuse_fixup_dt_cell_info; - nvmem = devm_nvmem_register(dev, &econfig); - - return PTR_ERR_OR_ZERO(nvmem); ---- a/include/linux/nvmem-provider.h -+++ b/include/linux/nvmem-provider.h -@@ -83,6 +83,8 @@ struct nvmem_cell_info { - * @cells: Optional array of pre-defined NVMEM cells. - * @ncells: Number of elements in cells. - * @add_legacy_fixed_of_cells: Read fixed NVMEM cells from old OF syntax. -+ * @fixup_dt_cell_info: Will be called before a cell is added. Can be -+ * used to modify the nvmem_cell_info. - * @keepout: Optional array of keepout ranges (sorted ascending by start). - * @nkeepout: Number of elements in the keepout array. - * @type: Type of the nvmem storage -@@ -113,6 +115,8 @@ struct nvmem_config { - const struct nvmem_cell_info *cells; - int ncells; - bool add_legacy_fixed_of_cells; -+ void (*fixup_dt_cell_info)(struct nvmem_device *nvmem, -+ struct nvmem_cell_info *cell); - const struct nvmem_keepout *keepout; - unsigned int nkeepout; - enum nvmem_type type; -@@ -158,8 +162,6 @@ struct nvmem_cell_table { - * @of_match_table: Open firmware match table. - * @add_cells: Called to populate the layout using - * nvmem_add_one_cell(). -- * @fixup_cell_info: Will be called before a cell is added. Can be -- * used to modify the nvmem_cell_info. - * @owner: Pointer to struct module. - * @node: List node. - * -@@ -172,9 +174,6 @@ struct nvmem_layout { - const char *name; - const struct of_device_id *of_match_table; - int (*add_cells)(struct device *dev, struct nvmem_device *nvmem); -- void (*fixup_cell_info)(struct nvmem_device *nvmem, -- struct nvmem_layout *layout, -- struct nvmem_cell_info *cell); - - /* private */ - struct module *owner; diff --git a/target/linux/generic/backport-6.6/823-v6.12-0001-nvmem-imx-ocotp-ele-support-i.MX95.patch b/target/linux/generic/backport-6.6/823-v6.12-0001-nvmem-imx-ocotp-ele-support-i.MX95.patch index b96134e315..de965e1ccd 100644 --- a/target/linux/generic/backport-6.6/823-v6.12-0001-nvmem-imx-ocotp-ele-support-i.MX95.patch +++ b/target/linux/generic/backport-6.6/823-v6.12-0001-nvmem-imx-ocotp-ele-support-i.MX95.patch @@ -40,7 +40,7 @@ Signed-off-by: Greg Kroah-Hartman } memcpy(val, ((u8 *)p) + skipbytes, bytes); -@@ -157,8 +161,30 @@ static const struct ocotp_devtype_data i +@@ -179,8 +183,30 @@ static const struct ocotp_devtype_data i }, }; diff --git a/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch b/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch index b3a592f078..8f63a7a0df 100644 --- a/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch +++ b/target/linux/generic/backport-6.6/900-v6.11-net-free_netdev-exit-earlier-if-dummy.patch @@ -23,7 +23,7 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -10989,7 +10989,8 @@ void free_netdev(struct net_device *dev) +@@ -11020,7 +11020,8 @@ void free_netdev(struct net_device *dev) dev->xdp_bulkq = NULL; /* Compatibility with error handling in drivers */ diff --git a/target/linux/generic/hack-6.6/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-6.6/721-net-add-packet-mangeling.patch index e1d4367a8f..0935a0b9c0 100644 --- a/target/linux/generic/hack-6.6/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-6.6/721-net-add-packet-mangeling.patch @@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3597,6 +3597,11 @@ static int xmit_one(struct sk_buff *skb, +@@ -3628,6 +3628,11 @@ static int xmit_one(struct sk_buff *skb, if (dev_nit_active(dev)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/pending-6.6/680-net-add-TCP-fraglist-GRO-support.patch b/target/linux/generic/pending-6.6/680-net-add-TCP-fraglist-GRO-support.patch index b810e7ec91..ca7c624447 100644 --- a/target/linux/generic/pending-6.6/680-net-add-TCP-fraglist-GRO-support.patch +++ b/target/linux/generic/pending-6.6/680-net-add-TCP-fraglist-GRO-support.patch @@ -31,7 +31,7 @@ Signe-off-by: Felix Fietkau static inline void gro_normal_list(struct napi_struct *napi) --- a/include/net/tcp.h +++ b/include/net/tcp.h -@@ -2084,7 +2084,10 @@ void tcp_v4_destroy_sock(struct sock *sk +@@ -2101,7 +2101,10 @@ void tcp_v4_destroy_sock(struct sock *sk struct sk_buff *tcp_gso_segment(struct sk_buff *skb, netdev_features_t features); diff --git a/target/linux/ipq40xx/patches-6.6/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch b/target/linux/ipq40xx/patches-6.6/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch index 9df758ae1b..747ba7f285 100644 --- a/target/linux/ipq40xx/patches-6.6/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch +++ b/target/linux/ipq40xx/patches-6.6/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch @@ -57,7 +57,7 @@ Signed-off-by: Bjorn Andersson static int __qcom_scm_set_dload_mode(struct device *dev, bool enable) { struct qcom_scm_desc desc = { -@@ -1473,6 +1496,13 @@ static int qcom_scm_probe(struct platfor +@@ -1474,6 +1497,13 @@ static int qcom_scm_probe(struct platfor __get_convention(); diff --git a/target/linux/ipq40xx/patches-6.6/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch b/target/linux/ipq40xx/patches-6.6/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch index 26cd0e0309..ab56c24a4d 100644 --- a/target/linux/ipq40xx/patches-6.6/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch +++ b/target/linux/ipq40xx/patches-6.6/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch @@ -15,7 +15,7 @@ Signed-off-by: Robert Marko --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -1528,7 +1528,8 @@ static int qcom_scm_probe(struct platfor +@@ -1529,7 +1529,8 @@ static int qcom_scm_probe(struct platfor static void qcom_scm_shutdown(struct platform_device *pdev) { /* Clean shutdown, disable download mode to allow normal restart */ diff --git a/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch b/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch index 56b638aa36..916f08ac5d 100644 --- a/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch +++ b/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch @@ -234,7 +234,7 @@ Signed-off-by: John Crispin /* Format flags */ #define UVC_FMT_FLAG_COMPRESSED 0x00000001 -@@ -587,6 +589,7 @@ struct uvc_device { +@@ -591,6 +593,7 @@ struct uvc_device { struct input_dev *input; char input_phys[64]; From 0fb8d7bc731a96beb1201ba6c6fd13909d50cc36 Mon Sep 17 00:00:00 2001 From: John Audia Date: Fri, 7 Mar 2025 15:17:22 -0500 Subject: [PATCH 14/15] kernel: bump 6.6 to 6.6.81 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.81 All patches automatically rebased. For x86, CONFIG_MICROCODE_LATE_FORCE_MINREV was introduced in this bump with hrecommendation to enable it[1]. 1. https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/arch/x86/Kconfig?id=v6.6.81&id2=v6.6.80 Build system: x86/64 Build-tested: bcm27xx/bcm2712, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: bcm27xx/bcm2712, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/18188 (cherry picked from commit aabc61d93f89bf3253bad98fd2fe8d5450c352bf) Link: https://github.com/openwrt/openwrt/pull/18208 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 ++-- ...all-the-downstream-rpi-sound-card-dr.patch | 2 +- ...-net-macb-Also-set-DMA-coherent-mask.patch | 24 +++++++++---------- ...port-for-Raspberry-Pi-RP1-ethernet-c.patch | 4 ++-- ...-rockchip-Fix-typo-in-function-names.patch | 2 +- target/linux/x86/config-6.6 | 1 + 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 1c34069947..c5c29a5aad 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .80 -LINUX_KERNEL_HASH-6.6.80 = 6cf911d01324f45c9dd2f44cf06f55bda0ecf383bc498f132a0c549768531327 +LINUX_VERSION-6.6 = .81 +LINUX_KERNEL_HASH-6.6.81 = af483828e67f1b9918bc438d789cdbb06c13a4d43a41d5f35d44c9a6d620318f diff --git a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch index 1d2f006258..56712a2b48 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch @@ -17583,7 +17583,7 @@ Signed-off-by: Phil Elwell * For devices with more than one control interface, we assume the --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c -@@ -2253,6 +2253,8 @@ static const struct usb_audio_quirk_flag +@@ -2254,6 +2254,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_ALIGN_TRANSFER), DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */ QUIRK_FLAG_ALIGN_TRANSFER), diff --git a/target/linux/bcm27xx/patches-6.6/950-0518-net-macb-Also-set-DMA-coherent-mask.patch b/target/linux/bcm27xx/patches-6.6/950-0518-net-macb-Also-set-DMA-coherent-mask.patch index cbfab3e4e6..9882230654 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0518-net-macb-Also-set-DMA-coherent-mask.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0518-net-macb-Also-set-DMA-coherent-mask.patch @@ -134,7 +134,7 @@ Signed-off-by: Jonathan Bell struct napi_struct napi_tx; dma_addr_t rx_ring_dma; -@@ -1285,9 +1304,15 @@ struct macb { +@@ -1287,9 +1306,15 @@ struct macb { u32 caps; unsigned int dma_burst_length; @@ -222,7 +222,7 @@ Signed-off-by: Jonathan Bell wmb(); // ensure softirq can see update } -@@ -2402,6 +2425,11 @@ static netdev_tx_t macb_start_xmit(struc +@@ -2404,6 +2427,11 @@ static netdev_tx_t macb_start_xmit(struc skb_tx_timestamp(skb); spin_lock_irq(&bp->lock); @@ -234,7 +234,7 @@ Signed-off-by: Jonathan Bell macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART)); spin_unlock_irq(&bp->lock); -@@ -2776,6 +2804,37 @@ static void macb_configure_dma(struct ma +@@ -2778,6 +2806,37 @@ static void macb_configure_dma(struct ma } } @@ -272,7 +272,7 @@ Signed-off-by: Jonathan Bell static void macb_init_hw(struct macb *bp) { u32 config; -@@ -2804,6 +2863,11 @@ static void macb_init_hw(struct macb *bp +@@ -2806,6 +2865,11 @@ static void macb_init_hw(struct macb *bp if (bp->caps & MACB_CAPS_JUMBO) bp->rx_frm_len_mask = MACB_RX_JFRMLEN_MASK; @@ -284,7 +284,7 @@ Signed-off-by: Jonathan Bell macb_configure_dma(bp); /* Enable RX partial store and forward and set watermark */ -@@ -3165,6 +3229,52 @@ static void gem_get_ethtool_strings(stru +@@ -3170,6 +3234,52 @@ static void gem_get_ethtool_strings(stru } } @@ -337,7 +337,7 @@ Signed-off-by: Jonathan Bell static struct net_device_stats *macb_get_stats(struct net_device *dev) { struct macb *bp = netdev_priv(dev); -@@ -3757,6 +3867,8 @@ static const struct ethtool_ops macb_eth +@@ -3764,6 +3874,8 @@ static const struct ethtool_ops macb_eth }; static const struct ethtool_ops gem_ethtool_ops = { @@ -346,7 +346,7 @@ Signed-off-by: Jonathan Bell .get_regs_len = macb_get_regs_len, .get_regs = macb_get_regs, .get_wol = macb_get_wol, -@@ -3766,6 +3878,8 @@ static const struct ethtool_ops gem_etht +@@ -3773,6 +3885,8 @@ static const struct ethtool_ops gem_etht .get_ethtool_stats = gem_get_ethtool_stats, .get_strings = gem_get_ethtool_strings, .get_sset_count = gem_get_sset_count, @@ -355,7 +355,7 @@ Signed-off-by: Jonathan Bell .get_link_ksettings = macb_get_link_ksettings, .set_link_ksettings = macb_set_link_ksettings, .get_ringparam = macb_get_ringparam, -@@ -5062,6 +5176,11 @@ static int macb_probe(struct platform_de +@@ -5069,6 +5183,11 @@ static int macb_probe(struct platform_de } } } @@ -365,9 +365,9 @@ Signed-off-by: Jonathan Bell + bp->use_aw2b_fill = device_property_read_bool(&pdev->dev, "cdns,use-aw2b-fill"); + spin_lock_init(&bp->lock); + spin_lock_init(&bp->stats_lock); - /* setup capabilities */ -@@ -5117,6 +5236,21 @@ static int macb_probe(struct platform_de +@@ -5125,6 +5244,21 @@ static int macb_probe(struct platform_de else bp->phy_interface = interface; @@ -389,7 +389,7 @@ Signed-off-by: Jonathan Bell /* IP specific init */ err = init(pdev); if (err) -@@ -5193,6 +5327,19 @@ static int macb_remove(struct platform_d +@@ -5201,6 +5335,19 @@ static int macb_remove(struct platform_d return 0; } @@ -409,7 +409,7 @@ Signed-off-by: Jonathan Bell static int __maybe_unused macb_suspend(struct device *dev) { struct net_device *netdev = dev_get_drvdata(dev); -@@ -5407,6 +5554,7 @@ static const struct dev_pm_ops macb_pm_o +@@ -5415,6 +5562,7 @@ static const struct dev_pm_ops macb_pm_o static struct platform_driver macb_driver = { .probe = macb_probe, .remove = macb_remove, diff --git a/target/linux/bcm27xx/patches-6.6/950-1423-net-macb-Add-support-for-Raspberry-Pi-RP1-ethernet-c.patch b/target/linux/bcm27xx/patches-6.6/950-1423-net-macb-Add-support-for-Raspberry-Pi-RP1-ethernet-c.patch index 6a9b7b36bd..c34d1c8720 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1423-net-macb-Add-support-for-Raspberry-Pi-RP1-ethernet-c.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1423-net-macb-Add-support-for-Raspberry-Pi-RP1-ethernet-c.patch @@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c -@@ -5023,6 +5023,17 @@ static const struct macb_config versal_c +@@ -5030,6 +5030,17 @@ static const struct macb_config versal_c .usrio = &macb_default_usrio, }; @@ -33,7 +33,7 @@ Signed-off-by: Dave Stevenson static const struct of_device_id macb_dt_ids[] = { { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config }, { .compatible = "cdns,macb" }, -@@ -5043,6 +5054,7 @@ static const struct of_device_id macb_dt +@@ -5050,6 +5061,7 @@ static const struct of_device_id macb_dt { .compatible = "microchip,mpfs-macb", .data = &mpfs_config }, { .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config }, { .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config }, diff --git a/target/linux/rockchip/patches-6.6/032-04-v6.10-phy-rockchip-Fix-typo-in-function-names.patch b/target/linux/rockchip/patches-6.6/032-04-v6.10-phy-rockchip-Fix-typo-in-function-names.patch index 9495dd2b10..08620d66ec 100644 --- a/target/linux/rockchip/patches-6.6/032-04-v6.10-phy-rockchip-Fix-typo-in-function-names.patch +++ b/target/linux/rockchip/patches-6.6/032-04-v6.10-phy-rockchip-Fix-typo-in-function-names.patch @@ -26,7 +26,7 @@ Signed-off-by: Vinod Koul .init = rockchip_combphy_init, .exit = rockchip_combphy_exit, .owner = THIS_MODULE, -@@ -364,7 +364,7 @@ static int rockchip_combphy_probe(struct +@@ -367,7 +367,7 @@ static int rockchip_combphy_probe(struct return ret; } diff --git a/target/linux/x86/config-6.6 b/target/linux/x86/config-6.6 index c416bb6a08..ad73334253 100644 --- a/target/linux/x86/config-6.6 +++ b/target/linux/x86/config-6.6 @@ -239,6 +239,7 @@ CONFIG_M686=y # CONFIG_MGEODEGX1 is not set # CONFIG_MGEODE_LX is not set CONFIG_MICROCODE=y +CONFIG_MICROCODE_LATE_FORCE_MINREV=y CONFIG_MICROCODE_LATE_LOADING=y CONFIG_MIGRATION=y CONFIG_MITIGATION_RFDS=y From 24db6154502a823c6c5bce6b790d2de85404888f Mon Sep 17 00:00:00 2001 From: John Audia Date: Sun, 9 Mar 2025 06:18:32 -0400 Subject: [PATCH 15/15] kernel: bump 6.6 to 6.6.82 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.82 All patches automatically rebased. Added CONFIG_MICROCODE_INITRD32=y to x86: config-6.6[1] 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/arch/x86/Kconfig?id=v6.6.82&id2=v6.6.81 Build system: x86/64 Build-tested: bcm27xx/bcm2712 Run-tested: bcm27xx/bcm2712 Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/18188 (cherry picked from commit 7cf8f61eb24c32bb47925cbd11f1cde68c9ba0b9) Link: https://github.com/openwrt/openwrt/pull/18208 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 ++-- target/linux/x86/config-6.6 | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index c5c29a5aad..7502edfd62 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .81 -LINUX_KERNEL_HASH-6.6.81 = af483828e67f1b9918bc438d789cdbb06c13a4d43a41d5f35d44c9a6d620318f +LINUX_VERSION-6.6 = .82 +LINUX_KERNEL_HASH-6.6.82 = f3c2389b8c23cabe747f104a3e434201ca6e7725bbbfb3a8c59a063ac4820e41 diff --git a/target/linux/x86/config-6.6 b/target/linux/x86/config-6.6 index ad73334253..2b6ab88dc3 100644 --- a/target/linux/x86/config-6.6 +++ b/target/linux/x86/config-6.6 @@ -239,6 +239,7 @@ CONFIG_M686=y # CONFIG_MGEODEGX1 is not set # CONFIG_MGEODE_LX is not set CONFIG_MICROCODE=y +CONFIG_MICROCODE_INITRD32=y CONFIG_MICROCODE_LATE_FORCE_MINREV=y CONFIG_MICROCODE_LATE_LOADING=y CONFIG_MIGRATION=y