Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2022-04-17 13:07:08 +08:00
commit 197ee85e5f
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
95 changed files with 2565 additions and 776 deletions

View File

@ -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

View File

@ -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

View File

@ -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"
;;

View File

@ -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)

View File

@ -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" ] && \

View File

@ -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)"

View File

@ -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

View File

@ -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

View File

@ -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}"
}
}

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -1,65 +0,0 @@
From ba068938e629eb1a8b423a54405233e685cedb78 Mon Sep 17 00:00:00 2001
Message-Id: <ba068938e629eb1a8b423a54405233e685cedb78.1647594132.git.chunkeey@gmail.com>
From: Christian Lamparter <chunkeey@gmail.com>
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 <damien.lemoal@opensource.wdc.com>,
Jens Axboe <axboe@kernel.dk>,
Tejun Heo <tj@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
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 <CE,ME> 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 <chunkeey@gmail.com>
---
--- 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;

View File

@ -18,7 +18,7 @@ Signed-off-by: Stephen Boyd <sboyd@kernel.org>
--- 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;

View File

@ -0,0 +1,156 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "ar9331.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
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 = <KEY_RESTART>;
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 = <&reg_usb_vbus>;
};
&usb_phy {
status = "okay";
};
&eth0 {
status = "okay";
nvmem-cells = <&macaddr_bdinfo_18a>;
nvmem-cell-names = "mac-address-ascii";
mac-address-increment = <1>;
};
&eth1 {
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>;
};
};

View File

@ -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";
};

View File

@ -0,0 +1,198 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca955x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
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 = <KEY_RESTART>;
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 */
>;
};
};
&eth0 {
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>;
};
};
&eth1 {
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";
};

View File

@ -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 <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
aliases {
led-boot = &led_status_green;
led-failsafe = &led_status_red;
led-running = &led_status_green;
led-upgrade = &led_status_red;
label-mac-device = &eth0;
};
chosen {
bootargs = "console=ttyS0,115200n8";
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
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;
};
};
&eth0 {
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 = <&reg_usb_vbus>;
hub_port0: port@1 {
reg = <1>;
#trigger-source-cells = <0>;
};
};

View File

@ -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";
};
&reg_usb_vbus {
status = "okay";
};
&usb_phy0 {
status = "okay";
};
&usb0 {
status = "okay";
dr_mode = "host";
};

View File

@ -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";
};

View File

@ -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";
};
&reg_usb_vbus {
status = "okay";
};
&usb_phy0 {
status = "okay";
};
&usb0 {
status = "okay";
dr_mode = "host";
};

View File

@ -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";
};

View File

@ -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)

View File

@ -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"

View File

@ -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|\

View File

@ -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

View File

@ -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

View File

@ -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"
;;

View File

@ -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"
;;

View File

@ -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
;;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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:

View File

@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
/* 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 <phil@raspberrypi.org>
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 */

View File

