From 8af80e79bd5b750bf9a5ab01a6ecdb3971248bae Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 5 Apr 2020 15:38:32 -0700 Subject: [PATCH 1/5] tools/cmake: update to 3.17.0 Remove libressl patches; they are no longer needed as LibreSSl adde support Replace qt tests patch with one that disables all of them. Refresh remaining one. Signed-off-by: Rosen Penev --- tools/cmake/Makefile | 6 ++-- .../cmake/patches/100-disable_qt_tests.patch | 34 ------------------- tools/cmake/patches/100-no-testing.patch | 33 ++++++++++++++++++ .../110-libarchive-fix-libressl-compat.patch | 11 ------ .../130-bootstrap_parallel_make_flag.patch | 2 +- .../patches/140-libarchive-fix-libressl.patch | 25 -------------- 6 files changed, 37 insertions(+), 74 deletions(-) delete mode 100644 tools/cmake/patches/100-disable_qt_tests.patch create mode 100644 tools/cmake/patches/100-no-testing.patch delete mode 100644 tools/cmake/patches/110-libarchive-fix-libressl-compat.patch delete mode 100644 tools/cmake/patches/140-libarchive-fix-libressl.patch diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index 336db5dd1f..ab3d225aa6 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.16.5 +PKG_VERSION:=3.17.0 PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \ - https://cmake.org/files/v3.16/ -PKG_HASH:=5f760b50b8ecc9c0c37135fae5fbf00a2fef617059aa9d61c1bb91653e5a8bfc + https://cmake.org/files/v3.17/ +PKG_HASH:=b74c05b55115eacc4fa2b77a814981dbda05cdc95a53e279fe16b7b272f00847 HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 diff --git a/tools/cmake/patches/100-disable_qt_tests.patch b/tools/cmake/patches/100-disable_qt_tests.patch deleted file mode 100644 index 9c0957a390..0000000000 --- a/tools/cmake/patches/100-disable_qt_tests.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/Tests/RunCMake/CMakeLists.txt -+++ b/Tests/RunCMake/CMakeLists.txt -@@ -375,15 +375,6 @@ else() - message(WARNING "Could not find or build ctresalloc") - endif() - --find_package(Qt4 QUIET) --find_package(Qt5Core QUIET) --if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0) -- add_RunCMake_test(IncompatibleQt) --endif() --if (QT4_FOUND) -- add_RunCMake_test(ObsoleteQtMacros -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}) --endif() -- - find_package(PkgConfig QUIET) - if(PKG_CONFIG_FOUND) - add_RunCMake_test(FindPkgConfig) ---- a/Tests/CMakeLists.txt -+++ b/Tests/CMakeLists.txt -@@ -489,13 +489,6 @@ if(BUILD_TESTING) - - list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) - -- if(NOT DEFINED CMake_TEST_Qt4) -- set(CMake_TEST_Qt4 1) -- endif() -- if(CMake_TEST_Qt4 AND NOT QT4_FOUND) -- find_package(Qt4 QUIET) -- endif() -- - if(CMake_TEST_Qt4 AND QT4_FOUND) - # test whether the Qt4 which has been found works, on some machines - # which run nightly builds there were errors like "wrong file format" diff --git a/tools/cmake/patches/100-no-testing.patch b/tools/cmake/patches/100-no-testing.patch new file mode 100644 index 0000000000..501302b835 --- /dev/null +++ b/tools/cmake/patches/100-no-testing.patch @@ -0,0 +1,33 @@ +--- a/Modules/CTest.cmake ++++ b/Modules/CTest.cmake +@@ -47,7 +47,7 @@ the :variable:`CTEST_USE_LAUNCHERS` variable:: + in the ``CTestConfig.cmake`` file. + #]=======================================================================] + +-option(BUILD_TESTING "Build the testing tree." ON) ++option(BUILD_TESTING "Build the testing tree." OFF) + + # function to turn generator name into a version string + # like vs9 or vs10 +--- a/Modules/Dart.cmake ++++ b/Modules/Dart.cmake +@@ -33,7 +33,7 @@ whether testing support should be enabled. The default is ON. + # + # + +-option(BUILD_TESTING "Build the testing tree." ON) ++option(BUILD_TESTING "Build the testing tree." OFF) + + if(BUILD_TESTING) + find_package(Dart QUIET) +--- a/Tests/Contracts/VTK/Dashboard.cmake.in ++++ b/Tests/Contracts/VTK/Dashboard.cmake.in +@@ -25,7 +25,7 @@ ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + + file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " + BUILD_EXAMPLES:BOOL=ON +- BUILD_TESTING:BOOL=ON ++ BUILD_TESTING:BOOL=OFF + VTK_WRAP_PYTHON:BOOL=ON + ExternalData_OBJECT_STORES:FILEPATH=@base_dir@/ExternalData + ") diff --git a/tools/cmake/patches/110-libarchive-fix-libressl-compat.patch b/tools/cmake/patches/110-libarchive-fix-libressl-compat.patch deleted file mode 100644 index ba6565b6af..0000000000 --- a/tools/cmake/patches/110-libarchive-fix-libressl-compat.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Utilities/cmlibarchive/libarchive/archive_openssl_evp_private.h -+++ b/Utilities/cmlibarchive/libarchive/archive_openssl_evp_private.h -@@ -28,7 +28,7 @@ - #include - #include - --#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - #include /* malloc, free */ - #include /* memset */ - static inline EVP_MD_CTX *EVP_MD_CTX_new(void) diff --git a/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch b/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch index 9fcbf63f98..7b6198b14b 100644 --- a/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch +++ b/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch @@ -1,6 +1,6 @@ --- a/bootstrap +++ b/bootstrap -@@ -1248,7 +1248,10 @@ int main(){ printf("1%c", (char)0x0a); r +@@ -1283,7 +1283,10 @@ int main(){ printf("1%c", (char)0x0a); r ' > "test.c" cmake_original_make_flags="${cmake_make_flags}" if [ "x${cmake_parallel_make}" != "x" ]; then diff --git a/tools/cmake/patches/140-libarchive-fix-libressl.patch b/tools/cmake/patches/140-libarchive-fix-libressl.patch deleted file mode 100644 index ddddc5e836..0000000000 --- a/tools/cmake/patches/140-libarchive-fix-libressl.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 5da00ad75b09e262774ec3675bbe4d5a4502a852 Mon Sep 17 00:00:00 2001 -From: Bernard Spil -Date: Sun, 1 Apr 2018 23:01:44 +0200 -Subject: [PATCH] fix build with LibreSSL 2.7 - -LibreSSL 2.7 adds OpenSSL 1.1 API leading to conflicts on method names - -See also: https://bugs.freebsd.org/226853 -Signed-off-by: Bernard Spil ---- - libarchive/archive_openssl_hmac_private.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/Utilities/cmlibarchive/libarchive/archive_openssl_evp_private.h -+++ b/Utilities/cmlibarchive/libarchive/archive_openssl_evp_private.h -@@ -28,7 +28,8 @@ - #include - #include - --#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \ -+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) - #include /* malloc, free */ - #include /* memset */ - static inline EVP_MD_CTX *EVP_MD_CTX_new(void) From ae06a650d68026530beec4196869706866c2e4b1 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sun, 5 Apr 2020 22:26:33 +0200 Subject: [PATCH 2/5] ppp: update to version 2.4.8.git-2020-03-21 Use upstream latest git HEAD as it allows to remove the patches 700-radius-Prevent-buffer-overflow-in-rc_mksid, 701-pppd-Fix-bounds-check-in-EAP-code and 702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP and take in other fixes. 41a7323 pppd: Fixed spelling 'unkown' => 'unknown' (#141) 6b014be pppd: Print version information to stdout instead of stderr (#133) cba2736 pppd: Add RFC1990 (Multilink) to the See Also section of the man page f2f9554 pppd: Add mppe.h to the list of headers to install if MPPE is defined ae54fcf pppd: Obfuscate password argument string 8d45443 pppd: Ignore received EAP messages when not doing EAP 8d7970b pppd: Fix bounds check in EAP code 858976b radius: Prevent buffer overflow in rc_mksid() Signed-off-by: Hans Dedecker --- package/network/services/ppp/Makefile | 5 +- .../services/ppp/patches/200-makefile.patch | 2 +- .../services/ppp/patches/202-no_strip.patch | 4 +- .../300-filter-pcap-includes-lib.patch | 2 +- .../ppp/patches/310-precompile_filter.patch | 4 +- ...openssl-for-the-DES-instead-of-the-l.patch | 2 +- ...-Prevent-buffer-overflow-in-rc_mksid.patch | 30 --------- ...01-pppd-Fix-bounds-check-in-EAP-code.patch | 37 ----------- ...ived-EAP-messages-when-not-doing-EAP.patch | 61 ------------------- 9 files changed, 10 insertions(+), 137 deletions(-) delete mode 100644 package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch delete mode 100644 package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch delete mode 100644 package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 9e42cb7437..03f88e13ac 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -13,14 +13,15 @@ PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/paulusmack/ppp -PKG_SOURCE_VERSION:=78cd384ce0f48bb5edb84e4fe9a574eab4a4ad14 +PKG_SOURCE_DATE:=2020-03-21 +PKG_SOURCE_VERSION:=41a73232c16e9a063cfe3fad461c94af3f450f6c PKG_MIRROR_HASH:=cf284c312b0c90974d11f8aeece173bcac8475f5b810911f4feb2c5a4db263fe PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-4-Clause PKG_CPE_ID:=cpe:/a:samba:ppp PKG_RELEASE_VERSION:=2.4.8 -PKG_VERSION:=$(PKG_RELEASE_VERSION) +PKG_VERSION:=$(PKG_RELEASE_VERSION).git-$(PKG_SOURCE_DATE) PKG_BUILD_DEPENDS:=libpcap diff --git a/package/network/services/ppp/patches/200-makefile.patch b/package/network/services/ppp/patches/200-makefile.patch index 82b1cc67b9..42351392dc 100644 --- a/package/network/services/ppp/patches/200-makefile.patch +++ b/package/network/services/ppp/patches/200-makefile.patch @@ -34,7 +34,7 @@ Signed-off-by: Jo-Philipp Wich CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"' -@@ -125,10 +125,10 @@ CFLAGS += -DHAS_SHADOW +@@ -126,10 +126,10 @@ CFLAGS += -DHAS_SHADOW #LIBS += -lshadow $(LIBS) endif diff --git a/package/network/services/ppp/patches/202-no_strip.patch b/package/network/services/ppp/patches/202-no_strip.patch index 436085f3b3..0af7b2b2ab 100644 --- a/package/network/services/ppp/patches/202-no_strip.patch +++ b/package/network/services/ppp/patches/202-no_strip.patch @@ -19,7 +19,7 @@ Signed-off-by: Jo-Philipp Wich clean: --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -107,7 +107,7 @@ ifdef USE_SRP +@@ -108,7 +108,7 @@ ifdef USE_SRP CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto TARGETS += srp-entry @@ -28,7 +28,7 @@ Signed-off-by: Jo-Philipp Wich MANPAGES += srp-entry.8 EXTRACLEAN += srp-entry.o NEEDDES=y -@@ -219,7 +219,7 @@ all: $(TARGETS) +@@ -220,7 +220,7 @@ all: $(TARGETS) install: pppd mkdir -p $(BINDIR) $(MANDIR) $(EXTRAINSTALL) diff --git a/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch b/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch index 00fb835029..40866132e8 100644 --- a/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch +++ b/package/network/services/ppp/patches/300-filter-pcap-includes-lib.patch @@ -7,7 +7,7 @@ Signed-off-by: Jo-Philipp Wich --- a/pppd/Makefile.linux +++ b/pppd/Makefile.linux -@@ -189,8 +189,8 @@ endif +@@ -190,8 +190,8 @@ endif ifdef FILTER ifneq ($(wildcard /usr/include/pcap-bpf.h),) diff --git a/package/network/services/ppp/patches/310-precompile_filter.patch b/package/network/services/ppp/patches/310-precompile_filter.patch index a65c19cf1c..ec61104423 100644 --- a/package/network/services/ppp/patches/310-precompile_filter.patch +++ b/package/network/services/ppp/patches/310-precompile_filter.patch @@ -23,7 +23,7 @@ Signed-off-by: Jo-Philipp Wich # Uncomment the next line to enable multilink PPP (enabled by default) # Linux distributions: Please leave multilink ENABLED in your builds # of pppd! -@@ -194,6 +197,14 @@ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR) +@@ -195,6 +198,14 @@ CFLAGS += -DPPP_FILTER -I$(STAGING_DIR) endif endif @@ -77,7 +77,7 @@ Signed-off-by: Jo-Philipp Wich #ifdef MAXOCTETS { "maxoctets", o_int, &maxoctets, "Set connection traffic limit", -@@ -1511,6 +1527,29 @@ callfile(argv) +@@ -1516,6 +1532,29 @@ callfile(argv) return ok; } diff --git a/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch b/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch index 9676824f5f..331ec09ed2 100644 --- a/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch +++ b/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch @@ -28,7 +28,7 @@ This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875. # Don't use MSLANMAN unless you really know what you're doing. #MSLANMAN=y # Uncomment the next line to include support for MPPE. CHAPMS (above) must -@@ -140,8 +140,7 @@ endif +@@ -141,8 +141,7 @@ endif ifdef NEEDDES ifndef USE_CRYPT diff --git a/package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch b/package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch deleted file mode 100644 index 1c5722e6dd..0000000000 --- a/package/network/services/ppp/patches/700-radius-Prevent-buffer-overflow-in-rc_mksid.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 858976b1fc3107f1261aae337831959b511b83c2 Mon Sep 17 00:00:00 2001 -From: Paul Mackerras -Date: Sat, 4 Jan 2020 12:01:32 +1100 -Subject: [PATCH] radius: Prevent buffer overflow in rc_mksid() - -On some systems getpid() can return a value greater than 65535. -Increase the size of buf[] to allow for this, and use slprintf() -to make sure we never overflow it. - -Signed-off-by: Paul Mackerras ---- - pppd/plugins/radius/util.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pppd/plugins/radius/util.c b/pppd/plugins/radius/util.c -index 6f976a712951..740131e8377c 100644 ---- a/pppd/plugins/radius/util.c -+++ b/pppd/plugins/radius/util.c -@@ -73,9 +73,9 @@ void rc_mdelay(int msecs) - char * - rc_mksid (void) - { -- static char buf[15]; -+ static char buf[32]; - static unsigned short int cnt = 0; -- sprintf (buf, "%08lX%04X%02hX", -+ slprintf(buf, sizeof(buf), "%08lX%04X%02hX", - (unsigned long int) time (NULL), - (unsigned int) getpid (), - cnt & 0xFF); diff --git a/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch b/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch deleted file mode 100644 index c2ca9729ec..0000000000 --- a/package/network/services/ppp/patches/701-pppd-Fix-bounds-check-in-EAP-code.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 8d7970b8f3db727fe798b65f3377fe6787575426 Mon Sep 17 00:00:00 2001 -From: Paul Mackerras -Date: Mon, 3 Feb 2020 15:53:28 +1100 -Subject: [PATCH] pppd: Fix bounds check in EAP code - -Given that we have just checked vallen < len, it can never be the case -that vallen >= len + sizeof(rhostname). This fixes the check so we -actually avoid overflowing the rhostname array. - -Reported-by: Ilja Van Sprundel -Signed-off-by: Paul Mackerras ---- - pppd/eap.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pppd/eap.c b/pppd/eap.c -index 94407f56a336..1b93db01aebd 100644 ---- a/pppd/eap.c -+++ b/pppd/eap.c -@@ -1420,7 +1420,7 @@ int len; - } - - /* Not so likely to happen. */ -- if (vallen >= len + sizeof (rhostname)) { -+ if (len - vallen >= sizeof (rhostname)) { - dbglog("EAP: trimming really long peer name down"); - BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; -@@ -1846,7 +1846,7 @@ int len; - } - - /* Not so likely to happen. */ -- if (vallen >= len + sizeof (rhostname)) { -+ if (len - vallen >= sizeof (rhostname)) { - dbglog("EAP: trimming really long peer name down"); - BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1); - rhostname[sizeof (rhostname) - 1] = '\0'; diff --git a/package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch b/package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch deleted file mode 100644 index 7286d81a56..0000000000 --- a/package/network/services/ppp/patches/702-pppd-Ignore-received-EAP-messages-when-not-doing-EAP.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 8d45443bb5c9372b4c6a362ba2f443d41c5636af Mon Sep 17 00:00:00 2001 -From: Paul Mackerras -Date: Mon, 3 Feb 2020 16:31:42 +1100 -Subject: [PATCH] pppd: Ignore received EAP messages when not doing EAP - -This adds some basic checks to the subroutines of eap_input to check -that we have requested or agreed to doing EAP authentication before -doing any processing on the received packet. The motivation is to -make it harder for a malicious peer to disrupt the operation of pppd -by sending unsolicited EAP packets. Note that eap_success() already -has a check that the EAP client state is reasonable, and does nothing -(apart from possibly printing a debug message) if not. - -Signed-off-by: Paul Mackerras ---- - pppd/eap.c | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/pppd/eap.c b/pppd/eap.c -index 1b93db01aebd..082e95343120 100644 ---- a/pppd/eap.c -+++ b/pppd/eap.c -@@ -1328,6 +1328,12 @@ int len; - int fd; - #endif /* USE_SRP */ - -+ /* -+ * Ignore requests if we're not open -+ */ -+ if (esp->es_client.ea_state <= eapClosed) -+ return; -+ - /* - * Note: we update es_client.ea_id *only if* a Response - * message is being generated. Otherwise, we leave it the -@@ -1736,6 +1742,12 @@ int len; - u_char dig[SHA_DIGESTSIZE]; - #endif /* USE_SRP */ - -+ /* -+ * Ignore responses if we're not open -+ */ -+ if (esp->es_server.ea_state <= eapClosed) -+ return; -+ - if (esp->es_server.ea_id != id) { - dbglog("EAP: discarding Response %d; expected ID %d", id, - esp->es_server.ea_id); -@@ -2047,6 +2059,12 @@ u_char *inp; - int id; - int len; - { -+ /* -+ * Ignore failure messages if we're not open -+ */ -+ if (esp->es_client.ea_state <= eapClosed) -+ return; -+ - if (!eap_client_active(esp)) { - dbglog("EAP unexpected failure message in state %s (%d)", - eap_state_name(esp->es_client.ea_state), From 7daab6286110b95167e291409395494f18edc9dc Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Wed, 11 Mar 2020 16:00:42 -0500 Subject: [PATCH 3/5] ath79: add support for Comfast CF-EW72 Specifications: Qualcomm/Atheros QCA9531 + QCA9886 2x 10/100 Mbps Ethernet, with 48v PoE 2T2R 2.4 GHz, 802.11b/g/n 2T2R 5 GHz, 802.11a/n/ac 128MB RAM 16MB SPI Flash 4x LED (Always On Power, LAN, WAN, WLAN) Flashing Instructions: Original firmware is based on OpenWRT, so flashing the sysupgrade image on the factory firmware is sufficient. Tested: Reset button, WAN LED, LAN LED, Power LED (always on, not much to test), WLAN LED (one LED only for 2 interfaces, by default it gets assigned to the first interface), MAC addresses (match factory firmware). My LAN factory MAC address ends in F2. use stock_mac art_loc lan :f2 0x0 wan :f3 0x1002 5g :f4 0x6 2g :f5 0x5006 Since MAC address flash locations do not really match their use in vendor firmware (e.g. address from 5 GHz calibration data is assigned to 2.4 GHz WiFi), just calculate the MAC addresses with an offset based on 0x0 address. Signed-off-by: Chris Morgan [add MAC address comment] Signed-off-by: Adrian Schmutzler --- .../ath79/dts/qca9531_comfast_cf-ew72.dts | 132 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 4 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 3 +- target/linux/ath79/image/generic.mk | 10 ++ 4 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts new file mode 100644 index 0000000000..06c8f0737e --- /dev/null +++ b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "comfast,cf-ew72", "qca,qca9531"; + model = "COMFAST CF-EW72"; + + aliases { + serial0 = &uart; + led-boot = &led_wan; + led-failsafe = &led_wan; + led-upgrade = &led_wan; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + lan { + label = "cf-ew72:blue:lan"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + led_wan: wan { + label = "cf-ew72:blue:wan"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "cf-ew72:blue:wlan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + hw_margin_ms = <1200>; + always-running; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "winbond,w25q128", "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x010000>; + read-only; + }; + + art: partition@10000 { + label = "art"; + reg = <0x010000 0x010000>; + read-only; + }; + + partition@20000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x020000 0xfd0000>; + }; + + partition@ff0000 { + label = "nvram"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; +}; + +ð1 { + mtd-mac-address = <&art 0x0>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <3>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 046339aa0a..8e84ca25bf 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -80,6 +80,10 @@ comfast,cf-e560ac) ucidef_set_led_switch "lan3" "LAN3" "$boardname:blue:lan3" "switch0" "0x08" ucidef_set_led_switch "lan4" "LAN4" "$boardname:blue:lan4" "switch0" "0x10" ;; +comfast,cf-ew72) + ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x02" + ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:wan" "eth1" + ;; devolo,magic-2-wifi) ucidef_set_led_netdev "plcw" "dLAN" "devolo:white:dlan" "eth0.1" "rx" ;; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index d354c7eaec..18bdfa2b22 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -140,7 +140,8 @@ case "$FIRMWARE" in /lib/firmware/ath10k/QCA9888/hw2.0/board.bin rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin ;; - comfast,cf-e560ac) + comfast,cf-e560ac|\ + comfast,cf-ew72) caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2) ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index aac89e9269..87586492be 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -326,6 +326,16 @@ define Device/comfast_cf-e560ac endef TARGET_DEVICES += comfast_cf-e560ac +define Device/comfast_cf-ew72 + SOC := qca9531 + DEVICE_VENDOR := COMFAST + DEVICE_MODEL := CF-EW72 + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca9888-ct \ + -uboot-envtools -swconfig + IMAGE_SIZE := 16192k +endef +TARGET_DEVICES += comfast_cf-ew72 + define Device/comfast_cf-wr650ac-v1 SOC := qca9558 DEVICE_VENDOR := COMFAST From c459a6bf482f5afc4746a4a108a143e9194cd59d Mon Sep 17 00:00:00 2001 From: Dan Haab Date: Mon, 6 Apr 2020 16:14:39 -0700 Subject: [PATCH 4/5] bcm53xx: add support for Luxul FullMAC WiFi devices This prepares support for models XAP-1610 and XWR-3150. Flashing requires using Luxul firmware version: 1) 8.1.0 or newer for XAP-1610 2) 6.4.0 or newer for XWR-3150 and uploading firmware using "Firmware Update" web UI page. Signed-off-by: Dan Haab --- .../bcm53xx/base-files/etc/board.d/02_network | 19 ++++++++++++++++++- target/linux/bcm53xx/image/Makefile | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network index f86f12407f..b3d614d6a2 100755 --- a/target/linux/bcm53xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network @@ -36,6 +36,15 @@ bcm53xx_setup_interfaces() ucidef_add_switch "switch0" \ "0:wan" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5@eth0" ;; + luxul,xap-1610-v1) + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "5@eth0" + ucidef_set_interface_lan "eth0.1" "dhcp" + ;; + luxul,xwr-3150-v1) + ucidef_add_switch "switch0" \ + "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan" "5@eth0" + ;; phicomm,k3) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:wan" "5@eth0" @@ -87,20 +96,28 @@ bcm53xx_setup_macs() case "$board" in asus,rt-ac87u) etXmacaddr=$(nvram get et1macaddr) + offset=1 ;; dlink,dir-885l | \ netgear,r7900 | \ netgear,r8000 | \ netgear,r8500) etXmacaddr=$(nvram get et2macaddr) + offset=1 + ;; + luxul,xwr-3100v1 | \ + luxul,xwr-3150-v1) + etXmacaddr=$(nvram get et0macaddr) + offset=5 ;; *) etXmacaddr=$(nvram get et0macaddr) + offset=1 ;; esac # If WAN MAC isn't explicitly set, calculate it using base MAC as reference. - [ -z "$wan_macaddr" -a -n "$etXmacaddr" ] && wan_macaddr=$(macaddr_add "$etXmacaddr" 1) + [ -z "$wan_macaddr" -a -n "$etXmacaddr" ] && wan_macaddr=$(macaddr_add "$etXmacaddr" $offset) [ -n "$wan_macaddr" ] && ucidef_set_interface_macaddr "wan" "$wan_macaddr" } diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 610af03abe..b3ec1e99a2 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -291,6 +291,15 @@ define Device/luxul-abr-4500 endef TARGET_DEVICES += luxul-abr-4500 +define Device/luxul-xap-1610 + $(Device/luxul) + DEVICE_MODEL := XAP-1610 + DEVICE_PACKAGES := $(BRCMFMAC_4366C0) + IMAGE/lxl := append-rootfs | trx-serial | luxul-lxl + LUXUL_BOARD := XAP-1610 +endef +TARGET_DEVICES += luxul-xap-1610 + define Device/luxul-xbr-4500 $(Device/luxul) DEVICE_MODEL := XBR-4500 @@ -299,6 +308,15 @@ define Device/luxul-xbr-4500 endef TARGET_DEVICES += luxul-xbr-4500 +define Device/luxul-xwr-3150 + $(Device/luxul) + DEVICE_MODEL := XWR-3150 + DEVICE_PACKAGES := $(BRCMFMAC_4366C0) $(USB3_PACKAGES) + DEVICE_DTS := bcm47094-luxul-xwr-3150-v1 + LUXUL_BOARD := XWR-3150 +endef +TARGET_DEVICES += luxul-xwr-3150 + define Device/netgear DEVICE_VENDOR := NETGEAR IMAGES := chk From e8787291b351a98a522ecc255a1da78394558588 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Sat, 23 Mar 2019 22:45:42 +0900 Subject: [PATCH 5/5] ramips: add support for Buffalo WSR-2533DHPL Buffalo WSR-2533DHPL is a 2.4/5 GHz band 11ac router, based on MediaTek MT7621A. Specification: - SoC : MediaTek MT7621A - RAM : DDR3 128 MiB - Flash : SPI-NOR 16 MiB - WLAN : 2.4/5 GHz 4T4R (2x MediaTek MT7615N) - Ethernet : 10/100/1000 Mbps - Switch : MediaTek MT7530 (SoC) - LED/keys : 8x/6x (3x buttons, 2x slide-switches) - UART : through-hole on PCB - J4: 3.3V, GND, TX, RX from triangle-mark - 57600n8 - Power : 12VDC 1.5A Flash instruction using initramfs image: 1. prepare the TFTP server with the initramfs image renamed to "linux.trx-recovery" and IP address "192.168.11.2" 2. press the "AOSS" button while powering on the WSR-2533DHPL 3. after 10 seconds, release the "AOSS" button, WSR-2533DHPL downloads the initramfs image and boot with it automatically 4. on the initramfs image, download the sysupgrade image to the device and perform sysupgrade with it 5. wait ~120 seconds to complete flashing Switch position overview: - slide-switch1 (2x positions) - "AUTO" - "MANUAL" (not connected to gpio) - slide-switch2 (3x positions) - "ROUTER" - "AP" (not connected to gpio) - "WB" Signed-off-by: INAGAKI Hiroshi [add note on switches, fix group->groups for state_default] Signed-off-by: Adrian Schmutzler --- .../dts/mt7621_buffalo_wsr-2533dhpl.dts | 236 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 9 + 2 files changed, 245 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts new file mode 100644 index 0000000000..e17c66689a --- /dev/null +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts @@ -0,0 +1,236 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "buffalo,wsr-2533dhpl", "mediatek,mt7621-soc"; + model = "Buffalo WSR-2533DHPL"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_diag; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + leds { + compatible = "gpio-leds"; + + internet_green { + label = "wsr-2533dhpl:green:internet"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + }; + + router_green { + label = "wsr-2533dhpl:green:router"; + gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + }; + + router_amber { + label = "wsr-2533dhpl:amber:router"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + }; + + internet_amber { + label = "wsr-2533dhpl:amber:internet"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + + wireless_amber { + label = "wsr-2533dhpl:amber:wireless"; + gpios = <&gpio 45 GPIO_ACTIVE_LOW>; + }; + + led_power: power { + label = "wsr-2533dhpl:green:power"; + gpios = <&gpio 46 GPIO_ACTIVE_LOW>; + }; + + led_diag: diag { + label = "wsr-2533dhpl:amber:diag"; + gpios = <&gpio 47 GPIO_ACTIVE_LOW>; + }; + + wireless_green { + label = "wsr-2533dhpl:green:wireless"; + gpios = <&gpio 48 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + aoss { + label = "aoss"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + auto { + label = "auto"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + bridge { + label = "wb"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + router { + label = "router"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + power { + label = "power"; + gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "openwrt,trx"; + label = "firmware"; + reg = <0x50000 0x7c0000>; + }; + + partition@810000 { + label = "Kernel2"; + reg = <0x810000 0x7c0000>; + read-only; + }; + + partition@fd0000 { + label = "glbcfg"; + reg = <0xfd0000 0x010000>; + read-only; + }; + + partition@fe0000 { + label = "board_data"; + reg = <0xfe0000 0x20000>; + read-only; + }; + }; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <(-1)>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "wan"; + }; + + port@1 { + status = "okay"; + label = "lan4"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan2"; + }; + + port@4 { + status = "okay"; + label = "lan1"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart2", "uart3", "wdt", "sdhci"; + function = "gpio"; + }; +}; + +&xhci { + status = "disabled"; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index cdae42f3e4..30552ebee1 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -196,6 +196,15 @@ define Device/buffalo_wsr-1166dhp endef TARGET_DEVICES += buffalo_wsr-1166dhp +define Device/buffalo_wsr-2533dhpl + IMAGE_SIZE := 7936k + DEVICE_VENDOR := Buffalo + DEVICE_MODEL := WSR-2533DHPL + IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata + DEVICE_PACKAGES := kmod-mt7615e wpad-basic +endef +TARGET_DEVICES += buffalo_wsr-2533dhpl + define Device/buffalo_wsr-600dhp IMAGE_SIZE := 16064k DEVICE_VENDOR := Buffalo