From 7a48dfc90c6eb4ed160cea3e28401e84e3accc2a Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Mon, 29 Nov 2021 20:30:42 +0000 Subject: [PATCH 01/78] nftables: install package file Install pc file so dnsmasq can find libnftables Signed-off-by: Kevin Darbyshire-Bryant --- package/network/utils/nftables/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 89bb10e0da..49c56ee6c3 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -65,6 +65,9 @@ define Build/InstallDev $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/include/nftables $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnftables.pc \ + $(1)/usr/lib/pkgconfig/ endef define Package/nftables/install/Default From 7c99085bd69742f66207d61e9f2da5ec4f8f9d2f Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sun, 28 Nov 2021 02:31:54 +0100 Subject: [PATCH 02/78] ca-certicficates: Update to version 20211016 Update the ca-certificates and ca-bundle package from version 20210119 to version 20211016. Debian change-log entry [1]: |[...] |[ Julien Cristau ] |* mozilla/{certdata.txt,nssckbi.h}: Update Mozilla certificate authority | bundle to version 2.50 | The following certificate authorities were added (+): | + "AC RAIZ FNMT-RCM SERVIDORES SEGUROS" | + "GlobalSign Root R46" | + "GlobalSign Root E46" | + "GLOBALTRUST 2020" | + "ANF Secure Server Root CA" | + "Certum EC-384 CA" | + "Certum Trusted Root CA" | The following certificate authorities were removed (-): | - "QuoVadis Root CA" | - "Sonera Class 2 Root CA" | - "GeoTrust Primary Certification Authority - G2" | - "VeriSign Universal Root Certification Authority" | - "Chambers of Commerce Root - 2008" | - "Global Chambersign Root - 2008" | - "Trustis FPS Root CA" | - "Staat der Nederlanden Root CA - G3" | * Blacklist expired root certificate "DST Root CA X3" (closes: #995432) |[...] [1] Signed-off-by: Christian Lamparter --- package/system/ca-certificates/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/system/ca-certificates/Makefile b/package/system/ca-certificates/Makefile index 46bd871ccb..9fac32e7e3 100644 --- a/package/system/ca-certificates/Makefile +++ b/package/system/ca-certificates/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ca-certificates -PKG_VERSION:=20210119 +PKG_VERSION:=20211016 PKG_RELEASE:=1 PKG_MAINTAINER:= PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@DEBIAN/pool/main/c/ca-certificates -PKG_HASH:=daa3afae563711c30a0586ddae4336e8e3974c2b627faaca404c4e0141b64665 +PKG_HASH:=2ae9b6dc5f40c25d6d7fe55e07b54f12a8967d1955d3b7b2f42ee46266eeef88 PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk From 79ceea43032f9e70fdf8e5280f5af62cc175a9f5 Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Tue, 23 Nov 2021 19:07:14 -0500 Subject: [PATCH 03/78] mpc85xx: Fix HiveAP-330 nvmem mac loader We actually need to enclose the whole section of partitions in a `partitions { ... }` to assign it a `compatible = "fixed-partitions"; otherwise the partition referred to by `hwinfo` won't be registered when bringing up MTD partitions, for example as per: - - commit e2b03c16eb44 ("ipq806x: add missing enclosing partitions block for TP-Link C2600")' Fixes: 8ec21d6bb210 ("mpc85xx: convert mtd-mac-address to nvmem implementation") Signed-off-by: Martin Kennedy [minor beautification] Signed-off-by: Christian Lamparter --- .../arch/powerpc/boot/dts/hiveap-330.dts | 102 +++++++++--------- 1 file changed, 54 insertions(+), 48 deletions(-) diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts index 97f5b7c7b7..9eb6e2613a 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts @@ -42,64 +42,70 @@ bank-width = <2>; device-width = <1>; - partition@0 { - reg = <0x0 0x40000>; - label = "dtb"; - }; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; - partition@40000 { - reg = <0x40000 0x40000>; - label = "initrd"; - }; + partition@0 { + reg = <0x0 0x40000>; + label = "dtb"; + }; - partition@80000 { - reg = <0x80000 0x27c0000>; - label = "rootfs"; - }; + partition@40000 { + reg = <0x40000 0x40000>; + label = "initrd"; + }; - partition@2840000 { - reg = <0x2840000 0x800000>; - label = "kernel"; - }; + partition@80000 { + reg = <0x80000 0x27c0000>; + label = "rootfs"; + }; - partition@3040000 { - reg = <0x3040000 0xec0000>; - label = "stock-jffs2"; - read-only; - }; + partition@2840000 { + reg = <0x2840000 0x800000>; + label = "kernel"; + }; - hwinfo: partition@3f00000 { - reg = <0x3f00000 0x20000>; - label = "hw-info"; - read-only; - }; + partition@3040000 { + reg = <0x3040000 0xec0000>; + label = "stock-jffs2"; + read-only; + }; - partition@3f20000 { - reg = <0x3f20000 0x20000>; - label = "boot-info"; - read-only; - }; + hwinfo: partition@3f00000 { + reg = <0x3f00000 0x20000>; + label = "hw-info"; + read-only; + }; - partition@3f40000 { - reg = <0x3f40000 0x20000>; - label = "boot-info-backup"; - read-only; - }; + partition@3f20000 { + reg = <0x3f20000 0x20000>; + label = "boot-info"; + read-only; + }; - partition@3f60000 { - reg = <0x3f60000 0x20000>; - label = "u-boot-env"; - }; + partition@3f40000 { + reg = <0x3f40000 0x20000>; + label = "boot-info-backup"; + read-only; + }; - partition@3f80000 { - reg = <0x3f80000 0x80000>; - label = "u-boot"; - read-only; - }; + partition@3f60000 { + reg = <0x3f60000 0x20000>; + label = "u-boot-env"; + }; - firmware@0 { - reg = <0x0 0x3040000>; - label = "firmware"; + partition@3f80000 { + reg = <0x3f80000 0x80000>; + label = "u-boot"; + read-only; + }; + + firmware@0 { + reg = <0x0 0x3040000>; + label = "firmware"; + }; }; }; }; From 56246f2910ff78ee287d0425d8bfa8ed57a7ba58 Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Fri, 5 Nov 2021 20:28:07 +0100 Subject: [PATCH 04/78] lantiq: xway_legacy: disable unused switches The xway_legacy subtarget only supports 5 devices. Most compiled switch drivers are unused by any of these devices. The same drivers are compiled into the xway subtarget. They were probably copied from there when creating this subtarget. Switches used by devices: Arcadyan ARV4518PWR01 Realtek RTL8306SD Arcadyan ARV4518PWR01A Realtek RTL8306SD Arcadyan ARV4520PW Infineon ADM6996I Arcadyan ARV4525PW only PHY(IC+ IP101A) Arcadyan ARV452CQW Realtek RTL8306 The CONFIG_ETHERNET_PACKET_MANGLE symbol has also been disabled, as it is only needed by the driver for AR8216. Reduces kernel size by 19.9 kB. Signed-off-by: Aleksander Jan Bajkowski --- target/linux/lantiq/xway_legacy/config-5.10 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/target/linux/lantiq/xway_legacy/config-5.10 b/target/linux/lantiq/xway_legacy/config-5.10 index 611663535b..c177d2a935 100644 --- a/target/linux/lantiq/xway_legacy/config-5.10 +++ b/target/linux/lantiq/xway_legacy/config-5.10 @@ -1,12 +1,10 @@ CONFIG_ADM6996_PHY=y -CONFIG_AR8216_PHY=y CONFIG_BLK_MQ_PCI=y CONFIG_CPU_HAS_DIEI=y CONFIG_CRC16=y CONFIG_CRYPTO_ACOMP2=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LZO=y -CONFIG_ETHERNET_PACKET_MANGLE=y CONFIG_GENERIC_ALLOCATOR=y # CONFIG_GPIO_SYSFS is not set CONFIG_INPUT=y @@ -21,15 +19,9 @@ CONFIG_NLS=y CONFIG_PCI=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_LANTIQ=y -CONFIG_PSB6970_PHY=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RTL8306_PHY=y -CONFIG_RTL8366RB_PHY=y -CONFIG_RTL8366S_PHY=y -CONFIG_RTL8366_SMI=y -CONFIG_RTL8367B_PHY=y -CONFIG_RTL8367_PHY=y CONFIG_SGL_ALLOC=y CONFIG_SOC_TYPE_XWAY=y CONFIG_SOC_XWAY=y From 7f7034d79fd1283a80c66655495875bb0b5d0e20 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Thu, 25 Nov 2021 06:32:18 +0200 Subject: [PATCH 05/78] libnftnl: bump to 1.2.1 This version is required by nftables 1.0.1. Signed-off-by: Stijn Tintel --- package/libs/libnftnl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile index 4c7f6ad465..37835b4338 100644 --- a/package/libs/libnftnl/Makefile +++ b/package/libs/libnftnl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnftnl -PKG_VERSION:=1.2.0 +PKG_VERSION:=1.2.1 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files -PKG_HASH:=90b01fddfe9be8c3245c3ba5ff5a4424a8df708828f92b2b361976b658c074f5 +PKG_HASH:=7508a5c414fab13e3cb3ce8262d0ce4f02c1590a8e4f8628ab497b5b4585937c PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0-or-later From 6832271ee74d408c49977995c44f102f33e731a1 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Thu, 25 Nov 2021 06:33:26 +0200 Subject: [PATCH 06/78] nftables: bump to 1.0.1 Signed-off-by: Stijn Tintel --- package/network/utils/nftables/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 49c56ee6c3..86f2136966 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables -PKG_VERSION:=1.0.0 -PKG_RELEASE:=2 +PKG_VERSION:=1.0.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files -PKG_HASH:=58bf547daf967a2b88ecb4f425f126006ebde22711db806b25c1d6cf84fe45f4 +PKG_HASH:=3ceeba625818e81a0be293e9dd486c3ef799ebd92165270f1e57e9a201efa423 PKG_MAINTAINER:= PKG_LICENSE:=GPL-2.0 From ac83015621cbffbbdadb7269503757c7d2c8260d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 28 Nov 2021 11:45:25 +0100 Subject: [PATCH 07/78] qosify: add besteffort class and switch all default classifications to class names Signed-off-by: Felix Fietkau --- .../config/qosify/files/qosify-defaults.conf | 20 +++++++++---------- .../network/config/qosify/files/qosify.conf | 10 +++++++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/package/network/config/qosify/files/qosify-defaults.conf b/package/network/config/qosify/files/qosify-defaults.conf index 23408d54cc..ff8a0bef5b 100644 --- a/package/network/config/qosify/files/qosify-defaults.conf +++ b/package/network/config/qosify/files/qosify-defaults.conf @@ -1,17 +1,17 @@ # DNS -tcp:53 CS5 -tcp:5353 CS5 -udp:53 CS5 -udp:5353 CS5 +tcp:53 voice +tcp:5353 voice +udp:53 voice +udp:5353 voice # NTP -udp:123 CS6 +udp:123 voice # SSH -tcp:22 +CS4 +tcp:22 +video # HTTP/QUIC -tcp:80 +CS3 -tcp:443 +CS3 -udp:80 +CS3 -udp:443 +CS3 +tcp:80 +besteffort +tcp:443 +besteffort +udp:80 +besteffort +udp:443 +besteffort diff --git a/package/network/config/qosify/files/qosify.conf b/package/network/config/qosify/files/qosify.conf index ac3423a8d4..a293bbd60d 100644 --- a/package/network/config/qosify/files/qosify.conf +++ b/package/network/config/qosify/files/qosify.conf @@ -1,13 +1,17 @@ config defaults list defaults /etc/qosify/*.conf - option dscp_prio CS5 - option dscp_icmp +CS0 + option dscp_prio video + option dscp_icmp +besteffort option dscp_bulk bulk - option dscp_default_udp CS4 + option dscp_default_udp besteffort option bulk_trigger_timeout 5 option bulk_trigger_pps 100 option prio_max_avg_pkt_len 500 +config class besteffort + option ingress CS0 + option egress CS0 + config class bulk option ingress LE option egress LE From b7ce8a8c17d371fa43e4479cd92d984e32ee4617 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 28 Nov 2021 11:46:11 +0100 Subject: [PATCH 08/78] qosify: remove bulk flow detection from default ports Signed-off-by: Felix Fietkau --- package/network/config/qosify/files/qosify.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/package/network/config/qosify/files/qosify.conf b/package/network/config/qosify/files/qosify.conf index a293bbd60d..69c1d5949a 100644 --- a/package/network/config/qosify/files/qosify.conf +++ b/package/network/config/qosify/files/qosify.conf @@ -2,10 +2,7 @@ config defaults list defaults /etc/qosify/*.conf option dscp_prio video option dscp_icmp +besteffort - option dscp_bulk bulk option dscp_default_udp besteffort - option bulk_trigger_timeout 5 - option bulk_trigger_pps 100 option prio_max_avg_pkt_len 500 config class besteffort From fbc9ce779fd9840a06a0831dafe4086cc717b044 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 1 Dec 2021 16:38:35 +0100 Subject: [PATCH 09/78] hostapd: make hostapd/supplicant/wpad packages depend on a specific version of hostapd-commoon This avoids potential version mismatch between packages when upgraded individually Signed-off-by: Felix Fietkau --- package/network/services/hostapd/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index d921df7f97..12e200be3e 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -143,6 +143,7 @@ define Package/hostapd/Default TITLE:=IEEE 802.1x Authenticator URL:=http://hostap.epitest.fi/ DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus + EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-$(PKG_RELEASE)) USERID:=network=101:network=101 PROVIDES:=hostapd CONFLICTS:=$(HOSTAPD_PROVIDERS) @@ -227,6 +228,7 @@ define Package/wpad/Default SUBMENU:=WirelessAPD TITLE:=IEEE 802.1x Auth/Supplicant DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus + EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-$(PKG_RELEASE)) USERID:=network=101:network=101 URL:=http://hostap.epitest.fi/ PROVIDES:=hostapd wpa-supplicant @@ -342,6 +344,7 @@ define Package/wpa-supplicant/Default TITLE:=WPA Supplicant URL:=http://hostap.epitest.fi/wpa_supplicant/ DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus + EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-$(PKG_RELEASE)) USERID:=network=101:network=101 PROVIDES:=wpa-supplicant CONFLICTS:=$(SUPPLICANT_PROVIDERS) From 25bc66eb40ea2c062940778fba601032b2579734 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 1 Dec 2021 15:01:23 +0100 Subject: [PATCH 10/78] ca-certificates: fix python3-cryptography woes in certdata2pem.py This patch is a revert of the upstream patch to Debian's ca-certificate commit 033d52259172 ("mozilla/certdata2pem.py: print a warning for expired certificates.") The reason is, that this change broke builds with the popular Ubuntu 20.04 LTS (focal) releases which are shipping with an older version of the python3-cryptography package that is not compatible. |Traceback (most recent call last): | File "certdata2pem.py", line 125, in | cert = x509.load_der_x509_certificate(obj['CKA_VALUE']) |TypeError: load_der_x509_certificate() missing 1 required positional argument: 'backend' |make[5]: *** [Makefile:6: all] Error 1 ...or if the python3-cryptography was missing all together: |Traceback (most recent call last): | File "/certdata2pem.py", line 31, in | from cryptography import x509 |ModuleNotFoundError: No module named 'cryptography' More concerns were raised by Jo-Philipp Wich: "We don't want the build to depend on the local system time anyway. Right now it seems to be just a warning but I could imagine that eventually certs are simply omitted of found to be expired at build time which would break reproducibility." Link: Reported-by: Chen Minqiang Reported-by: Shane Synan Signed-off-by: Christian Lamparter --- ...fix-python3-cryptography-woes-in-cer.patch | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 package/system/ca-certificates/patches/0001-ca-certificates-fix-python3-cryptography-woes-in-cer.patch diff --git a/package/system/ca-certificates/patches/0001-ca-certificates-fix-python3-cryptography-woes-in-cer.patch b/package/system/ca-certificates/patches/0001-ca-certificates-fix-python3-cryptography-woes-in-cer.patch new file mode 100644 index 0000000000..add01f42c0 --- /dev/null +++ b/package/system/ca-certificates/patches/0001-ca-certificates-fix-python3-cryptography-woes-in-cer.patch @@ -0,0 +1,53 @@ +From 3c51cb5ff1d0db41fb3288fb555c7e7055cf3e86 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 1 Dec 2021 14:41:31 +0100 +Subject: [PATCH] ca-certificates: fix python3-cryptography woes in + certdata2pem.py + +reverts the code portion of the Debian's ca-certificate +commit 033d52259172 ("mozilla/certdata2pem.py: print a warning for expired certificates.") + +It broke builds with the popular Ubuntu 20.04 (focal) releases. +This was due to them shipping with an older python3-cryptography +version which is not compatible. + +More concerns were raised by jow- as well: +"We don't want the build to depend on the local system time anyway." + +Reported-by: Chen Minqiang +Reported-by: Shane Synan +Signed-off-by: Christian Lamparter +--- +--- a/work/mozilla/certdata2pem.py ++++ b/work/mozilla/certdata2pem.py +@@ -21,16 +21,12 @@ + # USA. + + import base64 +-import datetime + import os.path + import re + import sys + import textwrap + import io + +-from cryptography import x509 +- +- + objects = [] + + # Dirty file parser. +@@ -121,13 +117,6 @@ for obj in objects: + if obj['CKA_CLASS'] == 'CKO_CERTIFICATE': + if not obj['CKA_LABEL'] in trust or not trust[obj['CKA_LABEL']]: + continue +- +- cert = x509.load_der_x509_certificate(obj['CKA_VALUE']) +- if cert.not_valid_after < datetime.datetime.now(): +- print('!'*74) +- print('Trusted but expired certificate found: %s' % obj['CKA_LABEL']) +- print('!'*74) +- + bname = obj['CKA_LABEL'][1:-1].replace('/', '_')\ + .replace(' ', '_')\ + .replace('(', '=')\ From 51d4e85068e0c2e0e15d3226c1d8946ebf7ad1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 2 Dec 2021 09:14:09 +0100 Subject: [PATCH 11/78] firmware-utils: bump to the latest master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 56e8e19 otrx: support TRX from stdin when extracting a37ccaf otrx: support unsorted partitions offsets 1fa145e otrx: extract shared code opening & parsing TRX format 0fbc135 oseama: support extracting entity to stdout 58c9d5d oseama: allow reading from stdin 4ecefda otrx: allow validating TRX from stdin cf01e69 otrx: avoid unneeded fseek() when calculating CRC32 fa35379 tplink-safeloader: add EAP225 v1 support f4d1263 build, cmake: switch OPENSSL_CRYPTO_LIBRARY -> OPENSSL_CRYPTO_LIBRARIES cd3f6ee build, cmake: add quotes for FW_UTIL variable arguments Signed-off-by: Rafał Miłecki --- tools/firmware-utils/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index d980ddfda1..f5e978a7f0 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git -PKG_SOURCE_DATE:=2021-10-30 -PKG_SOURCE_VERSION:=70737600d9385486df5c1970b4ab41ccb17006fa -PKG_MIRROR_HASH:=a2c64e34827992c0f0c71974aa0b66e0a2aafb38a838649500ecd78095098d4c +PKG_SOURCE_DATE:=2021-12-02 +PKG_SOURCE_VERSION:=56e8e19151743c923f48604c457850cf8eb52076 +PKG_MIRROR_HASH:=91f1bac08af2d856e93e651dc7c1ce6745f0b32b6fe4fb1917660494d7518057 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From e7bd6cce4c382e33a62c462bf07bafba23b22e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 26 Nov 2021 18:01:50 +0100 Subject: [PATCH 12/78] bcm53xx: sysupgrade: simplify extracting image from Seama seal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use "oseama extract" which supports now writing to stdout. Signed-off-by: Rafał Miłecki --- .../bcm53xx/base-files/lib/upgrade/platform.sh | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh index cbb8290275..0973e4048b 100644 --- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh @@ -396,20 +396,8 @@ platform_img_from_safeloader() { echo -n $dir/os-image } -platform_img_from_seama() { - local dir="/tmp/sysupgrade-bcm53xx" - local offset=$(oseama info "$1" -e 0 | grep "Entity offset:" | sed "s/.*:\s*//") - local size=$(oseama info "$1" -e 0 | grep "Entity size:" | sed "s/.*:\s*//") - - # Busybox doesn't support required iflag-s - # echo -n dd iflag=skip_bytes,count_bytes skip=$offset count=$size - - rm -fR $dir - mkdir -p $dir - dd if="$1" of=$dir/image-noheader.bin bs=$offset skip=1 - dd if=$dir/image-noheader.bin of=$dir/image-entity.bin bs=$size count=1 - - echo -n $dir/image-entity.bin +platform_img_from_seama_cmd() { + echo -n oseama extract "$1" -e 0 } platform_other_do_upgrade() { @@ -438,7 +426,7 @@ platform_other_do_upgrade() { "lxl") cmd=$(platform_trx_from_lxl_cmd "$trx");; "lxlold") cmd=$(platform_trx_from_lxlold_cmd "$trx");; "safeloader") trx=$(platform_img_from_safeloader "$trx"); PART_NAME=os-image;; - "seama") trx=$(platform_img_from_seama "$trx");; + "seama") cmd=$(platform_img_from_seama_cmd "$trx");; esac default_do_upgrade "$trx" "$cmd" From 80041dea7094f46f9ef5402964c95b0a5dcd5f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 28 Nov 2021 11:54:19 +0100 Subject: [PATCH 13/78] bcm53xx: sysupgrade: refactor handling different firmware formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List of supported formats grew over time and implementation got a bit messy. There are multiple functions with format-specific parameters and commands. Refactor it by making platform_identify() setup all required info right after detecting firmware format. This simplifies formats handling in platform_other_check_image() and platform_do_upgrade() a lot. This has been tested on: 1. SmartRG SR400ac (TRX): non-NAND sysupgrade 2. Netgear R8000 (CHK): NAND aware and standard sysupgrade-s 3. D-Link DIR-885L (Seama): NAND aware and standard sysupgrade-s 4. Luxul XWR-3150 (LXL): NAND aware and standard sysupgrade-s Signed-off-by: Rafał Miłecki --- .../base-files/lib/upgrade/platform.sh | 294 ++++++++---------- 1 file changed, 126 insertions(+), 168 deletions(-) diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh index 0973e4048b..512dad1891 100644 --- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh @@ -2,6 +2,12 @@ RAMFS_COPY_BIN='osafeloader oseama otrx truncate' PART_NAME=firmware +BCM53XX_FW_FORMAT= +BCM53XX_FW_BOARD_ID= +BCM53XX_FW_INT_IMG_FORMAT= +BCM53XX_FW_INT_IMG_TRX_OFFSET= +BCM53XX_FW_INT_IMG_EXTRACT_CMD= + LXL_FLAGS_VENDOR_LUXUL=0x00000001 # $(1): file to read magic from @@ -30,7 +36,7 @@ platform_expected_image() { local machine=$(board_name) case "$machine" in - "dlink,dir-885l") echo "seama wrgac42_dlink.2015_dir885l"; return;; + "dlink,dir-885l") echo "seamaseal wrgac42_dlink.2015_dir885l"; return;; "luxul,abr-4500-v1") echo "lxl ABR-4500"; return;; "luxul,xap-810-v1") echo "lxl XAP-810"; return;; "luxul,xap-1410v1") echo "lxl XAP-1410"; return;; @@ -59,169 +65,126 @@ platform_identify() { magic=$(get_magic_long "$1") case "$magic" in "48445230") - echo "trx" + BCM53XX_FW_FORMAT="trx" return ;; "2a23245e") - echo "chk" + local header_len=$((0x$(get_magic_long_at "$1" 4))) + local board_id_len=$(($header_len - 40)) + + BCM53XX_FW_FORMAT="chk" + BCM53XX_FW_BOARD_ID=$(dd if="$1" skip=40 bs=1 count=$board_id_len 2>/dev/null | hexdump -v -e '1/1 "%c"') + BCM53XX_FW_INT_IMG_FORMAT="trx" + BCM53XX_FW_INT_IMG_TRX_OFFSET="$header_len" + BCM53XX_FW_INT_IMG_EXTRACT_CMD="dd skip=$header_len iflag=skip_bytes" return ;; "4c584c23") - echo "lxl" + local hdr_len=$(get_le_long_at "$1" 8) + local flags=$(get_le_long_at "$1" 12) + + [ $((flags & LXL_FLAGS_VENDOR_LUXUL)) -gt 0 ] && notify_firmware_no_backup + + BCM53XX_FW_FORMAT="lxl" + BCM53XX_FW_BOARD_ID=$(dd if="$1" skip=16 bs=1 count=16 2>/dev/null | hexdump -v -e '1/1 "%c"') + BCM53XX_FW_INT_IMG_FORMAT="trx" + BCM53XX_FW_INT_IMG_TRX_OFFSET="$hdr_len" + BCM53XX_FW_INT_IMG_EXTRACT_CMD="dd skip=$hdr_len iflag=skip_bytes" + return ;; "5ea3a417") - echo "seama" + BCM53XX_FW_FORMAT="seamaseal" + BCM53XX_FW_BOARD_ID=$(oseama info "$1" | grep "Meta entry:.*signature=" | sed "s/.*=//") + BCM53XX_FW_INT_IMG_EXTRACT_CMD="oseama extract - -e 0" return ;; esac magic=$(get_magic_long_at "$1" 14) [ "$magic" = "55324e44" ] && { - echo "cybertan" + BCM53XX_FW_FORMAT="cybertan" + BCM53XX_FW_BOARD_ID=$(dd if="$1" bs=1 count=4 2>/dev/null | hexdump -v -e '1/1 "%c"') + BCM53XX_FW_INT_IMG_FORMAT="trx" + BCM53XX_FW_INT_IMG_TRX_OFFSET="32" + BCM53XX_FW_INT_IMG_EXTRACT_CMD="dd skip=32 iflag=skip_bytes" return } magic=$(get_magic_long_at "$1" 60) [ "$magic" = "4c584c23" ] && { - echo "lxlold" + notify_firmware_no_backup + + BCM53XX_FW_FORMAT="lxlold" + BCM53XX_FW_BOARD_ID=$(dd if="$1" skip=48 bs=1 count=12 2>/dev/null | hexdump -v -e '1/1 "%c"') + BCM53XX_FW_INT_IMG_FORMAT="trx" + BCM53XX_FW_INT_IMG_TRX_OFFSET="64" + BCM53XX_FW_INT_IMG_EXTRACT_CMD="dd skip=64 iflag=skip_bytes" return } if osafeloader info "$1" > /dev/null 2>&1; then - echo "safeloader" + BCM53XX_FW_FORMAT="safeloader" return fi - - echo "unknown" } platform_other_check_image() { [ "$#" -gt 1 ] && return 1 - local file_type=$(platform_identify "$1") - local magic local error=0 - case "$file_type" in - "chk") - local header_len=$((0x$(get_magic_long_at "$1" 4))) - local board_id_len=$(($header_len - 40)) - local board_id=$(dd if="$1" skip=40 bs=1 count=$board_id_len 2>/dev/null | hexdump -v -e '1/1 "%c"') - local dev_board_id=$(platform_expected_image) - echo "Found CHK image with device board_id $board_id" + platform_identify "$1" + [ -z "$BCM53XX_FW_FORMAT" ] && { + echo "Invalid image type. Please use firmware specific for this device." + notify_firmware_broken + return 1 + } + echo "Found $BCM53XX_FW_FORMAT firmware for device $BCM53XX_FW_BOARD_ID" - [ -n "$dev_board_id" -a "chk $board_id" != "$dev_board_id" ] && { - echo "Firmware board_id doesn't match device board_id ($dev_board_id)" - error=1 - } - - if ! otrx check "$1" -o "$header_len"; then - echo "No valid TRX firmware in the CHK image" - notify_firmware_test_result "trx_valid" 0 - error=1 - else - notify_firmware_test_result "trx_valid" 1 - fi - ;; - "cybertan") - local pattern=$(dd if="$1" bs=1 count=4 2>/dev/null | hexdump -v -e '1/1 "%c"') - local dev_pattern=$(platform_expected_image) - echo "Found CyberTAN image with device pattern: $pattern" - - [ -n "$dev_pattern" -a "cybertan $pattern" != "$dev_pattern" ] && { - echo "Firmware pattern doesn't match device pattern ($dev_pattern)" - error=1 - } - - if ! otrx check "$1" -o 32; then - echo "No valid TRX firmware in the CyberTAN image" - notify_firmware_test_result "trx_valid" 0 - error=1 - else - notify_firmware_test_result "trx_valid" 1 - fi - ;; - "lxl") - local hdr_len=$(get_le_long_at "$1" 8) - local flags=$(get_le_long_at "$1" 12) - local board=$(dd if="$1" skip=16 bs=1 count=16 2>/dev/null | hexdump -v -e '1/1 "%c"') - local dev_board=$(platform_expected_image) - echo "Found LXL image for board $board" - - [ -n "$dev_board" -a "lxl $board" != "$dev_board" ] && { - echo "Firmware ($board) doesn't match device ($dev_board)" - error=1 - } - - [ $((flags & LXL_FLAGS_VENDOR_LUXUL)) -gt 0 ] && notify_firmware_no_backup - - if ! otrx check "$1" -o "$hdr_len"; then - echo "No valid TRX firmware in the LXL image" - notify_firmware_test_result "trx_valid" 0 - error=1 - else - notify_firmware_test_result "trx_valid" 1 - fi - ;; - "lxlold") - local board_id=$(dd if="$1" skip=48 bs=1 count=12 2>/dev/null | hexdump -v -e '1/1 "%c"') - local dev_board_id=$(platform_expected_image) - echo "Found LXL image with device board_id $board_id" - - [ -n "$dev_board_id" -a "lxl $board_id" != "$dev_board_id" ] && { - echo "Firmware board_id doesn't match device board_id ($dev_board_id)" - error=1 - } - - notify_firmware_no_backup - - if ! otrx check "$1" -o 64; then - echo "No valid TRX firmware in the Luxul image" - notify_firmware_test_result "trx_valid" 0 - error=1 - else - notify_firmware_test_result "trx_valid" 1 - fi - ;; - "safeloader") - ;; - "seama") - local img_signature=$(oseama info "$1" | grep "Meta entry:.*signature=" | sed "s/.*=//") - local dev_signature=$(platform_expected_image) - echo "Found Seama image with device signature: $img_signature" - - [ -n "$dev_signature" -a "seama $img_signature" != "$dev_signature" ] && { - echo "Firmware signature doesn't match device signature ($dev_signature)" - error=1 - } + local expected_image="$(platform_expected_image)" + [ -n "$expected_image" -a -n "$BCM53XX_FW_BOARD_ID" -a "$expected_image" != "$BCM53XX_FW_FORMAT $BCM53XX_FW_BOARD_ID" ] && { + echo "Firmware doesn't match device ($expected_image)" + error=1 + } + case "$BCM53XX_FW_FORMAT" in + "seamaseal") $(oseama info "$1" -e 0 | grep -q "Meta entry:.*type=firmware") || { - echo "Seama container doesn't have firmware entity" + echo "Seama seal doesn't contain firmware entity" error=1 } - ;; + ;; "trx") - local expected=$(platform_expected_image) + if ! otrx check "$1"; then + echo "Failed to find a valid TRX in firmware" + notify_firmware_test_result "trx_valid" 0 + error=1 + else + notify_firmware_test_result "trx_valid" 1 + fi - [ "$expected" == "safeloader" ] && { + [ "$expected_image" == "safeloader" ] && { echo "This device expects SafeLoader format and may not work with TRX" error=1 } - - if ! otrx check "$1"; then - echo "Invalid (corrupted?) TRX firmware" - notify_firmware_test_result "trx_valid" 0 - error=1 - else - notify_firmware_test_result "trx_valid" 1 - fi - ;; + ;; *) - echo "Invalid image type. Please use firmware specific for this device." - notify_firmware_broken - error=1 - ;; + case "$BCM53XX_FW_INT_IMG_FORMAT" in + "trx") + # Make sure that both ways of extracting TRX work. + # platform_do_upgrade() may use any of them. + if ! otrx check "$1" -o "$BCM53XX_FW_INT_IMG_TRX_OFFSET" || \ + ! $BCM53XX_FW_INT_IMG_EXTRACT_CMD < $1 | otrx check -; then + echo "Invalid (corrupted?) TRX firmware" + notify_firmware_test_result "trx_valid" 0 + error=1 + else + notify_firmware_test_result "trx_valid" 1 + fi + ;; + esac + ;; esac return $error @@ -246,8 +209,8 @@ platform_check_image() { } -# $(1): image for upgrade (with possible extra header) -# $(2): offset of trx in image +# $(1): TRX image or firmware containing TRX +# $(2): offset of TRX in firmware (optional) platform_do_upgrade_nand_trx() { local dir="/tmp/sysupgrade-bcm53xx" local trx="$1" @@ -311,15 +274,15 @@ platform_do_upgrade_nand_trx() { nand_do_upgrade $dir/root } -platform_do_upgrade_nand_seama() { +platform_do_upgrade_nand_seamaseal() { local dir="/tmp/sysupgrade-bcm53xx" - local seama="$1" + local seamaseal="$1" local tmp # Extract Seama entity from Seama seal rm -fR $dir mkdir -p $dir - oseama extract "$seama" \ + oseama extract "$seamaseal" \ -e 0 \ -o $dir/seama.entity [ $? -ne 0 ] && { @@ -358,26 +321,6 @@ platform_do_upgrade_nand_seama() { nand_do_upgrade $dir/root.ubi } -platform_trx_from_chk_cmd() { - local header_len=$((0x$(get_magic_long_at "$1" 4))) - - echo -n dd skip=$header_len iflag=skip_bytes -} - -platform_trx_from_cybertan_cmd() { - echo -n dd skip=32 iflag=skip_bytes -} - -platform_trx_from_lxl_cmd() { - local hdr_len=$(get_le_long_at "$1" 8) - - echo -n dd skip=$hdr_len iflag=skip_bytes -} - -platform_trx_from_lxlold_cmd() { - echo -n dd bs=64 skip=1 -} - platform_img_from_safeloader() { local dir="/tmp/sysupgrade-bcm53xx" @@ -396,23 +339,28 @@ platform_img_from_safeloader() { echo -n $dir/os-image } -platform_img_from_seama_cmd() { - echo -n oseama extract "$1" -e 0 -} - platform_other_do_upgrade() { - local file_type=$(platform_identify "$1") - local trx="$1" - local cmd= + platform_identify "$1" [ "$(platform_flash_type)" == "nand" ] && { - case "$file_type" in - "chk") platform_do_upgrade_nand_trx "$1" $((0x$(get_magic_long_at "$1" 4)));; - "cybertan") platform_do_upgrade_nand_trx "$1" 32;; - "lxl") platform_do_upgrade_nand_trx "$1" $(get_le_long_at "$1" 8);; - "lxlold") platform_do_upgrade_nand_trx "$1" 64;; - "seama") platform_do_upgrade_nand_seama "$1";; - "trx") platform_do_upgrade_nand_trx "$1";; + # Try NAND-aware upgrade + case "$BCM53XX_FW_FORMAT" in + "seamaseal") + platform_do_upgrade_nand_seamaseal "$1" + ;; + "trx") + platform_do_upgrade_nand_trx "$1" + ;; + *) + case "$BCM53XX_FW_INT_IMG_FORMAT" in + "trx") + platform_do_upgrade_nand_trx "$1" "$BCM53XX_FW_INT_IMG_TRX_OFFSET" + ;; + *) + echo "NAND aware sysupgrade is unsupported for $BCM53XX_FW_FORMAT format" + ;; + esac + ;; esac # Above calls exit on success. @@ -420,16 +368,26 @@ platform_other_do_upgrade() { echo "Writing whole image to NAND flash. All erase counters will be lost." } - case "$file_type" in - "chk") cmd=$(platform_trx_from_chk_cmd "$trx");; - "cybertan") cmd=$(platform_trx_from_cybertan_cmd "$trx");; - "lxl") cmd=$(platform_trx_from_lxl_cmd "$trx");; - "lxlold") cmd=$(platform_trx_from_lxlold_cmd "$trx");; - "safeloader") trx=$(platform_img_from_safeloader "$trx"); PART_NAME=os-image;; - "seama") cmd=$(platform_img_from_seama_cmd "$trx");; + case "$BCM53XX_FW_FORMAT" in + "safeloader") + PART_NAME=os-image + img=$(platform_img_from_safeloader "$1") + default_do_upgrade "$img" + ;; + "seamaseal") + default_do_upgrade "$1" "$BCM53XX_FW_INT_IMG_EXTRACT_CMD" + ;; + "trx") + default_do_upgrade "$1" + ;; + *) + case "$BCM53XX_FW_INT_IMG_FORMAT" in + "trx") + default_do_upgrade "$1" "$BCM53XX_FW_INT_IMG_EXTRACT_CMD" + ;; + esac + ;; esac - - default_do_upgrade "$trx" "$cmd" } platform_do_upgrade() { From 30b168b9b8451d6165833cee75019ef7dbfd8a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 29 Nov 2021 10:25:30 +0100 Subject: [PATCH 14/78] bcm4908: sysupgrade: refactor handling different firmware formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This results in setting format specific data (format info, extract commands) in a single function. It should help maintaining sysupgrade code. This change has been tested on Asus GT-AC5300 and Netgear R8000P. Signed-off-by: Rafał Miłecki --- .../base-files/lib/upgrade/platform.sh | 110 ++++++++++++------ 1 file changed, 77 insertions(+), 33 deletions(-) diff --git a/target/linux/bcm4908/base-files/lib/upgrade/platform.sh b/target/linux/bcm4908/base-files/lib/upgrade/platform.sh index ee43e3a713..c057f2dc58 100644 --- a/target/linux/bcm4908/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm4908/base-files/lib/upgrade/platform.sh @@ -4,6 +4,10 @@ RAMFS_COPY_BIN="bcm4908img expr" PART_NAME=firmware +BCM4908_FW_FORMAT= +BCM4908_FW_BOARD_ID= +BCM4908_FW_INT_IMG_FORMAT= + # $(1): file to read from # $(2): offset in bytes # $(3): length in bytes @@ -34,7 +38,12 @@ platform_identify() { magic=$(get_hex_u32_be "$1" 0) case "$magic" in 2a23245e) - echo "chk" + local header_len=$((0x$(get_hex_u32_be "$1" 4))) + local board_id_len=$(($header_len - 40)) + + BCM4908_FW_FORMAT="chk" + BCM4908_FW_BOARD_ID=$(dd if="$1" skip=40 bs=1 count=$board_id_len 2>/dev/null | hexdump -v -e '1/1 "%c"') + BCM4908_FW_INT_IMG_FORMAT="bcm4908img" return ;; esac @@ -44,12 +53,22 @@ platform_identify() { magic=$(get_content "$1" $((size - 20 - 64 + 8)) 12) case "$magic" in GT-AC5300) - echo "asus" + local size=$(wc -c "$1" | cut -d ' ' -f 1) + + BCM4908_FW_FORMAT="asus" + BCM4908_FW_BOARD_ID=$(get_content "$1" $((size - 20 - 64 + 8)) 12) + BCM4908_FW_INT_IMG_FORMAT="bcm4908img" return ;; esac - echo "unknown" + # Detecting native format is a bit complex (it may start with CFE or + # JFFS2) so just use bcm4908img instead of bash hacks. + # Make it the last attempt as bcm4908img detects also vendor formats. + bcm4908img info -i "$1" > /dev/null && { + BCM4908_FW_FORMAT="bcm4908img" + return + } } platform_check_image() { @@ -58,43 +77,51 @@ platform_check_image() { local expected_image=$(platform_expected_image) local error=0 - bcm4908img info -i "$1" > /dev/null || { - echo "Failed to validate BCM4908 image" >&2 + platform_identify "$1" + [ -z "$BCM4908_FW_FORMAT" ] && { + echo "Invalid image type. Please use firmware specific for this device." notify_firmware_broken return 1 } + echo "Found $BCM4908_FW_FORMAT firmware for device ${BCM4908_FW_BOARD_ID:----}" - bcm4908img bootfs -i "$1" ls | grep -q "1-openwrt" || { - # OpenWrt images have 1-openwrt dummy file in the bootfs. - # Don't allow backup if it's missing - notify_firmware_no_backup + local expected_image="$(platform_expected_image)" + [ -n "$expected_image" -a -n "$BCM4908_FW_BOARD_ID" -a "$BCM4908_FW_FORMAT $BCM4908_FW_BOARD_ID" != "$expected_image" ] && { + echo "Firmware doesn't match device ($expected_image)" + error=1 } - case "$(platform_identify "$1")" in - asus) - local size=$(wc -c "$1" | cut -d ' ' -f 1) - local productid=$(get_content "$1" $((size - 20 - 64 + 8)) 12) - - [ -n "$expected_image" -a "asus $productid" != "$expected_image" ] && { - echo "Firmware productid mismatch ($productid)" >&2 - error=1 + case "$BCM4908_FW_FORMAT" in + "bcm4908img") + bcm4908img info -i "$1" > /dev/null || { + echo "Failed to validate BCM4908 image" >&2 + notify_firmware_broken + return 1 } - ;; - chk) - local header_len=$((0x$(get_hex_u32_be "$1" 4))) - local board_id_len=$(($header_len - 40)) - local board_id=$(dd if="$1" skip=40 bs=1 count=$board_id_len 2>/dev/null | hexdump -v -e '1/1 "%c"') - [ -n "$expected_image" -a "chk $board_id" != "$expected_image" ] && { - echo "Firmware board_id mismatch ($board_id)" >&2 - error=1 + bcm4908img bootfs -i "$1" ls | grep -q "1-openwrt" || { + # OpenWrt images have 1-openwrt dummy file in the bootfs. + # Don't allow backup if it's missing + notify_firmware_no_backup } - ;; + ;; *) - echo "Invalid image type. Please use firmware specific for this device." >&2 - notify_firmware_broken - error=1 - ;; + case "$BCM4908_FW_INT_IMG_FORMAT" in + "bcm4908img") + bcm4908img info -i "$1" > /dev/null || { + echo "Failed to validate BCM4908 image" >&2 + notify_firmware_broken + return 1 + } + + bcm4908img bootfs -i "$1" ls | grep -q "1-openwrt" || { + # OpenWrt images have 1-openwrt dummy file in the bootfs. + # Don't allow backup if it's missing + notify_firmware_no_backup + } + ;; + esac + ;; esac return $error @@ -189,10 +216,27 @@ platform_do_upgrade_ubi() { } platform_do_upgrade() { - # Try NAND aware UBI upgrade for OpenWrt images - # Below call will exit on success - bcm4908img bootfs -i "$1" ls | grep -q "1-openwrt" && platform_do_upgrade_ubi "$1" + platform_identify "$1" + # Try NAND aware UBI upgrade for OpenWrt images + case "$BCM4908_FW_FORMAT" in + "bcm4908img") + bcm4908img bootfs -i "$1" ls | grep -q "1-openwrt" && platform_do_upgrade_ubi "$1" + ;; + *) + case "$BCM4908_FW_INT_IMG_FORMAT" in + "bcm4908img") + bcm4908img bootfs -i "$1" ls | grep -q "1-openwrt" && platform_do_upgrade_ubi "$1" + ;; + *) + echo "NAND aware sysupgrade is unsupported for $BCM4908_FW_FORMAT format" + ;; + esac + ;; + esac + + # Above calls exit on success. + # If we got here it isn't OpenWrt image or something went wrong. echo "Writing whole image to NAND flash. All erase counters will be lost." # Find cferam name for new firmware From fd311a5fe3ec7e1a6dd38824eabc9e210a4eb0d3 Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 13 Nov 2021 16:15:53 +0100 Subject: [PATCH 15/78] sunxi: update nanopi neo air that use brcmfmac43430a0 Update wifi firmware used for nanopi neo air, with cypress-firmware-43430-sdio there is no wifi detected, as brcmfmac-firmware-43430a0-sdio allow to acces to wifi. Signed-off-by: Michel Promonet --- target/linux/sunxi/image/cortexa7.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk index f5c2b850bc..74cdc6e996 100644 --- a/target/linux/sunxi/image/cortexa7.mk +++ b/target/linux/sunxi/image/cortexa7.mk @@ -39,7 +39,7 @@ define Device/friendlyarm_nanopi-neo-air DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi NEO Air DEVICE_PACKAGES := kmod-leds-gpio kmod-brcmfmac \ - cypress-firmware-43430-sdio wpad-basic-wolfssl + brcmfmac-firmware-43430a0-sdio wpad-basic-wolfssl SOC := sun8i-h3 endef TARGET_DEVICES += friendlyarm_nanopi-neo-air From 7e153900566ec1aebdc4f15f5a9d9ff9b9401cc1 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 2 Dec 2021 11:26:36 +0100 Subject: [PATCH 16/78] mt76: update to the latest version a6451fea5a3d mt76: mt7615: improve wmm index allocation 1911486414dc mt76: mt7915: improve wmm index allocation 7998a41d1321 mt76: clear sta powersave flag after notifying driver 664475574438 mt76: mt7603: introduce SAR support 5c0da39c940b mt76: mt7915: introduce SAR support 77fc6c439a32 mt76: mt7603: improve reliability of tx powersave filtering 094b3d800835 firmware: update mt7663 rebb firmware to 20200904171623 25237b19bcc1 mt76: eeprom: tolerate corrected bit-flips 1463cb4c6ac2 mt76: mt7921: fix boolreturn.cocci warning 586bad6020f7 mt76: mt7921: use correct iftype data on 6GHz cap init 8ec95c910425 mt76: mt7921s: fix bus hang with wrong privilege 688e30c7d854 firmware: update mt7921 firmware to version 20211014 6fad970893dd mt76: fix key pointer overwrite in mt7921s_write_txwi/mt7663_usb_sdio_write_txwi 95acf972750c mt76: fix 802.3 RX fail by hdr_trans 3f402b0cf6c0 mt76: mt7921s: fix possible kernel crash due to invalid Rx count 929a03a8d65d mt76: connac: fix last_chan configuration in mt76_connac_mcu_rate_txpower_band Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index e947f1a2f3..ca4ef5d137 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-11-23 -PKG_SOURCE_VERSION:=99225b985cbcab4707589f1fa313436f4bf1e368 -PKG_MIRROR_HASH:=6444c7d49d778c7621b03f0f201ce41f6dc9ac00dedb29c66478360b4fd60492 +PKG_SOURCE_DATE:=2021-12-02 +PKG_SOURCE_VERSION:=929a03a8d65daf912eb09ae07df522b863c7a8fc +PKG_MIRROR_HASH:=8078d9f40fa341936252d27447821e4826af800b07e5fc412abcea34e648be59 PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 From 15d8c7aa74c202c530dbd53e53b00e418f0b64f4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 2 Dec 2021 13:52:18 +0100 Subject: [PATCH 17/78] mac80211: fix queue assignment of aggregation start requests Signed-off-by: Felix Fietkau --- ...DBA-requests-using-the-tid-queue-of-.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/309-mac80211-send-ADDBA-requests-using-the-tid-queue-of-.patch diff --git a/package/kernel/mac80211/patches/subsys/309-mac80211-send-ADDBA-requests-using-the-tid-queue-of-.patch b/package/kernel/mac80211/patches/subsys/309-mac80211-send-ADDBA-requests-using-the-tid-queue-of-.patch new file mode 100644 index 0000000000..1c213289c5 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/309-mac80211-send-ADDBA-requests-using-the-tid-queue-of-.patch @@ -0,0 +1,28 @@ +From: Felix Fietkau +Date: Thu, 2 Dec 2021 13:30:05 +0100 +Subject: [PATCH] mac80211: send ADDBA requests using the tid/queue of the + aggregation session + +Sending them out on a different queue can cause a race condition where a +number of packets in the queue may be discarded by the receiver, because +the ADDBA request is sent too early. +This affects any driver with software A-MPDU setup which does not allocate +packet seqno in hardware on tx, regardless of whether iTXQ is used or not. +The only driver I've seen that explicitly deals with this issue internally +is mwl8k. + +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/agg-tx.c ++++ b/net/mac80211/agg-tx.c +@@ -106,7 +106,7 @@ static void ieee80211_send_addba_request + mgmt->u.action.u.addba_req.start_seq_num = + cpu_to_le16(start_seq_num << 4); + +- ieee80211_tx_skb(sdata, skb); ++ ieee80211_tx_skb_tid(sdata, skb, tid); + } + + void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn) From a1a71a71999001502fa86136dbf8925da8341098 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 2 Dec 2021 14:11:21 +0100 Subject: [PATCH 18/78] mac80211: fix tx aggregation locking issue Signed-off-by: Felix Fietkau --- ...don-t-schedule_and_wake_txq-under-st.patch | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/310-mac80211-agg-tx-don-t-schedule_and_wake_txq-under-st.patch diff --git a/package/kernel/mac80211/patches/subsys/310-mac80211-agg-tx-don-t-schedule_and_wake_txq-under-st.patch b/package/kernel/mac80211/patches/subsys/310-mac80211-agg-tx-don-t-schedule_and_wake_txq-under-st.patch new file mode 100644 index 0000000000..008ee49cfb --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/310-mac80211-agg-tx-don-t-schedule_and_wake_txq-under-st.patch @@ -0,0 +1,79 @@ +From: Johannes Berg +Date: Mon, 29 Nov 2021 15:32:47 +0200 +Subject: [PATCH] mac80211: agg-tx: don't schedule_and_wake_txq() under + sta->lock + +When we call ieee80211_agg_start_txq(), that will in turn call +schedule_and_wake_txq(). Called from ieee80211_stop_tx_ba_cb() +this is done under sta->lock, which leads to certain circular +lock dependencies, as reported by Chris Murphy: +https://lore.kernel.org/r/CAJCQCtSXJ5qA4bqSPY=oLRMbv-irihVvP7A2uGutEbXQVkoNaw@mail.gmail.com + +In general, ieee80211_agg_start_txq() is usually not called +with sta->lock held, only in this one place. But it's always +called with sta->ampdu_mlme.mtx held, and that's therefore +clearly sufficient. + +Change ieee80211_stop_tx_ba_cb() to also call it without the +sta->lock held, by factoring it out of ieee80211_remove_tid_tx() +(which is only called in this one place). + +This breaks the locking chain and makes it less likely that +we'll have similar locking chain problems in the future. + +Reported-by: Chris Murphy +Signed-off-by: Johannes Berg +Signed-off-by: Luca Coelho +--- + +--- a/net/mac80211/agg-tx.c ++++ b/net/mac80211/agg-tx.c +@@ -9,7 +9,7 @@ + * Copyright 2007, Michael Wu + * Copyright 2007-2010, Intel Corporation + * Copyright(c) 2015-2017 Intel Deutschland GmbH +- * Copyright (C) 2018 - 2020 Intel Corporation ++ * Copyright (C) 2018 - 2021 Intel Corporation + */ + + #include +@@ -213,6 +213,8 @@ ieee80211_agg_start_txq(struct sta_info + struct ieee80211_txq *txq = sta->sta.txq[tid]; + struct txq_info *txqi; + ++ lockdep_assert_held(&sta->ampdu_mlme.mtx); ++ + if (!txq) + return; + +@@ -290,7 +292,6 @@ static void ieee80211_remove_tid_tx(stru + ieee80211_assign_tid_tx(sta, tid, NULL); + + ieee80211_agg_splice_finish(sta->sdata, tid); +- ieee80211_agg_start_txq(sta, tid, false); + + kfree_rcu(tid_tx, rcu_head); + } +@@ -889,6 +890,7 @@ void ieee80211_stop_tx_ba_cb(struct sta_ + { + struct ieee80211_sub_if_data *sdata = sta->sdata; + bool send_delba = false; ++ bool start_txq = false; + + ht_dbg(sdata, "Stopping Tx BA session for %pM tid %d\n", + sta->sta.addr, tid); +@@ -906,10 +908,14 @@ void ieee80211_stop_tx_ba_cb(struct sta_ + send_delba = true; + + ieee80211_remove_tid_tx(sta, tid); ++ start_txq = true; + + unlock_sta: + spin_unlock_bh(&sta->lock); + ++ if (start_txq) ++ ieee80211_agg_start_txq(sta, tid, false); ++ + if (send_delba) + ieee80211_send_delba(sdata, sta->sta.addr, tid, + WLAN_BACK_INITIATOR, WLAN_REASON_QSTA_NOT_USE); From 8fedc17d01806c8a4bf4ed9e83a9523677d37bbd Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Mon, 29 Nov 2021 19:07:34 +0300 Subject: [PATCH 19/78] tools/fakeroot: fix build on MacOS arm64 Added patch for MacOS without 32 bit inodes support (__DARWIN_ONLY_64_BIT_INO_T is true) This patch based on discussion https://github.com/archmac/bootstrap/issues/4 Signed-off-by: Sergey V. Lobanov --- .../patches/500-macos_arm64_compile_fix.patch | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 tools/fakeroot/patches/500-macos_arm64_compile_fix.patch diff --git a/tools/fakeroot/patches/500-macos_arm64_compile_fix.patch b/tools/fakeroot/patches/500-macos_arm64_compile_fix.patch new file mode 100644 index 0000000000..a3731b9e99 --- /dev/null +++ b/tools/fakeroot/patches/500-macos_arm64_compile_fix.patch @@ -0,0 +1,86 @@ +diff --git a/communicate.c b/communicate.c +index e2699a2..21e5366 100644 +--- a/communicate.c ++++ b/communicate.c +@@ -24,7 +24,12 @@ + In this file, we want 'struct stat' to have a 32-bit 'ino_t'. + We use 'struct stat64' when we need a 64-bit 'ino_t'. + */ +-#define _DARWIN_NO_64_BIT_INODE ++# include ++# if __DARWIN_ONLY_64_BIT_INO_T ++# define _DARWIN_USE_64_BIT_INODE ++# else ++# define _DARWIN_NO_64_BIT_INODE ++# endif + #endif + + #include "communicate.h" +diff --git a/communicate.h b/communicate.h +index 3f9ca39..a586108 100644 +--- a/communicate.h ++++ b/communicate.h +@@ -91,6 +91,10 @@ + # include + #endif + ++#if __DARWIN_ONLY_64_BIT_INO_T ++struct stat64 __DARWIN_STRUCT_STAT64; ++#endif ++ + #ifndef FAKEROOT_FAKENET + # define FAKEROOTKEY_ENV "FAKEROOTKEY" + #endif /* ! FAKEROOT_FAKENET */ +diff --git a/faked.c b/faked.c +index a970184..ea51a23 100644 +--- a/faked.c ++++ b/faked.c +@@ -84,7 +84,12 @@ + In this file, we want 'struct stat' to have a 32-bit 'ino_t'. + We use 'struct stat64' when we need a 64-bit 'ino_t'. + */ +-#define _DARWIN_NO_64_BIT_INODE ++# include ++# if __DARWIN_ONLY_64_BIT_INO_T ++# define _DARWIN_USE_64_BIT_INODE ++# else ++# define _DARWIN_NO_64_BIT_INODE ++# endif + #endif + + #include "config.h" +diff --git a/libfakeroot.c b/libfakeroot.c +index c967d5d..836337d 100644 +--- a/libfakeroot.c ++++ b/libfakeroot.c +@@ -38,7 +38,12 @@ + In this file, we want 'struct stat' to have a 32-bit 'ino_t'. + We use 'struct stat64' when we need a 64-bit 'ino_t'. + */ +-#define _DARWIN_NO_64_BIT_INODE ++# include ++# if __DARWIN_ONLY_64_BIT_INO_T ++# define _DARWIN_USE_64_BIT_INODE ++# else ++# define _DARWIN_NO_64_BIT_INODE ++# endif + + /* The helper _unix2003 version of this file calls a few functions in this file + that are marked with static_nonapple so that needs to become private instead +diff --git a/libfakeroot_unix2003.c b/libfakeroot_unix2003.c +index e1e19b6..f32bfec 100644 +--- a/libfakeroot_unix2003.c ++++ b/libfakeroot_unix2003.c +@@ -18,7 +18,11 @@ + In this file, we want 'struct stat' to have a 32-bit 'ino_t'. + We use 'struct stat64' when we need a 64-bit 'ino_t'. + */ +-#define _DARWIN_NO_64_BIT_INODE ++# if __DARWIN_ONLY_64_BIT_INO_T ++# define _DARWIN_USE_64_BIT_INODE ++# else ++# define _DARWIN_NO_64_BIT_INODE ++# endif + + /* + This file is for 32-bit symbols which have the "$UNIX2003" version, i.e. From ab241e0937c9cea4ae606f204ce82749373611f0 Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Mon, 29 Nov 2021 19:09:10 +0300 Subject: [PATCH 20/78] toolchain/gcc: fix build on MacOS arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added patch for GCC to fix compilation issues on MacOS arm64 The original commit message from Przemysław Buczkowski: GCC: Patch for Apple Silicon compatibility This patch fixes a linker error occuring when compiling the cross-compiler on macOS and ARM64 architecture. Adapted from: https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404 Signed-off-by: Sergey V. Lobanov --- .../11.2.0/970-macos_arm64-building-fix.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 toolchain/gcc/patches/11.2.0/970-macos_arm64-building-fix.patch diff --git a/toolchain/gcc/patches/11.2.0/970-macos_arm64-building-fix.patch b/toolchain/gcc/patches/11.2.0/970-macos_arm64-building-fix.patch new file mode 100644 index 0000000000..6572b8e559 --- /dev/null +++ b/toolchain/gcc/patches/11.2.0/970-macos_arm64-building-fix.patch @@ -0,0 +1,49 @@ +commit 9c6e71079b46ad5433165feaa2001450f2017b56 +Author: Przemysław Buczkowski +Date: Mon Aug 16 13:16:21 2021 +0100 + + GCC: Patch for Apple Silicon compatibility + + This patch fixes a linker error occuring when compiling + the cross-compiler on macOS and ARM64 architecture. + + Adapted from: + https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404 + + Change-Id: Ia3ee98a163bbb62689f42e2da83a5ef36beb0913 + Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4329 + Reviewed-by: John Scipione + Reviewed-by: Adrien Destugues + +diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h +index 976f9afae5..736b83ff0b 100644 +--- a/gcc/config/aarch64/aarch64.h ++++ b/gcc/config/aarch64/aarch64.h +@@ -1000,7 +1000,7 @@ extern const char *aarch64_rewrite_mcpu (int argc, const char **argv); + #define MCPU_TO_MARCH_SPEC_FUNCTIONS \ + { "rewrite_mcpu", aarch64_rewrite_mcpu }, + +-#if defined(__aarch64__) ++#if defined(__aarch64__) && ! defined(__APPLE__) + extern const char *host_detect_local_cpu (int argc, const char **argv); + #define HAVE_LOCAL_CPU_DETECT + # define EXTRA_SPEC_FUNCTIONS \ +diff --git a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c +index 8f700eec85..b737abc006 100644 +--- a/gcc/config/host-darwin.c ++++ b/gcc/config/host-darwin.c +@@ -22,6 +22,8 @@ + #include "coretypes.h" + #include "diagnostic-core.h" + #include "config/host-darwin.h" ++#include "hosthooks.h" ++#include "hosthooks-def.h" + + /* Yes, this is really supposed to work. */ + static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096))); +@@ -75,3 +77,5 @@ darwin_gt_pch_use_address (void *addr, size_t sz, int fd, size_t off) + + return ret; + } ++ ++const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; From 8d623047851337c4507f77b51f47851988c0f53c Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Tue, 5 Jan 2021 00:22:00 +0100 Subject: [PATCH 21/78] ipq40xx: add MikroTik LHGG-60ad outdoor 802.11ad (60GHz) dish LHGG-60ad is IPQ4019 + wil6210 based. Specification: - Qualcomm IPQ4019 (717 MHz) - 256 MB of RAM (DDR3L) - 16 MB (SPI NOR) of flash - 1x Gbit ethernet, 802.3af/at POE IN connected through AR8035. - WLAN: wil6210 802.11ad PCI card - No USB or SD card ports - UART disabled - 8x LEDs Biggest news is the wil6210 PCI card. Integration for its configuration and detection has already been taken care of when adding support for TP-Link Talon AD7200. However, signal quality is much lower than with stock firmware, so probably additional board-specific data has to be provided to the driver and is still missing at the moment. Signed-off-by: Robert Marko Signed-off-by: Alexander Couzens Signed-off-by: Daniel Golle [Fix Ethernet Interface] Signed-off-by: Nick Hainke --- .../ipq40xx/base-files/etc/board.d/01_leds | 3 +- .../ipq40xx/base-files/etc/board.d/02_network | 2 + .../base-files/lib/upgrade/platform.sh | 1 + .../arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts | 269 ++++++++++++++++++ target/linux/ipq40xx/image/mikrotik.mk | 8 + .../901-arm-boot-add-dts-files.patch | 3 +- .../901-arm-boot-add-dts-files.patch | 3 +- 7 files changed, 286 insertions(+), 3 deletions(-) create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts diff --git a/target/linux/ipq40xx/base-files/etc/board.d/01_leds b/target/linux/ipq40xx/base-files/etc/board.d/01_leds index 8942ad2000..16039c8c42 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/01_leds +++ b/target/linux/ipq40xx/base-files/etc/board.d/01_leds @@ -22,7 +22,8 @@ avm,fritzbox-4040) ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x1e" ;; avm,fritzbox-7530 |\ -glinet,gl-b1300) +glinet,gl-b1300 |\ +mikrotik,lhgg-60ad) ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" ;; edgecore,oap100) diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 12e67387fa..63209fa49a 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -29,6 +29,7 @@ ipq40xx_setup_interfaces() engenius,eap1300|\ engenius,emd1|\ meraki,mr33|\ + mikrotik,lhgg-60ad|\ mikrotik,sxtsq-5-ac|\ netgear,ex6100v2|\ netgear,ex6150v2|\ @@ -190,6 +191,7 @@ ipq40xx_setup_macs() lan_mac=$(macaddr_add $wan_mac 1) label_mac="$wan_mac" ;; + mikrotik,lhgg-60ad|\ mikrotik,sxtsq-5-ac) lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base) label_mac="$lan_mac" diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index bd55b1712b..8f8494dcff 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -133,6 +133,7 @@ platform_do_upgrade() { nand_do_upgrade "$1" ;; mikrotik,hap-ac2|\ + mikrotik,lhgg-60ad|\ mikrotik,sxtsq-5-ac) [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware default_do_upgrade "$1" diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts new file mode 100644 index 0000000000..bd61f4b69f --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-lhgg-60ad.dts @@ -0,0 +1,269 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2019, Robert Marko + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Mikrotik Wireless Wire Dish LHGG-60ad"; + compatible = "mikrotik,lhgg-60ad"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &user; + led-failsafe = &user; + led-running = &user; + led-upgrade = &user; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + + /delete-node/ ethernet-phy@1; + /delete-node/ ethernet-phy@2; + /delete-node/ ethernet-phy@3; + /delete-node/ ethernet-phy@4; + /delete-node/ psgmii-phy@5; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + switch_mac_mode = <0x3>; /* mac mode for RGMII RMII */ + switch_lan_bmp = <0x0>; /* lan port bitmap */ + switch_wan_bmp = <0x10>; /* wan port bitmap */ + }; + + edma@c080000 { + status = "okay"; + phy-mode = "rgmii-id"; + qcom,num_gmac = <1>; + qcom,single-phy; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + power: power { + label = "blue:power"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + panic-indicator; + }; + + user: user { + label = "yellow:user"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + + wlan { + label = "green:wlan"; + gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + }; + + align-left { + label = "green:align-left"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + align-right { + label = "green:align-right"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + + wlan-rx { + label = "green:align-down"; + gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>; + }; + + wlan-tx { + label = "green:align-up"; + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi-0-pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + bias-disable; + }; + + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + status = "okay"; + + m25p80@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Qualcomm"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + label = "RouterBoot"; + reg = <0x80000 0x80000>; + read-only; + + hard_config { + read-only; + size = <0x2000>; + }; + + dtb_config { + read-only; + }; + + soft_config { + }; + }; + + partition@100000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x100000 0xf00000>; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 42 GPIO_ACTIVE_HIGH>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + /* wil6210 802.11ad card */ + wifi: wifi@1,0 { + status = "okay"; + /* wil6210 driver has no compatible */ + reg = <0x00010000 0 0 0 0>; + }; + }; +}; + +&gmac0 { + qcom,phy_mdio_addr = <0>; + qcom,poll_required = <1>; + vlan_tag = <0 0x20>; +}; diff --git a/target/linux/ipq40xx/image/mikrotik.mk b/target/linux/ipq40xx/image/mikrotik.mk index bfff58597f..2fdaad60ab 100644 --- a/target/linux/ipq40xx/image/mikrotik.mk +++ b/target/linux/ipq40xx/image/mikrotik.mk @@ -40,6 +40,14 @@ define Device/mikrotik_hap-ac3 endef TARGET_DEVICES += mikrotik_hap-ac3 +define Device/mikrotik_lhgg-60ad + $(call Device/mikrotik_nor) + DEVICE_MODEL := Wireless Wire Dish LHGG-60ad + DEVICE_DTS := qcom-ipq4019-lhgg-60ad + DEVICE_PACKAGES += -kmod-ath10k-ct -ath10k-firmware-qca4019-ct kmod-wil6210 +endef +TARGET_DEVICES += mikrotik_lhgg-60ad + define Device/mikrotik_sxtsq-5-ac $(call Device/mikrotik_nor) DEVICE_MODEL := SXTsq 5 ac (RBSXTsqG-5acD) diff --git a/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch index 9817e9c102..3bd13bf932 100644 --- a/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -902,11 +902,69 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -902,11 +902,70 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -58,6 +58,7 @@ Signed-off-by: John Crispin + qcom-ipq4019-habanero-dvk.dtb \ + qcom-ipq4019-hap-ac3.dtb \ + qcom-ipq4019-map-ac2200.dtb \ ++ qcom-ipq4019-lhgg-60ad.dtb \ + qcom-ipq4019-mr8300.dtb \ + qcom-ipq4019-pa2200.dtb \ + qcom-ipq4019-r619ac-64m.dtb \ diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index bda2b014a4..734d08387a 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,67 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,68 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -55,6 +55,7 @@ Signed-off-by: John Crispin + qcom-ipq4019-fritzrepeater-3000.dtb \ + qcom-ipq4019-hap-ac3.dtb \ + qcom-ipq4019-map-ac2200.dtb \ ++ qcom-ipq4019-lhgg-60ad.dtb \ + qcom-ipq4019-mr8300.dtb \ + qcom-ipq4019-e2600ac-c1.dtb \ + qcom-ipq4019-e2600ac-c2.dtb \ From 57c1f3f9c5c699cc215bebde772552787c632570 Mon Sep 17 00:00:00 2001 From: Enrico Mioso Date: Wed, 1 Dec 2021 16:17:55 +0100 Subject: [PATCH 22/78] base-files: add eMMC sysupgrade support Adds generic support for sysupgrading on eMMC-based devices. Provide function emmc_do_upgrade and emmc_copy_config to be used in /lib/upgrade/platform.sh instead of redundantly implementing the same logic over and over again. Similar to generic sysupgrade on NAND, use environment variables CI_KERNPART, CI_ROOTPART and newly introduce CI_DATAPART to indicate GPT partition names to be used. On devices with more than one MMC block device, CI_ROOTDEV can be used to specify the MMC device for partition name lookups. Also allow to select block devices directly using EMMC_KERN_DEV, EMMC_ROOT_DEV and EMMC_DATA_DEV, as using GPT partition names is not always an option (e.g. when forced to use MBR). To easily handle writing kernel and rootfs make use of sysupgrade.tar format convention which is also already used for generic NAND support. Signed-off-by: Enrico Mioso Signed-off-by: Daniel Golle CC: Li Zhang CC: TruongSinh Tran-Nguyen --- package/base-files/Makefile | 8 +++ package/base-files/files/lib/upgrade/emmc.sh | 64 ++++++++++++++++++++ scripts/target-metadata.pl | 1 + target/Config.in | 3 + 4 files changed, 76 insertions(+) create mode 100644 package/base-files/files/lib/upgrade/emmc.sh diff --git a/package/base-files/Makefile b/package/base-files/Makefile index af5c0e6b00..914f0598ff 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -24,6 +24,7 @@ PKG_CONFIG_DEPENDS += \ CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \ CONFIG_NAND_SUPPORT \ CONFIG_LEGACY_SDCARD_SUPPORT \ + CONFIG_EMMC_SUPPORT \ CONFIG_CLEAN_IPKG \ CONFIG_PER_FEED_REPO \ $(foreach feed,$(FEEDS_AVAILABLE),CONFIG_FEED_$(feed)) @@ -124,6 +125,12 @@ ifeq ($(CONFIG_NAND_SUPPORT),) endef endif +ifeq ($(CONFIG_EMMC_SUPPORT),) + define Package/base-files/emmc-support + rm -f $(1)/lib/upgrade/emmc.sh + endef +endif + ifeq ($(CONFIG_LEGACY_SDCARD_SUPPORT),) define Package/base-files/legacy-sdcard-support rm -f $(1)/lib/upgrade/legacy-sdcard.sh @@ -136,6 +143,7 @@ define Package/base-files/install $(Package/base-files/install-key) $(Package/base-files/nand-support) $(Package/base-files/legacy-sdcard-support) + $(Package/base-files/emmc-support) if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \ $(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \ fi diff --git a/package/base-files/files/lib/upgrade/emmc.sh b/package/base-files/files/lib/upgrade/emmc.sh new file mode 100644 index 0000000000..15fa370cd9 --- /dev/null +++ b/package/base-files/files/lib/upgrade/emmc.sh @@ -0,0 +1,64 @@ +# Copyright (C) 2021 OpenWrt.org +# + +. /lib/functions.sh + +emmc_upgrade_tar() { + local tar_file="$1" + [ "$CI_KERNPART" -a -z "$EMMC_KERN_DEV" ] && export EMMC_KERN_DEV="$(find_mmc_part $CI_KERNPART $CI_ROOTDEV)" + [ "$CI_ROOTPART" -a -z "$EMMC_ROOT_DEV" ] && export EMMC_ROOT_DEV="$(find_mmc_part $CI_ROOTPART $CI_ROOTDEV)" + [ "$CI_DATAPART" -a -z "$EMMC_DATA_DEV" ] && export EMMC_DATA_DEV="$(find_mmc_part $CI_DATAPART $CI_ROOTDEV)" + local has_kernel + local has_rootfs + local board_dir=$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + tar tf "$tar_file" ${board_dir}/kernel 1>/dev/null 2>/dev/null && has_kernel=1 + tar tf "$tar_file" ${board_dir}/root 1>/dev/null 2>/dev/null && has_rootfs=1 + + [ "$has_kernel" = 1 -a "$EMMC_KERN_DEV" ] && + export EMMC_KERNEL_BLOCKS=$(($(tar xf "$tar_file" ${board_dir}/kernel -O | dd of="$EMMC_KERN_DEV" bs=512 2>&1 | grep "records out" | cut -d' ' -f1))) + + [ "$has_rootfs" = 1 -a "$EMMC_ROOT_DEV" ] && + export EMMC_ROOTFS_BLOCKS=$(($(tar xf "$tar_file" ${board_dir}/root -O | dd of="$EMMC_ROOT_DEV" bs=512 2>&1 | grep "records out" | cut -d' ' -f1))) + + if [ -z "$UPGRADE_BACKUP" ]; then + if [ "$EMMC_DATA_DEV" ]; then + dd if=/dev/zero of="$EMMC_DATA_DEV" bs=512 count=8 + elif [ "$EMMC_ROOTFS_BLOCKS" ]; then + dd if=/dev/zero of="$EMMC_ROOT_DEV" bs=512 seek=$EMMC_ROOTFS_BLOCKS count=8 + elif [ "$EMMC_KERNEL_BLOCKS" ]; then + dd if=/dev/zero of="$EMMC_KERN_DEV" bs=512 seek=$EMMC_KERNEL_BLOCKS count=8 + fi + fi +} + +emmc_upgrade_fit() { + local fit_file="$1" + [ "$CI_KERNPART" -a -z "$EMMC_KERN_DEV" ] && export EMMC_KERN_DEV="$(find_mmc_part $CI_KERNPART $CI_ROOTDEV)" + + if [ "$EMMC_KERN_DEV" ]; then + export EMMC_KERNEL_BLOCKS=$(($(get_image "$fit_file" | fwtool -i /dev/null -T - | dd of="$EMMC_KERN_DEV" bs=512 2>&1 | grep "records out" | cut -d' ' -f1))) + + [ -z "$UPGRADE_BACKUP" ] && dd if=/dev/zero of="$EMMC_KERN_DEV" bs=512 seek=$EMMC_KERNEL_BLOCKS count=8 + fi +} + +emmc_copy_config() { + if [ "$EMMC_DATA_DEV" ]; then + dd if="$UPGRADE_BACKUP" of="$EMMC_DATA_DEV" bs=512 + elif [ "$EMMC_ROOTFS_BLOCKS" ]; then + dd if="$UPGRADE_BACKUP" of="$EMMC_ROOT_DEV" bs=512 seek=$EMMC_ROOTFS_BLOCKS + elif [ "$EMMC_KERNEL_BLOCKS" ]; then + dd if="$UPGRADE_BACKUP" of="$EMMC_KERN_DEV" bs=512 seek=$EMMC_KERNEL_BLOCKS + fi +} + +emmc_do_upgrade() { + local file_type=$(identify $1) + + case "$file_type" in + "fit") emmc_upgrade_fit $1;; + *) emmc_upgrade_tar $1;; + esac +} diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index 163eb3768b..e1d4ef242b 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -17,6 +17,7 @@ sub target_config_features(@) { /^display$/ and $ret .= "\tselect DISPLAY_SUPPORT\n"; /^dt$/ and $ret .= "\tselect USES_DEVICETREE\n"; /^dt-overlay$/ and $ret .= "\tselect HAS_DT_OVERLAY_SUPPORT\n"; + /^emmc$/ and $ret .= "\tselect EMMC_SUPPORT\n"; /^ext4$/ and $ret .= "\tselect USES_EXT4\n"; /^fpu$/ and $ret .= "\tselect HAS_FPU\n"; /^gpio$/ and $ret .= "\tselect GPIO_SUPPORT\n"; diff --git a/target/Config.in b/target/Config.in index 32242446ee..a6b3351a61 100644 --- a/target/Config.in +++ b/target/Config.in @@ -98,6 +98,9 @@ config HAS_MIPS16 config RFKILL_SUPPORT bool +config EMMC_SUPPORT + bool + config NAND_SUPPORT bool From febc2b831f633d8d6648267952bd43c35689c36f Mon Sep 17 00:00:00 2001 From: TruongSinh Tran-Nguyen Date: Wed, 1 Dec 2021 16:18:17 +0100 Subject: [PATCH 23/78] ipq40xx: add support for GL.iNet GL-B2200 This patch adds supports for the GL-B2200 router. Specifications: - SOC: Qualcomm IPQ4019 ARM Quad-Core - RAM: 512 MiB - Flash: 16 MiB NOR - SPI0 - EMMC: 8GB EMMC - ETH: Qualcomm QCA8075 - WLAN1: Qualcomm Atheros QCA4019 2.4GHz 802.11b/g/n 2x2 - WLAN2: Qualcomm Atheros QCA4019 5GHz 802.11n/ac W2 2x2 - WLAN3: Qualcomm Atheros QCA9886 5GHz 802.11n/ac W2 2x2 - INPUT: Reset, WPS - LED: Power, Internet - UART1: On board pin header near to LED (3.3V, TX, RX, GND), 3.3V without pin - 115200 8N1 - UART2: On board with BLE module - SPI1: On board socket for Zigbee module Update firmware instructions: Please update the firmware via U-Boot web UI (by default at 192.168.1.1, following instructions found at https://docs.gl-inet.com/en/3/troubleshooting/debrick/). Normal sysupgrade, either via CLI or LuCI, is not possible from stock firmware. Please do use the *gl-b2200-squashfs-emmc.img file, gunzipping the produced *gl-b2200-squashfs-emmc.img.gz one first. What's working: - WiFi 2G, 5G - WPA2/WPA3 Not tested: - Bluetooth LE/Zigbee Credits goes to the original authors of this patch. V1->V2: - updates *arm-boot-add-dts-files.patch correctly (sorry, my mistake) - add uboot-envtools support V2->V3: - Li Zhang updated official patch to fix wrong MAC address on wlan0 (PCI) interface V3->V4: - wire up sysupgrade Signed-off-by: Li Zhang [fix tab and trailing space, document what's working and what's not] Signed-off-by: TruongSinh Tran-Nguyen [rebase on top of master, address remaining comments] Signed-off-by: Enrico Mioso [remove redundant check in platform.sh] Signed-off-by: Daniel Golle --- package/boot/uboot-envtools/files/ipq40xx | 1 + package/firmware/ipq-wifi/Makefile | 2 + .../ipq-wifi/board-glinet_gl-b2200.qca4019 | Bin 0 -> 24308 bytes .../ipq-wifi/board-glinet_gl-b2200.qca9888 | Bin 0 -> 12200 bytes .../ipq40xx/base-files/etc/board.d/02_network | 5 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 5 + .../base-files/lib/upgrade/platform.sh | 15 + .../arm/boot/dts/qcom-ipq4019-gl-b2200.dts | 364 ++++++++++++++++++ target/linux/ipq40xx/generic/target.mk | 1 + target/linux/ipq40xx/image/generic.mk | 28 ++ .../901-arm-boot-add-dts-files.patch | 3 +- .../901-arm-boot-add-dts-files.patch | 3 +- 12 files changed, 425 insertions(+), 2 deletions(-) create mode 100644 package/firmware/ipq-wifi/board-glinet_gl-b2200.qca4019 create mode 100644 package/firmware/ipq-wifi/board-glinet_gl-b2200.qca9888 create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx index 1462aa991d..9a71a622f7 100644 --- a/package/boot/uboot-envtools/files/ipq40xx +++ b/package/boot/uboot-envtools/files/ipq40xx @@ -35,6 +35,7 @@ devolo,magic-2-wifi-next|\ edgecore,ecw5211|\ glinet,gl-ap1300|\ glinet,gl-b1300|\ +glinet,gl-b2200|\ luma,wrtq-329acn|\ netgear,wac510|\ openmesh,a42|\ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index ebaac48c24..b1e6541e61 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -39,6 +39,7 @@ ALLWIFIBOARDS:= \ engenius_emr3500 \ ezviz_cs-w3-wd1200g-eup \ glinet_gl-ap1300 \ + glinet_gl-b2200 \ glinet_gl-s1300 \ linksys_ea8300 \ linksys_mr8300-v0 \ @@ -127,6 +128,7 @@ $(eval $(call generate-ipq-wifi-package,engenius_emd1,EnGenius EMD1)) $(eval $(call generate-ipq-wifi-package,engenius_emr3500,EnGenius EMR3500)) $(eval $(call generate-ipq-wifi-package,ezviz_cs-w3-wd1200g-eup,EZVIZ CS-W3-WD1200G EUP)) $(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300)) +$(eval $(call generate-ipq-wifi-package,glinet_gl-b2200,GL.iNet GL-B2200)) $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300)) $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) $(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300)) diff --git a/package/firmware/ipq-wifi/board-glinet_gl-b2200.qca4019 b/package/firmware/ipq-wifi/board-glinet_gl-b2200.qca4019 new file mode 100644 index 0000000000000000000000000000000000000000..ac1850160aead29cee0fb96664272b8a620a4e6a GIT binary patch literal 24308 zcmeHPdr(tX8b1jj>SE!BfCzXAAv{7MK%g2V@)iT6U{R3(i$E30tx+C^hoKAYC{l=s zKrI*|Xc?48Q$)ta7qM7dJEP40v48CBA8ltJ-I;aQcCLna&8 z!7IvLW4{*NNZ>gXcuZf@TlE@SlXXWzx%bckIO$*H5j;jxpDANrJ>r>8pthc<;p4LO zFWA5$8ub~IVOWb{+S}XP+1c3`2mp8RnOZ0=(9STq!n$Fyu$yT!M<~;kWv-Mo58=y3 zFS92zKBQ`@KA4@FEEvD0YO9uI?@5jyA5fiYER(*Kyk&e4YUR?5{LMj?5?%CBs)V8s(0|89p6i8)lgnyGW#&)FdGlkwUvO9>6tCB*50Oq%E*KM znVzW=ZDqAdGTwfd_&Woook^zx%G~lh2Xi_jPqE6K3;G%hEf#BgWOCc@)op9#CSQ*(U<$A9iqn9D?N&D zd{WUJQtMUXoWHzKqM{`cu(MzHs|}8bv&+U!9-GMze1j7IjD3;7e&7WWp3&)a8lKzO zz^~;sda=J!mlf*v;N4w(l*93Xf4*#QZy&Zdo1JO9*65mq42dci5rM3%j5Ide3y$#9 zPfx#}n!>Mu1YBPqUE6=Y|KoRtZMflP2Yb4$?SG-2BRpX<{?DF0d91Tt#BhnOONQX} z2-Heyn}_g(HwNk@0E!<6m!+u@6EMmU6hY$9I3x@WLrUbwYfpU8+}1Hy0Ybgpwn|~3 z3?Abl193;)dG2B-)CqAzLJ7AJ5MqAYB8xAy;bH_T?yBu)Eq2X0u)LVN@ftCmWCN% zW;L%$lx877RVV}~1SkY31SkY31XeKu8~Ga%FUC&(P9&YNmA@5|n9X@vQ|*#8Nv;`dUIZ;@o28=pz7NS*7e5 zePmn)2Et#z;m_Y}7NxC343^MRG#N@PK!Edi+&TclfFI=NctJK02U4NfFyUnjBMh+F zo}O$YX@~7|TiNW~HVzO9XyC`A0JPg9wAcs$0@flx2!yuzYY;$pp|8({rIQn}>1Z-0 zs&Qo?@O;>TNv9uxI}mVpnQpuGBPbW4kh2?uGM_ea7W{DS8U4y!>F?*u`6ZKX=T5g* zr`w$q@7j}fu3VRmH6Zpu#f%1WCzRL& z6~{M_yP(AWr&t2%#T-SbSPG4E5%*=*4 z#Y8+&PoAfk2@}IPk=i8%*p@)w5ZokIH&UTvl4#4&2*3$4z^6d==!vB}SKo)@K z&tx(Io=92ejOc4le(mMx=UJ z)_+R_RUA4P7@~v0AL!uGm<@O$v;~fLY(dO+JAk;@*x4^k2vjc=0u%zP4uKiIyeYo@ zzyJQ1Z@>BG4-gd{2OsC#KmX_7{`C0qUtya$zP(Tw5vt?sPfh*nhlS_ho8sFC=>@0V z{%PC%wZYteIj?HY3Jaebb2 zdtY%@@$8!mqnfGri(%W>BieR#g(6cD^7Rd^N?oJKlL)le)#ntYk|cqzc0|*wRA3T; zC;mTTx9|D~0O-)BmMiv3c$34Lv&y4bhD4wlRrg?+Bux;c{jIuHA(O-lSh&NT34eb; zm|==cMdsv9O_x%R?UroS+*F>!%0!6*K6GeP93~ycC;Yi!^0wxJvI6$|hIUx#$=*6LCEAS%_U_uwol-$bKv^n zb7)l`R~9MK;K2*ZDr}b|1P0QnkV{ep+{x>j^U5+TUBtm1KAYe|l&)zz)#b`OMdIWb zJXo&C#Zq9H7a^9h0u&zYQdeRLqD_RueK-eeWC>pCQz2P$0x6Uzl*}No5|)OUsZq_V z7J-hDBbQ^^gBv_5E^2p5CtTIkZu7apc(L__mM+ z5BbP&kviq<>%Z|hdZs6{IqWzKb4>f9|8Q$;ov&v5ZvHi@mj&aaOKCb%>gwViXUCGcs6ZW0I4wZZ)#3f}jUx#aa} zq}_>USaKx4f3RFFJjpI~l8knjH7C>r$y_rYe45e}RK2OlXLaF;Yqsv+6CLIpF0Lgw_mqlW0-)SYN8M@iNGAX{WBvoOUWJ!ZD$n5 zYOB7CZ%;g92LFwkO=%Pc|NnJB^6dQ}i>4P+hd2%}K^9CbIDB>~+0r mM)B=m6*pJ+8D3jzj85S3pID+VNxf)UhC)x=qn z6hu*pVibldri{aMtZm0Sj1_0p=|dl!=}RB_?1Ob2UrKs6Vfj-usnGhfXLI+Sd+zzp zx%b-*>~hH8log+)lqX6R@v?1M1)IVC{rdqFCV@QzPzqZ`lQylsvL;Sft*NSONK0H# zR>oCT>uM^i)1=aM>*KUd71|bUWA*;{aSth!Db@*JXw{WB)Rb!))3#FaGJ=pw1u%X% z%oU#S=Pv>Qy0)m>61;co}D5`;0|G zrw9as1)Kmd^eeq_&X2&(G_r%bSc@y(%(tB^-zrKYuYc763JujWw?DUMyU=@NZ~a3?E)0zRZR9 z@ez*W_v|Sta@j&c{QX@q=ki=XSZ^AH0qYN&2HD2Oj+-K}v3N9wv4(d~dle4|h9Fs3 z7Ltf1BK1uN4}WDeb#}k3fYfpM(IW-LPzm|~MMAI;NeJbK`60_O877m+9>|bvEL)OI zWn!6#93wD7LOdXlWGq>dOi3{*LShq(u-aa&POK?4bz)V#`qK4rhZ29x|A{{miiJu- zsZH3XCz}ujrjRJ8BrNGk5|V06|0y6Uj6d=aMfccj0WC8dF zeII>B)dB&r%yqh5RYxjtDPz-{>7#NbDRTmF7GR@Ks5E2_PB2$#GlVLauYnq)(vo@j zI_q`)N&1j{`#2y*j05X{-lS5?Rd^iJPa7eW!V_T-Bg_DU*oPPsU8ho#NfS%5_A+L= zo;6v&(HrPyxq?iFK@9Xk`8G1me#zRdSJNeOi4zbbjs;d5(@7s-0n8=6iEfkUkm>fT z3`1*Fg(PwNvh^6#NGs*IYY$>Eun#g8IGIOEVFn}JBF`o_+WVN}bPa2JG-&^tsikvN zgbNUh1A9MQQUi>ZXuYCuhZ%Col-o9|QC~~%mXnYA>_&#B6)LF{5R1pW=`u~5=U-Q* z(J{+_XK5B*)9xX?TG%hR75 z@Y>*=pJbowDK*OUE6M{3u3gl25<09B&A)y|(IVL!R_L?wO3%J_NnO}3KgBJZ#{AjQ z@M@9rl8rv4I1!}@+Sz56>k{^cDSeWM&K+WswNVuTd0iJuPG%emt3`|FAj;>UT zRQ+9A;|5LSu0U$Uw$m727q%P8869e|=9&^(eU&}ERpyj7aXqTM*R3^B%@I2S6sOLq z3~2|U-?owKx$O!1P&Ha|-d5h3d^q|5qC8~EZ(FrHFvlnT?D;AtQ@=(NQ270gmdgpp zutvWM>xF7dYO7d-<}t>dEqG~Aw(rIhUB$=ACcMT!?}x!JtkPDj7Ts~DztWt3B&Go^ zywYCRCM{o)i=+&n)fsd3L@m12+_le`bug9=R=tK=eu`&+XW$)YVA0|w%Y1wh|A3(2 z(CP1GuF=~rf5=cq`i-{c5!mY0QSh@WG9r9cL_}mn5%6Lwqv5!e%#`O9m#OQUj~Fc7 zy#qrxe;yqj<<|1H`Q5<>5kbgGbStqH*@kW)HXs?O7bl>gqQiD$Wa^oF_4llQImZ%C z<}8Ohd*yw223Q83KY#x0*|Wc<$P8ZG`g=9R%(dT)WqfQys#MJkKLh~w%}np`!#|}cLng@-_Ag}1cmds3FU2UT%7sp zsbcuUwRiabY`r*ob=3daT$MXltZ{VzhQmBEeggR@Wl+3_YL7nwaiZE~$P|r!674hM-``+9JAJ#(MsTt=M z?b>5HeWBm}-R*m`=^qv=le-a(iI6ZXOcF+kz~-^d2!&A+irNg;j;%#fu~bPawRX +#include +#include + +/ { + model = "GL.iNet GL-B2200"; + compatible = "glinet,gl-b2200", "qcom,ipq4019"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + bootargs-append = " root=/dev/mmcblk0p2 rw rootwait clk_ignore_unused"; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + switch_lan_bmp = <0x2e>; + switch_wan_bmp = <0x10>; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = <1>; + }; + + reset { + label = "reset"; + gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = <1>; + }; + }; + + leds { + compatible = "gpio-leds"; + + power_blue { + label = "blue:power"; + gpios = <&tlmm 57 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + internet_blue { + label = "blue:internet"; + gpios = <&tlmm 60 GPIO_ACTIVE_HIGH>; + }; + power_white { + label = "white:power"; + gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; + }; + internet_white { + label = "white:internet"; + gpios = <&tlmm 66 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gmac1 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <2 0x10>; +}; + +&gmac0 { + vlan_tag = <1 0x2e>; +}; + +&vqmmc { + status = "okay"; +}; + +&sdhci { + status = "okay"; + pinctrl-0 = <&sd_pins>; + pinctrl-names = "default"; + cd-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>; + vqmmc-supply = <&vqmmc>; +}; + +&blsp_dma { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "MIBIB"; + reg = <0x40000 0x20000>; + read-only; + }; + + partition@60000 { + label = "QSEE"; + reg = <0x60000 0x60000>; + read-only; + }; + + partition@c0000 { + label = "CDT"; + reg = <0xc0000 0x10000>; + read-only; + }; + + partition@d0000 { + label = "DDRPARAMS"; + reg = <0xd0000 0x10000>; + read-only; + }; + + partition@e0000 { + label = "APPSBLENV"; + reg = <0xe0000 0x10000>; + read-only; + }; + + partition@f0000 { + label = "APPSBL"; + reg = <0xf0000 0x80000>; + read-only; + }; + + partition@170000 { + label = "ART"; + reg = <0x170000 0x10000>; + read-only; + }; + }; + }; +}; + +&blsp1_spi2 { + pinctrl-0 = <&spi_1_pins>; + pinctrl-names = "default"; + status = "okay"; + + spidev1: spi@0 { + compatible = "siliconlabs,si3210"; + reg = <0>; + spi-max-frequency = <24000000>; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&blsp1_uart2 { + pinctrl-0 = <&serial_1_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + serial_1_pins: serial1_pinmux { + mux { + pins = "gpio8", "gpio9", + "gpio10", "gpio11"; + function = "blsp_uart1"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pinmux { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + }; + pinmux_cs { + function = "gpio"; + pins = "gpio12"; + }; + pinconf { + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + pinconf_cs { + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + spi_1_pins: spi_1_pinmux { + mux { + pins = "gpio44", "gpio46", "gpio47"; + function = "blsp_spi1"; + bias-disable; + }; + cs { + pins = "gpio45"; + function = "gpio"; + bias-pull-up; + }; + reset { + pins = "gpio43"; + function = "gpio"; + output-high; + }; + mux_2 { + pins = "gpio35"; + function = "gpio"; + output-high; + }; + host_int { + pins = "gpio2"; + function = "gpio"; + input; + }; + wake { + pins = "gpio48"; + function = "gpio"; + output-high; + }; + }; + + sd_pins: sd_pins { + pinmux { + function = "sdio"; + pins = "gpio23", "gpio24", "gpio25", "gpio26", + "gpio29", "gpio30", "gpio31", "gpio32"; + drive-strength = <10>; + }; + + pinmux_sd_clk { + function = "sdio"; + pins = "gpio27"; + drive-strength = <16>; + }; + + pinmux_sd7 { + function = "sdio"; + pins = "gpio28"; + drive-strength = <10>; + bias-disable; + }; + }; + +}; + +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi2: wifi@1,0 { + status = "okay"; + compatible = "qcom,ath10k"; + reg = <0x00010000 0 0 0 0>; + qcom,ath10k-calibration-variant = "GL-B2200"; + }; + }; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "GL-B2200"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "GL-B2200"; +}; diff --git a/target/linux/ipq40xx/generic/target.mk b/target/linux/ipq40xx/generic/target.mk index f5cb1fb19b..e158b1c98b 100644 --- a/target/linux/ipq40xx/generic/target.mk +++ b/target/linux/ipq40xx/generic/target.mk @@ -1 +1,2 @@ BOARDNAME:=Generic +FEATURES+=emmc diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 0d7d7a30d2..872c4f957f 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -92,6 +92,16 @@ define Build/qsdk-ipq-factory-nand-askey @mv $@.new $@ endef +define Build/qsdk-ipq-app-gpt + cp $@ $@.tmp 2>/dev/null || true + ptgen -g -o $@.tmp -a 1 -l 1024 \ + -t 0x2e -N 0:HLOS -r -p 32M \ + -t 0x83 -N rootfs -r -p 128M \ + -N rootfs_data -p 512M + cat $@.tmp >> $@ + rm $@.tmp +endef + define Build/SenaoFW -$(STAGING_DIR_HOST)/bin/mksenaofw \ -n $(BOARD_NAME) -r $(VENDOR_ID) -p $(1) \ @@ -520,6 +530,24 @@ define Device/glinet_gl-b1300 endef TARGET_DEVICES += glinet_gl-b1300 +define Device/glinet_gl-b2200 + $(call Device/FitzImage) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-B2200 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@ap.dk04.1-c3 + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + IMAGES := emmc.img.gz sysupgrade.bin + IMAGE/emmc.img.gz := qsdk-ipq-app-gpt |\ + pad-to 1024k | append-kernel |\ + pad-to 33792k | append-rootfs |\ + append-metadata | gzip + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-glinet_gl-b2200 \ + kmod-fs-ext4 kmod-mmc kmod-spi-dev mkf2fs e2fsprogs kmod-fs-f2fs +endef +TARGET_DEVICES += glinet_gl-b2200 + define Device/glinet_gl-s1300 $(call Device/FitzImage) DEVICE_VENDOR := GL.iNet diff --git a/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch index 3bd13bf932..b641251423 100644 --- a/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -902,11 +902,70 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -902,11 +902,71 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -76,6 +76,7 @@ Signed-off-by: John Crispin + qcom-ipq4029-ap-303h.dtb \ + qcom-ipq4029-ap-365.dtb \ + qcom-ipq4029-gl-b1300.dtb \ ++ qcom-ipq4019-gl-b2200.dtb \ + qcom-ipq4029-gl-s1300.dtb \ + qcom-ipq4029-mr33.dtb \ qcom-ipq8064-ap148.dtb \ diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index 734d08387a..4270418d6c 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,68 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,69 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -74,6 +74,7 @@ Signed-off-by: John Crispin + qcom-ipq4029-ap-303h.dtb \ + qcom-ipq4029-ap-365.dtb \ + qcom-ipq4029-gl-b1300.dtb \ ++ qcom-ipq4019-gl-b2200.dtb \ + qcom-ipq4029-gl-s1300.dtb \ + qcom-ipq4029-mr33.dtb \ qcom-ipq8064-ap148.dtb \ From c9db3ed58ed01d80d6f8e59cbb202af4110e64dc Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 1 Dec 2021 21:32:27 +0000 Subject: [PATCH 24/78] mediatek: mt7622: switch to generic eMMC sysupgrade Use functions in newly introduced emmc.sh for sysupgrade of the BananaPi BPi-R64. Signed-off-by: Daniel Golle --- target/linux/mediatek/Makefile | 2 +- .../mt7622/base-files/lib/upgrade/platform.sh | 21 ++++--------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/target/linux/mediatek/Makefile b/target/linux/mediatek/Makefile index d42d0eacd7..fb2951cc9b 100644 --- a/target/linux/mediatek/Makefile +++ b/target/linux/mediatek/Makefile @@ -6,7 +6,7 @@ ARCH:=arm BOARD:=mediatek BOARDNAME:=MediaTek Ralink ARM SUBTARGETS:=mt7622 mt7623 mt7629 -FEATURES:=dt-overlay fpu gpio nand pci pcie separate_ramdisk squashfs usb +FEATURES:=dt-overlay emmc fpu gpio nand pci pcie separate_ramdisk squashfs usb KERNEL_PATCHVER:=5.10 diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh index b9fa055854..e6afb9547c 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -12,12 +12,9 @@ platform_do_upgrade() { export_partdevice rootdev 0 case "$rootdev" in mmc*) - sync - export UPGRADE_MMC_PARTDEV=$(find_mmc_part "production" $rootdev) - [ "$UPGRADE_MMC_PARTDEV" ] || return 1 - export UPGRADE_MMC_IMAGE_BLOCKS=$(($(get_image "$1" | fwtool -i /dev/null -T - | dd of=$UPGRADE_MMC_PARTDEV bs=512 2>&1 | grep "records out" | cut -d' ' -f1))) - [ "$UPGRADE_MMC_IMAGE_BLOCKS" ] || return 0 - dd if=/dev/zero of=$UPGRADE_MMC_PARTDEV bs=512 seek=$UPGRADE_MMC_IMAGE_BLOCKS count=8 + CI_ROOTDEV="$rootdev" + CI_KERNPART="production" + emmc_do_upgrade "$1" ;; *) CI_KERNPART="fit" @@ -86,23 +83,13 @@ platform_check_image() { return 0 } -platform_copy_config_mmc() { - if [ ! -e "$UPGRADE_BACKUP" ] || - [ ! -e "$UPGRADE_MMC_PARTDEV" ] || - [ ! "$UPGRADE_MMC_IMAGE_BLOCKS" ]; then - return - fi - dd if="$UPGRADE_BACKUP" of="$UPGRADE_MMC_PARTDEV" bs=512 seek=$UPGRADE_MMC_IMAGE_BLOCKS - sync -} - platform_copy_config() { case "$(board_name)" in bananapi,bpi-r64) export_bootdevice export_partdevice rootdev 0 if echo $rootdev | grep -q mmc; then - platform_copy_config_mmc + emmc_copy_config fi ;; esac From c47e82d255ef461e7b426f6ada067affc2836e32 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 1 Dec 2021 21:33:25 +0000 Subject: [PATCH 25/78] mediatek: mt7623: switch to BPi-R2 to generic eMMC sysugprade Make use of new functions in emmc.sh to implement sysupgrade on the BananaPi BPi-R2. Signed-off-by: Daniel Golle --- .../mt7623/base-files/lib/upgrade/platform.sh | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh index 0afc15afc9..452a533db0 100755 --- a/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh @@ -84,14 +84,11 @@ platform_do_upgrade() { case "$board" in bananapi,bpi-r2) - sync export_bootdevice export_partdevice fitpart 3 [ "$fitpart" ] || return 1 - export UPGRADE_MMC_PARTDEV="/dev/$fitpart" - export UPGRADE_MMC_IMAGE_BLOCKS=$(($(get_image "$1" | fwtool -i /dev/null -T - | dd of=$UPGRADE_MMC_PARTDEV bs=512 2>&1 | grep "records out" | cut -d' ' -f1))) - [ "$UPGRADE_MMC_IMAGE_BLOCKS" ] || return 0 - dd if=/dev/zero of=$UPGRADE_MMC_PARTDEV bs=512 seek=$UPGRADE_MMC_IMAGE_BLOCKS count=8 + EMMC_KERN_DEV="/dev/$fitpart" + emmc_do_upgrade "$1" ;; unielec,u7623-02-emmc-512m) @@ -166,20 +163,10 @@ platform_check_image() { return 0 } -platform_copy_config_mmc() { - if [ ! -e "$UPGRADE_BACKUP" ] || - [ ! -e "$UPGRADE_MMC_PARTDEV" ] || - [ ! "$UPGRADE_MMC_IMAGE_BLOCKS" ]; then - return - fi - dd if="$UPGRADE_BACKUP" of="$UPGRADE_MMC_PARTDEV" bs=512 seek=$UPGRADE_MMC_IMAGE_BLOCKS - sync -} - platform_copy_config() { case "$(board_name)" in bananapi,bpi-r2) - platform_copy_config_mmc + emmc_copy_config ;; unielec,u7623-02-emmc-512m) # platform_do_upgrade() will have set $recoverydev From fc4398fe71810f3bb5637bdfd0b3975a8ec858f0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 3 Dec 2021 10:56:17 +0100 Subject: [PATCH 26/78] mt76: update to the latest version 71e08471ab56 mt76: eeprom: fix return code on corrected bit-flips 9a8fc6636d83 mt76: move sar_capa configuration in common code 7cdbea1dc82a mt76: only access ieee80211_hdr after mt76_insert_ccmp_hdr 678071ef7029 mt76: mt7615: clear mcu error interrupt status on mt7663 Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index ca4ef5d137..8210478c37 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-12-02 -PKG_SOURCE_VERSION:=929a03a8d65daf912eb09ae07df522b863c7a8fc -PKG_MIRROR_HASH:=8078d9f40fa341936252d27447821e4826af800b07e5fc412abcea34e648be59 +PKG_SOURCE_DATE:=2021-12-03 +PKG_SOURCE_VERSION:=678071ef70297b7264661c356ddb3c8cf7f3c87b +PKG_MIRROR_HASH:=b1f8613f7c65ca6a893f83ed9efc3f7ce72b9b4904fd11b89264f57f4f2a3b5e PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 From 0efb169aadc868768fde4a22c3be8a3742f73dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Sat, 20 Mar 2021 11:48:24 +0100 Subject: [PATCH 27/78] mvebu: sysupgrade: drop unnecessary UBI to UBI logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The recent changes to the maximum kernel size for Mamba and Venom highlighted the fact that the old Mamba kernel size has been hardcoded in linksys_get_root_magic() even for devices with a different kernel/rootfs split. The purpose of this code seems to be to avoid issues caused by partially overwriting an existing UBI partition, where some of the erase counters would be reset but not the unmodified ones. This problem has been solved in a more generic way by the UBI EOF marker. This ensures that any old PEBs after the marker are properly initialized. It is therefore unnecessary to erase the whole partition before flashing a new OpenWrt factory image. Signed-off-by: Bjørn Mork --- .../base-files/lib/upgrade/linksys.sh | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh index c5da471d76..aaa32eb4ea 100644 --- a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh +++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh @@ -44,10 +44,6 @@ linksys_get_target_firmware() { esac } -linksys_get_root_magic() { - (get_image "$@" | dd skip=786432 bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2>/dev/null -} - platform_do_upgrade_linksys() { local magic_long="$(get_magic_long "$1")" @@ -75,20 +71,7 @@ platform_do_upgrade_linksys() { nand_upgrade_tar "$1" } [ "$magic_long" = "27051956" -o "$magic_long" = "0000a0e1" ] && { - # check firmwares' rootfs types - local target_mtd=$(find_mtd_part $part_label) - local oldroot="$(linksys_get_root_magic $target_mtd)" - local newroot="$(linksys_get_root_magic "$1")" - - if [ "$newroot" = "55424923" -a "$oldroot" = "55424923" ] - # we're upgrading from a firmware with UBI to one with UBI - then - # erase everything to be safe - mtd erase $part_label - get_image "$1" | mtd -n write - $part_label - else - get_image "$1" | mtd write - $part_label - fi + get_image "$1" | mtd write - $part_label } } From 25382dff8584ffc70917e9f693681fb7d9c06826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Sat, 20 Mar 2021 11:48:25 +0100 Subject: [PATCH 28/78] kirkwood: sysupgrade: drop unnecessary UBI to UBI logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The purpose of this code seems to be to avoid issues caused by partially overwriting an existing UBI partition, where some of the erase counters would be reset but not the unmodified ones. This problem has been solved in a more generic way by the UBI EOF marker. This ensures that any old PEBs after the marker are properly initialized. It is therefore unnecessary to erase the whole partition before flashing a new OpenWrt factory image. Signed-off-by: Bjørn Mork --- .../base-files/lib/upgrade/linksys.sh | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh b/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh index b89aad3d7e..1f2596ea88 100644 --- a/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh +++ b/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh @@ -44,10 +44,6 @@ linksys_get_target_firmware() { esac } -linksys_get_root_magic() { - (get_image "$@" | dd skip=786432 bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2>/dev/null -} - platform_do_upgrade_linksys() { local magic_long="$(get_magic_long "$1")" @@ -75,19 +71,6 @@ platform_do_upgrade_linksys() { nand_upgrade_tar "$1" } [ "$magic_long" = "27051956" ] && { - # check firmwares' rootfs types - local target_mtd=$(find_mtd_part $part_label) - local oldroot="$(linksys_get_root_magic $target_mtd)" - local newroot="$(linksys_get_root_magic "$1")" - - if [ "$newroot" = "55424923" -a "$oldroot" = "55424923" ] - # we're upgrading from a firmware with UBI to one with UBI - then - # erase everything to be safe - mtd erase $part_label - get_image "$1" | mtd -n write - $part_label - else - get_image "$1" | mtd write - $part_label - fi + get_image "$1" | mtd write - $part_label } } From 5fb51d4516d27dcf72d2a1592abba922259ec8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Sat, 20 Mar 2021 11:48:26 +0100 Subject: [PATCH 29/78] ipq806x: sysupgrade: drop unnecessary UBI to UBI logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The purpose of this code seems to be to avoid issues caused by partially overwriting an existing UBI partition, where some of the erase counters would be reset but not the unmodified ones. This problem has been solved in a more generic way by the UBI EOF marker. This ensures that any old PEBs after the marker are properly initialized. It is therefore unnecessary to erase the whole partition before flashing a new OpenWrt factory image. Signed-off-by: Bjørn Mork --- .../ipq806x/base-files/lib/upgrade/linksys.sh | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh b/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh index 22771278ce..29f4763451 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh @@ -44,10 +44,6 @@ linksys_get_target_firmware() { esac } -linksys_get_root_magic() { - (get_image "$@" | dd skip=786432 bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2>/dev/null -} - platform_do_upgrade_linksys() { local magic_long="$(get_magic_long "$1")" @@ -101,18 +97,6 @@ platform_do_upgrade_linksys() { nand_upgrade_tar "$1" } [ "$magic_long" = "27051956" ] && { - # check firmwares' rootfs types - local oldroot="$(linksys_get_root_magic $target_mtd)" - local newroot="$(linksys_get_root_magic "$1")" - - if [ "$newroot" = "55424923" -a "$oldroot" = "55424923" ] - # we're upgrading from a firmware with UBI to one with UBI - then - # erase everything to be safe - mtd erase $part_label - get_image "$1" | mtd -n write - $part_label - else - get_image "$1" | mtd write - $part_label - fi + get_image "$1" | mtd write - $part_label } } From 8ac8c09f5ebbb6ae5e73b8a8ff4b095c1154f707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Sat, 20 Mar 2021 11:48:27 +0100 Subject: [PATCH 30/78] ipq40xx: sysupgrade: drop disabled UBI to UBI logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commented out code is not required, as the comment indicates. The purpose of this code seems to be to avoid issues caused by partially overwriting an existing UBI partition, where some of the erase counters would be reset but not the unmodified ones. This problem has been solved in a more generic way by the UBI EOF marker. This ensures that any old PEBs after the marker are properly initialized. It is therefore unnecessary to erase the whole partition before flashing a new OpenWrt factory image. Signed-off-by: Bjørn Mork --- .../ipq40xx/base-files/lib/upgrade/linksys.sh | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh b/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh index de09d34aef..f1dc81f7c9 100755 --- a/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh @@ -47,10 +47,6 @@ linksys_get_target_firmware() { esac } -linksys_get_root_magic() { - (get_image "$@" | dd skip=786432 bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2>/dev/null -} - platform_do_upgrade_linksys() { local magic_long="$(get_magic_long "$1")" @@ -100,23 +96,7 @@ platform_do_upgrade_linksys() { } [ "$magic_long" = "27051956" ] && { - # This magic is for a uImage (which is a sysupgrade image) - # check firmwares' rootfs types - local oldroot="$(linksys_get_root_magic "$target_mtd")" - local newroot="$(linksys_get_root_magic "$1")" - - if [ "$newroot" = "55424923" ] && [ "$oldroot" = "55424923" ]; then - # we're upgrading from a firmware with UBI to one with UBI - # erase everything to be safe - # - Is that really needed? Won't remove (or comment) the if, - # because it may be needed in a future device. - #mtd erase $part_label - #get_image "$1" | mtd -n write - $part_label - echo "writing \"$1\" UBI image to \"$part_label\" (UBI)..." - get_image "$1" | mtd write - "$part_label" - else - echo "writing \"$1\" image to \"$part_label\"" - get_image "$1" | mtd write - "$part_label" - fi + echo "writing \"$1\" image to \"$part_label\"" + get_image "$1" | mtd write - "$part_label" } } From 24d455d1d0adf64de844b25800c23992aa3eeda5 Mon Sep 17 00:00:00 2001 From: Catrinel Catrinescu Date: Thu, 2 Dec 2021 10:07:54 +0000 Subject: [PATCH 31/78] ath79: add Embedded Wireless Balin Platform Add the Embedded Wireless "Balin" platform, it is in ar71xx too SoC: QCA AR9344 or AR9350 RAM: DDR2-RAM 64MBytes Flash: SPI-NOR 16MBytes WLAN: 2 x 2 MIMO 2.4 & 5 GHz IEEE802.11 a/b/g/n Ethernet: 3 x 10/100 Mb/s USB: 1 x USB2.0 Host/Device bootstrap-pin at power-up PCIe: MiniPCIe - 1 x lane PCIe 1.2 Button: 1 x Reset-Button UART: 1 x Normal, 1 x High-Speed JTAG: 1 x EJTAG LED: 1 x Green Power/Status LED GPIO: 10 x Input/Output multiplexed The module comes already with the current vanilla OpenWrt firmware. To update, use "sysupgrade -n --force " image directly in vendor firmware. This resets the existing configurations back to default! Signed-off-by: Catrinel Catrinescu [indent, led function+color properties, fix partition unit-address, re-enable pcie port, mention button+led in commit message] Signed-off-by: Christian Lamparter --- .../dts/ar9344_embeddedwireless_balin.dts | 130 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 4 + target/linux/ath79/image/generic.mk | 9 ++ 3 files changed, 143 insertions(+) create mode 100644 target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts diff --git a/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts b/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts new file mode 100644 index 0000000000..a84c273f86 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include +#include + +/ { + model = "Embedded Wireless Balin"; + compatible = "embeddedwireless,balin", "qca,ar9344"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + leds { + compatible = "gpio-leds"; + + led_system: led-0 { + label = "green:system"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xfa0000>; + }; + + partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_art_1000: calibration_data@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + }; + }; + }; +}; + +&builtin_switch { + /delete-property/qca,phy4-mii-enable; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_art_1002>; + nvmem-cell-names = "mac-address"; + mac-address-increment-byte = <3>; + mac-address-increment = <0x40>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <0>; + switch-only-mode = <1>; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&macaddr_art_1002>, <&calibration_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&pcie { + status = "okay"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 01e364a8fe..8c09932bd7 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -265,6 +265,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan" ;; + embeddedwireless,balin) + ucidef_add_switch "switch0" \ + "0@eth0" "5:lan:1" "4:lan:2" "3:wan" + ;; embeddedwireless,dorin) ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan:3" "3:lan:2" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 39f616b010..c259db94af 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1028,6 +1028,15 @@ define Device/elecom_wrc-300ghbk2-i endef TARGET_DEVICES += elecom_wrc-300ghbk2-i +define Device/embeddedwireless_balin + SOC := ar9344 + DEVICE_VENDOR := Embedded Wireless + DEVICE_MODEL := Balin + DEVICE_PACKAGES := kmod-usb-chipidea2 + IMAGE_SIZE := 16000k +endef +TARGET_DEVICES += embeddedwireless_balin + define Device/embeddedwireless_dorin SOC := ar9331 DEVICE_VENDOR := Embedded Wireless From 7fd1ca96a13112a7ea214b3baf076cd81d712378 Mon Sep 17 00:00:00 2001 From: Kabuli Chana Date: Thu, 2 Dec 2021 15:03:51 -0700 Subject: [PATCH 32/78] mvebu: next backport mvnet MQPrio offload linux-next MQPrio patches adding TC traffic shaping offload Signed-off-by: Kabuli Chana --- ...ethernet-marvell-mvnetaMQPrioOffload.patch | 71 +++++++ ...xt-ethernet-marvell-mvnetaMQPrioFlag.patch | 35 ++++ ...t-ethernet-marvell-mvnetaMQPrioQueue.patch | 102 ++++++++++ ...hernet-marvell-mvnetaMQPrioTCOffload.patch | 187 ++++++++++++++++++ 4 files changed, 395 insertions(+) create mode 100644 target/linux/mvebu/patches-5.10/702-net-next-ethernet-marvell-mvnetaMQPrioOffload.patch create mode 100644 target/linux/mvebu/patches-5.10/703-net-next-ethernet-marvell-mvnetaMQPrioFlag.patch create mode 100644 target/linux/mvebu/patches-5.10/704-net-next-ethernet-marvell-mvnetaMQPrioQueue.patch create mode 100644 target/linux/mvebu/patches-5.10/705-net-next-ethernet-marvell-mvnetaMQPrioTCOffload.patch diff --git a/target/linux/mvebu/patches-5.10/702-net-next-ethernet-marvell-mvnetaMQPrioOffload.patch b/target/linux/mvebu/patches-5.10/702-net-next-ethernet-marvell-mvnetaMQPrioOffload.patch new file mode 100644 index 0000000000..8a5f3f3cf4 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/702-net-next-ethernet-marvell-mvnetaMQPrioOffload.patch @@ -0,0 +1,71 @@ +From 75fa71e3acadbb4ab5eda18505277eb9a1f69b23 Mon Sep 17 00:00:00 2001 +From: Maxime Chevallier +Date: Fri, 26 Nov 2021 12:20:53 +0100 +Subject: net: mvneta: Use struct tc_mqprio_qopt_offload for MQPrio + configuration + +The struct tc_mqprio_qopt_offload is a container for struct tc_mqprio_qopt, +that allows passing extra parameters, such as traffic shaping. This commit +converts the current mqprio code to that new struct. + +Signed-off-by: Maxime Chevallier +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +(limited to 'drivers/net/ethernet/marvell/mvneta.c') + +diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c +index 80e4b500695e6..46b7604805f76 100644 +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + + /* Registers */ +@@ -4908,14 +4909,14 @@ static void mvneta_setup_rx_prio_map(struct mvneta_port *pp) + } + + static int mvneta_setup_mqprio(struct net_device *dev, +- struct tc_mqprio_qopt *qopt) ++ struct tc_mqprio_qopt_offload *mqprio) + { + struct mvneta_port *pp = netdev_priv(dev); + u8 num_tc; + int i; + +- qopt->hw = TC_MQPRIO_HW_OFFLOAD_TCS; +- num_tc = qopt->num_tc; ++ mqprio->qopt.hw = TC_MQPRIO_HW_OFFLOAD_TCS; ++ num_tc = mqprio->qopt.num_tc; + + if (num_tc > rxq_number) + return -EINVAL; +@@ -4926,13 +4927,15 @@ static int mvneta_setup_mqprio(struct net_device *dev, + return 0; + } + +- memcpy(pp->prio_tc_map, qopt->prio_tc_map, sizeof(pp->prio_tc_map)); ++ memcpy(pp->prio_tc_map, mqprio->qopt.prio_tc_map, ++ sizeof(pp->prio_tc_map)); + + mvneta_setup_rx_prio_map(pp); + +- netdev_set_num_tc(dev, qopt->num_tc); +- for (i = 0; i < qopt->num_tc; i++) +- netdev_set_tc_queue(dev, i, qopt->count[i], qopt->offset[i]); ++ netdev_set_num_tc(dev, mqprio->qopt.num_tc); ++ for (i = 0; i < mqprio->qopt.num_tc; i++) ++ netdev_set_tc_queue(dev, i, mqprio->qopt.count[i], ++ mqprio->qopt.offset[i]); + + return 0; + } +-- +cgit 1.2.3-1.el7 + diff --git a/target/linux/mvebu/patches-5.10/703-net-next-ethernet-marvell-mvnetaMQPrioFlag.patch b/target/linux/mvebu/patches-5.10/703-net-next-ethernet-marvell-mvnetaMQPrioFlag.patch new file mode 100644 index 0000000000..a9bf9b22c3 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/703-net-next-ethernet-marvell-mvnetaMQPrioFlag.patch @@ -0,0 +1,35 @@ +From e7ca75fe6662f78bfeb0112671c812e4c7b8e214 Mon Sep 17 00:00:00 2001 +From: Maxime Chevallier +Date: Fri, 26 Nov 2021 12:20:54 +0100 +Subject: net: mvneta: Don't force-set the offloading flag + +The qopt->hw flag is set by the TC code according to the offloading mode +asked by user. Don't force-set it in the driver, but instead read it to +make sure we do what's asked. + +Signed-off-by: Maxime Chevallier +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +(limited to 'drivers/net/ethernet/marvell/mvneta.c') + +diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c +index 46b7604805f76..d3ce87e69d2a8 100644 +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -4915,7 +4915,9 @@ static int mvneta_setup_mqprio(struct net_device *dev, + u8 num_tc; + int i; + +- mqprio->qopt.hw = TC_MQPRIO_HW_OFFLOAD_TCS; ++ if (mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS) ++ return 0; ++ + num_tc = mqprio->qopt.num_tc; + + if (num_tc > rxq_number) +-- +cgit 1.2.3-1.el7 + diff --git a/target/linux/mvebu/patches-5.10/704-net-next-ethernet-marvell-mvnetaMQPrioQueue.patch b/target/linux/mvebu/patches-5.10/704-net-next-ethernet-marvell-mvnetaMQPrioQueue.patch new file mode 100644 index 0000000000..ac5fdc329a --- /dev/null +++ b/target/linux/mvebu/patches-5.10/704-net-next-ethernet-marvell-mvnetaMQPrioQueue.patch @@ -0,0 +1,102 @@ +From e9f7099d0730341b24c057acbf545dd019581db6 Mon Sep 17 00:00:00 2001 +From: Maxime Chevallier +Date: Fri, 26 Nov 2021 12:20:55 +0100 +Subject: net: mvneta: Allow having more than one queue per TC + +The current mqprio implementation assumed that we are only using one +queue per TC. Use the offset and count parameters to allow using +multiple queues per TC. In that case, the controller will use a standard +round-robin algorithm to pick queues assigned to the same TC, with the +same priority. + +This only applies to VLAN priorities in ingress traffic, each TC +corresponding to a vlan priority. + +Signed-off-by: Maxime Chevallier +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 35 ++++++++++++++++++++--------------- + 1 file changed, 20 insertions(+), 15 deletions(-) + +(limited to 'drivers/net/ethernet/marvell/mvneta.c') + +diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c +index d3ce87e69d2a8..aba452e8abfe6 100644 +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -493,7 +493,6 @@ struct mvneta_port { + u8 mcast_count[256]; + u16 tx_ring_size; + u16 rx_ring_size; +- u8 prio_tc_map[8]; + + phy_interface_t phy_interface; + struct device_node *dn; +@@ -4897,13 +4896,12 @@ static void mvneta_clear_rx_prio_map(struct mvneta_port *pp) + mvreg_write(pp, MVNETA_VLAN_PRIO_TO_RXQ, 0); + } + +-static void mvneta_setup_rx_prio_map(struct mvneta_port *pp) ++static void mvneta_map_vlan_prio_to_rxq(struct mvneta_port *pp, u8 pri, u8 rxq) + { +- u32 val = 0; +- int i; ++ u32 val = mvreg_read(pp, MVNETA_VLAN_PRIO_TO_RXQ); + +- for (i = 0; i < rxq_number; i++) +- val |= MVNETA_VLAN_PRIO_RXQ_MAP(i, pp->prio_tc_map[i]); ++ val &= ~MVNETA_VLAN_PRIO_RXQ_MAP(pri, 0x7); ++ val |= MVNETA_VLAN_PRIO_RXQ_MAP(pri, rxq); + + mvreg_write(pp, MVNETA_VLAN_PRIO_TO_RXQ, val); + } +@@ -4912,8 +4910,8 @@ static int mvneta_setup_mqprio(struct net_device *dev, + struct tc_mqprio_qopt_offload *mqprio) + { + struct mvneta_port *pp = netdev_priv(dev); ++ int rxq, tc; + u8 num_tc; +- int i; + + if (mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS) + return 0; +@@ -4923,21 +4921,28 @@ static int mvneta_setup_mqprio(struct net_device *dev, + if (num_tc > rxq_number) + return -EINVAL; + ++ mvneta_clear_rx_prio_map(pp); ++ + if (!num_tc) { +- mvneta_clear_rx_prio_map(pp); + netdev_reset_tc(dev); + return 0; + } + +- memcpy(pp->prio_tc_map, mqprio->qopt.prio_tc_map, +- sizeof(pp->prio_tc_map)); ++ netdev_set_num_tc(dev, mqprio->qopt.num_tc); ++ ++ for (tc = 0; tc < mqprio->qopt.num_tc; tc++) { ++ netdev_set_tc_queue(dev, tc, mqprio->qopt.count[tc], ++ mqprio->qopt.offset[tc]); + +- mvneta_setup_rx_prio_map(pp); ++ for (rxq = mqprio->qopt.offset[tc]; ++ rxq < mqprio->qopt.count[tc] + mqprio->qopt.offset[tc]; ++ rxq++) { ++ if (rxq >= rxq_number) ++ return -EINVAL; + +- netdev_set_num_tc(dev, mqprio->qopt.num_tc); +- for (i = 0; i < mqprio->qopt.num_tc; i++) +- netdev_set_tc_queue(dev, i, mqprio->qopt.count[i], +- mqprio->qopt.offset[i]); ++ mvneta_map_vlan_prio_to_rxq(pp, tc, rxq); ++ } ++ } + + return 0; + } +-- +cgit 1.2.3-1.el7 + diff --git a/target/linux/mvebu/patches-5.10/705-net-next-ethernet-marvell-mvnetaMQPrioTCOffload.patch b/target/linux/mvebu/patches-5.10/705-net-next-ethernet-marvell-mvnetaMQPrioTCOffload.patch new file mode 100644 index 0000000000..d2fd1832d8 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/705-net-next-ethernet-marvell-mvnetaMQPrioTCOffload.patch @@ -0,0 +1,187 @@ +From 2551dc9e398c37a15e52122d385c29a8b06be45f Mon Sep 17 00:00:00 2001 +From: Maxime Chevallier +Date: Fri, 26 Nov 2021 12:20:56 +0100 +Subject: net: mvneta: Add TC traffic shaping offload + +The mvneta controller is able to do some tocken-bucket per-queue traffic +shaping. This commit adds support for setting these using the TC mqprio +interface. + +The token-bucket parameters are customisable, but the current +implementation configures them to have a 10kbps resolution for the +rate limitation, since it allows to cover the whole range of max_rate +values from 10kbps to 5Gbps with 10kbps increments. + +Signed-off-by: Maxime Chevallier +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/marvell/mvneta.c | 120 +++++++++++++++++++++++++++++++++- + 1 file changed, 119 insertions(+), 1 deletion(-) + +(limited to 'drivers/net/ethernet/marvell/mvneta.c') + +diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c +index aba452e8abfe6..2368ae3f0e10d 100644 +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -248,12 +248,39 @@ + #define MVNETA_TXQ_SENT_DESC_MASK 0x3fff0000 + #define MVNETA_PORT_TX_RESET 0x3cf0 + #define MVNETA_PORT_TX_DMA_RESET BIT(0) ++#define MVNETA_TXQ_CMD1_REG 0x3e00 ++#define MVNETA_TXQ_CMD1_BW_LIM_SEL_V1 BIT(3) ++#define MVNETA_TXQ_CMD1_BW_LIM_EN BIT(0) ++#define MVNETA_REFILL_NUM_CLK_REG 0x3e08 ++#define MVNETA_REFILL_MAX_NUM_CLK 0x0000ffff + #define MVNETA_TX_MTU 0x3e0c + #define MVNETA_TX_TOKEN_SIZE 0x3e14 + #define MVNETA_TX_TOKEN_SIZE_MAX 0xffffffff ++#define MVNETA_TXQ_BUCKET_REFILL_REG(q) (0x3e20 + ((q) << 2)) ++#define MVNETA_TXQ_BUCKET_REFILL_PERIOD_MASK 0x3ff00000 ++#define MVNETA_TXQ_BUCKET_REFILL_PERIOD_SHIFT 20 ++#define MVNETA_TXQ_BUCKET_REFILL_VALUE_MAX 0x0007ffff + #define MVNETA_TXQ_TOKEN_SIZE_REG(q) (0x3e40 + ((q) << 2)) + #define MVNETA_TXQ_TOKEN_SIZE_MAX 0x7fffffff + ++/* The values of the bucket refill base period and refill period are taken from ++ * the reference manual, and adds up to a base resolution of 10Kbps. This allows ++ * to cover all rate-limit values from 10Kbps up to 5Gbps ++ */ ++ ++/* Base period for the rate limit algorithm */ ++#define MVNETA_TXQ_BUCKET_REFILL_BASE_PERIOD_NS 100 ++ ++/* Number of Base Period to wait between each bucket refill */ ++#define MVNETA_TXQ_BUCKET_REFILL_PERIOD 1000 ++ ++/* The base resolution for rate limiting, in bps. Any max_rate value should be ++ * a multiple of that value. ++ */ ++#define MVNETA_TXQ_RATE_LIMIT_RESOLUTION (NSEC_PER_SEC / \ ++ (MVNETA_TXQ_BUCKET_REFILL_BASE_PERIOD_NS * \ ++ MVNETA_TXQ_BUCKET_REFILL_PERIOD)) ++ + #define MVNETA_LPI_CTRL_0 0x2cc0 + #define MVNETA_LPI_CTRL_1 0x2cc4 + #define MVNETA_LPI_REQUEST_ENABLE BIT(0) +@@ -4906,11 +4933,74 @@ static void mvneta_map_vlan_prio_to_rxq(struct mvneta_port *pp, u8 pri, u8 rxq) + mvreg_write(pp, MVNETA_VLAN_PRIO_TO_RXQ, val); + } + ++static int mvneta_enable_per_queue_rate_limit(struct mvneta_port *pp) ++{ ++ unsigned long core_clk_rate; ++ u32 refill_cycles; ++ u32 val; ++ ++ core_clk_rate = clk_get_rate(pp->clk); ++ if (!core_clk_rate) ++ return -EINVAL; ++ ++ refill_cycles = MVNETA_TXQ_BUCKET_REFILL_BASE_PERIOD_NS / ++ (NSEC_PER_SEC / core_clk_rate); ++ ++ if (refill_cycles > MVNETA_REFILL_MAX_NUM_CLK) ++ return -EINVAL; ++ ++ /* Enable bw limit algorithm version 3 */ ++ val = mvreg_read(pp, MVNETA_TXQ_CMD1_REG); ++ val &= ~(MVNETA_TXQ_CMD1_BW_LIM_SEL_V1 | MVNETA_TXQ_CMD1_BW_LIM_EN); ++ mvreg_write(pp, MVNETA_TXQ_CMD1_REG, val); ++ ++ /* Set the base refill rate */ ++ mvreg_write(pp, MVNETA_REFILL_NUM_CLK_REG, refill_cycles); ++ ++ return 0; ++} ++ ++static void mvneta_disable_per_queue_rate_limit(struct mvneta_port *pp) ++{ ++ u32 val = mvreg_read(pp, MVNETA_TXQ_CMD1_REG); ++ ++ val |= (MVNETA_TXQ_CMD1_BW_LIM_SEL_V1 | MVNETA_TXQ_CMD1_BW_LIM_EN); ++ mvreg_write(pp, MVNETA_TXQ_CMD1_REG, val); ++} ++ ++static int mvneta_setup_queue_rates(struct mvneta_port *pp, int queue, ++ u64 min_rate, u64 max_rate) ++{ ++ u32 refill_val, rem; ++ u32 val = 0; ++ ++ /* Convert to from Bps to bps */ ++ max_rate *= 8; ++ ++ if (min_rate) ++ return -EINVAL; ++ ++ refill_val = div_u64_rem(max_rate, MVNETA_TXQ_RATE_LIMIT_RESOLUTION, ++ &rem); ++ ++ if (rem || !refill_val || ++ refill_val > MVNETA_TXQ_BUCKET_REFILL_VALUE_MAX) ++ return -EINVAL; ++ ++ val = refill_val; ++ val |= (MVNETA_TXQ_BUCKET_REFILL_PERIOD << ++ MVNETA_TXQ_BUCKET_REFILL_PERIOD_SHIFT); ++ ++ mvreg_write(pp, MVNETA_TXQ_BUCKET_REFILL_REG(queue), val); ++ ++ return 0; ++} ++ + static int mvneta_setup_mqprio(struct net_device *dev, + struct tc_mqprio_qopt_offload *mqprio) + { + struct mvneta_port *pp = netdev_priv(dev); +- int rxq, tc; ++ int rxq, txq, tc, ret; + u8 num_tc; + + if (mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS) +@@ -4924,6 +5014,7 @@ static int mvneta_setup_mqprio(struct net_device *dev, + mvneta_clear_rx_prio_map(pp); + + if (!num_tc) { ++ mvneta_disable_per_queue_rate_limit(pp); + netdev_reset_tc(dev); + return 0; + } +@@ -4944,6 +5035,33 @@ static int mvneta_setup_mqprio(struct net_device *dev, + } + } + ++ if (mqprio->shaper != TC_MQPRIO_SHAPER_BW_RATE) { ++ mvneta_disable_per_queue_rate_limit(pp); ++ return 0; ++ } ++ ++ if (mqprio->qopt.num_tc > txq_number) ++ return -EINVAL; ++ ++ ret = mvneta_enable_per_queue_rate_limit(pp); ++ if (ret) ++ return ret; ++ ++ for (tc = 0; tc < mqprio->qopt.num_tc; tc++) { ++ for (txq = mqprio->qopt.offset[tc]; ++ txq < mqprio->qopt.count[tc] + mqprio->qopt.offset[tc]; ++ txq++) { ++ if (txq >= txq_number) ++ return -EINVAL; ++ ++ ret = mvneta_setup_queue_rates(pp, txq, ++ mqprio->min_rate[tc], ++ mqprio->max_rate[tc]); ++ if (ret) ++ return ret; ++ } ++ } ++ + return 0; + } + +-- +cgit 1.2.3-1.el7 + From 1add2c0d95efb970ab18485e570b146610740bf2 Mon Sep 17 00:00:00 2001 From: Tan Zien Date: Fri, 27 Aug 2021 21:27:11 +0800 Subject: [PATCH 33/78] firmware: intel-microcode: update to 20210608 intel-microcode (3.20210608.2) * Correct INTEL-SA-00442 CVE id to CVE-2020-24489 in changelog and debian/changelog (3.20210608.1). intel-microcode (3.20210608.1) * New upstream microcode datafile 20210608 (closes: #989615) * Implements mitigations for CVE-2020-24511 CVE-2020-24512 (INTEL-SA-00464), information leakage through shared resources, and timing discrepancy sidechannels * Implements mitigations for CVE-2020-24513 (INTEL-SA-00465), Domain-bypass transient execution vulnerability in some Intel Atom Processors, affects Intel SGX. * Implements mitigations for CVE-2020-24489 (INTEL-SA-00442), Intel VT-d privilege escalation * Fixes critical errata on several processors * New Microcodes: sig 0x00050655, pf_mask 0xb7, 2018-11-16, rev 0x3000010, size 47104 sig 0x000606a5, pf_mask 0x87, 2021-03-08, rev 0xc0002f0, size 283648 sig 0x000606a6, pf_mask 0x87, 2021-04-25, rev 0xd0002a0, size 283648 sig 0x00080664, pf_mask 0x01, 2021-02-17, rev 0xb00000f, size 130048 sig 0x00080665, pf_mask 0x01, 2021-02-17, rev 0xb00000f, size 130048 sig 0x000806c1, pf_mask 0x80, 2021-03-31, rev 0x0088, size 109568 sig 0x000806c2, pf_mask 0xc2, 2021-04-07, rev 0x0016, size 94208 sig 0x000806d1, pf_mask 0xc2, 2021-04-23, rev 0x002c, size 99328 sig 0x00090661, pf_mask 0x01, 2021-02-04, rev 0x0011, size 19456 sig 0x000906c0, pf_mask 0x01, 2021-03-23, rev 0x001d, size 19456 sig 0x000a0671, pf_mask 0x02, 2021-04-11, rev 0x0040, size 100352 * Updated Microcodes: sig 0x000306f2, pf_mask 0x6f, 2021-01-27, rev 0x0046, size 34816 sig 0x000306f4, pf_mask 0x80, 2021-02-05, rev 0x0019, size 19456 sig 0x000406e3, pf_mask 0xc0, 2021-01-25, rev 0x00ea, size 105472 sig 0x000406f1, pf_mask 0xef, 2021-02-06, rev 0xb00003e, size 31744 sig 0x00050653, pf_mask 0x97, 2021-03-08, rev 0x100015b, size 34816 sig 0x00050654, pf_mask 0xb7, 2021-03-08, rev 0x2006b06, size 36864 sig 0x00050656, pf_mask 0xbf, 2021-03-08, rev 0x4003102, size 30720 sig 0x00050657, pf_mask 0xbf, 2021-03-08, rev 0x5003102, size 30720 sig 0x0005065b, pf_mask 0xbf, 2021-04-23, rev 0x7002302, size 27648 sig 0x00050663, pf_mask 0x10, 2021-02-04, rev 0x700001b, size 24576 sig 0x00050664, pf_mask 0x10, 2021-02-04, rev 0xf000019, size 24576 sig 0x00050665, pf_mask 0x10, 2021-02-04, rev 0xe000012, size 19456 sig 0x000506c9, pf_mask 0x03, 2020-10-23, rev 0x0044, size 17408 sig 0x000506ca, pf_mask 0x03, 2020-10-23, rev 0x0020, size 15360 sig 0x000506e3, pf_mask 0x36, 2021-01-25, rev 0x00ea, size 105472 sig 0x000506f1, pf_mask 0x01, 2020-10-23, rev 0x0034, size 11264 sig 0x000706a1, pf_mask 0x01, 2020-10-23, rev 0x0036, size 74752 sig 0x000706a8, pf_mask 0x01, 2020-10-23, rev 0x001a, size 75776 sig 0x000706e5, pf_mask 0x80, 2020-11-01, rev 0x00a6, size 110592 sig 0x000806a1, pf_mask 0x10, 2020-11-06, rev 0x002a, size 32768 sig 0x000806e9, pf_mask 0x10, 2021-01-05, rev 0x00ea, size 104448 sig 0x000806e9, pf_mask 0xc0, 2021-01-05, rev 0x00ea, size 104448 sig 0x000806ea, pf_mask 0xc0, 2021-01-06, rev 0x00ea, size 103424 sig 0x000806eb, pf_mask 0xd0, 2021-01-05, rev 0x00ea, size 104448 sig 0x000806ec, pf_mask 0x94, 2021-01-05, rev 0x00ea, size 104448 sig 0x000906e9, pf_mask 0x2a, 2021-01-05, rev 0x00ea, size 104448 sig 0x000906ea, pf_mask 0x22, 2021-01-05, rev 0x00ea, size 102400 sig 0x000906eb, pf_mask 0x02, 2021-01-05, rev 0x00ea, size 104448 sig 0x000906ec, pf_mask 0x22, 2021-01-05, rev 0x00ea, size 103424 sig 0x000906ed, pf_mask 0x22, 2021-01-05, rev 0x00ea, size 103424 sig 0x000a0652, pf_mask 0x20, 2021-02-07, rev 0x00ea, size 93184 sig 0x000a0653, pf_mask 0x22, 2021-03-08, rev 0x00ea, size 94208 sig 0x000a0655, pf_mask 0x22, 2021-03-08, rev 0x00ec, size 94208 sig 0x000a0660, pf_mask 0x80, 2020-12-08, rev 0x00e8, size 94208 sig 0x000a0661, pf_mask 0x80, 2021-02-07, rev 0x00ea, size 93184 * source: update symlinks to reflect id of the latest release, 20210608 intel-microcode (3.20210216.1) * New upstream microcode datafile 20210216 * Mitigates an issue on Skylake Server (H0/M0/U0), Xeon-D 21xx, and Cascade Lake Server (B0/B1) when using an active JTAG agent like In Target Probe (ITP), Direct Connect Interface (DCI) or a Baseboard Management Controller (BMC) to take the CPU JTAG/TAP out of reset and then returning it to reset. * This issue is related to the INTEL-SA-00381 mitigation. * Updated Microcodes: sig 0x00050654, pf_mask 0xb7, 2020-12-31, rev 0x2006a0a, size 36864 sig 0x00050656, pf_mask 0xbf, 2020-12-31, rev 0x4003006, size 53248 sig 0x00050657, pf_mask 0xbf, 2020-12-31, rev 0x5003006, size 53248 * source: update symlinks to reflect id of the latest release, 20210216 intel-microcode (3.20201118.1) * New upstream microcode datafile 20201118 * Removes a faulty microcode update from release 2020-11-10 for Tiger Lake processors. Note that Debian already had removed this specific falty microcode update on the 3.20201110.1 release * Add a microcode update for the Pentium Silver N/J5xxx and Celeron N/J4xxx which didn't make it to release 20201110, fixing security issues (INTEL-SA-00381, INTEL-SA-00389) * Updated Microcodes: sig 0x000706a1, pf_mask 0x01, 2020-06-09, rev 0x0034, size 74752 * Removed Microcodes: sig 0x000806c1, pf_mask 0x80, 2020-10-02, rev 0x0068, size 107520 intel-microcode (3.20201110.1) * New upstream microcode datafile 20201110 (closes: #974533) * Implements mitigation for CVE-2020-8696 and CVE-2020-8698, aka INTEL-SA-00381: AVX register information leakage; Fast-Forward store predictor information leakage * Implements mitigation for CVE-2020-8695, Intel SGX information disclosure via RAPL, aka INTEL-SA-00389 * Fixes critical errata on several processor models * Reintroduces SRBDS mitigations(CVE-2020-0543, INTEL-SA-00320) for Skylake-U/Y, Skylake Xeon E3 * New Microcodes sig 0x0005065b, pf_mask 0xbf, 2020-08-20, rev 0x700001e, size 27648 sig 0x000806a1, pf_mask 0x10, 2020-06-26, rev 0x0028, size 32768 sig 0x000806c1, pf_mask 0x80, 2020-10-02, rev 0x0068, size 107520 sig 0x000a0652, pf_mask 0x20, 2020-07-08, rev 0x00e0, size 93184 sig 0x000a0653, pf_mask 0x22, 2020-07-08, rev 0x00e0, size 94208 sig 0x000a0655, pf_mask 0x22, 2020-07-08, rev 0x00e0, size 93184 sig 0x000a0661, pf_mask 0x80, 2020-07-02, rev 0x00e0, size 93184 * Updated Microcodes sig 0x000306f2, pf_mask 0x6f, 2020-05-27, rev 0x0044, size 34816 sig 0x000406e3, pf_mask 0xc0, 2020-07-14, rev 0x00e2, size 105472 sig 0x00050653, pf_mask 0x97, 2020-06-18, rev 0x1000159, size 33792 sig 0x00050654, pf_mask 0xb7, 2020-06-16, rev 0x2006a08, size 35840 sig 0x00050656, pf_mask 0xbf, 2020-06-18, rev 0x4003003, size 52224 sig 0x00050657, pf_mask 0xbf, 2020-06-18, rev 0x5003003, size 52224 sig 0x000506c9, pf_mask 0x03, 2020-02-27, rev 0x0040, size 17408 sig 0x000506ca, pf_mask 0x03, 2020-02-27, rev 0x001e, size 15360 sig 0x000506e3, pf_mask 0x36, 2020-07-14, rev 0x00e2, size 105472 sig 0x000706a8, pf_mask 0x01, 2020-06-09, rev 0x0018, size 75776 sig 0x000706e5, pf_mask 0x80, 2020-07-30, rev 0x00a0, size 109568 sig 0x000806e9, pf_mask 0x10, 2020-05-27, rev 0x00de, size 104448 sig 0x000806e9, pf_mask 0xc0, 2020-05-27, rev 0x00de, size 104448 sig 0x000806ea, pf_mask 0xc0, 2020-06-17, rev 0x00e0, size 104448 sig 0x000806eb, pf_mask 0xd0, 2020-06-03, rev 0x00de, size 104448 sig 0x000806ec, pf_mask 0x94, 2020-05-18, rev 0x00de, size 104448 sig 0x000906e9, pf_mask 0x2a, 2020-05-26, rev 0x00de, size 104448 sig 0x000906ea, pf_mask 0x22, 2020-05-25, rev 0x00de, size 103424 sig 0x000906eb, pf_mask 0x02, 2020-05-25, rev 0x00de, size 104448 sig 0x000906ec, pf_mask 0x22, 2020-06-03, rev 0x00de, size 103424 sig 0x000906ed, pf_mask 0x22, 2020-05-24, rev 0x00de, size 103424 sig 0x000a0660, pf_mask 0x80, 2020-07-08, rev 0x00e0, size 94208 * 0x806c1: remove the new Tiger Lake update: causes hang on cold/warm boot https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/44 INTEL-SA-00381 AND INTEL-SA-00389 MITIGATIONS ARE THEREFORE NOT INSTALLED FOR 0x806c1 TIGER LAKE PROCESSORS by this package update. Contact your system vendor for a firmware update, or wait fo a possible fix in a future Intel microcode release. * source: update symlinks to reflect id of the latest release, 20201110 * source: ship new upstream documentation (security.md, releasenote.md) Signed-off-by: Tan Zien [used different .tar.xz source, but with the same content] Signed-off-by: Christian Lamparter --- package/firmware/intel-microcode/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/firmware/intel-microcode/Makefile b/package/firmware/intel-microcode/Makefile index d2f61e9bf0..7f8d5adf7c 100644 --- a/package/firmware/intel-microcode/Makefile +++ b/package/firmware/intel-microcode/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=intel-microcode -PKG_VERSION:=20200616 +PKG_VERSION:=20210608 PKG_RELEASE:=1 -PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz +PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).2.tar.xz PKG_SOURCE_URL:=@DEBIAN/pool/non-free/i/intel-microcode/ -PKG_HASH:=bcc3b81c452fe4649a948c022475d76c1cdfbb730f36749a082f412f1406a3b9 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE) +PKG_HASH:=fbf82688ffd0d87b352a35c57bd097ea014f0ad32c9c8f9629725c1b43d1c84d +PKG_BUILD_DIR:=$(BUILD_DIR)/intel-microcode-3.$(PKG_VERSION).2 PKG_BUILD_DEPENDS:=iucode-tool/host From eb20a1b8bb631084b9a70126eac2a6e32c3f3565 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Thu, 2 Dec 2021 20:04:53 +0100 Subject: [PATCH 34/78] gemini: only provide squashfs image for storlink-derivates The itian sq201, raidsonic ib-4220-b and storlink sl93512r can't boot from ext4. This is because the rootfstype in the device-tree bootargs is set to "squashfs,jffs2". (And ext4 was not designed for raw NOR flash chips). Signed-off-by: Christian Lamparter --- target/linux/gemini/image/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile index 9906808c9e..c84f1926dd 100644 --- a/target/linux/gemini/image/Makefile +++ b/target/linux/gemini/image/Makefile @@ -181,6 +181,7 @@ define Device/storlink-reference COMPILE := copy-kernel-$(1).bin COMPILE/copy-kernel-$(1).bin := copy-kernel.bin IMAGES := factory.bin + FILESYSTEMS := squashfs IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 6144k | \ storlink-default-images $(1) DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) From 45eb57f12f3a128a1822a20b7e536527ab92ca67 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sun, 28 Nov 2021 15:26:18 +0100 Subject: [PATCH 35/78] ipq40xx: unbreak EZVIZ CS-W3-WD1200G EUP on 5.10 with current images, the device is no longer booting. It gets stuck in the bootloader with "Config not available" and drops to the uboot shell. |flash_type: 0 |Hit any key to stop autoboot: 0 |SF: Detected MX25L12805D with page size 4 KiB, total 16 MiB |Config not availabale |(IPQ40xx) # This is because the default bootcmd "bootipq" will only read the first four MiB of the kernel image. With 5.10 the gzip'd kernel is slightly larger. So the part of the FIT image which had the configuration is cut off. Hence it can't find it. To update the bootcmd, you have to attach the serial console again and enter the following commands into the boot prompt: # setenv bootcmd "sf probe; sf read 84000000 180000 600000; bootm" # saveenv # run bootcmd This will allow booting kernels with up to six MiB. This also allows us to drop the DEVICE_DTS_CONFIG hack we had to use. Note: uboot doesn't support LZMA. It fails with: "Unimplemented compression type 3" Signed-off-by: Christian Lamparter --- .../base-files/etc/uci-defaults/05_fix-compat-version | 10 ++++++++++ target/linux/ipq40xx/image/generic.mk | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version diff --git a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version new file mode 100644 index 0000000000..44873b9df4 --- /dev/null +++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version @@ -0,0 +1,10 @@ +. /lib/functions.sh + +case "$(board_name)" in +ezviz,cs-w3-wd1200g-eup) + uci set system.@system[0].compat_version="2.0" + uci commit system + ;; +esac + +exit 0 diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 872c4f957f..332fff7f45 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -493,13 +493,16 @@ define Device/ezviz_cs-w3-wd1200g-eup DEVICE_VENDOR := EZVIZ DEVICE_MODEL := CS-W3-WD1200G DEVICE_VARIANT := EUP - DEVICE_DTS_CONFIG := config@4 IMAGE_SIZE := 14848k + KERNEL_SIZE = 6m SOC := qcom-ipq4018 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ append-metadata DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \ ipq-wifi-ezviz_cs-w3-wd1200g-eup + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := uboot's bootcmd has to be updated (see wiki). \ + Upgrade via sysupgrade mechanism is not possible. endef TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup From d641a604789ac604b01b9a7b408614e1cb74c700 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 27 Nov 2021 23:06:13 +0100 Subject: [PATCH 36/78] ipq40xx: nvmem cells for EZVIZ CS-W3-WD1200G EUP introduce nvmem pre-cal + mac-address cells for both Wifis and ethernet on the EZVIZ CS-W3-WD1200G EUP. This is one of the few devices in which the correct mac adress is already at the right place for Wifi, so no separate nvmem cell is needed. Signed-off-by: Christian Lamparter --- .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 -- .../lib/preinit/05_set_iface_mac_ipq40xx.sh | 4 --- .../dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts | 34 +++++++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 8924fb3258..d368475ffc 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -64,7 +64,6 @@ case "$FIRMWARE" in 8dev,jalapeno |\ alfa-network,ap120c-ac |\ cilab,meshpoint-one |\ - ezviz,cs-w3-wd1200g-eup |\ glinet,gl-ap1300 |\ glinet,gl-b1300 |\ glinet,gl-b2200 |\ @@ -187,7 +186,6 @@ case "$FIRMWARE" in 8dev,jalapeno |\ alfa-network,ap120c-ac |\ cilab,meshpoint-one |\ - ezviz,cs-w3-wd1200g-eup |\ glinet,gl-ap1300 |\ glinet,gl-b1300 |\ glinet,gl-b2200 |\ diff --git a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh index 1b8454e4c5..d1fcd804d9 100644 --- a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh +++ b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh @@ -7,10 +7,6 @@ preinit_set_mac_address() { ip link set dev eth0 address $(macaddr_add "$base_mac" 1) ip link set dev eth1 address $(macaddr_add "$base_mac" 3) ;; - ezviz,cs-w3-wd1200g-eup) - ip link set dev eth0 address $(mtd_get_mac_binary "ART" 0x6) - ip link set dev eth1 address $(mtd_get_mac_binary "ART" 0x0) - ;; engenius,eap2200) base_mac=$(cat /sys/class/net/eth0/address) ip link set dev eth1 address $(macaddr_add "$base_mac" 1) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts index 062826c7a4..52311755b7 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts @@ -210,6 +210,26 @@ label = "ART"; reg = <0x00170000 0x00010000>; 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>; + }; }; partition9@580000 { @@ -234,9 +254,23 @@ &wifi0 { status = "okay"; qcom,ath10k-calibration-variant = "ezviz-cs-w3-wd1200g-eup"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_1000>; }; &wifi1 { status = "okay"; qcom,ath10k-calibration-variant = "ezviz-cs-w3-wd1200g-eup"; + nvmem-cell-names = "pre-calibration"; + nvmem-cells = <&precal_art_5000>; +}; + +&gmac0 { + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_art_6>; +}; + +&gmac1 { + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_art_0>; }; From a82fa5bcd4817339f5eb75cbeb49e1ab6d30d50e Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Mon, 29 Nov 2021 13:56:49 +0100 Subject: [PATCH 37/78] ramips: mt7620: Enable PHY aneg of Lava LR-25G001 In 20b09a2125f5 Lava LR-25G001 router have problem with two inactive ethernet ports. JBOOT bootloader didn't configure ethernet devices by default. The same situation was there. It is required to enable all phy ports. This is fragment of stock bootlog: switch reg write_athr offset=90, value=2b0 switch reg write_athr offset=8c, value=2b0 switch reg write_athr offset=88, value=2b0 switch reg write_athr offset=84, value=2b0 switch reg write_athr offset=80, value=2b0 This patch adds proper registers configuration ar8337 initvals. 0x2b0 value causes force flow control configuration, 0x1200 was used instead (flow control config auto-neg with phy). [1] When switch is now ok, let's fix port numeration too. Fixes: 20b09a2125f5 ("ramips: add support for Lava LR-25G001") [1] https://github.com/openwrt/openwrt/pull/4806#issuecomment-982019858 Signed-off-by: Pawel Dembicki --- target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts | 5 +++++ .../linux/ramips/mt7620/base-files/etc/board.d/02_network | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts index b7fa78661e..2c2e485f43 100644 --- a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts +++ b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts @@ -125,6 +125,11 @@ 0x04 0x87300000 /* PORT0 PAD MODE CTRL */ 0x0c 0x00000000 /* PORT6 PAD MODE CTRL */ 0x7c 0x0000007e /* PORT0_STATUS */ + 0x80 0x00001200 /* PORT1_STATUS */ + 0x84 0x00001200 /* PORT2_STATUS */ + 0x88 0x00001200 /* PORT3_STATUS */ + 0x8c 0x00001200 /* PORT4_STATUS */ + 0x90 0x00001200 /* PORT5_STATUS */ 0x94 0x00000000 /* PORT6_STATUS */ >; }; diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 7710fbfb3b..2d91911766 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -138,6 +138,7 @@ ramips_setup_interfaces() "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" ;; engenius,esr600|\ + lava,lr-25g001|\ sitecom,wlr-4100-v1-002) ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "0@eth0" @@ -173,13 +174,6 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0" ;; - lava,lr-25g001) - ucidef_add_switch "switch0" \ - "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" - ucidef_add_switch "switch1" \ - "5:lan" "6@eth0" - ucidef_add_switch_attr "switch1" "enable" "false" - ;; lenovo,newifi-y1|\ xiaomi,miwifi-mini) ucidef_add_switch "switch0" \ From e22c91e144d63ccbd7b76b370a53652c48db1d6f Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Fri, 26 Nov 2021 20:26:17 +0300 Subject: [PATCH 38/78] ramips: fix tl-mr3020-v3 switch topology to configure vlans via luci Currently it is not possible to configure VLANs via LUCI on tplink tl-mr3020-v3. This patch fixes switch topology for the LUCI interface. Signed-off-by: Sergey V. Lobanov [copied commit message from github PR] Signed-off-by: Christian Lamparter --- target/linux/ramips/mt76x8/base-files/etc/board.d/02_network | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index d4e3027f4e..d3c7f9c3f9 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -26,7 +26,6 @@ ramips_setup_interfaces() tplink,re220-v2|\ tplink,re305-v1|\ tplink,re305-v3|\ - tplink,tl-mr3020-v3|\ tplink,tl-wr802n-v4|\ tplink,tl-wa801nd-v5|\ widora,neo-16m|\ @@ -35,6 +34,10 @@ ramips_setup_interfaces() ucidef_add_switch_attr "switch0" "enable" "false" ucidef_set_interface_lan "eth0" ;; + tplink,tl-mr3020-v3) + ucidef_add_switch "switch0" \ + "0:lan" "6@eth0" + ;; asus,rt-n10p-v3|\ asus,rt-n11p-b1|\ asus,rt-n12-vp-b1|\ From 3843c641d83b621e07f03753a5617ab27e55e262 Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Mon, 16 Aug 2021 17:42:56 +0200 Subject: [PATCH 39/78] kirkwood: add support for Ctera C200 V1 NAS 2-Bay NAS - maximum two 3.5" Harddisks Hardware: - SoC: Marvell 88F6281-A1 ARMv5TE Processor 1.2GHz - Ram: 512MB (4x Nanya NT5TU128M8GE-AC) - NAND Flash: 256MB (Samsung 216 K9F2G08U0C) - Lan: 1x GBE (Marvell 88E1116R-NNC1) - Storage: 2x SATA HDD 3.5" Slot - USB: 2x USB 2.0 port - Console: Internal J3 connector (1: Vcc, 2: Rx, 3: Tx, 4: GND) - LEDs: 13x GPIO controlled - Buttons: 2x GPIO controlled Known issues: - Buzzer is unused due lack of proper driver Installation: - Apply factory initramfs image via stock web-gui. - Do sysupgrade to make installation complete. Back to stock: - OpenWrt rootfs partition use unused space after stock firmware. - Full revert is possible. - Login via ssh and run: ctera_c200-v1_back_to_factory Signed-off-by: Pawel Dembicki Reviewed-by: Sungbo Eo [apply sorting to device recipe] Signed-off-by: Sungbo Eo --- .../base-files/etc/board.d/02_network | 1 + .../base-files/etc/init.d/hwmon_fancontrol | 7 + .../base-files/lib/upgrade/platform.sh | 13 +- .../sbin/ctera_c200-v1_back_to_factory | 28 ++ .../arch/arm/boot/dts/kirkwood-c200-v1.dts | 303 ++++++++++++++++++ target/linux/kirkwood/image/Makefile | 70 ++++ 6 files changed, 421 insertions(+), 1 deletion(-) create mode 100755 target/linux/kirkwood/base-files/sbin/ctera_c200-v1_back_to_factory create mode 100644 target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-c200-v1.dts diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index 694bcaecce..c98e30adcb 100644 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -18,6 +18,7 @@ cisco,on100) ;; cloudengines,pogoe02|\ cloudengines,pogoplugv4|\ +ctera,c200-v1|\ globalscale,sheevaplug|\ iom,iconnect-1.1|\ iom,ix2-200|\ diff --git a/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol b/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol index 334a2a08ef..ec85b56ca1 100755 --- a/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol +++ b/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol @@ -7,6 +7,13 @@ boot() { # for more information, please read https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface case $(board_name) in + ctera,c200-v1) + path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-004c/hwmon/hwmon0' + + # It should be related to hdd temerature instead lm63 temp + echo 1 > "$path_to_hwmon/pwm1_enable" + echo 128 > "$path_to_hwmon/pwm1" + ;; iom,ix2-200) path_to_hwmon='/sys/class/hwmon/hwmon0' echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1 diff --git a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh index 8ff1709f2c..3f84df2808 100644 --- a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh +++ b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh @@ -1,4 +1,4 @@ -RAMFS_COPY_BIN='fw_printenv fw_setenv' +RAMFS_COPY_BIN='fw_printenv fw_setenv strings' RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' REQUIRE_IMAGE_METADATA=1 @@ -11,6 +11,17 @@ platform_do_upgrade() { local board="$(board_name)" case "$board" in + ctera,c200-v1) + part=$(find_mtd_part "active_bank") + + if [ -n "$part" ]; then + CI_KERNPART="$(strings $part | grep bank)" + nand_do_upgrade "$1" + else + echo "active_bank partition missed!" + return 1 + fi + ;; linksys,e4200-v2|\ linksys,ea3500|\ linksys,ea4500) diff --git a/target/linux/kirkwood/base-files/sbin/ctera_c200-v1_back_to_factory b/target/linux/kirkwood/base-files/sbin/ctera_c200-v1_back_to_factory new file mode 100755 index 0000000000..bb922d4d75 --- /dev/null +++ b/target/linux/kirkwood/base-files/sbin/ctera_c200-v1_back_to_factory @@ -0,0 +1,28 @@ +#!/bin/sh + +. /lib/functions.sh + +case $(board_name) in +ctera,c200-v1) + part=$(find_mtd_part "active_bank") + + if [ -n "$part" ]; then + active_bank="$(strings $part | grep bank)" + + if [ $active_bank = "bank1" ]; then + echo "bank2" > /tmp/change_bank + else + echo "bank1" > /tmp/change_bank + fi + + mtd write /tmp/change_bank active_bank + reboot + else + echo "active_bank partition missed!" + return 1 + fi + ;; +*) + echo "Unsupported hardware." + ;; +esac diff --git a/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-c200-v1.dts b/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-c200-v1.dts new file mode 100644 index 0000000000..9ff73382b3 --- /dev/null +++ b/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-c200-v1.dts @@ -0,0 +1,303 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Ctera C200 V1 Board Description + * Copyright 2021 Pawel Dembicki + */ + +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "Ctera C200 V1"; + compatible = "ctera,c200-v1", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x20000000>; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&pmx_buttons>; + pinctrl-names = "default"; + + power { + label = "Power Button"; + linux,code = ; + gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>; + }; + + reset { + label = "Reset Button"; + linux,code = ; + gpios = <&gpio1 17 GPIO_ACTIVE_LOW>; + }; + + usb1 { + label = "USB1 Button"; + linux,code = ; + gpios = <&gpio0 28 GPIO_ACTIVE_LOW>; + }; + + usb2 { + label = "USB2 Button"; + linux,code = ; + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-poweroff { + compatible = "gpio-poweroff"; + pinctrl-0 = <&pmx_poweroff>; + pinctrl-names = "default"; + gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&pmx_leds>; + pinctrl-names = "default"; + + led_status_green: status-green { + label = "green:status"; + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + }; + + led_status_red: status-red { + label = "red:status"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + }; + + cloud-blue { + label = "blue:cloud"; + gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + }; + + disk1-green { + label = "green:disk1"; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "ata1"; + }; + + disk1-red { + label = "red:disk1"; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; + }; + + disk2-green { + label = "green:disk2"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "ata2"; + }; + + disk2-red { + label = "red:disk2"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + }; + + disk-fail-green { + label = "green:disk-fail"; + gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; + }; + + disk-fail-red { + label = "red:disk-fail"; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + }; + + usb1-green { + label = "green:usb1"; + gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port2>; + }; + + usb1-red { + label = "red:usb1"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + }; + + usb2-green { + label = "green:usb2"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port1>; + }; + + usb2-red { + label = "red:usb2"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; +}; + +ð0port { + phy-handle = <ðphy9>; +}; + +&i2c0 { + status = "okay"; + + rtc@30 { + compatible = "s35390a"; + reg = <0x30>; + }; + + lm63@4c { + compatible = "national,lm63"; + reg = <0x4c>; + }; +}; + +&mdio { + status = "okay"; + + ethphy9: ethernet-phy@9 { + reg = <9>; + }; +}; + +&nand { + status = "okay"; + chip-delay = <40>; + + partition@0 { + label = "uboot"; + reg = <0x0000000 0x200000>; + }; + + partition@200000 { + label = "certificate"; + reg = <0x0200000 0x100000>; + }; + + partition@300000 { + label = "preset_cfg"; + reg = <0x0300000 0x100000>; + }; + + partition@400000 { + label = "dev_params"; + reg = <0x0400000 0x100000>; + }; + partition@500000 { + label = "active_bank"; + reg = <0x0500000 0x0100000>; + }; + + partition@600000 { + label = "magic"; + reg = <0x0600000 0x0100000>; + }; + + partition@700000 { + label = "bank1"; + reg = <0x0700000 0x2800000>; + }; + + partition@2f00000 { + label = "bank2"; + reg = <0x2f00000 0x2800000>; + }; + + /* 0x5700000-0x5a00000 undefined in vendor firmware */ + + partition@5a00000 { + label = "reserved"; + reg = <0x5a00000 0x2000000>; + }; + + partition@7a00000 { + label = "ubi"; + reg = <0x7a00000 0x8600000>; + }; +}; + +&pciec { + status = "okay"; +}; + +&pcie0 { + status = "okay"; +}; + +&pinctrl { + /* buzzer gpios are connected to two pins of buzzer + * leave it as is due lack of proper driver + */ + pmx_buzzer: pmx-buzzer { + marvell,pins = "mpp12", "mpp13"; + marvell,function = "gpio"; + }; + + pmx_leds: pmx-leds { + marvell,pins = "mpp14", "mpp15", "mpp16", "mpp17", "mpp38", + "mpp39", "mpp40", "mpp42", "mpp43", "mpp44", + "mpp45", "mpp46", "mpp47"; + marvell,function = "gpio"; + }; + + pmx_buttons: pmx-buttons { + marvell,pins = "mpp28", "mpp29", "mpp48", "mpp49"; + marvell,function = "gpio"; + }; + + pmx_poweroff: pmx-poweroff { + marvell,pins = "mpp34"; + marvell,function = "gpio"; + }; +}; + +&rtc { + status = "disabled"; +}; + +&sata { + status = "okay"; + nr-ports = <2>; +}; + +&uart0 { + status = "okay"; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + #trigger-source-cells = <0>; + + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + hub_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; +}; diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index f1cd2611d2..51772692cc 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -7,6 +7,63 @@ include $(INCLUDE_DIR)/image.mk KERNEL_LOADADDR:=0x8000 +# Some info about Ctera firmware: +# 1. It's simple tar file (GNU standard), but it must have ".firm" suffix. +# 2. It contains two images: kernel and romdisk. Both are required. +# 3. Every image has header and trailer file. +# 4. The struct of tar firmware is: header kernel trailer header romdisk trailer +# 5. In header file are some strings used to describe image. It was decoded from +# factory image. +# 6. Version format in header file is restricted by Original FW. +# 7. Trailer file contains MD5 sum string of header and image file. +# 8. Firmware file must have <=24MB size. + +define Build/ctera-firmware + mkdir -p $@.tmp + + # Prepare header and trailer file for kernel + echo "# CTera firmware information file" > $@.tmp/header + echo "image_type=kernel" >> $@.tmp/header + echo "arch=Kirkwood" >> $@.tmp/header + echo "board=Any" >> $@.tmp/header + echo "version=3.1.22.30669" >> $@.tmp/header + echo "kernel_cmd=console=ttyS0,115200 earlyprintk" >> $@.tmp/header + echo "date=$$(date $(if $(SOURCE_DATE_EPOCH),-d@$(SOURCE_DATE_EPOCH)))" \ + >> $@.tmp/header + + cp $@ $@.tmp/kernel + + echo "MD5=$$(cat $@.tmp/header $@.tmp/kernel | $(MKHASH) md5)" \ + > $@.tmp/trailer + + tar $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \ + -H gnu -C $@.tmp -cf $@.tar header kernel trailer + + # Prepare header and trailer file for fake romdisk + echo "# CTera firmware information file" > $@.tmp/header + echo "image_type=romdisk" >> $@.tmp/header + echo "initrd=yes" >> $@.tmp/header + echo "arch=Kirkwood" >> $@.tmp/header + echo "board=Any" >> $@.tmp/header + echo "version=3.1.22.30669" >> $@.tmp/header + echo "date=$$(date $(if $(SOURCE_DATE_EPOCH),-d@$(SOURCE_DATE_EPOCH)))" \ + >> $@.tmp/header + + rm -f $@ + touch $@ + $(call Build/append-uImage-fakehdr, ramdisk) + cp $@ $@.tmp/romdisk + + echo "MD5=$$(cat $@.tmp/header $@.tmp/romdisk | $(MKHASH) md5)" \ + > $@.tmp/trailer + + tar $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \ + -H gnu -C $@.tmp -rf $@.tar header romdisk trailer + + mv $@.tar $@ + rm -rf $@.tmp +endef + define Device/kernel-size-migration DEVICE_COMPAT_VERSION := 2.0 DEVICE_COMPAT_MESSAGE := Partition design has changed compared to \ @@ -70,6 +127,19 @@ define Device/cloudengines_pogoplugv4 endef TARGET_DEVICES += cloudengines_pogoplugv4 +define Device/ctera_c200-v1 + DEVICE_VENDOR := Ctera + DEVICE_MODEL := C200 + DEVICE_VARIANT := V1 + DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-gpio-button-hotplug \ + kmod-hwmon-lm63 kmod-rtc-s35390a kmod-usb-ledtrig-usbport + KERNEL := kernel-bin | append-dtb | uImage none | ctera-firmware + KERNEL_IN_UBI := + KERNEL_SUFFIX := -factory.firm + IMAGES := sysupgrade.bin +endef +TARGET_DEVICES += ctera_c200-v1 + define Device/globalscale_sheevaplug DEVICE_VENDOR := Globalscale DEVICE_MODEL := Sheevaplug From c33eb0372e7cbc404eb77a811bca7fe1eed8a2a9 Mon Sep 17 00:00:00 2001 From: Yuchan Seo Date: Tue, 12 Oct 2021 21:04:44 -0400 Subject: [PATCH 40/78] ramips: add support for ipTIME A3004NS-dual ipTIME A3004NS-dual is a 2.4/5GHz band router, based on Mediatek MT7621. Specifications: - SoC: MT7621 (880MHz) - RAM: DDR3 256M - Flash: SPI NOR 16MB - WiFi: - 2.4GHz: MT7602E - 5GHz : MT7612E - Ethernet: - 4x LAN - 1x WAN - USB: 1 * USB3.0 port - UART: - 3.3V, TX, RX, GND / 57600 8N1 Installation via web interface: - 1. Flash Initramfs image using OEM Firmware's web GUI - 2. Boot into OpenWrt and perform Sysupgrade with sysupgrade image. Revert to stock firmware: - 1. Boot into OpenWrt and perform Sysupgrade with OEM Stock Firmware image. Signed-off-by: Yuchan Seo Reviewed-by: Sungbo Eo --- .../ramips/dts/mt7621_iptime_a3004ns-dual.dts | 179 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 11 ++ 2 files changed, 190 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts diff --git a/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts b/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts new file mode 100644 index 0000000000..fa3f146e81 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts @@ -0,0 +1,179 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "iptime,a3004ns-dual", "mediatek,mt7621-soc"; + model = "ipTIME A3004NS-dual"; + + aliases { + led-boot = &led_cpu; + led-failsafe = &led_cpu; + led-running = &led_cpu; + led-upgrade = &led_cpu; + }; + + leds { + compatible = "gpio-leds"; + + led_cpu: cpu { + label = "blue:cpu"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "blue:usb"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + trigger-sources = <&xhci_ehci_port1>; + linux,default-trigger = "usbport"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "config"; + reg = <0x20000 0x10000>; + read-only; + }; + + factory: partition@30000 { + label = "factory"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "firmware"; + reg = <0x40000 0xfc0000>; + compatible = "denx,uimage"; + }; + }; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_uboot_1fc20>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + nvmem-cells = <&macaddr_uboot_1fc40>; + nvmem-cell-names = "mac-address"; + }; + + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan3"; + }; + + port@4 { + status = "okay"; + label = "lan4"; + }; + }; +}; + +&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; + }; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + + led { + led-sources = <2>; + led-active-low; + }; + }; +}; + +&state_default { + gpio { + groups = "wdt", "i2c", "uart3"; + function = "gpio"; + }; +}; + +&uboot { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; + + macaddr_uboot_1fc40: macaddr@1fc40 { + reg = <0x1fc40 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 3b68a76b3e..2b08efc468 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -736,6 +736,17 @@ define Device/iodata_wnpr2600g endef TARGET_DEVICES += iodata_wnpr2600g +define Device/iptime_a3004ns-dual + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 16128k + UIMAGE_NAME := a3004nd + DEVICE_VENDOR := ipTIME + DEVICE_MODEL := A3004NS-dual + DEVICE_PACKAGES := kmod-usb3 kmod-mt76x2 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += iptime_a3004ns-dual + define Device/iptime_a6ns-m $(Device/dsa-migration) IMAGE_SIZE := 16128k From dd681838d370f1f6f6fa1bf1f22b0414322292f3 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 15 Jun 2021 08:48:18 +0200 Subject: [PATCH 41/78] base-files: fix service_running check The following command checks if a instance of a service is running. /etc/init.d/ running In the variable `$@`, which is passed to the function `service_running`, the first argument is always the `instance` which should be checked. Because all other variables where removed from `$@` with `shift`. Before this change the first argument of `$@` was set to the `$service` Variable. So the function does not work as expected. The `$service` variable was always the instance which should be checked. This is not what we want. Signed-off-by: Florian Eckert Reviewed-by: Sungbo Eo --- package/base-files/files/etc/rc.common | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index 5dcbf5138d..e950ec209d 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -105,9 +105,9 @@ service_data() { } service_running() { - local service="${1:-$(basename $initscript)}" - local instance="${2:-*}" - procd_running "$service" "$instance" "$@" + local instance="${1:-*}" + + procd_running "$(basename $initscript)" "$instance" } ${INIT_TRACE:+set -x} From 2d49e49b1854c2234aa343847594245214a4edf9 Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Sat, 4 Dec 2021 22:24:59 +0800 Subject: [PATCH 42/78] mediatek: bmt: use generic mtd api BMT replaces nand-specific ops for erasing and writing, but the mtk-snand driver only implements generic mtd api. Replace erase, block_isbad, block_markbad in mtd_info for generic mtd drivers. Fixes: b600aee3ed ("mediatek: attach bmt to the new snand driver") Signed-off-by: Chuanhong Guo --- .../patches-5.10/330-mtk-bmt-support.patch | 119 +++++++++--------- 1 file changed, 63 insertions(+), 56 deletions(-) diff --git a/target/linux/mediatek/patches-5.10/330-mtk-bmt-support.patch b/target/linux/mediatek/patches-5.10/330-mtk-bmt-support.patch index 72a729c7f3..bf70fb75b9 100644 --- a/target/linux/mediatek/patches-5.10/330-mtk-bmt-support.patch +++ b/target/linux/mediatek/patches-5.10/330-mtk-bmt-support.patch @@ -23,7 +23,7 @@ obj-y += raw/ --- /dev/null +++ b/drivers/mtd/nand/mtk_bmt.c -@@ -0,0 +1,781 @@ +@@ -0,0 +1,788 @@ +/* + * Copyright (c) 2017 MediaTek Inc. + * Author: Xiangsheng Hou @@ -43,7 +43,7 @@ +#include +#include +#include -+#include ++#include +#include +#include +#include @@ -89,7 +89,9 @@ + struct mtd_oob_ops *ops); + int (*_write_oob) (struct mtd_info *mtd, loff_t to, + struct mtd_oob_ops *ops); -+ const struct nand_ops *nand_ops; ++ int (*_erase) (struct mtd_info *mtd, struct erase_info *instr); ++ int (*_block_isbad) (struct mtd_info *mtd, loff_t ofs); ++ int (*_block_markbad) (struct mtd_info *mtd, loff_t ofs); + + struct bbbt *bbt; + @@ -145,12 +147,13 @@ + +static inline int bbt_nand_erase(u16 block) +{ -+ struct nand_device *nand = mtd_to_nanddev(bmtd.mtd); -+ loff_t addr = (loff_t)block << bmtd.blk_shift; -+ struct nand_pos pos; ++ struct mtd_info *mtd = bmtd.mtd; ++ struct erase_info instr = { ++ .addr = (loff_t)block << bmtd.blk_shift, ++ .len = bmtd.blk_size, ++ }; + -+ nanddev_offs_to_pos(nand, addr, &pos); -+ return bmtd.nand_ops->erase(nand, &pos); ++ return bmtd._erase(mtd, &instr); +} + +/* -------- Bad Blocks Management -------- */ @@ -544,76 +547,80 @@ + return 0; +} + -+ -+ +static int -+mtk_bmt_erase(struct nand_device *nand, const struct nand_pos *pos) ++mtk_bmt_mtd_erase(struct mtd_info *mtd, struct erase_info *instr) +{ -+ struct nand_pos new_pos = *pos; ++ struct erase_info mapped_instr = { ++ .len = bmtd.blk_size, ++ }; + int retry_count = 0; ++ u64 start_addr, end_addr; ++ int ret; ++ u16 orig_block, block; ++ ++ start_addr = instr->addr & (~mtd->erasesize_mask); ++ end_addr = instr->addr + instr->len; ++ ++ while (start_addr < end_addr) { ++ orig_block = start_addr >> bmtd.blk_shift; ++ block = get_mapping_block_index(orig_block); ++ mapped_instr.addr = (loff_t)block << bmtd.blk_shift; ++ ret = bmtd._erase(mtd, &mapped_instr); ++ if (ret) { ++ update_bmt(orig_block); ++ if (retry_count++ < 10) ++ continue; ++ instr->fail_addr = start_addr; ++ break; ++ } ++ start_addr += mtd->erasesize; ++ retry_count = 0; ++ } ++ ++ return ret; ++} ++static int ++mtk_bmt_block_isbad(struct mtd_info *mtd, loff_t ofs) ++{ ++ int retry_count = 0; ++ u16 orig_block = ofs >> bmtd.blk_shift; ++ u16 block; + int ret; + +retry: -+ new_pos.eraseblock = get_mapping_block_index(pos->eraseblock); -+ -+ ret = bmtd.nand_ops->erase(nand, &new_pos); ++ block = get_mapping_block_index(orig_block); ++ ret = bmtd._block_isbad(mtd, (loff_t)block << bmtd.blk_shift); + if (ret) { -+ update_bmt(pos->eraseblock); ++ update_bmt(orig_block); + if (retry_count++ < 10) + goto retry; + } -+ -+ return ret; -+} -+ -+static bool -+mtk_bmt_isbad(struct nand_device *nand, const struct nand_pos *pos) -+{ -+ struct nand_pos new_pos = *pos; -+ int retry_count = 0; -+ bool ret; -+ -+retry: -+ new_pos.eraseblock = get_mapping_block_index(pos->eraseblock); -+ -+ ret = bmtd.nand_ops->isbad(nand, &new_pos); -+ if (ret) { -+ update_bmt(pos->eraseblock); -+ if (retry_count++ < 10) -+ goto retry; -+ } -+ + return ret; +} + +static int -+mtk_bmt_markbad(struct nand_device *nand, const struct nand_pos *pos) ++mtk_bmt_block_markbad(struct mtd_info *mtd, loff_t ofs) +{ -+ struct nand_pos new_pos = *pos; -+ -+ new_pos.eraseblock = get_mapping_block_index(new_pos.eraseblock); -+ update_bmt(pos->eraseblock); -+ -+ return bmtd.nand_ops->markbad(nand, &new_pos); ++ u16 orig_block = ofs >> bmtd.blk_shift; ++ u16 block = get_mapping_block_index(orig_block); ++ update_bmt(orig_block); ++ return bmtd._block_markbad(mtd, (loff_t)block << bmtd.blk_shift); +} + +static void +mtk_bmt_replace_ops(struct mtd_info *mtd) +{ -+ static const struct nand_ops mtk_bmt_nand_ops = { -+ .erase = mtk_bmt_erase, -+ .isbad = mtk_bmt_isbad, -+ .markbad = mtk_bmt_markbad, -+ }; -+ struct nand_device *nand = mtd_to_nanddev(mtd); -+ -+ bmtd.nand_ops = nand->ops; + bmtd._read_oob = mtd->_read_oob; + bmtd._write_oob = mtd->_write_oob; ++ bmtd._erase = mtd->_erase; ++ bmtd._block_isbad = mtd->_block_isbad; ++ bmtd._block_markbad = mtd->_block_markbad; + + mtd->_read_oob = mtk_bmt_read; + mtd->_write_oob = mtk_bmt_write; -+ nand->ops = &mtk_bmt_nand_ops; ++ mtd->_erase = mtk_bmt_mtd_erase; ++ mtd->_block_isbad = mtk_bmt_block_isbad; ++ mtd->_block_markbad = mtk_bmt_block_markbad; +} + +static int mtk_bmt_debug_mark_good(void *data, u64 val) @@ -653,8 +660,6 @@ + +void mtk_bmt_detach(struct mtd_info *mtd) +{ -+ struct nand_device *nand = mtd_to_nanddev(mtd); -+ + if (bmtd.mtd != mtd) + return; + @@ -667,8 +672,10 @@ + + mtd->_read_oob = bmtd._read_oob; + mtd->_write_oob = bmtd._write_oob; ++ mtd->_erase = bmtd._erase; ++ mtd->_block_isbad = bmtd._block_isbad; ++ mtd->_block_markbad = bmtd._block_markbad; + mtd->size = bmtd.total_blks << bmtd.blk_shift; -+ nand->ops = bmtd.nand_ops; + + memset(&bmtd, 0, sizeof(bmtd)); +} From f9a28d216d65b55e1139e2c73d016c5e77d7fe0b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 4 Dec 2021 22:46:00 +0100 Subject: [PATCH 43/78] mediatek: enable bmt on mt7622-rfb1 Signed-off-by: Felix Fietkau --- .../patches-5.10/331-mt7622-rfb1-enable-bmt.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 target/linux/mediatek/patches-5.10/331-mt7622-rfb1-enable-bmt.patch diff --git a/target/linux/mediatek/patches-5.10/331-mt7622-rfb1-enable-bmt.patch b/target/linux/mediatek/patches-5.10/331-mt7622-rfb1-enable-bmt.patch new file mode 100644 index 0000000000..3f59163e09 --- /dev/null +++ b/target/linux/mediatek/patches-5.10/331-mt7622-rfb1-enable-bmt.patch @@ -0,0 +1,11 @@ +--- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts +@@ -533,6 +533,8 @@ + pinctrl-0 = <&serial_nand_pins>; + status = "okay"; + ++ mediatek,bmt-v2; ++ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; From eddb51392a640cd013ae26873eb22527b2dbae3a Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sun, 5 Dec 2021 18:37:15 +0100 Subject: [PATCH 44/78] nat46: update to latest git HEAD d9bc161 nat46-core: Fix typo since day one (#31) 840e235 Fix coverity issues observed so far (#30) Signed-off-by: Hans Dedecker --- package/kernel/nat46/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/nat46/Makefile b/package/kernel/nat46/Makefile index 2329c03411..c365026f08 100644 --- a/package/kernel/nat46/Makefile +++ b/package/kernel/nat46/Makefile @@ -3,11 +3,11 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=nat46 -PKG_MIRROR_HASH:=5e7ebe31311a7b79f9eda222e94170611b3e041e3a472f55b6a283d9b0093bd4 +PKG_MIRROR_HASH:=1476da31996e26ef76e2ba9623d978d33002abf357a59323d9b539812b0a4b76 PKG_SOURCE_URL:=https://github.com/ayourtch/nat46.git -PKG_SOURCE_DATE:=2021-11-08 +PKG_SOURCE_DATE:=2021-11-24 PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=1fdf2a3cf90843ef65b8e84ff25d5e0507eaa3fe +PKG_SOURCE_VERSION:=d9bc161faa4c18ad1d327a96baa2dc4460b71ccd PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 9f0575a13023c1edbb1518304b25ecab7d34cd58 Mon Sep 17 00:00:00 2001 From: Shane Synan Date: Fri, 3 Dec 2021 15:46:36 -0500 Subject: [PATCH 45/78] ipq806x: revert SDC clock changes for NBG6817 MMC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert the SDC "CLK_SET_RATE_GATE" changes to the SDC clock regulator structures. See https://elinux.org/images/b/b8/Elc2013_Clement.pdf > if ((clk->flags & CLK_SET_RATE_GATE) && clk->prepare_count) { > > For this particular clock, setting its rate is possible only if the > clock is ungated (not yet prepared) This fixes the MMC failing to initialize on newer ZyXEL NBG6817 hardware revisions with Kingston MMC. Older revisions should hopefully be unaffected. Check MMC hardware details with: cd /sys/block/mmcblk0/device/ && \ tail -v cid date name manfid fwrev hwrev oemid rev Known problematic MMC names (broken before this commit): * M62704 (dated 12/2018) via myself * M62704 (dated 11/2018) via Drake Stefani Known unaffected MMC names (already working without this commit): * S10004 (dated 12/2015) via slh Without enabling dynamic debugging, this error manifests in the kernel hardware serial console as the following: [ 2.746605] mmc0: error -110 whilst initialising MMC card […trimmed other messages…] [ 2.877832] Waiting for root device /dev/mmcblk0p5... Enabling Linux dynamic kernel debugging provides additional messages. For guidance, see the Linux kernel documentation: https://www.kernel.org/doc/html/latest/admin-guide/dynamic-debug-howto.html First, enable dynamic debugging in OpenWRT's configuration: 1. Run "make menuconfig" 2. Select "Global build settings --->" 3. Select "Kernel build options --->" 4. Enable "Compile the kernel with dynamic printk" via spacebar 5. Save and exit (arrow key to "Exit" until prompted to save, save) Alternatively, set "CONFIG_KERNEL_DYNAMIC_DEBUG=y" in your .config. Then, turn on dynamic debugging at boot: Modify bootargs in target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts to add… bootargs = "[…existing bootargs…] dyndbg=\"file drivers/mmc/* +p\" dynamic_debug.verbose=1 loglevel=8"; For example: chosen { - bootargs = "rootfstype=squashfs,ext4 rootwait noinitrd fstools_ignore_partname=1"; + bootargs = "rootfstype=squashfs,ext4 rootwait noinitrd fstools_ignore_partname=1 dyndbg=\"file drivers/mmc/* +p\" dynamic_debug.verbose=1 loglevel=8"; append-rootblock = "root=/dev/mmcblk0p"; Then, compile and flash the resulting build. If you are testing before this commit on newer MMC hardware, be prepared to recover! NOTE: If you have hardware serial console access, you don't need to use TFTP recovery to change the active boot partition. Reboot to working alternative partition via serial console: 1. Connect to hardware serial console * See https://openwrt.org/toh/zyxel/nbg6817#serial 2. Interrupt boot at "Hit any key to stop autoboot:" 3. Run "ATSE NBG6817" 4. Copy the result (e.g. "001976FE4B04") * Changes with **every boot** - can't reuse this 5. On your local system, run "./zyxel-uboot-password-tool.sh " * Example: "./zyxel-uboot-password-tool.sh 001976FE4B04" 6. Run the command provided by the password tool * Example: "ATEN 1,910F129B" * Changes with **every boot** - can't reuse this 7. Run "ATGU" * You now have full u-boot shell until next boot - unlocking is not remembered 8. Run either "run boot_mmc" (for booting partition set "FF") or "run boot_mmc_1" (for booting partition set "01") * These commands are not affected by dual-boot partition flags NOTE: This will NOT set the dual-boot partition flag. You'll need to fix that manually. The "nbg6817-dualboot" script may help: https://github.com/pkgadd/nbg6817/blob/master/nbg6817-dualboot zyxel-uboot-password-tool.sh - sourced from commit 459c8c9ef816156107e297964d088ddee2b4eef5: ror32() { echo $(( ($1 >> $2) | (($1 << (32 - $2) & (2**32-1)) ) )) } v="0x$1" a="0x${v:2:6}" b=$(( a + 0x10F0A563)) c=$(( 0x${v:12:14} & 7 )) p=$(( $(ror32 $b $c) ^ a )) printf "ATEN 1,%X\n" $p Kernel serial console log BEFORE commit with dynamic debug enabled: […trimmed…] [ 3.171343] mmci-pl18x 12400000.sdcc: designer ID = 0x51 [ 3.171397] mmci-pl18x 12400000.sdcc: revision = 0x0 [ 3.175811] mmci-pl18x 12400000.sdcc: clocking block at 96000000 Hz [ 3.181134] mmci-pl18x 12400000.sdcc: No vqmmc regulator found [ 3.186788] mmci-pl18x 12400000.sdcc: mmc0: PL180 manf 51 rev0 at 0x12400000 irq 41,0 (pio) [ 3.192902] mmci-pl18x 12400000.sdcc: DMA channels RX dma1chan1, TX dma1chan2 [ 3.215609] mmc0: clock 0Hz busmode 2 powermode 1 cs 0 Vdd 21 width 1 timing 0 [ 3.227532] mmci-pl18x 12400000.sdcc: Initial signal voltage of 3.3v [ 3.247518] mmc0: clock 52000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 1 timing 0 […trimmed…] [ 3.997725] mmc0: req done (CMD2): -110: 00000000 00000000 00000000 00000000 [ 4.003631] mmci-pl18x 12400000.sdcc: irq0 (data+cmd) 00000000 [ 4.003659] mmc0: error -110 whilst initialising MMC card [ 4.016481] mmc0: clock 0Hz busmode 2 powermode 0 cs 0 Vdd 0 width 1 timing 0 Notice how the initial clock is 52 MHz, which is incorrect - MMC requires negotiation to enable higher speeds. Kernel serial console log AFTER commit with dynamic debug enabled: […trimmed…] [ 3.168996] mmci-pl18x 12400000.sdcc: designer ID = 0x51 [ 3.169051] mmci-pl18x 12400000.sdcc: revision = 0x0 [ 3.173492] mmci-pl18x 12400000.sdcc: clocking block at 96000000 Hz [ 3.178808] mmci-pl18x 12400000.sdcc: No vqmmc regulator found [ 3.184702] mmci-pl18x 12400000.sdcc: mmc0: PL180 manf 51 rev0 at 0x12400000 irq 41,0 (pio) [ 3.190573] mmci-pl18x 12400000.sdcc: DMA channels RX dma1chan1, TX dma1chan2 [ 3.217873] mmc0: clock 0Hz busmode 2 powermode 1 cs 0 Vdd 21 width 1 timing 0 [ 3.229250] mmci-pl18x 12400000.sdcc: Initial signal voltage of 3.3v [ 3.249111] mmc0: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 1 timing 0 […trimmed…] [ 4.392652] mmci-pl18x 12400000.sdcc: irq0 (data+cmd) 00000000 [ 4.392785] mmc0: clock 52000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 1 timing 1 [ 4.406554] mmc0: starting CMD6 arg 03b70201 flags 0000049d […trimmed…] Now, the MMC properly initializes and later switches to high speed. Thanks to: * Ansuel for maintaining/help with the IPQ806x platform, kernel code * slh for additional debugging and suggestions * dwfreed for confirming newer MMC details, clock frequency * robimarko for device driver debug printing help, clock debugging * Drake for testing and confirmation with their own newer NBG6817 ...and anyone else I missed! Signed-off-by: Shane Synan Tested-by: Shane Synan --- ...7-1-ipq806x-gcc-add-missing-clk-flag.patch | 22 +++---------------- ...missing-clk-and-reset-for-crypto-eng.patch | 10 ++++----- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/target/linux/ipq806x/patches-5.10/097-1-ipq806x-gcc-add-missing-clk-flag.patch b/target/linux/ipq806x/patches-5.10/097-1-ipq806x-gcc-add-missing-clk-flag.patch index 3067ec777a..3b4900fafb 100644 --- a/target/linux/ipq806x/patches-5.10/097-1-ipq806x-gcc-add-missing-clk-flag.patch +++ b/target/linux/ipq806x/patches-5.10/097-1-ipq806x-gcc-add-missing-clk-flag.patch @@ -69,7 +69,7 @@ Signed-off-by: Ansuel Smith }, }, }; -@@ -1293,6 +1295,7 @@ static struct clk_rcg sdc1_src = { +@@ -1424,6 +1426,7 @@ static struct clk_rcg tsif_ref_src = { .parent_names = gcc_pxo_pll8, .num_parents = 2, .ops = &clk_rcg_ops, @@ -77,23 +77,7 @@ Signed-off-by: Ansuel Smith }, } }; -@@ -1341,6 +1344,7 @@ static struct clk_rcg sdc3_src = { - .parent_names = gcc_pxo_pll8, - .num_parents = 2, - .ops = &clk_rcg_ops, -+ .flags = CLK_SET_RATE_GATE, - }, - } - }; -@@ -1424,6 +1428,7 @@ static struct clk_rcg tsif_ref_src = { - .parent_names = gcc_pxo_pll8, - .num_parents = 2, - .ops = &clk_rcg_ops, -+ .flags = CLK_SET_RATE_GATE, - }, - } - }; -@@ -2694,7 +2699,8 @@ static struct clk_dyn_rcg ubi32_core1_sr +@@ -2694,7 +2697,8 @@ static struct clk_dyn_rcg ubi32_core1_sr .parent_names = gcc_pxo_pll8_pll14_pll18_pll0, .num_parents = 5, .ops = &clk_dyn_rcg_ops, @@ -103,7 +87,7 @@ Signed-off-by: Ansuel Smith }, }, }; -@@ -2747,7 +2753,8 @@ static struct clk_dyn_rcg ubi32_core2_sr +@@ -2747,7 +2751,8 @@ static struct clk_dyn_rcg ubi32_core2_sr .parent_names = gcc_pxo_pll8_pll14_pll18_pll0, .num_parents = 5, .ops = &clk_dyn_rcg_ops, diff --git a/target/linux/ipq806x/patches-5.10/097-4-ipq806x-gcc-add-missing-clk-and-reset-for-crypto-eng.patch b/target/linux/ipq806x/patches-5.10/097-4-ipq806x-gcc-add-missing-clk-and-reset-for-crypto-eng.patch index f8f4924dd1..d1e047cabf 100644 --- a/target/linux/ipq806x/patches-5.10/097-4-ipq806x-gcc-add-missing-clk-and-reset-for-crypto-eng.patch +++ b/target/linux/ipq806x/patches-5.10/097-4-ipq806x-gcc-add-missing-clk-and-reset-for-crypto-eng.patch @@ -107,7 +107,7 @@ Signed-off-by: Ansuel Smith { 64000000, P_PLL8, 3, 1, 2 }, { 96000000, P_PLL8, 4, 0, 0 }, { 192000000, P_PLL8, 2, 0, 0 }, -@@ -2647,7 +2703,9 @@ static const struct freq_tbl clk_tbl_nss +@@ -2645,7 +2701,9 @@ static const struct freq_tbl clk_tbl_nss { 110000000, P_PLL18, 1, 1, 5 }, { 275000000, P_PLL18, 2, 0, 0 }, { 550000000, P_PLL18, 1, 0, 0 }, @@ -117,7 +117,7 @@ Signed-off-by: Ansuel Smith { } }; -@@ -2759,6 +2817,186 @@ static struct clk_dyn_rcg ubi32_core2_sr +@@ -2757,6 +2815,186 @@ static struct clk_dyn_rcg ubi32_core2_sr }, }; @@ -304,7 +304,7 @@ Signed-off-by: Ansuel Smith static struct clk_regmap *gcc_ipq806x_clks[] = { [PLL0] = &pll0.clkr, [PLL0_VOTE] = &pll0_vote, -@@ -2766,6 +3004,7 @@ static struct clk_regmap *gcc_ipq806x_cl +@@ -2764,6 +3002,7 @@ static struct clk_regmap *gcc_ipq806x_cl [PLL4_VOTE] = &pll4_vote, [PLL8] = &pll8.clkr, [PLL8_VOTE] = &pll8_vote, @@ -312,7 +312,7 @@ Signed-off-by: Ansuel Smith [PLL14] = &pll14.clkr, [PLL14_VOTE] = &pll14_vote, [PLL18] = &pll18.clkr, -@@ -2880,6 +3119,12 @@ static struct clk_regmap *gcc_ipq806x_cl +@@ -2878,6 +3117,12 @@ static struct clk_regmap *gcc_ipq806x_cl [PLL9] = &hfpll0.clkr, [PLL10] = &hfpll1.clkr, [PLL12] = &hfpll_l2.clkr, @@ -325,7 +325,7 @@ Signed-off-by: Ansuel Smith }; static const struct qcom_reset_map gcc_ipq806x_resets[] = { -@@ -3011,6 +3256,11 @@ static const struct qcom_reset_map gcc_i +@@ -3009,6 +3254,11 @@ static const struct qcom_reset_map gcc_i [GMAC_CORE3_RESET] = { 0x3cfc, 0 }, [GMAC_CORE4_RESET] = { 0x3d1c, 0 }, [GMAC_AHB_RESET] = { 0x3e24, 0 }, From fcb82e42dffca99a6e3244b67992df0b573ce38e Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Thu, 16 May 2019 17:23:12 +0200 Subject: [PATCH 46/78] kernel: btrfs: enable ACL By default CONFIG_BTRFS_FS_POSIX_ACL is disabled, it should be enabled only when you enable CONFIG_FS_POSIX_ACL. Right now, when you enable CONFIG_FS_POSIX_ACL it will enable CONFIG_BTRFS_FS_POSIX_ACL, but it will be disabled once you install kmod-btrfs. This should prevent it. Btrfs has enabled by default ACL for mount option. More details: https://cateee.net/lkddb/web-lkddb/BTRFS_FS_POSIX_ACL.html https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs(5) Signed-off-by: Josef Schlehofer --- package/kernel/linux/modules/fs.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index 7de1a0673c..f9e1b132c7 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -70,7 +70,6 @@ define KernelPackage/fs-btrfs DEPENDS:=+kmod-lib-crc32c +kmod-lib-lzo +kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +kmod-lib-raid6 +kmod-lib-xor +kmod-lib-zstd KCONFIG:=\ CONFIG_BTRFS_FS \ - CONFIG_BTRFS_FS_POSIX_ACL=n \ CONFIG_BTRFS_FS_CHECK_INTEGRITY=n FILES:=\ $(LINUX_DIR)/fs/btrfs/btrfs.ko From 362695acdfa78ad6206ac385962ded589dad5b7c Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Fri, 25 Jun 2021 11:31:23 +0200 Subject: [PATCH 47/78] kernel: add kmod-video-gspca-sq930x This module adds support for USB WebCams, which uses SQ930X chip [1]. [1] https://cateee.net/lkddb/web-lkddb/USB_GSPCA_SQ930X.html Signed-off-by: Josef Schlehofer --- package/kernel/linux/modules/video.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index d665cd43a9..431f077c44 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -856,6 +856,21 @@ endef $(eval $(call KernelPackage,video-gspca-sq905c)) +define KernelPackage/video-gspca-sq930x + TITLE:=sq930x webcam support + KCONFIG:=CONFIG_USB_GSPCA_SQ930X + FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sq930x.ko + AUTOLOAD:=$(call AutoProbe,gspca_sq930x) + $(call AddDepends/camera-gspca) +endef + +define KernelPackage/video-gspca-sq930x/description + The SQ Technologies SQ930X based USB Camera Driver (sq930x) kernel module +endef + +$(eval $(call KernelPackage,video-gspca-sq930x)) + + define KernelPackage/video-gspca-stk014 TITLE:=stk014 webcam support KCONFIG:=CONFIG_USB_GSPCA_STK014 From 75093d1b1de7af82acd3b8bcc61f308c37493400 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 22 Nov 2021 00:51:08 -0800 Subject: [PATCH 48/78] tools/meson: update to 0.60.1 change meson binary to use py extension. Fixes issue with meson's symbolextractor using the host python instead of the system one. We intentionally use a .py extension here so that meson launches additional python scripts with the same build host python interpreter as itself is running under (and not the host package one once it becomes available) Signed-off-by: Rosen Penev --- include/meson.mk | 2 +- tools/meson/Makefile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/meson.mk b/include/meson.mk index ae17e18d2d..e101de4d89 100644 --- a/include/meson.mk +++ b/include/meson.mk @@ -56,7 +56,7 @@ MESON_CPU:="$(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))" endif define Meson - $(2) $(STAGING_DIR_HOST)/bin/$(PYTHON) $(STAGING_DIR_HOST)/bin/meson $(1) + $(2) $(STAGING_DIR_HOST)/bin/$(PYTHON) $(STAGING_DIR_HOST)/bin/meson.py $(1) endef define Meson/CreateNativeFile diff --git a/tools/meson/Makefile b/tools/meson/Makefile index f648085f90..10f29c93d8 100644 --- a/tools/meson/Makefile +++ b/tools/meson/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=meson -PKG_VERSION:=0.60.0 +PKG_VERSION:=0.60.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION) -PKG_HASH:=080d68b685e9a0d9c9bb475457e097b49e1d1a6f750abc971428a8d2e1b12d47 +PKG_HASH:=5add789c953d984b500858b2851ee3d7add0460cf1a6f852f0a721af17384e13 PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 @@ -21,7 +21,7 @@ endef define Host/Install $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin - $(HOST_BUILD_DIR)/packaging/create_zipapp.py $(HOST_BUILD_DIR) --outfile $(STAGING_DIR_HOST)/bin/meson + $(HOST_BUILD_DIR)/packaging/create_zipapp.py $(HOST_BUILD_DIR) --outfile $(STAGING_DIR_HOST)/bin/meson.py $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/meson $(INSTALL_CONF) files/openwrt-cross.txt.in $(STAGING_DIR_HOST)/lib/meson/ $(INSTALL_CONF) files/openwrt-native.txt.in $(STAGING_DIR_HOST)/lib/meson/ From fd4ad6cae88d009e9560e4ee902bf20a5b42d36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Old=C5=99ich=20Jedli=C4=8Dka?= Date: Sat, 9 Jan 2021 22:23:09 +0100 Subject: [PATCH 49/78] x86: added support to generate VHDX images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added support to generate dynamic-sized VHDX images for Hyper-V. Compile-tested on x86 and run-tested on Windows 10 21H2 (Hyper-V). Signed-off-by: Oldřich Jedlička --- config/Config-images.in | 6 ++++++ include/image-commands.mk | 2 +- target/linux/x86/Makefile | 2 +- target/linux/x86/image/Makefile | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/config/Config-images.in b/config/Config-images.in index 92720fb84d..49e5330ffe 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -272,6 +272,12 @@ menu "Target Images" depends on GRUB_IMAGES || GRUB_EFI_IMAGES select PACKAGE_kmod-e1000 + config VHDX_IMAGES + bool "Build Hyper-V image files (VHDX)" + depends on TARGET_x86 + depends on GRUB_IMAGES || GRUB_EFI_IMAGES + select PACKAGE_kmod-e1000 + config TARGET_IMAGES_GZIP bool "GZip images" depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_malta diff --git a/include/image-commands.mk b/include/image-commands.mk index f0557936c9..97176f7d7b 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -395,7 +395,7 @@ define Build/patch-cmdline endef # Convert a raw image into a $1 type image. -# E.g. | qemu-image vdi +# E.g. | qemu-image vdi define Build/qemu-image if command -v qemu-img; then \ qemu-img convert -f raw -O $1 $@ $@.new; \ diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index fbad527e0a..e42d87fbc9 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk ARCH:=i386 BOARD:=x86 BOARDNAME:=x86 -FEATURES:=squashfs ext4 vdi vmdk pcmcia targz fpu boot-part rootfs-part +FEATURES:=squashfs ext4 vdi vmdk vhdx pcmcia targz fpu boot-part rootfs-part SUBTARGETS:=generic legacy geode 64 KERNEL_PATCHVER:=5.10 diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index f61e4ff802..322131c2a4 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -109,6 +109,7 @@ define Device/Default IMAGE/combined.img.gz := grub-config pc | combined | grub-install | gzip | append-metadata IMAGE/combined.vdi := grub-config pc | combined | grub-install | qemu-image vdi IMAGE/combined.vmdk := grub-config pc | combined | grub-install | qemu-image vmdk + IMAGE/combined.vhdx := grub-config pc | combined | grub-install | qemu-image vhdx -o subformat=dynamic IMAGE/rootfs.img := append-rootfs | pad-to $(ROOTFS_PARTSIZE) IMAGE/rootfs.img.gz := append-rootfs | pad-to $(ROOTFS_PARTSIZE) | gzip ARTIFACT/image-efi.iso := grub-config iso | iso efi @@ -116,6 +117,7 @@ define Device/Default IMAGE/combined-efi.img.gz := grub-config efi | combined efi | grub-install efi | gzip | append-metadata IMAGE/combined-efi.vdi := grub-config efi | combined efi | grub-install efi | qemu-image vdi IMAGE/combined-efi.vmdk := grub-config efi | combined efi | grub-install efi | qemu-image vmdk + IMAGE/combined-efi.vhdx := grub-config efi | combined efi | grub-install efi | qemu-image vhdx -o subformat=dynamic ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y) IMAGES-y := rootfs.img.gz IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.img.gz @@ -140,6 +142,10 @@ define Device/Default IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vmdk IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vmdk endif + ifeq ($(CONFIG_VHDX_IMAGES),y) + IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vhdx + IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vhdx + endif IMAGES := $$(IMAGES-y) ARTIFACTS := $$(ARTIFACTS-y) SUPPORTED_DEVICES := From 4304799b4abc31e37ed91f6270322de79133dd88 Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Wed, 1 Dec 2021 22:08:23 +0100 Subject: [PATCH 50/78] realtek: update watchdog timer patch The Realtek Otto watchdog timer driver was accepted upstream, and is queued for 5.17. Update the patch's file name, and replace by the final version. Signed-off-by: Sander Vanheule --- ...dog-add-realtek-otto-watchdog-timer.patch} | 67 +++++++++++++------ 1 file changed, 45 insertions(+), 22 deletions(-) rename target/linux/realtek/patches-5.10/{100-watchdog-add-realtek-otto-watchdog-timer.patch => 008-5.17-watchdog-add-realtek-otto-watchdog-timer.patch} (89%) diff --git a/target/linux/realtek/patches-5.10/100-watchdog-add-realtek-otto-watchdog-timer.patch b/target/linux/realtek/patches-5.10/008-5.17-watchdog-add-realtek-otto-watchdog-timer.patch similarity index 89% rename from target/linux/realtek/patches-5.10/100-watchdog-add-realtek-otto-watchdog-timer.patch rename to target/linux/realtek/patches-5.10/008-5.17-watchdog-add-realtek-otto-watchdog-timer.patch index fae478a624..9b06a3e318 100644 --- a/target/linux/realtek/patches-5.10/100-watchdog-add-realtek-otto-watchdog-timer.patch +++ b/target/linux/realtek/patches-5.10/008-5.17-watchdog-add-realtek-otto-watchdog-timer.patch @@ -1,10 +1,7 @@ -From 2dbf0c6e0eebf523008c15794434d2d1a9b1260e Mon Sep 17 00:00:00 2001 -Message-Id: <2dbf0c6e0eebf523008c15794434d2d1a9b1260e.1636018117.git.sander@svanheule.net> -In-Reply-To: -References: +From 293903b9dfe43520f01374dc1661be11d6838c49 Mon Sep 17 00:00:00 2001 From: Sander Vanheule -Date: Sun, 3 Oct 2021 09:25:27 +0200 -Subject: [PATCH v3 2/2] watchdog: Add Realtek Otto watchdog timer +Date: Thu, 18 Nov 2021 17:29:52 +0100 +Subject: watchdog: Add Realtek Otto watchdog timer Realtek MIPS SoCs (platform name Otto) have a watchdog timer with pretimeout notifitication support. The WDT can (partially) hard reset, @@ -22,12 +19,15 @@ supported platforms. This means that the phase2 interrupt will only fire at the same time as reset, so implementing phase2 is of little use. Signed-off-by: Sander Vanheule +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/6d060bccbdcc709cfa79203485db85aad3c3beb5.1637252610.git.sander@svanheule.net +Signed-off-by: Guenter Roeck --- MAINTAINERS | 7 + - drivers/watchdog/Kconfig | 13 + + drivers/watchdog/Kconfig | 13 ++ drivers/watchdog/Makefile | 1 + - drivers/watchdog/realtek_otto_wdt.c | 361 ++++++++++++++++++++++++++++ - 4 files changed, 382 insertions(+) + drivers/watchdog/realtek_otto_wdt.c | 384 ++++++++++++++++++++++++++++++++++++ + 4 files changed, 405 insertions(+) create mode 100644 drivers/watchdog/realtek_otto_wdt.c --- a/MAINTAINERS @@ -80,7 +80,7 @@ Signed-off-by: Sander Vanheule --- /dev/null +++ b/drivers/watchdog/realtek_otto_wdt.c -@@ -0,0 +1,361 @@ +@@ -0,0 +1,384 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/* @@ -150,7 +150,7 @@ Signed-off-by: Sander Vanheule + struct watchdog_device wdev; + struct device *dev; + void __iomem *base; -+ struct clk *clk; ++ unsigned int clk_rate_khz; + int irq_phase1; +}; + @@ -189,12 +189,7 @@ Signed-off-by: Sander Vanheule + +static int otto_wdt_tick_ms(struct otto_wdt_ctrl *ctrl, int prescale) +{ -+ unsigned int rate_khz = clk_get_rate(ctrl->clk) / 1000; -+ -+ if (!rate_khz) -+ return 0; -+ -+ return DIV_ROUND_CLOSEST(1 << (25 + prescale), rate_khz); ++ return DIV_ROUND_CLOSEST(1 << (25 + prescale), ctrl->clk_rate_khz); +} + +/* @@ -323,6 +318,34 @@ Signed-off-by: Sander Vanheule + WDIOF_PRETIMEOUT, +}; + ++static void otto_wdt_clock_action(void *data) ++{ ++ clk_disable_unprepare(data); ++} ++ ++static int otto_wdt_probe_clk(struct otto_wdt_ctrl *ctrl) ++{ ++ struct clk *clk = devm_clk_get(ctrl->dev, NULL); ++ int ret; ++ ++ if (IS_ERR(clk)) ++ return dev_err_probe(ctrl->dev, PTR_ERR(clk), "Failed to get clock\n"); ++ ++ ret = clk_prepare_enable(clk); ++ if (ret) ++ return dev_err_probe(ctrl->dev, ret, "Failed to enable clock\n"); ++ ++ ret = devm_add_action_or_reset(ctrl->dev, otto_wdt_clock_action, clk); ++ if (ret) ++ return ret; ++ ++ ctrl->clk_rate_khz = clk_get_rate(clk) / 1000; ++ if (ctrl->clk_rate_khz == 0) ++ return dev_err_probe(ctrl->dev, -ENXIO, "Failed to get clock rate\n"); ++ ++ return 0; ++} ++ +static int otto_wdt_probe_reset_mode(struct otto_wdt_ctrl *ctrl) +{ + static const char *mode_property = "realtek,reset-mode"; @@ -380,13 +403,13 @@ Signed-off-by: Sander Vanheule + ctrl->base + OTTO_WDT_REG_INTR); + iowrite32(OTTO_WDT_CTRL_DEFAULT, ctrl->base + OTTO_WDT_REG_CTRL); + -+ ctrl->clk = devm_clk_get(dev, NULL); -+ if (IS_ERR(ctrl->clk)) -+ return dev_err_probe(dev, PTR_ERR(ctrl->clk), "Failed to get clock\n"); ++ ret = otto_wdt_probe_clk(ctrl); ++ if (ret) ++ return ret; + + ctrl->irq_phase1 = platform_get_irq_byname(pdev, "phase1"); + if (ctrl->irq_phase1 < 0) -+ return dev_err_probe(dev, ctrl->irq_phase1, "phase1 IRQ not found\n"); ++ return ctrl->irq_phase1; + + ret = devm_request_irq(dev, ctrl->irq_phase1, otto_wdt_phase1_isr, 0, + "realtek-otto-wdt", ctrl); @@ -403,7 +426,7 @@ Signed-off-by: Sander Vanheule + + /* + * Since pretimeout cannot be disabled, min. timeout is twice the -+ * subsystem resolution. max. timeout is ca. 43s at a bus clock of 200MHz. ++ * subsystem resolution. Max. timeout is ca. 43s at a bus clock of 200MHz. + */ + ctrl->wdev.min_timeout = 2; + max_tick_ms = otto_wdt_tick_ms(ctrl, OTTO_WDT_PRESCALE_MAX); From afeda4a3d37cf3f9a2001a67e24d0cdbbdbc4cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Mon, 29 Nov 2021 14:18:14 +0100 Subject: [PATCH 51/78] realtek: sort the port list numerically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mac adresses are assigned in the order given by the port list. The interfaces are also brought up in this order. This target supports devices with up to 52 ports. Sorting these alphabetically is very confusing, and assigning mac addresses in alphabetic order does not match stock firmware behaviour. Suggested-by: Sander Vanheule Signed-off-by: Bjørn Mork --- target/linux/realtek/base-files/etc/board.d/02_network | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 93d6d4bd1e..e8e3f6035d 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -17,10 +17,7 @@ ucidef_set_poe() { board=$(board_name) board_config_update -lan_list="" -for lan in /sys/class/net/lan*; do - lan_list="$lan_list $(basename $lan)" -done +lan_list=$(ls -1 -v -d /sys/class/net/lan* | xargs -n1 basename | xargs) ucidef_set_bridge_device switch ucidef_set_interface_lan "$lan_list" From 0f6b6aab2bc9d34b5d516ddf38fb14e8c5d029db Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Mon, 22 Nov 2021 20:59:06 +0100 Subject: [PATCH 52/78] ath79: add support for TP-Link EAP225 v1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TP-Link EAP225 v1 is an AC1200 (802.11ac Wave-1) ceiling mount access point. Device specifications: * SoC: QCA9563 @ 775MHz * RAM: 128MiB DDR2 * Flash: 16MiB SPI-NOR * Wireless 2.4GHz (SoC): b/g/n, 2x2 * Wireless 5Ghz (QCA9882): a/n/ac, 2x2 * Ethernet (AR8033): 1× 1GbE, 802.3at PoE Flashing instructions: * Ensure the device is upgraded to firmware v1.4.0 * Exploit the user management page in the web interface to start telnetd by changing the username to `;/usr/sbin/telnetd -l/bin/sh&`. * Immediately change the malformed username back to something valid (e.g. 'admin') to make ssh work again. * Use the root shell via telnet to make /tmp world writeable (chmod 777) * Extract /usr/bin/uclited from the device via ssh and apply the binary patch listed below. The patch is required to prevent `uclited -u` in the last step from crashing. * Copy the patched uclited binary back to the device at /tmp/uclited (via ssh) * Upload the factory image to /tmp/upgrade.bin (via ssh) * Run `chmod +x /tmp/uclited && /tmp/uclited -u` to install OpenWrt. uclited patching: --- xxd uclited +++ xxd uclited-patched @@ -53811,7 +53811,7 @@ 000d2330: 8c44 0000 0320 f809 0000 0000 8fbc 0010 .D... .......... 000d2340: 8fa6 0a4c 02c0 2821 8f82 87c4 0000 0000 ...L..(!........ -000d2350: 8c44 0000 0c13 461c 27a7 0018 8fbc 0010 .D....F.'....... +000d2350: 8c44 0000 2402 0000 0000 0000 8fbc 0010 .D..$........... 000d2360: 1040 001d 0000 1821 8f99 8378 3c04 0058 .@.....!...x<..X 000d2370: 3c05 0056 2484 ad68 24a5 9f00 0320 f809 <..V$..h$.... .. To make sure the correct file is patched, the following MD5 checksums should match the unpatched and patched files: 4bd74183c23859c897ed77e8566b84de uclited 4107104024a2e0aeaf6395ed30adccae uclited-patched Debricking: * Serial port can be soldered on unpopulated 4-pin header (1: TXD, 2: RXD, 3: GND, 4: VCC) * Bridge unpopulated resistors running from pins 1 (TXD) and 2 (RXD). Do NOT bridge the pull-down for pin 2, running parallel to the header. * Use 3.3V, 115200 baud, 8n1 * Interrupt bootloader by holding CTRL+B during boot * tftp initramfs to flash via the LuCI web interface setenv ipaddr 192.168.1.1 # default, change as required setenv serverip 192.168.1.10 # default, change as required tftp 0x80800000 initramfs.bin bootelf $fileaddr Tested by forum user KernelMaker. Link: https://forum.openwrt.org/t/eap225-v1-firmware/87116 Signed-off-by: Sander Vanheule --- .../ath79/dts/qca9563_tplink_eap225-v1.dts | 51 +++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + target/linux/ath79/image/generic-tp-link.mk | 11 ++++ 4 files changed, 64 insertions(+) create mode 100644 target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts new file mode 100644 index 0000000000..20fd55b409 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include "qca9563_tplink_eap2x5-1port.dtsi" + +/ { + compatible = "tplink,eap225-v1", "qca,qca9563"; + model = "TP-Link EAP225 v1"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_amber; + led-running = &led_status_green; + led-upgrade = &led_status_amber; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: led-0 { + label = "green:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led_status_amber: led-1 { + label = "amber:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: led-2 { + label = "red:status"; + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + led_enable { + gpio-export,name = "leds:enable"; + gpio-export,output = <1>; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 8c09932bd7..11e8d59058 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -65,6 +65,7 @@ ath79_setup_interfaces() tplink,cpe610-v2|\ tplink,cpe710-v1|\ tplink,eap225-outdoor-v1|\ + tplink,eap225-v1|\ tplink,eap225-v3|\ tplink,eap245-v1|\ tplink,re350k-v1|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 1d02da8639..829d042036 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -139,6 +139,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfs 0xf100) 2) ;; + tplink,eap225-v1|\ tplink,eap245-v1|\ tplink,re450-v2|\ tplink,re450-v3|\ diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 363be289c6..ac01767fcc 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -393,6 +393,17 @@ define Device/tplink_eap225-outdoor-v1 endef TARGET_DEVICES += tplink_eap225-outdoor-v1 +define Device/tplink_eap225-v1 + $(Device/tplink-eap2x5) + SOC := qca9563 + IMAGE_SIZE := 13824k + DEVICE_MODEL := EAP225 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + TPLINK_BOARD_ID := EAP225-V1 +endef +TARGET_DEVICES += tplink_eap225-v1 + define Device/tplink_eap225-v3 $(Device/tplink-eap2x5) SOC := qca9563 From 7e89421a7c3855d66a20350a5bf9ca4cc7a2caf9 Mon Sep 17 00:00:00 2001 From: Sergey Ryazanov Date: Tue, 16 Nov 2021 13:10:25 +0300 Subject: [PATCH 53/78] ramips: add support for Zbtlink ZBT-WG1602 Zbtlink ZBT-WG1602 is a Wi-Fi router intendent to use with WWAN (UMTS/LTE/3G/4G) modems. The router board offsers a couple of miniPCIe slots with USB and SIM only and another one pure miniPCIe slot as well as five Gigabit Ethernet ports (4xLAN + WAN). Specification: * SoC: MT7621A * RAM: 256/512 MiB * Flash: 16/32 MiB (SPI NOR) * external watchdog (looks like Torexsemi XC6131B) * Eth: 10/100/1000 Mbps Ethernet x5 ports (4xLAN + WAN) * WLAN 2GHz: MT7603EN (.11n, MIMO 2x2) * WLAN 5GHz: MT7612EN (.11ac, MIMO 2x2) * WLAN Ants: detachable x2, shared by 2GHz & 5GHz radios * miniPCIe: 2x slots with USB&SIM + 1x slot with regular PCIe bus * WWAN Ants: detachable x4 * External storage: microSD (SDXC) slot * USB: 2.0 Type-A port * LED: 11 (5 per Eth phy, 3 SoC controlled, 2 WLAN 2/5 controlled, 1 power indicator) * Button: 1 (reset) * UART: console (115200 baud) * Power: DC jack (12 V / 2.5 A) Additional HW information: * SoC USB port #1 is shared by internal miniPCIe slot and external Type-A USB port, USB D+/D- lines are toggled between ports using a GPIO controlled DPDT switch. * Power of the USB enabled miniPCIe slots can be individually controlled using dedicated GPIO lines. * Vendor firmware feeds the external watchdog with 1s pulses. GPIO watchdog driver is able to either generate a 1us pulses or toggle the output line. 1us is not enough for the external watchod timer, so the line toggling driver mode is utilized. Installation: Vendor's firmware is OpenWrt (LEDE) based, so the sysupgrade image can be directly used to install OpenWrt. Firmware must be upgraded using the 'force' and 'do not save configuration' command line options (or correspondig web interface checkboxes) since the vendor firmware is from the pre-DSA era. Signed-off-by: Sergey Ryazanov --- .../dts/mt7621_zbtlink_zbt-wg1602-16m.dts | 10 + .../ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi | 206 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 12 + 3 files changed, 228 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-16m.dts create mode 100644 target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-16m.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-16m.dts new file mode 100644 index 0000000000..216c7b3cf0 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-16m.dts @@ -0,0 +1,10 @@ +#include "mt7621_zbtlink_zbt-wg1602.dtsi" + +/ { + compatible = "zbtlink,zbt-wg1602-16m", "zbtlink,zbt-wg1602", "mediatek,mt7621-soc"; + model = "Zbtlink ZBT-WG1602 (16M)"; +}; + +&firmware { + reg = <0x50000 0xfb0000>; +}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi new file mode 100644 index 0000000000..e377a13444 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi @@ -0,0 +1,206 @@ +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "zbtlink,zbt-wg1602", "mediatek,mt7621-soc"; + + aliases { + led-boot = &led_sm; + led-failsafe = &led_sm; + led-running = &led_sm; + led-upgrade = &led_sm; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_sm: sm { + label = "green:sm"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + 4g1 { + label = "green:4g1"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + }; + + 4g2 { + label = "green:4g2"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + hw_algo = "toggle"; + /* hw_margin_ms is actually ~120s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + 4g1-pwr { + gpio-export,name = "4g1-pwr"; + gpio-export,output = <1>; + gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; + }; + + 4g2-pwr { + gpio-export,name = "4g2-pwr"; + gpio-export,output = <1>; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + }; + + ext-usb { + gpio-export,name = "ext-usb"; + gpio-export,output = <1>; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&sdhci { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi0: wifi@0,0 { + compatible = "pci14c3,7603"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + }; +}; + +&pcie1 { + wifi1: wifi@0,0 { + compatible = "pci14c3,7662"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + }; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + + port@4 { + status = "okay"; + label = "wan"; + nvmem-cells = <&macaddr_factory_e006>; + nvmem-cell-names = "mac-address"; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "rgmii2", "uart2", "wdt"; + function = "gpio"; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 2b08efc468..8b156c2a1c 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1700,6 +1700,18 @@ define Device/zbtlink_zbt-we3526 endef TARGET_DEVICES += zbtlink_zbt-we3526 +define Device/zbtlink_zbt-wg1602-16m + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-WG1602 + DEVICE_VARIANT := 16M + DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 kmod-usb3 \ + kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += zbtlink_zbt-wg1602-16m + define Device/zbtlink_zbt-wg2626 $(Device/dsa-migration) $(Device/uimage-lzma-loader) From 8261b85844a0018c6c79e10c1abb581aca102e45 Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Thu, 2 Dec 2021 19:02:23 +0300 Subject: [PATCH 54/78] tools/mkimage: fix build on MacOS arm64 Fixed -no-pie compilation warning on MacOS Fixed errors related to using absolute addressing on MacOS arm64 Based on upstream patch from Jessica Clarke and suggestions from Ronny Kotzschmar Link to original patch and discussion: https://github.com/u-boot/u-boot/commit/3b142045e8a7f0ab17b6099e9226296af45967d0 Signed-off-by: Sergey V. Lobanov --- .../patches/090-macos-arm64-builing-fix.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tools/mkimage/patches/090-macos-arm64-builing-fix.patch diff --git a/tools/mkimage/patches/090-macos-arm64-builing-fix.patch b/tools/mkimage/patches/090-macos-arm64-builing-fix.patch new file mode 100644 index 0000000000..216a8abd35 --- /dev/null +++ b/tools/mkimage/patches/090-macos-arm64-builing-fix.patch @@ -0,0 +1,47 @@ +This patch fixes compilation issues on MacOS arm64. +Based on discussion +https://github.com/u-boot/u-boot/commit/3b142045e8a7f0ab17b6099e9226296af45967d0 + +diff --git a/Makefile b/Makefile +index b4f1cbc..551041f 100644 +--- a/Makefile ++++ b/Makefile +@@ -324,11 +324,6 @@ HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc") + KBUILD_HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp") + KBUILD_HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress") + +-# since Lion (10.7) ASLR is on by default, but we use linker generated lists +-# in some host tools which is a problem then ... so disable ASLR for these +-# tools +-KBUILD_HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie") +- + # macOS Mojave (10.14.X) + # Undefined symbols for architecture x86_64: "_PyArg_ParseTuple" + KBUILD_HOSTLDFLAGS += $(call os_x_after, 10, 14, "-lpython -dynamclib", "") +diff --git a/tools/imagetool.h b/tools/imagetool.h +index 8726792..d1b72ef 100644 +--- a/tools/imagetool.h ++++ b/tools/imagetool.h +@@ -270,17 +270,20 @@ int rockchip_copy_image(int fd, struct image_tool_params *mparams); + * b) we need a API call to get the respective section symbols */ + #if defined(__MACH__) + #include ++#include + + #define INIT_SECTION(name) do { \ + unsigned long name ## _len; \ +- char *__cat(pstart_, name) = getsectdata("__TEXT", \ ++ char *__cat(pstart_, name) = getsectdata("__DATA", \ + #name, &__cat(name, _len)); \ ++ __cat(pstart_, name) += \ ++ _dyld_get_image_vmaddr_slide(0); \ + char *__cat(pstop_, name) = __cat(pstart_, name) + \ + __cat(name, _len); \ + __cat(__start_, name) = (void *)__cat(pstart_, name); \ + __cat(__stop_, name) = (void *)__cat(pstop_, name); \ + } while (0) +-#define SECTION(name) __attribute__((section("__TEXT, " #name))) ++#define SECTION(name) __attribute__((section("__DATA, " #name))) + + struct image_type_params **__start_image_type, **__stop_image_type; + #else From 5b66dfaf6c53ac21285cbabd8935666d34d6378a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 7 Dec 2021 11:06:16 +0100 Subject: [PATCH 55/78] hostapd: enable FILS support in the full config and add build feature discovery Signed-off-by: Felix Fietkau --- .../hostapd/files/hostapd-full.config | 2 +- .../hostapd/files/wpa_supplicant-full.config | 2 +- .../hostapd/files/wpa_supplicant-p2p.config | 2 +- .../hostapd/patches/050-build_fix.patch | 20 +++++++++++++++++++ .../hostapd/patches/200-multicall.patch | 20 +++++++++---------- .../patches/380-disable_ctrl_iface_mib.patch | 2 +- .../patches/500-lto-jobserver-support.patch | 6 +++--- .../hostapd/patches/600-ubus_support.patch | 2 +- .../hostapd/src/src/utils/build_features.h | 4 ++++ 9 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 package/network/services/hostapd/patches/050-build_fix.patch diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index 6d5e90cd46..dbc2022550 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -60,7 +60,7 @@ CONFIG_RSN_PREAUTH=y CONFIG_EAP=y # EAP Re-authentication Protocol (ERP) in integrated EAP server -#CONFIG_ERP=y +CONFIG_ERP=y # EAP-MD5 for the integrated EAP server CONFIG_EAP_MD5=y diff --git a/package/network/services/hostapd/files/wpa_supplicant-full.config b/package/network/services/hostapd/files/wpa_supplicant-full.config index b3e85d073d..de3302c875 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-full.config +++ b/package/network/services/hostapd/files/wpa_supplicant-full.config @@ -578,7 +578,7 @@ CONFIG_HS20=y #CONFIG_MBO=y # Fast Initial Link Setup (FILS) (IEEE 802.11ai) -#CONFIG_FILS=y +CONFIG_FILS=y # FILS shared key authentication with PFS #CONFIG_FILS_SK_PFS=y diff --git a/package/network/services/hostapd/files/wpa_supplicant-p2p.config b/package/network/services/hostapd/files/wpa_supplicant-p2p.config index b00847a256..48302bb4c3 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-p2p.config +++ b/package/network/services/hostapd/files/wpa_supplicant-p2p.config @@ -578,7 +578,7 @@ CONFIG_P2P=y #CONFIG_MBO=y # Fast Initial Link Setup (FILS) (IEEE 802.11ai) -#CONFIG_FILS=y +CONFIG_FILS=y # FILS shared key authentication with PFS #CONFIG_FILS_SK_PFS=y diff --git a/package/network/services/hostapd/patches/050-build_fix.patch b/package/network/services/hostapd/patches/050-build_fix.patch new file mode 100644 index 0000000000..3da88fe290 --- /dev/null +++ b/package/network/services/hostapd/patches/050-build_fix.patch @@ -0,0 +1,20 @@ +--- a/hostapd/Makefile ++++ b/hostapd/Makefile +@@ -323,6 +323,7 @@ ifdef CONFIG_FILS + CFLAGS += -DCONFIG_FILS + OBJS += ../src/ap/fils_hlp.o + NEED_SHA384=y ++NEED_HMAC_SHA384_KDF=y + NEED_AES_SIV=y + ifdef CONFIG_FILS_SK_PFS + CFLAGS += -DCONFIG_FILS_SK_PFS +--- a/wpa_supplicant/Makefile ++++ b/wpa_supplicant/Makefile +@@ -309,6 +309,7 @@ endif + ifdef CONFIG_FILS + CFLAGS += -DCONFIG_FILS + NEED_SHA384=y ++NEED_HMAC_SHA384_KDF=y + NEED_AES_SIV=y + ifdef CONFIG_FILS_SK_PFS + CFLAGS += -DCONFIG_FILS_SK_PFS diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index 8dce260871..ceeaf5169b 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -18,7 +18,7 @@ OBJS += ../src/ap/vlan_init.o OBJS += ../src/ap/vlan_ifconfig.o OBJS += ../src/ap/vlan.o -@@ -349,10 +351,14 @@ CFLAGS += -DCONFIG_MBO +@@ -350,10 +352,14 @@ CFLAGS += -DCONFIG_MBO OBJS += ../src/ap/mbo_ap.o endif @@ -36,7 +36,7 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -1277,6 +1283,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) +@@ -1278,6 +1284,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) _OBJS_VAR := OBJS include ../src/objs.mk @@ -49,7 +49,7 @@ hostapd: $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -1351,6 +1363,12 @@ include ../src/objs.mk +@@ -1352,6 +1364,12 @@ include ../src/objs.mk _OBJS_VAR := SOBJS include ../src/objs.mk @@ -72,7 +72,7 @@ include ../src/build.rules ifdef LIBS -@@ -359,7 +360,9 @@ endif +@@ -360,7 +361,9 @@ endif ifdef CONFIG_IBSS_RSN NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_IBSS_RSN @@ -82,7 +82,7 @@ OBJS += ibss_rsn.o endif -@@ -897,6 +900,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS +@@ -898,6 +901,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -93,7 +93,7 @@ endif ifdef CONFIG_AP -@@ -904,9 +911,11 @@ NEED_EAP_COMMON=y +@@ -905,9 +912,11 @@ NEED_EAP_COMMON=y NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_AP OBJS += ap.o @@ -105,7 +105,7 @@ OBJS += ../src/ap/hostapd.o OBJS += ../src/ap/wpa_auth_glue.o OBJS += ../src/ap/utils.o -@@ -986,6 +995,12 @@ endif +@@ -987,6 +996,12 @@ endif ifdef CONFIG_HS20 OBJS += ../src/ap/hs20.o endif @@ -118,7 +118,7 @@ endif ifdef CONFIG_MBO -@@ -994,7 +1009,9 @@ CFLAGS += -DCONFIG_MBO +@@ -995,7 +1010,9 @@ CFLAGS += -DCONFIG_MBO endif ifdef NEED_RSN_AUTHENTICATOR @@ -128,7 +128,7 @@ NEED_AES_WRAP=y OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth_ie.o -@@ -1889,6 +1906,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) +@@ -1890,6 +1907,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) _OBJS_VAR := OBJS include ../src/objs.mk @@ -141,7 +141,7 @@ wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -2021,6 +2044,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK) +@@ -2022,6 +2045,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK) $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ @$(E) " sed" $< diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch index ca634077b7..0297a603c4 100644 --- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -30,7 +30,7 @@ reply_len = -1; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -955,6 +955,9 @@ ifdef CONFIG_FILS +@@ -956,6 +956,9 @@ ifdef CONFIG_FILS OBJS += ../src/ap/fils_hlp.o endif ifdef CONFIG_CTRL_IFACE diff --git a/package/network/services/hostapd/patches/500-lto-jobserver-support.patch b/package/network/services/hostapd/patches/500-lto-jobserver-support.patch index 1475590d06..3f741cdf34 100644 --- a/package/network/services/hostapd/patches/500-lto-jobserver-support.patch +++ b/package/network/services/hostapd/patches/500-lto-jobserver-support.patch @@ -1,6 +1,6 @@ --- a/hostapd/Makefile +++ b/hostapd/Makefile -@@ -1293,7 +1293,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) +@@ -1294,7 +1294,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) @$(AR) cr $@ hostapd_multi.o $(OBJS) hostapd: $(OBJS) @@ -9,7 +9,7 @@ @$(E) " LD " $@ ifdef CONFIG_WPA_TRACE -@@ -1304,7 +1304,7 @@ _OBJS_VAR := OBJS_c +@@ -1305,7 +1305,7 @@ _OBJS_VAR := OBJS_c include ../src/objs.mk hostapd_cli: $(OBJS_c) @@ -20,7 +20,7 @@ NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -1918,31 +1918,31 @@ wpa_supplicant_multi.a: .config $(BCHECK +@@ -1919,31 +1919,31 @@ wpa_supplicant_multi.a: .config $(BCHECK @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 358c53167a..bf2f8a52d1 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -283,7 +283,7 @@ ifdef CONFIG_CODE_COVERAGE CFLAGS += -O0 -fprofile-arcs -ftest-coverage LIBS += -lgcov -@@ -959,6 +965,9 @@ ifdef CONFIG_CTRL_IFACE_MIB +@@ -960,6 +966,9 @@ ifdef CONFIG_CTRL_IFACE_MIB CFLAGS += -DCONFIG_CTRL_IFACE_MIB endif OBJS += ../src/ap/ctrl_iface_ap.o diff --git a/package/network/services/hostapd/src/src/utils/build_features.h b/package/network/services/hostapd/src/src/utils/build_features.h index 3ab5246c78..cb7cb72731 100644 --- a/package/network/services/hostapd/src/src/utils/build_features.h +++ b/package/network/services/hostapd/src/src/utils/build_features.h @@ -50,6 +50,10 @@ static inline int has_feature(const char *feat) #ifdef CONFIG_WPS if (!strcmp(feat, "wps")) return 1; +#endif +#ifdef CONFIG_FILS + if (!strcmp(feat, "fils")) + return 1; #endif return 0; } From b7d9bced3056d37857292670ed1a29084ecb0aa1 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 7 Dec 2021 14:47:40 +0100 Subject: [PATCH 56/78] hostapd: add support for enabling FILS on AP and client interfaces This is only supported with WPA-enterprise Signed-off-by: Felix Fietkau --- .../network/services/hostapd/files/hostapd.sh | 41 +++++++++++++++++-- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index b4aa5e4c85..30d1418789 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -72,6 +72,15 @@ hostapd_append_wpa_key_mgmt() { ;; esac + [ "$fils" -gt 0 ] && { + case "$auth_type" in + eap*) + append wpa_key_mgmt FILS-SHA256 + [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt FT-FILS-SHA256 + ;; + esac + } + [ "$auth_osen" = "1" ] && append wpa_key_mgmt "OSEN" } @@ -359,6 +368,8 @@ hostapd_common_add_bss_config() { config_add_int eap_server config_add_string eap_user_file ca_cert server_cert private_key private_key_passwd server_id + + config_add_boolean fils } hostapd_set_vlan_file() { @@ -531,8 +542,9 @@ hostapd_set_bss_options() { airtime_bss_weight airtime_bss_limit airtime_sta_weight \ multicast_to_unicast proxy_arp per_sta_vif \ eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id \ - vendor_elements + vendor_elements fils + set_default fils 0 set_default isolate 0 set_default maxassoc 0 set_default max_inactivity 0 @@ -554,6 +566,8 @@ hostapd_set_bss_options() { set_default airtime_bss_limit 0 set_default eap_server 0 + /usr/sbin/hostapd -vfils || fils=0 + append bss_conf "ctrl_interface=/var/run/hostapd" if [ "$isolate" -gt 0 ]; then append bss_conf "ap_isolate=$isolate" "$N" @@ -654,7 +668,9 @@ hostapd_set_bss_options() { auth_server auth_secret auth_port \ dae_client dae_secret dae_port \ ownip radius_client_addr \ - eap_reauth_period request_cui + eap_reauth_period request_cui \ + erp_domain mobility_domain \ + fils_realm # radius can provide VLAN ID for clients vlan_possible=1 @@ -664,6 +680,17 @@ hostapd_set_bss_options() { [ -n "$auth_port" ] || json_get_var auth_port port [ -n "$auth_secret" ] || json_get_var auth_secret key + [ "$fils" -gt 0 ] && { + set_default erp_domain "$mobility_domain" + set_default erp_domain "$(echo "$ssid" | md5sum | head -c 8)" + set_default fils_realm "$erp_domain" + + append bss_conf "erp_send_reauth_start=1" "$N" + append bss_conf "erp_domain=$erp_domain" "$N" + append bss_conf "fils_realm=$fils_realm" "$N" + append bss_conf "fils_cache_id=$(echo "$fils_realm" | md5sum | head -c 4)" "$N" + } + set_default auth_port 1812 set_default dae_port 3799 set_default request_cui 0 @@ -853,6 +880,10 @@ hostapd_set_bss_options() { done fi fi + if [ "$fils" -gt 0 ]; then + json_get_vars fils_realm + set_default fils_realm "$(echo "$ssid" | md5sum | head -c 8)" + fi append bss_conf "wpa_disable_eapol_key_retries=$wpa_disable_eapol_key_retries" "$N" @@ -877,7 +908,7 @@ hostapd_set_bss_options() { fi append bss_conf "okc=$auth_cache" "$N" - [ "$auth_cache" = 0 ] && append bss_conf "disable_pmksa_caching=1" "$N" + [ "$auth_cache" = 0 -a "$fils" = 0 ] && append bss_conf "disable_pmksa_caching=1" "$N" # RSN -> allow management frame protection case "$ieee80211w" in @@ -1031,6 +1062,7 @@ hostapd_set_bss_options() { if [ "$eap_server" = "1" ]; then append bss_conf "eap_server=1" "$N" + append bss_conf "eap_server_erp=1" "$N" [ -n "$eap_user_file" ] && append bss_conf "eap_user_file=$eap_user_file" "$N" [ -n "$ca_cert" ] && append bss_conf "ca_cert=$ca_cert" "$N" [ -n "$server_cert" ] && append bss_conf "server_cert=$server_cert" "$N" @@ -1197,7 +1229,7 @@ wpa_supplicant_add_network() { json_get_vars \ ssid bssid key \ basic_rate mcast_rate \ - ieee80211w ieee80211r \ + ieee80211w ieee80211r fils \ multi_ap \ default_disabled @@ -1289,6 +1321,7 @@ wpa_supplicant_add_network() { json_get_vars eap_type identity anonymous_identity ca_cert ca_cert_usesystem + [ "$fils" -gt 0 ] && append network_data "erp=1" "$N$T" if [ "$ca_cert_usesystem" -eq "1" -a -f "/etc/ssl/certs/ca-certificates.crt" ]; then append network_data "ca_cert=\"/etc/ssl/certs/ca-certificates.crt\"" "$N$T" else From baba2fdaa60c2f2426ec09eaacd6dfb7cec3fd2c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 10 Dec 2021 10:16:18 +0100 Subject: [PATCH 57/78] netifd: on dhcp interfaces, store the dhcp server in interface data Among other things, this can be used to auto-configure the DHCP server address for wireless APs using FILS, if the bridged interface is configured to DHCP Signed-off-by: Felix Fietkau --- package/network/config/netifd/files/lib/netifd/dhcp.script | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script index e46005d84c..6fcf139beb 100755 --- a/package/network/config/netifd/files/lib/netifd/dhcp.script +++ b/package/network/config/netifd/files/lib/netifd/dhcp.script @@ -60,6 +60,7 @@ setup_interface () { [ -n "$message" ] && json_add_string message "$message" [ -n "$timezone" ] && json_add_int timezone "$timezone" [ -n "$lease" ] && json_add_int leasetime "$lease" + [ -n "$serverid" ] && json_add_string dhcpserver "$serverid" proto_close_data proto_send_update "$INTERFACE" From ea49690ff47d14ee096d7c1368cff03f1cce1d76 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 10 Dec 2021 11:30:40 +0100 Subject: [PATCH 58/78] hostapd: add support for specifying the FILS DHCP server The 'fils_dhcp' option can be set to '*' in order to autodetect the DHCP server For proto=dhcp networks, the discovered dhcp server will be used For all other networks, udhcpc is called to discover the address Signed-off-by: Felix Fietkau --- package/network/services/hostapd/Makefile | 1 + .../services/hostapd/files/dhcp-get-server.sh | 2 ++ .../network/services/hostapd/files/hostapd.sh | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 package/network/services/hostapd/files/dhcp-get-server.sh diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 12e200be3e..7e4056bb18 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -601,6 +601,7 @@ endef define Package/hostapd-common/install $(INSTALL_DIR) $(1)/etc/capabilities $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d $(1)/lib/netifd $(1)/usr/share/acl.d + $(INSTALL_BIN) ./files/dhcp-get-server.sh $(1)/lib/netifd/dhcp-get-server.sh $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh $(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad $(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps diff --git a/package/network/services/hostapd/files/dhcp-get-server.sh b/package/network/services/hostapd/files/dhcp-get-server.sh new file mode 100644 index 0000000000..a1509ace2f --- /dev/null +++ b/package/network/services/hostapd/files/dhcp-get-server.sh @@ -0,0 +1,2 @@ +#!/bin/sh +[ "$1" = bound ] && echo "$serverid" diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 30d1418789..d9d5f34877 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -370,6 +370,7 @@ hostapd_common_add_bss_config() { config_add_string eap_user_file ca_cert server_cert private_key private_key_passwd server_id config_add_boolean fils + config_add_string fils_dhcp } hostapd_set_vlan_file() { @@ -670,7 +671,7 @@ hostapd_set_bss_options() { ownip radius_client_addr \ eap_reauth_period request_cui \ erp_domain mobility_domain \ - fils_realm + fils_realm fils_dhcp # radius can provide VLAN ID for clients vlan_possible=1 @@ -689,6 +690,19 @@ hostapd_set_bss_options() { append bss_conf "erp_domain=$erp_domain" "$N" append bss_conf "fils_realm=$fils_realm" "$N" append bss_conf "fils_cache_id=$(echo "$fils_realm" | md5sum | head -c 4)" "$N" + + [ "$fils_dhcp" = "*" ] && { + json_get_values network network + fils_dhcp= + for net in $network; do + fils_dhcp="$(ifstatus "$net" | jsonfilter -e '@.data.dhcpserver')" + [ -n "$fils_dhcp" ] && break + done + + [ -z "$fils_dhcp" -a -n "$network_bridge" -a -n "$network_ifname" ] && \ + fils_dhcp="$(udhcpc -B -n -q -s /lib/netifd/dhcp-get-server.sh -t 1 -i "$network_ifname" 2>/dev/null)" + } + [ -n "$fils_dhcp" ] && append bss_conf "dhcp_server=$fils_dhcp" "$N" } set_default auth_port 1812 From 1c4b3ce344ff71641defe989457060b72885e27e Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Sun, 17 Oct 2021 13:29:57 +0200 Subject: [PATCH 59/78] kernel: add more disabled config options NET_DSA_MSCC_FELIX: Marvell 88E6xxx Ethernet switch fabric support (NET_DSA_MV88E6XXX) [N/m/y/?] n Ocelot / Felix Ethernet switch support (NET_DSA_MSCC_FELIX) [N/m/y/?] (NEW) Error in reading or end of file. make[6]: *** [scripts/kconfig/Makefile:71: syncconfig] Error 1 make[5]: *** [Makefile:603: syncconfig] Error 2 IR_IMON_RAW: SoundGraph iMON Receiver (early raw IR models) (IR_IMON_RAW) [N/m/?] (NEW) Signed-off-by: Josef Schlehofer [squashed with "kernel: add missing IR_IMON_RAW config symbol"] Signed-off-by: Christian Lamparter --- target/linux/generic/config-5.10 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index a803ba36d7..dbe3fb91d4 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -2766,6 +2766,7 @@ CONFIG_IP_VS_MH_TAB_INDEX=10 # CONFIG_IR_IGUANA is not set # CONFIG_IR_IMG is not set # CONFIG_IR_IMON is not set +# CONFIG_IR_IMON_RAW is not set # CONFIG_IR_JVC_DECODER is not set # CONFIG_IR_LIRC_CODEC is not set # CONFIG_IR_MCEUSB is not set @@ -3831,6 +3832,7 @@ CONFIG_NET_CORE=y # CONFIG_NET_DSA_LOOP is not set # CONFIG_NET_DSA_MICROCHIP_KSZ8795 is not set # CONFIG_NET_DSA_MICROCHIP_KSZ9477 is not set +# CONFIG_NET_DSA_MSCC_FELIX is not set # CONFIG_NET_DSA_MSCC_SEVILLE is not set # CONFIG_NET_DSA_MT7530 is not set # CONFIG_NET_DSA_MV88E6060 is not set From ffab23d99d980974e502989994f3aaec3f462865 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Sun, 5 Dec 2021 22:32:04 +0000 Subject: [PATCH 60/78] x86: add/improve support for Sophos SG/XG products * Better product ID for Sophos SG/XG-105 models * Add support for Sophos SG/XG-135 r1, r2 with/without wireless Signed-off-by: Stan Grishin [Changed subject to x86 - probably eaten somewhere, the PR had it] Signed-off-by: Christian Lamparter --- target/linux/x86/base-files/etc/board.d/02_network | 9 ++++++++- target/linux/x86/base-files/lib/preinit/01_sysinfo | 8 +++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network index 2a07518096..21238a5df1 100644 --- a/target/linux/x86/base-files/etc/board.d/02_network +++ b/target/linux/x86/base-files/etc/board.d/02_network @@ -17,9 +17,16 @@ pc-engines-apu1|pc-engines-apu2|pc-engines-apu3) roqos-roqos-core-rc10) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; -sophos-sg-105|sophos-xg-105) +sophos-sg-105r1|sophos-xg-105r1| \ +sophos-sg-105r2|sophos-xg-105r2) ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1" ;; +sophos-sg-135r1|sophos-xg-135r1| \ +sophos-sg-135Wr1|sophos-xg-135Wr1| \ +sophos-sg-135r2|sophos-xg-135r2| \ +sophos-sg-135Wr2|sophos-xg-135Wr2) + ucidef_set_interfaces_lan_wan "eth0 eth2 eth3 eth4 eth5 eth6 eth7" "eth1" + ;; traverse-technologies-geos) ucidef_set_interface_lan "eth0 eth1" ucidef_add_atm_bridge "0" "35" "llc" "bridged" diff --git a/target/linux/x86/base-files/lib/preinit/01_sysinfo b/target/linux/x86/base-files/lib/preinit/01_sysinfo index 682ce4a5bb..0687f4ca13 100644 --- a/target/linux/x86/base-files/lib/preinit/01_sysinfo +++ b/target/linux/x86/base-files/lib/preinit/01_sysinfo @@ -23,9 +23,11 @@ do_sysinfo_x86() { break ;; "Sophos:SG"|"Sophos:XG") - case "$(cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null)" in - 105*) - product="${product}-105" + local product_version + product_version="$(cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null)" + case "$product_version" in + 105*|135*) + product="${product}-${product_version}" break ;; esac From 4deaeaa13cbcd3c4b94c69e96d7e507f201ea4cc Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 4 Dec 2021 21:52:22 +0100 Subject: [PATCH 61/78] x86: remove old lzma tuning patch Chen Minqiang reported in his GitHub PR #4733 that: With CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA=y option set, the popular x86/amd64 target's initramfs-kernel failed to boot. The cause for this boot failure is that the LZMA compression uses a the first bytes to encode the compression parameters. It does not have a fixed magic. Yes, this only works if the the existing lzma options in the upstream are not changed. This patch does away with OpenWrt special LZMA options tuning since it is rather unlikely that upstream will improve the compression algorithm detection after all this time. Even though, the tuning produced a smaller initramfs (~1.1% in a spot check). Link: Reported-by: Chen Minqiang Signed-off-by: Christian Lamparter --- .../patches-5.10/011-tune_lzma_options.patch | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 target/linux/x86/patches-5.10/011-tune_lzma_options.patch diff --git a/target/linux/x86/patches-5.10/011-tune_lzma_options.patch b/target/linux/x86/patches-5.10/011-tune_lzma_options.patch deleted file mode 100644 index c19e1f54db..0000000000 --- a/target/linux/x86/patches-5.10/011-tune_lzma_options.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/scripts/Makefile.lib -+++ b/scripts/Makefile.lib -@@ -370,7 +370,7 @@ quiet_cmd_bzip2 = BZIP2 $@ - # --------------------------------------------------------------------------- - - quiet_cmd_lzma = LZMA $@ -- cmd_lzma = { cat $(real-prereqs) | $(LZMA) e -d20 -lc1 -lp2 -pb2 -eos -si -so; $(size_append); } > $@ -+ cmd_lzma = { cat $(real-prereqs) | $(LZMA) e -lc8 -eos -si -so; $(size_append); } > $@ - - quiet_cmd_lzo = LZO $@ - cmd_lzo = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@ ---- a/arch/x86/include/asm/boot.h -+++ b/arch/x86/include/asm/boot.h -@@ -24,7 +24,7 @@ - # error "Invalid value for CONFIG_PHYSICAL_ALIGN" - #endif - --#if defined(CONFIG_KERNEL_BZIP2) -+#if defined(CONFIG_KERNEL_BZIP2) || defined(CONFIG_KERNEL_LZMA) - # define BOOT_HEAP_SIZE 0x400000 - #elif defined(CONFIG_KERNEL_ZSTD) - /* From 7853453950bf47b518673dc50b61903cd48c9081 Mon Sep 17 00:00:00 2001 From: Olivier Valentin Date: Thu, 2 Dec 2021 17:05:18 +0100 Subject: [PATCH 62/78] ath79: add support for jjPlus JWAP230 The jjPlus JWAP230 is an access point board built around the QCA9558, with built-in 2.4GHz 3x3 N WiFi (28dBm). It can be expanded with 2 mini-PCIe boards, and has an USB2 root port. Specifications: - SOC: Qualcomm Atheros QCA9558 - CPU: 720MHz - H/W switch: QCA8327 rev 2 - Flash: 16 MiB SPI NOR (en25qh128) - RAM: 128 MiB DDR2 - WLAN: AR9550 built-in SoC bgn 3T3R (ath9k) - PCI: 2x mini-PCIe (optional 5V) - LEDs: 6x LEDs (3 are currently available) - Button: 1x Reset (not yet defined) - USB2: - 1x Type A root port - 1x combined mini-PCIe - Ethernet: - 2x 10/100/1000 (1x PoE 802.3af (36-57 V)) Notes: The device used to be supported in the ar71xx target. For upgrades: Please use "sysupgrade --force -n ". This will restore the device back to OpenWrt defaults! MAC address assignment: use source LAN art 0x0 WAN art 0x6 WLAN art 0x1002 (as part of the calibration data) Flash instructions: - install from u-boot with tftp (requires serial access) > setenv ipaddr a.b.c.d > setenv serverip e.f.g.h > tftp 0x80060000 \ openwrt-ath79-generic-jjplus_jwap230-squashfs-sysupgrade.bin > erase 0x9f050000 +${filesize} > cp.b $fileaddr 0x9f050000 $filesize > setenv bootcmd bootm 0x9f050000 > saveenv Signed-off-by: Olivier Valentin [Added DT-Leds (based on ar71xx), Added more notes about sysupgrade, fixed "qca9550" to match SoC in commit and dts file name] Signed-off-by: Christian Lamparter --- .../ath79/dts/qca9558_jjplus_jwap230.dts | 183 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 4 + target/linux/ath79/image/generic.mk | 8 + 3 files changed, 195 insertions(+) create mode 100644 target/linux/ath79/dts/qca9558_jjplus_jwap230.dts diff --git a/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts b/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts new file mode 100644 index 0000000000..159013066f --- /dev/null +++ b/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts @@ -0,0 +1,183 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include +#include + +/ { + model = "jjPlus JWAP230"; + compatible = "jjplus,jwap230", "qca,qca9558"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led_power: led-0 { + label = "green:power"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + + led-1 { + color = ; + function-enumerator = <0>; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + led-2 { + color = ; + function-enumerator = <1>; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&pcie1 { + 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>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xfa0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_lan: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_wan: macaddr@6 { + reg = <0x6 0x6>; + }; + + calibration_art_wlan: calibration@1000 { + reg = <0x1000 0x440>; + }; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + switch { + compatible = "qca,ar8327"; + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x58 0xffb7ffb7 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */ + 0x94 0x0000007e /* PORT6_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_wan>; + nvmem-cell-names = "mac-address"; + + pll-data = <0xae000000 0x80000101 0x80001313>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + + gmac_config: gmac-config { + device = <&gmac>; + + rxdv-delay = <3>; + rxd-delay = <3>; + txen-delay = <0>; + txd-delay = <0>; + rgmii-enabled = <1>; + }; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_art_lan>; + nvmem-cell-names = "mac-address"; + + pll-data = <0x03000101 0x00000101 0x00001313>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&wmac { + status = "okay"; + nvmem-cells = <&calibration_art_wlan>; + nvmem-cell-names = "calibration"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 11e8d59058..45b002330e 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -306,6 +306,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" ;; + jjplus,jwap230) + ucidef_add_switch "switch0" \ + "0@eth0" "5:wan:1" "1:lan:2" "6@eth1" + ;; joyit,jt-or750i) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index c259db94af..cff4b98eae 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1407,6 +1407,14 @@ define Device/jjplus_ja76pf2 endef TARGET_DEVICES += jjplus_ja76pf2 +define Device/jjplus_jwap230 + SOC := qca9558 + DEVICE_VENDOR := jjPlus + DEVICE_MODEL := JWAP230 + IMAGE_SIZE := 16000k +endef +TARGET_DEVICES += jjplus_jwap230 + define Device/joyit_jt-or750i SOC := qca9531 DEVICE_VENDOR := Joy-IT From 35aecc9d4a735c36d5eefe6e821c5930f736635f Mon Sep 17 00:00:00 2001 From: Ryan Mounce Date: Tue, 16 Nov 2021 21:55:19 +1030 Subject: [PATCH 63/78] ath79: add support for WD My Net N600 SoC: AR9344 RAM: 128MB Flash: 16MiB SPI NOR 5GHz WiFi: AR9382 PCIe 2x2:2 802.11n 2.4GHz WiFi: AR9344 (SoC) AHB 2x2:2 802.11n 5x Fast ethernet via SoC switch (green LEDs) 1x USB 2.0 4x front LEDs from SoC GPIO 1x front WPS button from SoC GPIO 1x bottom reset button from SoC GPIO UART header JP1, 115200 no parity 1 stop TX GND VCC (N/P) RX Flash factory image via "emergency room" recovery: - Configure your computer with a static IP 192.168.1.123/24 - Connect to LAN port on the N600 switch - Hold reset putton - Power on, holding reset until the power LED blinks slowly - Visit http://192.168.1.1/ and upload OpenWrt factory image - Wait at least 5 minutes for flashing, reboot and key generation - Visit http://192.168.1.1/ (OpenWrt LuCI) and upload OpenWrt sysupgrade image Signed-off-by: Ryan Mounce [dt leds preparations] Signed-off-by: Christian Lamparter --- .../linux/ath79/dts/ar9344_wd_mynet-n600.dts | 108 ++++++++++++++++++ .../linux/ath79/dts/ar9344_wd_mynet-n750.dts | 89 +-------------- .../linux/ath79/dts/ar9344_wd_mynet-nxxx.dtsi | 88 ++++++++++++++ .../generic/base-files/etc/board.d/02_network | 4 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 2 + target/linux/ath79/image/generic.mk | 12 ++ 6 files changed, 216 insertions(+), 87 deletions(-) create mode 100644 target/linux/ath79/dts/ar9344_wd_mynet-n600.dts create mode 100644 target/linux/ath79/dts/ar9344_wd_mynet-nxxx.dtsi diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-n600.dts b/target/linux/ath79/dts/ar9344_wd_mynet-n600.dts new file mode 100644 index 0000000000..81788fb348 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_wd_mynet-n600.dts @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_wd_mynet-nxxx.dtsi" +#include + +/ { + model = "Western Digital My Net N600"; + compatible = "wd,mynet-n600", "qca,ar9344"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + color = ; + function = LED_FUNCTION_WLAN; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + + led_power: led-1 { + label = "blue:power"; + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + }; + + led-2 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_WPS; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wps { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio { + gpio_ext_lna0 { + gpio-hog; + gpios = <14 0>; + output-high; + line-name = "ext:lna0"; + }; + + gpio_ext_lna1 { + gpio-hog; + gpios = <15 0>; + output-high; + line-name = "ext:lna1"; + }; +}; + +&pinmux { + pmx_led_switch: pinmux_led_switch { + pinctrl-single,bits = + <0x0 0x2c2b2a00 0xffffff00>, /* GPIO1-3 default to PHY2-4 */ + <0x4 0x00000029 0x000000ff>; /* GPIO4 default to PHY1 */ + }; +}; + +&builtin_switch { + pinctrl-names = "default"; + pinctrl-0 = <&pmx_led_switch>; +}; + +&usb { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + switch-only-mode = <1>; + }; +}; + +ð1 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts index e3faa392a8..d1f63c5064 100644 --- a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts +++ b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts @@ -1,18 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "ar9344.dtsi" - -#include -#include +#include "ar9344_wd_mynet-nxxx.dtsi" / { model = "Western Digital My Net N750"; compatible = "wd,mynet-n750", "qca,ar9344"; - chosen { - bootargs = "console=ttyS0,115200n8"; - }; - aliases { led-boot = &led_power; led-failsafe = &led_power; @@ -59,75 +52,19 @@ }; }; -&ref { - clock-frequency = <40000000>; -}; - &gpio { gpio_ext_lna0 { gpio-hog; gpios = <15 0>; output-high; - line-name = "mynet-n750:ext:lna0"; + line-name = "ext:lna0"; }; gpio_ext_lna1 { gpio-hog; gpios = <18 0>; output-high; - line-name = "mynet-n750:ext:lna1"; - }; -}; - -&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 = "bootloader"; - reg = <0x000000 0x40000>; - read-only; - }; - - partition@40000 { - label = "bdcfg"; - reg = <0x040000 0x10000>; - read-only; - }; - - partition@50000 { - label = "devdata"; - reg = <0x050000 0x10000>; - read-only; - }; - - partition@60000 { - label = "devconf"; - reg = <0x060000 0x10000>; - read-only; - }; - - partition@70000 { - compatible = "seama"; - label = "firmware"; - reg = <0x070000 0xf80000>; - }; - - art: partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - }; - }; + line-name = "ext:lna1"; }; }; @@ -154,26 +91,6 @@ }; }; -&usb_phy { - status = "okay"; -}; - -&pcie { - status = "okay"; - - wifi@0,0 { - compatible = "pci168c,0033"; - reg = <0x0000 0 0 0 0>; - qca,no-eeprom; - }; -}; - -&wmac { - status = "okay"; - - qca,no-eeprom; -}; - &mdio0 { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-nxxx.dtsi b/target/linux/ath79/dts/ar9344_wd_mynet-nxxx.dtsi new file mode 100644 index 0000000000..73e2c2566f --- /dev/null +++ b/target/linux/ath79/dts/ar9344_wd_mynet-nxxx.dtsi @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&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 = "bootloader"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "bdcfg"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "devdata"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + label = "devconf"; + reg = <0x060000 0x010000>; + read-only; + }; + + partition@70000 { + compatible = "seama"; + label = "firmware"; + reg = <0x070000 0xf80000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + }; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 45b002330e..edd79b606e 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -130,7 +130,8 @@ ath79_setup_interfaces() pcs,cr3000|\ tplink,archer-c58-v1|\ tplink,archer-c59-v1|\ - tplink,archer-c59-v2) + tplink,archer-c59-v2|\ + wd,mynet-n600) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2" @@ -595,6 +596,7 @@ ath79_setup_macs() ;; dlink,dir-859-a1|\ qihoo,c301|\ + wd,mynet-n600|\ wd,mynet-n750) lan_mac=$(mtd_get_mac_ascii devdata "lanmac") wan_mac=$(mtd_get_mac_ascii devdata "wanmac") diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index da78e74dcb..219e618cb9 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -30,6 +30,7 @@ case "$FIRMWARE" in dlink,dir-859-a1|\ nec,wf1200cr|\ nec,wg1200cr|\ + wd,mynet-n600|\ wd,mynet-n750) caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac") @@ -126,6 +127,7 @@ case "$FIRMWARE" in openmesh,mr600-v2) caldata_extract "ART" 0x5000 0x440 ;; + wd,mynet-n600|\ wd,mynet-n750) caldata_extract "art" 0x5000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac") diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index cff4b98eae..ff24764740 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -2336,6 +2336,18 @@ define Device/wallys_dr531 endef TARGET_DEVICES += wallys_dr531 +define Device/wd_mynet-n600 + $(Device/seama) + SOC := ar9344 + DEVICE_VENDOR := Western Digital + DEVICE_MODEL := My Net N600 + IMAGE_SIZE := 15872k + DEVICE_PACKAGES := kmod-usb2 + SEAMA_SIGNATURE := wrgnd16_wd_db600 + SUPPORTED_DEVICES += mynet-n600 +endef +TARGET_DEVICES += wd_mynet-n600 + define Device/wd_mynet-n750 $(Device/seama) SOC := ar9344 From 7061d5f343016bfd195a1af94ee194902e7db0ab Mon Sep 17 00:00:00 2001 From: Joel Linn Date: Wed, 8 Dec 2021 11:07:50 +0100 Subject: [PATCH 64/78] lantiq: fixed wifi support for AVM FRITZ!Box 7430 adds the correct offset for the calibration data. The values are according to the OpenWrt Forum Thread: "Fritzbox 7430 and wifi". Link: Reported-by: RENErica Signed-off-by: Joel Linn [changed commit message] Signed-off-by: Christian Lamparter --- .../base-files/etc/hotplug.d/firmware/12-ath9k-eeprom | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index 09d26f7f85..07463a8061 100644 --- a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -23,10 +23,12 @@ case "$FIRMWARE" in avm,fritz7360-v2) caldata_extract "urlader" 0x985 0x1000 ;; - avm,fritz7412|\ - avm,fritz7430) + avm,fritz7412) /usr/bin/fritz_cal_extract -i 1 -s 0x1e000 -e 0x207 -l 4096 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader") ;; + avm,fritz7430) + /usr/bin/fritz_cal_extract -i 1 -s 0x1e800 -e 0x207 -l 4096 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader") + ;; bt,homehub-v5a) caldata_extract_ubi "caldata" 0x1000 0x1000 ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) 2) 0x10c From 03c004977491e911127e75fc36310620135f6eea Mon Sep 17 00:00:00 2001 From: Janpieter Sollie Date: Thu, 9 Dec 2021 13:27:49 +0100 Subject: [PATCH 65/78] rtl8812au-ct: update driver to be ready for 5.15 update rtl8812au-ct driver to be ready for 5.15 Linux. Signed-off-by: Janpieter Sollie [added commit message from PR with changes, added tag to subject] Signed-off-by: Christian Lamparter --- package/kernel/rtl8812au-ct/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/rtl8812au-ct/Makefile b/package/kernel/rtl8812au-ct/Makefile index fa2cd295ab..aa2d7a2ea9 100644 --- a/package/kernel/rtl8812au-ct/Makefile +++ b/package/kernel/rtl8812au-ct/Makefile @@ -7,10 +7,10 @@ PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/greearb/rtl8812AU_8821AU_linux.git -PKG_MIRROR_HASH:=aee819df4ba83251b59bd1d4f412287b27105e5de9284bb09579f0e1a1538328 +PKG_MIRROR_HASH:=31e658df3e4d4c18c396259c2e0bef2bfc44a4aa870931f031a31e948be98af4 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2020-12-07 -PKG_SOURCE_VERSION:=1e9689c89fa627d2d764ba0e8359fd444fe8458f +PKG_SOURCE_DATE:=2021-11-07 +PKG_SOURCE_VERSION:=39df55967b7de9f6c9600017b724303f95a8b9e2 PKG_MAINTAINER:=Ben Greear PKG_BUILD_PARALLEL:=1 From b2aca5a263e73cb2def1c6cbb36f3be24d38089b Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 11 Dec 2021 00:09:13 +0100 Subject: [PATCH 66/78] ath79: fix various dts warnings ar9344_openmesh_mr600-v1.dts:40.10-44.5: Warning (gpios_property): /leds-ath9k/wifi2g: Missing property '#gpio-cells' in node /ahb/pcie-controller@180c0000/wifi@0,0 or bad phandle => added gpio-controller + #gpio-cells qca955x_zyxel_nbg6x16.dtsi:121.3-13: Warning (reg_format): /ahb/usb@1b000000/port@1:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1) ../dts/qca955x_zyxel_nbg6x16.dtsi:131.3-13: Warning (reg_format): /ahb/usb@1b400000/port@1:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1) qca955x_zyxel_nbg6x16.dtsi:120.20-123.4: Warning (avoid_default_addr_size): /ahb/usb@1b000000/port@1: Relying on default #address-cells value => ath79's usb-nodes are missing the address- and size-cells properties. These are needed for usb led trigger support. ar7242_ubnt_sw.dtsi:54.4-14: Warning (reg_format): /gpio_spi/gpio_spi@0:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) => the #address-cells and #size-cells had to be nudged. qca9531_dlink_dch-g020-a1.dts:19.6-39.4: Warning (i2c_bus_bridge): /i2c: incorrect #size-cells for I2C bus => #size-cells = <0>; Signed-off-by: Christian Lamparter --- target/linux/ath79/dts/ar7100.dtsi | 6 ++++++ target/linux/ath79/dts/ar7240.dtsi | 3 +++ target/linux/ath79/dts/ar7241.dtsi | 3 +++ target/linux/ath79/dts/ar7242.dtsi | 3 +++ target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts | 5 +++-- target/linux/ath79/dts/ar7242_ubnt_sw.dtsi | 4 ++-- target/linux/ath79/dts/ar9330.dtsi | 3 +++ target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi | 3 +++ target/linux/ath79/dts/ar934x.dtsi | 3 +++ target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts | 2 +- target/linux/ath79/dts/qca953x.dtsi | 3 +++ target/linux/ath79/dts/qca955x.dtsi | 6 ++++++ target/linux/ath79/dts/qca956x.dtsi | 6 ++++++ 13 files changed, 45 insertions(+), 5 deletions(-) diff --git a/target/linux/ath79/dts/ar7100.dtsi b/target/linux/ath79/dts/ar7100.dtsi index 86673cb5da..12ab7e5039 100644 --- a/target/linux/ath79/dts/ar7100.dtsi +++ b/target/linux/ath79/dts/ar7100.dtsi @@ -146,6 +146,9 @@ has-synopsys-hc-bug; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; usb1: usb@1c000000 { @@ -159,6 +162,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; spi: spi@1f000000 { diff --git a/target/linux/ath79/dts/ar7240.dtsi b/target/linux/ath79/dts/ar7240.dtsi index 730c509d7b..425d75f0d7 100644 --- a/target/linux/ath79/dts/ar7240.dtsi +++ b/target/linux/ath79/dts/ar7240.dtsi @@ -29,6 +29,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; }; diff --git a/target/linux/ath79/dts/ar7241.dtsi b/target/linux/ath79/dts/ar7241.dtsi index 4044cdee0e..ff7a61f921 100644 --- a/target/linux/ath79/dts/ar7241.dtsi +++ b/target/linux/ath79/dts/ar7241.dtsi @@ -36,6 +36,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; }; diff --git a/target/linux/ath79/dts/ar7242.dtsi b/target/linux/ath79/dts/ar7242.dtsi index be28ae7838..eda1b16309 100644 --- a/target/linux/ath79/dts/ar7242.dtsi +++ b/target/linux/ath79/dts/ar7242.dtsi @@ -36,6 +36,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; }; diff --git a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts index f5433a30a3..0c2fe394d4 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts +++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts @@ -114,11 +114,12 @@ ethernet-switch@1e { compatible = "brcm,bcm53128"; - #address-cells = <1>; - #size-cells = <0>; reg = <0x1e>; ports { + #address-cells = <1>; + #size-cells = <0>; + port0@0 { reg = <0>; label = "lan1"; diff --git a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi index 3f996a16c7..c776c8ef6e 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi +++ b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi @@ -41,8 +41,8 @@ gpio_spi { compatible = "spi-gpio"; - #address-cells = <0x1>; - ranges; + #address-cells = <1>; + #size-cells = <0>; sck-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; mosi-gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/ath79/dts/ar9330.dtsi b/target/linux/ath79/dts/ar9330.dtsi index 06e1cf4601..aed8e205ad 100644 --- a/target/linux/ath79/dts/ar9330.dtsi +++ b/target/linux/ath79/dts/ar9330.dtsi @@ -116,6 +116,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; spi: spi@1f000000 { diff --git a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi index de8bfb70b7..bbbcc3e0b6 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi +++ b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi @@ -129,6 +129,9 @@ nvmem-cells = <&macaddr_art_0>; nvmem-cell-names = "mac-address"; mac-address-increment = <8>; + + gpio-controller; + #gpio-cells = <2>; }; }; diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi index 84dbe65f85..d88c7bfabc 100644 --- a/target/linux/ath79/dts/ar934x.dtsi +++ b/target/linux/ath79/dts/ar934x.dtsi @@ -175,6 +175,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; nand: nand@1b000200 { diff --git a/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts b/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts index d2fbc09c60..9a4db6f9fc 100644 --- a/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts +++ b/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts @@ -19,7 +19,7 @@ i2c { compatible = "i2c-gpio"; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; sda-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; scl-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi index d73163c3fe..6df0941eef 100644 --- a/target/linux/ath79/dts/qca953x.dtsi +++ b/target/linux/ath79/dts/qca953x.dtsi @@ -201,6 +201,9 @@ phys = <&usb_phy>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; spi: spi@1f000000 { diff --git a/target/linux/ath79/dts/qca955x.dtsi b/target/linux/ath79/dts/qca955x.dtsi index 8138f4afee..fb820169d5 100644 --- a/target/linux/ath79/dts/qca955x.dtsi +++ b/target/linux/ath79/dts/qca955x.dtsi @@ -265,6 +265,9 @@ phys = <&usb_phy0>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; usb1: usb@1b400000 { @@ -283,6 +286,9 @@ phys = <&usb_phy1>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; nand: nand@1b800200 { diff --git a/target/linux/ath79/dts/qca956x.dtsi b/target/linux/ath79/dts/qca956x.dtsi index 8627f7ee40..f2452e9dc7 100644 --- a/target/linux/ath79/dts/qca956x.dtsi +++ b/target/linux/ath79/dts/qca956x.dtsi @@ -200,6 +200,9 @@ phys = <&usb_phy0>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; usb1: usb@1b400000 { @@ -219,6 +222,9 @@ phys = <&usb_phy1>; status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; }; spi: spi@1f000000 { From 56b14fdeb24b63b26ae948aa2fa6b1ce4b9df1fd Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 11 Dec 2021 03:16:16 +0000 Subject: [PATCH 67/78] procd: update to git HEAD bb95fe8 jail: make sure jailed process is terminated Signed-off-by: Daniel Golle --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 228eecfebc..0f0df8c68d 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_MIRROR_HASH:=39f24aa076a61a3d570f4e5f7a3f38eb6b6e3b96a967c8be7f0dc3e3ffaeed1a -PKG_SOURCE_DATE:=2021-11-23 -PKG_SOURCE_VERSION:=01ac2c4500cb0c7934640e6d2e5f99b08483bdf4 +PKG_MIRROR_HASH:=e2c60679cc39549e01c2c8e64eeb78278edb92953ce24e74b73da9ac0f21fe3d +PKG_SOURCE_DATE:=2021-12-11 +PKG_SOURCE_VERSION:=bb95fe8df7115ab57792369c768927eafc042161 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 3b20eb185b2a45681fa9e2d31b9844458d5a72d2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 30 Nov 2021 11:37:15 +0100 Subject: [PATCH 68/78] kernel: fix RCU issue in xt_FLOWOFFLOAD patch cond_resched() may not be called in a rcu-locked section Signed-off-by: Felix Fietkau --- .../hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch b/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch index 77c24ccc7a..bda8d06b7c 100644 --- a/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch +++ b/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch @@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o --- /dev/null +++ b/net/netfilter/xt_FLOWOFFLOAD.c -@@ -0,0 +1,658 @@ +@@ -0,0 +1,656 @@ +/* + * Copyright (C) 2018-2021 Felix Fietkau + * @@ -278,8 +278,6 @@ Signed-off-by: Felix Fietkau + hook->used = true; + } + spin_unlock_bh(&hooks_lock); -+ -+ cond_resched(); +} + +static void From 446da706690a239dc7a454102db0b0a3b3a9d1ed Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Sun, 5 Dec 2021 02:08:48 +0900 Subject: [PATCH 69/78] build: image: improve zip build recipe * clean before build * specify executable path * allow adding extra options for zip * use basename of $@ Signed-off-by: Sungbo Eo --- include/image-commands.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index 97176f7d7b..913e1c2411 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -524,12 +524,14 @@ define Build/xor-image endef define Build/zip + rm -rf $@.tmp mkdir $@.tmp - mv $@ $@.tmp/$(1) + mv $@ $@.tmp/$(word 1,$(1)) - zip -j -X \ + $(STAGING_DIR_HOST)/bin/zip -j -X \ $(if $(SOURCE_DATE_EPOCH),--mtime="$(SOURCE_DATE_EPOCH)") \ - $@ $@.tmp/$(if $(1),$(1),$@) + $(wordlist 2,$(words $(1)),$(1)) \ + $@ $@.tmp/$(if $(word 1,$(1)),$(word 1,$(1)),$$(basename $@)) rm -rf $@.tmp endef From 91e37b60a0b1181b77aabf7269450bf76d220c40 Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Sun, 12 Dec 2021 20:25:56 +0900 Subject: [PATCH 70/78] ramips: mt76x8: tidy up 02_network * fix alphabetic sorting * consolidate duplicate cases Signed-off-by: Sungbo Eo --- .../ramips/mt76x8/base-files/etc/board.d/02_network | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index d3c7f9c3f9..08b2e6cebc 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -34,10 +34,6 @@ ramips_setup_interfaces() ucidef_add_switch_attr "switch0" "enable" "false" ucidef_set_interface_lan "eth0" ;; - tplink,tl-mr3020-v3) - ucidef_add_switch "switch0" \ - "0:lan" "6@eth0" - ;; asus,rt-n10p-v3|\ asus,rt-n11p-b1|\ asus,rt-n12-vp-b1|\ @@ -61,10 +57,7 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "2:lan:2" "3:lan:1" "4:wan" "6@eth0" ;; - duzun,dm06) - ucidef_add_switch "switch0" \ - "1:lan" "0:wan" "6@eth0" - ;; + duzun,dm06|\ glinet,gl-mt300n-v2) ucidef_add_switch "switch0" \ "1:lan" "0:wan" "6@eth0" @@ -124,6 +117,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0" ;; + tplink,tl-mr3020-v3) + ucidef_add_switch "switch0" \ + "0:lan" "6@eth0" + ;; tplink,tl-mr6400-v4) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" From 9a1b9a42b793104bd65bfd292d4935b061d5da33 Mon Sep 17 00:00:00 2001 From: Kyoungkyu Park Date: Sun, 14 Nov 2021 01:03:24 +0900 Subject: [PATCH 71/78] ramips: add support for HUMAX E10 HUMAX E10 (also known as HUMAX QUANTUM E10) is a 2.4/5GHz band AC router, based on MediaTek MT7621A. Specifications: - SoC: MT7621A - RAM: DDR3 128MB - Flash: SPI NOR 16MB (MXIC MX25L12805D) - WiFi: - 2.4GHz: MT7615 - 5GHz: MT7615 - Ethernet: 2x 10/100/1000Mbps - Switch: SoC internal - USB: 1x USB 2.0 Type-A - UART: J1 (57600 8N1) - pinout: [3V3] (RXD) (GND) (TXD) Installation via web interface: - Flash **factory** image through the stock web interface. Recovery procedure: 1. Connect ethernet cable between Router **LAN** port and PC Ethernet port. 2. Set your computer to a static IP **192.168.1.1** 3. Turn the device off and wait a few seconds. Hold the WPS button on front of device and insert power. 4. Send a firmware image to **192.168.1.6** using TFTP. You can use any TFTP client. (tftp, curl, Tftpd64...) - It can accept both images which is HUMAX stock firmware dump (0x70000-0x1000000) image and OpenWRT **sysupgrade** image. Signed-off-by: Kyoungkyu Park [remove trailing whitespace] Signed-off-by: Sungbo Eo --- target/linux/ramips/dts/mt7621_humax_e10.dts | 170 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 19 ++ .../mt7621/base-files/etc/board.d/02_network | 1 + 3 files changed, 190 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_humax_e10.dts diff --git a/target/linux/ramips/dts/mt7621_humax_e10.dts b/target/linux/ramips/dts/mt7621_humax_e10.dts new file mode 100644 index 0000000000..41587629c0 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_humax_e10.dts @@ -0,0 +1,170 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "humax,e10", "mediatek,mt7621-soc"; + model = "HUMAX E10"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &wan; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio-usb-power { + gpio-export,name = "power:usb"; + gpio-export,output = <1>; + gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + }; + + pairing { + label = "green:pairing"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + }; + + wps { + label = "green:wps"; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps-reset { + label = "wps_reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x30000>; + read-only; + }; + + partition@70000 { + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,offset = ; + openwrt,partition-magic = ; + label = "firmware"; + reg = <0x70000 0xf90000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_10007>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + wan: port@0 { + status = "okay"; + label = "wan"; + nvmem-cells = <&macaddr_factory_1000d>; + nvmem-cell-names = "mac-address"; + }; + + port@1 { + 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_10007: macaddr@10007 { + reg = <0x10007 0x6>; + }; + + macaddr_factory_1000d: macaddr@1000d { + reg = <0x1000d 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 8b156c2a1c..35c5627264 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -637,6 +637,25 @@ define Device/hiwifi_hc5962 endef TARGET_DEVICES += hiwifi_hc5962 +define Device/humax_e10 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 15936k + DEVICE_VENDOR := HUMAX + DEVICE_MODEL := E10 + DEVICE_ALT0_VENDOR := HUMAX + DEVICE_ALT0_MODEL := QUANTUM E10 + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + edimax-header -s CSYS -m EA03 -f 0x70000 -S 0x01100000 | pad-rootfs | \ + check-size | append-metadata + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | \ + edimax-header -s CSYS -m EA03 -f 0x70000 -S 0x01100000 | \ + check-size | zip upg -P f013c26cf0a320fb71d03356dcb6bb63 + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 +endef +TARGET_DEVICES += humax_e10 + define Device/iodata_wn-ax1167gr $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 47f978baf8..342704ee30 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -30,6 +30,7 @@ ramips_setup_interfaces() ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; asiarf,ap7621-001|\ + humax,e10|\ winstars,ws-wn583a6) ucidef_set_interfaces_lan_wan "lan" "wan" ;; From a725bdc700c9a63666ce1ef9fec1b2a65216576f Mon Sep 17 00:00:00 2001 From: Enrico Mioso Date: Fri, 3 Dec 2021 17:32:20 +0100 Subject: [PATCH 72/78] ipq40xx: fix reset button GPIO for GL.iNet GL-B2200 GL.iNet's U-Boot checks for GPIO 40, not 43. Changing this allows the RESET button to work as expected. Signed-off-by: Enrico Mioso CC: Daniel Golle CC: Li Zhang --- .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts index 6b84f78dc4..339a1e0f72 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts @@ -84,7 +84,7 @@ reset { label = "reset"; - gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; linux,code = ; linux,input-type = <1>; }; From 6c945fa379a1b59e6b439b0f6ffba4cbd3ca04d3 Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 1 Dec 2021 06:28:02 -0500 Subject: [PATCH 73/78] kernel: bump 5.10 to 5.10.83 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed upstreamed: bcm53xx/patches-5.10/033-v5.16-0024-ARM-dts-BCM5301X-Fix-I2C-controller-interrupt.patch[1] bcm53xx/patches-5.10/033-v5.16-0025-ARM-dts-BCM5301X-Add-interrupt-properties-to-GPIO-no.patch[2] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.83&id=b2cd6fdcbe0a5cb44e4610a08cc58261d494a885 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.83&id=9db1d4a3c2700e1cc84c3d61199411d75c2a3ec6 Build system: x86_64* Build-tested: bcm2711/RPi4B, ipq806x/R7800† Run-tested: bcm2711/RPi4B, ipq806x/R7800† * Had to revert 7c99085bd69742f66207d61e9f2da5ec4f8f9d2f in order to build (latest bump of ca-certificates) † Had to revert 7f1edbd41295dff9f2127b169fbc086c0fb2c14e in order to build (binutils 2.37, https://bugs.openwrt.org/index.php?do=details&task_id=4149) Signed-off-by: John Audia --- include/kernel-version.mk | 4 +-- .../950-0040-Add-dwc_otg-driver.patch | 2 +- ...-0201-mmc-sdhci-Silence-MMC-warnings.patch | 4 +-- ...tft-Add-support-for-display-variants.patch | 6 ++-- ...ARM-dts-Expand-PCIe-space-on-BCM2711.patch | 2 +- ...e-compatible-string-for-BCM2711-DSI1.patch | 2 +- ...cm2711-fold-in-the-correct-interrupt.patch | 2 +- ...1X-Harmonize-EHCI-OHCI-DT-nodes-name.patch | 4 +-- ...CM5310X-Harmonize-xHCI-DT-nodes-name.patch | 2 +- ...-Use-corretc-pinctrl-compatible-for-.patch | 2 +- ...01X-Move-CRU-devices-to-the-CRU-node.patch | 4 +-- ...01X-Update-Ethernet-switch-node-name.patch | 2 +- ...-Add-a-default-compatible-for-switch.patch | 2 +- ...-Provide-defaults-ports-container-no.patch | 2 +- ...RM-dts-BCM5301X-Fix-NAND-nodes-names.patch | 2 +- ...s-BCM5301X-Fix-pinmux-subnodes-names.patch | 2 +- ...010-ARM-dts-BCM5301X-Fix-nodes-names.patch | 4 +-- ...RM-dts-BCM5301X-Fix-MDIO-mux-binding.patch | 2 +- ...CM5301X-Fix-I2C-controller-interrupt.patch | 29 ------------------- ...-Add-interrupt-properties-to-GPIO-no.patch | 26 ----------------- ...lve-forwarding-path-for-vlan-devices.patch | 4 +-- ...ve-forwarding-path-for-VLAN-tag-acti.patch | 2 +- ...the-dst-buffer-to-of_get_mac_address.patch | 12 ++++---- .../generic/hack-5.10/902-debloat_proc.patch | 2 +- ...ng-with-source-address-failed-policy.patch | 18 ++++++------ .../105-ipq40xx-fix-sleep-clock.patch | 2 +- ...702-dts-ipq4019-add-PHY-switch-nodes.patch | 2 +- ...8-arm-dts-ipq4019-QCA807x-properties.patch | 2 +- ...ts-ipq4019-add-ethernet-essedma-node.patch | 2 +- .../083-ipq8064-dtsi-additions.patch | 12 ++++---- ...c-explicitly-deassert-gmac-ahb-reset.patch | 6 ++-- ...y-simplify-phy_link_change-arguments.patch | 2 +- ...vers-net-phy-eee-support-for-rtl838x.patch | 6 ++-- 33 files changed, 61 insertions(+), 116 deletions(-) delete mode 100644 target/linux/bcm53xx/patches-5.10/033-v5.16-0024-ARM-dts-BCM5301X-Fix-I2C-controller-interrupt.patch delete mode 100644 target/linux/bcm53xx/patches-5.10/033-v5.16-0025-ARM-dts-BCM5301X-Add-interrupt-properties-to-GPIO-no.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 73de553a7b..ccedcb18c0 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL endif LINUX_VERSION-5.4 = .162 -LINUX_VERSION-5.10 = .82 +LINUX_VERSION-5.10 = .83 LINUX_KERNEL_HASH-5.4.162 = c12d72ddaac78189305a5e98825295ecb02282970033b052276035e83189e25b -LINUX_KERNEL_HASH-5.10.82 = d66f7c7eed02f84ae550b3c91a26c70eea13682a6d672432f07bce66ff8ce350 +LINUX_KERNEL_HASH-5.10.83 = ef259a43f33ddb56001283f4f4e50af29b8a48fa066aed7371a90ebf38c29b70 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/bcm27xx/patches-5.10/950-0040-Add-dwc_otg-driver.patch b/target/linux/bcm27xx/patches-5.10/950-0040-Add-dwc_otg-driver.patch index ec59069392..c0a315042a 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0040-Add-dwc_otg-driver.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0040-Add-dwc_otg-driver.patch @@ -1123,7 +1123,7 @@ Signed-off-by: Jonathan Bell } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5494,7 +5494,7 @@ static void port_event(struct usb_hub *h +@@ -5503,7 +5503,7 @@ static void port_event(struct usb_hub *h port_dev->over_current_count++; port_over_current_notify(port_dev); diff --git a/target/linux/bcm27xx/patches-5.10/950-0201-mmc-sdhci-Silence-MMC-warnings.patch b/target/linux/bcm27xx/patches-5.10/950-0201-mmc-sdhci-Silence-MMC-warnings.patch index ae6eba1cb4..fabb3b0e6d 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0201-mmc-sdhci-Silence-MMC-warnings.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0201-mmc-sdhci-Silence-MMC-warnings.patch @@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard #define MAX_TUNING_LOOP 40 -@@ -3133,7 +3133,7 @@ static void sdhci_timeout_timer(struct t +@@ -3145,7 +3145,7 @@ static void sdhci_timeout_timer(struct t spin_lock_irqsave(&host->lock, flags); if (host->cmd && !sdhci_data_line_cmd(host->cmd)) { @@ -31,7 +31,7 @@ Signed-off-by: Maxime Ripard mmc_hostname(host->mmc)); sdhci_dumpregs(host); -@@ -3155,7 +3155,7 @@ static void sdhci_timeout_data_timer(str +@@ -3167,7 +3167,7 @@ static void sdhci_timeout_data_timer(str if (host->data || host->data_cmd || (host->cmd && sdhci_data_line_cmd(host->cmd))) { diff --git a/target/linux/bcm27xx/patches-5.10/950-0332-staging-fbtft-Add-support-for-display-variants.patch b/target/linux/bcm27xx/patches-5.10/950-0332-staging-fbtft-Add-support-for-display-variants.patch index 72f741fa89..7bdc80b46c 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0332-staging-fbtft-Add-support-for-display-variants.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0332-staging-fbtft-Add-support-for-display-variants.patch @@ -95,7 +95,7 @@ Signed-off-by: Phil Elwell #include