@ -75,7 +75,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
/*** 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 <maxime@cerno.tech>
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 <maxime@cerno.tech>
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 <maxime@cerno.tech>
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 <maxime@cerno.tech>
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 <maxime@cerno.tech>
/* 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 <maxime@cerno.tech>
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 <maxime@cerno.tech>
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 <maxime@cerno.tech>
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 <maxime@cerno.tech>
* 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);

View File

@ -10,7 +10,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- 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;

View File

@ -15,7 +15,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- 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)
{

View File

@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
--- 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;

View File

@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- 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 <phil@raspberrypi.org>
/**
* 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 <phil@raspberrypi.org>
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 <phil@raspberrypi.org>
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);

View File

@ -116,7 +116,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
}
--- 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 <jonas.gorski@gmail.com>
}
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);

View File

@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- 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 <kuba@kernel.org>
/* 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;

View File

@ -1398,7 +1398,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
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 <davem@davemloft.net>
/*
--- 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 <davem@davemloft.net>
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);

View File

@ -48,7 +48,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
/* 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);

View File

@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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;

View File

@ -19,7 +19,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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 <lorenzo.pieralisi@arm.com>
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();

View File

@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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);

View File

@ -21,7 +21,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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);

View File

@ -20,7 +20,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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);

View File

@ -20,7 +20,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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);

View File

@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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);

View File

@ -0,0 +1,58 @@
From d91a03b72c5f9c25e5b976f8f67bcf279601d644 Mon Sep 17 00:00:00 2001
From: Lech Perczak <lech.perczak@gmail.com>
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 <kristian.evensen@gmail.com>
Cc: Bjørn Mork <bjorn@mork.no>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
---
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 \

View File

@ -0,0 +1,118 @@
From 69a9efb689b43fedf5f19431f1889aa6b8d35d55 Mon Sep 17 00:00:00 2001
From: Lech Perczak <lech.perczak@gmail.com>
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 <bjorn@mork.no>
Cc: Kristian Evensen <kristian.evensen@gmail.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
---
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

View File

@ -0,0 +1,63 @@
From 1bfbe1799b9ec5d00f7f032d6e7db1980e466aeb Mon Sep 17 00:00:00 2001
From: Lech Perczak <lech.perczak@gmail.com>
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 <bjorn@mork.no>
Cc: Kristian Evensen <kristian.evensen@gmail.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
---
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,

View File

@ -48,7 +48,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
/* 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);

View File

@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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;

View File

@ -19,7 +19,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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 <lorenzo.pieralisi@arm.com>
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();

View File

@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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);

View File

@ -21,7 +21,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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);

View File

@ -20,7 +20,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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);

View File

@ -20,7 +20,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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);

View File

@ -18,7 +18,7 @@ Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
--- 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);

View File

@ -0,0 +1,58 @@
From a79a5613e1907e1bf09bb6ba6fd5ff43b66c1afe Mon Sep 17 00:00:00 2001
From: Lech Perczak <lech.perczak@gmail.com>
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 <kristian.evensen@gmail.com>
Cc: Bjørn Mork <bjorn@mork.no>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
---
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 \

View File

@ -0,0 +1,118 @@
From aa8aff10e969aca0cb64f5e54ff7489355582667 Mon Sep 17 00:00:00 2001
From: Lech Perczak <lech.perczak@gmail.com>
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 <bjorn@mork.no>
Cc: Kristian Evensen <kristian.evensen@gmail.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
---
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

View File

@ -0,0 +1,63 @@
From 9bfb4bcda7ba32d73ea322ea56a8ebe32e9247f6 Mon Sep 17 00:00:00 2001
From: Lech Perczak <lech.perczak@gmail.com>
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 <bjorn@mork.no>
Cc: Kristian Evensen <kristian.evensen@gmail.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
---
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,

View File

@ -14,7 +14,7 @@ Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
--- 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

View File

@ -164,7 +164,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
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,

View File

@ -27,7 +27,7 @@ Signed-off-by: Marek Behún <kabel@kernel.org>
--- 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 <kabel@kernel.org>
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;

View File

@ -1,72 +0,0 @@
From bb03b126ea6c9e57177b537dd022246fa5dbef16 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
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 <pali@kernel.org>
Signed-off-by: Marek Behún <kabel@kernel.org>
---
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);
}

View File

@ -161,7 +161,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
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,

View File

@ -1,72 +0,0 @@
From bb03b126ea6c9e57177b537dd022246fa5dbef16 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
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 <pali@kernel.org>
Signed-off-by: Marek Behún <kabel@kernel.org>
---
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);
}

View File

@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
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 <kaloz@openwrt.org>
/*
* 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);

View File

@ -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
;;

View File

@ -49,31 +49,31 @@
* Voltage thresholds are <target min max>
*/
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>;
};
};

View File

@ -148,12 +148,10 @@
};
&usb3_0 {
clocks = <&gcc USB30_1_MASTER_CLK>;
status = "okay";
};
&usb3_1 {
clocks = <&gcc USB30_0_MASTER_CLK>;
status = "okay";
};

View File

@ -96,6 +96,35 @@
input-disable;
};
};
spi_pins: spi_pins {
cs {
pins = "gpio20";
drive-strength = <12>;
};
};
};
&gsbi5 {
qcom,mode = <GSBI_PROT_SPI>;
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";
};
};
};

View File

@ -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 = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
+ reg = <0x10000000 0xcd00>;
+ interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
+ 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 = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
+ reg = <0x11000000 0xcd00>;
+ interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
+ phys = <&hs_phy_1>, <&ss_phy_1>;
+ phy-names = "usb2-phy", "usb3-phy";
+ dr_mode = "host";

View File

@ -50,7 +50,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
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;
}

View File

@ -178,7 +178,7 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
}
--- a/init/main.c
+++ b/init/main.c
@@ -112,6 +112,10 @@
@@ -113,6 +113,10 @@
#include <kunit/test.h>
@ -189,7 +189,7 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
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();

View File

@ -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>;

View File

@ -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>;

View File

@ -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>;

View File

@ -88,21 +88,6 @@
lantiq,gphy-mode = <GPHY_MODE_GE>;
};
&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 {

View File

@ -0,0 +1,181 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
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 = <KEY_RESTART>;
};
wps {
label = "WPS";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};
&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>;
};
};

View File

@ -95,7 +95,6 @@
partition@80000 {
label = "u_env";
reg = <0x80000 0x40000>;
read-only;
};
factory: partition@c0000 {

View File

@ -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";
};

View File

@ -2,52 +2,15 @@
// Copyright (c) 2022 Ray Wang
// Copyright (c) 2022 Ivan Pavlov
#include "mt7628an.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#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 = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
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>;
};
};
};
};
&ethernet {
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 {

View File

@ -0,0 +1,138 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7628an.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
aliases {
led-boot = &led_wps;
led-failsafe = &led_wps;
led-running = &led_wps;
led-upgrade = &led_wps;
label-mac-device = &ethernet;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
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>;
};
};
&ethernet {
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;
};
};
};

View File

@ -0,0 +1,148 @@
#include "mt7628an.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
/ {
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 = <BTN_1>;
};
wps {
label = "wps";
gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
reset {
label = "reset";
gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
touchlink {
label = "touchlink";
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
linux,code = <BTN_0>;
};
};
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>;
};
&ethernet {
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>;
};
};

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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)

View File

@ -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"
;;

View File

@ -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>;
};
};
};

View File

@ -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