diff --git a/include/kernel-5.10 b/include/kernel-5.10 index 2a8fa3c4e7..76c5ff42d1 100644 --- a/include/kernel-5.10 +++ b/include/kernel-5.10 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.10 = .110 -LINUX_KERNEL_HASH-5.10.110 = dbef6a06325433481551cb8cfca9254d908d0ae950bc809f3da8ade00c485693 +LINUX_VERSION-5.10 = .111 +LINUX_KERNEL_HASH-5.10.111 = 1831b3d8765592ce91e51441bb179d908f6bcfe8c78d03c2bec8c675c4a0ab1a diff --git a/include/kernel-5.15 b/include/kernel-5.15 index cb830e39db..31ee3119eb 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .33 -LINUX_KERNEL_HASH-5.15.33 = c30a17e6090f9ebf2d8ff58cd6c92c7324b1f4a8b3aa6a7f68850310af05a9c4 +LINUX_VERSION-5.15 = .34 +LINUX_KERNEL_HASH-5.15.34 = a7514685392f0f89b337fa252a10a004c6a97d23e8d1126059c8e373398fdb69 diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index c69a7c292c..98aa426c6b 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -125,6 +125,12 @@ plasmacloud,pa300e) qihoo,c301) ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" ;; +sophos,ap55|\ +sophos,ap55c|\ +sophos,ap100|\ +sophos,ap100c) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000" + ;; wallys,dr531) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000" ;; diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 763f15d4e0..92118a6319 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -71,6 +71,7 @@ zyxel,nr7101) [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000" ;; +bolt,arion|\ xiaomi,mi-router-cr6606|\ xiaomi,mi-router-cr6608|\ xiaomi,mi-router-cr6609) diff --git a/package/boot/uboot-envtools/files/realtek b/package/boot/uboot-envtools/files/realtek index 9836462a92..c07175a357 100644 --- a/package/boot/uboot-envtools/files/realtek +++ b/package/boot/uboot-envtools/files/realtek @@ -16,6 +16,7 @@ zyxel,gs1900-8hp-v1|\ zyxel,gs1900-8hp-v2|\ zyxel,gs1900-10hp|\ zyxel,gs1900-24-v1|\ +zyxel,gs1900-24hp-v1|\ zyxel,gs1900-24hp-v2) idx="$(find_mtd_index u-boot-env)" [ -n "$idx" ] && \ diff --git a/package/libs/pcre/Makefile b/package/libs/pcre/Makefile index 43267562ea..894f39b7d1 100644 --- a/package/libs/pcre/Makefile +++ b/package/libs/pcre/Makefile @@ -67,9 +67,8 @@ HOST_CONFIGURE_ARGS += \ --enable-unicode-properties \ --enable-pcre16 \ --with-match-limit-recursion=16000 \ - --enable-cpp - -TARGET_CFLAGS += $(FPIC) + --enable-cpp \ + --with-pic CONFIGURE_ARGS += \ --enable-utf8 \ @@ -78,7 +77,8 @@ CONFIGURE_ARGS += \ --enable-pcre32 \ $(if $(CONFIG_PCRE_JIT_ENABLED),--enable-jit,--disable-jit) \ --with-match-limit-recursion=16000 \ - --$(if $(CONFIG_PACKAGE_libpcrecpp),en,dis)able-cpp + --$(if $(CONFIG_PACKAGE_libpcrecpp),en,dis)able-cpp \ + --with-pic MAKE_FLAGS += \ CFLAGS="$(TARGET_CFLAGS)" diff --git a/package/libs/readline/Makefile b/package/libs/readline/Makefile index d14f058eab..9cf061a648 100644 --- a/package/libs/readline/Makefile +++ b/package/libs/readline/Makefile @@ -53,6 +53,7 @@ CONFIGURE_VARS += \ bash_cv_func_sigsetjmp=yes \ TARGET_CFLAGS += $(FPIC) +HOST_CFLAGS += $(FPIC) define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include diff --git a/package/network/utils/comgt/Makefile b/package/network/utils/comgt/Makefile index db5ea57473..24dae2521e 100644 --- a/package/network/utils/comgt/Makefile +++ b/package/network/utils/comgt/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=comgt PKG_VERSION:=0.32 -PKG_RELEASE:=33 +PKG_RELEASE:=34 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz PKG_SOURCE_URL:=@SF/comgt diff --git a/package/network/utils/comgt/files/ncm.json b/package/network/utils/comgt/files/ncm.json index bbdb30c5ee..b6ad717529 100644 --- a/package/network/utils/comgt/files/ncm.json +++ b/package/network/utils/comgt/files/ncm.json @@ -74,5 +74,27 @@ "connect": "AT+CGACT=1,${profile}", "finalize": "AT+CGDATA=\\\"M-MBIM\\\",${profile},1", "disconnect": "AT+CGACT=0,${profile}" + }, + "\"zte": { + "initialize": [ + "AT+CFUN=1" + ], + "configure": [ + "AT+ZGDCONT=${profile},\\\"${pdptype}\\\",\\\"${apn}\\\",\\\"\\\",0,0", + "AT+ZGPCOAUTH=${profile},\\\"${username}\\\",\\\"${password}\\\",0" + ], + "connect": "AT+ZGACT=1,${profile}", + "disconnect": "AT+ZGACT=0,${profile}" + }, + "\"marvell\"": { + "initialize": [ + "AT+CFUN=1" + ], + "configure": [ + "AT+ZGDCONT=${profile},\\\"${pdptype}\\\",\\\"${apn}\\\",\\\"\\\",0,0", + "AT+ZGPCOAUTH=${profile},\\\"${username}\\\",\\\"${password}\\\",0" + ], + "connect": "AT+ZGACT=1,${profile}", + "disconnect": "AT+ZGACT=0,${profile}" } } diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh index 6545091c82..a2c913ea1d 100644 --- a/package/network/utils/comgt/files/ncm.sh +++ b/package/network/utils/comgt/files/ncm.sh @@ -10,6 +10,7 @@ proto_ncm_init_config() { no_device=1 available=1 proto_config_add_string "device:device" + proto_config_add_string ifname proto_config_add_string apn proto_config_add_string auth proto_config_add_string username @@ -25,10 +26,10 @@ proto_ncm_init_config() { proto_ncm_setup() { local interface="$1" - local manufacturer initialize setmode connect finalize ifname devname devpath + local manufacturer initialize setmode connect finalize devname devpath ifpath - local device apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS - json_get_vars device apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS + local device ifname apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS + json_get_vars device ifname apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS [ "$metric" = "" ] && metric="0" @@ -53,17 +54,25 @@ proto_ncm_setup() { return 1 } - devname="$(basename "$device")" - case "$devname" in - 'tty'*) - devpath="$(readlink -f /sys/class/tty/$devname/device)" - ifname="$( ls "$devpath"/../../*/net )" - ;; - *) - devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)" - ifname="$( ls "$devpath"/net )" - ;; - esac + [ -z "$ifname" ] && { + devname="$(basename "$device")" + case "$devname" in + 'ttyACM'*) + devpath="$(readlink -f /sys/class/tty/$devname/device)" + ifpath="$devpath/../*/net" + ;; + 'tty'*) + devpath="$(readlink -f /sys/class/tty/$devname/device)" + ifpath="$devpath/../../*/net" + ;; + *) + devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)" + ifpath="$devpath/net" + ;; + esac + ifname="$(ls $(ls -1 -d $ifpath | head -n 1))" + } + [ -n "$ifname" ] || { echo "The interface could not be found." proto_notify_error "$interface" NO_IFACE diff --git a/scripts/cfe-partition-tag.py b/scripts/cfe-partition-tag.py index a2605d5205..41495a9af0 100755 --- a/scripts/cfe-partition-tag.py +++ b/scripts/cfe-partition-tag.py @@ -17,175 +17,123 @@ CFE Partition Tag import argparse import os import struct +import binascii + PART_NAME_SIZE = 33 PART_VERSION_SIZE = 21 -CRC32_INIT = 0xFFFFFFFF -CRC32_TABLE = [ - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, - 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, - 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, - 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, - 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, - 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, - 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, - 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, - 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, - 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, - 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, - 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, - 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, - 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, - 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, - 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, - 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, - 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, - 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, - 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, - 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, - 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, - 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, - 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, - 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, - 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, - 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, - 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, - 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, - 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, - 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, - 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, - 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, - 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, - 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, - 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, - 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, - 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, - 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, - 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, - 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, - 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, - 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, - 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, - 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, - 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, - 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, - 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, - 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, - 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, - 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, - 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, - 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, - 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, - 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, - 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, - 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, - 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D -] def auto_int(x): - return int(x, 0) + return int(x, 0) -def crc32(bytes, size, crc): - i = 0 - while (i < size): - crc = (crc >> 8) ^ CRC32_TABLE[(crc ^ bytes[i]) & 0xff] - i += 1 - return crc def str_to_bytes_pad(string, size): - str_bytes = string.encode() - num_bytes = len(str_bytes) - if (num_bytes >= size): - str_bytes = str_bytes[:size - 1] + '\0'.encode() - else: - str_bytes += '\0'.encode() * (size - num_bytes) - return str_bytes + str_bytes = string.encode() + num_bytes = len(str_bytes) + if num_bytes >= size: + str_bytes = str_bytes[: size - 1] + "\0".encode() + else: + str_bytes += "\0".encode() * (size - num_bytes) + return str_bytes + def create_tag(args, in_bytes, size): - crc = crc32(in_bytes, size, CRC32_INIT) + # JAM CRC32 is bitwise not and unsigned + crc = ~binascii.crc32(in_bytes) & 0xFFFFFFFF - tag = bytearray() - tag += struct.pack('>I', args.part_id) - tag += struct.pack('>I', size) - tag += struct.pack('>H', args.part_flags) - tag += str_to_bytes_pad(args.part_name, PART_NAME_SIZE) - tag += str_to_bytes_pad(args.part_version, PART_VERSION_SIZE) - tag += struct.pack('>I', crc) + tag = bytearray() + tag += struct.pack(">I", args.part_id) + tag += struct.pack(">I", size) + tag += struct.pack(">H", args.part_flags) + tag += str_to_bytes_pad(args.part_name, PART_NAME_SIZE) + tag += str_to_bytes_pad(args.part_version, PART_VERSION_SIZE) + tag += struct.pack(">I", crc) + + return tag - return tag def create_output(args): - in_st = os.stat(args.input_file) - in_size = in_st.st_size + in_st = os.stat(args.input_file) + in_size = in_st.st_size - in_f = open(args.input_file, 'r+b') - in_bytes = in_f.read(in_size) - in_f.close() + in_f = open(args.input_file, "r+b") + in_bytes = in_f.read(in_size) + in_f.close() - tag = create_tag(args, in_bytes, in_size) + tag = create_tag(args, in_bytes, in_size) + + out_f = open(args.output_file, "w+b") + out_f.write(tag) + out_f.close() - out_f = open(args.output_file, 'w+b') - out_f.write(tag) - out_f.close() def main(): - global args + global args - parser = argparse.ArgumentParser(description='') + parser = argparse.ArgumentParser(description="") - parser.add_argument('--flags', - dest='part_flags', - action='store', - type=auto_int, - help='Partition Flags') + parser.add_argument( + "--flags", + dest="part_flags", + action="store", + type=auto_int, + help="Partition Flags", + ) - parser.add_argument('--id', - dest='part_id', - action='store', - type=auto_int, - help='Partition ID') + parser.add_argument( + "--id", + dest="part_id", + action="store", + type=auto_int, + help="Partition ID", + ) - parser.add_argument('--input-file', - dest='input_file', - action='store', - type=str, - help='Input file') + parser.add_argument( + "--input-file", + dest="input_file", + action="store", + type=str, + help="Input file", + ) - parser.add_argument('--output-file', - dest='output_file', - action='store', - type=str, - help='Output file') + parser.add_argument( + "--output-file", + dest="output_file", + action="store", + type=str, + help="Output file", + ) - parser.add_argument('--name', - dest='part_name', - action='store', - type=str, - help='Partition Name') + parser.add_argument( + "--name", + dest="part_name", + action="store", + type=str, + help="Partition Name", + ) - parser.add_argument('--version', - dest='part_version', - action='store', - type=str, - help='Partition Version') + parser.add_argument( + "--version", + dest="part_version", + action="store", + type=str, + help="Partition Version", + ) - args = parser.parse_args() + args = parser.parse_args() + + if ( + (not args.part_flags) + or (not args.part_id) + or (not args.input_file) + or (not args.output_file) + or (not args.part_name) + or (not args.part_version) + ): + parser.print_help() + else: + create_output(args) - if ((not args.part_flags) or - (not args.part_id) or - (not args.input_file) or - (not args.output_file) or - (not args.part_name) or - (not args.part_version)): - parser.print_help() - else: - create_output(args) main() diff --git a/scripts/cfe-wfi-tag.py b/scripts/cfe-wfi-tag.py index 78ae869f1d..5fac8ee475 100755 --- a/scripts/cfe-wfi-tag.py +++ b/scripts/cfe-wfi-tag.py @@ -43,158 +43,107 @@ Flags: import argparse import os import struct +import binascii -CRC32_INIT = 0xFFFFFFFF -CRC32_TABLE = [ - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, - 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, - 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, - 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, - 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, - 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, - 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, - 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, - 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, - 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, - 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, - 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, - 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, - 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, - 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, - 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, - 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, - 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, - 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, - 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, - 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, - 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, - 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, - 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, - 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, - 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, - 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, - 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, - 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, - 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, - 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, - 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, - 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, - 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, - 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, - 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, - 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, - 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, - 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, - 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, - 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, - 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, - 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, - 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, - 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, - 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, - 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, - 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, - 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, - 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, - 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, - 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, - 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, - 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, - 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, - 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, - 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, - 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D -] def auto_int(x): - return int(x, 0) + return int(x, 0) -def crc32(bytes, size, crc): - i = 0 - while (i < size): - crc = (crc >> 8) ^ CRC32_TABLE[(crc ^ bytes[i]) & 0xff] - i += 1 - return crc -def create_tag(args, in_bytes, size): - crc = crc32(in_bytes, size, CRC32_INIT) - tag = struct.pack('>IIIII', crc, args.tag_version, args.chip_id, args.flash_type, args.flags) - return tag +def create_tag(args, in_bytes): + # JAM CRC32 is bitwise not and unsigned + crc = ~binascii.crc32(in_bytes) & 0xFFFFFFFF + tag = struct.pack( + ">IIIII", + crc, + args.tag_version, + args.chip_id, + args.flash_type, + args.flags, + ) + return tag + def create_output(args): - in_st = os.stat(args.input_file) - in_size = in_st.st_size + in_st = os.stat(args.input_file) + in_size = in_st.st_size - in_f = open(args.input_file, 'r+b') - in_bytes = in_f.read(in_size) - in_f.close() + in_f = open(args.input_file, "r+b") + in_bytes = in_f.read(in_size) + in_f.close() - tag = create_tag(args, in_bytes, in_size) + tag = create_tag(args, in_bytes) + + out_f = open(args.output_file, "w+b") + out_f.write(in_bytes) + out_f.write(tag) + out_f.close() - out_f = open(args.output_file, 'w+b') - out_f.write(in_bytes) - out_f.write(tag) - out_f.close() def main(): - global args + global args - parser = argparse.ArgumentParser(description='') + parser = argparse.ArgumentParser(description="") - parser.add_argument('--input-file', - dest='input_file', - action='store', - type=str, - help='Input file') + parser.add_argument( + "--input-file", + dest="input_file", + action="store", + type=str, + help="Input file", + ) - parser.add_argument('--output-file', - dest='output_file', - action='store', - type=str, - help='Output file') + parser.add_argument( + "--output-file", + dest="output_file", + action="store", + type=str, + help="Output file", + ) - parser.add_argument('--version', - dest='tag_version', - action='store', - type=auto_int, - help='WFI Tag Version') + parser.add_argument( + "--version", + dest="tag_version", + action="store", + type=auto_int, + help="WFI Tag Version", + ) - parser.add_argument('--chip-id', - dest='chip_id', - action='store', - type=auto_int, - help='WFI Chip ID') + parser.add_argument( + "--chip-id", + dest="chip_id", + action="store", + type=auto_int, + help="WFI Chip ID", + ) - parser.add_argument('--flash-type', - dest='flash_type', - action='store', - type=auto_int, - help='WFI Flash Type') + parser.add_argument( + "--flash-type", + dest="flash_type", + action="store", + type=auto_int, + help="WFI Flash Type", + ) - parser.add_argument('--flags', - dest='flags', - action='store', - type=auto_int, - help='WFI Flags') + parser.add_argument( + "--flags", dest="flags", action="store", type=auto_int, help="WFI Flags" + ) - args = parser.parse_args() + args = parser.parse_args() - if not args.flags: - args.flags = 0 + if not args.flags: + args.flags = 0 + + if ( + (not args.input_file) + or (not args.output_file) + or (not args.tag_version) + or (not args.chip_id) + or (not args.flash_type) + ): + parser.print_help() + else: + create_output(args) - if ((not args.input_file) or - (not args.output_file) or - (not args.tag_version) or - (not args.chip_id) or - (not args.flash_type)): - parser.print_help() - else: - create_output(args) main() diff --git a/target/linux/apm821xx/patches-5.10/150-ata-sata_dwc_460ex-Fix-crash-due-to-OOB-write.patch b/target/linux/apm821xx/patches-5.10/150-ata-sata_dwc_460ex-Fix-crash-due-to-OOB-write.patch deleted file mode 100644 index c503be9c0d..0000000000 --- a/target/linux/apm821xx/patches-5.10/150-ata-sata_dwc_460ex-Fix-crash-due-to-OOB-write.patch +++ /dev/null @@ -1,65 +0,0 @@ -From ba068938e629eb1a8b423a54405233e685cedb78 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Christian Lamparter -Date: Thu, 17 Mar 2022 21:29:28 +0100 -Subject: [PATCH v1 1/2] ata: sata_dwc_460ex: Fix crash due to OOB write -To: linux-ide@vger.kernel.org -Cc: Damien Le Moal , - Jens Axboe , - Tejun Heo , - Andy Shevchenko - -the driver uses libata's "tag" values from in various arrays. -Since the mentioned patch bumped the ATA_TAG_INTERNAL to 32, -the value of the SATA_DWC_QCMD_MAX needs to be bumped to 33. - -Otherwise ATA_TAG_INTERNAL cause a crash like this: - -| BUG: Kernel NULL pointer dereference at 0x00000000 -| Faulting instruction address: 0xc03ed4b8 -| Oops: Kernel access of bad area, sig: 11 [#1] -| BE PAGE_SIZE=4K PowerPC 44x Platform -| CPU: 0 PID: 362 Comm: scsi_eh_1 Not tainted 5.4.163 #0 -| NIP: c03ed4b8 LR: c03d27e8 CTR: c03ed36c -| REGS: cfa59950 TRAP: 0300 Not tainted (5.4.163) -| MSR: 00021000 CR: 42000222 XER: 00000000 -| DEAR: 00000000 ESR: 00000000 -| GPR00: c03d27e8 cfa59a08 cfa55fe0 00000000 0fa46bc0 [...] -| [..] -| NIP [c03ed4b8] sata_dwc_qc_issue+0x14c/0x254 -| LR [c03d27e8] ata_qc_issue+0x1c8/0x2dc -| Call Trace: -| [cfa59a08] [c003f4e0] __cancel_work_timer+0x124/0x194 (unreliable) -| [cfa59a78] [c03d27e8] ata_qc_issue+0x1c8/0x2dc -| [cfa59a98] [c03d2b3c] ata_exec_internal_sg+0x240/0x524 -| [cfa59b08] [c03d2e98] ata_exec_internal+0x78/0xe0 -| [cfa59b58] [c03d30fc] ata_read_log_page.part.38+0x1dc/0x204 -| [cfa59bc8] [c03d324c] ata_identify_page_supported+0x68/0x130 -| [...] - -this is because sata_dwc_dma_xfer_complete() NULLs the -dma_pending's next neighbour "chan" (a *dma_chan struct) in -this '32' case right here (line ~735): -> hsdevp->dma_pending[tag] = SATA_DWC_DMA_PENDING_NONE; - -Then the next time, a dma gets issued; dma_dwc_xfer_setup() passes -the NULL'd hsdevp->chan to the dmaengine_slave_config() which then -causes the crash. - -Reported-by: ticerex (OpenWrt Forum) -Fixes: 28361c403683c ("libata: add extra internal command") -Cc: stable@kernel.org # 4.18+ -Link: https://forum.openwrt.org/t/my-book-live-duo-reboot-loop/122464 -Signed-off-by: Christian Lamparter ---- ---- a/drivers/ata/sata_dwc_460ex.c -+++ b/drivers/ata/sata_dwc_460ex.c -@@ -145,7 +145,7 @@ struct sata_dwc_device { - #endif - }; - --#define SATA_DWC_QCMD_MAX 32 -+#define SATA_DWC_QCMD_MAX 33 - - struct sata_dwc_device_port { - struct sata_dwc_device *hsdev; diff --git a/target/linux/at91/patches-5.10/247-clk-use-clk_core_get_rate_recalc-in-clk_rate_get.patch b/target/linux/at91/patches-5.10/247-clk-use-clk_core_get_rate_recalc-in-clk_rate_get.patch index a17acc2742..2e8893645c 100644 --- a/target/linux/at91/patches-5.10/247-clk-use-clk_core_get_rate_recalc-in-clk_rate_get.patch +++ b/target/linux/at91/patches-5.10/247-clk-use-clk_core_get_rate_recalc-in-clk_rate_get.patch @@ -18,7 +18,7 @@ Signed-off-by: Stephen Boyd --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -3082,7 +3082,10 @@ static int clk_rate_get(void *data, u64 +@@ -3106,7 +3106,10 @@ static int clk_rate_get(void *data, u64 { struct clk_core *core = data; diff --git a/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts b/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts new file mode 100644 index 0000000000..05d3f6730e --- /dev/null +++ b/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9331.dtsi" + +#include +#include + +/ { + model = "HiWiFi HC6361"; + compatible = "hiwifi,hc6361", "qca,ar9331"; + + aliases { + serial0 = &uart; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "blue:system"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + wlan { + label = "blue:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + wan { + label = "blue:wan"; + gpios = <&gpio 27 GPIO_ACTIVE_LOW>; + }; + }; + + reg_usb_vbus: regulator { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&gpio 20 GPIO_ACTIVE_HIGH>; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + reg = <0x0 0x10000>; + label = "u-boot"; + read-only; + }; + + bdinfo: partition@10000 { + reg = <0x10000 0x10000>; + label = "bdinfo"; + read-only; + }; + + firmware: partition@20000 { + compatible = "denx,uimage"; + reg = <0x20000 0xfc0000>; + label = "firmware"; + }; + + backup: partition@fe0000 { + reg = <0xfe0000 0x10000>; + label = "backup"; + read-only; + }; + + art: partition@ff0000 { + reg = <0xff0000 0x10000>; + label = "art"; + read-only; + }; + }; + }; +}; + +&gpio { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&usb { + status = "okay"; + dr_mode = "host"; + vbus-supply = <®_usb_vbus>; +}; + +&usb_phy { + status = "okay"; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_bdinfo_18a>; + nvmem-cell-names = "mac-address-ascii"; + mac-address-increment = <1>; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_bdinfo_18a>; + nvmem-cell-names = "mac-address-ascii"; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_bdinfo_18a>; + nvmem-cell-names = "mac-address-ascii"; + mac-address-increment = <2>; +}; + +&bdinfo { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_18a: macaddr@18a { + reg = <0x18a 0x11>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-962uigs-5hact2hnt.dts b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-962uigs-5hact2hnt.dts new file mode 100644 index 0000000000..f3fc31af14 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-962uigs-5hact2hnt.dts @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_mikrotik_routerboard-96x.dtsi" + +/ { + compatible = "mikrotik,routerboard-962uigs-5hact2hnt", "qca,qca9558"; + model = "MikroTik RouterBOARD 962UiGS-5HacT2HnT (hAP ac)"; + + gpio-export { + compatible = "gpio-export"; + + port5_poe { + gpio-export,name = "port5-poe"; + gpio-export,output = <1>; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio { + input-poe-out-compat { + gpio-hog; + gpios = <2 GPIO_ACTIVE_HIGH>; + input; + line-name = "PoE out compat"; + }; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; + +&pcie1 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-96x.dtsi b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-96x.dtsi new file mode 100644 index 0000000000..e1de96e40c --- /dev/null +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-96x.dtsi @@ -0,0 +1,198 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-upgrade = &led_user; + serial0 = &uart; + }; + + leds { + compatible = "gpio-leds"; + + led_user: user { + label = "green:user"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + buzzer { + /* Beeper requires PWM for frequency selection */ + gpio-export,name = "buzzer"; + gpio-export,output = <0>; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + }; + + usb_power { + gpio-export,name = "usb-power"; + gpio-export,output = <0>; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + }; + + i2c: i2c { + compatible = "i2c-gpio"; + + sda-gpios = <&gpio 18 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <5>; + i2c-gpio,timeout-ms = <1>; + }; + + sfp1: sfp { + compatible = "sff,sfp"; + + i2c-bus = <&i2c>; + maximum-power-milliwatt = <1000>; + los-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + mod-def0-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + tx-disable-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + // Toggling GPIO16 actually enables/disables the transmitter, + // but the SFP driver does not seem to be using it. + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "RouterBoot"; + reg = <0x0 0x20000>; + read-only; + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader1"; + reg = <0x0 0x0>; + read-only; + }; + + hard_config { + read-only; + }; + + bios { + size = <0x1000>; + read-only; + }; + + partition@10000 { + label = "bootloader2"; + reg = <0x10000 0x0>; + read-only; + }; + + soft_config { + }; + }; + + partition@20000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x020000 0xfe0000>; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + /* PAD0_MODE from vendor firmware + * RGMII_EN, TX/RXCLK_DELAY_EN, TXCLK_DELAY_SEL=1 + */ + 0x04 0x07400000 /* PAD0_MODE */ + 0x50 0xc737c737 /* LED_CTRL0 */ + 0x54 0x00000000 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x0030c300 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy0>; + /* gigabit pll-data from vendor firmware + * TX_INVERT, TX_DELAY=3, GIGE, OFFSET_PHASE + */ + pll-data = <0x8f000000 0x00000101 0x00001616>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +&mdio1 { + status = "okay"; + + phy_sfp: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + sfp = <&sfp1>; + }; +}; + +ð1 { + status = "okay"; + + phy-handle = <&phy_sfp>; + pll-data = <0x03000000 0x00000101 0x00001616>; + qca955x-sgmii-fixup; + + gmac-config { + device = <&gmac>; + }; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9558_sophos_ap.dtsi b/target/linux/ath79/dts/qca9558_sophos_ap.dtsi new file mode 100644 index 0000000000..5c79d19de0 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_sophos_ap.dtsi @@ -0,0 +1,179 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/* + * The hardware of this board family is most likely shared with other devices + * from other manufacturers. Edimax appear to be the actual OEM. + * + * Sophos use the same exact board for the AP55C/AP100C, and AP55/AP100. + * Yes, this means your AP55C is a 3x3 AP with a software lock, and your + * AP55 is an AP100 with one missing antenna pigtail. + * + * AP55 and AP55C boards have different physical layouts, but are logically + * almost identical. AP55/100 have an empty micro-USB OTG port footprint, + * which may be possible to retrofit with some work. + */ + +#include "qca955x.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + label-mac-device = ð0; + }; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + label = "green:status"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; + + reg_usb_vbus: reg_usb_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 11 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + status = "disabled"; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + art: partition@50000 { + label = "art"; + reg = <0x050000 0x010000>; + read-only; + }; + + config: partition@60000 { + label = "config"; + reg = <0x060000 0x010000>; + read-only; + }; + + partition@70000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x070000 0xf90000>; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x10>; + + phy4: ethernet-phy@4 { + reg = <4>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0xa6000000 0xa0000101 0xa0001313>; + + nvmem-cells = <&macaddr_config_201a>; + nvmem-cell-names = "mac-address"; + + phy-mode = "rgmii-id"; + phy-handle = <&phy4>; + + gmac_config: gmac-config { + device = <&gmac>; + + rgmii-enabled = <1>; + + rxdv-delay = <3>; + rxd-delay = <3>; + txen-delay = <3>; + txd-delay = <3>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_201a: macaddr@201a { + reg = <0x201a 0x6>; + }; +}; + +&usb0 { + vbus-supply = <®_usb_vbus>; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_sophos_ap100.dts b/target/linux/ath79/dts/qca9558_sophos_ap100.dts new file mode 100644 index 0000000000..50ed5fbfba --- /dev/null +++ b/target/linux/ath79/dts/qca9558_sophos_ap100.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_sophos_ap.dtsi" + +/ { + compatible = "sophos,ap100", "qca,qca9558"; + model = "Sophos AP100"; +}; + +®_usb_vbus { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; diff --git a/target/linux/ath79/dts/qca9558_sophos_ap100c.dts b/target/linux/ath79/dts/qca9558_sophos_ap100c.dts new file mode 100644 index 0000000000..1811b9e0a4 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_sophos_ap100c.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_sophos_ap.dtsi" + +/ { + compatible = "sophos,ap100c", "qca,qca9558"; + model = "Sophos AP100C"; +}; diff --git a/target/linux/ath79/dts/qca9558_sophos_ap55.dts b/target/linux/ath79/dts/qca9558_sophos_ap55.dts new file mode 100644 index 0000000000..9a3fd61c93 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_sophos_ap55.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_sophos_ap.dtsi" + +/ { + compatible = "sophos,ap55", "qca,qca9558"; + model = "Sophos AP55"; +}; + +®_usb_vbus { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; diff --git a/target/linux/ath79/dts/qca9558_sophos_ap55c.dts b/target/linux/ath79/dts/qca9558_sophos_ap55c.dts new file mode 100644 index 0000000000..bd88d8ac12 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_sophos_ap55c.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9558_sophos_ap.dtsi" + +/ { + compatible = "sophos,ap55c", "qca,qca9558"; + model = "Sophos AP55C"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 7e9854b4d6..813ecc2a2c 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -250,6 +250,10 @@ joyit,jt-or750i|\ yuncore,xd3200) ucidef_set_led_default "ath10k" "ath10k-disable" "ath10k-phy0" "0" ;; +hiwifi,hc6361) + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" + ucidef_set_led_wlan "wlan" "WLAN" "blue:wlan" "phy0tpt" + ;; meraki,mr12|\ tplink,cpe210-v2|\ tplink,cpe210-v3) diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 65e6ddca73..f832103cde 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -63,6 +63,10 @@ ath79_setup_interfaces() pisen,wmb001n|\ pisen,wmm003n|\ siemens,ws-ap3610|\ + sophos,ap55|\ + sophos,ap55c|\ + sophos,ap100|\ + sophos,ap100c|\ tplink,cpe210-v2|\ tplink,cpe210-v3|\ tplink,cpe510-v2|\ @@ -505,6 +509,7 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" ;; + hiwifi,hc6361|\ xiaomi,mi-router-4q|\ zbtlink,zbt-wd323) ucidef_set_interface_wan "eth1" diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 3df7d3da36..36ac790c3a 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -29,6 +29,10 @@ case "$FIRMWARE" in qxwlan,e1700ac-v2-16m|\ qxwlan,e600gac-v2-8m|\ qxwlan,e600gac-v2-16m|\ + sophos,ap55|\ + sophos,ap55c|\ + sophos,ap100|\ + sophos,ap100c|\ ubnt,aircube-ac|\ ubnt,bullet-ac|\ ubnt,unifiac-lite|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index b02f4fb8f4..7703a53930 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1389,6 +1389,18 @@ define Device/hak5_wifi-pineapple-nano endef TARGET_DEVICES += hak5_wifi-pineapple-nano +define Device/hiwifi_hc6361 + SOC := ar9331 + DEVICE_VENDOR := HiWiFi + DEVICE_MODEL := HC6361 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-chipidea2 kmod-usb-storage \ + kmod-fs-ext4 kmod-nls-iso8859-1 e2fsprogs + BOARDNAME := HiWiFi-HC6361 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 16128k +endef +TARGET_DEVICES += hiwifi_hc6361 + define Device/iodata_etg3-r SOC := ar9342 DEVICE_VENDOR := I-O DATA @@ -2367,6 +2379,42 @@ define Device/sitecom_wlr-8100 endef TARGET_DEVICES += sitecom_wlr-8100 +define Device/sophos_ap55 + SOC := qca9558 + DEVICE_VENDOR := Sophos + DEVICE_MODEL := AP55 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 + IMAGE_SIZE := 15936k +endef +TARGET_DEVICES += sophos_ap55 + +define Device/sophos_ap55c + SOC := qca9558 + DEVICE_VENDOR := Sophos + DEVICE_MODEL := AP55C + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE_SIZE := 15936k +endef +TARGET_DEVICES += sophos_ap55c + +define Device/sophos_ap100 + SOC := qca9558 + DEVICE_VENDOR := Sophos + DEVICE_MODEL := AP100 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 + IMAGE_SIZE := 15936k +endef +TARGET_DEVICES += sophos_ap100 + +define Device/sophos_ap100c + SOC := qca9558 + DEVICE_VENDOR := Sophos + DEVICE_MODEL := AP100C + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE_SIZE := 15936k +endef +TARGET_DEVICES += sophos_ap100c + define Device/telco_t1 SOC := qca9531 DEVICE_VENDOR := Telco diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index dccb05e45a..13aec3949a 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -38,6 +38,17 @@ define Device/mikrotik_routerboard-922uags-5hpacd endef TARGET_DEVICES += mikrotik_routerboard-922uags-5hpacd +define Device/mikrotik_routerboard-962uigs-5hact2hnt + $(Device/mikrotik_nor) + SOC := qca9558 + DEVICE_MODEL := RouterBOARD 962UiGS-5HacT2HnT (hAP ac) + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 \ + kmod-i2c-gpio kmod-sfp + IMAGE_SIZE := 16256k + SUPPORTED_DEVICES += rb-962uigs-5hact2hnt +endef +TARGET_DEVICES += mikrotik_routerboard-962uigs-5hact2hnt + define Device/mikrotik_routerboard-lhg-2nd $(Device/mikrotik_nor) SOC := qca9533 diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index cc4121f93e..04bedfb569 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -23,6 +23,10 @@ ath79_setup_interfaces() mikrotik,routerboard-wapr-2nd) ucidef_set_interface_lan "eth0" ;; + mikrotik,routerboard-962uigs-5hact2hnt) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan" + ;; *) ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 8b1b5f04dd..4701460cb6 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -34,6 +34,9 @@ case "$FIRMWARE" in mikrotik,routerboard-wap-g-5hact2hnd) caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 2) ;; + mikrotik,routerboard-962uigs-5hact2hnt) + caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 7) + ;; *) caldata_die "board $board is not supported yet" ;; diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 31d4eeedbc..77cd47f6a0 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -12,6 +12,7 @@ case "$FIRMWARE" in "ath10k/cal-pci-0000:00:00.0.bin") case $board in mikrotik,routerboard-921gs-5hpacd-15s|\ + mikrotik,routerboard-962uigs-5hact2hnt|\ mikrotik,routerboard-wap-g-5hact2hnd) caldata_sysfsload_from_file $wlan_data 0x5000 0x844 ;; diff --git a/target/linux/ath79/patches-5.10/600-of_net-add-mac-address-ascii-support.patch b/target/linux/ath79/patches-5.10/600-of_net-add-mac-address-ascii-support.patch new file mode 100644 index 0000000000..8849afb4d6 --- /dev/null +++ b/target/linux/ath79/patches-5.10/600-of_net-add-mac-address-ascii-support.patch @@ -0,0 +1,103 @@ +Index: linux-5.15.31/net/ethernet/eth.c +=================================================================== +--- linux-5.15.31.orig/net/ethernet/eth.c ++++ linux-5.15.31/net/ethernet/eth.c +@@ -544,6 +544,63 @@ int eth_platform_get_mac_address(struct + } + EXPORT_SYMBOL(eth_platform_get_mac_address); + ++static void *nvmem_cell_get_mac_address(struct nvmem_cell *cell) ++{ ++ size_t len; ++ void *mac; ++ ++ mac = nvmem_cell_read(cell, &len); ++ if (IS_ERR(mac)) ++ return PTR_ERR(mac); ++ if (len != ETH_ALEN) { ++ kfree(mac); ++ return ERR_PTR(-EINVAL); ++ } ++ return mac; ++} ++ ++static void *nvmem_cell_get_mac_address_ascii(struct nvmem_cell *cell) ++{ ++ size_t len; ++ int ret; ++ void *mac_ascii; ++ u8 *mac; ++ ++ mac_ascii = nvmem_cell_read(cell, &len); ++ if (IS_ERR(mac_ascii)) ++ return PTR_ERR(mac_ascii); ++ if (len != ETH_ALEN*2+5) { ++ kfree(mac_ascii); ++ return ERR_PTR(-EINVAL); ++ } ++ mac = kmalloc(ETH_ALEN, GFP_KERNEL); ++ if (!mac) { ++ kfree(mac_ascii); ++ return ERR_PTR(-ENOMEM); ++ } ++ ret = sscanf(mac_ascii, "%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", ++ &mac[0], &mac[1], &mac[2], ++ &mac[3], &mac[4], &mac[5]); ++ kfree(mac_ascii); ++ if (ret == ETH_ALEN) ++ return mac; ++ kfree(mac); ++ return ERR_PTR(-EINVAL); ++} ++ ++static struct nvmem_cell_mac_address_property { ++ char *name; ++ void *(*read)(struct nvmem_cell *); ++} nvmem_cell_mac_address_properties[] = { ++ { ++ .name = "mac-address", ++ .read = nvmem_cell_get_mac_address, ++ }, { ++ .name = "mac-address-ascii", ++ .read = nvmem_cell_get_mac_address_ascii, ++ }, ++}; ++ + /** + * nvmem_get_mac_address - Obtain the MAC address from an nvmem cell named + * 'mac-address' associated with given device. +@@ -557,19 +614,23 @@ int nvmem_get_mac_address(struct device + { + struct nvmem_cell *cell; + const void *mac; +- size_t len; ++ struct nvmem_cell_mac_address_property *property; ++ int i; + +- cell = nvmem_cell_get(dev, "mac-address"); +- if (IS_ERR(cell)) +- return PTR_ERR(cell); +- +- mac = nvmem_cell_read(cell, &len); +- nvmem_cell_put(cell); +- +- if (IS_ERR(mac)) +- return PTR_ERR(mac); ++ for (i = 0; i < ARRAY_SIZE(nvmem_cell_mac_address_properties); i++) { ++ property = &nvmem_cell_mac_address_properties[i]; ++ cell = nvmem_cell_get(dev, property->name); ++ if (IS_ERR(cell)) { ++ if (i == ARRAY_SIZE(nvmem_cell_mac_address_properties) - 1) ++ return PTR_ERR(cell); ++ continue; ++ } ++ mac = property->read(cell); ++ nvmem_cell_put(cell); ++ break; ++ } + +- if (len != ETH_ALEN || !is_valid_ether_addr(mac)) { ++ if (!is_valid_ether_addr(mac)) { + kfree(mac); + return -EINVAL; + } diff --git a/target/linux/ath79/patches-5.15/600-of_net-add-mac-address-ascii-support.patch b/target/linux/ath79/patches-5.15/600-of_net-add-mac-address-ascii-support.patch new file mode 100644 index 0000000000..8849afb4d6 --- /dev/null +++ b/target/linux/ath79/patches-5.15/600-of_net-add-mac-address-ascii-support.patch @@ -0,0 +1,103 @@ +Index: linux-5.15.31/net/ethernet/eth.c +=================================================================== +--- linux-5.15.31.orig/net/ethernet/eth.c ++++ linux-5.15.31/net/ethernet/eth.c +@@ -544,6 +544,63 @@ int eth_platform_get_mac_address(struct + } + EXPORT_SYMBOL(eth_platform_get_mac_address); + ++static void *nvmem_cell_get_mac_address(struct nvmem_cell *cell) ++{ ++ size_t len; ++ void *mac; ++ ++ mac = nvmem_cell_read(cell, &len); ++ if (IS_ERR(mac)) ++ return PTR_ERR(mac); ++ if (len != ETH_ALEN) { ++ kfree(mac); ++ return ERR_PTR(-EINVAL); ++ } ++ return mac; ++} ++ ++static void *nvmem_cell_get_mac_address_ascii(struct nvmem_cell *cell) ++{ ++ size_t len; ++ int ret; ++ void *mac_ascii; ++ u8 *mac; ++ ++ mac_ascii = nvmem_cell_read(cell, &len); ++ if (IS_ERR(mac_ascii)) ++ return PTR_ERR(mac_ascii); ++ if (len != ETH_ALEN*2+5) { ++ kfree(mac_ascii); ++ return ERR_PTR(-EINVAL); ++ } ++ mac = kmalloc(ETH_ALEN, GFP_KERNEL); ++ if (!mac) { ++ kfree(mac_ascii); ++ return ERR_PTR(-ENOMEM); ++ } ++ ret = sscanf(mac_ascii, "%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", ++ &mac[0], &mac[1], &mac[2], ++ &mac[3], &mac[4], &mac[5]); ++ kfree(mac_ascii); ++ if (ret == ETH_ALEN) ++ return mac; ++ kfree(mac); ++ return ERR_PTR(-EINVAL); ++} ++ ++static struct nvmem_cell_mac_address_property { ++ char *name; ++ void *(*read)(struct nvmem_cell *); ++} nvmem_cell_mac_address_properties[] = { ++ { ++ .name = "mac-address", ++ .read = nvmem_cell_get_mac_address, ++ }, { ++ .name = "mac-address-ascii", ++ .read = nvmem_cell_get_mac_address_ascii, ++ }, ++}; ++ + /** + * nvmem_get_mac_address - Obtain the MAC address from an nvmem cell named + * 'mac-address' associated with given device. +@@ -557,19 +614,23 @@ int nvmem_get_mac_address(struct device + { + struct nvmem_cell *cell; + const void *mac; +- size_t len; ++ struct nvmem_cell_mac_address_property *property; ++ int i; + +- cell = nvmem_cell_get(dev, "mac-address"); +- if (IS_ERR(cell)) +- return PTR_ERR(cell); +- +- mac = nvmem_cell_read(cell, &len); +- nvmem_cell_put(cell); +- +- if (IS_ERR(mac)) +- return PTR_ERR(mac); ++ for (i = 0; i < ARRAY_SIZE(nvmem_cell_mac_address_properties); i++) { ++ property = &nvmem_cell_mac_address_properties[i]; ++ cell = nvmem_cell_get(dev, property->name); ++ if (IS_ERR(cell)) { ++ if (i == ARRAY_SIZE(nvmem_cell_mac_address_properties) - 1) ++ return PTR_ERR(cell); ++ continue; ++ } ++ mac = property->read(cell); ++ nvmem_cell_put(cell); ++ break; ++ } + +- if (len != ETH_ALEN || !is_valid_ether_addr(mac)) { ++ if (!is_valid_ether_addr(mac)) { + kfree(mac); + return -EINVAL; + } diff --git a/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch index 7196d28fb2..46f5be3d4e 100644 --- a/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch @@ -171,7 +171,7 @@ #define UDP_CORK 1 /* Never send partially complete segments */ --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -292,8 +292,8 @@ nf_ct_get_tuple(const struct sk_buff *sk +@@ -305,8 +305,8 @@ nf_ct_get_tuple(const struct sk_buff *sk switch (l3num) { case NFPROTO_IPV4: diff --git a/target/linux/bcm27xx/patches-5.10/950-0256-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch b/target/linux/bcm27xx/patches-5.10/950-0256-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch index fb57e916c5..e23e7ec376 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0256-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0256-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch @@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell /* Device and char device-related information */ static DEFINE_IDA(gpio_ida); static dev_t gpio_devt; -@@ -2444,8 +2446,8 @@ int gpiod_direction_output(struct gpio_d +@@ -2463,8 +2465,8 @@ int gpiod_direction_output(struct gpio_d value = !!value; /* GPIOs used for enabled IRQs shall not be set as output */ @@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell gpiod_err(desc, "%s: tried to set a GPIO tied to an IRQ as output\n", __func__); -@@ -3260,8 +3262,8 @@ int gpiochip_lock_as_irq(struct gpio_chi +@@ -3279,8 +3281,8 @@ int gpiochip_lock_as_irq(struct gpio_chi } /* To be valid for IRQ the line needs to be input or open drain */ diff --git a/target/linux/bcm27xx/patches-5.10/950-0537-clk-Introduce-a-clock-request-API.patch b/target/linux/bcm27xx/patches-5.10/950-0537-clk-Introduce-a-clock-request-API.patch index b9b916f15d..e90134d682 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0537-clk-Introduce-a-clock-request-API.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0537-clk-Introduce-a-clock-request-API.patch @@ -75,7 +75,7 @@ Signed-off-by: Maxime Ripard /*** runtime pm ***/ static int clk_pm_runtime_get(struct clk_core *core) { -@@ -1413,10 +1421,14 @@ unsigned long clk_hw_round_rate(struct c +@@ -1431,10 +1439,14 @@ unsigned long clk_hw_round_rate(struct c { int ret; struct clk_rate_request req; @@ -90,7 +90,7 @@ Signed-off-by: Maxime Ripard ret = clk_core_round_rate_nolock(hw->core, &req); if (ret) return 0; -@@ -1437,6 +1449,7 @@ EXPORT_SYMBOL_GPL(clk_hw_round_rate); +@@ -1455,6 +1467,7 @@ EXPORT_SYMBOL_GPL(clk_hw_round_rate); long clk_round_rate(struct clk *clk, unsigned long rate) { struct clk_rate_request req; @@ -98,7 +98,7 @@ Signed-off-by: Maxime Ripard int ret; if (!clk) -@@ -1450,6 +1463,9 @@ long clk_round_rate(struct clk *clk, uns +@@ -1468,6 +1481,9 @@ long clk_round_rate(struct clk *clk, uns clk_core_get_boundaries(clk->core, &req.min_rate, &req.max_rate); req.rate = rate; @@ -108,7 +108,7 @@ Signed-off-by: Maxime Ripard ret = clk_core_round_rate_nolock(clk->core, &req); if (clk->exclusive_count) -@@ -1917,6 +1933,7 @@ static struct clk_core *clk_calc_new_rat +@@ -1935,6 +1951,7 @@ static struct clk_core *clk_calc_new_rat unsigned long new_rate; unsigned long min_rate; unsigned long max_rate; @@ -116,7 +116,7 @@ Signed-off-by: Maxime Ripard int p_index = 0; long ret; -@@ -1931,6 +1948,9 @@ static struct clk_core *clk_calc_new_rat +@@ -1949,6 +1966,9 @@ static struct clk_core *clk_calc_new_rat clk_core_get_boundaries(core, &min_rate, &max_rate); @@ -126,7 +126,7 @@ Signed-off-by: Maxime Ripard /* find the closest rate and parent clk/rate */ if (clk_core_can_round(core)) { struct clk_rate_request req; -@@ -2135,6 +2155,7 @@ static unsigned long clk_core_req_round_ +@@ -2153,6 +2173,7 @@ static unsigned long clk_core_req_round_ { int ret, cnt; struct clk_rate_request req; @@ -134,7 +134,7 @@ Signed-off-by: Maxime Ripard lockdep_assert_held(&prepare_lock); -@@ -2149,6 +2170,9 @@ static unsigned long clk_core_req_round_ +@@ -2167,6 +2188,9 @@ static unsigned long clk_core_req_round_ clk_core_get_boundaries(core, &req.min_rate, &req.max_rate); req.rate = req_rate; @@ -144,7 +144,7 @@ Signed-off-by: Maxime Ripard ret = clk_core_round_rate_nolock(core, &req); /* restore the protection */ -@@ -2242,6 +2266,9 @@ int clk_set_rate(struct clk *clk, unsign +@@ -2260,6 +2284,9 @@ int clk_set_rate(struct clk *clk, unsign ret = clk_core_set_rate_nolock(clk->core, rate); @@ -154,7 +154,7 @@ Signed-off-by: Maxime Ripard if (clk->exclusive_count) clk_core_rate_protect(clk->core); -@@ -2402,6 +2429,99 @@ int clk_set_max_rate(struct clk *clk, un +@@ -2426,6 +2453,99 @@ int clk_set_max_rate(struct clk *clk, un EXPORT_SYMBOL_GPL(clk_set_max_rate); /** @@ -254,7 +254,7 @@ Signed-off-by: Maxime Ripard * clk_get_parent - return the parent of a clk * @clk: the clk whose parent gets returned * -@@ -3851,6 +3971,7 @@ __clk_register(struct device *dev, struc +@@ -3875,6 +3995,7 @@ __clk_register(struct device *dev, struc goto fail_parents; INIT_HLIST_HEAD(&core->clks); diff --git a/target/linux/bcm27xx/patches-5.10/950-0572-clk-requests-Ignore-if-the-pointer-is-null.patch b/target/linux/bcm27xx/patches-5.10/950-0572-clk-requests-Ignore-if-the-pointer-is-null.patch index 5ee8e71bda..973fc4e92b 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0572-clk-requests-Ignore-if-the-pointer-is-null.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0572-clk-requests-Ignore-if-the-pointer-is-null.patch @@ -10,7 +10,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2498,6 +2498,9 @@ void clk_request_done(struct clk_request +@@ -2522,6 +2522,9 @@ void clk_request_done(struct clk_request { struct clk_core *core = req->clk->core; diff --git a/target/linux/bcm27xx/patches-5.10/950-0581-clk-requests-Dereference-the-request-pointer-after-t.patch b/target/linux/bcm27xx/patches-5.10/950-0581-clk-requests-Dereference-the-request-pointer-after-t.patch index 9f87aadc17..9f7ccf85e9 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0581-clk-requests-Dereference-the-request-pointer-after-t.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0581-clk-requests-Dereference-the-request-pointer-after-t.patch @@ -15,7 +15,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2496,10 +2496,11 @@ EXPORT_SYMBOL_GPL(clk_request_start); +@@ -2520,10 +2520,11 @@ EXPORT_SYMBOL_GPL(clk_request_start); */ void clk_request_done(struct clk_request *req) { diff --git a/target/linux/bcm27xx/patches-5.10/950-0596-clk-Always-clamp-the-rounded-rate.patch b/target/linux/bcm27xx/patches-5.10/950-0596-clk-Always-clamp-the-rounded-rate.patch index 05cbc7afae..868e1569bc 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0596-clk-Always-clamp-the-rounded-rate.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0596-clk-Always-clamp-the-rounded-rate.patch @@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1316,6 +1316,8 @@ static int clk_core_determine_round_nolo +@@ -1334,6 +1334,8 @@ static int clk_core_determine_round_nolo if (!core) return 0; diff --git a/target/linux/bcm27xx/patches-5.10/950-0639-cgroup-Disable-cgroup-memory-by-default.patch b/target/linux/bcm27xx/patches-5.10/950-0639-cgroup-Disable-cgroup-memory-by-default.patch index 315d79ddf4..84fbcdb2c2 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0639-cgroup-Disable-cgroup-memory-by-default.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0639-cgroup-Disable-cgroup-memory-by-default.patch @@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -5720,6 +5720,9 @@ int __init cgroup_init_early(void) +@@ -5735,6 +5735,9 @@ int __init cgroup_init_early(void) return 0; } @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell /** * cgroup_init - cgroup initialization * -@@ -5758,6 +5761,12 @@ int __init cgroup_init(void) +@@ -5773,6 +5776,12 @@ int __init cgroup_init(void) mutex_unlock(&cgroup_mutex); @@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell for_each_subsys(ss, ssid) { if (ss->early_init) { struct cgroup_subsys_state *css = -@@ -6296,6 +6305,10 @@ static int __init cgroup_disable(char *s +@@ -6311,6 +6320,10 @@ static int __init cgroup_disable(char *s strcmp(token, ss->legacy_name)) continue; @@ -51,7 +51,7 @@ Signed-off-by: Phil Elwell static_branch_disable(cgroup_subsys_enabled_key[i]); pr_info("Disabling %s control group subsystem\n", ss->name); -@@ -6305,6 +6318,31 @@ static int __init cgroup_disable(char *s +@@ -6320,6 +6333,31 @@ static int __init cgroup_disable(char *s } __setup("cgroup_disable=", cgroup_disable); diff --git a/target/linux/bcm63xx/patches-5.10/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch b/target/linux/bcm63xx/patches-5.10/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch index 17cb9e0f00..9657592d70 100644 --- a/target/linux/bcm63xx/patches-5.10/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch +++ b/target/linux/bcm63xx/patches-5.10/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch @@ -116,7 +116,7 @@ Signed-off-by: Jonas Gorski } --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c -@@ -1893,7 +1893,8 @@ int gpiochip_add_pingroup_range(struct g +@@ -1912,7 +1912,8 @@ int gpiochip_add_pingroup_range(struct g list_add_tail(&pin_range->node, &gdev->pin_ranges); @@ -126,7 +126,7 @@ Signed-off-by: Jonas Gorski } EXPORT_SYMBOL_GPL(gpiochip_add_pingroup_range); -@@ -1950,7 +1951,7 @@ int gpiochip_add_pin_range(struct gpio_c +@@ -1969,7 +1970,7 @@ int gpiochip_add_pin_range(struct gpio_c list_add_tail(&pin_range->node, &gdev->pin_ranges); diff --git a/target/linux/generic/backport-5.10/711-v5.12-sfp-add-support-for-100-base-x-SFPs.patch b/target/linux/generic/backport-5.10/711-v5.12-sfp-add-support-for-100-base-x-SFPs.patch index 7d06c235d9..0c87532e13 100644 --- a/target/linux/generic/backport-5.10/711-v5.12-sfp-add-support-for-100-base-x-SFPs.patch +++ b/target/linux/generic/backport-5.10/711-v5.12-sfp-add-support-for-100-base-x-SFPs.patch @@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c -@@ -280,6 +280,12 @@ void sfp_parse_support(struct sfp_bus *b +@@ -286,6 +286,12 @@ void sfp_parse_support(struct sfp_bus *b br_min <= 1300 && br_max >= 1200) phylink_set(modes, 1000baseX_Full); @@ -28,7 +28,7 @@ Signed-off-by: Jakub Kicinski /* For active or passive cables, select the link modes * based on the bit rates and the cable compliance bytes. */ -@@ -399,6 +405,9 @@ phy_interface_t sfp_select_interface(str +@@ -405,6 +411,9 @@ phy_interface_t sfp_select_interface(str if (phylink_test(link_modes, 1000baseX_Full)) return PHY_INTERFACE_MODE_1000BASEX; diff --git a/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch index ab35665581..3b7f618a31 100644 --- a/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch +++ b/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch @@ -1398,7 +1398,7 @@ Signed-off-by: David S. Miller } phy_mode = device_get_phy_mode(&pdev->dev); -@@ -644,7 +644,7 @@ void stmmac_remove_config_dt(struct plat +@@ -643,7 +643,7 @@ void stmmac_remove_config_dt(struct plat } #else struct plat_stmmacenet_data * @@ -1834,7 +1834,7 @@ Signed-off-by: David S. Miller /* --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c -@@ -334,7 +334,6 @@ int wfx_probe(struct wfx_dev *wdev) +@@ -339,7 +339,6 @@ int wfx_probe(struct wfx_dev *wdev) { int i; int err; @@ -1842,7 +1842,7 @@ Signed-off-by: David S. Miller struct gpio_desc *gpio_saved; // During first part of boot, gpio_wakeup cannot yet been used. So -@@ -423,9 +422,9 @@ int wfx_probe(struct wfx_dev *wdev) +@@ -428,9 +427,9 @@ int wfx_probe(struct wfx_dev *wdev) for (i = 0; i < ARRAY_SIZE(wdev->addresses); i++) { eth_zero_addr(wdev->addresses[i].addr); diff --git a/target/linux/generic/backport-5.10/850-v5.17-0004-PCI-aardvark-Clear-all-MSIs-at-setup.patch b/target/linux/generic/backport-5.10/850-v5.17-0004-PCI-aardvark-Clear-all-MSIs-at-setup.patch index d617845e42..dc01c5f85d 100644 --- a/target/linux/generic/backport-5.10/850-v5.17-0004-PCI-aardvark-Clear-all-MSIs-at-setup.patch +++ b/target/linux/generic/backport-5.10/850-v5.17-0004-PCI-aardvark-Clear-all-MSIs-at-setup.patch @@ -48,7 +48,7 @@ Signed-off-by: Lorenzo Pieralisi /* Enable summary interrupt for GIC SPI source */ reg = PCIE_IRQ_ALL_MASK & (~PCIE_IRQ_ENABLE_INTS_MASK); -@@ -1401,7 +1403,7 @@ static void advk_pcie_handle_msi(struct +@@ -1397,7 +1399,7 @@ static void advk_pcie_handle_msi(struct msi_mask = advk_readl(pcie, PCIE_MSI_MASK_REG); msi_val = advk_readl(pcie, PCIE_MSI_STATUS_REG); diff --git a/target/linux/generic/backport-5.10/850-v5.17-0005-PCI-aardvark-Comment-actions-in-driver-remove-method.patch b/target/linux/generic/backport-5.10/850-v5.17-0005-PCI-aardvark-Comment-actions-in-driver-remove-method.patch index 1261066289..45df1b9695 100644 --- a/target/linux/generic/backport-5.10/850-v5.17-0005-PCI-aardvark-Comment-actions-in-driver-remove-method.patch +++ b/target/linux/generic/backport-5.10/850-v5.17-0005-PCI-aardvark-Comment-actions-in-driver-remove-method.patch @@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1700,11 +1700,13 @@ static int advk_pcie_remove(struct platf +@@ -1696,11 +1696,13 @@ static int advk_pcie_remove(struct platf struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); int i; diff --git a/target/linux/generic/backport-5.10/850-v5.17-0006-PCI-aardvark-Disable-bus-mastering-when-unbinding-dr.patch b/target/linux/generic/backport-5.10/850-v5.17-0006-PCI-aardvark-Disable-bus-mastering-when-unbinding-dr.patch index cb50e08fdc..5959d80592 100644 --- a/target/linux/generic/backport-5.10/850-v5.17-0006-PCI-aardvark-Disable-bus-mastering-when-unbinding-dr.patch +++ b/target/linux/generic/backport-5.10/850-v5.17-0006-PCI-aardvark-Disable-bus-mastering-when-unbinding-dr.patch @@ -19,7 +19,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1698,6 +1698,7 @@ static int advk_pcie_remove(struct platf +@@ -1694,6 +1694,7 @@ static int advk_pcie_remove(struct platf { struct advk_pcie *pcie = platform_get_drvdata(pdev); struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); @@ -27,7 +27,7 @@ Signed-off-by: Lorenzo Pieralisi int i; /* Remove PCI bus with all devices */ -@@ -1706,6 +1707,11 @@ static int advk_pcie_remove(struct platf +@@ -1702,6 +1703,11 @@ static int advk_pcie_remove(struct platf pci_remove_root_bus(bridge->bus); pci_unlock_rescan_remove(); diff --git a/target/linux/generic/backport-5.10/850-v5.17-0007-PCI-aardvark-Mask-all-interrupts-when-unbinding-driv.patch b/target/linux/generic/backport-5.10/850-v5.17-0007-PCI-aardvark-Mask-all-interrupts-when-unbinding-driv.patch index ce8088b3b1..130bb701f8 100644 --- a/target/linux/generic/backport-5.10/850-v5.17-0007-PCI-aardvark-Mask-all-interrupts-when-unbinding-driv.patch +++ b/target/linux/generic/backport-5.10/850-v5.17-0007-PCI-aardvark-Mask-all-interrupts-when-unbinding-driv.patch @@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1712,6 +1712,27 @@ static int advk_pcie_remove(struct platf +@@ -1708,6 +1708,27 @@ static int advk_pcie_remove(struct platf val &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); advk_writel(pcie, val, PCIE_CORE_CMD_STATUS_REG); diff --git a/target/linux/generic/backport-5.10/850-v5.17-0008-PCI-aardvark-Fix-memory-leak-in-driver-unbind.patch b/target/linux/generic/backport-5.10/850-v5.17-0008-PCI-aardvark-Fix-memory-leak-in-driver-unbind.patch index a460f770f8..74d25d508b 100644 --- a/target/linux/generic/backport-5.10/850-v5.17-0008-PCI-aardvark-Fix-memory-leak-in-driver-unbind.patch +++ b/target/linux/generic/backport-5.10/850-v5.17-0008-PCI-aardvark-Fix-memory-leak-in-driver-unbind.patch @@ -21,7 +21,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1737,6 +1737,9 @@ static int advk_pcie_remove(struct platf +@@ -1733,6 +1733,9 @@ static int advk_pcie_remove(struct platf advk_pcie_remove_msi_irq_domain(pcie); advk_pcie_remove_irq_domain(pcie); diff --git a/target/linux/generic/backport-5.10/850-v5.17-0009-PCI-aardvark-Assert-PERST-when-unbinding-driver.patch b/target/linux/generic/backport-5.10/850-v5.17-0009-PCI-aardvark-Assert-PERST-when-unbinding-driver.patch index 2dfd22f439..26d8afdddd 100644 --- a/target/linux/generic/backport-5.10/850-v5.17-0009-PCI-aardvark-Assert-PERST-when-unbinding-driver.patch +++ b/target/linux/generic/backport-5.10/850-v5.17-0009-PCI-aardvark-Assert-PERST-when-unbinding-driver.patch @@ -20,7 +20,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1740,6 +1740,10 @@ static int advk_pcie_remove(struct platf +@@ -1736,6 +1736,10 @@ static int advk_pcie_remove(struct platf /* Free config space for emulated root bridge */ pci_bridge_emul_cleanup(&pcie->bridge); diff --git a/target/linux/generic/backport-5.10/850-v5.17-0010-PCI-aardvark-Disable-link-training-when-unbinding-dr.patch b/target/linux/generic/backport-5.10/850-v5.17-0010-PCI-aardvark-Disable-link-training-when-unbinding-dr.patch index e1ff7e8573..23346a9284 100644 --- a/target/linux/generic/backport-5.10/850-v5.17-0010-PCI-aardvark-Disable-link-training-when-unbinding-dr.patch +++ b/target/linux/generic/backport-5.10/850-v5.17-0010-PCI-aardvark-Disable-link-training-when-unbinding-dr.patch @@ -20,7 +20,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1744,6 +1744,11 @@ static int advk_pcie_remove(struct platf +@@ -1740,6 +1740,11 @@ static int advk_pcie_remove(struct platf if (pcie->reset_gpio) gpiod_set_value_cansleep(pcie->reset_gpio, 1); diff --git a/target/linux/generic/backport-5.10/850-v5.17-0011-PCI-aardvark-Disable-common-PHY-when-unbinding-drive.patch b/target/linux/generic/backport-5.10/850-v5.17-0011-PCI-aardvark-Disable-common-PHY-when-unbinding-drive.patch index 5a0840f3ed..a7d5c014ab 100644 --- a/target/linux/generic/backport-5.10/850-v5.17-0011-PCI-aardvark-Disable-common-PHY-when-unbinding-drive.patch +++ b/target/linux/generic/backport-5.10/850-v5.17-0011-PCI-aardvark-Disable-common-PHY-when-unbinding-drive.patch @@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1753,6 +1753,9 @@ static int advk_pcie_remove(struct platf +@@ -1749,6 +1749,9 @@ static int advk_pcie_remove(struct platf for (i = 0; i < OB_WIN_COUNT; i++) advk_pcie_disable_ob_win(pcie, i); diff --git a/target/linux/generic/backport-5.10/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch b/target/linux/generic/backport-5.10/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch new file mode 100644 index 0000000000..b5a226181e --- /dev/null +++ b/target/linux/generic/backport-5.10/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch @@ -0,0 +1,58 @@ +From d91a03b72c5f9c25e5b976f8f67bcf279601d644 Mon Sep 17 00:00:00 2001 +From: Lech Perczak +Date: Fri, 1 Apr 2022 22:03:55 +0200 +Subject: [PATCH 1/3] cdc_ether: export usbnet_cdc_zte_rx_fixup +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit bfe9b9d2df66 ("cdc_ether: Improve ZTE MF823/831/910 handling") +introduces a workaround for certain ZTE modems reporting invalid MAC +addresses over CDC-ECM. +The same issue was present on their RNDIS interface,which was fixed in +commit a5a18bdf7453 ("rndis_host: Set valid random MAC on buggy devices"). + +However, internal modem of ZTE MF286R router, on its RNDIS interface, also +exhibits a second issue fixed already in CDC-ECM, of the device not +respecting configured random MAC address. In order to share the fixup for +this with rndis_host driver, export the workaround function, which will +be re-used in the following commit in rndis_host. + +Cc: Kristian Evensen +Cc: Bjørn Mork +Cc: Oliver Neukum +Signed-off-by: Lech Perczak +--- + drivers/net/usb/cdc_ether.c | 3 ++- + include/linux/usb/usbnet.h | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -466,7 +466,7 @@ static int usbnet_cdc_zte_bind(struct us + * device MAC address has been updated). Always set MAC address to that of the + * device. + */ +-static int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ++int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb) + { + if (skb->len < ETH_HLEN || !(skb->data[0] & 0x02)) + return 1; +@@ -476,6 +476,7 @@ static int usbnet_cdc_zte_rx_fixup(struc + + return 1; + } ++EXPORT_SYMBOL_GPL(usbnet_cdc_zte_rx_fixup); + + /* Ensure correct link state + * +--- a/include/linux/usb/usbnet.h ++++ b/include/linux/usb/usbnet.h +@@ -215,6 +215,7 @@ extern int usbnet_ether_cdc_bind(struct + extern int usbnet_cdc_bind(struct usbnet *, struct usb_interface *); + extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *); + extern void usbnet_cdc_status(struct usbnet *, struct urb *); ++extern int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb); + + /* CDC and RNDIS support the same host-chosen packet filters for IN transfers */ + #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ diff --git a/target/linux/generic/backport-5.10/881-v5.19-rndis_host-enable-the-bogus-MAC-fixup-for-ZTE-device.patch b/target/linux/generic/backport-5.10/881-v5.19-rndis_host-enable-the-bogus-MAC-fixup-for-ZTE-device.patch new file mode 100644 index 0000000000..99f0146e50 --- /dev/null +++ b/target/linux/generic/backport-5.10/881-v5.19-rndis_host-enable-the-bogus-MAC-fixup-for-ZTE-device.patch @@ -0,0 +1,118 @@ +From 69a9efb689b43fedf5f19431f1889aa6b8d35d55 Mon Sep 17 00:00:00 2001 +From: Lech Perczak +Date: Fri, 1 Apr 2022 22:04:01 +0200 +Subject: [PATCH 2/3] rndis_host: enable the bogus MAC fixup for ZTE devices + from cdc_ether +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Certain ZTE modems, namely: MF823. MF831, MF910, built-in modem from +MF286R, expose both CDC-ECM and RNDIS network interfaces. +They have a trait of ignoring the locally-administered MAC address +configured on the interface both in CDC-ECM and RNDIS part, +and this leads to dropping of incoming traffic by the host. +However, the workaround was only present in CDC-ECM, and MF286R +explicitly requires it in RNDIS mode. + +Re-use the workaround in rndis_host as well, to fix operation of MF286R +module, some versions of which expose only the RNDIS interface. Do so by +introducing new flag, RNDIS_DRIVER_DATA_DST_MAC_FIXUP, and testing for it +in rndis_rx_fixup. This is required, as RNDIS uses frame batching, and all +of the packets inside the batch need the fixup. This might introduce a +performance penalty, because test is done for every returned Ethernet +frame. + +Apply the workaround to both "flavors" of RNDIS interfaces, as older ZTE +modems, like MF823 found in the wild, report the USB_CLASS_COMM class +interfaces, while MF286R reports USB_CLASS_WIRELESS_CONTROLLER. + +Suggested-by: Bjørn Mork +Cc: Kristian Evensen +Cc: Oliver Neukum +Signed-off-by: Lech Perczak +--- + drivers/net/usb/rndis_host.c | 32 ++++++++++++++++++++++++++++++++ + include/linux/usb/rndis_host.h | 1 + + 2 files changed, 33 insertions(+) + +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -485,10 +485,14 @@ EXPORT_SYMBOL_GPL(rndis_unbind); + */ + int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) + { ++ bool dst_mac_fixup; ++ + /* This check is no longer done by usbnet */ + if (skb->len < dev->net->hard_header_len) + return 0; + ++ dst_mac_fixup = !!(dev->driver_info->data & RNDIS_DRIVER_DATA_DST_MAC_FIXUP); ++ + /* peripheral may have batched packets to us... */ + while (likely(skb->len)) { + struct rndis_data_hdr *hdr = (void *)skb->data; +@@ -523,10 +527,17 @@ int rndis_rx_fixup(struct usbnet *dev, s + break; + skb_pull(skb, msg_len - sizeof *hdr); + skb_trim(skb2, data_len); ++ ++ if (unlikely(dst_mac_fixup)) ++ usbnet_cdc_zte_rx_fixup(dev, skb2); ++ + usbnet_skb_return(dev, skb2); + } + + /* caller will usbnet_skb_return the remaining packet */ ++ if (unlikely(dst_mac_fixup)) ++ usbnet_cdc_zte_rx_fixup(dev, skb); ++ + return 1; + } + EXPORT_SYMBOL_GPL(rndis_rx_fixup); +@@ -600,6 +611,17 @@ static const struct driver_info rndis_po + .tx_fixup = rndis_tx_fixup, + }; + ++static const struct driver_info zte_rndis_info = { ++ .description = "ZTE RNDIS device", ++ .flags = FLAG_ETHER | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT, ++ .data = RNDIS_DRIVER_DATA_DST_MAC_FIXUP, ++ .bind = rndis_bind, ++ .unbind = rndis_unbind, ++ .status = rndis_status, ++ .rx_fixup = rndis_rx_fixup, ++ .tx_fixup = rndis_tx_fixup, ++}; ++ + /*-------------------------------------------------------------------------*/ + + static const struct usb_device_id products [] = { +@@ -609,6 +631,16 @@ static const struct usb_device_id produc + USB_CLASS_COMM, 2 /* ACM */, 0x0ff), + .driver_info = (unsigned long) &rndis_poll_status_info, + }, { ++ /* ZTE WWAN modules */ ++ USB_VENDOR_AND_INTERFACE_INFO(0x19d2, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long)&zte_rndis_info, ++}, { ++ /* ZTE WWAN modules, ACM flavour */ ++ USB_VENDOR_AND_INTERFACE_INFO(0x19d2, ++ USB_CLASS_COMM, 2 /* ACM */, 0x0ff), ++ .driver_info = (unsigned long)&zte_rndis_info, ++}, { + /* Hytera Communications DMR radios' "Radio to PC Network" */ + USB_VENDOR_AND_INTERFACE_INFO(0x238b, + USB_CLASS_COMM, 2 /* ACM */, 0x0ff), +--- a/include/linux/usb/rndis_host.h ++++ b/include/linux/usb/rndis_host.h +@@ -197,6 +197,7 @@ struct rndis_keepalive_c { /* IN (option + + /* Flags for driver_info::data */ + #define RNDIS_DRIVER_DATA_POLL_STATUS 1 /* poll status before control */ ++#define RNDIS_DRIVER_DATA_DST_MAC_FIXUP 2 /* device ignores configured MAC address */ + + extern void rndis_status(struct usbnet *dev, struct urb *urb); + extern int diff --git a/target/linux/generic/backport-5.10/882-v5.19-rndis_host-limit-scope-of-bogus-MAC-address-detectio.patch b/target/linux/generic/backport-5.10/882-v5.19-rndis_host-limit-scope-of-bogus-MAC-address-detectio.patch new file mode 100644 index 0000000000..bdb78ff170 --- /dev/null +++ b/target/linux/generic/backport-5.10/882-v5.19-rndis_host-limit-scope-of-bogus-MAC-address-detectio.patch @@ -0,0 +1,63 @@ +From 1bfbe1799b9ec5d00f7f032d6e7db1980e466aeb Mon Sep 17 00:00:00 2001 +From: Lech Perczak +Date: Sat, 2 Apr 2022 02:19:57 +0200 +Subject: [PATCH 3/3] rndis_host: limit scope of bogus MAC address detection to + ZTE devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Reporting of bogus MAC addresses and ignoring configuration of new +destination address wasn't observed outside of a range of ZTE devices, +among which this seems to be the common bug. Align rndis_host driver +with implementation found in cdc_ether, which also limits this workaround +to ZTE devices. + +Suggested-by: Bjørn Mork +Cc: Kristian Evensen +Cc: Oliver Neukum +Signed-off-by: Lech Perczak +--- + drivers/net/usb/rndis_host.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -418,10 +418,7 @@ generic_rndis_bind(struct usbnet *dev, s + goto halt_fail_and_release; + } + +- if (bp[0] & 0x02) +- eth_hw_addr_random(net); +- else +- ether_addr_copy(net->dev_addr, bp); ++ ether_addr_copy(net->dev_addr, bp); + + /* set a nonzero filter to enable data transfers */ + memset(u.set, 0, sizeof *u.set); +@@ -463,6 +460,16 @@ static int rndis_bind(struct usbnet *dev + return generic_rndis_bind(dev, intf, FLAG_RNDIS_PHYM_NOT_WIRELESS); + } + ++static int zte_rndis_bind(struct usbnet *dev, struct usb_interface *intf) ++{ ++ int status = rndis_bind(dev, intf); ++ ++ if (!status && (dev->net->dev_addr[0] & 0x02)) ++ eth_hw_addr_random(dev->net); ++ ++ return status; ++} ++ + void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) + { + struct rndis_halt *halt; +@@ -615,7 +622,7 @@ static const struct driver_info zte_rndi + .description = "ZTE RNDIS device", + .flags = FLAG_ETHER | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT, + .data = RNDIS_DRIVER_DATA_DST_MAC_FIXUP, +- .bind = rndis_bind, ++ .bind = zte_rndis_bind, + .unbind = rndis_unbind, + .status = rndis_status, + .rx_fixup = rndis_rx_fixup, diff --git a/target/linux/generic/backport-5.15/850-v5.17-0004-PCI-aardvark-Clear-all-MSIs-at-setup.patch b/target/linux/generic/backport-5.15/850-v5.17-0004-PCI-aardvark-Clear-all-MSIs-at-setup.patch index 9967f46639..61dd8b8733 100644 --- a/target/linux/generic/backport-5.15/850-v5.17-0004-PCI-aardvark-Clear-all-MSIs-at-setup.patch +++ b/target/linux/generic/backport-5.15/850-v5.17-0004-PCI-aardvark-Clear-all-MSIs-at-setup.patch @@ -48,7 +48,7 @@ Signed-off-by: Lorenzo Pieralisi /* Enable summary interrupt for GIC SPI source */ reg = PCIE_IRQ_ALL_MASK & (~PCIE_IRQ_ENABLE_INTS_MASK); -@@ -1393,7 +1395,7 @@ static void advk_pcie_handle_msi(struct +@@ -1389,7 +1391,7 @@ static void advk_pcie_handle_msi(struct msi_mask = advk_readl(pcie, PCIE_MSI_MASK_REG); msi_val = advk_readl(pcie, PCIE_MSI_STATUS_REG); diff --git a/target/linux/generic/backport-5.15/850-v5.17-0005-PCI-aardvark-Comment-actions-in-driver-remove-method.patch b/target/linux/generic/backport-5.15/850-v5.17-0005-PCI-aardvark-Comment-actions-in-driver-remove-method.patch index e60fbd0cea..a022f3ec6c 100644 --- a/target/linux/generic/backport-5.15/850-v5.17-0005-PCI-aardvark-Comment-actions-in-driver-remove-method.patch +++ b/target/linux/generic/backport-5.15/850-v5.17-0005-PCI-aardvark-Comment-actions-in-driver-remove-method.patch @@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1685,11 +1685,13 @@ static int advk_pcie_remove(struct platf +@@ -1681,11 +1681,13 @@ static int advk_pcie_remove(struct platf struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); int i; diff --git a/target/linux/generic/backport-5.15/850-v5.17-0006-PCI-aardvark-Disable-bus-mastering-when-unbinding-dr.patch b/target/linux/generic/backport-5.15/850-v5.17-0006-PCI-aardvark-Disable-bus-mastering-when-unbinding-dr.patch index 7ac7db2ed3..9b8ae26dfe 100644 --- a/target/linux/generic/backport-5.15/850-v5.17-0006-PCI-aardvark-Disable-bus-mastering-when-unbinding-dr.patch +++ b/target/linux/generic/backport-5.15/850-v5.17-0006-PCI-aardvark-Disable-bus-mastering-when-unbinding-dr.patch @@ -19,7 +19,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1683,6 +1683,7 @@ static int advk_pcie_remove(struct platf +@@ -1679,6 +1679,7 @@ static int advk_pcie_remove(struct platf { struct advk_pcie *pcie = platform_get_drvdata(pdev); struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie); @@ -27,7 +27,7 @@ Signed-off-by: Lorenzo Pieralisi int i; /* Remove PCI bus with all devices */ -@@ -1691,6 +1692,11 @@ static int advk_pcie_remove(struct platf +@@ -1687,6 +1688,11 @@ static int advk_pcie_remove(struct platf pci_remove_root_bus(bridge->bus); pci_unlock_rescan_remove(); diff --git a/target/linux/generic/backport-5.15/850-v5.17-0007-PCI-aardvark-Mask-all-interrupts-when-unbinding-driv.patch b/target/linux/generic/backport-5.15/850-v5.17-0007-PCI-aardvark-Mask-all-interrupts-when-unbinding-driv.patch index 85c8b7059d..97173ee281 100644 --- a/target/linux/generic/backport-5.15/850-v5.17-0007-PCI-aardvark-Mask-all-interrupts-when-unbinding-driv.patch +++ b/target/linux/generic/backport-5.15/850-v5.17-0007-PCI-aardvark-Mask-all-interrupts-when-unbinding-driv.patch @@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1697,6 +1697,27 @@ static int advk_pcie_remove(struct platf +@@ -1693,6 +1693,27 @@ static int advk_pcie_remove(struct platf val &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); advk_writel(pcie, val, PCIE_CORE_CMD_STATUS_REG); diff --git a/target/linux/generic/backport-5.15/850-v5.17-0008-PCI-aardvark-Fix-memory-leak-in-driver-unbind.patch b/target/linux/generic/backport-5.15/850-v5.17-0008-PCI-aardvark-Fix-memory-leak-in-driver-unbind.patch index d24bd82273..e8611c82fe 100644 --- a/target/linux/generic/backport-5.15/850-v5.17-0008-PCI-aardvark-Fix-memory-leak-in-driver-unbind.patch +++ b/target/linux/generic/backport-5.15/850-v5.17-0008-PCI-aardvark-Fix-memory-leak-in-driver-unbind.patch @@ -21,7 +21,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1722,6 +1722,9 @@ static int advk_pcie_remove(struct platf +@@ -1718,6 +1718,9 @@ static int advk_pcie_remove(struct platf advk_pcie_remove_msi_irq_domain(pcie); advk_pcie_remove_irq_domain(pcie); diff --git a/target/linux/generic/backport-5.15/850-v5.17-0009-PCI-aardvark-Assert-PERST-when-unbinding-driver.patch b/target/linux/generic/backport-5.15/850-v5.17-0009-PCI-aardvark-Assert-PERST-when-unbinding-driver.patch index 1928a3c6f1..3e309159d0 100644 --- a/target/linux/generic/backport-5.15/850-v5.17-0009-PCI-aardvark-Assert-PERST-when-unbinding-driver.patch +++ b/target/linux/generic/backport-5.15/850-v5.17-0009-PCI-aardvark-Assert-PERST-when-unbinding-driver.patch @@ -20,7 +20,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1725,6 +1725,10 @@ static int advk_pcie_remove(struct platf +@@ -1721,6 +1721,10 @@ static int advk_pcie_remove(struct platf /* Free config space for emulated root bridge */ pci_bridge_emul_cleanup(&pcie->bridge); diff --git a/target/linux/generic/backport-5.15/850-v5.17-0010-PCI-aardvark-Disable-link-training-when-unbinding-dr.patch b/target/linux/generic/backport-5.15/850-v5.17-0010-PCI-aardvark-Disable-link-training-when-unbinding-dr.patch index f66635aaef..1a5725121b 100644 --- a/target/linux/generic/backport-5.15/850-v5.17-0010-PCI-aardvark-Disable-link-training-when-unbinding-dr.patch +++ b/target/linux/generic/backport-5.15/850-v5.17-0010-PCI-aardvark-Disable-link-training-when-unbinding-dr.patch @@ -20,7 +20,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1729,6 +1729,11 @@ static int advk_pcie_remove(struct platf +@@ -1725,6 +1725,11 @@ static int advk_pcie_remove(struct platf if (pcie->reset_gpio) gpiod_set_value_cansleep(pcie->reset_gpio, 1); diff --git a/target/linux/generic/backport-5.15/850-v5.17-0011-PCI-aardvark-Disable-common-PHY-when-unbinding-drive.patch b/target/linux/generic/backport-5.15/850-v5.17-0011-PCI-aardvark-Disable-common-PHY-when-unbinding-drive.patch index 263e81f354..4a4af186fd 100644 --- a/target/linux/generic/backport-5.15/850-v5.17-0011-PCI-aardvark-Disable-common-PHY-when-unbinding-drive.patch +++ b/target/linux/generic/backport-5.15/850-v5.17-0011-PCI-aardvark-Disable-common-PHY-when-unbinding-drive.patch @@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1738,6 +1738,9 @@ static int advk_pcie_remove(struct platf +@@ -1734,6 +1734,9 @@ static int advk_pcie_remove(struct platf for (i = 0; i < OB_WIN_COUNT; i++) advk_pcie_disable_ob_win(pcie, i); diff --git a/target/linux/generic/backport-5.15/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch b/target/linux/generic/backport-5.15/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch new file mode 100644 index 0000000000..39fdb32773 --- /dev/null +++ b/target/linux/generic/backport-5.15/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch @@ -0,0 +1,58 @@ +From a79a5613e1907e1bf09bb6ba6fd5ff43b66c1afe Mon Sep 17 00:00:00 2001 +From: Lech Perczak +Date: Fri, 1 Apr 2022 22:03:55 +0200 +Subject: [PATCH 1/3] cdc_ether: export usbnet_cdc_zte_rx_fixup +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit bfe9b9d2df66 ("cdc_ether: Improve ZTE MF823/831/910 handling") +introduces a workaround for certain ZTE modems reporting invalid MAC +addresses over CDC-ECM. +The same issue was present on their RNDIS interface,which was fixed in +commit a5a18bdf7453 ("rndis_host: Set valid random MAC on buggy devices"). + +However, internal modem of ZTE MF286R router, on its RNDIS interface, also +exhibits a second issue fixed already in CDC-ECM, of the device not +respecting configured random MAC address. In order to share the fixup for +this with rndis_host driver, export the workaround function, which will +be re-used in the following commit in rndis_host. + +Cc: Kristian Evensen +Cc: Bjørn Mork +Cc: Oliver Neukum +Signed-off-by: Lech Perczak +--- + drivers/net/usb/cdc_ether.c | 3 ++- + include/linux/usb/usbnet.h | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -479,7 +479,7 @@ static int usbnet_cdc_zte_bind(struct us + * device MAC address has been updated). Always set MAC address to that of the + * device. + */ +-static int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ++int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb) + { + if (skb->len < ETH_HLEN || !(skb->data[0] & 0x02)) + return 1; +@@ -489,6 +489,7 @@ static int usbnet_cdc_zte_rx_fixup(struc + + return 1; + } ++EXPORT_SYMBOL_GPL(usbnet_cdc_zte_rx_fixup); + + /* Ensure correct link state + * +--- a/include/linux/usb/usbnet.h ++++ b/include/linux/usb/usbnet.h +@@ -214,6 +214,7 @@ extern int usbnet_ether_cdc_bind(struct + extern int usbnet_cdc_bind(struct usbnet *, struct usb_interface *); + extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *); + extern void usbnet_cdc_status(struct usbnet *, struct urb *); ++extern int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb); + + /* CDC and RNDIS support the same host-chosen packet filters for IN transfers */ + #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ diff --git a/target/linux/generic/backport-5.15/881-v5.19-rndis_host-enable-the-bogus-MAC-fixup-for-ZTE-device.patch b/target/linux/generic/backport-5.15/881-v5.19-rndis_host-enable-the-bogus-MAC-fixup-for-ZTE-device.patch new file mode 100644 index 0000000000..7da2280cd9 --- /dev/null +++ b/target/linux/generic/backport-5.15/881-v5.19-rndis_host-enable-the-bogus-MAC-fixup-for-ZTE-device.patch @@ -0,0 +1,118 @@ +From aa8aff10e969aca0cb64f5e54ff7489355582667 Mon Sep 17 00:00:00 2001 +From: Lech Perczak +Date: Fri, 1 Apr 2022 22:04:01 +0200 +Subject: [PATCH 2/3] rndis_host: enable the bogus MAC fixup for ZTE devices + from cdc_ether +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Certain ZTE modems, namely: MF823. MF831, MF910, built-in modem from +MF286R, expose both CDC-ECM and RNDIS network interfaces. +They have a trait of ignoring the locally-administered MAC address +configured on the interface both in CDC-ECM and RNDIS part, +and this leads to dropping of incoming traffic by the host. +However, the workaround was only present in CDC-ECM, and MF286R +explicitly requires it in RNDIS mode. + +Re-use the workaround in rndis_host as well, to fix operation of MF286R +module, some versions of which expose only the RNDIS interface. Do so by +introducing new flag, RNDIS_DRIVER_DATA_DST_MAC_FIXUP, and testing for it +in rndis_rx_fixup. This is required, as RNDIS uses frame batching, and all +of the packets inside the batch need the fixup. This might introduce a +performance penalty, because test is done for every returned Ethernet +frame. + +Apply the workaround to both "flavors" of RNDIS interfaces, as older ZTE +modems, like MF823 found in the wild, report the USB_CLASS_COMM class +interfaces, while MF286R reports USB_CLASS_WIRELESS_CONTROLLER. + +Suggested-by: Bjørn Mork +Cc: Kristian Evensen +Cc: Oliver Neukum +Signed-off-by: Lech Perczak +--- + drivers/net/usb/rndis_host.c | 32 ++++++++++++++++++++++++++++++++ + include/linux/usb/rndis_host.h | 1 + + 2 files changed, 33 insertions(+) + +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -485,10 +485,14 @@ EXPORT_SYMBOL_GPL(rndis_unbind); + */ + int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) + { ++ bool dst_mac_fixup; ++ + /* This check is no longer done by usbnet */ + if (skb->len < dev->net->hard_header_len) + return 0; + ++ dst_mac_fixup = !!(dev->driver_info->data & RNDIS_DRIVER_DATA_DST_MAC_FIXUP); ++ + /* peripheral may have batched packets to us... */ + while (likely(skb->len)) { + struct rndis_data_hdr *hdr = (void *)skb->data; +@@ -523,10 +527,17 @@ int rndis_rx_fixup(struct usbnet *dev, s + break; + skb_pull(skb, msg_len - sizeof *hdr); + skb_trim(skb2, data_len); ++ ++ if (unlikely(dst_mac_fixup)) ++ usbnet_cdc_zte_rx_fixup(dev, skb2); ++ + usbnet_skb_return(dev, skb2); + } + + /* caller will usbnet_skb_return the remaining packet */ ++ if (unlikely(dst_mac_fixup)) ++ usbnet_cdc_zte_rx_fixup(dev, skb); ++ + return 1; + } + EXPORT_SYMBOL_GPL(rndis_rx_fixup); +@@ -600,6 +611,17 @@ static const struct driver_info rndis_po + .tx_fixup = rndis_tx_fixup, + }; + ++static const struct driver_info zte_rndis_info = { ++ .description = "ZTE RNDIS device", ++ .flags = FLAG_ETHER | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT, ++ .data = RNDIS_DRIVER_DATA_DST_MAC_FIXUP, ++ .bind = rndis_bind, ++ .unbind = rndis_unbind, ++ .status = rndis_status, ++ .rx_fixup = rndis_rx_fixup, ++ .tx_fixup = rndis_tx_fixup, ++}; ++ + /*-------------------------------------------------------------------------*/ + + static const struct usb_device_id products [] = { +@@ -614,6 +636,16 @@ static const struct usb_device_id produc + USB_CLASS_COMM, 2 /* ACM */, 0x0ff), + .driver_info = (unsigned long)&rndis_info, + }, { ++ /* ZTE WWAN modules */ ++ USB_VENDOR_AND_INTERFACE_INFO(0x19d2, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long)&zte_rndis_info, ++}, { ++ /* ZTE WWAN modules, ACM flavour */ ++ USB_VENDOR_AND_INTERFACE_INFO(0x19d2, ++ USB_CLASS_COMM, 2 /* ACM */, 0x0ff), ++ .driver_info = (unsigned long)&zte_rndis_info, ++}, { + /* RNDIS is MSFT's un-official variant of CDC ACM */ + USB_INTERFACE_INFO(USB_CLASS_COMM, 2 /* ACM */, 0x0ff), + .driver_info = (unsigned long) &rndis_info, +--- a/include/linux/usb/rndis_host.h ++++ b/include/linux/usb/rndis_host.h +@@ -197,6 +197,7 @@ struct rndis_keepalive_c { /* IN (option + + /* Flags for driver_info::data */ + #define RNDIS_DRIVER_DATA_POLL_STATUS 1 /* poll status before control */ ++#define RNDIS_DRIVER_DATA_DST_MAC_FIXUP 2 /* device ignores configured MAC address */ + + extern void rndis_status(struct usbnet *dev, struct urb *urb); + extern int diff --git a/target/linux/generic/backport-5.15/882-v5.19-rndis_host-limit-scope-of-bogus-MAC-address-detectio.patch b/target/linux/generic/backport-5.15/882-v5.19-rndis_host-limit-scope-of-bogus-MAC-address-detectio.patch new file mode 100644 index 0000000000..ebe7a43fd3 --- /dev/null +++ b/target/linux/generic/backport-5.15/882-v5.19-rndis_host-limit-scope-of-bogus-MAC-address-detectio.patch @@ -0,0 +1,63 @@ +From 9bfb4bcda7ba32d73ea322ea56a8ebe32e9247f6 Mon Sep 17 00:00:00 2001 +From: Lech Perczak +Date: Sat, 2 Apr 2022 02:19:57 +0200 +Subject: [PATCH 3/3] rndis_host: limit scope of bogus MAC address detection to + ZTE devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Reporting of bogus MAC addresses and ignoring configuration of new +destination address wasn't observed outside of a range of ZTE devices, +among which this seems to be the common bug. Align rndis_host driver +with implementation found in cdc_ether, which also limits this workaround +to ZTE devices. + +Suggested-by: Bjørn Mork +Cc: Kristian Evensen +Cc: Oliver Neukum +Signed-off-by: Lech Perczak +--- + drivers/net/usb/rndis_host.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -418,10 +418,7 @@ generic_rndis_bind(struct usbnet *dev, s + goto halt_fail_and_release; + } + +- if (bp[0] & 0x02) +- eth_hw_addr_random(net); +- else +- ether_addr_copy(net->dev_addr, bp); ++ ether_addr_copy(net->dev_addr, bp); + + /* set a nonzero filter to enable data transfers */ + memset(u.set, 0, sizeof *u.set); +@@ -463,6 +460,16 @@ static int rndis_bind(struct usbnet *dev + return generic_rndis_bind(dev, intf, FLAG_RNDIS_PHYM_NOT_WIRELESS); + } + ++static int zte_rndis_bind(struct usbnet *dev, struct usb_interface *intf) ++{ ++ int status = rndis_bind(dev, intf); ++ ++ if (!status && (dev->net->dev_addr[0] & 0x02)) ++ eth_hw_addr_random(dev->net); ++ ++ return status; ++} ++ + void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) + { + struct rndis_halt *halt; +@@ -615,7 +622,7 @@ static const struct driver_info zte_rndi + .description = "ZTE RNDIS device", + .flags = FLAG_ETHER | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT, + .data = RNDIS_DRIVER_DATA_DST_MAC_FIXUP, +- .bind = rndis_bind, ++ .bind = zte_rndis_bind, + .unbind = rndis_unbind, + .status = rndis_status, + .rx_fixup = rndis_rx_fixup, diff --git a/target/linux/generic/hack-5.15/661-kernel-ct-size-the-hashtable-more-adequately.patch b/target/linux/generic/hack-5.15/661-kernel-ct-size-the-hashtable-more-adequately.patch index a003fc2944..134e2100c8 100644 --- a/target/linux/generic/hack-5.15/661-kernel-ct-size-the-hashtable-more-adequately.patch +++ b/target/linux/generic/hack-5.15/661-kernel-ct-size-the-hashtable-more-adequately.patch @@ -14,7 +14,7 @@ Signed-off-by: Rui Salvaterra --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -2676,7 +2676,7 @@ int nf_conntrack_init_start(void) +@@ -2727,7 +2727,7 @@ int nf_conntrack_init_start(void) if (!nf_conntrack_htable_size) { nf_conntrack_htable_size diff --git a/target/linux/generic/pending-5.10/710-bridge-add-knob-for-filtering-rx-tx-BPDU-pack.patch b/target/linux/generic/pending-5.10/710-bridge-add-knob-for-filtering-rx-tx-BPDU-pack.patch index ecd6e9e7a2..106f7d3560 100644 --- a/target/linux/generic/pending-5.10/710-bridge-add-knob-for-filtering-rx-tx-BPDU-pack.patch +++ b/target/linux/generic/pending-5.10/710-bridge-add-knob-for-filtering-rx-tx-BPDU-pack.patch @@ -164,7 +164,7 @@ Signed-off-by: Felix Fietkau struct rtnl_link { rtnl_doit_func doit; -@@ -4684,7 +4684,9 @@ int ndo_dflt_bridge_getlink(struct sk_bu +@@ -4695,7 +4695,9 @@ int ndo_dflt_bridge_getlink(struct sk_bu brport_nla_put_flag(skb, flags, mask, IFLA_BRPORT_MCAST_FLOOD, BR_MCAST_FLOOD) || brport_nla_put_flag(skb, flags, mask, diff --git a/target/linux/generic/pending-5.10/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch b/target/linux/generic/pending-5.10/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch index 6d08456d47..b2d32f5566 100644 --- a/target/linux/generic/pending-5.10/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch +++ b/target/linux/generic/pending-5.10/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch @@ -27,7 +27,7 @@ Signed-off-by: Marek Behún --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c -@@ -1395,7 +1395,7 @@ static void advk_pcie_remove_irq_domain( +@@ -1391,7 +1391,7 @@ static void advk_pcie_remove_irq_domain( static void advk_pcie_handle_msi(struct advk_pcie *pcie) { u32 msi_val, msi_mask, msi_status, msi_idx; @@ -36,7 +36,7 @@ Signed-off-by: Marek Behún msi_mask = advk_readl(pcie, PCIE_MSI_MASK_REG); msi_val = advk_readl(pcie, PCIE_MSI_STATUS_REG); -@@ -1405,13 +1405,12 @@ static void advk_pcie_handle_msi(struct +@@ -1401,13 +1401,12 @@ static void advk_pcie_handle_msi(struct if (!(BIT(msi_idx) & msi_status)) continue; diff --git a/target/linux/generic/pending-5.10/850-0003-PCI-aardvark-Fix-support-for-MSI-interrupts.patch b/target/linux/generic/pending-5.10/850-0003-PCI-aardvark-Fix-support-for-MSI-interrupts.patch deleted file mode 100644 index 813cbe5148..0000000000 --- a/target/linux/generic/pending-5.10/850-0003-PCI-aardvark-Fix-support-for-MSI-interrupts.patch +++ /dev/null @@ -1,72 +0,0 @@ -From bb03b126ea6c9e57177b537dd022246fa5dbef16 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Fri, 12 Feb 2021 16:24:07 +0100 -Subject: [PATCH] PCI: aardvark: Fix support for MSI interrupts -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Aardvark hardware supports Multi-MSI and MSI_FLAG_MULTI_PCI_MSI is already -set for the MSI chip. But when allocating MSI interrupt numbers for -Multi-MSI, the numbers need to be properly aligned, otherwise endpoint -devices send MSI interrupt with incorrect numbers. - -Fix this issue by using function bitmap_find_free_region() instead of -bitmap_find_next_zero_area(). - -To ensure that aligned MSI interrupt numbers are used by endpoint devices, -we cannot use Linux virtual irq numbers (as they are random and not -properly aligned). Instead we need to use the aligned hwirq numbers. - -This change fixes receiving MSI interrupts on Armada 3720 boards and -allows using NVMe disks which use Multi-MSI feature with 3 interrupts. - -Without this NVMe disks freeze booting as linux nvme-core.c is waiting -60s for an interrupt. - -Signed-off-by: Pali Rohár -Signed-off-by: Marek Behún ---- - drivers/pci/controller/pci-aardvark.c | 16 ++++++---------- - 1 file changed, 6 insertions(+), 10 deletions(-) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -1191,7 +1191,7 @@ static void advk_msi_irq_compose_msi_msg - - msg->address_lo = lower_32_bits(msi_msg); - msg->address_hi = upper_32_bits(msi_msg); -- msg->data = data->irq; -+ msg->data = data->hwirq; - } - - static int advk_msi_set_affinity(struct irq_data *irq_data, -@@ -1208,15 +1208,11 @@ static int advk_msi_irq_domain_alloc(str - int hwirq, i; - - mutex_lock(&pcie->msi_used_lock); -- hwirq = bitmap_find_next_zero_area(pcie->msi_used, MSI_IRQ_NUM, -- 0, nr_irqs, 0); -- if (hwirq >= MSI_IRQ_NUM) { -- mutex_unlock(&pcie->msi_used_lock); -- return -ENOSPC; -- } -- -- bitmap_set(pcie->msi_used, hwirq, nr_irqs); -+ hwirq = bitmap_find_free_region(pcie->msi_used, MSI_IRQ_NUM, -+ order_base_2(nr_irqs)); - mutex_unlock(&pcie->msi_used_lock); -+ if (hwirq < 0) -+ return -ENOSPC; - - for (i = 0; i < nr_irqs; i++) - irq_domain_set_info(domain, virq + i, hwirq + i, -@@ -1234,7 +1230,7 @@ static void advk_msi_irq_domain_free(str - struct advk_pcie *pcie = domain->host_data; - - mutex_lock(&pcie->msi_used_lock); -- bitmap_clear(pcie->msi_used, d->hwirq, nr_irqs); -+ bitmap_release_region(pcie->msi_used, d->hwirq, order_base_2(nr_irqs)); - mutex_unlock(&pcie->msi_used_lock); - } - diff --git a/target/linux/generic/pending-5.15/710-bridge-add-knob-for-filtering-rx-tx-BPDU-pack.patch b/target/linux/generic/pending-5.15/710-bridge-add-knob-for-filtering-rx-tx-BPDU-pack.patch index f30887fccb..84a3ee8e60 100644 --- a/target/linux/generic/pending-5.15/710-bridge-add-knob-for-filtering-rx-tx-BPDU-pack.patch +++ b/target/linux/generic/pending-5.15/710-bridge-add-knob-for-filtering-rx-tx-BPDU-pack.patch @@ -161,7 +161,7 @@ Signed-off-by: Felix Fietkau struct rtnl_link { rtnl_doit_func doit; -@@ -4689,7 +4689,9 @@ int ndo_dflt_bridge_getlink(struct sk_bu +@@ -4700,7 +4700,9 @@ int ndo_dflt_bridge_getlink(struct sk_bu brport_nla_put_flag(skb, flags, mask, IFLA_BRPORT_MCAST_FLOOD, BR_MCAST_FLOOD) || brport_nla_put_flag(skb, flags, mask, diff --git a/target/linux/generic/pending-5.15/850-0003-PCI-aardvark-Fix-support-for-MSI-interrupts.patch b/target/linux/generic/pending-5.15/850-0003-PCI-aardvark-Fix-support-for-MSI-interrupts.patch deleted file mode 100644 index 950f3a8abf..0000000000 --- a/target/linux/generic/pending-5.15/850-0003-PCI-aardvark-Fix-support-for-MSI-interrupts.patch +++ /dev/null @@ -1,72 +0,0 @@ -From bb03b126ea6c9e57177b537dd022246fa5dbef16 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Pali=20Roh=C3=A1r?= -Date: Fri, 12 Feb 2021 16:24:07 +0100 -Subject: [PATCH] PCI: aardvark: Fix support for MSI interrupts -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Aardvark hardware supports Multi-MSI and MSI_FLAG_MULTI_PCI_MSI is already -set for the MSI chip. But when allocating MSI interrupt numbers for -Multi-MSI, the numbers need to be properly aligned, otherwise endpoint -devices send MSI interrupt with incorrect numbers. - -Fix this issue by using function bitmap_find_free_region() instead of -bitmap_find_next_zero_area(). - -To ensure that aligned MSI interrupt numbers are used by endpoint devices, -we cannot use Linux virtual irq numbers (as they are random and not -properly aligned). Instead we need to use the aligned hwirq numbers. - -This change fixes receiving MSI interrupts on Armada 3720 boards and -allows using NVMe disks which use Multi-MSI feature with 3 interrupts. - -Without this NVMe disks freeze booting as linux nvme-core.c is waiting -60s for an interrupt. - -Signed-off-by: Pali Rohár -Signed-off-by: Marek Behún ---- - drivers/pci/controller/pci-aardvark.c | 16 ++++++---------- - 1 file changed, 6 insertions(+), 10 deletions(-) - ---- a/drivers/pci/controller/pci-aardvark.c -+++ b/drivers/pci/controller/pci-aardvark.c -@@ -1184,7 +1184,7 @@ static void advk_msi_irq_compose_msi_msg - - msg->address_lo = lower_32_bits(msi_msg); - msg->address_hi = upper_32_bits(msi_msg); -- msg->data = data->irq; -+ msg->data = data->hwirq; - } - - static int advk_msi_set_affinity(struct irq_data *irq_data, -@@ -1201,15 +1201,11 @@ static int advk_msi_irq_domain_alloc(str - int hwirq, i; - - mutex_lock(&pcie->msi_used_lock); -- hwirq = bitmap_find_next_zero_area(pcie->msi_used, MSI_IRQ_NUM, -- 0, nr_irqs, 0); -- if (hwirq >= MSI_IRQ_NUM) { -- mutex_unlock(&pcie->msi_used_lock); -- return -ENOSPC; -- } -- -- bitmap_set(pcie->msi_used, hwirq, nr_irqs); -+ hwirq = bitmap_find_free_region(pcie->msi_used, MSI_IRQ_NUM, -+ order_base_2(nr_irqs)); - mutex_unlock(&pcie->msi_used_lock); -+ if (hwirq < 0) -+ return -ENOSPC; - - for (i = 0; i < nr_irqs; i++) - irq_domain_set_info(domain, virq + i, hwirq + i, -@@ -1227,7 +1223,7 @@ static void advk_msi_irq_domain_free(str - struct advk_pcie *pcie = domain->host_data; - - mutex_lock(&pcie->msi_used_lock); -- bitmap_clear(pcie->msi_used, d->hwirq, nr_irqs); -+ bitmap_release_region(pcie->msi_used, d->hwirq, order_base_2(nr_irqs)); - mutex_unlock(&pcie->msi_used_lock); - } - diff --git a/target/linux/generic/pending-5.15/920-mangle_bootargs.patch b/target/linux/generic/pending-5.15/920-mangle_bootargs.patch index d3f3a1c639..1fb0182f1e 100644 --- a/target/linux/generic/pending-5.15/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-5.15/920-mangle_bootargs.patch @@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz help --- a/init/main.c +++ b/init/main.c -@@ -614,6 +614,29 @@ static inline void setup_nr_cpu_ids(void +@@ -615,6 +615,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -954,6 +977,7 @@ asmlinkage __visible void __init __no_sa +@@ -955,6 +978,7 @@ asmlinkage __visible void __init __no_sa pr_notice("%s", linux_banner); early_security_init(); setup_arch(&command_line); diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 4a474766d5..398ddf9a29 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -17,9 +17,6 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in - askey,rt4230w-rev6) - caldata_extract "0:ART" 0x1000 0x2f20 - ;; asrock,g10) caldata_extract "0:art" 0x1000 0x2f20 ;; @@ -40,9 +37,6 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-pci-0001:01:00.0.bin") case $board in - askey,rt4230w-rev6) - caldata_extract "0:ART" 0x5000 0x2f20 - ;; asrock,g10) caldata_extract "0:art" 0x5000 0x2f20 ;; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi index f1681f4c02..29226ca275 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi @@ -49,31 +49,31 @@ * Voltage thresholds are */ opp-384000000 { - opp-microvolt-speed0-pvs0-v0 = <950000 902500 997500>; - opp-microvolt-speed0-pvs1-v0 = <900000 855000 945000>; - opp-microvolt-speed0-pvs2-v0 = <850000 807500 892500>; - opp-microvolt-speed0-pvs3-v0 = <800000 760000 840000>; + opp-microvolt-speed0-pvs0-v0 = <1000000 950000 1050000>; + opp-microvolt-speed0-pvs1-v0 = < 925000 878750 971250>; + opp-microvolt-speed0-pvs2-v0 = < 875000 831250 918750>; + opp-microvolt-speed0-pvs3-v0 = < 800000 760000 840000>; }; opp-600000000 { - opp-microvolt-speed0-pvs0-v0 = <1000000 950000 1050000>; - opp-microvolt-speed0-pvs1-v0 = <950000 945000 955000>; - opp-microvolt-speed0-pvs2-v0 = <900000 895000 905000>; - opp-microvolt-speed0-pvs3-v0 = <850000 845000 855000>; + opp-microvolt-speed0-pvs0-v0 = <1050000 997500 1102500>; + opp-microvolt-speed0-pvs1-v0 = < 975000 926250 1023750>; + opp-microvolt-speed0-pvs2-v0 = < 925000 878750 971250>; + opp-microvolt-speed0-pvs3-v0 = < 850000 807500 892500>; }; opp-800000000 { - opp-microvolt-speed0-pvs0-v0 = <1050000 997500 1102500>; - opp-microvolt-speed0-pvs1-v0 = <1000000 995000 1005000>; - opp-microvolt-speed0-pvs2-v0 = <950000 945000 955000>; - opp-microvolt-speed0-pvs3-v0 = <900000 895000 905000>; + opp-microvolt-speed0-pvs0-v0 = <1100000 1045000 1155000>; + opp-microvolt-speed0-pvs1-v0 = <1025000 973750 1076250>; + opp-microvolt-speed0-pvs2-v0 = < 995000 945250 1044750>; + opp-microvolt-speed0-pvs3-v0 = < 900000 855000 945000>; }; opp-1000000000 { - opp-microvolt-speed0-pvs0-v0 = <1100000 1045000 1155000>; - opp-microvolt-speed0-pvs1-v0 = <1050000 997500 1102500>; - opp-microvolt-speed0-pvs2-v0 = <1000000 995000 1005000>; - opp-microvolt-speed0-pvs3-v0 = <950000 945000 955000>; + opp-microvolt-speed0-pvs0-v0 = <1150000 1092500 1207500>; + opp-microvolt-speed0-pvs1-v0 = <1075000 1021250 1128750>; + opp-microvolt-speed0-pvs2-v0 = <1025000 973750 1076250>; + opp-microvolt-speed0-pvs3-v0 = < 950000 902500 997500>; }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts index 94b7ed6277..0970eaf0ec 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts @@ -148,12 +148,10 @@ }; &usb3_0 { - clocks = <&gcc USB30_1_MASTER_CLK>; status = "okay"; }; &usb3_1 { - clocks = <&gcc USB30_0_MASTER_CLK>; status = "okay"; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts index d700149939..96163331f3 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts @@ -96,6 +96,35 @@ input-disable; }; }; + + spi_pins: spi_pins { + cs { + pins = "gpio20"; + drive-strength = <12>; + }; + }; +}; + +&gsbi5 { + qcom,mode = ; + status = "okay"; + + spi@1a280000 { + status = "okay"; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "everspin,mr25h256"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <40000000>; + reg = <0>; + }; + }; }; &nand { @@ -122,100 +151,139 @@ reg = <0x0000000 0x0040000>; read-only; }; + partition@40000 { label = "0:MIBIB"; reg = <0x0040000 0x0140000>; read-only; }; + partition@180000 { label = "0:SBL2"; reg = <0x0180000 0x0140000>; read-only; }; + partition@2c0000 { label = "0:SBL3"; reg = <0x02c0000 0x0280000>; read-only; }; + partition@540000 { label = "0:DDRCONFIG"; reg = <0x0540000 0x0120000>; read-only; }; + partition@660000 { label = "0:SSD"; reg = <0x0660000 0x0120000>; read-only; }; + partition@780000 { label = "0:TZ"; reg = <0x0780000 0x0280000>; read-only; }; + partition@a00000 { label = "0:RPM"; reg = <0x0a00000 0x0280000>; read-only; }; + partition@c80000 { label = "0:APPSBL"; reg = <0x0c80000 0x0500000>; read-only; }; + partition@1180000 { label = "0:APPSBLENV"; reg = <0x1180000 0x0080000>; }; - ART: partition@1200000 { + + partition@1200000 { label = "0:ART"; reg = <0x1200000 0x0140000>; read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_ART_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_ART_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_ART_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_ART_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; + partition@1340000 { label = "0:BOOTCONFIG"; reg = <0x1340000 0x0060000>; read-only; }; + partition@13a0000 { label = "0:SBL2_1"; reg = <0x13a0000 0x0140000>; read-only; }; + partition@14e0000 { label = "0:SBL3_1"; reg = <0x14e0000 0x0280000>; read-only; }; + partition@1760000 { label = "0:DDRCONFIG_1"; reg = <0x1760000 0x0120000>; read-only; }; + partition@1880000 { label = "0:SSD_1"; reg = <0x1880000 0x0120000>; read-only; }; + partition@19a0000 { label = "0:TZ_1"; reg = <0x19a0000 0x0280000>; read-only; }; + partition@1c20000 { label = "0:RPM_1"; reg = <0x1c20000 0x0280000>; read-only; }; + partition@1ea0000 { label = "0:BOOTCONFIG1"; reg = <0x1ea0000 0x0060000>; read-only; }; + partition@1f00000 { label = "0:APPSBL_1"; reg = <0x1f00000 0x0500000>; read-only; }; + partition@2400000 { label = "ubi"; reg = <0x2400000 0x1a000000>; @@ -283,12 +351,10 @@ &usb3_0 { status = "okay"; - clocks = <&gcc USB30_1_MASTER_CLK>; }; &usb3_1 { status = "okay"; - clocks = <&gcc USB30_0_MASTER_CLK>; }; &pcie0 { @@ -296,6 +362,21 @@ reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_HIGH>; pinctrl-0 = <&pcie0_pins>; pinctrl-names = "default"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@1,0 { + compatible = "pci168c,0046"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&precal_ART_1000>; + nvmem-cell-names = "pre-calibration"; + }; + }; }; &pcie1 { @@ -304,18 +385,19 @@ pinctrl-0 = <&pcie1_pins>; pinctrl-names = "default"; max-link-speed = <1>; -}; -&ART { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; - macaddr_ART_0: macaddr@0 { - reg = <0x0 0x6>; - }; + wifi1: wifi@1,0 { + compatible = "pci168c,0046"; + reg = <0x00010000 0 0 0 0>; - macaddr_ART_6: macaddr@6 { - reg = <0x6 0x6>; + nvmem-cells = <&precal_ART_5000>; + nvmem-cell-names = "pre-calibration"; + }; }; }; diff --git a/target/linux/ipq806x/patches-5.10/083-ipq8064-dtsi-additions.patch b/target/linux/ipq806x/patches-5.10/083-ipq8064-dtsi-additions.patch index e74e6ad55d..a1a97ae941 100644 --- a/target/linux/ipq806x/patches-5.10/083-ipq8064-dtsi-additions.patch +++ b/target/linux/ipq806x/patches-5.10/083-ipq8064-dtsi-additions.patch @@ -681,7 +681,7 @@ + + hs_phy_0: hs_phy_0 { + compatible = "qcom,ipq806x-usb-phy-hs"; -+ reg = <0x110f8800 0x30>; ++ reg = <0x100f8800 0x30>; + clocks = <&gcc USB30_0_UTMI_CLK>; + clock-names = "ref"; + #phy-cells = <0>; @@ -689,17 +689,17 @@ + + ss_phy_0: ss_phy_0 { + compatible = "qcom,ipq806x-usb-phy-ss"; -+ reg = <0x110f8830 0x30>; ++ reg = <0x100f8830 0x30>; + clocks = <&gcc USB30_0_MASTER_CLK>; + clock-names = "ref"; + #phy-cells = <0>; + }; + -+ usb3_0: usb3@110f8800 { ++ usb3_0: usb3@100f8800 { + compatible = "qcom,dwc3", "syscon"; + #address-cells = <1>; + #size-cells = <1>; -+ reg = <0x110f8800 0x8000>; ++ reg = <0x100f8800 0x8000>; + clocks = <&gcc USB30_0_MASTER_CLK>; + clock-names = "core"; + @@ -710,10 +710,10 @@ + + status = "disabled"; + -+ dwc3_0: dwc3@11000000 { ++ dwc3_0: dwc3@10000000 { + compatible = "snps,dwc3"; -+ reg = <0x11000000 0xcd00>; -+ interrupts = ; ++ reg = <0x10000000 0xcd00>; ++ interrupts = ; + phys = <&hs_phy_0>, <&ss_phy_0>; + phy-names = "usb2-phy", "usb3-phy"; + dr_mode = "host"; @@ -723,7 +723,7 @@ + + hs_phy_1: hs_phy_1 { + compatible = "qcom,ipq806x-usb-phy-hs"; -+ reg = <0x100f8800 0x30>; ++ reg = <0x110f8800 0x30>; + clocks = <&gcc USB30_1_UTMI_CLK>; + clock-names = "ref"; + #phy-cells = <0>; @@ -731,17 +731,17 @@ + + ss_phy_1: ss_phy_1 { + compatible = "qcom,ipq806x-usb-phy-ss"; -+ reg = <0x100f8830 0x30>; ++ reg = <0x110f8830 0x30>; + clocks = <&gcc USB30_1_MASTER_CLK>; + clock-names = "ref"; + #phy-cells = <0>; + }; + -+ usb3_1: usb3@100f8800 { ++ usb3_1: usb3@110f8800 { + compatible = "qcom,dwc3", "syscon"; + #address-cells = <1>; + #size-cells = <1>; -+ reg = <0x100f8800 0x8000>; ++ reg = <0x110f8800 0x8000>; + clocks = <&gcc USB30_1_MASTER_CLK>; + clock-names = "core"; + @@ -752,10 +752,10 @@ + + status = "disabled"; + -+ dwc3_1: dwc3@10000000 { ++ dwc3_1: dwc3@11000000 { + compatible = "snps,dwc3"; -+ reg = <0x10000000 0xcd00>; -+ interrupts = ; ++ reg = <0x11000000 0xcd00>; ++ interrupts = ; + phys = <&hs_phy_1>, <&ss_phy_1>; + phy-names = "usb2-phy", "usb3-phy"; + dr_mode = "host"; diff --git a/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch b/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch index dd1e506e5b..77667b139e 100644 --- a/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch +++ b/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch @@ -50,7 +50,7 @@ Signed-off-by: David S. Miller if (priv->hw->pcs != STMMAC_PCS_TBI && --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -@@ -617,6 +617,12 @@ stmmac_probe_config_dt(struct platform_d +@@ -616,6 +616,12 @@ stmmac_probe_config_dt(struct platform_d plat->stmmac_rst = NULL; } diff --git a/target/linux/ipq806x/patches-5.15/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-5.15/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index 9cc5719078..39ec7b8028 100644 --- a/target/linux/ipq806x/patches-5.15/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-5.15/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -178,7 +178,7 @@ Signed-off-by: Adrian Panella } --- a/init/main.c +++ b/init/main.c -@@ -112,6 +112,10 @@ +@@ -113,6 +113,10 @@ #include @@ -189,7 +189,7 @@ Signed-off-by: Adrian Panella static int kernel_init(void *); extern void init_IRQ(void); -@@ -991,6 +995,18 @@ asmlinkage __visible void __init __no_sa +@@ -992,6 +996,18 @@ asmlinkage __visible void __init __no_sa pr_notice("Kernel command line: %s\n", saved_command_line); /* parameters may set static keys */ jump_label_init(); diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts index 8881745819..063d6dca5e 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts @@ -7,11 +7,23 @@ model = "AVM FRITZ!Box 7360 V2"; }; -&state_default { - pcie-rst { - lantiq,pins = "io21"; - lantiq,pull = <0>; - lantiq,output = <1>; +&gpio { + pinctrl-names = "default"; + pinctrl-0 = <&state_default>; + + state_default: pinmux { + pcie-rst { + lantiq,pins = "io21"; + lantiq,pull = <0>; + lantiq,output = <1>; + }; + + phy-rst { + lantiq,pins = "io37", "io44"; + lantiq,pull = <0>; + lantiq,open-drain; + lantiq,output = <1>; + }; }; }; @@ -58,6 +70,14 @@ mac-address-increment = <(-2)>; }; +&phy0 { + reset-gpios = <&gpio 37 GPIO_ACTIVE_LOW>; +}; + +&phy1 { + reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; +}; + &urlader { compatible = "nvmem-cells"; #address-cells = <1>; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts index 945c553688..31523eaae0 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts @@ -7,12 +7,25 @@ model = "AVM FRITZ!Box 7360 SL"; }; -&state_default { - pcie-rst { - lantiq,pins = "io38"; - lantiq,pull = <0>; - lantiq,output = <1>; +&gpio { + pinctrl-names = "default"; + pinctrl-0 = <&state_default>; + + state_default: pinmux { + pcie-rst { + lantiq,pins = "io21"; + lantiq,pull = <0>; + lantiq,output = <1>; + }; + + phy-rst { + lantiq,pins = "io37", "io44"; + lantiq,pull = <0>; + lantiq,open-drain; + lantiq,output = <1>; + }; }; + }; &localbus { @@ -58,6 +71,14 @@ mac-address-increment = <(-2)>; }; +&phy0 { + reset-gpios = <&gpio 37 GPIO_ACTIVE_LOW>; +}; + +&phy1 { + reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; +}; + &urlader { compatible = "nvmem-cells"; #address-cells = <1>; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts index c75edd933c..7995b34971 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts @@ -7,12 +7,25 @@ model = "AVM FRITZ!Box 7362 SL"; }; -&state_default { - pcie-rst { - lantiq,pins = "io21"; - lantiq,open-drain = <1>; - lantiq,output = <1>; +&gpio { + pinctrl-names = "default"; + pinctrl-0 = <&state_default>; + + state_default: pinmux { + pcie-rst { + lantiq,pins = "io21"; + lantiq,pull = <0>; + lantiq,output = <1>; + }; + + phy-rst { + lantiq,pins = "io44", "io45"; + lantiq,pull = <0>; + lantiq,open-drain; + lantiq,output = <1>; + }; }; + }; &spi { @@ -96,6 +109,14 @@ mac-address-increment = <(-2)>; }; +&phy0 { + reset-gpios = <&gpio 45 GPIO_ACTIVE_LOW>; +}; + +&phy1 { + reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; +}; + &urlader { compatible = "nvmem-cells"; #address-cells = <1>; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi index 8406539f69..73f6e152bf 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi @@ -88,21 +88,6 @@ lantiq,gphy-mode = ; }; -&gpio { - pinctrl-names = "default"; - pinctrl-0 = <&state_default>; - - state_default: pinmux { - phy-rst { - lantiq,pins = "io37", "io44"; - lantiq,pull = <0>; - lantiq,open-drain; - lantiq,output = <1>; - }; - }; - -}; - &gswip { pinctrl-0 = <&mdio_pins>; pinctrl-names = "default"; @@ -111,12 +96,10 @@ &gswip_mdio { phy0: ethernet-phy@0 { reg = <0x00>; - reset-gpios = <&gpio 37 GPIO_ACTIVE_LOW>; }; phy1: ethernet-phy@1 { reg = <0x01>; - reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; phy11: ethernet-phy@11 { diff --git a/target/linux/ramips/dts/mt7621_bolt_arion.dts b/target/linux/ramips/dts/mt7621_bolt_arion.dts new file mode 100644 index 0000000000..a665b7b143 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_bolt_arion.dts @@ -0,0 +1,181 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "bolt,arion", "mediatek,mt7621-soc"; + model = "Bolt Arion"; + + aliases { + label-mac-device = &wan; + }; + + chosen { + bootargs = "console=ttyS0,57600n8"; + }; + + leds { + compatible = "gpio-leds"; + + led_wlan_blue: wlan_blue { + label = "blue:wlan"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + }; + + led_wlan_red: wlan_red { + label = "red:wlan"; + gpios = <&gpio 86 GPIO_ACTIVE_LOW>; + }; + + led_tel_blue: tel_blue { + label = "blue:tel"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + }; + + led_sig1_blue: sig1_blue { + label = "blue:sig1"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + + led_sig1_red: sig1_red { + label = "red:sig1"; + gpios = <&gpio 87 GPIO_ACTIVE_LOW>; + }; + + led_sig2_blue: sig2_blue { + label = "blue:sig2"; + gpios = <&gpio 45 GPIO_ACTIVE_LOW>; + }; + + led_sig3_blue: sig3_blue { + label = "blue:sig3"; + gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 26 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "WPS"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x20000 0x20000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x1fb0000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "pci14c3,7603"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "pci14c3,7662"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_4000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <3>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "modem"; + }; + + wan: port@1 { + status = "okay"; + label = "wan"; + nvmem-cells = <&macaddr_factory_4000>; + nvmem-cell-names = "mac-address"; + }; + + port@2 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&state_default { + gpio { + groups = "jtag", "uart2", "uart3", "wdt"; + function = "gpio"; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4000: macaddr@4000 { + reg = <0x28 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi b/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi index ec232968a6..5e9c82507d 100644 --- a/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi +++ b/target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi @@ -95,7 +95,6 @@ partition@80000 { label = "u_env"; reg = <0x80000 0x40000>; - read-only; }; factory: partition@c0000 { diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts new file mode 100644 index 0000000000..2dd38fba4b --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an_asus_rt-ac1200.dtsi" + +/ { + compatible = "asus,rt-ac1200-v2", "mediatek,mt7628an-soc"; + model = "ASUS RT-AC1200 V2"; +}; + +&state_default { + spis { + groups = "spis"; + function = "spis"; + }; + + gpio { + groups = "refclk", "i2c", "wled_an"; + function = "gpio"; + }; +}; + +&usbphy { + status = "disabled"; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dts b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dts index dbb8302b85..abb86456da 100644 --- a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dts +++ b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dts @@ -2,52 +2,15 @@ // Copyright (c) 2022 Ray Wang // Copyright (c) 2022 Ivan Pavlov -#include "mt7628an.dtsi" - -#include -#include +#include "mt7628an_asus_rt-ac1200.dtsi" / { compatible = "asus,rt-ac1200", "mediatek,mt7628an-soc"; model = "Asus RT-AC1200"; - aliases { - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 5 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - leds { compatible = "gpio-leds"; - led_power: power { - label = "blue:power"; - gpios = <&gpio 37 GPIO_ACTIVE_LOW>; - }; - - wlan2g { - label = "blue:wlan2g"; - gpios = <&gpio 44 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - usb { label = "blue:usb"; gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; @@ -55,98 +18,6 @@ linux,default-trigger = "usbport"; }; }; - - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - - led-all { - gpio-export,name = "led_all"; - gpio-export,output = <0>; - gpios = <&gpio 4 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "bootloader"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "nvram"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0xfb0000>; - }; - }; - }; -}; - -ðernet { - nvmem-cells = <&macaddr_factory_28>; - nvmem-cell-names = "mac-address"; -}; - -&esw { - mediatek,portmap = <0x3e>; -}; - -&wmac { - status = "okay"; - - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&pcie { - status = "okay"; -}; - -&pcie0 { - wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - ieee80211-freq-limit = <5000000 6000000>; - - led { - led-sources = <2>; - led-active-low; - }; - }; }; &state_default { diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi new file mode 100644 index 0000000000..d8d4245447 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_wps; + led-failsafe = &led_wps; + led-running = &led_wps; + led-upgrade = &led_wps; + label-mac-device = ðernet; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_wps: wps { + label = "blue:wps"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "blue:wlan2g"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <58000000>; + m25p,fast-read; + + partitions: 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; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&gpio { + enable-leds { + gpio-hog; + line-name = "enable-leds"; + output-low; + gpios = <4 GPIO_ACTIVE_HIGH>; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x3e>; +}; + +&wmac { + status = "okay"; + + mediatek,mtd-eeprom = <&factory 0x0>; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + led-active-low; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts new file mode 100644 index 0000000000..2a09ce6f38 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts @@ -0,0 +1,148 @@ +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "wavlink,wl-wn531a3", "mediatek,mt7628an-soc"; + model = "Wavlink WL-WN531A3"; + + aliases { + led-boot = &led_status_blue; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + }; + + keys { + compatible = "gpio-keys"; + + turbo { + label = "turbo"; + gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 45 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + touchlink { + label = "touchlink"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + wifi { + label = "blue:wifi"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_status_blue: led_status_blue { + label = "blue:status"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: led_status_red { + label = "red:status"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "wled_an", "gpio", "wdt"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + 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; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + mediatek,mtd-eeprom = <&factory 0x0>; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; +}; + +&esw { + mediatek,portmap = <0x2f>; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index f194c848ee..ee47dac7fb 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -289,6 +289,16 @@ define Device/buffalo_wsr-600dhp endef TARGET_DEVICES += buffalo_wsr-600dhp +define Device/bolt_arion + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 32448k + DEVICE_VENDOR := BOLT + DEVICE_MODEL := Arion + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 uboot-envtools +endef +TARGET_DEVICES += bolt_arion + define Device/cudy_wr1300 $(Device/dsa-migration) IMAGE_SIZE := 15872k diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index cb50fa156f..f1dbd14c07 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -47,6 +47,19 @@ define Device/asus_rt-ac1200 endef TARGET_DEVICES += asus_rt-ac1200 +define Device/asus_rt-ac1200-v2 + BLOCKSIZE := 64k + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Asus + DEVICE_MODEL := RT-AC1200 + DEVICE_VARIANT := V2 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7663-firmware-ap +endef +TARGET_DEVICES += asus_rt-ac1200-v2 + define Device/asus_rt-n10p-v3 IMAGE_SIZE := 7872k DEVICE_VENDOR := Asus @@ -779,6 +792,17 @@ define Device/vocore_vocore2-lite endef TARGET_DEVICES += vocore_vocore2-lite +define Device/wavlink_wl-wn531a3 + IMAGE_SIZE := 7872k + DEVICE_VENDOR := Wavlink + DEVICE_MODEL := WL-WN531A3 + DEVICE_ALT0_VENDOR := Wavlink + DEVICE_ALT0_MODEL := QUANTUM D4 + DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES += wl-wn531a3 +endef +TARGET_DEVICES += wavlink_wl-wn531a3 + define Device/wavlink_wl-wn570ha1 IMAGE_SIZE := 7872k DEVICE_VENDOR := Wavlink 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 1fc0ccdd5b..7223908f95 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 @@ -51,6 +51,13 @@ ramips_setup_interfaces() xiaomi,mi-router-4a-gigabit) ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" ;; + bolt,arion) + ucidef_set_interfaces_lan_wan "lan" "wan" + ucidef_set_interface "eth_data" device "modem.103" protocol "static" ipaddr "10.22.127.222" netmask "255.255.255.255" + ucidef_set_interface "eth_om" device "modem.4094" protocol "static" ipaddr "169.254.0.2" netmask "255.255.255.252" + uci add_list firewall.@zone[1].network='eth_data' + uci add_list firewall.@zone[1].network='eth_om' + ;; gnubee,gb-pc1|\ gnubee,gb-pc2) ucidef_set_interface_lan "lan1 lan2" diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 7791ee6be2..408f5f5e01 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -35,6 +35,7 @@ ramips_setup_interfaces() ucidef_set_interface_lan "eth0" ;; asus,rt-ac1200|\ + asus,rt-ac1200-v2|\ hilink,hlk-7628n|\ hilink,hlk-7688a|\ hiwifi,hc5861b|\ @@ -117,7 +118,8 @@ ramips_setup_interfaces() ;; netgear,r6020|\ netgear,r6080|\ - netgear,r6120) + netgear,r6120|\ + wavlink,wl-wn531a3) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" ;; @@ -177,7 +179,9 @@ ramips_setup_macs() local label_mac="" case $board in - asus,rt-ac1200|\ + asus,rt-ac1200) + wan_mac=$(mtd_get_mac_binary factory 0x22) + ;; elecom,wrc-1167fs) wan_mac=$(mtd_get_mac_binary factory 0x22) label_mac=$wan_mac @@ -190,6 +194,7 @@ ramips_setup_macs() cudy,wr1000|\ hilink,hlk-7628n|\ hilink,hlk-7688a|\ + wavlink,wl-wn531a3|\ wavlink,wl-wn577a2|\ wavlink,wl-wn578a2) wan_mac=$(mtd_get_mac_binary factory 0x2e) diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index e8e3f6035d..af9db848dd 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -57,6 +57,7 @@ zyxel,gs1900-8hp-v1|\ zyxel,gs1900-8hp-v2) ucidef_set_poe 70 "$lan_list" ;; +zyxel,gs1900-24hp-v1|\ zyxel,gs1900-24hp-v2) ucidef_set_poe 170 "$lan_list" ;; diff --git a/target/linux/realtek/dts-5.10/rtl8382_zyxel_gs1900-24hp-v1.dts b/target/linux/realtek/dts-5.10/rtl8382_zyxel_gs1900-24hp-v1.dts new file mode 100644 index 0000000000..7bb3410a31 --- /dev/null +++ b/target/linux/realtek/dts-5.10/rtl8382_zyxel_gs1900-24hp-v1.dts @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "rtl8380_zyxel_gs1900.dtsi" + +/ { + compatible = "zyxel,gs1900-24hp-v1", "realtek,rtl838x-soc"; + model = "ZyXEL GS1900-24HP v1"; + + memory@0 { + reg = <0x0 0x4000000>; + }; + + /* i2c of the left SFP cage: port 25 */ + i2c0: i2c-gpio-0 { + compatible = "i2c-gpio"; + sda-gpios = <&gpio1 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio1 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + sfp0: sfp-p25 { + compatible = "sff,sfp"; + i2c-bus = <&i2c0>; + los-gpio = <&gpio1 27 GPIO_ACTIVE_HIGH>; + tx-fault-gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 26 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>; + }; + + /* i2c of the right SFP cage: port 26 */ + i2c1: i2c-gpio-1 { + compatible = "i2c-gpio"; + sda-gpios = <&gpio1 30 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio1 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + sfp1: sfp-p26 { + compatible = "sff,sfp"; + i2c-bus = <&i2c1>; + los-gpio = <&gpio1 33 GPIO_ACTIVE_HIGH>; + tx-fault-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 32 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpio1 29 GPIO_ACTIVE_HIGH>; + }; +}; + +&uart1 { + status = "okay"; +}; + +&mdio { + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) + + EXTERNAL_PHY(16) + EXTERNAL_PHY(17) + EXTERNAL_PHY(18) + EXTERNAL_PHY(19) + EXTERNAL_PHY(20) + EXTERNAL_PHY(21) + EXTERNAL_PHY(22) + EXTERNAL_PHY(23) + + INTERNAL_PHY(24) + INTERNAL_PHY(26) +}; + +&switch0 { + ports { + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, internal) + SWITCH_PORT(9, 10, internal) + SWITCH_PORT(10, 11, internal) + SWITCH_PORT(11, 12, internal) + SWITCH_PORT(12, 13, internal) + SWITCH_PORT(13, 14, internal) + SWITCH_PORT(14, 15, internal) + SWITCH_PORT(15, 16, internal) + + SWITCH_PORT(16, 17, qsgmii) + SWITCH_PORT(17, 18, qsgmii) + SWITCH_PORT(18, 19, qsgmii) + SWITCH_PORT(19, 20, qsgmii) + SWITCH_PORT(20, 21, qsgmii) + SWITCH_PORT(21, 22, qsgmii) + SWITCH_PORT(22, 23, qsgmii) + SWITCH_PORT(23, 24, qsgmii) + + port@24 { + reg = <24>; + label = "lan25"; + phy-mode = "1000base-x"; + managed = "in-band-status"; + sfp = <&sfp0>; + }; + + port@26 { + reg = <26>; + label = "lan26"; + phy-mode = "1000base-x"; + managed = "in-band-status"; + sfp = <&sfp1>; + }; + }; +}; + diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index 9688dd93de..29e7ff2695 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -145,6 +145,15 @@ define Device/zyxel_gs1900-24-v1 endef TARGET_DEVICES += zyxel_gs1900-24-v1 +define Device/zyxel_gs1900-24hp-v1 + $(Device/zyxel_gs1900) + SOC := rtl8382 + DEVICE_MODEL := GS1900-24HP + DEVICE_VARIANT := v1 + ZYXEL_VERS := AAHM +endef +TARGET_DEVICES += zyxel_gs1900-24hp-v1 + define Device/zyxel_gs1900-24hp-v2 $(Device/zyxel_gs1900) SOC := rtl8382