From 93adba459794c0bb32373ab5504992199b5c5314 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sun, 25 Oct 2020 18:55:24 +0100 Subject: [PATCH 01/31] glibc: update to latest stable version 2.32 refresh patches : 050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch 00-fix_cross_rpcgen.patch Signed-off-by: Hans Dedecker --- toolchain/glibc/common.mk | 6 +- ...use-of-DES-encryption-functions-in-n.patch | 138 ++++++++++-------- .../glibc/patches/100-fix_cross_rpcgen.patch | 17 --- 3 files changed, 81 insertions(+), 80 deletions(-) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index ad4b324374..90a22c31e8 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glibc -PKG_VERSION:=2.31 +PKG_VERSION:=2.32 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=4bc9918c998085800ecf5bbb3c863e66ea6252a0 -PKG_MIRROR_HASH:=51877ffff6819b5ccc004a842de755c6c203996d673d94d7013927712e252c17 +PKG_SOURCE_VERSION:=70ee5e8b573f76745760dd6b75f705590fc1923a +PKG_MIRROR_HASH:=d816dc7658446c2969d307730b58df5f8a65853b4e57a655895feb685590d63b PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz diff --git a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch index 4e3e2eebb2..002e7a1770 100644 --- a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch +++ b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch @@ -1,11 +1,11 @@ -From cfc93329e00cd23c226f34b3ffd5552a93c35bd7 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Mon, 23 Mar 2020 22:33:46 +0100 +From 08f5e0df46ce1ad617bcde1fd5542545397630b9 Mon Sep 17 00:00:00 2001 +From: Hans Dedecker +Date: Sat, 24 Oct 2020 21:13:30 +0200 Subject: Revert "Disallow use of DES encryption functions in new programs." This reverts commit b10a0accee709a5efff2fadf0b0bbb79ff0ad759. -ppp still uses the encrypt functions from the libc. musl libc also +ppp still uses the encrypt functions from the libc while musl libc also provides them. --- conform/data/stdlib.h-data | 3 + @@ -15,18 +15,19 @@ provides them. crypt/crypt.h | 16 +++ crypt/crypt_util.c | 9 -- manual/conf.texi | 2 - - manual/crypt.texi | 201 +++++++++++++++++++++++++++++++++++++ + manual/crypt.texi | 204 +++++++++++++++++++++++++++++++++++++ manual/string.texi | 82 +++++++-------- - posix/unistd.h | 22 ++-- + posix/unistd.h | 17 +++- stdlib/stdlib.h | 6 ++ - sunrpc/Makefile | 2 +- sunrpc/des_crypt.c | 7 +- sunrpc/des_soft.c | 2 +- - 14 files changed, 303 insertions(+), 96 deletions(-) + 13 files changed, 305 insertions(+), 90 deletions(-) +diff --git a/conform/data/stdlib.h-data b/conform/data/stdlib.h-data +index 6913828196..d8fcccc2fb 100644 --- a/conform/data/stdlib.h-data +++ b/conform/data/stdlib.h-data -@@ -149,6 +149,9 @@ function {unsigned short int*} seed48 (u +@@ -149,6 +149,9 @@ function {unsigned short int*} seed48 (unsigned short int[3]) #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 function int setenv (const char*, const char*, int) #endif @@ -36,6 +37,8 @@ provides them. #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 function {char*} setstate (char*) #endif +diff --git a/conform/data/unistd.h-data b/conform/data/unistd.h-data +index aa070528e8..ddf4f25132 100644 --- a/conform/data/unistd.h-data +++ b/conform/data/unistd.h-data @@ -437,6 +437,9 @@ function int chroot (const char*) @@ -58,6 +61,8 @@ provides them. function int execl (const char*, const char*, ...) function int execle (const char*, const char*, ...) function int execlp (const char*, const char*, ...) +diff --git a/crypt/cert.c b/crypt/cert.c +index e070ca398d..80029e9078 100644 --- a/crypt/cert.c +++ b/crypt/cert.c @@ -10,22 +10,6 @@ @@ -97,6 +102,8 @@ provides them. -} - -#endif +diff --git a/crypt/crypt-entry.c b/crypt/crypt-entry.c +index 502b5846f0..09332c690a 100644 --- a/crypt/crypt-entry.c +++ b/crypt/crypt-entry.c @@ -35,7 +35,6 @@ @@ -107,7 +114,7 @@ provides them. /* Prototypes for local functions. */ #ifndef __GNU_LIBRARY__ -@@ -177,7 +176,17 @@ crypt (const char *key, const char *salt +@@ -177,7 +176,17 @@ crypt (const char *key, const char *salt) return __crypt_r (key, salt, &_ufc_foobar); } @@ -127,6 +134,8 @@ provides them. + return crypt (key, salt); +} #endif +diff --git a/crypt/crypt.h b/crypt/crypt.h +index ca8ad456cc..7d0de95018 100644 --- a/crypt/crypt.h +++ b/crypt/crypt.h @@ -36,6 +36,14 @@ __BEGIN_DECLS @@ -159,6 +168,8 @@ provides them. #endif __END_DECLS +diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c +index 4b2f0a89cb..b012cde6bd 100644 --- a/crypt/crypt_util.c +++ b/crypt/crypt_util.c @@ -34,7 +34,6 @@ @@ -185,7 +196,7 @@ provides them. /* * This is the final -@@ -788,7 +785,6 @@ _ufc_output_conversion_r (ufc_long v1, u +@@ -788,7 +785,6 @@ _ufc_output_conversion_r (ufc_long v1, ufc_long v2, const char *salt, __data->crypt_3_buf[13] = 0; } @@ -193,7 +204,7 @@ provides them. /* * UNIX encrypt function. Takes a bitvector -@@ -889,14 +885,12 @@ __encrypt_r (char *__block, int __edflag +@@ -889,14 +885,12 @@ __encrypt_r (char *__block, int __edflag, } } weak_alias (__encrypt_r, encrypt_r) @@ -208,7 +219,7 @@ provides them. /* -@@ -921,15 +915,12 @@ __setkey_r (const char *__key, struct cr +@@ -921,15 +915,12 @@ __setkey_r (const char *__key, struct crypt_data * __restrict __data) _ufc_mk_keytab_r((char *) ktab, __data); } weak_alias (__setkey_r, setkey_r) @@ -224,9 +235,11 @@ provides them. void __b64_from_24bit (char **cp, int *buflen, +diff --git a/manual/conf.texi b/manual/conf.texi +index f959b00bb6..51fb2f5aa1 100644 --- a/manual/conf.texi +++ b/manual/conf.texi -@@ -780,8 +780,6 @@ Inquire about the parameter correspondin +@@ -780,8 +780,6 @@ Inquire about the parameter corresponding to @code{_XOPEN_LEGACY}. @item _SC_XOPEN_CRYPT @standards{X/Open, unistd.h} Inquire about the parameter corresponding to @code{_XOPEN_CRYPT}. @@ -235,9 +248,11 @@ provides them. @item _SC_XOPEN_ENH_I18N @standards{X/Open, unistd.h} +diff --git a/manual/crypt.texi b/manual/crypt.texi +index af23dd7847..1b151f2d74 100644 --- a/manual/crypt.texi +++ b/manual/crypt.texi -@@ -16,8 +16,19 @@ subject to them, even if you do not use +@@ -16,8 +16,19 @@ subject to them, even if you do not use the functions in this chapter yourself. The restrictions vary from place to place and are changed often, so we cannot give any more specific advice than this warning. @@ -253,12 +268,12 @@ provides them. + @menu * Passphrase Storage:: One-way hashing for passphrases. -+* DES Encryption:: Routines for DES encryption. ++* crypt:: A one-way function for passwords. * Unpredictable Bytes:: Randomness for cryptographic purposes. @end menu -@@ -200,6 +211,196 @@ hashes for the same passphrase. - @include testpass.c.texi +@@ -190,6 +201,199 @@ unpredictable as possible; @pxref{Unpredictable Bytes}. + @include genpass.c.texi @end smallexample +@node DES Encryption @@ -451,9 +466,14 @@ provides them. +functions and their accompanying macros are all defined in the header +@file{rpc/des_crypt.h}. + - @node Unpredictable Bytes - @section Generating Unpredictable Bytes - @cindex randomness source ++@node Unpredictable Bytes ++@section Generating Unpredictable Bytes ++ + The next program demonstrates how to verify a passphrase. It checks a + hash hardcoded into the program, because looking up real users' hashed + passphrases may require special privileges (@pxref{User Database}). +diff --git a/manual/string.texi b/manual/string.texi +index 23f516439a..5586b52dee 100644 --- a/manual/string.texi +++ b/manual/string.texi @@ -36,8 +36,8 @@ too. @@ -467,7 +487,7 @@ provides them. * Encode Binary Data:: Encoding and Decoding of Binary Data. * Argz and Envz Vectors:: Null-separated string vectors. @end menu -@@ -2426,73 +2426,73 @@ functionality under a different name, su +@@ -2426,73 +2426,73 @@ functionality under a different name, such as @code{explicit_memset}, systems it may be in @file{strings.h} instead. @end deftypefun @@ -518,19 +538,10 @@ provides them. -@node Obfuscating Data -@section Obfuscating Data +-@cindex Rot13 +@node Trivial Encryption +@section Trivial Encryption +@cindex encryption -+ -+ -+The @code{memfrob} function converts an array of data to something -+unrecognizable and back again. It is not encryption in its usual sense -+since it is easy for someone to convert the encrypted data back to clear -+text. The transformation is analogous to Usenet's ``Rot13'' encryption -+method for obscuring offensive jokes from sensitive eyes and such. -+Unlike Rot13, @code{memfrob} works on arbitrary binary data, not just -+text. - @cindex Rot13 -The @code{memfrob} function reversibly obfuscates an array of binary -data. This is not true encryption; the obfuscated data still bears a @@ -538,12 +549,20 @@ provides them. -undo the obfuscation. It is analogous to the ``Rot13'' cipher used on -Usenet for obscuring offensive jokes, spoilers for works of fiction, -and so on, but it can be applied to arbitrary binary data. -- + -Programs that need true encryption---a transformation that completely -obscures the original and cannot be reversed without knowledge of a -secret key---should use a dedicated cryptography library, such as -@uref{https://www.gnu.org/software/libgcrypt/,,libgcrypt}. -- ++The @code{memfrob} function converts an array of data to something ++unrecognizable and back again. It is not encryption in its usual sense ++since it is easy for someone to convert the encrypted data back to clear ++text. The transformation is analogous to Usenet's ``Rot13'' encryption ++method for obscuring offensive jokes from sensitive eyes and such. ++Unlike Rot13, @code{memfrob} works on arbitrary binary data, not just ++text. ++@cindex Rot13 + -Programs that need to @emph{destroy} data should use -@code{explicit_bzero} (@pxref{Erasing Sensitive Data}), or possibly -@code{strfry} (@pxref{Shuffling Bytes}). @@ -560,14 +579,13 @@ provides them. -beginning at @var{mem}, in place. Each byte is bitwise xor-ed with -the binary pattern 00101010 (hexadecimal 0x2A). The return value is -always @var{mem}. -- --@code{memfrob} a second time on the same data returns it to --its original state. +@code{memfrob} transforms (frobnicates) each byte of the data structure +at @var{mem}, which is @var{length} bytes long, by bitwise exclusive +oring it with binary 00101010. It does the transformation in place and +its return value is always @var{mem}. -+ + +-@code{memfrob} a second time on the same data returns it to +-its original state. +Note that @code{memfrob} a second time on the same data structure +returns it to its original state. + @@ -582,6 +600,8 @@ provides them. @end deftypefun @node Encode Binary Data +diff --git a/posix/unistd.h b/posix/unistd.h +index 32b8161619..6fac59999f 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -107,6 +107,9 @@ __BEGIN_DECLS @@ -594,20 +614,20 @@ provides them. /* The enhanced internationalization capabilities according to XPG4.2 are present. */ #define _XOPEN_ENH_I18N 1 -@@ -1115,17 +1118,20 @@ ssize_t copy_file_range (int __infd, __o +@@ -1129,17 +1132,25 @@ ssize_t copy_file_range (int __infd, __off64_t *__pinoff, extern int fdatasync (int __fildes); #endif /* Use POSIX199309 */ -#ifdef __USE_MISC --/* One-way hash PHRASE, returning a string suitable for storage in the -- user database. SALT selects the one-way function to use, and -- ensures that no two users' hashes are the same, even if they use -- the same passphrase. The return value points to static storage -- which will be overwritten by the next call to crypt. */ -+ +/* XPG4.2 specifies that prototypes for the encryption functions must + be defined here. */ +#ifdef __USE_XOPEN + /* One-way hash PHRASE, returning a string suitable for storage in the + user database. SALT selects the one-way function to use, and + ensures that no two users' hashes are the same, even if they use + the same passphrase. The return value points to static storage + which will be overwritten by the next call to crypt. */ ++ +/* Encrypt at most 8 characters from KEY using salt to perturb DES. */ extern char *crypt (const char *__key, const char *__salt) __THROW __nonnull ((1, 2)); @@ -623,9 +643,11 @@ provides them. /* Swab pairs bytes in the first N bytes of the area pointed to by FROM and copy the result to TO. The value of TO must not be in the range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM +diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h +index 3aa27a9d25..67e5e66f94 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h -@@ -961,6 +961,12 @@ extern int getsubopt (char **__restrict +@@ -962,6 +962,12 @@ extern int getsubopt (char **__restrict __optionp, #endif @@ -638,20 +660,11 @@ provides them. /* X/Open pseudo terminal handling. */ #ifdef __USE_XOPEN2KXSI ---- a/sunrpc/Makefile -+++ b/sunrpc/Makefile -@@ -51,7 +51,7 @@ rpcsvc = bootparam_prot.x nlm_prot.x rst - headers-sunrpc = $(addprefix rpc/,auth.h auth_unix.h clnt.h pmap_clnt.h \ - pmap_prot.h pmap_rmt.h rpc.h rpc_msg.h \ - svc.h svc_auth.h types.h xdr.h auth_des.h \ -- key_prot.h) \ -+ des_crypt.h key_prot.h rpc_des.h) \ - $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h - headers = rpc/netdb.h - install-others = $(inst_sysconfdir)/rpc +diff --git a/sunrpc/des_crypt.c b/sunrpc/des_crypt.c +index 9b4bd2d5dd..a4d8b2936b 100644 --- a/sunrpc/des_crypt.c +++ b/sunrpc/des_crypt.c -@@ -86,9 +86,6 @@ common_crypt (char *key, char *buf, regi +@@ -86,9 +86,6 @@ common_crypt (char *key, char *buf, register unsigned len, return desdev == DES_SW ? DESERR_NONE : DESERR_NOHWDEVICE; } @@ -661,7 +674,7 @@ provides them. /* * CBC mode encryption */ -@@ -105,7 +102,7 @@ cbc_crypt (char *key, char *buf, unsigne +@@ -105,7 +102,7 @@ cbc_crypt (char *key, char *buf, unsigned int len, unsigned int mode, COPY8 (dp.des_ivec, ivec); return err; } @@ -670,12 +683,14 @@ provides them. /* * ECB mode encryption -@@ -118,4 +115,4 @@ ecb_crypt (char *key, char *buf, unsigne +@@ -118,4 +115,4 @@ ecb_crypt (char *key, char *buf, unsigned int len, unsigned int mode) dp.des_mode = ECB; return common_crypt (key, buf, len, mode, &dp); } -hidden_nolink (ecb_crypt, libc, GLIBC_2_1) +libc_hidden_nolink_sunrpc (ecb_crypt, GLIBC_2_1) +diff --git a/sunrpc/des_soft.c b/sunrpc/des_soft.c +index a87de96cc7..f884f8f21b 100644 --- a/sunrpc/des_soft.c +++ b/sunrpc/des_soft.c @@ -71,4 +71,4 @@ des_setparity (char *p) @@ -684,3 +699,6 @@ provides them. } -hidden_nolink (des_setparity, libc, GLIBC_2_1) +libc_hidden_nolink_sunrpc (des_setparity, GLIBC_2_1) +-- +2.25.1 + diff --git a/toolchain/glibc/patches/100-fix_cross_rpcgen.patch b/toolchain/glibc/patches/100-fix_cross_rpcgen.patch index f10efcc5d6..6ee1e80424 100644 --- a/toolchain/glibc/patches/100-fix_cross_rpcgen.patch +++ b/toolchain/glibc/patches/100-fix_cross_rpcgen.patch @@ -33,20 +33,3 @@ +typedef char *caddr_t; # define __daddr_t_defined #endif - ---- a/sunrpc/rpc_main.c -+++ b/sunrpc/rpc_main.c -@@ -958,9 +958,10 @@ mkfile_output (struct commandline *cmd) - abort (); - temp = strrchr (cmd->infile, '.'); - cp = stpcpy (mkfilename, "Makefile."); -- if (temp != NULL) -- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0'; -- else -+ if (temp != NULL) { -+ strncpy(cp, cmd->infile, temp - cmd->infile); -+ cp[temp - cmd->infile - 1] = 0; -+ } else - stpcpy (cp, cmd->infile); - - } From 682843adadd753f174c4d7a8b1e487f7ee91e53a Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Tue, 3 Nov 2020 20:08:03 +0000 Subject: [PATCH 02/31] hostapd: add a hostapd-basic-wolfssl variant If only AP mode is needed, this is currently the most space-efficient way to provide support for WPA{2,3}-PSK, 802.11w and 802.11r. openwrt-ath79-generic-ubnt_nanostation-loco-m-squashfs-sysupgrade.bin sizes: 4719426 bytes (with wpad-basic-wolfssl) 4457282 bytes (with hostapd-basic-wolfssl) Signed-off-by: Rui Salvaterra --- package/network/services/hostapd/Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index f076eba88f..8c884386f2 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -204,6 +204,17 @@ define Package/hostapd-basic-openssl/description This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support. endef +define Package/hostapd-basic-wolfssl +$(call Package/hostapd/Default,$(1)) + TITLE+= (WPA-PSK, 11r and 11w) + VARIANT:=basic-wolfssl + DEPENDS+=+libwolfssl +endef + +define Package/hostapd-basic-wolfssl/description + This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support. +endef + define Package/hostapd-mini $(call Package/hostapd/Default,$(1)) TITLE+= (WPA-PSK only) @@ -598,6 +609,7 @@ define Package/hostapd/install endef Package/hostapd-basic/install = $(Package/hostapd/install) Package/hostapd-basic-openssl/install = $(Package/hostapd/install) +Package/hostapd-basic-wolfssl/install = $(Package/hostapd/install) Package/hostapd-mini/install = $(Package/hostapd/install) Package/hostapd-openssl/install = $(Package/hostapd/install) Package/hostapd-wolfssl/install = $(Package/hostapd/install) @@ -668,6 +680,7 @@ endif $(eval $(call BuildPackage,hostapd)) $(eval $(call BuildPackage,hostapd-basic)) $(eval $(call BuildPackage,hostapd-basic-openssl)) +$(eval $(call BuildPackage,hostapd-basic-wolfssl)) $(eval $(call BuildPackage,hostapd-mini)) $(eval $(call BuildPackage,hostapd-openssl)) $(eval $(call BuildPackage,hostapd-wolfssl)) From b1b8abaf588e7ec269e924828bcd40a0a9738b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 4 Nov 2020 08:01:04 +0100 Subject: [PATCH 03/31] rtl838x: clean whitespace issues in rtl8382_d-link_dgs-1210-16.dts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So it's tidy. Signed-off-by: Petr Štetiar --- target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts index 2d7abc00db..3fb3cfb353 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts @@ -12,7 +12,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - }; + }; chosen { bootargs = "console=ttyS0,115200"; @@ -90,7 +90,7 @@ regmap = <ðernet0>; #address-cells = <1>; #size-cells = <0>; - + /* External phy RTL8218B */ phy0: ethernet-phy@0 { reg = <0>; @@ -166,7 +166,7 @@ compatible = "ethernet-phy-ieee802.3-c22"; phy-is-integrated; }; - + /* External phy: RTL8214FC */ phy24: ethernet-phy@24 { compatible = "ethernet-phy-ieee802.3-c22"; @@ -248,7 +248,6 @@ phy-handle = <&phy7>; phy-mode = "qsgmii"; }; - port@8 { reg = <8>; label = "lan9"; From aeb26f8434bdc9d4263328a0b7493fae5d74b334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 4 Nov 2020 10:39:42 +0100 Subject: [PATCH 04/31] rtl838x: d-link_dgs-1210: refactor common family bits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So the common bits can be easily shared with other boards in the family and while at it add missing SPDX license identifiers into the DTS files and fixed alphabetic sorting of the devices in the images. Signed-off-by: Petr Štetiar --- .../dts/rtl8382_d-link_dgs-1210-10p.dts | 2 + .../dts/rtl8382_d-link_dgs-1210-16.dts | 81 +----------------- .../rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi | 84 +++++++++++++++++++ target/linux/rtl838x/image/Makefile | 16 ++-- 4 files changed, 97 insertions(+), 86 deletions(-) create mode 100644 target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts index d7c6cbfc7c..89e3746ad5 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + #include "rtl838x.dtsi" #include diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts index 3fb3cfb353..3843af1371 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts @@ -1,87 +1,10 @@ -#include "rtl838x.dtsi" +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include -#include +#include "rtl8382_d-link_dgs-1210.dtsi" / { compatible = "d-link,dgs-1210-16", "realtek,rtl838x-soc"; model = "D-Link DGS-1210-16"; - - aliases { - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - chosen { - bootargs = "console=ttyS0,115200"; - }; - - leds { - compatible = "gpio-leds"; - - led_power: power { - label = "green:power"; - gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&gpio0 { - indirect-access-bus-id = <0>; -}; - -&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 = <0x00000000 0x80000>; - read-only; - }; - partition@80000 { - label = "u-boot-env"; - reg = <0x00080000 0x40000>; - read-only; - }; - partition@c0000 { - label = "u-boot-env2"; - reg = <0x000c0000 0x40000>; - read-only; - }; - partition@280000 { - label = "firmware"; - compatible = "denx,uimage"; - reg = <0x00100000 0xd80000>; - }; - partition@be80000 { - label = "kernel2"; - reg = <0x00e80000 0x180000>; - }; - partition@1000000 { - label = "sysinfo"; - reg = <0x01000000 0x40000>; - }; - partition@1040000 { - label = "rootfs2"; - reg = <0x01040000 0xc00000>; - }; - partition@1c40000 { - label = "jffs2"; - reg = <0x01c40000 0x3c0000>; - }; - }; - }; }; ðernet0 { diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi new file mode 100644 index 0000000000..74043c097a --- /dev/null +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210.dtsi @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl838x.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio0 { + indirect-access-bus-id = <0>; +}; + +&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 = <0x00000000 0x80000>; + read-only; + }; + partition@80000 { + label = "u-boot-env"; + reg = <0x00080000 0x40000>; + read-only; + }; + partition@c0000 { + label = "u-boot-env2"; + reg = <0x000c0000 0x40000>; + read-only; + }; + partition@280000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x00100000 0xd80000>; + }; + partition@be80000 { + label = "kernel2"; + reg = <0x00e80000 0x180000>; + }; + partition@1000000 { + label = "sysinfo"; + reg = <0x01000000 0x40000>; + }; + partition@1040000 { + label = "rootfs2"; + reg = <0x01040000 0xc00000>; + }; + partition@1c40000 { + label = "jffs2"; + reg = <0x01c40000 0x3c0000>; + }; + }; + }; +}; diff --git a/target/linux/rtl838x/image/Makefile b/target/linux/rtl838x/image/Makefile index f490fa7ffe..cd384c5345 100644 --- a/target/linux/rtl838x/image/Makefile +++ b/target/linux/rtl838x/image/Makefile @@ -41,22 +41,24 @@ define Device/allnet_all-sg8208m endef TARGET_DEVICES += allnet_all-sg8208m -define Device/d-link_dgs-1210-16 +define Device/d-link_dgs-1210 SOC := rtl8382 IMAGE_SIZE := 13824k DEVICE_VENDOR := D-Link - DEVICE_MODEL := DGS-1210-16 DEVICE_PACKAGES := ip-full ip-bridge ethtool tc endef -TARGET_DEVICES += d-link_dgs-1210-16 define Device/d-link_dgs-1210-10p - SOC := rtl8382 - IMAGE_SIZE := 13824k - DEVICE_VENDOR := D-Link + $(Device/d-link_dgs-1210) DEVICE_MODEL := DGS-1210-10P - DEVICE_PACKAGES := ip-full ip-bridge ethtool tc lua-rs232 + DEVICE_PACKAGES += lua-rs232 endef TARGET_DEVICES += d-link_dgs-1210-10p +define Device/d-link_dgs-1210-16 + $(Device/d-link_dgs-1210) + DEVICE_MODEL := DGS-1210-16 +endef +TARGET_DEVICES += d-link_dgs-1210-16 + $(eval $(call BuildImage)) From b5bd945733a7ed235777c2ceaa0ff27dc779630f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 4 Nov 2020 11:37:42 +0100 Subject: [PATCH 05/31] rtl838x: add support for D-Link DGS-1210-28 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hardware specification ---------------------- * RTL8382M SoC, 1 MIPS 4KEc core @ 500MHz * 128MB DRAM * 32MB NOR Flash (MX25L25635E) * 24 x 10/100/1000BASE-T ports - Internal PHY with 8 ports (RTL8218B) - Two external PHYs with 8 ports each (RTL8218B) * 4 x Gigabit RJ45/SFP Combo ports - External PHY with 4 SFP ports (RTL8214FC) * Power LED * Reset button on front panel * UART (115200 8N1) via unpopulated standard 0.1" pin header marked J6 UART pinout ----------- [oooo]J3 [o]ooo|J6 | ^ ||`------ GND | | |`------- RX | | `-------- TX | `---------- Vcc (3V3) | `------------------ J3 is power input connector nearby J6 UART Boot initramfs image from U-Boot -------------------------------- 1. Press Escape key during `Hit Esc key to stop autoboot` prompt 2. Press CTRL+C keys to get into real U-Boot prompt 3. Init network with `rtk network on` command 4. Load image with `tftpboot 0x8f000000 openwrt-rtl838x-generic-d-link_dgs-1210-28-initramfs-kernel.bin` command 5. Boot the image with `bootm` command To install, upload the sysupgrade image to the OEM webpage or sysupgrade from the system running from initramfs image. It has been developed and tested on device with F1 revision. Signed-off-by: Petr Štetiar --- .../dts/rtl8382_d-link_dgs-1210-28.dts | 339 ++++++++++++++++++ target/linux/rtl838x/image/Makefile | 5 + 2 files changed, 344 insertions(+) create mode 100644 target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts new file mode 100644 index 0000000000..f154ca963d --- /dev/null +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts @@ -0,0 +1,339 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl8382_d-link_dgs-1210.dtsi" + +/ { + compatible = "d-link,dgs-1210-28", "realtek,rtl838x-soc"; + model = "D-Link DGS-1210-28"; +}; + +ðernet0 { + mdio: mdio-bus { + compatible = "realtek,rtl838x-mdio"; + regmap = <ðernet0>; + #address-cells = <1>; + #size-cells = <0>; + + /* External phy RTL8218B */ + phy0: ethernet-phy@0 { + reg = <0>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy1: ethernet-phy@1 { + reg = <1>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy2: ethernet-phy@2 { + reg = <2>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy3: ethernet-phy@3 { + reg = <3>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy4: ethernet-phy@4 { + reg = <4>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy5: ethernet-phy@5 { + reg = <5>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy6: ethernet-phy@6 { + reg = <6>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy7: ethernet-phy@7 { + reg = <7>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + + /* Internal phy RTL8218B */ + phy8: ethernet-phy@8 { + reg = <8>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy9: ethernet-phy@9 { + reg = <9>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy10: ethernet-phy@10 { + reg = <10>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy11: ethernet-phy@11 { + reg = <11>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy12: ethernet-phy@12 { + reg = <12>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy13: ethernet-phy@13 { + reg = <13>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy14: ethernet-phy@14 { + reg = <14>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + phy15: ethernet-phy@15 { + reg = <15>; + compatible = "ethernet-phy-ieee802.3-c22"; + phy-is-integrated; + }; + + /* External phy RTL8218B */ + phy16: ethernet-phy@16 { + reg = <16>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy17: ethernet-phy@17 { + reg = <17>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy18: ethernet-phy@18 { + reg = <18>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy19: ethernet-phy@19 { + reg = <19>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy20: ethernet-phy@20 { + reg = <20>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy21: ethernet-phy@21 { + reg = <21>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy22: ethernet-phy@22 { + reg = <22>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + phy23: ethernet-phy@23 { + reg = <23>; + compatible = "ethernet-phy-ieee802.3-c22"; + }; + + /* External phy: RTL8214FC */ + phy24: ethernet-phy@24 { + compatible = "ethernet-phy-ieee802.3-c22"; + sfp; + media = "fibre"; + reg = <24>; + }; + phy25: ethernet-phy@25 { + compatible = "ethernet-phy-ieee802.3-c22"; + sfp; + media = "fibre"; + reg = <25>; + }; + phy26: ethernet-phy@26 { + compatible = "ethernet-phy-ieee802.3-c22"; + sfp; + media = "fibre"; + reg = <26>; + }; + phy27: ethernet-phy@27 { + compatible = "ethernet-phy-ieee802.3-c22"; + sfp; + media = "fibre"; + reg = <27>; + }; + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + phy-handle = <&phy0>; + phy-mode = "qsgmii"; + }; + port@1 { + reg = <1>; + label = "lan2"; + phy-handle = <&phy1>; + phy-mode = "qsgmii"; + }; + port@2 { + reg = <2>; + label = "lan3"; + phy-handle = <&phy2>; + phy-mode = "qsgmii"; + }; + port@3 { + reg = <3>; + label = "lan4"; + phy-handle = <&phy3>; + phy-mode = "qsgmii"; + }; + port@4 { + reg = <4>; + label = "lan5"; + phy-handle = <&phy4>; + phy-mode = "qsgmii"; + }; + port@5 { + reg = <5>; + label = "lan6"; + phy-handle = <&phy5>; + phy-mode = "qsgmii"; + }; + port@6 { + reg = <6>; + label = "lan7"; + phy-handle = <&phy6>; + phy-mode = "qsgmii"; + }; + port@7 { + reg = <7>; + label = "lan8"; + phy-handle = <&phy7>; + phy-mode = "qsgmii"; + }; + port@8 { + reg = <8>; + label = "lan9"; + phy-handle = <&phy8>; + phy-mode = "internal"; + }; + port@9 { + reg = <9>; + label = "lan10"; + phy-handle = <&phy9>; + phy-mode = "internal"; + }; + port@10 { + reg = <10>; + label = "lan11"; + phy-handle = <&phy10>; + phy-mode = "internal"; + }; + port@11 { + reg = <11>; + label = "lan12"; + phy-handle = <&phy11>; + phy-mode = "internal"; + }; + port@12 { + reg = <12>; + label = "lan13"; + phy-handle = <&phy12>; + phy-mode = "internal"; + }; + port@13 { + reg = <13>; + label = "lan14"; + phy-handle = <&phy13>; + phy-mode = "internal"; + }; + port@14 { + reg = <14>; + label = "lan15"; + phy-handle = <&phy14>; + phy-mode = "internal"; + }; + port@15 { + reg = <15>; + label = "lan16"; + phy-handle = <&phy15>; + phy-mode = "internal"; + }; + port@16 { + reg = <16>; + label = "lan17"; + phy-handle = <&phy16>; + phy-mode = "qsgmii"; + }; + port@17 { + reg = <17>; + label = "lan18"; + phy-handle = <&phy17>; + phy-mode = "qsgmii"; + }; + port@18 { + reg = <18>; + label = "lan19"; + phy-handle = <&phy18>; + phy-mode = "qsgmii"; + }; + port@19 { + reg = <19>; + label = "lan20"; + phy-handle = <&phy19>; + phy-mode = "qsgmii"; + }; + port@20 { + reg = <20>; + label = "lan21"; + phy-handle = <&phy20>; + phy-mode = "qsgmii"; + }; + port@21 { + reg = <21>; + label = "lan22"; + phy-handle = <&phy21>; + phy-mode = "qsgmii"; + }; + port@22 { + reg = <22>; + label = "lan23"; + phy-handle = <&phy22>; + phy-mode = "qsgmii"; + }; + port@23 { + reg = <23>; + label = "lan24"; + phy-handle = <&phy23>; + phy-mode = "qsgmii"; + }; + + port@24 { + reg = <24>; + label = "lan25"; + phy-handle = <&phy24>; + phy-mode = "qsgmii"; + }; + port@25 { + reg = <25>; + label = "lan26"; + phy-handle = <&phy25>; + phy-mode = "qsgmii"; + }; + port@26 { + reg = <26>; + label = "lan27"; + phy-handle = <&phy26>; + phy-mode = "qsgmii"; + }; + port@27 { + reg = <27>; + label = "lan28"; + phy-handle = <&phy27>; + phy-mode = "qsgmii"; + }; + port@28 { + ethernet = <ðernet0>; + reg = <28>; + phy-mode = "internal"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/target/linux/rtl838x/image/Makefile b/target/linux/rtl838x/image/Makefile index cd384c5345..51acd41c76 100644 --- a/target/linux/rtl838x/image/Makefile +++ b/target/linux/rtl838x/image/Makefile @@ -61,4 +61,9 @@ define Device/d-link_dgs-1210-16 endef TARGET_DEVICES += d-link_dgs-1210-16 +define Device/d-link_dgs-1210-28 + $(Device/d-link_dgs-1210) + DEVICE_MODEL := DGS-1210-28 +endef +TARGET_DEVICES += d-link_dgs-1210-28 $(eval $(call BuildImage)) From 2ab6add9b9171099c5bcd993cb8a3d355b6f3ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 4 Nov 2020 16:43:16 +0100 Subject: [PATCH 06/31] rtl838x: rtl838x.dtsi: remove reg property from root node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following dtc warning: ../dts/rtl838x.dtsi:38.3-145.3: Warning (reg_format): /: Root node has a "reg" property Signed-off-by: Petr Štetiar --- target/linux/rtl838x/dts/rtl838x.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/rtl838x/dts/rtl838x.dtsi b/target/linux/rtl838x/dts/rtl838x.dtsi index 5d562063ea..699a621f62 100644 --- a/target/linux/rtl838x/dts/rtl838x.dtsi +++ b/target/linux/rtl838x/dts/rtl838x.dtsi @@ -7,7 +7,6 @@ #size-cells = <1>; compatible = "realtek,rtl838x-soc"; - reg = <0xbb000000 0xa000>; cpus { #address-cells = <1>; From 0516aa398cc73a2fec90db5795f7b1d73feefbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 4 Nov 2020 16:53:47 +0100 Subject: [PATCH 07/31] rtl838x: rtl838x.dtsi: fix missing interrupt-parent for uart0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following dtc warning: Warning (interrupts_property): /uart@b8002000: Missing interrupt-parent Signed-off-by: Petr Štetiar --- target/linux/rtl838x/dts/rtl838x.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/rtl838x/dts/rtl838x.dtsi b/target/linux/rtl838x/dts/rtl838x.dtsi index 699a621f62..99c324bf52 100644 --- a/target/linux/rtl838x/dts/rtl838x.dtsi +++ b/target/linux/rtl838x/dts/rtl838x.dtsi @@ -53,6 +53,8 @@ reg = <0xb8002000 0x100>; clock-frequency = <200000000>; + + interrupt-parent = <&cpuintc>; interrupts = <31>; reg-io-width = <1>; From e26744551039ef8d33786948a830ba5aa0a988b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 4 Nov 2020 16:20:17 +0100 Subject: [PATCH 08/31] rtl838x: dts: use macros for phy and switch definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's quite more readable, saves some tedious copy&pasting, not so error prone etc. Signed-off-by: Petr Štetiar --- .../dts/rtl8382_allnet_all-sg8208m.dts | 111 +----- .../dts/rtl8382_d-link_dgs-1210-10p.dts | 125 +----- .../dts/rtl8382_d-link_dgs-1210-16.dts | 261 ++----------- .../dts/rtl8382_d-link_dgs-1210-28.dts | 359 +++--------------- target/linux/rtl838x/dts/rtl838x.dtsi | 33 ++ 5 files changed, 170 insertions(+), 719 deletions(-) diff --git a/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts b/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts index 5433b7f372..a5dd3be0a4 100644 --- a/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts +++ b/target/linux/rtl838x/dts/rtl8382_allnet_all-sg8208m.dts @@ -103,46 +103,14 @@ #address-cells = <1>; #size-cells = <0>; - /* Internal phy */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) }; }; @@ -151,61 +119,14 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <8>; - label = "lan1"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - - port@1 { - reg = <9>; - label = "lan2"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - - port@2 { - reg = <10>; - label = "lan3"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - - port@3 { - reg = <11>; - label = "lan4"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - - port@4 { - reg = <12>; - label = "lan5"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - - port@5 { - reg = <13>; - label = "lan6"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - - port@6 { - reg = <14>; - label = "lan7"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - - port@7 { - reg = <15>; - label = "lan8"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; + SWITCH_PORT(8, 1, internal) + SWITCH_PORT(9, 2, internal) + SWITCH_PORT(10, 3, internal) + SWITCH_PORT(11, 4, internal) + SWITCH_PORT(12, 5, internal) + SWITCH_PORT(13, 6, internal) + SWITCH_PORT(14, 7, internal) + SWITCH_PORT(15, 8, internal) port@28 { ethernet = <ðernet0>; diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts index 89e3746ad5..9987316c21 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-10p.dts @@ -99,8 +99,6 @@ }; }; - - ðernet0 { mdio: mdio-bus { compatible = "realtek,rtl838x-mdio"; @@ -108,49 +106,16 @@ #address-cells = <1>; #size-cells = <0>; - /* Internal phy */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy24: ethernet-phy@24 { - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - reg = <24>; - }; - phy26: ethernet-phy@26 { - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - reg = <26>; - }; + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + INTERNAL_PHY(24) + INTERNAL_PHY(26) }; }; @@ -159,67 +124,17 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <8>; - label = "lan1"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - port@1 { - reg = <9>; - label = "lan2"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - port@2 { - reg = <10>; - label = "lan3"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - port@3 { - reg = <11>; - label = "lan4"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - port@4 { - reg = <12>; - label = "lan5"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - port@5 { - reg = <13>; - label = "lan6"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - port@6 { - reg = <14>; - label = "lan7"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - port@7 { - reg = <15>; - label = "lan8"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; + SWITCH_PORT(8, 1, internal) + SWITCH_PORT(9, 2, internal) + SWITCH_PORT(10, 3, internal) + SWITCH_PORT(11, 4, internal) + SWITCH_PORT(12, 5, internal) + SWITCH_PORT(13, 6, internal) + SWITCH_PORT(14, 7, internal) + SWITCH_PORT(15, 8, internal) + SWITCH_PORT(24, 9, internal) + SWITCH_PORT(26, 10, internal) - port@24 { - reg = <24>; - label = "lan9"; - phy-mode = "internal"; - phy-handle = <&phy24>; - }; - port@26 { - reg = <26>; - label = "lan10"; - phy-mode = "internal"; - phy-handle = <&phy26>; - }; port@28 { ethernet = <ðernet0>; reg = <28>; diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts index 3843af1371..ac51185ed0 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-16.dts @@ -14,107 +14,28 @@ #address-cells = <1>; #size-cells = <0>; - /* External phy RTL8218B */ - phy0: ethernet-phy@0 { - reg = <0>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy1: ethernet-phy@1 { - reg = <1>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy2: ethernet-phy@2 { - reg = <2>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy3: ethernet-phy@3 { - reg = <3>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy4: ethernet-phy@4 { - reg = <4>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy5: ethernet-phy@5 { - reg = <5>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy6: ethernet-phy@6 { - reg = <6>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy7: ethernet-phy@7 { - reg = <7>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) - /* Internal phy RTL8218B */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) - /* External phy: RTL8214FC */ - phy24: ethernet-phy@24 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <24>; - }; - phy25: ethernet-phy@25 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <25>; - }; - phy26: ethernet-phy@26 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <26>; - }; - phy27: ethernet-phy@27 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <27>; - }; + EXTERNAL_SFP_PHY(24) + EXTERNAL_SFP_PHY(25) + EXTERNAL_SFP_PHY(26) + EXTERNAL_SFP_PHY(27) }; }; @@ -123,127 +44,29 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <0>; - label = "lan1"; - phy-handle = <&phy0>; - phy-mode = "qsgmii"; - }; - port@1 { - reg = <1>; - label = "lan2"; - phy-handle = <&phy1>; - phy-mode = "qsgmii"; - }; - port@2 { - reg = <2>; - label = "lan3"; - phy-handle = <&phy2>; - phy-mode = "qsgmii"; - }; - port@3 { - reg = <3>; - label = "lan4"; - phy-handle = <&phy3>; - phy-mode = "qsgmii"; - }; - port@4 { - reg = <4>; - label = "lan5"; - phy-handle = <&phy4>; - phy-mode = "qsgmii"; - }; - port@5 { - reg = <5>; - label = "lan6"; - phy-handle = <&phy5>; - phy-mode = "qsgmii"; - }; - port@6 { - reg = <6>; - label = "lan7"; - phy-handle = <&phy6>; - phy-mode = "qsgmii"; - }; - port@7 { - reg = <7>; - label = "lan8"; - phy-handle = <&phy7>; - phy-mode = "qsgmii"; - }; - port@8 { - reg = <8>; - label = "lan9"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - port@9 { - reg = <9>; - label = "lan10"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - port@10 { - reg = <10>; - label = "lan11"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - port@11 { - reg = <11>; - label = "lan12"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - port@12 { - reg = <12>; - label = "lan13"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - port@13 { - reg = <13>; - label = "lan14"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - port@14 { - reg = <14>; - label = "lan15"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - port@15 { - reg = <15>; - label = "lan16"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, internal) + SWITCH_PORT(9, 10, internal) + SWITCH_PORT(10, 11, internal) + SWITCH_PORT(11, 12, internal) + SWITCH_PORT(12, 13, internal) + SWITCH_PORT(13, 14, internal) + SWITCH_PORT(14, 15, internal) + SWITCH_PORT(15, 16, internal) + + SWITCH_PORT(24, 17, qsgmii) + SWITCH_PORT(25, 18, qsgmii) + SWITCH_PORT(26, 19, qsgmii) + SWITCH_PORT(27, 20, qsgmii) - port@24 { - reg = <24>; - label = "lan17"; - phy-handle = <&phy24>; - phy-mode = "qsgmii"; - }; - port@25 { - reg = <25>; - label = "lan18"; - phy-handle = <&phy25>; - phy-mode = "qsgmii"; - }; - port@26 { - reg = <26>; - label = "lan19"; - phy-handle = <&phy26>; - phy-mode = "qsgmii"; - }; - port@27 { - reg = <27>; - label = "lan20"; - phy-handle = <&phy27>; - phy-mode = "qsgmii"; - }; port@28 { ethernet = <ðernet0>; reg = <28>; diff --git a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts index f154ca963d..edd4fb140f 100644 --- a/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts +++ b/target/linux/rtl838x/dts/rtl8382_d-link_dgs-1210-28.dts @@ -14,141 +14,37 @@ #address-cells = <1>; #size-cells = <0>; - /* External phy RTL8218B */ - phy0: ethernet-phy@0 { - reg = <0>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy1: ethernet-phy@1 { - reg = <1>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy2: ethernet-phy@2 { - reg = <2>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy3: ethernet-phy@3 { - reg = <3>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy4: ethernet-phy@4 { - reg = <4>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy5: ethernet-phy@5 { - reg = <5>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy6: ethernet-phy@6 { - reg = <6>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy7: ethernet-phy@7 { - reg = <7>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) - /* Internal phy RTL8218B */ - phy8: ethernet-phy@8 { - reg = <8>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy9: ethernet-phy@9 { - reg = <9>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy10: ethernet-phy@10 { - reg = <10>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy11: ethernet-phy@11 { - reg = <11>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy12: ethernet-phy@12 { - reg = <12>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy13: ethernet-phy@13 { - reg = <13>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy14: ethernet-phy@14 { - reg = <14>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; - phy15: ethernet-phy@15 { - reg = <15>; - compatible = "ethernet-phy-ieee802.3-c22"; - phy-is-integrated; - }; + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) - /* External phy RTL8218B */ - phy16: ethernet-phy@16 { - reg = <16>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy17: ethernet-phy@17 { - reg = <17>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy18: ethernet-phy@18 { - reg = <18>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy19: ethernet-phy@19 { - reg = <19>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy20: ethernet-phy@20 { - reg = <20>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy21: ethernet-phy@21 { - reg = <21>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy22: ethernet-phy@22 { - reg = <22>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; - phy23: ethernet-phy@23 { - reg = <23>; - compatible = "ethernet-phy-ieee802.3-c22"; - }; + EXTERNAL_PHY(16) + EXTERNAL_PHY(17) + EXTERNAL_PHY(18) + EXTERNAL_PHY(19) + EXTERNAL_PHY(20) + EXTERNAL_PHY(21) + EXTERNAL_PHY(22) + EXTERNAL_PHY(23) - /* External phy: RTL8214FC */ - phy24: ethernet-phy@24 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <24>; - }; - phy25: ethernet-phy@25 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <25>; - }; - phy26: ethernet-phy@26 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <26>; - }; - phy27: ethernet-phy@27 { - compatible = "ethernet-phy-ieee802.3-c22"; - sfp; - media = "fibre"; - reg = <27>; - }; + EXTERNAL_SFP_PHY(24) + EXTERNAL_SFP_PHY(25) + EXTERNAL_SFP_PHY(26) + EXTERNAL_SFP_PHY(27) }; }; @@ -157,175 +53,38 @@ #address-cells = <1>; #size-cells = <0>; - port@0 { - reg = <0>; - label = "lan1"; - phy-handle = <&phy0>; - phy-mode = "qsgmii"; - }; - port@1 { - reg = <1>; - label = "lan2"; - phy-handle = <&phy1>; - phy-mode = "qsgmii"; - }; - port@2 { - reg = <2>; - label = "lan3"; - phy-handle = <&phy2>; - phy-mode = "qsgmii"; - }; - port@3 { - reg = <3>; - label = "lan4"; - phy-handle = <&phy3>; - phy-mode = "qsgmii"; - }; - port@4 { - reg = <4>; - label = "lan5"; - phy-handle = <&phy4>; - phy-mode = "qsgmii"; - }; - port@5 { - reg = <5>; - label = "lan6"; - phy-handle = <&phy5>; - phy-mode = "qsgmii"; - }; - port@6 { - reg = <6>; - label = "lan7"; - phy-handle = <&phy6>; - phy-mode = "qsgmii"; - }; - port@7 { - reg = <7>; - label = "lan8"; - phy-handle = <&phy7>; - phy-mode = "qsgmii"; - }; - port@8 { - reg = <8>; - label = "lan9"; - phy-handle = <&phy8>; - phy-mode = "internal"; - }; - port@9 { - reg = <9>; - label = "lan10"; - phy-handle = <&phy9>; - phy-mode = "internal"; - }; - port@10 { - reg = <10>; - label = "lan11"; - phy-handle = <&phy10>; - phy-mode = "internal"; - }; - port@11 { - reg = <11>; - label = "lan12"; - phy-handle = <&phy11>; - phy-mode = "internal"; - }; - port@12 { - reg = <12>; - label = "lan13"; - phy-handle = <&phy12>; - phy-mode = "internal"; - }; - port@13 { - reg = <13>; - label = "lan14"; - phy-handle = <&phy13>; - phy-mode = "internal"; - }; - port@14 { - reg = <14>; - label = "lan15"; - phy-handle = <&phy14>; - phy-mode = "internal"; - }; - port@15 { - reg = <15>; - label = "lan16"; - phy-handle = <&phy15>; - phy-mode = "internal"; - }; - port@16 { - reg = <16>; - label = "lan17"; - phy-handle = <&phy16>; - phy-mode = "qsgmii"; - }; - port@17 { - reg = <17>; - label = "lan18"; - phy-handle = <&phy17>; - phy-mode = "qsgmii"; - }; - port@18 { - reg = <18>; - label = "lan19"; - phy-handle = <&phy18>; - phy-mode = "qsgmii"; - }; - port@19 { - reg = <19>; - label = "lan20"; - phy-handle = <&phy19>; - phy-mode = "qsgmii"; - }; - port@20 { - reg = <20>; - label = "lan21"; - phy-handle = <&phy20>; - phy-mode = "qsgmii"; - }; - port@21 { - reg = <21>; - label = "lan22"; - phy-handle = <&phy21>; - phy-mode = "qsgmii"; - }; - port@22 { - reg = <22>; - label = "lan23"; - phy-handle = <&phy22>; - phy-mode = "qsgmii"; - }; - port@23 { - reg = <23>; - label = "lan24"; - phy-handle = <&phy23>; - phy-mode = "qsgmii"; - }; + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, internal) + SWITCH_PORT(9, 10, internal) + SWITCH_PORT(10, 11, internal) + SWITCH_PORT(11, 12, internal) + SWITCH_PORT(12, 13, internal) + SWITCH_PORT(13, 14, internal) + SWITCH_PORT(14, 15, internal) + SWITCH_PORT(15, 16, internal) + + SWITCH_PORT(16, 17, qsgmii) + SWITCH_PORT(17, 18, qsgmii) + SWITCH_PORT(18, 19, qsgmii) + SWITCH_PORT(19, 20, qsgmii) + SWITCH_PORT(20, 21, qsgmii) + SWITCH_PORT(21, 22, qsgmii) + SWITCH_PORT(22, 23, qsgmii) + SWITCH_PORT(23, 24, qsgmii) + + SWITCH_PORT(24, 25, qsgmii) + SWITCH_PORT(25, 26, qsgmii) + SWITCH_PORT(26, 27, qsgmii) + SWITCH_PORT(27, 28, qsgmii) - port@24 { - reg = <24>; - label = "lan25"; - phy-handle = <&phy24>; - phy-mode = "qsgmii"; - }; - port@25 { - reg = <25>; - label = "lan26"; - phy-handle = <&phy25>; - phy-mode = "qsgmii"; - }; - port@26 { - reg = <26>; - label = "lan27"; - phy-handle = <&phy26>; - phy-mode = "qsgmii"; - }; - port@27 { - reg = <27>; - label = "lan28"; - phy-handle = <&phy27>; - phy-mode = "qsgmii"; - }; port@28 { ethernet = <ðernet0>; reg = <28>; diff --git a/target/linux/rtl838x/dts/rtl838x.dtsi b/target/linux/rtl838x/dts/rtl838x.dtsi index 99c324bf52..37bbcefd44 100644 --- a/target/linux/rtl838x/dts/rtl838x.dtsi +++ b/target/linux/rtl838x/dts/rtl838x.dtsi @@ -2,6 +2,39 @@ /dts-v1/; +#define STRINGIZE(s) #s +#define LAN_LABEL(p, s) STRINGIZE(p ## s) +#define SWITCH_PORT_LABEL(n) LAN_LABEL(lan, n) + +#define INTERNAL_PHY(n) \ + phy##n: ethernet-phy@##n { \ + reg = <##n>; \ + compatible = "ethernet-phy-ieee802.3-c22"; \ + phy-is-integrated; \ + }; + +#define EXTERNAL_PHY(n) \ + phy##n: ethernet-phy@##n { \ + reg = <##n>; \ + compatible = "ethernet-phy-ieee802.3-c22"; \ + }; + +#define EXTERNAL_SFP_PHY(n) \ + phy##n: ethernet-phy@##n { \ + compatible = "ethernet-phy-ieee802.3-c22"; \ + sfp; \ + media = "fibre"; \ + reg = <##n>; \ + }; + +#define SWITCH_PORT(n, s, m) \ + port@##n { \ + reg = <##n>; \ + label = SWITCH_PORT_LABEL(s) ; \ + phy-handle = <&phy##n>; \ + phy-mode = #m ; \ + }; + / { #address-cells = <1>; #size-cells = <1>; From 91a0dc5161e25085a01edd66b1d8da19593dcc4a Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 16 Jul 2020 17:43:30 -1000 Subject: [PATCH 09/31] scripts: mkhash show -n option in usage The -n option prints the filename of hashed files next to the calculated checksum. Reflect that in the usage message. user@dawn:~/src/openwrt/openwrt$ ./a.out md5 -n .config eb06db36e7b6751cb18801945e46bf5d .config Signed-off-by: Paul Spooren --- scripts/mkhash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/mkhash.c b/scripts/mkhash.c index 0f5815f242..e26ca3a350 100644 --- a/scripts/mkhash.c +++ b/scripts/mkhash.c @@ -736,7 +736,10 @@ static int usage(const char *progname) { int i; - fprintf(stderr, "Usage: %s [...]\n" + fprintf(stderr, "Usage: %s [options] [...]\n" + "Options:\n" + " -n Print filename(s)\n" + "\n" "Supported hash types:", progname); for (i = 0; i < ARRAY_SIZE(types); i++) From fac98f1c54a16073e28ab11adf195f9917a30ef6 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 16 Jul 2020 22:19:31 -1000 Subject: [PATCH 10/31] scripts: mkhash fix return code handling If hashing a file fails mkhash shouldn't just silently fail. Now check after each call of `hash_file()` the return and exit early in case of errors. The return value which was previously ignored and would always return 0. Signed-off-by: Paul Spooren --- scripts/mkhash.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/mkhash.c b/scripts/mkhash.c index e26ca3a350..ce156e979d 100644 --- a/scripts/mkhash.c +++ b/scripts/mkhash.c @@ -823,8 +823,11 @@ int main(int argc, char **argv) if (argc < 2) return hash_file(t, NULL, add_filename); - for (i = 0; i < argc - 1; i++) - hash_file(t, argv[1 + i], add_filename); + for (i = 0; i < argc - 1; i++) { + int ret = hash_file(t, argv[1 + i], add_filename); + if (ret) + return ret; + } return 0; } From fcd3e13779ca644bfbb0940f39fdf13203bf8211 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 16 Jul 2020 22:19:32 -1000 Subject: [PATCH 11/31] scripts: mkhash fail on hashing a folder mkhash currently returns the hash of an empty input when trying to hash a folder. This can be missleading in caseswhere e.g. an env variable is undefined which should contain a filename. `mkhash ./path/to/$FILE` would exit with code 0 and return a legit looking checksum. A better behaviour would be to fail with exit code 1, which imitates the behaviour of `md5sum` and `sha256sum`. To avoid hashing of folders the `stat()` is checked. Hashing empty inputs result in the following checksums: md5: d41d8cd98f00b204e9800998ecf8427e sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 Signed-off-by: Paul Spooren --- scripts/mkhash.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/mkhash.c b/scripts/mkhash.c index ce156e979d..ced4f3c34a 100644 --- a/scripts/mkhash.c +++ b/scripts/mkhash.c @@ -85,6 +85,7 @@ #include #include #include +#include #define ARRAY_SIZE(_n) (sizeof(_n) / sizeof((_n)[0])) @@ -770,6 +771,13 @@ static int hash_file(struct hash_type *t, const char *filename, bool add_filenam if (!filename || !strcmp(filename, "-")) { str = t->func(stdin); } else { + struct stat path_stat; + stat(filename, &path_stat); + if (S_ISDIR(path_stat.st_mode)) { + fprintf(stderr, "Failed to open '%s': Is a directory\n", filename); + return 1; + } + FILE *f = fopen(filename, "r"); if (!f) { From 753309c7ddbe2efc7adf288af7f5b170f4f29674 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 31 Aug 2020 11:39:39 -1000 Subject: [PATCH 12/31] uhttpd: use P-256 for certs The uhttpd package takes care of creating self-signed certificates if px5g is installed. This improves the security of router management as it encrypts the LuCI connection. The EC P-256 curve is faster than RSA which which improves the user experience on embedded devices. EC P-256 is support for as old devices as Android 4.4. Signed-off-by: Paul Spooren --- package/network/services/uhttpd/files/uhttpd.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/uhttpd/files/uhttpd.config b/package/network/services/uhttpd/files/uhttpd.config index f368d08e8b..aeded08afc 100644 --- a/package/network/services/uhttpd/files/uhttpd.config +++ b/package/network/services/uhttpd/files/uhttpd.config @@ -119,13 +119,13 @@ config cert defaults option days 730 # key type: rsa or ec - option key_type rsa + option key_type ec # RSA key size option bits 2048 # EC curve name - # Curve names vary between mbedtls/px5g and openssl + # Curve names vary between px5g-{wolfssl,mbedtls} and openssl # P-256 or P-384 are guaranteed to work option ec_curve P-256 From 2e282537d00267774526ea5b4386ea3167b69c6a Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 2 Nov 2020 11:35:39 -1000 Subject: [PATCH 13/31] imagebuilder: fix sstrip Without an absolute path to staging_dir/host/bin/sstrip the Makefile tries to run a host installed version of sstrip, which is likely not available. Signed-off-by: Paul Spooren --- target/imagebuilder/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile index 1575f59b61..8b2f4e5af6 100644 --- a/target/imagebuilder/Makefile +++ b/target/imagebuilder/Makefile @@ -90,7 +90,7 @@ endif (cd $(PKG_BUILD_DIR); find staging_dir/host/bin/ $(IB_LDIR)/scripts/dtc/ -type f | \ $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(PKG_BUILD_DIR)/staging_dir/host) $(CP) $(TOPDIR)/staging_dir/host/lib/libfakeroot* $(PKG_BUILD_DIR)/staging_dir/host/lib - STRIP=sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/ + STRIP=$(STAGING_DIR_HOST)/bin/sstrip $(SCRIPT_DIR)/rstrip.sh $(PKG_BUILD_DIR)/staging_dir/host/bin/ (cd $(BUILD_DIR); \ tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(IB_NAME) \ --mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \ From 9eb9943f82e0b2d5e32ffe1c63f5a82caca5094d Mon Sep 17 00:00:00 2001 From: "W. Michael Petullo" Date: Sun, 1 Nov 2020 07:44:56 -0600 Subject: [PATCH 14/31] refpolicy: add variant that builds modular policy This adds a variant of refpolicy that builds the modular form of the policy. While this requires more memory on the target device, along with some tricks to deal with OpenWrt's volatile /var directory, it is useful for experiementing with SELinux policy. Signed-off-by: W. Michael Petullo --- config/Config-build.in | 6 ++++++ package/system/refpolicy/Makefile | 35 +++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/config/Config-build.in b/config/Config-build.in index 8e12199cbd..178afbdb94 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -362,6 +362,12 @@ menu "Global build settings" help SELinux Reference Policy (refpolicy) + config SELINUXTYPE_targeted-modular + bool "targeted-modular" + select PACKAGE_refpolicy-modular + help + Modular SELinux Reference Policy (refpolicy-modular) + config SELINUXTYPE_dssp bool "dssp" select PACKAGE_selinux-policy diff --git a/package/system/refpolicy/Makefile b/package/system/refpolicy/Makefile index a431770955..d9c8c90208 100644 --- a/package/system/refpolicy/Makefile +++ b/package/system/refpolicy/Makefile @@ -24,7 +24,7 @@ TAR_OPTIONS:=--transform='s%^refpolicy%$(PKG_NAME)-$(PKG_VERSION)%' -xf - include $(INCLUDE_DIR)/package.mk -define Package/refpolicy +define Package/refpolicy/Default SECTION:=system CATEGORY:=Base system TITLE:=SELinux reference policy @@ -32,6 +32,19 @@ define Package/refpolicy PKGARCH:=all endef +define Package/refpolicy + $(call Package/refpolicy/Default) + CONFLICTS:=refpolicy-modular + VARIANT:=default +endef + +define Package/refpolicy-modular + $(call Package/refpolicy/Default) + TITLE += (modular) + VARIANT:=modular + PROVIDES:=refpolicy +endef + define Package/refpolicy/description The SELinux Reference Policy project (refpolicy) is a complete SELinux policy that can be used as the system @@ -56,25 +69,43 @@ endef # builds is a small host tool that gets run as part of the build # process. MAKE_FLAGS += \ + DESTDIR="$(PKG_INSTALL_DIR)" SETFILES="$(STAGING_DIR_HOST)/bin/setfiles" \ CHECKPOLICY="$(STAGING_DIR_HOSTPKG)/bin/checkpolicy" \ CC="$(HOSTCC)" \ CFLAGS="$(HOST_CFLAGS)" define Build/Configure - $(SED) "/MONOLITHIC/c\MONOLITHIC = y" $(PKG_BUILD_DIR)/build.conf $(SED) "/NAME/c\NAME = targeted" $(PKG_BUILD_DIR)/build.conf +ifneq ($(BUILD_VARIANT),modular) + $(SED) "/MONOLITHIC/c\MONOLITHIC = y" $(PKG_BUILD_DIR)/build.conf +endif $(call Build/Compile/Default,conf) endef +ifeq ($(BUILD_VARIANT),modular) +define Build/Install + $(call Build/Compile/Default,install install-headers) +endef +endif + define Package/refpolicy/conffiles /etc/selinux/config endef +Package/refpolicy-modular/conffiles = $(Package/refpolicy/conffiles) + define Package/refpolicy/install $(INSTALL_DIR) $(1)/etc/selinux $(CP) $(PKG_INSTALL_DIR)/etc/selinux/* $(1)/etc/selinux/ $(CP) ./files/selinux-config $(1)/etc/selinux/config +ifeq ($(BUILD_VARIANT),modular) + $(INSTALL_DIR) $(1)/usr/share/selinux + $(CP) $(PKG_INSTALL_DIR)/usr/share/selinux/* $(1)/usr/share/selinux/ +endif endef +Package/refpolicy-modular/install = $(Package/refpolicy/install) + $(eval $(call BuildPackage,refpolicy)) +$(eval $(call BuildPackage,refpolicy-modular)) From a86c0d97b5d74912ddfff1f1de8f01f519ee4cd1 Mon Sep 17 00:00:00 2001 From: Jan Pavlinec Date: Mon, 9 Nov 2020 15:58:39 +0100 Subject: [PATCH 15/31] dnsmasq: explictly set ednspacket_max value This is related to DNS Flag Day 2020. It sets default ends buffer size value to 1232. Signed-off-by: Jan Pavlinec --- package/network/services/dnsmasq/Makefile | 2 +- package/network/services/dnsmasq/files/dhcp.conf | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index cbbbad7b87..4086aa25e0 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_UPSTREAM_VERSION:=2.82 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq diff --git a/package/network/services/dnsmasq/files/dhcp.conf b/package/network/services/dnsmasq/files/dhcp.conf index 19052e2333..8c42ef782e 100644 --- a/package/network/services/dnsmasq/files/dhcp.conf +++ b/package/network/services/dnsmasq/files/dhcp.conf @@ -20,6 +20,7 @@ config dnsmasq #list notinterface lo #list bogusnxdomain '64.94.110.11' option localservice 1 # disable to allow DNS requests from non-local subnets + option ednspacket_max 1232 config dhcp lan option interface lan From fe302d472a9ace858ccbf0ba2833c9f3469d02f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 9 Nov 2020 18:15:53 +0100 Subject: [PATCH 16/31] rtl838x: fine tune default package set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Althought most of the switches aren't routers, they can be used as such, so let's add some of the packages from the router's DEVICE_TYPE. While at it, remove swconfig package which is not needed on DSA targets. Acked-by: John Crispin Signed-off-by: Petr Štetiar --- target/linux/rtl838x/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/rtl838x/Makefile b/target/linux/rtl838x/Makefile index 83cb074b89..a4e203718d 100644 --- a/target/linux/rtl838x/Makefile +++ b/target/linux/rtl838x/Makefile @@ -21,6 +21,7 @@ include $(INCLUDE_DIR)/target.mk FEATURES := $(filter-out mips16,$(FEATURES)) -DEFAULT_PACKAGES += swconfig uboot-envtools ethtool kmod-gpio-button-hotplug +DEFAULT_PACKAGES += uboot-envtools ethtool kmod-gpio-button-hotplug \ + dnsmasq firewall ip6tables iptables odhcp6c odhcpd-ipv6only $(eval $(call BuildTarget)) From d4521fb132266fd6c94796e19d3d1e925847338d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 9 Nov 2020 21:46:01 +0100 Subject: [PATCH 17/31] tools: fakeroot: rework relocatable patch to avoid LD_LIBRARY_PATH usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to the use of LD_LIBRARY_PATH, the programs running in the fakeroot environment may end up loading bundled SDK libraries using the system ld.so. Rework the relocatability patch to avoid meddling with LD_LIBRARY_PATH and construct the paths to faked and libfakeroot.so directly. Fixes: f93cb5c2c8 ("fakeroot: make fakeroot script relocatable") Reviewed-by: Petr Štetiar Signed-off-by: Jo-Philipp Wich --- tools/fakeroot/patches/000-relocatable.patch | 26 +++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tools/fakeroot/patches/000-relocatable.patch b/tools/fakeroot/patches/000-relocatable.patch index 9f6915bfe8..0408acfa25 100644 --- a/tools/fakeroot/patches/000-relocatable.patch +++ b/tools/fakeroot/patches/000-relocatable.patch @@ -1,25 +1,29 @@ --- a/scripts/fakeroot.in +++ b/scripts/fakeroot.in -@@ -30,12 +30,19 @@ fatal () +@@ -30,13 +30,20 @@ fatal () } # strip /bin/fakeroot to find install prefix -FAKEROOT_PREFIX=@prefix@ -FAKEROOT_BINDIR=@bindir@ +if [ -n "$STAGING_DIR_HOST" ]; then -+ FAKEROOT_PREFIX="${STAGING_DIR_HOST}" -+ FAKEROOT_BINDIR="${STAGING_DIR_HOST}/bin" -+ FAKEROOT_LIBDIR="${STAGING_DIR_HOST}/lib" ++ USEABSLIBPATH=1 ++ LIB=${STAGING_DIR_HOST}/lib/lib@fakeroot_transformed@@DLSUFFIX@ ++ FAKED=${STAGING_DIR_HOST}/bin/faked ++ PATHS= +else + FAKEROOT_PREFIX=@prefix@ + FAKEROOT_BINDIR=@bindir@ -+ FAKEROOT_LIBDIR=@libdir@ + +-USEABSLIBPATH=@LDPRELOADABS@ +-LIB=lib@fakeroot_transformed@@DLSUFFIX@ +-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot +-FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ ++ USEABSLIBPATH=@LDPRELOADABS@ ++ LIB=lib@fakeroot_transformed@@DLSUFFIX@ ++ PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot ++ FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ +fi - USEABSLIBPATH=@LDPRELOADABS@ - LIB=lib@fakeroot_transformed@@DLSUFFIX@ --PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot -+PATHS=${FAKEROOT_LIBDIR}:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot - FAKED=${FAKEROOT_BINDIR}/@faked_transformed@ - FAKED_MODE="unknown-is-root" + export FAKED_MODE From a47279154e08d54df05fa8bf45fe935ebf0df5da Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 5 Nov 2020 10:31:15 -0500 Subject: [PATCH 18/31] kernel: bump 5.4 to 5.4.75 Manually rebased patches: bcm27xx: patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch bcm53xx: patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch layerscape: patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch Removed since could be reverse-applied by quilt: mediatek: patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch All modifications made by update_kernel.sh Build system: x86_64 Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711, x86_64 Run-tested: ipq806x/R7800, x86_64 No dmesg regressions, everything functional Signed-off-by: John Audia Tested-by: Curtis Deptuck [x86_64] Rebase of 802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch Signed-off-by: Yangbo Lu Signed-off-by: Kevin Darbyshire-Bryant --- include/kernel-version.mk | 4 +- ...mware-loader-for-uPD720201-and-uPD72.patch | 10 ++-- .../802-usb-xhci-force-msi-renesas-xhci.patch | 4 +- ...Show-that-the-VIA-VL805-supports-LPM.patch | 2 +- ...hci_fixup_endpoint-for-interval-adju.patch | 4 +- ...or-host-controllers-that-don-t-updat.patch | 4 +- ...add-V4L2_CTRL_TYPE_AREA-control-type.patch | 4 +- ...d-V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF.patch | 4 +- ...a-videodev2.h-add-V4L2_DEC_CMD_FLUSH.patch | 2 +- ...h-Add-a-format-for-column-YUV4-2-0-m.patch | 2 +- ...-0510-mmc-sdhci-Silence-MMC-warnings.patch | 4 +- ...core-Add-sensor-ancillary-data-V4L2-.patch | 2 +- ...core-Add-ISP-statistics-output-V4L2-.patch | 2 +- ...support-for-performing-fake-doorbell.patch | 2 +- .../generic/hack-5.4/204-module_strip.patch | 2 +- .../hack-5.4/703-add_vsc8504_support.patch | 6 +-- .../203-kallsyms_uncompressed.patch | 2 +- ...ernel-XZ-compression-option-on-PPC_8.patch | 2 +- .../pending-5.4/920-mangle_bootargs.patch | 2 +- ...Mangle-bootloader-s-kernel-arguments.patch | 2 +- ...ate-mc-portal-from-root-dprc-contain.patch | 2 +- ...can-add-LPSR-mode-support-for-i.MX7D.patch | 49 ++----------------- ...LK-10893-i2c-imx-add-irqf_no_suspend.patch | 12 ++--- ...-I2C-imx-restore-pin-setting-for-i2c.patch | 4 +- ...-runtime-pm-of-i2c-temporary-when-do.patch | 2 +- ...-Defer-probing-if-EDMA-not-available.patch | 2 +- ...-of-esdhc-update-tuning-erratum-A-00.patch | 2 +- ...5-usb-dwc3-add-otg-properties-update.patch | 6 +-- ...-usb-role-switch-class-support-for-d.patch | 2 +- ...karound-for-host-mode-VBUS-glitch-wh.patch | 4 +- ...Add-cache-type-configuration-support.patch | 2 +- ...host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch | 4 +- ...735-usb-host-add-XHCI_CDNS_HOST-flag.patch | 2 +- ...-host-xhci-add-.bus_suspend-override.patch | 4 +- ...usb-dwc3-Add-cache-type-configuratio.patch | 2 +- ...3-Add-cache-type-configuration-suppo.patch | 2 +- ...623-add-missing-pause-for-switchport.patch | 23 --------- .../102-powerpc-add-cmdline-override.patch | 2 +- ...Mangle-bootloader-s-kernel-arguments.patch | 2 +- .../110-er200-ethernet_probe_order.patch | 4 +- .../patches-5.4/140-octeon_e300_support.patch | 12 ++--- .../700-allocate_interface_by_label.patch | 4 +- ...-honor_sgmii_node_device_tree_status.patch | 2 +- ...Mangle-bootloader-s-kernel-arguments.patch | 2 +- 44 files changed, 77 insertions(+), 141 deletions(-) delete mode 100644 target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index f03295e901..69dfaa5476 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .74 +LINUX_VERSION-5.4 = .75 -LINUX_KERNEL_HASH-5.4.74 = ec04f4ade1146a3b458a1ac3dc2059188cbb62cd51d2e66fcd8397fcec153ab7 +LINUX_KERNEL_HASH-5.4.75 = d2466fd6eb5433e7bf287b617b11b2640c65a7ea93a57eb7a80d7f537cbc1470 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/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index 937382fdf5..eb216aeb69 100644 --- a/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -48,7 +48,7 @@ Signed-off-by: Vinod Koul #include "xhci.h" #include "xhci-trace.h" -@@ -60,6 +62,44 @@ +@@ -62,6 +64,44 @@ #define PCI_DEVICE_ID_ASMEDIA_1142_XHCI 0x1242 #define PCI_DEVICE_ID_ASMEDIA_2142_XHCI 0x2142 @@ -93,7 +93,7 @@ Signed-off-by: Vinod Koul static const char hcd_name[] = "xhci_hcd"; static struct hc_driver __read_mostly xhci_pci_hc_driver; -@@ -291,6 +331,873 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -296,6 +336,873 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -967,7 +967,7 @@ Signed-off-by: Vinod Koul /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -332,6 +1239,27 @@ static int xhci_pci_probe(struct pci_dev +@@ -337,6 +1244,27 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -995,7 +995,7 @@ Signed-off-by: Vinod Koul driver = (struct hc_driver *)id->driver_data; /* Prevent runtime suspending between USB-2 and USB-3 initialization */ -@@ -393,6 +1321,16 @@ static void xhci_pci_remove(struct pci_d +@@ -398,6 +1326,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; @@ -1012,7 +1012,7 @@ Signed-off-by: Vinod Koul xhci = hcd_to_xhci(pci_get_drvdata(dev)); xhci->xhc_state |= XHCI_STATE_REMOVING; -@@ -520,6 +1458,11 @@ static int xhci_pci_resume(struct usb_hc +@@ -537,6 +1475,11 @@ static int xhci_pci_resume(struct usb_hc if (pdev->vendor == PCI_VENDOR_ID_INTEL) usb_enable_intel_xhci_ports(pdev); diff --git a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch index 02c9bcb2bf..be32823fee 100644 --- a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch @@ -13,7 +13,7 @@ produce a noisy warning. --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -278,6 +278,7 @@ static void xhci_pci_quirks(struct devic +@@ -283,6 +283,7 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x0015) { xhci->quirks |= XHCI_RESET_ON_RESUME; xhci->quirks |= XHCI_ZERO_64B_REGS; @@ -43,7 +43,7 @@ produce a noisy warning. hcd->msi_enabled = 1; --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1880,6 +1880,7 @@ struct xhci_hcd { +@@ -1881,6 +1881,7 @@ struct xhci_hcd { struct xhci_hub usb2_rhub; struct xhci_hub usb3_rhub; /* support xHCI 1.0 spec USB2 hardware LPM */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch b/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch index 7a1c2991f5..754a639853 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch @@ -10,7 +10,7 @@ Signed-off-by: Phil Elwell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -247,6 +247,10 @@ static void xhci_pci_quirks(struct devic +@@ -252,6 +252,10 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x3432) xhci->quirks |= XHCI_BROKEN_STREAMS; diff --git a/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch index 0bb08a56fa..5c241536dd 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -1453,6 +1453,103 @@ command_cleanup: +@@ -1456,6 +1456,103 @@ command_cleanup: } /* @@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell * non-error returns are a promise to giveback() the urb later * we drop ownership so next owner (or urb unlink) can get it */ -@@ -5334,6 +5431,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5337,6 +5434,7 @@ static const struct hc_driver xhci_hc_dr .endpoint_reset = xhci_endpoint_reset, .check_bandwidth = xhci_check_bandwidth, .reset_bandwidth = xhci_reset_bandwidth, diff --git a/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch b/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch index 83c86f6168..45a03fd81a 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch @@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -248,8 +248,10 @@ static void xhci_pci_quirks(struct devic +@@ -253,8 +253,10 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_BROKEN_STREAMS; if (pdev->vendor == PCI_VENDOR_ID_VIA && @@ -85,6 +85,6 @@ Signed-off-by: Jonathan Bell #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) +#define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(36) + #define XHCI_DISABLE_SPARSE BIT_ULL(38) unsigned int num_active_eps; - unsigned int limit_active_eps; diff --git a/target/linux/bcm27xx/patches-5.4/950-0488-media-add-V4L2_CTRL_TYPE_AREA-control-type.patch b/target/linux/bcm27xx/patches-5.4/950-0488-media-add-V4L2_CTRL_TYPE_AREA-control-type.patch index 265533eb3a..d82c3196b8 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0488-media-add-V4L2_CTRL_TYPE_AREA-control-type.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0488-media-add-V4L2_CTRL_TYPE_AREA-control-type.patch @@ -135,7 +135,7 @@ Signed-off-by: Mauro Carvalho Chehab /* Internal helper functions that deal with control events. */ --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -427,6 +427,11 @@ struct v4l2_fract { +@@ -426,6 +426,11 @@ struct v4l2_fract { __u32 denominator; }; @@ -147,7 +147,7 @@ Signed-off-by: Mauro Carvalho Chehab /** * struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP * -@@ -1725,6 +1730,7 @@ enum v4l2_ctrl_type { +@@ -1724,6 +1729,7 @@ enum v4l2_ctrl_type { V4L2_CTRL_TYPE_U8 = 0x0100, V4L2_CTRL_TYPE_U16 = 0x0101, V4L2_CTRL_TYPE_U32 = 0x0102, diff --git a/target/linux/bcm27xx/patches-5.4/950-0492-media-vb2-add-V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF.patch b/target/linux/bcm27xx/patches-5.4/950-0492-media-vb2-add-V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF.patch index b114aefacc..b05c34ccbe 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0492-media-vb2-add-V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0492-media-vb2-add-V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF.patch @@ -155,7 +155,7 @@ Signed-off-by: Mauro Carvalho Chehab */ --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -925,11 +925,12 @@ struct v4l2_requestbuffers { +@@ -924,11 +924,12 @@ struct v4l2_requestbuffers { }; /* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */ @@ -173,7 +173,7 @@ Signed-off-by: Mauro Carvalho Chehab /** * struct v4l2_plane - plane info for multi-planar buffers -@@ -1051,6 +1052,8 @@ static inline __u64 v4l2_timeval_to_ns(c +@@ -1050,6 +1051,8 @@ static inline __u64 v4l2_timeval_to_ns(c #define V4L2_BUF_FLAG_IN_REQUEST 0x00000080 /* timecode field is valid */ #define V4L2_BUF_FLAG_TIMECODE 0x00000100 diff --git a/target/linux/bcm27xx/patches-5.4/950-0494-media-videodev2.h-add-V4L2_DEC_CMD_FLUSH.patch b/target/linux/bcm27xx/patches-5.4/950-0494-media-videodev2.h-add-V4L2_DEC_CMD_FLUSH.patch index ef075fdb22..56fee1e029 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0494-media-videodev2.h-add-V4L2_DEC_CMD_FLUSH.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0494-media-videodev2.h-add-V4L2_DEC_CMD_FLUSH.patch @@ -47,7 +47,7 @@ Signed-off-by: Mauro Carvalho Chehab replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -1989,6 +1989,7 @@ struct v4l2_encoder_cmd { +@@ -1988,6 +1988,7 @@ struct v4l2_encoder_cmd { #define V4L2_DEC_CMD_STOP (1) #define V4L2_DEC_CMD_PAUSE (2) #define V4L2_DEC_CMD_RESUME (3) diff --git a/target/linux/bcm27xx/patches-5.4/950-0505-media-videodev2.h-Add-a-format-for-column-YUV4-2-0-m.patch b/target/linux/bcm27xx/patches-5.4/950-0505-media-videodev2.h-Add-a-format-for-column-YUV4-2-0-m.patch index 840541cd2e..5a309827e2 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0505-media-videodev2.h-Add-a-format-for-column-YUV4-2-0-m.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0505-media-videodev2.h-Add-a-format-for-column-YUV4-2-0-m.patch @@ -289,7 +289,7 @@ Signed-off-by: Dave Stevenson case V4L2_PIX_FMT_YUV422M: descr = "Planar YUV 4:2:2 (N-C)"; break; --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -737,6 +737,10 @@ struct v4l2_pix_format { +@@ -736,6 +736,10 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ #define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2') /* Sunxi Tiled NV12 Format */ #define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0510-mmc-sdhci-Silence-MMC-warnings.patch b/target/linux/bcm27xx/patches-5.4/950-0510-mmc-sdhci-Silence-MMC-warnings.patch index 41fa6cb3d2..38349280bb 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0510-mmc-sdhci-Silence-MMC-warnings.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0510-mmc-sdhci-Silence-MMC-warnings.patch @@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard #define MAX_TUNING_LOOP 40 -@@ -2754,7 +2754,7 @@ static void sdhci_timeout_timer(struct t +@@ -2756,7 +2756,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); -@@ -2776,7 +2776,7 @@ static void sdhci_timeout_data_timer(str +@@ -2778,7 +2778,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.4/950-0648-media-uapi-v4l2-core-Add-sensor-ancillary-data-V4L2-.patch b/target/linux/bcm27xx/patches-5.4/950-0648-media-uapi-v4l2-core-Add-sensor-ancillary-data-V4L2-.patch index de8f1d209a..69414e381c 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0648-media-uapi-v4l2-core-Add-sensor-ancillary-data-V4L2-.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0648-media-uapi-v4l2-core-Add-sensor-ancillary-data-V4L2-.patch @@ -75,7 +75,7 @@ Signed-off-by: Naushir Patuck /* Compressed formats */ --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -769,6 +769,7 @@ struct v4l2_pix_format { +@@ -768,6 +768,7 @@ struct v4l2_pix_format { #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */ #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */ #define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0676-media-uapi-v4l2-core-Add-ISP-statistics-output-V4L2-.patch b/target/linux/bcm27xx/patches-5.4/950-0676-media-uapi-v4l2-core-Add-ISP-statistics-output-V4L2-.patch index 1af97e8351..082dff510c 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0676-media-uapi-v4l2-core-Add-ISP-statistics-output-V4L2-.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0676-media-uapi-v4l2-core-Add-ISP-statistics-output-V4L2-.patch @@ -84,7 +84,7 @@ Signed-off-by: Naushir Patuck /* Compressed formats */ --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -770,6 +770,7 @@ struct v4l2_pix_format { +@@ -769,6 +769,7 @@ struct v4l2_pix_format { #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */ #define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */ #define V4L2_META_FMT_SENSOR_DATA v4l2_fourcc('S', 'E', 'N', 'S') /* Sensor Ancillary metadata */ diff --git a/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index 4c4db76b01..b27cbcad9f 100644 --- a/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-5.4/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -132,6 +132,6 @@ it on BCM4708 family. #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) +#define XHCI_FAKE_DOORBELL BIT_ULL(36) + #define XHCI_DISABLE_SPARSE BIT_ULL(38) unsigned int num_active_eps; - unsigned int limit_active_eps; diff --git a/target/linux/generic/hack-5.4/204-module_strip.patch b/target/linux/generic/hack-5.4/204-module_strip.patch index 0ed5f44697..f311b176f3 100644 --- a/target/linux/generic/hack-5.4/204-module_strip.patch +++ b/target/linux/generic/hack-5.4/204-module_strip.patch @@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau --- a/init/Kconfig +++ b/init/Kconfig -@@ -2195,6 +2195,13 @@ config TRIM_UNUSED_KSYMS +@@ -2196,6 +2196,13 @@ config TRIM_UNUSED_KSYMS If unsure, or if you need to build out-of-tree modules, say N. diff --git a/target/linux/generic/hack-5.4/703-add_vsc8504_support.patch b/target/linux/generic/hack-5.4/703-add_vsc8504_support.patch index e7265eba86..afb6ca6cf3 100644 --- a/target/linux/generic/hack-5.4/703-add_vsc8504_support.patch +++ b/target/linux/generic/hack-5.4/703-add_vsc8504_support.patch @@ -23,7 +23,7 @@ Signed-off-by: Roman Kuzmitskii #define PHY_ID_VSC8572 0x000704d0 #define PHY_ID_VSC8601 0x00070420 #define PHY_ID_VSC7385 0x00070450 -@@ -292,6 +293,7 @@ +@@ -292,6 +293,7 @@ static int vsc82xx_config_intr(struct ph err = phy_write(phydev, MII_VSC8244_IMASK, (phydev->drv->phy_id == PHY_ID_VSC8234 || phydev->drv->phy_id == PHY_ID_VSC8244 || @@ -31,7 +31,7 @@ Signed-off-by: Roman Kuzmitskii phydev->drv->phy_id == PHY_ID_VSC8572 || phydev->drv->phy_id == PHY_ID_VSC8601) ? MII_VSC8244_IMASK_MASK : -@@ -402,6 +404,15 @@ +@@ -402,6 +404,15 @@ static struct phy_driver vsc82xx_driver[ .ack_interrupt = &vsc824x_ack_interrupt, .config_intr = &vsc82xx_config_intr, }, { @@ -47,7 +47,7 @@ Signed-off-by: Roman Kuzmitskii .phy_id = PHY_ID_VSC8572, .name = "Vitesse VSC8572", .phy_id_mask = 0x000ffff0, -@@ -488,6 +499,7 @@ +@@ -488,6 +499,7 @@ module_phy_driver(vsc82xx_driver); static struct mdio_device_id __maybe_unused vitesse_tbl[] = { { PHY_ID_VSC8234, 0x000ffff0 }, { PHY_ID_VSC8244, 0x000fffc0 }, diff --git a/target/linux/generic/pending-5.4/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-5.4/203-kallsyms_uncompressed.patch index c4c13b9695..1f0c017680 100644 --- a/target/linux/generic/pending-5.4/203-kallsyms_uncompressed.patch +++ b/target/linux/generic/pending-5.4/203-kallsyms_uncompressed.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/init/Kconfig +++ b/init/Kconfig -@@ -1277,6 +1277,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW +@@ -1278,6 +1278,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW the unaligned access emulation. see arch/parisc/kernel/unaligned.c for reference diff --git a/target/linux/generic/pending-5.4/342-powerpc-Enable-kernel-XZ-compression-option-on-PPC_8.patch b/target/linux/generic/pending-5.4/342-powerpc-Enable-kernel-XZ-compression-option-on-PPC_8.patch index 26b8a8ce17..8d4c74219f 100644 --- a/target/linux/generic/pending-5.4/342-powerpc-Enable-kernel-XZ-compression-option-on-PPC_8.patch +++ b/target/linux/generic/pending-5.4/342-powerpc-Enable-kernel-XZ-compression-option-on-PPC_8.patch @@ -14,7 +14,7 @@ Signed-off-by: Pawel Dembicki --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig -@@ -204,7 +204,7 @@ config PPC +@@ -205,7 +205,7 @@ config PPC select HAVE_KERNEL_GZIP select HAVE_KERNEL_LZMA if DEFAULT_UIMAGE select HAVE_KERNEL_LZO if DEFAULT_UIMAGE diff --git a/target/linux/generic/pending-5.4/920-mangle_bootargs.patch b/target/linux/generic/pending-5.4/920-mangle_bootargs.patch index 7523b396ba..45eabbd10a 100644 --- a/target/linux/generic/pending-5.4/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-5.4/920-mangle_bootargs.patch @@ -13,7 +13,7 @@ Signed-off-by: Imre Kaloz --- a/init/Kconfig +++ b/init/Kconfig -@@ -1662,6 +1662,15 @@ config EMBEDDED +@@ -1663,6 +1663,15 @@ config EMBEDDED an embedded system so certain expert options are available for configuration. diff --git a/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index 0ca2c5f806..751ac10a19 100644 --- a/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-5.4/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -22,7 +22,7 @@ Signed-off-by: Adrian Panella --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1825,6 +1825,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/layerscape/patches-5.4/701-net-0147-bus-fsl-mc-Allocate-mc-portal-from-root-dprc-contain.patch b/target/linux/layerscape/patches-5.4/701-net-0147-bus-fsl-mc-Allocate-mc-portal-from-root-dprc-contain.patch index 655c4780d2..8fd2bb2738 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0147-bus-fsl-mc-Allocate-mc-portal-from-root-dprc-contain.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0147-bus-fsl-mc-Allocate-mc-portal-from-root-dprc-contain.patch @@ -22,7 +22,7 @@ Signed-off-by: Bharat Bhushan --- a/drivers/bus/fsl-mc/mc-io.c +++ b/drivers/bus/fsl-mc/mc-io.c -@@ -169,14 +169,16 @@ int __must_check fsl_mc_portal_allocate( +@@ -174,14 +174,16 @@ int __must_check fsl_mc_portal_allocate( int error = -EINVAL; struct fsl_mc_resource *resource = NULL; struct fsl_mc_io *mc_io = NULL; diff --git a/target/linux/layerscape/patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch b/target/linux/layerscape/patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch index 96c25e5cd9..806a020303 100644 --- a/target/linux/layerscape/patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch +++ b/target/linux/layerscape/patches-5.4/802-can-0025-can-flexcan-add-LPSR-mode-support-for-i.MX7D.patch @@ -28,57 +28,21 @@ Signed-off-by: Joakim Zhang #include #define DRV_NAME "flexcan" -@@ -1942,7 +1943,7 @@ static int __maybe_unused flexcan_suspen - { - struct net_device *dev = dev_get_drvdata(device); - struct flexcan_priv *priv = netdev_priv(dev); -- int err = 0; -+ int err; - - if (netif_running(dev)) { - /* if wakeup is enabled, enter stop mode -@@ -1954,25 +1955,27 @@ static int __maybe_unused flexcan_suspen +@@ -1954,9 +1955,7 @@ static int __maybe_unused flexcan_suspen if (err) return err; } else { - err = flexcan_chip_disable(priv); +- if (err) +- return err; + flexcan_chip_stop(dev); -+ -+ err = pm_runtime_force_suspend(device); - if (err) - return err; - -- err = pm_runtime_force_suspend(device); -+ pinctrl_pm_select_sleep_state(device); } netif_stop_queue(dev); netif_device_detach(dev); - } - priv->can.state = CAN_STATE_SLEEPING; - -- return err; -+ return 0; - } - - static int __maybe_unused flexcan_resume(struct device *device) - { - struct net_device *dev = dev_get_drvdata(device); - struct flexcan_priv *priv = netdev_priv(dev); -- int err = 0; -+ int err; - - priv->can.state = CAN_STATE_ERROR_ACTIVE; - if (netif_running(dev)) { -@@ -1984,15 +1987,19 @@ static int __maybe_unused flexcan_resume +@@ -1982,7 +1981,9 @@ static int __maybe_unused flexcan_resume if (err) return err; } else { -+ pinctrl_pm_select_default_state(device); -+ - err = pm_runtime_force_resume(device); - if (err) - return err; - - err = flexcan_chip_enable(priv); + err = flexcan_chip_start(dev); + if (err) @@ -86,8 +50,3 @@ Signed-off-by: Joakim Zhang } } -- return err; -+ return 0; - } - - static int __maybe_unused flexcan_runtime_suspend(struct device *device) diff --git a/target/linux/layerscape/patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch b/target/linux/layerscape/patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch index 08f44e795e..48432e1ec1 100644 --- a/target/linux/layerscape/patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch +++ b/target/linux/layerscape/patches-5.4/808-i2c-0002-MLK-10893-i2c-imx-add-irqf_no_suspend.patch @@ -17,13 +17,13 @@ Signed-off-by: Vipul Kumar --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c -@@ -1113,7 +1113,8 @@ static int i2c_imx_probe(struct platform - } +@@ -1131,7 +1131,8 @@ static int i2c_imx_probe(struct platform + goto rpm_disable; /* Request IRQ */ -- ret = devm_request_irq(&pdev->dev, irq, i2c_imx_isr, IRQF_SHARED, -+ ret = devm_request_irq(&pdev->dev, irq, i2c_imx_isr, -+ IRQF_SHARED | IRQF_NO_SUSPEND, - pdev->name, i2c_imx); +- ret = request_threaded_irq(irq, i2c_imx_isr, NULL, IRQF_SHARED, ++ ret = request_threaded_irq(irq, i2c_imx_isr, NULL, ++ IRQF_SHARED | IRQF_NO_SUSPEND, + pdev->name, i2c_imx); if (ret) { dev_err(&pdev->dev, "can't claim irq %d\n", irq); diff --git a/target/linux/layerscape/patches-5.4/808-i2c-0003-MLK-11403-I2C-imx-restore-pin-setting-for-i2c.patch b/target/linux/layerscape/patches-5.4/808-i2c-0003-MLK-11403-I2C-imx-restore-pin-setting-for-i2c.patch index 0c7c644330..a017e09930 100644 --- a/target/linux/layerscape/patches-5.4/808-i2c-0003-MLK-11403-I2C-imx-restore-pin-setting-for-i2c.patch +++ b/target/linux/layerscape/patches-5.4/808-i2c-0003-MLK-11403-I2C-imx-restore-pin-setting-for-i2c.patch @@ -15,7 +15,7 @@ Signed-off-by: Vipul Kumar --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c -@@ -1227,7 +1227,8 @@ static int __maybe_unused i2c_imx_runtim +@@ -1229,7 +1229,8 @@ static int __maybe_unused i2c_imx_runtim { struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev); @@ -25,7 +25,7 @@ Signed-off-by: Vipul Kumar return 0; } -@@ -1237,14 +1238,28 @@ static int __maybe_unused i2c_imx_runtim +@@ -1239,14 +1240,28 @@ static int __maybe_unused i2c_imx_runtim struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev); int ret; diff --git a/target/linux/layerscape/patches-5.4/808-i2c-0004-MLK-16203-enable-runtime-pm-of-i2c-temporary-when-do.patch b/target/linux/layerscape/patches-5.4/808-i2c-0004-MLK-16203-enable-runtime-pm-of-i2c-temporary-when-do.patch index 3157750f3f..16ac77c6f0 100644 --- a/target/linux/layerscape/patches-5.4/808-i2c-0004-MLK-16203-enable-runtime-pm-of-i2c-temporary-when-do.patch +++ b/target/linux/layerscape/patches-5.4/808-i2c-0004-MLK-16203-enable-runtime-pm-of-i2c-temporary-when-do.patch @@ -47,7 +47,7 @@ Signed-off-by: Vipul Kumar dev_dbg(&i2c_imx->adapter.dev, "<%s> exit with: %s: %d\n", __func__, (result < 0) ? "error" : "success msg", (result < 0) ? result : num); -@@ -1259,7 +1269,7 @@ static int i2c_imx_resume(struct device +@@ -1261,7 +1271,7 @@ static int i2c_imx_resume(struct device } static const struct dev_pm_ops i2c_imx_pm_ops = { diff --git a/target/linux/layerscape/patches-5.4/808-i2c-0016-LF-162-i2c-imx-Defer-probing-if-EDMA-not-available.patch b/target/linux/layerscape/patches-5.4/808-i2c-0016-LF-162-i2c-imx-Defer-probing-if-EDMA-not-available.patch index ce19d0b98b..53440f896b 100644 --- a/target/linux/layerscape/patches-5.4/808-i2c-0016-LF-162-i2c-imx-Defer-probing-if-EDMA-not-available.patch +++ b/target/linux/layerscape/patches-5.4/808-i2c-0016-LF-162-i2c-imx-Defer-probing-if-EDMA-not-available.patch @@ -67,4 +67,4 @@ Signed-off-by: Peng Ma + i2c_del_adapter(&i2c_imx->adapter); clk_notifier_unregister: clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb); - rpm_disable: + free_irq(irq, i2c_imx); diff --git a/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch b/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch index 1d2e9386c9..4a16dbd505 100644 --- a/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch +++ b/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch @@ -68,7 +68,7 @@ Acked-by: Adrian Hunter *window_start = 8 * esdhc->div_ratio; *window_end = 4 * esdhc->div_ratio; } else { -@@ -1050,6 +1050,19 @@ static int esdhc_execute_tuning(struct m +@@ -1061,6 +1061,19 @@ static int esdhc_execute_tuning(struct m if (ret) break; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch index 2a224d1171..8a8486b36f 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch @@ -36,7 +36,7 @@ Signed-off-by: Peter Chen dwc->sysdev_is_parent = device_property_read_bool(dev, --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h -@@ -953,6 +953,7 @@ struct dwc3_scratchpad_array { +@@ -954,6 +954,7 @@ struct dwc3_scratchpad_array { * @nr_scratch: number of scratch buffers * @u1u2: only used on revisions <1.83a for workaround * @maximum_speed: maximum speed requested (mainly for testing purposes) @@ -44,7 +44,7 @@ Signed-off-by: Peter Chen * @revision: revision register contents * @version_type: VERSIONTYPE register contents, a sub release of a revision * @dr_mode: requested mode of operation -@@ -1109,6 +1110,7 @@ struct dwc3 { +@@ -1110,6 +1111,7 @@ struct dwc3 { u32 nr_scratch; u32 u1u2; u32 maximum_speed; @@ -54,7 +54,7 @@ Signed-off-by: Peter Chen * All 3.1 IP version constants are greater than the 3.0 IP --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c -@@ -3495,6 +3495,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3525,6 +3525,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) dwc->gadget.sg_supported = true; dwc->gadget.name = "dwc3-gadget"; dwc->gadget.lpm_capable = true; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch b/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch index 95785792ac..b8f0c6a2cc 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0006-usb-dwc3-drd-add-usb-role-switch-class-support-for-d.patch @@ -23,7 +23,7 @@ Signed-off-by: Li Jun #include #include -@@ -1094,6 +1095,7 @@ struct dwc3 { +@@ -1095,6 +1096,7 @@ struct dwc3 { void __iomem *regs; size_t regs_size; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch b/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch index 8cb1779fb4..a8d23623be 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0009-usb-dwc3-Add-workaround-for-host-mode-VBUS-glitch-wh.patch @@ -44,7 +44,7 @@ Reviewed-by: Peter Chen --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h -@@ -1046,6 +1046,8 @@ struct dwc3_scratchpad_array { +@@ -1047,6 +1047,8 @@ struct dwc3_scratchpad_array { * 3 - Reserved * @dis_metastability_quirk: set to disable metastability quirk. * @dis_split_quirk: set to disable split boundary. @@ -53,7 +53,7 @@ Reviewed-by: Peter Chen * @imod_interval: set the interrupt moderation interval in 250ns * increments or 0 to disable. */ -@@ -1241,6 +1243,8 @@ struct dwc3 { +@@ -1242,6 +1244,8 @@ struct dwc3 { unsigned dis_split_quirk:1; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch b/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch index c40af8c5c7..3357acc76d 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0011-usb-dwc3-Add-cache-type-configuration-support.patch @@ -109,7 +109,7 @@ Reviewed-by: Jun Li usb_phy_set_suspend(dwc->usb2_phy, 0); usb_phy_set_suspend(dwc->usb3_phy, 0); ret = phy_power_on(dwc->usb2_generic_phy); -@@ -1920,12 +1972,9 @@ static const struct dev_pm_ops dwc3_dev_ +@@ -1931,12 +1983,9 @@ static const struct dev_pm_ops dwc3_dev_ #ifdef CONFIG_OF static const struct of_device_id of_dwc3_match[] = { diff --git a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch index 43d3d7d9e5..d57fb7c01f 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch @@ -174,7 +174,7 @@ Signed-off-by: Peter Chen * bursts that are required to move all packets in this TD. Only SuperSpeed --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -5361,6 +5361,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5364,6 +5364,7 @@ static const struct hc_driver xhci_hc_dr .disable_usb3_lpm_timeout = xhci_disable_usb3_lpm_timeout, .find_raw_port_number = xhci_find_raw_port_number, .clear_tt_buffer_complete = xhci_clear_tt_buffer_complete, @@ -184,7 +184,7 @@ Signed-off-by: Peter Chen void xhci_init_driver(struct hc_driver *drv, --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -2143,6 +2143,16 @@ int xhci_find_raw_port_number(struct usb +@@ -2144,6 +2144,16 @@ int xhci_find_raw_port_number(struct usb struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd); void xhci_hc_died(struct xhci_hcd *xhci); diff --git a/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch b/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch index 23e5094707..a934f289d8 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0016-MLK-16735-usb-host-add-XHCI_CDNS_HOST-flag.patch @@ -37,6 +37,6 @@ Signed-off-by: Peter Chen #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) +#define XHCI_CDNS_HOST BIT_ULL(36) + #define XHCI_DISABLE_SPARSE BIT_ULL(38) unsigned int num_active_eps; - unsigned int limit_active_eps; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch index 57818b1136..c74b2460b4 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch @@ -24,7 +24,7 @@ Signed-off-by: Peter Chen --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -5378,6 +5378,8 @@ void xhci_init_driver(struct hc_driver * +@@ -5381,6 +5381,8 @@ void xhci_init_driver(struct hc_driver * drv->reset = over->reset; if (over->start) drv->start = over->start; @@ -35,7 +35,7 @@ Signed-off-by: Peter Chen EXPORT_SYMBOL_GPL(xhci_init_driver); --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1911,6 +1911,7 @@ struct xhci_driver_overrides { +@@ -1912,6 +1912,7 @@ struct xhci_driver_overrides { size_t extra_priv_size; int (*reset)(struct usb_hcd *hcd); int (*start)(struct usb_hcd *hcd); diff --git a/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch b/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch index 8b31ae897e..4bc9f4d465 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0024-LF-387-1-Revert-usb-dwc3-Add-cache-type-configuratio.patch @@ -81,7 +81,7 @@ Signed-off-by: Ran Wang usb_phy_set_suspend(dwc->usb2_phy, 0); usb_phy_set_suspend(dwc->usb3_phy, 0); ret = phy_power_on(dwc->usb2_generic_phy); -@@ -1972,9 +1920,12 @@ static const struct dev_pm_ops dwc3_dev_ +@@ -1983,9 +1931,12 @@ static const struct dev_pm_ops dwc3_dev_ #ifdef CONFIG_OF static const struct of_device_id of_dwc3_match[] = { diff --git a/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch b/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch index 8fde037eaa..9c5818c268 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0025-LF-387-4-usb-dwc3-Add-cache-type-configuration-suppo.patch @@ -108,7 +108,7 @@ Reviewed-by: Jun Li usb_phy_set_suspend(dwc->usb2_phy, 0); usb_phy_set_suspend(dwc->usb3_phy, 0); ret = phy_power_on(dwc->usb2_generic_phy); -@@ -1920,12 +1971,16 @@ static const struct dev_pm_ops dwc3_dev_ +@@ -1931,12 +1982,16 @@ static const struct dev_pm_ops dwc3_dev_ #ifdef CONFIG_OF static const struct of_device_id of_dwc3_match[] = { diff --git a/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch b/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch deleted file mode 100644 index 94d5bbfb0d..0000000000 --- a/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Frank Wunderlich -Date: Mon, 7 Sep 2020 09:05:17 +0200 - -port6 of mt7530 switch (= cpu port 0) on bananapi-r2 misses pause option -which causes rx drops on running iperf. - -Cc: stable@vger.kernel.org -Fixes: f4ff257cd160 ("arm: dts: mt7623: add support for Bananapi R2 (BPI-R2) board") -Signed-off-by: Frank Wunderlich ---- - arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts -+++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts -@@ -193,6 +193,7 @@ - fixed-link { - speed = <1000>; - full-duplex; -+ pause; - }; - }; - }; diff --git a/target/linux/mpc85xx/patches-5.4/102-powerpc-add-cmdline-override.patch b/target/linux/mpc85xx/patches-5.4/102-powerpc-add-cmdline-override.patch index 19bbf9f2f4..924ce9307e 100644 --- a/target/linux/mpc85xx/patches-5.4/102-powerpc-add-cmdline-override.patch +++ b/target/linux/mpc85xx/patches-5.4/102-powerpc-add-cmdline-override.patch @@ -1,6 +1,6 @@ --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig -@@ -884,6 +884,14 @@ config CMDLINE_FORCE +@@ -885,6 +885,14 @@ config CMDLINE_FORCE This is useful if you cannot or don't want to change the command-line options your boot loader passes to the kernel. diff --git a/target/linux/mvebu/patches-5.4/006-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-5.4/006-mvebu-Mangle-bootloader-s-kernel-arguments.patch index ed92476302..fd60cdb322 100644 --- a/target/linux/mvebu/patches-5.4/006-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/mvebu/patches-5.4/006-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -28,7 +28,7 @@ Signed-off-by: Michael Gray --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1825,6 +1825,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/octeon/patches-5.4/110-er200-ethernet_probe_order.patch b/target/linux/octeon/patches-5.4/110-er200-ethernet_probe_order.patch index c1b6f73a30..7afa292757 100644 --- a/target/linux/octeon/patches-5.4/110-er200-ethernet_probe_order.patch +++ b/target/linux/octeon/patches-5.4/110-er200-ethernet_probe_order.patch @@ -1,6 +1,6 @@ --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -682,6 +682,7 @@ static int cvm_oct_probe(struct platform +@@ -683,6 +683,7 @@ static int cvm_oct_probe(struct platform int interface; int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE; int qos; @@ -8,7 +8,7 @@ struct device_node *pip; int mtu_overhead = ETH_HLEN + ETH_FCS_LEN; -@@ -805,13 +806,19 @@ static int cvm_oct_probe(struct platform +@@ -806,13 +807,19 @@ static int cvm_oct_probe(struct platform } num_interfaces = cvmx_helper_get_number_of_interfaces(); diff --git a/target/linux/octeon/patches-5.4/140-octeon_e300_support.patch b/target/linux/octeon/patches-5.4/140-octeon_e300_support.patch index 36b5d6abb5..7fe56a47d1 100644 --- a/target/linux/octeon/patches-5.4/140-octeon_e300_support.patch +++ b/target/linux/octeon/patches-5.4/140-octeon_e300_support.patch @@ -1,16 +1,16 @@ --- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h +++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h -@@ -296,6 +296,7 @@ - CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, - CVMX_BOARD_TYPE_UBNT_E100 = 20002, +@@ -298,6 +298,7 @@ enum cvmx_board_types_enum { + CVMX_BOARD_TYPE_UBNT_E200 = 20003, + CVMX_BOARD_TYPE_UBNT_E220 = 20005, CVMX_BOARD_TYPE_ITUS_SHIELD = 20006, + CVMX_BOARD_TYPE_UBNT_E300 = 20300, CVMX_BOARD_TYPE_KONTRON_S1901 = 21901, CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, -@@ -397,6 +398,7 @@ - ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) - ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) +@@ -401,6 +402,7 @@ static inline const char *cvmx_board_typ + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E200) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E220) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_ITUS_SHIELD) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E300) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KONTRON_S1901) diff --git a/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch b/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch index 0aef899a96..3a9b2eb7cd 100644 --- a/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch +++ b/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch @@ -12,7 +12,7 @@ Tested-by: Johannes Kimmel Signed-off-by: Roman Kuzmitskii --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -407,9 +407,12 @@ +@@ -408,9 +408,12 @@ int cvm_oct_common_init(struct net_devic { struct octeon_ethernet *priv = netdev_priv(dev); const u8 *mac = NULL; @@ -26,7 +26,7 @@ Signed-off-by: Roman Kuzmitskii if (!IS_ERR_OR_NULL(mac)) ether_addr_copy(dev->dev_addr, mac); -@@ -444,6 +447,9 @@ +@@ -445,6 +448,9 @@ int cvm_oct_common_init(struct net_devic if (dev->netdev_ops->ndo_stop) dev->netdev_ops->ndo_stop(dev); diff --git a/target/linux/octeon/patches-5.4/701-honor_sgmii_node_device_tree_status.patch b/target/linux/octeon/patches-5.4/701-honor_sgmii_node_device_tree_status.patch index af223dc314..9fb0c2f0a3 100644 --- a/target/linux/octeon/patches-5.4/701-honor_sgmii_node_device_tree_status.patch +++ b/target/linux/octeon/patches-5.4/701-honor_sgmii_node_device_tree_status.patch @@ -12,7 +12,7 @@ Tested-by: Johannes Kimmel Signed-off-by: Roman Kuzmitskii --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -884,8 +884,10 @@ +@@ -885,8 +885,10 @@ static int cvm_oct_probe(struct platform case CVMX_HELPER_INTERFACE_MODE_SGMII: priv->phy_mode = PHY_INTERFACE_MODE_SGMII; diff --git a/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch index 699d131c9f..8c83d55b6c 100644 --- a/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/oxnas/patches-5.4/996-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -22,7 +22,7 @@ Signed-off-by: Adrian Panella --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1825,6 +1825,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1827,6 +1827,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. From 826bb13742727300565b9d5785421813443d4de6 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Nov 2020 10:20:26 +0800 Subject: [PATCH 19/31] base-files: upgrade: log with date prefix And log to stderr Signed-off-by: Yousong Zhou --- package/base-files/files/lib/upgrade/common.sh | 2 +- package/base-files/files/lib/upgrade/stage2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 2eb26ba44b..2ae83f5bfb 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -64,7 +64,7 @@ ask_bool() { } v() { - [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$@" + [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$(date) upgrade: $@" >&2 } json_string() { diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index a4fef42134..211a3f4b33 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -42,7 +42,7 @@ switch_to_ramfs() { mtd partx losetup mkfs.ext4 nandwrite flash_erase \ ubiupdatevol ubiattach ubiblock ubiformat \ ubidetach ubirsvol ubirmvol ubimkvol \ - snapshot snapshot_tool \ + snapshot snapshot_tool date \ $RAMFS_COPY_BIN do local file="$(command -v "$binary" 2>/dev/null)" From 7863c33ceaf155783861aa434cc81b5cf37f7a15 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 10 Nov 2020 21:30:29 +0800 Subject: [PATCH 20/31] base-files: upgrade: add vn and variants To be used with in the following pattern vn "Remaining: " for p in $xx; do _vn "$p" done _v Signed-off-by: Yousong Zhou --- package/base-files/files/lib/upgrade/common.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 2ae83f5bfb..0f25199365 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -63,8 +63,20 @@ ask_bool() { [ "$answer" -gt 0 ] } +_v() { + [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$*" >&2 +} + +_vn() { + [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo -n "$*" >&2 +} + v() { - [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$(date) upgrade: $@" >&2 + _v "$(date) upgrade: $@" +} + +vn() { + _vn "$(date) upgrade: $@" } json_string() { From bd21e4a93617a6609725509c67dc293242c80f97 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Nov 2020 11:26:21 +0800 Subject: [PATCH 21/31] base-files: upgrade: use stdin redirection to replace cat command Signed-off-by: Yousong Zhou --- package/base-files/files/lib/upgrade/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 0f25199365..5eb7b23a83 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -103,7 +103,7 @@ get_image() { # [ ] esac fi - cat "$from" 2>/dev/null | $cmd + $cmd <"$from" } get_magic_word() { From 50b870ee3c7a000a6f1a6c5b5e927f3af1b124c0 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Nov 2020 11:38:06 +0800 Subject: [PATCH 22/31] base-files: upgrade: add get_image_dd() This is mainly to handle stderr message "Broken pipe", "F+P records in/out" by common pattern "xcat | dd .." Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3140 Reported-by: Philip Prindeville Signed-off-by: Yousong Zhou Reviewed-By: Philip Prindeville --- package/base-files/files/lib/upgrade/common.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 5eb7b23a83..a5c27dc2fb 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -106,6 +106,17 @@ get_image() { # [ ] $cmd <"$from" } +get_image_dd() { + local from="$1"; shift + + ( + exec 3>&2 + ( exec 3>&2; get_image "$from" 2>&1 1>&3 | grep -v -F ' Broken pipe' ) 2>&1 1>&3 \ + | ( exec 3>&2; dd "$@" 2>&1 1>&3 | grep -v -E ' records (in|out)') 2>&1 1>&3 + exec 3>&- + ) +} + get_magic_word() { (get_image "$@" | dd bs=2 count=1 | hexdump -v -n 2 -e '1/1 "%02x"') 2>/dev/null } From 856b288d27249f535fe15daa6471bb9393e94140 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Nov 2020 14:15:35 +0800 Subject: [PATCH 23/31] base-files: upgrade: fwtool.sh: use v for log lines This will have at least the following effects - Log lines will have common prefix - They will be output to stderr instead of stdout Signed-off-by: Yousong Zhou --- .../base-files/files/lib/upgrade/fwtool.sh | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/package/base-files/files/lib/upgrade/fwtool.sh b/package/base-files/files/lib/upgrade/fwtool.sh index 3a74c72bba..bf3059dbce 100644 --- a/package/base-files/files/lib/upgrade/fwtool.sh +++ b/package/base-files/files/lib/upgrade/fwtool.sh @@ -10,9 +10,9 @@ fwtool_check_signature() { } if ! fwtool -q -s /tmp/sysupgrade.ucert "$1"; then - echo "Image signature not found" + v "Image signature not found" [ "$REQUIRE_IMAGE_SIGNATURE" = 1 -a "$FORCE" != 1 ] && { - echo "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" + v "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" } [ "$REQUIRE_IMAGE_SIGNATURE" = 1 ] && return 1 return 0 @@ -30,16 +30,16 @@ fwtool_check_image() { . /usr/share/libubox/jshn.sh if ! fwtool -q -i /tmp/sysupgrade.meta "$1"; then - echo "Image metadata not found" + v "Image metadata not found" [ "$REQUIRE_IMAGE_METADATA" = 1 -a "$FORCE" != 1 ] && { - echo "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" + v "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" } [ "$REQUIRE_IMAGE_METADATA" = 1 ] && return 1 return 0 fi json_load "$(cat /tmp/sysupgrade.meta)" || { - echo "Invalid image metadata" + v "Invalid image metadata" return 1 } @@ -64,15 +64,15 @@ fwtool_check_image() { if [ "$dev" = "$device" ]; then # major compat version -> no sysupgrade if [ "${devicecompat%.*}" != "${imagecompat%.*}" ]; then - echo "The device is supported, but this image is incompatible for sysupgrade based on the image version ($devicecompat->$imagecompat)." - [ -n "$compatmessage" ] && echo "$compatmessage" + v "The device is supported, but this image is incompatible for sysupgrade based on the image version ($devicecompat->$imagecompat)." + [ -n "$compatmessage" ] && v "$compatmessage" return 1 fi # minor compat version -> sysupgrade with -n required if [ "${devicecompat#.*}" != "${imagecompat#.*}" ] && [ "$SAVE_CONFIG" = "1" ]; then - echo "The device is supported, but the config is incompatible to the new image ($devicecompat->$imagecompat). Please upgrade without keeping config (sysupgrade -n)." - [ -n "$compatmessage" ] && echo "$compatmessage" + v "The device is supported, but the config is incompatible to the new image ($devicecompat->$imagecompat). Please upgrade without keeping config (sysupgrade -n)." + [ -n "$compatmessage" ] && v "$compatmessage" return 1 fi @@ -80,13 +80,13 @@ fwtool_check_image() { fi done - echo "Device $device not supported by this image" - echo -n "Supported devices:" + v "Device $device not supported by this image" + vn "Supported devices:" for k in $dev_keys; do json_get_var dev "$k" - echo -n " $dev" + _vn " $dev" done - echo + _v return 1 } From 128bb4e8d31d358ce7c504bc8554abe45a6f9611 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Nov 2020 16:22:58 +0800 Subject: [PATCH 24/31] base-files: upgrade: fwtool.sh: rewording logs The intent is to make it sound more like info level message, not some error like "404 not found". x86 target at the moment makes image with only signature but no metadata (ref commit f8141216 "x86: append metadata to combined images"). Signed-off-by: Yousong Zhou Reviewed-By: Philip Prindeville --- package/base-files/files/lib/upgrade/fwtool.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/lib/upgrade/fwtool.sh b/package/base-files/files/lib/upgrade/fwtool.sh index bf3059dbce..3826bf5c30 100644 --- a/package/base-files/files/lib/upgrade/fwtool.sh +++ b/package/base-files/files/lib/upgrade/fwtool.sh @@ -10,7 +10,7 @@ fwtool_check_signature() { } if ! fwtool -q -s /tmp/sysupgrade.ucert "$1"; then - v "Image signature not found" + v "Image signature not present" [ "$REQUIRE_IMAGE_SIGNATURE" = 1 -a "$FORCE" != 1 ] && { v "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" } @@ -30,7 +30,7 @@ fwtool_check_image() { . /usr/share/libubox/jshn.sh if ! fwtool -q -i /tmp/sysupgrade.meta "$1"; then - v "Image metadata not found" + v "Image metadata not present" [ "$REQUIRE_IMAGE_METADATA" = 1 -a "$FORCE" != 1 ] && { v "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" } From 00fb51f97e549cb998ef5dc5dbbc33dff650d891 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Nov 2020 16:54:13 +0800 Subject: [PATCH 25/31] base-files: upgrade: stage2: use v for log lines Signed-off-by: Yousong Zhou --- package/base-files/files/lib/upgrade/stage2 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index 211a3f4b33..c7629c383f 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -53,7 +53,7 @@ switch_to_ramfs() { [ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64 supivot $RAM_ROOT /mnt || { - echo "Failed to switch over to ramfs. Please reboot." + v "Failed to switch over to ramfs. Please reboot." exit 1 } @@ -75,7 +75,7 @@ kill_remaining() { # [ [ ] ] local stat local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat) - echo -n "Sending $sig to remaining processes ... " + vn "Sending $sig to remaining processes ..." while $run; do run=false @@ -95,7 +95,7 @@ kill_remaining() { # [ [ ] ] # Skip kernel threads [ -n "$cmdline" ] || continue - echo -n "$name " + _vn " $name" kill -$sig $pid 2>/dev/null [ $loop -eq 1 ] && run=true @@ -103,12 +103,12 @@ kill_remaining() { # [ [ ] ] let loop_limit-- [ $loop_limit -eq 0 ] && { - echo - echo "Failed to kill all processes." + _v + v "Failed to kill all processes." exit 1 } done - echo + _v } indicate_upgrade @@ -129,7 +129,7 @@ if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then fi if [ -n "$(rootfs_type)" ]; then - echo "Switching to ramdisk..." + v "Switching to ramdisk..." switch_to_ramfs fi From 600bcaf9c9a036c5e1df33b34003bcf3af373c02 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Nov 2020 16:55:13 +0800 Subject: [PATCH 26/31] base-files: bump PKG_RELEASE Signed-off-by: Yousong Zhou --- package/base-files/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index f63c4db533..b546eb7e0b 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=235 +PKG_RELEASE:=236 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ From 31a34076edb24c06a315c9b912081bc1409064fa Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Nov 2020 11:03:31 +0800 Subject: [PATCH 27/31] x86: upgrade: use v function for writting logs Signed-off-by: Yousong Zhou --- .../linux/x86/base-files/lib/upgrade/platform.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh index 1bcd492dd7..617b267e68 100644 --- a/target/linux/x86/base-files/lib/upgrade/platform.sh +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh @@ -7,13 +7,13 @@ platform_check_image() { case "$(get_magic_word "$1")" in eb48|eb63) ;; *) - echo "Invalid image type" + v "Invalid image type" return 1 ;; esac export_bootdevice && export_partdevice diskdev 0 || { - echo "Unable to determine upgrade device" + v "Unable to determine upgrade device" return 1 } @@ -30,7 +30,7 @@ platform_check_image() { rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image if [ -n "$diff" ]; then - echo "Partition layout has changed. Full image will be written." + v "Partition layout has changed. Full image will be written." ask_bool 0 "Abort" && exit 1 return 0 fi @@ -57,7 +57,7 @@ platform_do_bootloader_upgrade() { echo "(hd0) /dev/$diskdev" > /tmp/device.map part_magic_efi "/dev/$diskdev" && parttable=gpt - echo "Upgrading bootloader on /dev/$diskdev..." + v "Upgrading bootloader on /dev/$diskdev..." grub-bios-setup \ -m "/tmp/device.map" \ -d "/tmp/boot/boot/grub" \ @@ -73,7 +73,7 @@ platform_do_upgrade() { local diskdev partdev diff export_bootdevice && export_partdevice diskdev 0 || { - echo "Unable to determine upgrade device" + v "Unable to determine upgrade device" return 1 } @@ -107,15 +107,15 @@ platform_do_upgrade() { #iterate over each partition from the image and write it to the boot disk while read part start size; do if export_partdevice partdev $part; then - echo "Writing image to /dev/$partdev..." + v "Writing image to /dev/$partdev..." get_image "$@" | dd of="/dev/$partdev" ibs=512 obs=1M skip="$start" count="$size" conv=fsync else - echo "Unable to find partition $part device, skipped." + v "Unable to find partition $part device, skipped." fi done < /tmp/partmap.image #copy partition uuid - echo "Writing new UUID to /dev/$diskdev..." + v "Writing new UUID to /dev/$diskdev..." get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync platform_do_bootloader_upgrade "$diskdev" From 2e34cfbca78f36d68995f87975db29f53171c854 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Nov 2020 11:39:59 +0800 Subject: [PATCH 28/31] x86: upgrade: use get_image_dd Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3140 Reported-by: Philip Prindeville Signed-off-by: Yousong Zhou Reviewed-By: Philip Prindeville --- target/linux/x86/base-files/lib/upgrade/platform.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh index 617b267e68..0b54caea29 100644 --- a/target/linux/x86/base-files/lib/upgrade/platform.sh +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh @@ -20,7 +20,7 @@ platform_check_image() { get_partitions "/dev/$diskdev" bootdisk #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=63 bs=512b 2>/dev/null + get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b get_partitions /tmp/image.bs image @@ -83,7 +83,7 @@ platform_do_upgrade() { get_partitions "/dev/$diskdev" bootdisk #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=63 bs=512b >/dev/null + get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b get_partitions /tmp/image.bs image @@ -94,7 +94,7 @@ platform_do_upgrade() { fi if [ -n "$diff" ]; then - get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync + get_image_dd "$1" of="/dev/$diskdev" bs=4096 conv=fsync # Separate removal and addtion is necessary; otherwise, partition 1 # will be missing if it overlaps with the old partition 2 @@ -108,7 +108,7 @@ platform_do_upgrade() { while read part start size; do if export_partdevice partdev $part; then v "Writing image to /dev/$partdev..." - get_image "$@" | dd of="/dev/$partdev" ibs=512 obs=1M skip="$start" count="$size" conv=fsync + get_image_dd "$1" of="/dev/$partdev" ibs=512 obs=1M skip="$start" count="$size" conv=fsync else v "Unable to find partition $part device, skipped." fi @@ -116,7 +116,7 @@ platform_do_upgrade() { #copy partition uuid v "Writing new UUID to /dev/$diskdev..." - get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync + get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync platform_do_bootloader_upgrade "$diskdev" local parttype=ext4 From c02096361c671351dc05733cdd47f3da71de47e7 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Nov 2020 11:41:44 +0800 Subject: [PATCH 29/31] x86: upgrade: make code comment appear as log lines The comment content can be useful for readers of both the log and code Previously when dd command "records in/out" messages are not filtered like now with get_image_dd, it's not clear that these messages are for extracting boot sectors. E.g. Before == upgrade: Reading partition table from bootdisk... 37+26 records in 37+26 records out == upgrade: Reading partition table from image... After == upgrade: Reading partition table from bootdisk... == upgrade: Extract boot sector from the image 37+26 records in 37+26 records out == upgrade: Reading partition table from image... Signed-off-by: Yousong Zhou --- target/linux/x86/base-files/lib/upgrade/platform.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh index 0b54caea29..d8f2eba97e 100644 --- a/target/linux/x86/base-files/lib/upgrade/platform.sh +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh @@ -19,7 +19,7 @@ platform_check_image() { get_partitions "/dev/$diskdev" bootdisk - #extract the boot sector from the image + v "Extract boot sector from the image" get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b get_partitions /tmp/image.bs image @@ -82,7 +82,7 @@ platform_do_upgrade() { if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then get_partitions "/dev/$diskdev" bootdisk - #extract the boot sector from the image + v "Extract boot sector from the image" get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b get_partitions /tmp/image.bs image @@ -114,7 +114,6 @@ platform_do_upgrade() { fi done < /tmp/partmap.image - #copy partition uuid v "Writing new UUID to /dev/$diskdev..." get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync @@ -129,5 +128,4 @@ platform_do_upgrade() { sed -i "s/\(PARTUUID=\)[a-f0-9-]\+/\1$4$3$2$1-$6$5-$8$7-$9/ig" /mnt/boot/grub/grub.cfg umount /mnt fi - } From de768829a5c6cd1c7889ba25c50db07827cfc96c Mon Sep 17 00:00:00 2001 From: James McGuire Date: Wed, 4 Nov 2020 21:13:19 -0800 Subject: [PATCH 30/31] ramips: add support for D-Link DIR-2640 A1 This patch adds support for D-Link DIR-2640 A1. Specifications: * Board: AP-MTKH7-0002 * SoC: MediaTek MT7621AT * RAM: 256 MB (DDR3) * Flash: 128 MB (NAND) * WiFi: MediaTek MT7615N (x2) * Switch: 1 WAN, 4 LAN (Gigabit) * Ports: 1 USB 2.0, 1 USB 3.0 * Buttons: Reset, WPS * LEDs: Power (blue/orange), Internet (blue/orange), WiFi 2.4G (blue), WiFi 5G (blue), USB 3.0 (blue), USB 2.0 (blue) Notes: * WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips Installation: * D-Link Recovery GUI: power down the router, press and hold the reset button, then re-plug it. Keep the reset button pressed until the power LED starts flashing orange, manually assign a static IP address under the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1 * Some modern browsers may have problems flashing via the Recovery GUI, if that occurs consider uploading the firmware through cURL: curl -v -i -F "firmware=@file.bin" 192.168.0.1 MAC addresses: lan factory 0xe000 *:a7 (label) wan factory 0xe006 *:aa 2.4 factory 0xe000 +1 *:a8 5.0 factory 0xe000 +2 *:a9 Seems like vendor didn't replace the dummy entries in the calibration data. Signed-off-by: James McGuire [fix device definition title] Signed-off-by: Adrian Schmutzler --- .../ramips/dts/mt7621_dlink_dir-2640-a1.dts | 34 +++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 7 ++++ .../mt7621/base-files/etc/board.d/01_leds | 1 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 4 files changed, 43 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts new file mode 100644 index 0000000000..323a790600 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_dlink_dir-xx60-a1.dtsi" + +/ { + compatible = "dlink,dir-2640-a1", "mediatek,mt7621-soc"; + model = "D-Link DIR-2640 A1"; +}; + +&leds { + usb2_white { + label = "white:usb2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + trigger-sources = <&ehci_port2>; + linux,default-trigger = "usbport"; + }; + + usb3_white { + label = "white:usb3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + trigger-sources = <&xhci_ehci_port1>; + linux,default-trigger = "usbport"; + }; +}; + +&wifi0 { + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <1>; +}; + +&wifi1 { + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <2>; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index bb7e5a0d48..7e5266a294 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -274,6 +274,13 @@ define Device/dlink_dir-1960-a1 endef TARGET_DEVICES += dlink_dir-1960-a1 +define Device/dlink_dir-2640-a1 + $(Device/dlink_dir-xx60-a1) + DEVICE_MODEL := DIR-2640 + DEVICE_VARIANT := A1 +endef +TARGET_DEVICES += dlink_dir-2640-a1 + define Device/dlink_dir-2660-a1 $(Device/dlink_dir-xx60-a1) DEVICE_MODEL := DIR-2660 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index a492132c79..3dd2a218b9 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -19,6 +19,7 @@ xzwifi,creativebox-v1) ucidef_set_led_netdev "internet" "internet" "blue:internet" "wan" ;; dlink,dir-1960-a1|\ +dlink,dir-2640-a1|\ dlink,dir-2660-a1) ucidef_set_led_netdev "wan" "wan" "white:net" "wan" ;; diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 442e78df3c..b4d07f8146 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -46,6 +46,7 @@ platform_do_upgrade() { asus,rt-ac65p|\ asus,rt-ac85p|\ dlink,dir-1960-a1|\ + dlink,dir-2640-a1|\ dlink,dir-2660-a1|\ hiwifi,hc5962|\ linksys,ea7300-v1|\ From acb336235cc640980ea549655b0702daf9e628f8 Mon Sep 17 00:00:00 2001 From: Aleksandr Mezin Date: Fri, 23 Oct 2020 11:02:37 +0600 Subject: [PATCH 31/31] dnsmasq: 'ipset' config sections Allow configuring ipsets with dedicated config sections: config ipset list name 'ss_rules_dst_forward' list name 'ss_rules6_dst_forward' list domain 't.me' list domain 'telegram.org' instead of current, rather inconvenient syntax: config dnsmasq ... list ipset '/t.me/telegram.org/ss_rules_dst_forward,ss_rules6_dst_forward' Current syntax will still continue to work though. With this change, a LuCI GUI for DNS ipsets should be easy to implement. Signed-off-by: Aleksandr Mezin Signed-off-by: Hans Dedecker [PKG_RELEASE increase] --- package/network/services/dnsmasq/Makefile | 2 +- .../services/dnsmasq/files/dnsmasq.init | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 4086aa25e0..ba10ded333 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_UPSTREAM_VERSION:=2.82 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 7ecc542b44..680e72f9e7 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -769,6 +769,29 @@ dhcp_relay_add() { fi } +dnsmasq_ipset_add() { + local cfg="$1" + local ipsets domains + + add_ipset() { + ipsets="${ipsets:+$ipsets,}$1" + } + + add_domain() { + # leading '/' is expected + domains="$domains/$1" + } + + config_list_foreach "$cfg" "name" add_ipset + config_list_foreach "$cfg" "domain" add_domain + + if [ -z "$ipsets" ] || [ -z "$domains" ]; then + return 0 + fi + + xappend "--ipset=$domains/$ipsets" +} + dnsmasq_start() { local cfg="$1" @@ -1056,6 +1079,10 @@ dnsmasq_start() config_foreach filter_dnsmasq cname dhcp_cname_add "$cfg" echo >> $CONFIGFILE_TMP + echo >> $CONFIGFILE_TMP + config_foreach filter_dnsmasq ipset dnsmasq_ipset_add "$cfg" + echo >> $CONFIGFILE_TMP + echo >> $CONFIGFILE_TMP mv -f $CONFIGFILE_TMP $CONFIGFILE mv -f $HOSTFILE_TMP $HOSTFILE