From 1302bee12ac94a651b7954d56f57a7193518a5d0 Mon Sep 17 00:00:00 2001 From: Nadim Atiya Date: Sun, 23 Aug 2020 01:07:40 +0100 Subject: [PATCH 01/97] hostapd: parse skip_inactivity_poll option hostapd.sh does not parse skip_inactivity_poll boolean from /etc/config/wireless despite being mentioned in the documentation [1]. This change fixes this, and by default sets its value to 0 [1]. [1] https://openwrt.org/docs/guide-user/network/wifi/basic Signed-off-by: Nadim Atiya Signed-off-by: Daniel Golle [fix and reformat commit message, make patch apply] --- package/network/services/hostapd/Makefile | 2 +- package/network/services/hostapd/files/hostapd.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 61b2a548ef..45e2e3e337 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=18 +PKG_RELEASE:=19 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 41b04e6029..80ded8ffbc 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -229,7 +229,7 @@ hostapd_common_add_bss_config() { config_add_boolean wds wmm uapsd hidden utf8_ssid config_add_int maxassoc max_inactivity - config_add_boolean disassoc_low_ack isolate short_preamble + config_add_boolean disassoc_low_ack isolate short_preamble skip_inactivity_poll config_add_int \ wep_rekey eap_reauth_period \ @@ -477,7 +477,7 @@ hostapd_set_bss_options() { iapp_interface eapol_version dynamic_vlan ieee80211w nasid \ acct_server acct_secret acct_port acct_interval \ bss_load_update_period chan_util_avg_period sae_require_mfp \ - multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key \ + multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \ airtime_bss_weight airtime_bss_limit airtime_sta_weight set_default isolate 0 @@ -485,6 +485,7 @@ hostapd_set_bss_options() { set_default max_inactivity 0 set_default short_preamble 1 set_default disassoc_low_ack 1 + set_default skip_inactivity_poll 0 set_default hidden 0 set_default wmm 1 set_default uapsd 1 @@ -517,6 +518,7 @@ hostapd_set_bss_options() { append bss_conf "bss_load_update_period=$bss_load_update_period" "$N" append bss_conf "chan_util_avg_period=$chan_util_avg_period" "$N" append bss_conf "disassoc_low_ack=$disassoc_low_ack" "$N" + append bss_conf "skip_inactivity_poll=$skip_inactivity_poll" "$N" append bss_conf "preamble=$short_preamble" "$N" append bss_conf "wmm_enabled=$wmm" "$N" append bss_conf "ignore_broadcast_ssid=$hidden" "$N" From b1952dc259ce3eb7ac6023c9e02d5adf2546efca Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 18 Dec 2020 16:22:29 -0800 Subject: [PATCH 02/97] ccache: update to 4.1 Upstream switched to building with CMake. Adjust accordingly. Reapplied patch as upstream changed the file format. Added HOST_BUILD_PARALLEL for faster compilation. Signed-off-by: Rosen Penev --- tools/ccache/Makefile | 13 +++++-------- tools/ccache/patches/100-honour-copts.patch | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 6e55001fd5..ee9ed08b28 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -8,25 +8,22 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=3.7.11 +PKG_VERSION:=4.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=8d450208099a4d202bd7df87caaec81baee20ce9dd62da91e9ea7b95a9072f68 +PKG_HASH:=5fdc804056632d722a1182e15386696f0ea6c59cb4ab4d65a54f0b269ae86f99 + +HOST_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/host-build.mk - -HOST_CONFIGURE_VARS += CC="$(HOSTCC_NOCACHE)" +include $(INCLUDE_DIR)/cmake.mk define Host/Install/ccache $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ $(CP) ./files/* $(STAGING_DIR_HOST)/bin/ endef -define Host/Clean - -$(MAKE) -C $(HOST_BUILD_DIR) uninstall - $(call Host/Clean/Default) -endef define Host/Install $(call Host/Install/Default) $(call Host/Install/ccache) diff --git a/tools/ccache/patches/100-honour-copts.patch b/tools/ccache/patches/100-honour-copts.patch index ccfa1c0247..e4045ef9be 100644 --- a/tools/ccache/patches/100-honour-copts.patch +++ b/tools/ccache/patches/100-honour-copts.patch @@ -1,10 +1,10 @@ ---- a/src/ccache.c -+++ b/src/ccache.c -@@ -2277,6 +2277,7 @@ calculate_object_hash(struct args *args, - "CPLUS_INCLUDE_PATH", - "OBJC_INCLUDE_PATH", - "OBJCPLUS_INCLUDE_PATH", // clang -+ "GCC_HONOUR_COPTS", - NULL - }; - for (const char **p = envvars; *p; ++p) { +--- a/src/ccache.cpp ++++ b/src/ccache.cpp +@@ -1654,6 +1654,7 @@ calculate_result_name(Context& ctx, + "CPLUS_INCLUDE_PATH", + "OBJC_INCLUDE_PATH", + "OBJCPLUS_INCLUDE_PATH", // clang ++ "GCC_HONOUR_COPTS", + nullptr}; + for (const char** p = envvars; *p; ++p) { + const char* v = getenv(*p); From c0e6b785f00737a767113c728a6cf4f3838ef9a2 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 16 Dec 2020 23:33:55 -0800 Subject: [PATCH 03/97] tools/pkgconf: update to 1.7.3 Remove upstreamed patch. Signed-off-by: Rosen Penev --- tools/pkgconf/Makefile | 4 +-- ...move-version-to-modversion-remapping.patch | 36 ------------------- 2 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile index cefee1edf0..7d785aae39 100644 --- a/tools/pkgconf/Makefile +++ b/tools/pkgconf/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pkgconf -PKG_VERSION:=1.6.3 +PKG_VERSION:=1.7.3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf -PKG_HASH:=61f0b31b0d5ea0e862b454a80c170f57bad47879c0c42bd8de89200ff62ea210 +PKG_HASH:=b846aea51cf696c3392a0ae58bef93e2e72f8e7073ca6ad1ed8b01c85871f9c0 HOST_BUILD_PARALLEL:=1 diff --git a/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch b/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch deleted file mode 100644 index b2c538d24e..0000000000 --- a/tools/pkgconf/patches/0001-cli-remove-version-to-modversion-remapping.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 62bbd3b664d4b03011a4b382ed20353a91c30406 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill -Date: Tue, 21 Jan 2020 10:32:36 -0600 -Subject: [PATCH] cli: remove --version to --modversion remapping - -This has been a source of frequent complaints, so we drop it. -Resolves: https://todo.sr.ht/~kaniini/pkgconf/6 ---- - cli/main.c | 14 ++------------ - 1 file changed, 2 insertions(+), 12 deletions(-) - -diff --git a/cli/main.c b/cli/main.c -index 563ec8f0cfcd..fc698a4f9191 100644 ---- a/cli/main.c -+++ b/cli/main.c -@@ -1005,18 +1005,8 @@ main(int argc, char *argv[]) - - if ((want_flags & PKG_VERSION) == PKG_VERSION) - { -- if (argc > 2) -- { -- fprintf(stderr, "%s: --version specified with other options or module names, assuming --modversion.\n", argv[0]); -- -- want_flags &= ~PKG_VERSION; -- want_flags |= PKG_MODVERSION; -- } -- else -- { -- version(); -- return EXIT_SUCCESS; -- } -+ version(); -+ return EXIT_SUCCESS; - } - - if ((want_flags & PKG_HELP) == PKG_HELP) From 0d502293e6061d99184a42ea728966f1432b6233 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 11 Jul 2020 11:26:14 -0700 Subject: [PATCH 04/97] elfutils: update to 0.180 Refreshed patches. Signed-off-by: Rosen Penev --- package/libs/elfutils/Makefile | 4 ++-- package/libs/elfutils/patches/100-musl-compat.patch | 2 +- package/libs/elfutils/patches/110-no-cdefs.patch | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index e6868c56f4..f2b25d2c36 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=elfutils -PKG_VERSION:=0.179 +PKG_VERSION:=0.180 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION) -PKG_HASH:=25a545566cbacaa37ae6222e58f1c48ea4570f53ba991886e2f5ce96e22a23a2 +PKG_HASH:=b827b6e35c59d188ba97d7cf148fa8dc6f5c68eb6c5981888dfdbb758c0b569d PKG_MAINTAINER:=Luiz Angelo Daros de Luca PKG_LICENSE:=GPL-3.0-or-later diff --git a/package/libs/elfutils/patches/100-musl-compat.patch b/package/libs/elfutils/patches/100-musl-compat.patch index 374e832d3f..508ff9e946 100644 --- a/package/libs/elfutils/patches/100-musl-compat.patch +++ b/package/libs/elfutils/patches/100-musl-compat.patch @@ -24,7 +24,7 @@ https://sourceware.org/bugzilla/show_bug.cgi?id=21002 #include --- a/libdw/libdw_alloc.c +++ b/libdw/libdw_alloc.c -@@ -147,5 +147,5 @@ __attribute ((noreturn)) attribute_hidde +@@ -152,5 +152,5 @@ __attribute ((noreturn)) attribute_hidde __libdw_oom (void) { while (1) diff --git a/package/libs/elfutils/patches/110-no-cdefs.patch b/package/libs/elfutils/patches/110-no-cdefs.patch index a7216c141e..f95625a913 100644 --- a/package/libs/elfutils/patches/110-no-cdefs.patch +++ b/package/libs/elfutils/patches/110-no-cdefs.patch @@ -39,9 +39,9 @@ Signed-off-by: Rosen Penev /* Standard ELF types. */ -@@ -4007,6 +4007,8 @@ enum - #define R_NDS32_TLS_TPOFF 102 - #define R_NDS32_TLS_DESC 119 +@@ -4103,6 +4103,8 @@ enum + #define R_ARC_TLS_LE_S9 0x4a + #define R_ARC_TLS_LE_32 0x4b -__END_DECLS +#ifdef __cplusplus From 5036383ccc2de254dec3957928785914a7c3de4a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 25 Nov 2020 16:20:25 -0800 Subject: [PATCH 05/97] binutils: update to 2.35.1 Fixes compilation with musl 1.2.x. Signed-off-by: Rosen Penev --- package/devel/binutils/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 9f7a0724f4..23f1ea9c25 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=binutils -PKG_VERSION:=2.34 +PKG_VERSION:=2.35.1 PKG_RELEASE:=1 PKG_SOURCE_URL:=@GNU/binutils PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_VERSION:=$(PKG_VERSION) -PKG_HASH:=f00b0e8803dc9bab1e2165bd568528135be734df3fabf8d0161828cd56028952 +PKG_HASH:=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607 PKG_FIXUP:=autoreconf PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl From 36540aa973cb87ac92012852eed2a733b9ceb54e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 5 Dec 2020 17:04:49 -0800 Subject: [PATCH 06/97] nettle: update to 3.6 Updated ABI_VERSION. Switched PKG_BUILD_PARALLEL on as there seems to be no issue anymore. I can't find any information about why it was turned off. Fixed license information. Signed-off-by: Rosen Penev --- package/libs/nettle/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package/libs/nettle/Makefile b/package/libs/nettle/Makefile index b9324e4793..b15ea0fa07 100644 --- a/package/libs/nettle/Makefile +++ b/package/libs/nettle/Makefile @@ -8,17 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nettle -PKG_VERSION:=3.5.1 -PKG_RELEASE:=2 +PKG_VERSION:=3.6 +PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/nettle -PKG_HASH:=75cca1998761b02e16f2db56da52992aef622bf55a3b45ec538bc2eedadc9419 +PKG_HASH:=d24c0d0f2abffbc8f4f34dcf114b0f131ec3774895f3555922fe2f40f3d5e3f1 -PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING -PKG_BUILD_PARALLEL:=0 +PKG_BUILD_PARALLEL:=1 PKG_CONFIG_DEPENDS := CONFIG_LIBNETTLE_MINI @@ -30,7 +30,7 @@ define Package/libnettle TITLE:=GNU crypto library URL:=http://www.lysator.liu.se/~nisse/nettle/ DEPENDS+= +!LIBNETTLE_MINI:libgmp - ABI_VERSION:=7 + ABI_VERSION:=8 endef define Package/libnettle/config From 6e5759f6b4852515a6092a43a767a0f5e09a6cb7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 10 Dec 2020 01:56:28 -0800 Subject: [PATCH 07/97] pcre: fix paths in config file The paths are pointing to OS paths, not OpenWrt ones. Use SED line from libpng to fix and adjust accordingly. This may allow certain packages that use the config file to pick up pcre. Signed-off-by: Rosen Penev --- package/libs/pcre/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/libs/pcre/Makefile b/package/libs/pcre/Makefile index bf3f733a5c..37d939da7f 100644 --- a/package/libs/pcre/Makefile +++ b/package/libs/pcre/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pcre PKG_VERSION:=8.44 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/$(PKG_NAME) @@ -87,6 +87,7 @@ MAKE_FLAGS += \ define Build/InstallDev $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pcre-config $(1)/usr/bin/ + $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/pcre-config $(INSTALL_DIR) $(2)/bin $(LN) $(STAGING_DIR)/usr/bin/pcre-config $(2)/bin From 57ad2a94211e68e418303d6ff2f70f03dfd4819a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 14 Oct 2020 23:03:25 -0700 Subject: [PATCH 08/97] fs/cifs: update module dependencies 0fdfef9aa7ee68ddd508aef7c98630cfc054f8d6 upstream removed CIFS_SMB311. Kernels 4.19 and above do not have it. Currently only kernels 4.19 and 5.4 are in the tree. The Kconfig file in the kernel has more selection that what is in here. Add the rest and reorder based on upstream ordering. Signed-off-by: Rosen Penev --- package/kernel/linux/modules/fs.mk | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index 18976a7941..d43542b17e 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -90,19 +90,22 @@ define KernelPackage/fs-cifs KCONFIG:= \ CONFIG_CIFS \ CONFIG_CIFS_DFS_UPCALL=n \ - CONFIG_CIFS_UPCALL=n \ - CONFIG_CIFS_SMB311=n + CONFIG_CIFS_UPCALL=n FILES:=$(LINUX_DIR)/fs/cifs/cifs.ko AUTOLOAD:=$(call AutoLoad,30,cifs) $(call AddDepends/nls) DEPENDS+= \ - +kmod-crypto-arc4 \ - +kmod-crypto-hmac \ - +kmod-crypto-md5 \ +kmod-crypto-md4 \ - +kmod-crypto-des \ + +kmod-crypto-md5 \ + +kmod-crypto-sha256 \ + +kmod-crypto-sha512 \ + +kmod-crypto-cmac \ + +kmod-crypto-hmac \ + +kmod-crypto-arc4 \ + +kmod-crypto-aead \ + +kmod-crypto-ccm \ +kmod-crypto-ecb \ - +kmod-crypto-sha256 + +kmod-crypto-des endef define KernelPackage/fs-cifs/description From bc3edae488bea4219f99782b9b22753897b3c51d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 14 Oct 2020 23:03:26 -0700 Subject: [PATCH 09/97] target/linux: disable CONFIG_CIFS_STATS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CIFS_STATS is a debugging option. It is not really useful for end users Signed-off-by: Rosen Penev [fixed missing config-4.19 file] Signed-off-by: Petr Štetiar --- target/linux/generic/config-5.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 10d14f6be5..fa7b6b98c4 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -833,7 +833,7 @@ CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y # CONFIG_CIFS_NFSD_EXPORT is not set CONFIG_CIFS_POSIX=y # CONFIG_CIFS_SMB2 is not set -CONFIG_CIFS_STATS=y +# CONFIG_CIFS_STATS is not set # CONFIG_CIFS_STATS2 is not set # CONFIG_CIFS_WEAK_PW_HASH is not set CONFIG_CIFS_XATTR=y From 2a92754ce92e8e360f3a452ffbe738f6f8957290 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 14 Dec 2020 17:56:17 -0800 Subject: [PATCH 10/97] libpcap: fix pcap-config pcap-config as installed is using OS paths instead of OpenWrt ones. Take fix from libpng and adjust as needed. This problem seems to occur on Arch Linux and not on Debian/Fedora based distros. No idea why. Remove CMAKE_INSTALL as there is now an InstallDev section. Signed-off-by: Rosen Penev --- package/libs/libpcap/Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 1a2cdcdd98..35ceb18c29 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libpcap PKG_VERSION:=1.9.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ @@ -18,7 +18,6 @@ PKG_HASH:=635237637c5b619bcceba91900666b64d56ecb7be63f298f601ec786ce087094 PKG_MAINTAINER:=Felix Fietkau -CMAKE_INSTALL:=1 PKG_ASLR_PIE_REGULAR:=1 PKG_BUILD_PARALLEL:=1 @@ -71,6 +70,15 @@ CMAKE_OPTIONS += $(if $(CONFIG_PCAP_HAS_NETFILTER) ,,-DPCAP_SUPPORT_NETFILTER=OF CMAKE_OPTIONS += $(if $(CONFIG_IPV6),-DINET6=ON,-DINET6=OFF) +define Build/InstallDev + $(call Build/InstallDev/cmake,$(1)) + $(SED) \ + 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \ + $(1)/usr/bin/pcap-config + $(INSTALL_DIR) $(2)/bin + $(LN) ../../usr/bin/pcap-config $(2)/bin/pcap-config +endef + define Package/libpcap/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/ From 6a1ad19cd3659b8df386ef8d7d2f9680bf749558 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 14 Dec 2020 17:56:18 -0800 Subject: [PATCH 11/97] tcpdump: fix pcap-config issues The patch removes a libpcap check to avoid a problem with libpcap. Fix libpcap instead. Modernize Makefile: Use a normal autoconf bool instead of checking for CONFIG_IPV6. Remove old configure and MAKE_FLAGS hacks. Removing them results in compilation continuing to work without a problem. Signed-off-by: Rosen Penev --- package/network/utils/tcpdump/Makefile | 27 +----- .../002-remove_static_libpcap_check.patch | 92 ------------------- 2 files changed, 4 insertions(+), 115 deletions(-) delete mode 100644 package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch diff --git a/package/network/utils/tcpdump/Makefile b/package/network/utils/tcpdump/Makefile index 3e4d9d2d73..f333cf98d2 100644 --- a/package/network/utils/tcpdump/Makefile +++ b/package/network/utils/tcpdump/Makefile @@ -9,20 +9,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tcpdump PKG_VERSION:=4.9.3 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ http://www.tcpdump.org/release/ PKG_HASH:=2cd47cb3d460b6ff75f4a9940f594317ad456cfbf2bd2c8e5151e16559db6410 -PKG_BUILD_PARALLEL:=1 - PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause PKG_CPE_ID:=cpe:/a:tcpdump:tcpdump PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk @@ -47,36 +46,18 @@ endef CONFIGURE_ARGS += \ --without-cap-ng \ - --without-crypto - -ifeq ($(CONFIG_IPV6),y) -CONFIGURE_ARGS += \ - --enable-ipv6 -endif + --without-crypto \ + $(call autoconf_bool,CONFIG_IPV6,ipv6) TARGET_CFLAGS += -ffunction-sections -fdata-sections TARGET_LDFLAGS += -Wl,--gc-sections -CONFIGURE_VARS += \ - BUILD_CC="$(TARGET_CC)" \ - HOSTCC="$(HOSTCC)" \ - td_cv_buggygetaddrinfo="no" \ - ac_cv_linux_vers=$(LINUX_VERSION) \ - ac_cv_header_rpc_rpcent_h=no \ - ac_cv_lib_rpc_main=no \ - ac_cv_path_PCAP_CONFIG="" - -MAKE_FLAGS := - ifeq ($(BUILD_VARIANT),mini) TARGET_CFLAGS += -DTCPDUMP_MINI CONFIGURE_ARGS += --disable-smb MAKE_FLAGS += TCPDUMP_MINI=1 endif -MAKE_FLAGS += \ - CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)" - define Package/tcpdump/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/ diff --git a/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch b/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch deleted file mode 100644 index fdebfcc6d8..0000000000 --- a/package/network/utils/tcpdump/patches/002-remove_static_libpcap_check.patch +++ /dev/null @@ -1,92 +0,0 @@ ---- a/configure -+++ b/configure -@@ -5395,37 +5395,6 @@ $as_echo "Using $pfopen" >&6; } - LIBS="$LIBS $pfopen" - fi - fi -- libpcap=FAIL -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local pcap library" >&5 --$as_echo_n "checking for local pcap library... " >&6; } -- --# Check whether --with-system-libpcap was given. --if test "${with_system_libpcap+set}" = set; then : -- withval=$with_system_libpcap; --fi -- -- if test "x$with_system_libpcap" != xyes ; then -- lastdir=FAIL -- places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ -- egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'` -- places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \ -- egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'` -- for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do -- basedir=`echo $dir | sed -e 's/[ab][0-9]*$//' | \ -- sed -e 's/-PRE-GIT$//' ` -- if test $lastdir = $basedir ; then -- continue; -- fi -- lastdir=$dir -- if test -r $dir/libpcap.a ; then -- libpcap=$dir/libpcap.a -- d=$dir -- fi -- done -- fi -- if test $libpcap = FAIL ; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 --$as_echo "not found" >&6; } - - # - # Look for pcap-config. -@@ -5581,51 +5550,6 @@ if test "x$ac_cv_lib_pcap_main" = xyes; - libpcap="-lpcap" - fi - -- if test $libpcap = FAIL ; then -- as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5 -- fi -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extraneous pcap header directories" >&5 --$as_echo_n "checking for extraneous pcap header directories... " >&6; } -- if test \( ! -r /usr/local/include/pcap.h \) -a \ -- \( ! -r /usr/include/pcap.h \); then -- if test -r /usr/local/include/pcap/pcap.h; then -- d="/usr/local/include/pcap" -- elif test -r /usr/include/pcap/pcap.h; then -- d="/usr/include/pcap" -- fi -- fi -- if test -z "$d" ; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 --$as_echo "not found" >&6; } -- else -- V_INCLS="-I$d $V_INCLS" -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found -- -I$d added" >&5 --$as_echo "found -- -I$d added" >&6; } -- fi -- fi -- else -- V_PCAPDEP=$libpcap -- places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ -- egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'` -- places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \ -- egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'` -- pcapH=FAIL -- if test -r $d/pcap.h; then -- pcapH=$d -- else -- for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do -- if test -r $dir/pcap.h ; then -- pcapH=$dir -- fi -- done -- fi -- -- if test $pcapH = FAIL ; then -- as_fn_error $? "cannot find pcap.h: see INSTALL" "$LINENO" 5 -- fi -- V_INCLS="-I$pcapH $V_INCLS" -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libpcap" >&5 --$as_echo "$libpcap" >&6; } - # Extract the first word of "pcap-config", so it can be a program name with args. - set dummy pcap-config; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 From 16815704fca7107986ecc256bd79374f8173445b Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Tue, 1 Dec 2020 18:29:14 +0100 Subject: [PATCH 12/97] tegra: sysupgrade: remove check for number of arguments This chunk got mistakenly removed from 30c95c4, since the get_image_dd evaluates only first agument, so that check is useless. Fixes: 30c95c4 ("tegra: sysupgrade: use get_image_dd wrapper") Signed-off-by: Tomasz Maciej Nowak --- target/linux/tegra/base-files/lib/upgrade/platform.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/linux/tegra/base-files/lib/upgrade/platform.sh b/target/linux/tegra/base-files/lib/upgrade/platform.sh index 3e6ea8a44f..170bc11ba7 100644 --- a/target/linux/tegra/base-files/lib/upgrade/platform.sh +++ b/target/linux/tegra/base-files/lib/upgrade/platform.sh @@ -3,8 +3,6 @@ REQUIRE_IMAGE_METADATA=1 platform_check_image() { local diskdev partdev diff - [ "$#" -gt 1 ] && return 1 - export_bootdevice && export_partdevice diskdev 0 || { v "Unable to determine upgrade device" return 1 From fa7705103714a2abf8b3771712b002a6d46076c8 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 25 Nov 2020 17:10:03 +0100 Subject: [PATCH 13/97] uboot-tegra: bump to 2020.04 This fixes error when host GCC >= 10. /usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here collect2: error: ld returned 1 exit status Signed-off-by: Tomasz Maciej Nowak --- package/boot/uboot-tegra/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/boot/uboot-tegra/Makefile b/package/boot/uboot-tegra/Makefile index 778019257d..a3d66900db 100644 --- a/package/boot/uboot-tegra/Makefile +++ b/package/boot/uboot-tegra/Makefile @@ -6,10 +6,10 @@ # include $(TOPDIR)/rules.mk -PKG_VERSION := 2019.04 +PKG_VERSION := 2020.04 PKG_RELEASE := 1 -PKG_HASH := 76b7772d156b3ddd7644c8a1736081e55b78828537ff714065d21dbade229bef +PKG_HASH := fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372 PKG_MAINTAINER := Tomasz Maciej Nowak From bbd665f38d6b48e56bb5ef38ee0eeceb02a8e129 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 25 Nov 2020 17:10:04 +0100 Subject: [PATCH 14/97] tegra: image: make bootscript standalone Don't hard-code the PTUUID, use U-Boot commands to determine it, as some partitioning tools could rewrite PTUUID when modifying partitions. Signed-off-by: Tomasz Maciej Nowak --- target/linux/tegra/image/Makefile | 5 +---- target/linux/tegra/image/generic-bootscript | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/target/linux/tegra/image/Makefile b/target/linux/tegra/image/Makefile index aa0083f9ae..fbff1cf6e8 100644 --- a/target/linux/tegra/image/Makefile +++ b/target/linux/tegra/image/Makefile @@ -14,10 +14,7 @@ define Build/tegra-sdcard $(if $(DEVICE_DTS),\ $(foreach dtb,$(DEVICE_DTS),$(CP) $(DTS_DIR)/$(dtb).dtb $@.boot), \ $(CP) $(DTS_DIR)/*.dtb $@.boot) - sed \ - -e 's#@ROOT@#$(IMG_PART_SIGNATURE)#g' \ - -e 's#@KERNEL@#$(KERNEL_NAME)#g' \ - $(BOOT_SCRIPT) > $@-boot.scr + sed -e 's#@KERNEL@#$(KERNEL_NAME)#g' $(BOOT_SCRIPT) > $@-boot.scr mkimage -A arm -O linux -T script -C none -a 0 -e 0 \ -n '$(DEVICE_TITLE) OpenWrt bootscript' \ -d $@-boot.scr \ diff --git a/target/linux/tegra/image/generic-bootscript b/target/linux/tegra/image/generic-bootscript index 7e86afdf5f..0908025d5d 100644 --- a/target/linux/tegra/image/generic-bootscript +++ b/target/linux/tegra/image/generic-bootscript @@ -1,4 +1,6 @@ -setenv bootargs "root=PARTUUID=@ROOT@-02 rw rootwait console=ttyS0,115200 console=tty0" +part uuid ${devtype} ${devnum}:2 ptuuid + +setenv bootargs "root=PARTUUID=${ptuuid} rw rootwait console=ttyS0,115200 console=tty0" load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /@KERNEL@ load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /${soc}-${board}.dtb From 4423b2753f27cdb4d5daf3d1fa91ec79a7724ba1 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 25 Nov 2020 17:10:05 +0100 Subject: [PATCH 15/97] tegra: image: remove unnecessary assumptions from bootscript 'bootz' expects gziped kernel image anyway, so hard-code it to zImage, and remove root path from 'load' commands, by default the files are searched in root directory. This will make the bootscript static, so the command which modified it when image was created can now be removed. Signed-off-by: Tomasz Maciej Nowak --- target/linux/tegra/image/Makefile | 3 +-- target/linux/tegra/image/generic-bootscript | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/target/linux/tegra/image/Makefile b/target/linux/tegra/image/Makefile index fbff1cf6e8..71a5fc581d 100644 --- a/target/linux/tegra/image/Makefile +++ b/target/linux/tegra/image/Makefile @@ -14,10 +14,9 @@ define Build/tegra-sdcard $(if $(DEVICE_DTS),\ $(foreach dtb,$(DEVICE_DTS),$(CP) $(DTS_DIR)/$(dtb).dtb $@.boot), \ $(CP) $(DTS_DIR)/*.dtb $@.boot) - sed -e 's#@KERNEL@#$(KERNEL_NAME)#g' $(BOOT_SCRIPT) > $@-boot.scr mkimage -A arm -O linux -T script -C none -a 0 -e 0 \ -n '$(DEVICE_TITLE) OpenWrt bootscript' \ - -d $@-boot.scr \ + -d $(BOOT_SCRIPT) \ $@.boot/boot.scr SIGNATURE="$(IMG_PART_SIGNATURE)" \ diff --git a/target/linux/tegra/image/generic-bootscript b/target/linux/tegra/image/generic-bootscript index 0908025d5d..0e7816490d 100644 --- a/target/linux/tegra/image/generic-bootscript +++ b/target/linux/tegra/image/generic-bootscript @@ -2,7 +2,7 @@ part uuid ${devtype} ${devnum}:2 ptuuid setenv bootargs "root=PARTUUID=${ptuuid} rw rootwait console=ttyS0,115200 console=tty0" -load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /@KERNEL@ -load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /${soc}-${board}.dtb +load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} zImage +load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${soc}-${board}.dtb bootz ${kernel_addr_r} - ${fdt_addr_r} From 3064651bf75d3ca08cbfff916a14e8b3c4c246fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= Date: Fri, 13 Nov 2020 20:22:51 +0100 Subject: [PATCH 16/97] mvebu: LS421DE: fix low performance issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Buffalo Linkstation LS421DE isn't able to enable the Level 2 cache (AKA Aurora cache). As of result of this, the throughput is about half of the expected, e.g when doing network data transfers. Fix it by adding the broken-idle property in the coherency fabric node. Signed-off-by: Daniel González Cabanelas --- .../files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts index e804665792..2a76649ec4 100644 --- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts @@ -209,6 +209,10 @@ }; }; +&coherencyfab { + broken-idle; +}; + ð1 { pinctrl-0 = <&ge1_rgmii_pins>; pinctrl-names = "default"; From 3d12b47985fc1983849925d2dc23430f55210c80 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Tue, 24 Nov 2020 08:39:48 +0200 Subject: [PATCH 17/97] base-files: flush kernel memory cache during sysupgrade Flush kernel memory caches during sysupgrade in order to mitigate the impact from memory consumption spikes in low-RAM devices. This may help to prevent sysupgrade causing a reboot before the actual flashing starts. Signed-off-by: Hannu Nyman --- package/base-files/files/lib/upgrade/common.sh | 1 + package/base-files/files/lib/upgrade/stage2 | 1 + 2 files changed, 2 insertions(+) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index a5c27dc2fb..b44a5998f4 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -297,6 +297,7 @@ indicate_upgrade() { # $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m default_do_upgrade() { sync + echo 3 > /proc/sys/vm/drop_caches if [ -n "$UPGRADE_BACKUP" ]; then get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$UPGRADE_BACKUP" write - "${PART_NAME:-image}" else diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index c7629c383f..23d356a447 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -123,6 +123,7 @@ kill_remaining KILL 1 sleep 1 +echo 3 > /proc/sys/vm/drop_caches if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then platform_pre_upgrade "$IMAGE" From 8336b0df5d6de83c9f44bef470a37a93b472773a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= Date: Tue, 24 Nov 2020 16:06:37 +0100 Subject: [PATCH 18/97] kernel: rtc: rs5c372: fix alarm support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rs5c372 RTC driver has alarm support, but it can't be enabled and only can handle 24 hours in the future spite the chip is 1 week capable. Provide these two patches: - Support alarms up to 1 week - Let the wakealarm to be used as a wakeup source This patch makes the alarm wakeup feature to be available in the Buffallo Linkstation LS421DE (mvebu target) and should also work with any other device if the hardware has the proper capability. Signed-off-by: Daniel González Cabanelas --- ...-rs5c372-support_alarms_up_to_1_week.patch | 96 +++++++++++++++++++ ...he_alarm_to_be_used_as_wakeup_source.patch | 72 ++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 target/linux/generic/pending-5.4/190-rtc-rs5c372-support_alarms_up_to_1_week.patch create mode 100644 target/linux/generic/pending-5.4/191-rtc-rs5c372-let_the_alarm_to_be_used_as_wakeup_source.patch diff --git a/target/linux/generic/pending-5.4/190-rtc-rs5c372-support_alarms_up_to_1_week.patch b/target/linux/generic/pending-5.4/190-rtc-rs5c372-support_alarms_up_to_1_week.patch new file mode 100644 index 0000000000..83cab4e6d7 --- /dev/null +++ b/target/linux/generic/pending-5.4/190-rtc-rs5c372-support_alarms_up_to_1_week.patch @@ -0,0 +1,96 @@ +From: Daniel González Cabanelas +Subject: [PATCH 1/2] rtc: rs5c372: support alarms up to 1 week + +The Ricoh R2221x, R2223x, RS5C372, RV5C387A chips can handle 1 week +alarms. + +Read the "wday" alarm register and convert it to a date to support up 1 +week in our driver. + +Signed-off-by: Daniel González Cabanelas +--- + drivers/rtc/rtc-rs5c372.c | 48 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 42 insertions(+), 6 deletions(-) + +diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c +index 3bd6eaa0d..94b778c6e 100644 +--- a/drivers/rtc/rtc-rs5c372.c ++++ b/drivers/rtc/rtc-rs5c372.c +@@ -393,7 +393,9 @@ static int rs5c_read_alarm(struct device *dev, struct rtc_wkalrm *t) + { + struct i2c_client *client = to_i2c_client(dev); + struct rs5c372 *rs5c = i2c_get_clientdata(client); +- int status; ++ int status, wday_offs; ++ struct rtc_time rtc; ++ unsigned long alarm_secs; + + status = rs5c_get_regs(rs5c); + if (status < 0) +@@ -403,6 +405,30 @@ static int rs5c_read_alarm(struct device *dev, struct rtc_wkalrm *t) + t->time.tm_sec = 0; + t->time.tm_min = bcd2bin(rs5c->regs[RS5C_REG_ALARM_A_MIN] & 0x7f); + t->time.tm_hour = rs5c_reg2hr(rs5c, rs5c->regs[RS5C_REG_ALARM_A_HOURS]); ++ t->time.tm_wday = ffs(rs5c->regs[RS5C_REG_ALARM_A_WDAY] & 0x7f) - 1; ++ ++ /* determine the day, month and year based on alarm wday, taking as a ++ * reference the current time from the rtc ++ */ ++ status = rs5c372_rtc_read_time(dev, &rtc); ++ if (status < 0) ++ return status; ++ ++ wday_offs = t->time.tm_wday - rtc.tm_wday; ++ alarm_secs = mktime64(rtc.tm_year + 1900, ++ rtc.tm_mon + 1, ++ rtc.tm_mday + wday_offs, ++ t->time.tm_hour, ++ t->time.tm_min, ++ t->time.tm_sec); ++ ++ if (wday_offs < 0 || (wday_offs == 0 && ++ (t->time.tm_hour < rtc.tm_hour || ++ (t->time.tm_hour == rtc.tm_hour && ++ t->time.tm_min <= rtc.tm_min)))) ++ alarm_secs += 7 * 86400; ++ ++ rtc_time64_to_tm(alarm_secs, &t->time); + + /* ... and status */ + t->enabled = !!(rs5c->regs[RS5C_REG_CTRL1] & RS5C_CTRL1_AALE); +@@ -417,12 +443,20 @@ static int rs5c_set_alarm(struct device *dev, struct rtc_wkalrm *t) + struct rs5c372 *rs5c = i2c_get_clientdata(client); + int status, addr, i; + unsigned char buf[3]; ++ struct rtc_time rtc_tm; ++ unsigned long rtc_secs, alarm_secs; + +- /* only handle up to 24 hours in the future, like RTC_ALM_SET */ +- if (t->time.tm_mday != -1 +- || t->time.tm_mon != -1 +- || t->time.tm_year != -1) ++ /* chip only can handle alarms up to one week in the future*/ ++ status = rs5c372_rtc_read_time(dev, &rtc_tm); ++ if (status) ++ return status; ++ rtc_secs = rtc_tm_to_time64(&rtc_tm); ++ alarm_secs = rtc_tm_to_time64(&t->time); ++ if (alarm_secs >= rtc_secs + 7 * 86400) { ++ dev_err(dev, "%s: alarm maximum is one week in the future (%d)\n", ++ __func__, status); + return -EINVAL; ++ } + + /* REVISIT: round up tm_sec */ + +@@ -443,7 +477,9 @@ static int rs5c_set_alarm(struct device *dev, struct rtc_wkalrm *t) + /* set alarm */ + buf[0] = bin2bcd(t->time.tm_min); + buf[1] = rs5c_hr2reg(rs5c, t->time.tm_hour); +- buf[2] = 0x7f; /* any/all days */ ++ /* each bit is the day of the week, 0x7f means all days */ ++ buf[2] = (t->time.tm_wday >= 0 && t->time.tm_wday < 7) ? ++ BIT(t->time.tm_wday) : 0x7f; + + for (i = 0; i < sizeof(buf); i++) { + addr = RS5C_ADDR(RS5C_REG_ALARM_A_MIN + i); diff --git a/target/linux/generic/pending-5.4/191-rtc-rs5c372-let_the_alarm_to_be_used_as_wakeup_source.patch b/target/linux/generic/pending-5.4/191-rtc-rs5c372-let_the_alarm_to_be_used_as_wakeup_source.patch new file mode 100644 index 0000000000..d5c8c23f65 --- /dev/null +++ b/target/linux/generic/pending-5.4/191-rtc-rs5c372-let_the_alarm_to_be_used_as_wakeup_source.patch @@ -0,0 +1,72 @@ +From: Daniel González Cabanelas +Subject: [PATCH 2/2] rtc: rs5c372: let the alarm to be used as wakeup source + +Currently there is no use for the interrupts on the rs5c372 RTC and the +wakealarm isn't enabled. There are some devices like NASes which use this +RTC to wake up from the power off state when the INTR pin is activated by +the alarm clock. + +Enable the alarm and let to be used as a wakeup source. + +Tested on a Buffalo LS421DE NAS. + +Signed-off-by: Daniel González Cabanelas +--- + drivers/rtc/rtc-rs5c372.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c +index 94b778c6e..76775d66e 100644 +--- a/drivers/rtc/rtc-rs5c372.c ++++ b/drivers/rtc/rtc-rs5c372.c +@@ -654,6 +654,7 @@ static int rs5c372_probe(struct i2c_client *client, + int err = 0; + int smbus_mode = 0; + struct rs5c372 *rs5c372; ++ bool rs5c372_can_wakeup_device = false; + + dev_dbg(&client->dev, "%s\n", __func__); + +@@ -689,6 +690,12 @@ static int rs5c372_probe(struct i2c_client *client, + else + rs5c372->type = id->driver_data; + ++#ifdef CONFIG_OF ++ if(of_property_read_bool(client->dev.of_node, ++ "wakeup-source")) ++ rs5c372_can_wakeup_device = true; ++#endif ++ + /* we read registers 0x0f then 0x00-0x0f; skip the first one */ + rs5c372->regs = &rs5c372->buf[1]; + rs5c372->smbus = smbus_mode; +@@ -722,6 +729,8 @@ static int rs5c372_probe(struct i2c_client *client, + goto exit; + } + ++ rs5c372->has_irq = 1; ++ + /* if the oscillator lost power and no other software (like + * the bootloader) set it up, do it here. + * +@@ -748,6 +757,10 @@ static int rs5c372_probe(struct i2c_client *client, + ); + + /* REVISIT use client->irq to register alarm irq ... */ ++ if (rs5c372_can_wakeup_device) { ++ device_init_wakeup(&client->dev, true); ++ } ++ + rs5c372->rtc = devm_rtc_device_register(&client->dev, + rs5c372_driver.driver.name, + &rs5c372_rtc_ops, THIS_MODULE); +@@ -761,6 +774,9 @@ static int rs5c372_probe(struct i2c_client *client, + if (err) + goto exit; + ++ /* the rs5c372 alarm only supports a minute accuracy */ ++ rs5c372->rtc->uie_unsupported = 1; ++ + return 0; + + exit: From b8362c20e7a7e83707a39f84689ec4180a4b53fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= Date: Tue, 24 Nov 2020 16:06:52 +0100 Subject: [PATCH 19/97] mvebu: LS421DE: use the RTC as a wakeup source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Buffalo Linkstation LS421DE comes with a Ricoh RS5C372A real time clock. This RTC has the INTRA pin connected to the power management circuit, allowing to wake up the device from the power off state when an alarm is scheduled. Add the "wakeup-source" property in the RTC dts node to allow the use of the alarm. Example of use, the device is powered off and it comes to life after 5 minutes: echo $(expr $(date '+%s') + 60 * 5) > /sys/class/rtc/rtc0/wakealarm poweroff This feature isn't available in the stock firmware. Signed-off-by: Daniel González Cabanelas --- .../mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts index 2a76649ec4..dee271541e 100644 --- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts @@ -230,6 +230,7 @@ rs5c372a: rs5c372a@32 { compatible = "ricoh,rs5c372a"; reg = <0x32>; + wakeup-source; }; }; From b163bfbba59b62c05a404e3cc3c59103c93aff68 Mon Sep 17 00:00:00 2001 From: Peter Cardoe Date: Fri, 27 Nov 2020 16:37:11 +0000 Subject: [PATCH 20/97] ipq806x: Fix gmac1 (WAN) on Netgear D7800 The WAN port on Netgear D7800 is unable to connect to an ISP when the link to the modem is running at less than 1GB. This patch fixes the issue by removing the phy-handle definition and replacing it with a fixed-link definition The WAN port is then able to connect to a modem via a link running at 100Mbs or 10Mbs Fixes: FS#3086 Signed-off-by: Peter Cardoe --- .../ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts index 7fb871be78..229596b082 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts @@ -283,13 +283,17 @@ &gmac1 { status = "okay"; phy-mode = "rgmii"; - phy-handle = <&phy4>; qcom,id = <1>; pinctrl-0 = <&rgmii2_pins>; pinctrl-names = "default"; mtd-mac-address = <&art 6>; + + fixed-link { + speed = <1000>; + full-duplex; + }; }; &gmac2 { From a9deace10c0f4c9e82091f579e96aa83f5b7aeb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Cabanelas?= Date: Tue, 27 Oct 2020 18:39:40 +0100 Subject: [PATCH 21/97] mvebu: gpio-mvebu IRQ index error kernel backport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport the upstream kernel fix 525b0858ff to get rid of the kernel messages: mvebu-gpio xxxxxx.gpio: IRQ index 3 not found Signed-off-by: Daniel González Cabanelas --- ...avoid_error_message_for_optional_IRQ.patch | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 target/linux/mvebu/patches-5.4/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch diff --git a/target/linux/mvebu/patches-5.4/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch b/target/linux/mvebu/patches-5.4/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch new file mode 100644 index 0000000000..8ef2897c97 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/007-gpio-mvebu-avoid_error_message_for_optional_IRQ.patch @@ -0,0 +1,33 @@ +From 525b0858ff2fdb78defec2d4d6d63baaa423d5fd Mon Sep 17 00:00:00 2001 +From: Chris Packham +Date: Fri, 13 Mar 2020 16:42:44 +1300 +Subject: [PATCH] gpio: mvebu: avoid error message for optional IRQ + +platform_get_irq() will generate an error message if the requested irq +is not present + + mvebu-gpio f1010140.gpio: IRQ index 3 not found + +use platform_get_irq_optional() to avoid the error message being +generated. + +Signed-off-by: Chris Packham +Acked-by: Uwe Kleine-König +Signed-off-by: Bartosz Golaszewski +--- + drivers/gpio/gpio-mvebu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c +index d2b999c7987f1..3c9f4fb3d5a28 100644 +--- a/drivers/gpio/gpio-mvebu.c ++++ b/drivers/gpio/gpio-mvebu.c +@@ -1245,7 +1245,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev) + * pins. + */ + for (i = 0; i < 4; i++) { +- int irq = platform_get_irq(pdev, i); ++ int irq = platform_get_irq_optional(pdev, i); + + if (irq < 0) + continue; From 39c8bc4422f0404af5b85c10eeb2c4098d919cdb Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Fri, 16 Oct 2020 23:24:19 +0300 Subject: [PATCH 22/97] mac80211: fix MAC address allocations when local bit set on base addr Testing with hwsim reveals two problems: 1. phyX/addresses has two addresses and mac80211_get_addr keeps returning the last one when asked for more; 2. The base address has the local bit set and the operation unsets it. Fix both. Fixes: 866790fd827cb0187353cdf484eb46a9b38fb6ba Reported-by: Zero_Chaos Signed-off-by: Paul Fertser --- package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 6ca12084cf..e12a804271 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -409,7 +409,7 @@ mac80211_generate_mac() { [ "$mask" = "00:00:00:00:00:00" ] && { mask="ff:ff:ff:ff:ff:ff"; - [ "$(wc -l < /sys/class/ieee80211/${phy}/addresses)" -gt 1 ] && { + [ "$(wc -l < /sys/class/ieee80211/${phy}/addresses)" -gt $id ] && { addr="$(mac80211_get_addr "$phy" "$id")" [ -n "$addr" ] && { echo "$addr" @@ -429,7 +429,7 @@ mac80211_generate_mac() { [ "$((0x$mask1))" -gt 0 ] && { b1="0x$1" [ "$id" -gt 0 ] && \ - b1=$(($b1 ^ ((($id - !($b1 & 2)) << 2) | 0x2))) + b1=$(($b1 ^ ((($id - !($b1 & 2)) << 2)) | 0x2)) printf "%02x:%s:%s:%s:%s:%s" $b1 $2 $3 $4 $5 $6 return } From 3aeaef6e569fde026058529720057dfea7974b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Tue, 22 Dec 2020 13:17:32 +0100 Subject: [PATCH 23/97] Revert "mvebu: fix initramfs/kernel image for CZNIC Turris Omnia" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e401a2a42e6d7c892e1cf7d765fa5ec9b2db3fb3 as at least two users had reported breakage on their devices. References: https://lists.infradead.org/pipermail/openwrt-devel/2020-December/032837.html References: https://github.com/openwrt/openwrt/commit/e401a2a42e6d7c892e1cf7d765fa5ec9b2db3fb3#commitcomment-45189788 Cc: Karel Kočí Reported-by: Magnus Kroken Signed-off-by: Petr Štetiar --- target/linux/mvebu/image/cortexa9.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 67f68b1770..ea20a25a29 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -32,7 +32,8 @@ define Device/cznic_turris-omnia DEVICE_VENDOR := CZ.NIC DEVICE_MODEL := Turris Omnia KERNEL_INSTALL := 1 - KERNEL := kernel-bin | append-dtb + KERNEL := kernel-bin + KERNEL_INITRAMFS := kernel-bin DEVICE_PACKAGES := \ mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \ wpad-basic-wolfssl kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \ From a282a04538ac9e41d79da1ea3f30049ffce15a03 Mon Sep 17 00:00:00 2001 From: John Audia Date: Mon, 21 Dec 2020 10:06:01 -0500 Subject: [PATCH 24/97] kernel: bump 5.4 to 5.4.85 All modifications made by update_kernel.sh run in a fresh clone without any existing toolchains. Build system: x86_64 Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711 Run-tested: ipq806x/R7800 No dmesg regressions, everything functional Signed-off-by: John Audia --- include/kernel-version.mk | 4 ++-- ...mware-loader-for-uPD720201-and-uPD72.patch | 10 ++++----- .../802-usb-xhci-force-msi-renesas-xhci.patch | 2 +- .../450-fix-block-protection-clearing.patch | 6 ++--- .../910-unaligned_access_hacks.patch | 2 +- ...Show-that-the-VIA-VL805-supports-LPM.patch | 2 +- ...or-host-controllers-that-don-t-updat.patch | 2 +- ....dtbo-overlays-to-be-built-piecemeal.patch | 2 +- ...ow-.dtbo-overlays-to-be-built-adjust.patch | 2 +- ...-support-hardware-flow-table-offload.patch | 4 ++-- ...pio-change-CENA-regs-to-be-cacheable.patch | 4 ++-- ...the-Time-Aware-Scheduler-via-tc-tapr.patch | 4 ++-- ...tc-WA-for-MDIO-register-access-issue.patch | 4 ++-- ...5-enetc-Clean-up-of-ehtool-stats-len.patch | 2 +- ...etc_gregs-with-a-readers-writer-lock.patch | 4 ++-- ...t-Credit-Based-Shaper-CBS-for-hardwa.patch | 2 +- ...ort-tsn-capabilities-qbv-qci-qbu-cbs.patch | 22 +++++++++---------- ...fspi-enable-fspi-on-imx8qxp-and-imx8.patch | 2 +- ...pi-fspi-dynamically-alloc-AHB-memory.patch | 4 ++-- ...st-xhci-do-warm-reset-for-link-state.patch | 2 +- ...agate-resolved-link-config-via-mac_l.patch | 2 +- ...ethernet-mediatek-support-net-labels.patch | 4 ++-- ...hip-Add-txpbl-node-for-RK3399-RK3328.patch | 2 +- 23 files changed, 47 insertions(+), 47 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 89bae2e8b3..3dd2496cb8 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 = .83 +LINUX_VERSION-5.4 = .85 -LINUX_KERNEL_HASH-5.4.83 = beec970bbb93de8ab839f27930f7ab00c7bd65af0ffa07a50e765affdc2561c6 +LINUX_KERNEL_HASH-5.4.85 = 1de3586d8e7a9a814726610745d80907a267590d2770ec1079ef2875c4984008 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 eb216aeb69..cba8062f55 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" -@@ -62,6 +64,44 @@ +@@ -63,6 +65,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; -@@ -296,6 +336,873 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -298,6 +338,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) { -@@ -337,6 +1244,27 @@ static int xhci_pci_probe(struct pci_dev +@@ -339,6 +1246,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 */ -@@ -398,6 +1326,16 @@ static void xhci_pci_remove(struct pci_d +@@ -400,6 +1328,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; -@@ -537,6 +1475,11 @@ static int xhci_pci_resume(struct usb_hc +@@ -539,6 +1477,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 be32823fee..53f4aae7f1 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 -@@ -283,6 +283,7 @@ static void xhci_pci_quirks(struct devic +@@ -285,6 +285,7 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x0015) { xhci->quirks |= XHCI_RESET_ON_RESUME; xhci->quirks |= XHCI_ZERO_64B_REGS; diff --git a/target/linux/ath79/patches-5.4/450-fix-block-protection-clearing.patch b/target/linux/ath79/patches-5.4/450-fix-block-protection-clearing.patch index a7ed62302d..dc76161892 100644 --- a/target/linux/ath79/patches-5.4/450-fix-block-protection-clearing.patch +++ b/target/linux/ath79/patches-5.4/450-fix-block-protection-clearing.patch @@ -17,12 +17,12 @@ Signed-off-by: Nick Hainke --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1981,7 +1981,7 @@ static int sr2_bit7_quad_enable(struct s +@@ -1985,7 +1985,7 @@ static int sr2_bit7_quad_enable(struct s static int spi_nor_clear_sr_bp(struct spi_nor *nor) { int ret; - u8 mask = SR_BP2 | SR_BP1 | SR_BP0; + u8 mask = SR_TB | SR_BP2 | SR_BP1 | SR_BP0; - ret = read_sr(nor); - if (ret < 0) { + if (nor->flags & SNOR_F_HAS_4BIT_BP) + mask |= SR_BP3; diff --git a/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch index 16317114dc..923eac92f8 100644 --- a/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch @@ -706,7 +706,7 @@ EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -3971,14 +3971,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -3972,14 +3972,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); 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 754a639853..b2a8279da2 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 -@@ -252,6 +252,10 @@ static void xhci_pci_quirks(struct devic +@@ -254,6 +254,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-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 45a03fd81a..e3c7c30389 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 -@@ -253,8 +253,10 @@ static void xhci_pci_quirks(struct devic +@@ -255,8 +255,10 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_BROKEN_STREAMS; if (pdev->vendor == PCI_VENDOR_ID_VIA && diff --git a/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch b/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch index 18b6260672..0fb5c12ac3 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell --- a/Makefile +++ b/Makefile -@@ -1264,6 +1264,9 @@ ifneq ($(dtstree),) +@@ -1267,6 +1267,9 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ diff --git a/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch b/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch index 0e35d756ed..a33cfe7142 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch @@ -15,7 +15,7 @@ Signed-off-by: Nataliya Korovkina --- a/Makefile +++ b/Makefile -@@ -1264,7 +1264,7 @@ ifneq ($(dtstree),) +@@ -1267,7 +1267,7 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ diff --git a/target/linux/generic/pending-5.4/643-net-bridge-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-5.4/643-net-bridge-support-hardware-flow-table-offload.patch index 4e27452477..d47482dc67 100644 --- a/target/linux/generic/pending-5.4/643-net-bridge-support-hardware-flow-table-offload.patch +++ b/target/linux/generic/pending-5.4/643-net-bridge-support-hardware-flow-table-offload.patch @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau #include #include "br_private.h" -@@ -376,6 +380,28 @@ static const struct ethtool_ops br_ethto +@@ -382,6 +386,28 @@ static const struct ethtool_ops br_ethto .get_link = ethtool_op_get_link, }; @@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops br_netdev_ops = { .ndo_open = br_dev_open, .ndo_stop = br_dev_stop, -@@ -404,6 +430,9 @@ static const struct net_device_ops br_ne +@@ -410,6 +436,9 @@ static const struct net_device_ops br_ne .ndo_bridge_setlink = br_setlink, .ndo_bridge_dellink = br_dellink, .ndo_features_check = passthru_features_check, diff --git a/target/linux/layerscape/patches-5.4/701-net-0149-soc-fsl-dpio-change-CENA-regs-to-be-cacheable.patch b/target/linux/layerscape/patches-5.4/701-net-0149-soc-fsl-dpio-change-CENA-regs-to-be-cacheable.patch index 34655487df..eba8a12007 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0149-soc-fsl-dpio-change-CENA-regs-to-be-cacheable.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0149-soc-fsl-dpio-change-CENA-regs-to-be-cacheable.patch @@ -32,7 +32,7 @@ Signed-off-by: Haiying Wang struct dpio_priv { struct dpaa2_io *io; }; -@@ -200,13 +205,11 @@ static int dpaa2_dpio_probe(struct fsl_m +@@ -197,13 +202,11 @@ static int dpaa2_dpio_probe(struct fsl_m if (dpio_dev->obj_desc.region_count < 3) { /* No support for DDR backed portals, use classic mapping */ /* @@ -50,7 +50,7 @@ Signed-off-by: Haiying Wang } else { desc.regs_cena = devm_memremap(dev, dpio_dev->regions[2].start, resource_size(&dpio_dev->regions[2]), -@@ -214,7 +217,7 @@ static int dpaa2_dpio_probe(struct fsl_m +@@ -211,7 +214,7 @@ static int dpaa2_dpio_probe(struct fsl_m } if (IS_ERR(desc.regs_cena)) { diff --git a/target/linux/layerscape/patches-5.4/701-net-0225-enetc-Configure-the-Time-Aware-Scheduler-via-tc-tapr.patch b/target/linux/layerscape/patches-5.4/701-net-0225-enetc-Configure-the-Time-Aware-Scheduler-via-tc-tapr.patch index 37ed557c32..c210e5b71e 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0225-enetc-Configure-the-Time-Aware-Scheduler-via-tc-tapr.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0225-enetc-Configure-the-Time-Aware-Scheduler-via-tc-tapr.patch @@ -141,7 +141,7 @@ Signed-off-by: David S. Miller #define ENETC_SIPCAPR0_RSS BIT(8) #define ENETC_SIPCAPR1 0x24 #define ENETC_SITGTGR 0x30 -@@ -440,22 +441,6 @@ union enetc_rx_bd { +@@ -444,22 +445,6 @@ union enetc_rx_bd { #define EMETC_MAC_ADDR_FILT_RES 3 /* # of reserved entries at the beginning */ #define ENETC_MAX_NUM_VFS 2 @@ -164,7 +164,7 @@ Signed-off-by: David S. Miller #define ENETC_CBD_FLAGS_SF BIT(7) /* short format */ #define ENETC_CBD_STATUS_MASK 0xf -@@ -554,3 +539,70 @@ static inline void enetc_set_bdr_prio(st +@@ -558,3 +543,70 @@ static inline void enetc_set_bdr_prio(st val |= ENETC_TBMR_SET_PRIO(prio); enetc_txbdr_wr(hw, bdr_idx, ENETC_TBMR, val); } diff --git a/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch b/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch index 5f24a60690..82fde98823 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch @@ -254,7 +254,7 @@ Signed-off-by: Alex Marginean rx_frm_cnt++; --- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h -@@ -321,8 +321,15 @@ struct enetc_hw { +@@ -325,8 +325,15 @@ struct enetc_hw { }; /* general register accessors */ @@ -272,7 +272,7 @@ Signed-off-by: Alex Marginean #ifdef ioread64 #define enetc_rd_reg64(reg) ioread64((reg)) #else -@@ -341,12 +348,102 @@ static inline u64 enetc_rd_reg64(void __ +@@ -345,12 +352,102 @@ static inline u64 enetc_rd_reg64(void __ } #endif diff --git a/target/linux/layerscape/patches-5.4/701-net-0235-enetc-Clean-up-of-ehtool-stats-len.patch b/target/linux/layerscape/patches-5.4/701-net-0235-enetc-Clean-up-of-ehtool-stats-len.patch index b085ea3a17..1602feb3bd 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0235-enetc-Clean-up-of-ehtool-stats-len.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0235-enetc-Clean-up-of-ehtool-stats-len.patch @@ -13,7 +13,7 @@ Signed-off-by: Claudiu Manoil --- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c -@@ -195,15 +195,21 @@ static const char tx_ring_stats[][ETH_GS +@@ -199,15 +199,21 @@ static const char tx_ring_stats[][ETH_GS static int enetc_get_sset_count(struct net_device *ndev, int sset) { struct enetc_ndev_priv *priv = netdev_priv(ndev); diff --git a/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch b/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch index ca79c43848..7f78e1d043 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch @@ -259,7 +259,7 @@ Signed-off-by: Claudiu Manoil --- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h -@@ -325,7 +325,7 @@ struct enetc_hw { +@@ -329,7 +329,7 @@ struct enetc_hw { #define enetc_wr_reg(reg, val) enetc_wr_reg_wa((reg), (val)) /* accessors for data-path, due to MDIO issue on LS1028 these should be called @@ -268,7 +268,7 @@ Signed-off-by: Claudiu Manoil */ #define enetc_rd_reg_hot(reg) ioread32((reg)) #define enetc_wr_reg_hot(reg, val) iowrite32((val), (reg)) -@@ -348,90 +348,45 @@ static inline u64 enetc_rd_reg64(void __ +@@ -352,90 +352,45 @@ static inline u64 enetc_rd_reg64(void __ } #endif diff --git a/target/linux/layerscape/patches-5.4/701-net-0336-enetc-add-support-Credit-Based-Shaper-CBS-for-hardwa.patch b/target/linux/layerscape/patches-5.4/701-net-0336-enetc-add-support-Credit-Based-Shaper-CBS-for-hardwa.patch index fd89174d59..e8b9e98247 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0336-enetc-add-support-Credit-Based-Shaper-CBS-for-hardwa.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0336-enetc-add-support-Credit-Based-Shaper-CBS-for-hardwa.patch @@ -79,7 +79,7 @@ Signed-off-by: David S. Miller #define ENETC_PTCCBSR1(n) (0x1114 + (n) * 8) /* n = 0 to 7*/ #define ENETC_RSSHASH_KEY_SIZE 40 #define ENETC_PRSSK(n) (0x1410 + (n) * 4) /* n = [0..9] */ -@@ -673,6 +675,8 @@ struct enetc_cbd { +@@ -677,6 +679,8 @@ struct enetc_cbd { u8 status_flags; }; diff --git a/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch b/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch index e54631f71f..ba71805275 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch @@ -192,7 +192,7 @@ Signed-off-by: Po Liu +#endif --- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c -@@ -183,6 +183,21 @@ static const struct { +@@ -187,6 +187,21 @@ static const struct { { ENETC_PICDR(3), "ICM DR3 discarded frames" }, }; @@ -214,7 +214,7 @@ Signed-off-by: Po Liu static const char rx_ring_stats[][ETH_GSTRING_LEN] = { "Rx ring %2d frames", "Rx ring %2d alloc errors", -@@ -192,6 +207,10 @@ static const char tx_ring_stats[][ETH_GS +@@ -196,6 +211,10 @@ static const char tx_ring_stats[][ETH_GS "Tx ring %2d frames", }; @@ -225,7 +225,7 @@ Signed-off-by: Po Liu static int enetc_get_sset_count(struct net_device *ndev, int sset) { struct enetc_ndev_priv *priv = netdev_priv(ndev); -@@ -209,6 +228,12 @@ static int enetc_get_sset_count(struct n +@@ -213,6 +232,12 @@ static int enetc_get_sset_count(struct n len += ARRAY_SIZE(enetc_port_counters); @@ -238,7 +238,7 @@ Signed-off-by: Po Liu return len; } -@@ -247,6 +272,28 @@ static void enetc_get_strings(struct net +@@ -251,6 +276,28 @@ static void enetc_get_strings(struct net ETH_GSTRING_LEN); p += ETH_GSTRING_LEN; } @@ -267,7 +267,7 @@ Signed-off-by: Po Liu break; } } -@@ -274,6 +321,18 @@ static void enetc_get_ethtool_stats(stru +@@ -278,6 +325,18 @@ static void enetc_get_ethtool_stats(stru for (i = 0; i < ARRAY_SIZE(enetc_port_counters); i++) data[o++] = enetc_port_rd(hw, enetc_port_counters[i].reg); @@ -317,7 +317,7 @@ Signed-off-by: Po Liu /* MAC counters */ #define ENETC_PM0_REOCT 0x8100 -@@ -294,6 +305,15 @@ enum enetc_bdr_type {TX, RX}; +@@ -298,6 +309,15 @@ enum enetc_bdr_type {TX, RX}; #define ENETC_PM0_TSCOL 0x82E0 #define ENETC_PM0_TLCOL 0x82E8 #define ENETC_PM0_TECOL 0x82F0 @@ -333,7 +333,7 @@ Signed-off-by: Po Liu /* Port counters */ #define ENETC_PICDR(n) (0x0700 + (n) * 8) /* n = [0..3] */ -@@ -452,6 +472,7 @@ union enetc_tx_bd { +@@ -456,6 +476,7 @@ union enetc_tx_bd { #define ENETC_TXBD_FLAGS_CSUM BIT(3) #define ENETC_TXBD_FLAGS_EX BIT(6) #define ENETC_TXBD_FLAGS_F BIT(7) @@ -341,7 +341,7 @@ Signed-off-by: Po Liu static inline void enetc_clear_tx_bd(union enetc_tx_bd *txbd) { -@@ -479,6 +500,8 @@ static inline __le16 enetc_txbd_l3_csoff +@@ -483,6 +504,8 @@ static inline __le16 enetc_txbd_l3_csoff #define ENETC_TXBD_L4_UDP BIT(5) #define ENETC_TXBD_L4_TCP BIT(6) @@ -350,7 +350,7 @@ Signed-off-by: Po Liu union enetc_rx_bd { struct { __le64 addr; -@@ -625,21 +648,307 @@ enum bdcr_cmd_class { +@@ -629,21 +652,307 @@ enum bdcr_cmd_class { BDCR_CMD_RFS, BDCR_CMD_PORT_GCL, BDCR_CMD_RECV_CLASSIFIER, @@ -662,7 +662,7 @@ Signed-off-by: Po Liu /* gate control list entry */ struct gce { __le32 period; -@@ -656,13 +965,55 @@ struct tgs_gcl_data { +@@ -660,13 +969,55 @@ struct tgs_gcl_data { struct gce entry[0]; }; @@ -719,7 +719,7 @@ Signed-off-by: Po Liu }; }; /* Long format */ __le32 data[6]; -@@ -677,11 +1028,88 @@ struct enetc_cbd { +@@ -681,11 +1032,88 @@ struct enetc_cbd { #define ENETC_CLK 400000000ULL diff --git a/target/linux/layerscape/patches-5.4/817-spi-0003-MLK-21960-1-spi-fspi-enable-fspi-on-imx8qxp-and-imx8.patch b/target/linux/layerscape/patches-5.4/817-spi-0003-MLK-21960-1-spi-fspi-enable-fspi-on-imx8qxp-and-imx8.patch index 59906dd93d..07fac213ce 100644 --- a/target/linux/layerscape/patches-5.4/817-spi-0003-MLK-21960-1-spi-fspi-enable-fspi-on-imx8qxp-and-imx8.patch +++ b/target/linux/layerscape/patches-5.4/817-spi-0003-MLK-21960-1-spi-fspi-enable-fspi-on-imx8qxp-and-imx8.patch @@ -35,7 +35,7 @@ Signed-off-by: Han Xu struct nxp_fspi { void __iomem *iobase; void __iomem *ahb_addr; -@@ -1076,6 +1092,8 @@ static int nxp_fspi_resume(struct device +@@ -1083,6 +1099,8 @@ static int nxp_fspi_resume(struct device static const struct of_device_id nxp_fspi_dt_ids[] = { { .compatible = "nxp,lx2160a-fspi", .data = (void *)&lx2160a_data, }, diff --git a/target/linux/layerscape/patches-5.4/817-spi-0004-MLK-21960-2-spi-fspi-dynamically-alloc-AHB-memory.patch b/target/linux/layerscape/patches-5.4/817-spi-0004-MLK-21960-2-spi-fspi-dynamically-alloc-AHB-memory.patch index ed8dc301f7..a8db23cebb 100644 --- a/target/linux/layerscape/patches-5.4/817-spi-0004-MLK-21960-2-spi-fspi-dynamically-alloc-AHB-memory.patch +++ b/target/linux/layerscape/patches-5.4/817-spi-0004-MLK-21960-2-spi-fspi-dynamically-alloc-AHB-memory.patch @@ -76,7 +76,7 @@ Signed-off-by: Han Xu } else { if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_OUT) nxp_fspi_fill_txfifo(f, op); -@@ -992,9 +1018,8 @@ static int nxp_fspi_probe(struct platfor +@@ -999,9 +1025,8 @@ static int nxp_fspi_probe(struct platfor /* find the resources - controller memory mapped space */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap"); @@ -88,7 +88,7 @@ Signed-off-by: Han Xu goto err_put_ctrl; } -@@ -1073,6 +1098,9 @@ static int nxp_fspi_remove(struct platfo +@@ -1080,6 +1105,9 @@ static int nxp_fspi_remove(struct platfo mutex_destroy(&f->lock); diff --git a/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch b/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch index b31c695794..fd64f2f10b 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch @@ -16,7 +16,7 @@ Signed-off-by: Li Jun --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c -@@ -1733,7 +1733,8 @@ static bool xhci_port_missing_cas_quirk( +@@ -1737,7 +1737,8 @@ static bool xhci_port_missing_cas_quirk( return false; if (((portsc & PORT_PLS_MASK) != XDEV_POLLING) && diff --git a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch index 424061ef5e..b6734a38dc 100644 --- a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch +++ b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch @@ -111,7 +111,7 @@ Signed-off-by: David S. Miller struct mvpp2_port *port = netdev_priv(dev); --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -448,9 +448,10 @@ static void mtk_mac_link_down(struct phy +@@ -449,9 +449,10 @@ static void mtk_mac_link_down(struct phy mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id)); } diff --git a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch index babd3d833c..6583fca60b 100644 --- a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch +++ b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch @@ -14,7 +14,7 @@ Signed-off-by: René van Dorst --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2919,6 +2919,7 @@ static const struct net_device_ops mtk_n +@@ -2922,6 +2922,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { @@ -22,7 +22,7 @@ Signed-off-by: René van Dorst const __be32 *_id = of_get_property(np, "reg", NULL); struct phylink *phylink; int phy_mode, id, err; -@@ -3011,6 +3012,9 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -3014,6 +3015,9 @@ static int mtk_add_mac(struct mtk_eth *e eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN; diff --git a/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch b/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch index 8931d5c5a9..83ce8f1efb 100644 --- a/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch +++ b/target/linux/rockchip/patches-5.4/004-arm64-dts-rockchip-Add-txpbl-node-for-RK3399-RK3328.patch @@ -44,7 +44,7 @@ Signed-off-by: Heiko Stuebner mdio { --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -@@ -288,6 +288,7 @@ +@@ -291,6 +291,7 @@ resets = <&cru SRST_A_GMAC>; reset-names = "stmmaceth"; rockchip,grf = <&grf>; From 77575d4c02d581d1c1607891fc6ce0ab84f630d3 Mon Sep 17 00:00:00 2001 From: Aleksander Jan Bajkowski Date: Sat, 27 Jun 2020 16:40:19 +0200 Subject: [PATCH 25/97] kernel: move some disabled symbols to generic Move some disabled config options found in lantiq target to generic. Signed-off-by: Aleksander Jan Bajkowski --- target/linux/apm821xx/nand/config-default | 2 -- target/linux/at91/sama5/config-default | 1 - target/linux/ath79/mikrotik/config-default | 3 --- target/linux/ath79/nand/config-default | 3 --- target/linux/bcm53xx/config-5.4 | 2 -- target/linux/bcm63xx/config-5.4 | 1 - target/linux/bcm63xx/smp/config-default | 2 -- target/linux/generic/config-5.4 | 5 +++++ target/linux/imx6/config-5.4 | 2 -- target/linux/ipq40xx/config-5.4 | 2 -- target/linux/ipq806x/config-5.4 | 2 -- target/linux/ipq807x/config-default | 1 - target/linux/kirkwood/config-5.4 | 3 --- target/linux/lantiq/xrx200/config-5.4 | 3 --- target/linux/lantiq/xway/config-5.4 | 4 ---- target/linux/layerscape/armv7/config-5.4 | 2 -- target/linux/layerscape/armv8_64b/config-5.4 | 2 -- target/linux/mediatek/mt7622/config-5.4 | 3 --- target/linux/mediatek/mt7623/config-5.4 | 2 -- target/linux/mediatek/mt7629/config-5.4 | 2 -- target/linux/mpc85xx/p1010/config-default | 2 -- target/linux/mpc85xx/p1020/config-default | 2 -- target/linux/mvebu/config-5.4 | 3 --- target/linux/omap/config-5.4 | 2 -- target/linux/oxnas/ox820/config-default | 2 -- target/linux/pistachio/config-5.4 | 1 - target/linux/ramips/mt7621/config-5.4 | 3 --- 27 files changed, 5 insertions(+), 57 deletions(-) diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default index e1874f6164..db60838cf3 100644 --- a/target/linux/apm821xx/nand/config-default +++ b/target/linux/apm821xx/nand/config-default @@ -37,8 +37,6 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_UBIFS_FS=y # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default index 1f49678508..d64aa1e2c6 100644 --- a/target/linux/at91/sama5/config-default +++ b/target/linux/at91/sama5/config-default @@ -360,7 +360,6 @@ CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 # CONFIG_MTD_UBI_BLOCK is not set CONFIG_MTD_UBI_FASTMAP=y -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y diff --git a/target/linux/ath79/mikrotik/config-default b/target/linux/ath79/mikrotik/config-default index 5c42368ea9..f713fc36cf 100644 --- a/target/linux/ath79/mikrotik/config-default +++ b/target/linux/ath79/mikrotik/config-default @@ -24,8 +24,6 @@ CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MTD_UBI_BEB_LIMIT=20 -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_NET_SWITCHDEV=y CONFIG_PCI_AR71XX=y CONFIG_PHY_AR7100_USB=y @@ -37,7 +35,6 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_WATCHDOG_CORE=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default index 738f2f0a5e..9ae059508f 100644 --- a/target/linux/ath79/nand/config-default +++ b/target/linux/ath79/nand/config-default @@ -13,8 +13,6 @@ CONFIG_MTD_SPI_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_PCI_AR71XX is not set CONFIG_PHY_AR7200_USB=y @@ -23,6 +21,5 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/bcm53xx/config-5.4 b/target/linux/bcm53xx/config-5.4 index 8c7cdf45d5..f0c54bbd8e 100644 --- a/target/linux/bcm53xx/config-5.4 +++ b/target/linux/bcm53xx/config-5.4 @@ -265,8 +265,6 @@ CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y diff --git a/target/linux/bcm63xx/config-5.4 b/target/linux/bcm63xx/config-5.4 index dd4d67224c..9aec004921 100644 --- a/target/linux/bcm63xx/config-5.4 +++ b/target/linux/bcm63xx/config-5.4 @@ -211,7 +211,6 @@ CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y CONFIG_OF_NET=y CONFIG_PCI=y -# CONFIG_PCIEAER is not set CONFIG_PCIEPORTBUS=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_DRIVERS_LEGACY=y diff --git a/target/linux/bcm63xx/smp/config-default b/target/linux/bcm63xx/smp/config-default index cc43bb2023..127c42e253 100644 --- a/target/linux/bcm63xx/smp/config-default +++ b/target/linux/bcm63xx/smp/config-default @@ -22,8 +22,6 @@ CONFIG_MTD_SPLIT_BCM_WFI_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NET_FLOW_LIMIT=y CONFIG_NR_CPUS=2 diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index fa7b6b98c4..00fbd93ff4 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -3271,6 +3271,8 @@ CONFIG_MTD_SPLIT_SUPPORT=y # CONFIG_MTD_SWAP is not set # CONFIG_MTD_TESTS is not set # CONFIG_MTD_UBI is not set +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set # CONFIG_MTD_UIMAGE_SPLIT is not set # CONFIG_MTD_VIRT_CONCAT is not set # CONFIG_MTK_MMC is not set @@ -3919,6 +3921,7 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_PCH_PHUB is not set # CONFIG_PCI is not set # CONFIG_PCI200SYN is not set +# CONFIG_PCIEAER is not set # CONFIG_PCIEAER_INJECT is not set # CONFIG_PCIEASPM is not set # CONFIG_PCIEPORTBUS is not set @@ -5818,6 +5821,8 @@ CONFIG_TTY=y # CONFIG_UBIFS_FS_AUTHENTICATION is not set # CONFIG_UBIFS_FS_ENCRYPTION is not set # CONFIG_UBIFS_FS_SECURITY is not set +# CONFIG_UBIFS_FS_ZLIB is not set +# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_UBIFS_FS_XATTR=y # CONFIG_UBSAN is not set CONFIG_UBSAN_ALIGNMENT=y diff --git a/target/linux/imx6/config-5.4 b/target/linux/imx6/config-5.4 index 26b718e28d..fe380f587b 100644 --- a/target/linux/imx6/config-5.4 +++ b/target/linux/imx6/config-5.4 @@ -353,8 +353,6 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y # CONFIG_MX3_IPU is not set diff --git a/target/linux/ipq40xx/config-5.4 b/target/linux/ipq40xx/config-5.4 index b442f73fbc..b8cd8da408 100644 --- a/target/linux/ipq40xx/config-5.4 +++ b/target/linux/ipq40xx/config-5.4 @@ -342,8 +342,6 @@ CONFIG_MTD_SPLIT_WRGG_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y diff --git a/target/linux/ipq806x/config-5.4 b/target/linux/ipq806x/config-5.4 index 20870f75c0..2c8e6bbbb0 100644 --- a/target/linux/ipq806x/config-5.4 +++ b/target/linux/ipq806x/config-5.4 @@ -324,8 +324,6 @@ CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y diff --git a/target/linux/ipq807x/config-default b/target/linux/ipq807x/config-default index 1f60ccfecb..337e660cdf 100644 --- a/target/linux/ipq807x/config-default +++ b/target/linux/ipq807x/config-default @@ -416,7 +416,6 @@ CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set CONFIG_MTD_UBI_GLUEBI=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y diff --git a/target/linux/kirkwood/config-5.4 b/target/linux/kirkwood/config-5.4 index a39137a29f..dcf6a1e327 100644 --- a/target/linux/kirkwood/config-5.4 +++ b/target/linux/kirkwood/config-5.4 @@ -227,8 +227,6 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MV643XX_ETH=y CONFIG_MVEBU_CLK_COMMON=y @@ -331,7 +329,6 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNWINDER_ARM=y CONFIG_USB=y diff --git a/target/linux/lantiq/xrx200/config-5.4 b/target/linux/lantiq/xrx200/config-5.4 index 7fc008b5c5..45406cf9de 100644 --- a/target/linux/lantiq/xrx200/config-5.4 +++ b/target/linux/lantiq/xrx200/config-5.4 @@ -47,15 +47,12 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NET_FLOW_LIMIT=y CONFIG_NLS=y CONFIG_NR_CPUS=2 CONFIG_PADATA=y CONFIG_PCI=y -# CONFIG_PCIEAER is not set CONFIG_PCIEPORTBUS=y CONFIG_PCIE_LANTIQ=y CONFIG_PCI_DOMAINS=y diff --git a/target/linux/lantiq/xway/config-5.4 b/target/linux/lantiq/xway/config-5.4 index 89b96d3863..ae73ae147d 100644 --- a/target/linux/lantiq/xway/config-5.4 +++ b/target/linux/lantiq/xway/config-5.4 @@ -21,8 +21,6 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NLS=y CONFIG_PCI=y @@ -42,8 +40,6 @@ CONFIG_SGL_ALLOC=y CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y -# CONFIG_UBIFS_FS_ZLIB is not set -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_USB=y CONFIG_USB_COMMON=y CONFIG_USB_SUPPORT=y diff --git a/target/linux/layerscape/armv7/config-5.4 b/target/linux/layerscape/armv7/config-5.4 index 1b969afd85..15c3492349 100644 --- a/target/linux/layerscape/armv7/config-5.4 +++ b/target/linux/layerscape/armv7/config-5.4 @@ -479,8 +479,6 @@ CONFIG_MTD_SST25L=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 # CONFIG_MTD_UBI_BLOCK is not set -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_MX3_IPU=y diff --git a/target/linux/layerscape/armv8_64b/config-5.4 b/target/linux/layerscape/armv8_64b/config-5.4 index 026cf15673..dd9abca986 100644 --- a/target/linux/layerscape/armv8_64b/config-5.4 +++ b/target/linux/layerscape/armv8_64b/config-5.4 @@ -663,8 +663,6 @@ CONFIG_MTD_SST25L=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 # CONFIG_MTD_UBI_BLOCK is not set -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MULTIPLEXER=y CONFIG_MUTEX_SPIN_ON_OWNER=y diff --git a/target/linux/mediatek/mt7622/config-5.4 b/target/linux/mediatek/mt7622/config-5.4 index 3861704eaa..929a04ce07 100755 --- a/target/linux/mediatek/mt7622/config-5.4 +++ b/target/linux/mediatek/mt7622/config-5.4 @@ -399,8 +399,6 @@ CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_MTK_CMDQ is not set # CONFIG_MTK_CQDMA is not set @@ -568,7 +566,6 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set # CONFIG_UCLAMP_TASK is not set # CONFIG_UNMAP_KERNEL_AT_EL0 is not set CONFIG_USB=y diff --git a/target/linux/mediatek/mt7623/config-5.4 b/target/linux/mediatek/mt7623/config-5.4 index a6b32ce33b..06312ac03c 100644 --- a/target/linux/mediatek/mt7623/config-5.4 +++ b/target/linux/mediatek/mt7623/config-5.4 @@ -337,8 +337,6 @@ CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_MTK_CMDQ is not set # CONFIG_MTK_CQDMA is not set diff --git a/target/linux/mediatek/mt7629/config-5.4 b/target/linux/mediatek/mt7629/config-5.4 index a291b9a263..7dd04b4e2e 100644 --- a/target/linux/mediatek/mt7629/config-5.4 +++ b/target/linux/mediatek/mt7629/config-5.4 @@ -247,8 +247,6 @@ CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_MTK_CMDQ is not set # CONFIG_MTK_EFUSE is not set diff --git a/target/linux/mpc85xx/p1010/config-default b/target/linux/mpc85xx/p1010/config-default index e25d51aeb1..12fe598223 100644 --- a/target/linux/mpc85xx/p1010/config-default +++ b/target/linux/mpc85xx/p1010/config-default @@ -5,8 +5,6 @@ CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_REALTEK_PHY=y CONFIG_RED_15W_REV1=y diff --git a/target/linux/mpc85xx/p1020/config-default b/target/linux/mpc85xx/p1020/config-default index fae155828d..c4c102ca45 100644 --- a/target/linux/mpc85xx/p1020/config-default +++ b/target/linux/mpc85xx/p1020/config-default @@ -26,8 +26,6 @@ CONFIG_MTD_SPLIT_FIT_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NET_FLOW_LIMIT=y diff --git a/target/linux/mvebu/config-5.4 b/target/linux/mvebu/config-5.4 index 4f38954b37..2858408064 100644 --- a/target/linux/mvebu/config-5.4 +++ b/target/linux/mvebu/config-5.4 @@ -334,8 +334,6 @@ CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_MVEBU_CLK_COMMON=y @@ -471,7 +469,6 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNWINDER_ARM=y CONFIG_USB=y diff --git a/target/linux/omap/config-5.4 b/target/linux/omap/config-5.4 index a797abaae6..9e156f69e7 100644 --- a/target/linux/omap/config-5.4 +++ b/target/linux/omap/config-5.4 @@ -432,8 +432,6 @@ CONFIG_MTD_SPI_NOR=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 # CONFIG_MTD_UBI_BLOCK is not set -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_MUSB_PIO_ONLY is not set CONFIG_MUTEX_SPIN_ON_OWNER=y diff --git a/target/linux/oxnas/ox820/config-default b/target/linux/oxnas/ox820/config-default index 25758a7ef5..b94ca29aaf 100644 --- a/target/linux/oxnas/ox820/config-default +++ b/target/linux/oxnas/ox820/config-default @@ -59,8 +59,6 @@ CONFIG_MTD_RAW_NAND=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NET_FLOW_LIMIT=y diff --git a/target/linux/pistachio/config-5.4 b/target/linux/pistachio/config-5.4 index d1e1acaead..890bb57ff9 100644 --- a/target/linux/pistachio/config-5.4 +++ b/target/linux/pistachio/config-5.4 @@ -244,7 +244,6 @@ CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_FASTMAP=y -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NAMESPACES=y CONFIG_NEED_DMA_MAP_STATE=y diff --git a/target/linux/ramips/mt7621/config-5.4 b/target/linux/ramips/mt7621/config-5.4 index b4c8ab1f1c..fbfb5b09f1 100644 --- a/target/linux/ramips/mt7621/config-5.4 +++ b/target/linux/ramips/mt7621/config-5.4 @@ -217,8 +217,6 @@ CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MTD_VIRT_CONCAT=y # CONFIG_MTK_HSDMA is not set @@ -326,7 +324,6 @@ CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_ZSTD is not set CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_WATCHDOG_CORE=y From 4771fac99f95e4cdd44d1ece17a2eb425b6b5b9e Mon Sep 17 00:00:00 2001 From: Davide Fioravanti Date: Sat, 19 Dec 2020 13:14:49 +0100 Subject: [PATCH 26/97] ath79: fix Sitecom WLR-8100 lan port leds Incorrect values were used for the switch initialization causing the lan port leds to not light up in case of 10Mb or 100Mb connections. This commit fixes this problem and removes unused values. Signed-off-by: Davide Fioravanti --- target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts b/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts index ccc08c39f1..96269c4418 100644 --- a/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts +++ b/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts @@ -153,10 +153,10 @@ qca,ar8327-initvals = < 0x04 0x87600000 /* PORT0 PAD MODE CTRL */ - 0x50 0xc437c437 /* LED Control Register 0 */ - 0x54 0xc337c337 /* LED Control Register 1 */ + 0x50 0xcf37cf37 /* LED Control Register 0 */ + 0x54 0x00000000 /* LED Control Register 1 */ 0x58 0x00000000 /* LED Control Register 2 */ - 0x5c 0x03ffff00 /* LED Control Register 3 */ + 0x5c 0x0030c300 /* LED Control Register 3 */ 0x7c 0x0000007e /* PORT0_STATUS */ >; }; From fdcdbdfdef512e0fdd719a704cff827a0633f5dc Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Thu, 17 Dec 2020 23:44:28 +0900 Subject: [PATCH 27/97] scripts: add -N option to mkhash for printing without newline Added "-N" option, it allow printing hash(es) without newline. Signed-off-by: INAGAKI Hiroshi --- scripts/mkhash.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/mkhash.c b/scripts/mkhash.c index 3292433213..ed3d42d4c3 100644 --- a/scripts/mkhash.c +++ b/scripts/mkhash.c @@ -747,6 +747,7 @@ static int usage(const char *progname) fprintf(stderr, "Usage: %s [options] [...]\n" "Options:\n" " -n Print filename(s)\n" + " -N Suppress trailing newline\n" "\n" "Supported hash types:", progname); @@ -771,7 +772,8 @@ static struct hash_type *get_hash_type(const char *name) } -static int hash_file(struct hash_type *t, const char *filename, bool add_filename) +static int hash_file(struct hash_type *t, const char *filename, bool add_filename, + bool no_newline) { const char *str; @@ -801,9 +803,10 @@ static int hash_file(struct hash_type *t, const char *filename, bool add_filenam } if (add_filename) - printf("%s %s\n", str, filename ? filename : "-"); + printf("%s %s%s", str, filename ? filename : "-", + no_newline ? "" : "\n"); else - printf("%s\n", str); + printf("%s%s", str, no_newline ? "" : "\n"); return 0; } @@ -813,13 +816,16 @@ int main(int argc, char **argv) struct hash_type *t; const char *progname = argv[0]; int i, ch; - bool add_filename = false; + bool add_filename = false, no_newline = false; - while ((ch = getopt(argc, argv, "n")) != -1) { + while ((ch = getopt(argc, argv, "nN")) != -1) { switch (ch) { case 'n': add_filename = true; break; + case 'N': + no_newline = true; + break; default: return usage(progname); } @@ -836,10 +842,10 @@ int main(int argc, char **argv) return usage(progname); if (argc < 2) - return hash_file(t, NULL, add_filename); + return hash_file(t, NULL, add_filename, no_newline); for (i = 0; i < argc - 1; i++) { - int ret = hash_file(t, argv[1 + i], add_filename); + int ret = hash_file(t, argv[1 + i], add_filename, no_newline); if (ret) return ret; } From fa373b219d3ee3851dd942668e080fac5f867b0b Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Thu, 17 Dec 2020 23:58:16 +0900 Subject: [PATCH 28/97] ramips: unify elecom-*-factory for ELECOM WRC-GHBK2-S/GS/GST devices Most of Build/elecom-wrc-factory and Build/elecom-wrc-gs-factory are nearly equal, Unify those definitions by using "-N" option of mkhash and splitting the appending text at the end of firmware image for WRC-GS/GST devices. Signed-off-by: INAGAKI Hiroshi --- target/linux/ramips/image/mt7621.mk | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 282152e79d..cc0eb1d279 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -12,20 +12,8 @@ DEVICE_VARS += ELECOM_HWNAME LINKSYS_HWNAME define Build/elecom-wrc-gs-factory $(eval product=$(word 1,$(1))) $(eval version=$(word 2,$(1))) - ( $(STAGING_DIR_HOST)/bin/mkhash md5 $@ | tr -d '\n' ) >> $@ - ( \ - echo -n "ELECOM $(product) v$(version)" | \ - dd bs=32 count=1 conv=sync; \ - dd if=$@; \ - ) > $@.new - mv $@.new $@ - echo -n "MT7621_ELECOM_$(product)" >> $@ -endef - -define Build/elecom-wrc-factory - $(eval product=$(word 1,$(1))) - $(eval version=$(word 2,$(1))) - $(STAGING_DIR_HOST)/bin/mkhash md5 $@ >> $@ + $(eval hash_opt=$(word 3,$(1))) + $(STAGING_DIR_HOST)/bin/mkhash md5 $(hash_opt) $@ >> $@ ( \ echo -n "ELECOM $(product) v$(version)" | \ dd bs=32 count=1 conv=sync; \ @@ -400,7 +388,7 @@ define Device/elecom_wrc-1167ghbk2-s DEVICE_MODEL := WRC-1167GHBK2-S IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ - elecom-wrc-factory WRC-1167GHBK2-S 0.00 + elecom-wrc-gs-factory WRC-1167GHBK2-S 0.00 DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware endef TARGET_DEVICES += elecom_wrc-1167ghbk2-s @@ -411,7 +399,8 @@ define Device/elecom_wrc-gs DEVICE_VENDOR := ELECOM IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ - elecom-wrc-gs-factory $$$$(ELECOM_HWNAME) 0.00 + elecom-wrc-gs-factory $$$$(ELECOM_HWNAME) 0.00 -N | \ + append-string MT7621_ELECOM_$$$$(ELECOM_HWNAME) DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware endef From cb41bc508856167ce302c31c2fc73829238f8611 Mon Sep 17 00:00:00 2001 From: Nick Lowe Date: Sun, 13 Dec 2020 11:39:12 +0000 Subject: [PATCH 29/97] hostapd: Use EAPOLv1 (802.1X-2001) if WPA enabled Currently, EAPOLv2 (802.1X-2004) is used by default for legacy clients that are not WPA2 (RSN) capable. These legacy clients are often intolerant to this EAPOL version and fail to connect. hostapd.conf upstream documents for eapol_version the following and that this is a known compatibility issue with version 2: // IEEE 802.1X/EAPOL version // hostapd is implemented based on IEEE Std 802.1X-2004 which defines EAPOL // version 2. However, there are many client implementations that do not handle // the new version number correctly (they seem to drop the frames completely). // In order to make hostapd interoperate with these clients, the version number // can be set to the older version (1) with this configuration value. // Note: When using MACsec, eapol_version shall be set to 3, which is // defined in IEEE Std 802.1X-2010. //eapol_version=2 For the wpa parameter, hostapd.conf upstream documents that this is a bitfield, configured as follows: // Enable WPA. Setting this variable configures the AP to require WPA (either // WPA-PSK or WPA-RADIUS/EAP based on other configuration). For WPA-PSK, either // wpa_psk or wpa_passphrase must be set and wpa_key_mgmt must include WPA-PSK. // Instead of wpa_psk / wpa_passphrase, wpa_psk_radius might suffice. // For WPA-RADIUS/EAP, ieee8021x must be set (but without dynamic WEP keys), // RADIUS authentication server must be configured, and WPA-EAP must be included // in wpa_key_mgmt. // This field is a bit field that can be used to enable WPA (IEEE 802.11i/D3.0) // and/or WPA2 (full IEEE 802.11i/RSN): // bit0 = WPA // bit1 = IEEE 802.11i/RSN (WPA2) (dot11RSNAEnabled) // Note that WPA3 is also configured with bit1 since it uses RSN just like WPA2. // In other words, for WPA3, wpa=2 is used the configuration (and // wpa_key_mgmt=SAE for WPA3-Personal instead of wpa_key_mgmt=WPA-PSK). //wpa=2 For client compatibility therefore: EAPOLv1 (802.1X-2001) should be used by default where WPA is enabled. EAPOLv2 (802.1X-2004) should be used by default where WPA is disabled. To fix this, we can therefore change in the script: set_default eapol_version 0 To the following: set_default eapol_version $((wpa & 1)) This therefore: 1) Sets eapol_version to 1 where WPA has been enabled via wpa bit0 being set. 2) Sets eapol_version to 0 where WPA has been disabled via wpa bit0 being unset. For usual configurations that only have WPA2 enabled, EAPOLv2 is then used. Signed-off-by: Nick Lowe --- package/network/services/hostapd/files/hostapd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 80ded8ffbc..78f6a19612 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -491,7 +491,7 @@ hostapd_set_bss_options() { set_default uapsd 1 set_default wpa_disable_eapol_key_retries 0 set_default tdls_prohibit 0 - set_default eapol_version 0 + set_default eapol_version $((wpa & 1)) set_default acct_port 1813 set_default bss_load_update_period 60 set_default chan_util_avg_period 600 From f4b687d1f05316bc0569c16a6a8a9fd8984b9e74 Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Sat, 12 Dec 2020 17:02:00 +0100 Subject: [PATCH 30/97] realtek: use kernel defined halt If _machine_hang is not defined on MIPS, the kernel will check if the CPU can enter a more power efficient sleep mode. Since the realtek platform supports mips32_r2, this should issue a WAIT instruction instead of a trivial infinite loop. Signed-off-by: Sander Vanheule --- target/linux/realtek/files-5.4/arch/mips/rtl838x/setup.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/target/linux/realtek/files-5.4/arch/mips/rtl838x/setup.c b/target/linux/realtek/files-5.4/arch/mips/rtl838x/setup.c index dbabb0354b..24c70b8274 100644 --- a/target/linux/realtek/files-5.4/arch/mips/rtl838x/setup.c +++ b/target/linux/realtek/files-5.4/arch/mips/rtl838x/setup.c @@ -59,19 +59,12 @@ static void rtl838x_restart(char *command) sw_w32(1, RTL838X_RST_GLB_CTRL_1); } -static void rtl838x_halt(void) -{ - pr_info("System halted.\n"); - while(1); -} - void __init plat_mem_setup(void) { void *dtb; set_io_port_base(KSEG1); _machine_restart = rtl838x_restart; - _machine_halt = rtl838x_halt; if (fw_passed_dtb) /* UHI interface */ dtb = (void *)fw_passed_dtb; From 95f1002acab574c24ad78f4453f091bf5a6731c7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 11 Dec 2020 19:18:33 -0800 Subject: [PATCH 31/97] toolchain: default to glibc for ARC glibc 2.32 gained support for the ARC architecture. This is preparation for removing uClibc-ng. Signed-off-by: Rosen Penev --- toolchain/Config.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/toolchain/Config.in b/toolchain/Config.in index cb557d4ad3..29de30d7e9 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -237,7 +237,7 @@ comment "C Library" choice prompt "C Library implementation" if TOOLCHAINOPTS - default LIBC_USE_UCLIBC if arc + default LIBC_USE_GLIBC if arc default LIBC_USE_MUSL help Select the C library implementation. @@ -245,7 +245,6 @@ choice config LIBC_USE_GLIBC bool "Use glibc" select USE_GLIBC - depends on !arc config LIBC_USE_UCLIBC select USE_UCLIBC From 57fe7d5401e3ef8390a66c907b9e688c74318ded Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 11 Dec 2020 19:21:40 -0800 Subject: [PATCH 32/97] toolchain: remove uClibc install stuff This is preparation for removing uClibc-ng. Signed-off-by: Rosen Penev --- package/libs/toolchain/Makefile | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile index 6853d95997..52a4cda19f 100644 --- a/package/libs/toolchain/Makefile +++ b/package/libs/toolchain/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=toolchain -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-3.0-with-GCC-exception @@ -458,11 +458,6 @@ LIBGCC_A=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a)) LIBGCC_MAP=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map)) LIBGCC_SO=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*)) -define Build/Compile/uClibc - $(CP) \ - $(TOOLCHAIN_DIR)/lib/libuClibc-*.so \ - $(PKG_BUILD_DIR)/ -endef ifneq ($(LIBGCC_SO),) define Build/Compile/libgcc $(CP) $(LIBGCC_SO) $(PKG_BUILD_DIR)/ @@ -535,21 +530,6 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) done endef - define Package/uClibc/install - $(INSTALL_DIR) $(1)/lib - $(CP) \ - $(TOOLCHAIN_DIR)/lib/ld*-uClibc.so.* \ - $(TOOLCHAIN_DIR)/lib/ld*-uClibc-$(LIBC_SO_VERSION).so \ - $(1)/lib/ - $(CP) \ - $(TOOLCHAIN_DIR)/lib/libc.so.* \ - $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \ - $(1)/lib/ - $(CP) \ - $(PKG_BUILD_DIR)/libuClibc-* \ - $(1)/lib/ - endef - LD_MUSL_NAME = $(notdir $(firstword $(wildcard $(TOOLCHAIN_DIR)/lib/libc.so*))) define Package/musl/install @@ -578,7 +558,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/libpthread/install $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y) + ifneq ($(CONFIG_USE_MUSL),y) $(CP) \ $(TOOLCHAIN_DIR)/lib/libpthread.so.* \ $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \ @@ -590,11 +570,6 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) $(INSTALL_DIR) $(1)/lib $(CP) \ $(TOOLCHAIN_DIR)/lib/libthread_db.so.* $(1)/lib - ifeq ($(CONFIG_USE_UCLIBC),y) - $(CP) \ - $(TOOLCHAIN_DIR)/lib/libthread_db-$(LIBC_SO_VERSION).so \ - $(1)/lib/ - endif endef define Package/libpthread/install_lib @@ -603,7 +578,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/librt/install $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y) + ifneq ($(CONFIG_USE_MUSL),y) $(CP) \ $(TOOLCHAIN_DIR)/lib/librt.so.* \ $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \ From 2207917acc7cd93db5b3bc9c6c5b898c38ec39aa Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 11 Dec 2020 19:24:49 -0800 Subject: [PATCH 33/97] toolchain: remove uClibc-ng config stuff This is in preparation for removing it. Signed-off-by: Rosen Penev --- toolchain/Config.in | 19 ------------------- toolchain/Makefile | 3 --- 2 files changed, 22 deletions(-) diff --git a/toolchain/Config.in b/toolchain/Config.in index 29de30d7e9..bb8729d805 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -110,11 +110,6 @@ menuconfig EXTERNAL_TOOLCHAIN bool "glibc" select USE_GLIBC - config EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC - bool "uClibc" - select USE_UCLIBC - depends on !(aarch64 || aarch64_be) - config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL bool "musl" select USE_MUSL @@ -125,7 +120,6 @@ menuconfig EXTERNAL_TOOLCHAIN string depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC - default "uclibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL config TOOLCHAIN_BIN_PATH @@ -246,11 +240,6 @@ choice bool "Use glibc" select USE_GLIBC - config LIBC_USE_UCLIBC - select USE_UCLIBC - bool "Use uClibc" - depends on BROKEN || arc - config LIBC_USE_MUSL select USE_MUSL bool "Use musl" @@ -258,7 +247,6 @@ choice endchoice -source "toolchain/uClibc/Config.in" source "toolchain/musl/Config.in" comment "Debuggers" @@ -274,10 +262,6 @@ config GDB config USE_GLIBC bool -config USE_UCLIBC - default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc) - bool - config USE_MUSL default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc) bool @@ -296,15 +280,12 @@ source "toolchain/gcc/Config.version" config LIBC string default "glibc" if USE_GLIBC - default "uClibc" if USE_UCLIBC default "musl" if USE_MUSL config TARGET_SUFFIX string default "gnueabi" if USE_GLIBC && (arm || armeb) default "gnu" if USE_GLIBC && !(arm || armeb) - default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb) - default "uclibc" if USE_UCLIBC && !(arm || armeb) default "muslgnueabi" if USE_MUSL && (arm || armeb) default "musl" if USE_MUSL && !(arm || armeb) diff --git a/toolchain/Makefile b/toolchain/Makefile index 23a5529eed..5dccf8f829 100644 --- a/toolchain/Makefile +++ b/toolchain/Makefile @@ -30,9 +30,6 @@ curdir:=toolchain # subdirectories to descend into $(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_NASM),nasm) -ifdef CONFIG_USE_UCLIBC - $(curdir)/builddirs += $(LIBC)/utils -endif # builddir dependencies ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) From 63fb175203bbf3b336804587c2f5b3a2d8132ec1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 11 Dec 2020 19:25:45 -0800 Subject: [PATCH 34/97] toolchain: remove uClibc-ng After musl was introduced, it was desired to remove uClibc-ng. As ARC has no musl support, it was kept around. However, glibc 2.32 includes ARC support. This makes it possible to finally remove it. Signed-off-by: Rosen Penev --- toolchain/uClibc/Config.in | 6 - toolchain/uClibc/Makefile | 37 ----- toolchain/uClibc/common.mk | 98 ------------- toolchain/uClibc/config/arc | 8 -- toolchain/uClibc/config/archs | 8 -- toolchain/uClibc/config/arm | 7 - toolchain/uClibc/config/armeb | 7 - toolchain/uClibc/config/common | 199 -------------------------- toolchain/uClibc/config/debug | 6 - toolchain/uClibc/config/i386 | 8 -- toolchain/uClibc/config/i686 | 8 -- toolchain/uClibc/config/m68k | 5 - toolchain/uClibc/config/mips | 10 -- toolchain/uClibc/config/mips64 | 10 -- toolchain/uClibc/config/mips64.32 | 11 -- toolchain/uClibc/config/mips64.64 | 11 -- toolchain/uClibc/config/mips64.n32 | 11 -- toolchain/uClibc/config/mips64el | 10 -- toolchain/uClibc/config/mips64el.32 | 11 -- toolchain/uClibc/config/mips64el.64 | 11 -- toolchain/uClibc/config/mips64el.n32 | 11 -- toolchain/uClibc/config/mipsel | 10 -- toolchain/uClibc/config/mipsel.cobalt | 10 -- toolchain/uClibc/config/powerpc | 6 - toolchain/uClibc/config/powerpc.e500 | 6 - toolchain/uClibc/config/sparc | 6 - toolchain/uClibc/config/sparc.leon | 6 - toolchain/uClibc/config/x86_64 | 5 - toolchain/uClibc/headers/Makefile | 27 ---- toolchain/uClibc/utils/Makefile | 24 ---- 30 files changed, 593 deletions(-) delete mode 100644 toolchain/uClibc/Config.in delete mode 100644 toolchain/uClibc/Makefile delete mode 100644 toolchain/uClibc/common.mk delete mode 100644 toolchain/uClibc/config/arc delete mode 100644 toolchain/uClibc/config/archs delete mode 100644 toolchain/uClibc/config/arm delete mode 100644 toolchain/uClibc/config/armeb delete mode 100644 toolchain/uClibc/config/common delete mode 100644 toolchain/uClibc/config/debug delete mode 100644 toolchain/uClibc/config/i386 delete mode 100644 toolchain/uClibc/config/i686 delete mode 100644 toolchain/uClibc/config/m68k delete mode 100644 toolchain/uClibc/config/mips delete mode 100644 toolchain/uClibc/config/mips64 delete mode 100644 toolchain/uClibc/config/mips64.32 delete mode 100644 toolchain/uClibc/config/mips64.64 delete mode 100644 toolchain/uClibc/config/mips64.n32 delete mode 100644 toolchain/uClibc/config/mips64el delete mode 100644 toolchain/uClibc/config/mips64el.32 delete mode 100644 toolchain/uClibc/config/mips64el.64 delete mode 100644 toolchain/uClibc/config/mips64el.n32 delete mode 100644 toolchain/uClibc/config/mipsel delete mode 100644 toolchain/uClibc/config/mipsel.cobalt delete mode 100644 toolchain/uClibc/config/powerpc delete mode 100644 toolchain/uClibc/config/powerpc.e500 delete mode 100644 toolchain/uClibc/config/sparc delete mode 100644 toolchain/uClibc/config/sparc.leon delete mode 100644 toolchain/uClibc/config/x86_64 delete mode 100644 toolchain/uClibc/headers/Makefile delete mode 100644 toolchain/uClibc/utils/Makefile diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in deleted file mode 100644 index 3bcb0037e9..0000000000 --- a/toolchain/uClibc/Config.in +++ /dev/null @@ -1,6 +0,0 @@ -# Debug version. - -config UCLIBC_ENABLE_DEBUG - bool "Build with debug information" - depends on TOOLCHAINOPTS && USE_UCLIBC && !EXTERNAL_TOOLCHAIN - default n diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile deleted file mode 100644 index 4764f2fa1d..0000000000 --- a/toolchain/uClibc/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -PATH_PREFIX=. - -include ./common.mk - -HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_installed - -HOST_BUILD_PARALLEL:=1 - -define Host/SetToolchainInfo - $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk -endef - -define Host/Compile - $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak - $(UCLIBC_MAKE) PREFIX= all -endef - -define Host/Install - $(call Host/SetToolchainInfo) - $(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev - $(CP) $(HOST_BUILD_DIR)/libc/libc_so.a $(TOOLCHAIN_DIR)/lib/ - ( cd $(TOOLCHAIN_DIR) ; \ - for d in lib usr/lib ; do \ - for f in libc.so libgcc_s.so ; do \ - if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \ - $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \ - fi \ - done \ - done \ - ) -endef - -$(eval $(call HostBuild)) diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk deleted file mode 100644 index bb093b1dc7..0000000000 --- a/toolchain/uClibc/common.mk +++ /dev/null @@ -1,98 +0,0 @@ -# -# Copyright (C) 2006-2020 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/target.mk - -PKG_VERSION:=1.0.34 -PKG_RELEASE:=1 - -PKG_NAME:=uClibc-ng -PKG_SOURCE_URL = http://downloads.uclibc-ng.org/releases/$(PKG_VERSION)/ -PATCH_DIR:=$(PATH_PREFIX)/patches -CONFIG_DIR:=$(PATH_PREFIX)/config -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -LIBC_SO_VERSION:=$(PKG_VERSION) - -PKG_HASH:=e6776229eee8d3f5a1cd29fb4286630e3cb9e97dded4e8f4a3a9bb4fa8c0d5e3 - -HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION) - -include $(INCLUDE_DIR)/toolchain-build.mk - -UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \ - -e 's/arc.*/arc/' \ - -e 's/i.86/i386/' \ - -e 's/sparc.*/sparc/' \ - -e 's/arm.*/arm/g' \ - -e 's/m68k.*/m68k/' \ - -e 's/ppc/powerpc/g' \ - -e 's/v850.*/v850/g' \ - -e 's/sh64/sh/' \ - -e 's/sh[234].*/sh/' \ - -e 's/mips.*/mips/' \ - -e 's/mipsel.*/mips/' \ -) - -GEN_CONFIG=$(SCRIPT_DIR)/kconfig.pl -n \ - $(if $(wildcard $(CONFIG_DIR)/common),'+' $(CONFIG_DIR)/common) \ - $(if $(CONFIG_UCLIBC_ENABLE_DEBUG),$(if $(wildcard $(CONFIG_DIR)/debug),'+' $(CONFIG_DIR)/debug)) \ - $(CONFIG_DIR)/$(ARCH)$(strip \ - $(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD), \ - $(if $(filter archs,$(subst ",,$(CONFIG_CPU_TYPE))),hs, \ - $(if $(CONFIG_MIPS64_ABI),.$(subst ",,$(CONFIG_MIPS64_ABI)), \ - $(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500)))))) - -CPU_CFLAGS = \ - -funsigned-char -fno-builtin -fno-asm \ - --std=gnu99 -ffunction-sections -fdata-sections \ - -Wno-unused-but-set-variable \ - $(TARGET_CFLAGS) -ggdb - -UCLIBC_MAKE = PATH='$(TOOLCHAIN_DIR)/initial/bin:$(TARGET_PATH)' $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ - $(TARGET_CONFIGURE_OPTS) \ - DEVEL_PREFIX=/ \ - RUNTIME_PREFIX=/ \ - HOSTCC="$(HOSTCC)" \ - CPU_CFLAGS="$(CPU_CFLAGS)" \ - ARCH="$(CONFIG_ARCH)" \ - LIBGCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))" \ - DOSTRIP="" - -define Host/Prepare - $(call Host/Prepare/Default) - $(if $(strip $(QUILT)), \ - cd $(HOST_BUILD_DIR); \ - if $(QUILT_CMD) next >/dev/null 2>&1; then \ - $(QUILT_CMD) push -a; \ - fi - ) - ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) -endef - -define Host/Configure - $(GEN_CONFIG) > $(HOST_BUILD_DIR)/.config.new - $(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/include\",g' \ - -e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \ - -e 's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \ - -e 's,^.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \ - -e 's,^.*UCLIBC_BUILD_ALL_LOCALE.*,UCLIBC_BUILD_ALL_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \ - -e 's,^.*UCLIBC_HAS_SSP[^_].*,UCLIBC_HAS_SSP=$(if $(or $(CONFIG_PKG_CC_STACKPROTECTOR_REGULAR),$(CONFIG_PKG_CC_STACKPROTECTOR_STRONG)),y,n),g' \ - $(HOST_BUILD_DIR)/.config.new - cmp -s $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last || { \ - cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config && \ - $(MAKE) -C $(HOST_BUILD_DIR) olddefconfig KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" && \ - $(MAKE) -C $(HOST_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" && \ - cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last; \ - } -endef - -define Host/Clean - rm -rf \ - $(HOST_BUILD_DIR) \ - $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ - $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev -endef diff --git a/toolchain/uClibc/config/arc b/toolchain/uClibc/config/arc deleted file mode 100644 index f92328b7ed..0000000000 --- a/toolchain/uClibc/config/arc +++ /dev/null @@ -1,8 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -TARGET_ARCH="arc" -TARGET_arc=y -CONFIG_ARC_PAGE_SIZE_8K=y -# CONFIG_ARC_PAGE_SIZE_16K is not set -# CONFIG_ARC_PAGE_SIZE_4K is not set diff --git a/toolchain/uClibc/config/archs b/toolchain/uClibc/config/archs deleted file mode 100644 index f92328b7ed..0000000000 --- a/toolchain/uClibc/config/archs +++ /dev/null @@ -1,8 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -TARGET_ARCH="arc" -TARGET_arc=y -CONFIG_ARC_PAGE_SIZE_8K=y -# CONFIG_ARC_PAGE_SIZE_16K is not set -# CONFIG_ARC_PAGE_SIZE_4K is not set diff --git a/toolchain/uClibc/config/arm b/toolchain/uClibc/config/arm deleted file mode 100644 index 9544f144d1..0000000000 --- a/toolchain/uClibc/config/arm +++ /dev/null @@ -1,7 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -TARGET_ARCH="arm" -TARGET_arm=y -CONFIG_ARM_EABI=y - diff --git a/toolchain/uClibc/config/armeb b/toolchain/uClibc/config/armeb deleted file mode 100644 index e329c7e369..0000000000 --- a/toolchain/uClibc/config/armeb +++ /dev/null @@ -1,7 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_WANTS_BIG_ENDIAN=y -TARGET_ARCH="arm" -TARGET_arm=y -CONFIG_ARM_EABI=y - diff --git a/toolchain/uClibc/config/common b/toolchain/uClibc/config/common deleted file mode 100644 index d88d5bf473..0000000000 --- a/toolchain/uClibc/config/common +++ /dev/null @@ -1,199 +0,0 @@ -# ARCH_ANY_ENDIAN is not set -ARCH_HAS_MMU=y -# ARCH_HAS_NO_LDSO is not set -# ARCH_HAS_NO_SHARED is not set -# ARCH_LITTLE_ENDIAN is not set -ARCH_USE_MMU=y -# ARCH_WANTS_BIG_ENDIAN is not set -# ARCH_WANTS_LITTLE_ENDIAN is not set -ASSUME_DEVPTS=y -CROSS_COMPILER_PREFIX="" -DEVEL_PREFIX="/usr/" -# DOASSERTS is not set -# DODEBUG is not set -# DODEBUG_PT is not set -DOPIC=y -DOSTRIP=y -DO_C99_MATH=y -# DO_XSI_MATH is not set -# EXTRA_WARNINGS is not set -FORCE_OPTIONS_FOR_ARCH=y -# FORCE_SHAREABLE_TEXT_SEGMENTS is not set -# HARDWIRED_ABSPATH is not set -# HAS_NO_THREADS is not set -HAVE_DOT_CONFIG=y -# HAVE_NO_PIC is not set -# HAVE_NO_SSP is not set -HAVE_SHARED=y -KERNEL_HEADERS="." -LDSO_BASE_FILENAME="ld.so" -LDSO_CACHE_SUPPORT=y -# LDSO_GNU_HASH_SUPPORT is not set -LDSO_LD_LIBRARY_PATH=y -LDSO_LDD_SUPPORT=y -# LDSO_PRELINK_SUPPORT is not set -# LDSO_PRELOAD_FILE_SUPPORT is not set -LDSO_PRELOAD_ENV_SUPPORT=y -LDSO_RUNPATH=y -LDSO_SAFE_RUNPATH=y -# LDSO_RUNPATH_OF_EXECUTABLE is not set -# LDSO_SEARCH_INTERP_PATH is not set -# LDSO_STANDALONE_SUPPORT is not set -# UCLIBC_HAS_BACKTRACE is not set -UCLIBC_HAS_THREADS_NATIVE=y -# MALLOC is not set -# MALLOC_SIMPLE is not set -MALLOC_STANDARD=y -MULTILIB_DIR="lib" -PTHREADS_DEBUG_SUPPORT=y -RUNTIME_PREFIX="/" -# SUPPORT_LD_DEBUG is not set -# SUPPORT_LD_DEBUG_EARLY is not set -TARGET_SUBARCH="" -# TARGET_alpha is not set -# TARGET_arc is not set -# TARGET_arm is not set -# TARGET_avr32 is not set -# TARGET_bfin is not set -# TARGET_c6x is not set -# TARGET_cris is not set -# TARGET_frv is not set -# TARGET_h8300 is not set -# TARGET_hppa is not set -# TARGET_i386 is not set -# TARGET_ia64 is not set -# TARGET_lm32 is not set -# TARGET_m68k is not set -# TARGET_metag is not set -# TARGET_microblaze is not set -# TARGET_mips is not set -# TARGET_nios is not set -# TARGET_nios2 is not set -# TARGET_or1k is not set -# TARGET_powerpc is not set -# TARGET_sh is not set -# TARGET_sparc is not set -# TARGET_x86_64 is not set -# TARGET_xtensa is not set -UCLIBC_BSD_SPECIFIC=y -UCLIBC_BUILD_NOEXECSTACK=y -# UCLIBC_BUILD_NOW is not set -# UCLIBC_BUILD_PIE is not set -UCLIBC_BUILD_RELRO=y -UCLIBC_CTOR_DTOR=y -UCLIBC_DYNAMIC_ATEXIT=y -UCLIBC_EXTRA_CFLAGS="" -UCLIBC_GRP_BUFFER_SIZE=256 -UCLIBC_HAS_ADVANCED_REALTIME=y -# UCLIBC_HAS_ARGP is not set -UCLIBC_HAS_BSD_ERR=y -# UCLIBC_HAS_BSD_RES_CLOSE is not set -# UCLIBC_HAS_COMPAT_RES_STATE is not set -UCLIBC_HAS_CRYPT=y -UCLIBC_HAS_CRYPT_IMPL=y -UCLIBC_HAS_CTYPE_CHECKED=y -# UCLIBC_HAS_CTYPE_ENFORCED is not set -UCLIBC_HAS_CTYPE_SIGNED=y -UCLIBC_HAS_CTYPE_TABLES=y -# UCLIBC_HAS_CTYPE_UNSAFE is not set -UCLIBC_HAS_EPOLL=y -UCLIBC_HAS_ERRNO_MESSAGES=y -# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set -# UCLIBC_HAS_FENV is not set -UCLIBC_HAS_FLOATS=y -UCLIBC_HAS_FNMATCH=y -# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set -UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y -# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set -# UCLIBC_HAS_FPU is not set -UCLIBC_HAS_FTS=y -# UCLIBC_HAS_FTW is not set -UCLIBC_HAS_GETPT=y -UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y -UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y -# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set -UCLIBC_HAS_GLOB=y -UCLIBC_HAS_GNU_ERROR=y -UCLIBC_HAS_GNU_GETOPT=y -UCLIBC_HAS_GNU_GETSUBOPT=y -UCLIBC_HAS_GNU_GLOB=y -UCLIBC_HAS_HEXADECIMAL_FLOATS=y -UCLIBC_HAS_IPV4=y -UCLIBC_HAS_IPV6=y -UCLIBC_HAS_LFS=y -UCLIBC_HAS_LIBUTIL=y -# UCLIBC_HAS_LOCALE is not set -# UCLIBC_BUILD_ALL_LOCALE is not set -# UCLIBC_BUILD_MINIMAL_LOCALE is not set -UCLIBC_HAS_LONG_DOUBLE_MATH=y -UCLIBC_HAS_NETWORK_SUPPORT=y -UCLIBC_HAS_NFTW=y -# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set -# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set -UCLIBC_HAS_PRINTF_M_SPEC=y -# UCLIBC_HAS_PROFILING is not set -UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y -UCLIBC_HAS_PTY=y -UCLIBC_HAS_REALTIME=y -UCLIBC_HAS_REGEX=y -UCLIBC_HAS_RESOLVER_SUPPORT=y -# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set -# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set -UCLIBC_HAS_SHADOW=y -UCLIBC_HAS_SIGNUM_MESSAGES=y -UCLIBC_HAS_SOCKET=y -UCLIBC_HAS_SOFT_FLOAT=y -# UCLIBC_HAS_SSP is not set -UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y -# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set -UCLIBC_HAS_STDIO_BUFSIZ_4096=y -# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set -# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set -# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set -UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y -UCLIBC_HAS_STDIO_GETC_MACRO=y -UCLIBC_HAS_STDIO_PUTC_MACRO=y -# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set -UCLIBC_HAS_STRING_ARCH_OPT=y -UCLIBC_HAS_STRING_GENERIC_OPT=y -# UCLIBC_HAS_STUBS is not set -UCLIBC_HAS_SYSLOG=y -# UCLIBC_HAS_SYS_ERRLIST is not set -# UCLIBC_HAS_SYS_SIGLIST is not set -UCLIBC_HAS_THREADS=y -UCLIBC_HAS_TM_EXTENSIONS=y -UCLIBC_HAS_TZ_CACHING=y -UCLIBC_HAS_TZ_FILE=y -UCLIBC_HAS_TZ_FILE_READ_MANY=y -UCLIBC_HAS_UTMPX=y -UCLIBC_HAS_UTMP=y -UCLIBC_HAS_WCHAR=y -UCLIBC_HAS_WORDEXP=y -UCLIBC_HAS_XATTR=y -# UCLIBC_HAS_XLOCALE is not set -UCLIBC_HAS___PROGNAME=y -UCLIBC_LINUX_SPECIFIC=y -# UCLIBC_MALLOC_DEBUGGING is not set -# UCLIBC_NTP_LEGACY is not set -# USE_OLD_VFPRINTF is not set -UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9 -UCLIBC_PWD_BUFFER_SIZE=256 -# UCLIBC_STATIC_LDCONFIG is not set -# UCLIBC_STRICT_HEADERS is not set -UCLIBC_SUPPORT_AI_ADDRCONFIG=y -UCLIBC_SUSV3_LEGACY=y -# UCLIBC_SUSV3_LEGACY_MACROS is not set -UCLIBC_SUSV4_LEGACY=y -# UCLIBC_SV4_DEPRECATED is not set -UCLIBC_TZ_FILE_PATH="/etc/TZ" -# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set -UCLIBC_USE_NETLINK=y -# UNIX98PTY_ONLY is not set -WARNINGS="-Wall" -# UCLIBC_SUSV2_LEGACY is not set -# UCLIBC_HAS_CONTEXT_FUNCS is not set -UCLIBC_HAS_GETOPT_LONG=y diff --git a/toolchain/uClibc/config/debug b/toolchain/uClibc/config/debug deleted file mode 100644 index b366e66e39..0000000000 --- a/toolchain/uClibc/config/debug +++ /dev/null @@ -1,6 +0,0 @@ -DODEBUG=y -DODEBUG_PT=y -PTHREADS_DEBUG_SUPPORT=y -SUPPORT_LD_DEBUG=y -SUPPORT_LD_DEBUG_EARLY=y -UCLIBC_MALLOC_DEBUGGING=y diff --git a/toolchain/uClibc/config/i386 b/toolchain/uClibc/config/i386 deleted file mode 100644 index cddb709630..0000000000 --- a/toolchain/uClibc/config/i386 +++ /dev/null @@ -1,8 +0,0 @@ -ARCH_LITTLE_ENDIAN=y -# CONFIG_386 is not set -CONFIG_486=y -# CONFIG_586 is not set -# CONFIG_686 is not set -TARGET_ARCH="i386" -TARGET_i386=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/i686 b/toolchain/uClibc/config/i686 deleted file mode 100644 index 8a25f41e23..0000000000 --- a/toolchain/uClibc/config/i686 +++ /dev/null @@ -1,8 +0,0 @@ -ARCH_LITTLE_ENDIAN=y -# CONFIG_386 is not set -# CONFIG_486 is not set -# CONFIG_586 is not set -CONFIG_686=y -TARGET_ARCH="i386" -TARGET_i386=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/m68k b/toolchain/uClibc/config/m68k deleted file mode 100644 index 0675bb9080..0000000000 --- a/toolchain/uClibc/config/m68k +++ /dev/null @@ -1,5 +0,0 @@ -ARCH_BIG_ENDIAN=y -TARGET_ARCH="m68k" -TARGET_SUBARCH="" -TARGET_m68k=y -# UCLIBC_HAS_THREADS_NATIVE is not set diff --git a/toolchain/uClibc/config/mips b/toolchain/uClibc/config/mips deleted file mode 100644 index c8f71f03c9..0000000000 --- a/toolchain/uClibc/config/mips +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64 b/toolchain/uClibc/config/mips64 deleted file mode 100644 index 453293def3..0000000000 --- a/toolchain/uClibc/config/mips64 +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64.32 b/toolchain/uClibc/config/mips64.32 deleted file mode 100644 index 4e98968633..0000000000 --- a/toolchain/uClibc/config/mips64.32 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64.64 b/toolchain/uClibc/config/mips64.64 deleted file mode 100644 index bf4ecca704..0000000000 --- a/toolchain/uClibc/config/mips64.64 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64.n32 b/toolchain/uClibc/config/mips64.n32 deleted file mode 100644 index c26ecec4c2..0000000000 --- a/toolchain/uClibc/config/mips64.n32 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -CONFIG_MIPS_N32_ABI=y -# CONFIG_MIPS_N64_ABI is not set -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64el b/toolchain/uClibc/config/mips64el deleted file mode 100644 index 98d9bb4569..0000000000 --- a/toolchain/uClibc/config/mips64el +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64el.32 b/toolchain/uClibc/config/mips64el.32 deleted file mode 100644 index 03ab17c24f..0000000000 --- a/toolchain/uClibc/config/mips64el.32 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64el.64 b/toolchain/uClibc/config/mips64el.64 deleted file mode 100644 index 884640c756..0000000000 --- a/toolchain/uClibc/config/mips64el.64 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mips64el.n32 b/toolchain/uClibc/config/mips64el.n32 deleted file mode 100644 index 9a8bb3d3fb..0000000000 --- a/toolchain/uClibc/config/mips64el.n32 +++ /dev/null @@ -1,11 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -CONFIG_MIPS_N32_ABI=y -# CONFIG_MIPS_N64_ABI is not set -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mipsel b/toolchain/uClibc/config/mipsel deleted file mode 100644 index 2a79c16bdb..0000000000 --- a/toolchain/uClibc/config/mipsel +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/mipsel.cobalt b/toolchain/uClibc/config/mipsel.cobalt deleted file mode 100644 index 2a79c16bdb..0000000000 --- a/toolchain/uClibc/config/mipsel.cobalt +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/config/powerpc b/toolchain/uClibc/config/powerpc deleted file mode 100644 index 5b1292d12e..0000000000 --- a/toolchain/uClibc/config/powerpc +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -CONFIG_CLASSIC=y -# CONFIG_E500 is not set -TARGET_ARCH="powerpc" -TARGET_SUBARCH="classic" -TARGET_powerpc=y diff --git a/toolchain/uClibc/config/powerpc.e500 b/toolchain/uClibc/config/powerpc.e500 deleted file mode 100644 index a835c3d5e7..0000000000 --- a/toolchain/uClibc/config/powerpc.e500 +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -# CONFIG_CLASSIC is not set -CONFIG_E500=y -TARGET_ARCH="powerpc" -TARGET_SUBARCH="classic" -TARGET_powerpc=y diff --git a/toolchain/uClibc/config/sparc b/toolchain/uClibc/config/sparc deleted file mode 100644 index 3630b24a7e..0000000000 --- a/toolchain/uClibc/config/sparc +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -# CONFIG_SPARC_V7 is not set -# CONFIG_SPARC_V8 is not set -TARGET_ARCH="sparc" -TARGET_sparc=y -UCLIBC_HAS_LONG_DOUBLE_MATH=y diff --git a/toolchain/uClibc/config/sparc.leon b/toolchain/uClibc/config/sparc.leon deleted file mode 100644 index 3deb5148d9..0000000000 --- a/toolchain/uClibc/config/sparc.leon +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -# CONFIG_SPARC_V7 is not set -CONFIG_SPARC_V8=y -TARGET_ARCH="sparc" -TARGET_sparc=y -UCLIBC_HAS_LONG_DOUBLE_MATH=y diff --git a/toolchain/uClibc/config/x86_64 b/toolchain/uClibc/config/x86_64 deleted file mode 100644 index a13d659ba1..0000000000 --- a/toolchain/uClibc/config/x86_64 +++ /dev/null @@ -1,5 +0,0 @@ -ARCH_LITTLE_ENDIAN=y -TARGET_ARCH="x86_64" -TARGET_x86_64=y -UCLIBC_BSD_SPECIFIC=y -UCLIBC_HAS_FPU=y diff --git a/toolchain/uClibc/headers/Makefile b/toolchain/uClibc/headers/Makefile deleted file mode 100644 index abd3620d33..0000000000 --- a/toolchain/uClibc/headers/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -PATH_PREFIX:=.. - -include ../common.mk - -HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.headers_built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_headers_installed - -define Host/Compile - -endef - -define Host/Install - PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \ - PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ - DEVEL_PREFIX=/ \ - RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ - HOSTCC="$(HOSTCC)" \ - CC="$(TARGET_CC)" \ - CPU_CFLAGS="$(TARGET_CFLAGS)" \ - ARCH="$(CONFIG_ARCH)" \ - pregen \ - install_headers - $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/ -endef - -$(eval $(call HostBuild)) - diff --git a/toolchain/uClibc/utils/Makefile b/toolchain/uClibc/utils/Makefile deleted file mode 100644 index 83100d70c1..0000000000 --- a/toolchain/uClibc/utils/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -PATH_PREFIX=.. - -include ../common.mk - -HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.utils_built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_utils_installed - -define Host/Compile - $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak - $(UCLIBC_MAKE) PREFIX= utils -endef - -define Host/Install - $(INSTALL_DIR) $(TOOLCHAIN_DIR)/bin - $(INSTALL_BIN) \ - $(HOST_BUILD_DIR)/utils/ldd \ - $(TOOLCHAIN_DIR)/bin/ - $(INSTALL_DIR) $(TOOLCHAIN_DIR)/sbin - $(INSTALL_BIN) \ - $(HOST_BUILD_DIR)/utils/ldconfig \ - $(TOOLCHAIN_DIR)/sbin/ -endef - -$(eval $(call HostBuild)) From a459696eb1529e68f1f74c9230dcbf143c2800b1 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 26 Nov 2020 03:33:40 -0500 Subject: [PATCH 35/97] ramips: add support for Senao Engenius ESR600H FCC ID: A8J-ESR750H Engenius ESR600H is an indoor wireless router with a gigabit switch, 2.4 GHz and 5 GHz wireless, internal and external antennas, and a USB port. **Specification:** - RT3662F MIPS SOC, 5 GHz WMAC (2x2) - RT5392L PCI on-board, 2.4 GHz (2x2) - AR8327 RGMII, 7-port GbE, 25 MHz clock - 40 MHz reference clock - 8 MB FLASH 25L6406EM2I-12G - 64 MB RAM - UART at J12 (unpopulated) - 2 internal antennas (5 GHz) - 2 external antennas (2.4 GHz) - 9 LEDs, 1 button (power, wps, wifi2g, wifi5g, 5 LAN/WAN) - USB 2 port (GPIO controlled power) **MAC addresses:** MAC Addresses are labeled as WAN and WLAN U-boot environment has the the vendor MAC address for ethernet MAC addresses in "factory" are part of wifi calibration data eth0.2 WAN *:13:e7 u-boot-env wanaddr eth0.1 ---- *:13:e8 u-boot-env wanaddr + 1 phy0 WLAN *:14:b8 factory 0x8004 phy1 ---- *:14:bc factory 0x4 **Installation:** Method 1: Firmware upgrade page OEM webpage at 192.168.0.1 username and password "admin" Navigate to Network Setting --> Tools --> Firmware Click Browse and select the factory.dlf image Click Continue to confirm and wait 6 minutes or more... Method 2: Serial console to load TFTP image: (see TFTP recovery) **Return to OEM:** Unlike most Engenius boards, this does not have a 'failsafe' image the only way to return to OEM is serial access to uboot Unlike most Engenius boards, public images are not available... so the only way to return to OEM is to have a copy of the MTD partition "firmware" BEFORE flashing openwrt. **TFTP recovery:** Unlike most Engenius boards, TFTP is reliable here however it requires serial console access (soldering pins to the UART pinouts) build your own image... with 'ramdisk' selected under 'Target Images' rename initramfs-kernel.bin to 'uImageESR-600H' make the file available on a TFTP server at 192.168.99.8 interrupt boot by holding or pressing '4' in serial console as soon as board is powered on `tftpboot 0x81000000` `bootm 0x81000000` perform a sysupgrade **Format of OEM firmware image:** This Engenius board uses the Senao proprietary header with a unique Product ID. The header for factory.bin is generated by the mksenaofw program included in openwrt. .dlf file extension is also required for OEM software to accept it **Note on using OKLI:** the kernel is now too large for the bootloader to handle so OKLI is used via the `kernel-loader` image command recently in master several other ramips boards have the same problem 'Kernel panic - not syncing: Failed to find ralink,rt3883-sysc node' see commit ad19751edc21ae713bd95df6b93be64bd1e0c612 Signed-off-by: Michael Pratt --- package/boot/uboot-envtools/files/ramips | 3 +- .../ramips/dts/rt3662_engenius_esr600h.dts | 171 ++++++++++++++++++ target/linux/ramips/image/rt3883.mk | 14 ++ .../rt3883/base-files/etc/board.d/02_network | 18 +- 4 files changed, 199 insertions(+), 7 deletions(-) create mode 100644 target/linux/ramips/dts/rt3662_engenius_esr600h.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 4319832e11..0568f1fa69 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -17,7 +17,8 @@ alfa-network,ac1200rm|\ alfa-network,awusfree1|\ alfa-network,quad-e4g|\ alfa-network,r36m-e4g|\ -alfa-network,tube-e4g) +alfa-network,tube-e4g|\ +engenius,esr600h) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000" ;; allnet,all0256n-4m|\ diff --git a/target/linux/ramips/dts/rt3662_engenius_esr600h.dts b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts new file mode 100644 index 0000000000..cce44ed4c3 --- /dev/null +++ b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rt3883.dtsi" + +#include +#include + +/ { + compatible = "engenius,esr600h", "ralink,rt3662-soc", "ralink,rt3883-soc"; + model = "EnGenius ESR600H"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "blue:power"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + reset-wps { + label = "reset-wps"; + gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + usb { + gpio-export,name = "usb"; + gpio-export,output = <1>; + gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + + 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 0x1000>; + }; + + partition@32000 { + label = "config"; + reg = <0x32000 0xe000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "jtag", "uartf"; + function = "gpio"; + }; +}; + +ðernet { + status = "okay"; + + port@0 { + phy-handle = <&phy0>; + phy-mode = "rgmii"; + }; + + mdio-bus { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "rgmii"; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */ + 0x10 0x40000000 /* Power-on Strapping: 176-pin interface configuration */ + 0x50 0xc437c437 /* LED Control Register 0 */ + 0x54 0xc337c337 /* LED Control Register 1 */ + 0x58 0x00000000 /* LED Control Register 2 */ + 0x5c 0x03ffff00 /* LED Control Register 3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6 STATUS */ + >; + }; + }; +}; + +&pci { + status = "okay"; +}; + +&pci1 { + status = "okay"; + + wifi@0,1,0 { + compatible = "pci1814,3091"; + reg = <0x0 1 0 0 0>; + ralink,5ghz = <0>; + ralink,mtd-eeprom = <&factory 0x8000>; + }; +}; + +&wmac { + status = "okay"; + + ralink,2ghz = <0>; + ralink,mtd-eeprom = <&factory 0x0>; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; diff --git a/target/linux/ramips/image/rt3883.mk b/target/linux/ramips/image/rt3883.mk index f434172c50..1b46d570fd 100644 --- a/target/linux/ramips/image/rt3883.mk +++ b/target/linux/ramips/image/rt3883.mk @@ -59,6 +59,20 @@ define Device/edimax_br-6475nd endef TARGET_DEVICES += edimax_br-6475nd +define Device/engenius_esr600h + $(Device/uimage-lzma-loader) + SOC := rt3662 + BLOCKSIZE := 4k + IMAGE_SIZE := 7872k + IMAGES += factory.dlf + IMAGE/factory.dlf := $$(sysupgrade_bin) | check-size | \ + senao-header -r 0x101 -p 0x44 -t 2 + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := ESR600H + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 uboot-envtools +endef +TARGET_DEVICES += engenius_esr600h + define Device/loewe_wmdr-143n SOC := rt3662 BLOCKSIZE := 64k diff --git a/target/linux/ramips/rt3883/base-files/etc/board.d/02_network b/target/linux/ramips/rt3883/base-files/etc/board.d/02_network index 7b73f93944..f26199611e 100755 --- a/target/linux/ramips/rt3883/base-files/etc/board.d/02_network +++ b/target/linux/ramips/rt3883/base-files/etc/board.d/02_network @@ -25,6 +25,13 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0" ;; + engenius,esr600h|\ + sitecom,wlr-6000|\ + trendnet,tew-691gr|\ + trendnet,tew-692gr) + ucidef_add_switch "switch0" \ + "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" + ;; loewe,wmdr-143n|\ omnima,hpm) ucidef_set_interface_lan "eth0" @@ -33,12 +40,6 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "9@eth0" ;; - sitecom,wlr-6000|\ - trendnet,tew-691gr|\ - trendnet,tew-692gr) - ucidef_add_switch "switch0" \ - "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" - ;; esac } @@ -66,6 +67,11 @@ ramips_setup_macs() edimax,br-6475nd) wan_mac=$(mtd_get_mac_binary devdata 0x7) ;; + engenius,esr600h) + wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) + lan_mac=$(macaddr_add "$wan_mac" 1) + label_mac=$wan_mac + ;; samsung,cy-swr1100) lan_mac=$(mtd_get_mac_ascii nvram lanmac) wan_mac=$(mtd_get_mac_ascii nvram wanmac) From 7c75eaadfcddd5375d0cfd8a4eeed8e8f9e1a094 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 25 Nov 2020 10:48:57 +0100 Subject: [PATCH 36/97] scripts/om-fwupgradecfg-gen.sh: Drop block alignment code The padding and block alignment is handled by the image build script and doesn't need to be duplicated in the fwupgrade.cfg build script. Signed-off-by: Sven Eckelmann --- scripts/om-fwupgradecfg-gen.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index 4a7094055f..915fbd05ab 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -23,7 +23,6 @@ case $CE_TYPE in OM2P) MAX_PART_SIZE=7168 KERNEL_FLASH_ADDR=0x1c0000 - FLASH_BS=262144 MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1 SIZE_FORMAT="%d" @@ -31,7 +30,6 @@ case $CE_TYPE in OM5P|OM5PAC|MR600|MR900|MR1750|A60) MAX_PART_SIZE=7808 KERNEL_FLASH_ADDR=0xb0000 - FLASH_BS=65536 MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1 SIZE_FORMAT="%d" @@ -39,7 +37,6 @@ case $CE_TYPE in A42) MAX_PART_SIZE=15616 KERNEL_FLASH_ADDR=0x180000 - FLASH_BS=65536 MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1024 SIZE_FORMAT="0x%08x" @@ -47,7 +44,6 @@ case $CE_TYPE in A62) MAX_PART_SIZE=15552 KERNEL_FLASH_ADDR=0x1a0000 - FLASH_BS=65536 MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1024 SIZE_FORMAT="0x%08x" @@ -63,7 +59,7 @@ CHECK_BS=65536 KERNEL_SIZE=$(stat -c%s "$KERNEL_PATH") KERNEL_MD5=$(mkhash md5 $KERNEL_PATH) KERNEL_SHA256=$(mkhash sha256 $KERNEL_PATH) -KERNEL_PART_SIZE_KB=$(size=$(($KERNEL_SIZE / $FLASH_BS)); [ $(($size * $FLASH_BS)) -lt $KERNEL_SIZE ] && size=$(($size + 1)); echo $(($size * $FLASH_BS / 1024))) +KERNEL_PART_SIZE_KB=$((KERNEL_SIZE / 1024)) KERNEL_PART_SIZE=$(printf $SIZE_FORMAT $(($KERNEL_PART_SIZE_KB * $SIZE_FACTOR))) ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE_KB * 1024))); printf "0x%x" $addr) From a4c30d9399bdd7f5c42409b959d52230a97600c9 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 25 Nov 2020 10:48:57 +0100 Subject: [PATCH 37/97] scripts/om-fwupgradecfg-gen.sh: Generate checksum over whole squashfs The rootfs is padded to the full block size by padjffs2 and a 4 byte magic value ("deadc0de") is added to the end. On first boot, the JFFS2 is replacing the "deadc0de" marker when the rootfs_data is initialized. The static part of the rootfs is therefore $rootfs_size - 4 and not $rootfs_size - 262144 - 4. Signed-off-by: Sven Eckelmann --- scripts/om-fwupgradecfg-gen.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index 915fbd05ab..ce33454a24 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -23,28 +23,24 @@ case $CE_TYPE in OM2P) MAX_PART_SIZE=7168 KERNEL_FLASH_ADDR=0x1c0000 - MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1 SIZE_FORMAT="%d" ;; OM5P|OM5PAC|MR600|MR900|MR1750|A60) MAX_PART_SIZE=7808 KERNEL_FLASH_ADDR=0xb0000 - MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1 SIZE_FORMAT="%d" ;; A42) MAX_PART_SIZE=15616 KERNEL_FLASH_ADDR=0x180000 - MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1024 SIZE_FORMAT="0x%08x" ;; A62) MAX_PART_SIZE=15552 KERNEL_FLASH_ADDR=0x1a0000 - MD5_SKIP_BLOCKS=4 SIZE_FACTOR=1024 SIZE_FORMAT="0x%08x" ;; @@ -64,11 +60,12 @@ KERNEL_PART_SIZE=$(printf $SIZE_FORMAT $(($KERNEL_PART_SIZE_KB * $SIZE_FACTOR))) ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE_KB * 1024))); printf "0x%x" $addr) ROOTFS_SIZE=$(stat -c%s "$ROOTFS_PATH") -ROOTFS_CHECK_BLOCKS=$((($ROOTFS_SIZE / $CHECK_BS) - $MD5_SKIP_BLOCKS)) +ROOTFS_SQUASHFS_SIZE=$((ROOTFS_SIZE-4)) +ROOTFS_CHECK_BLOCKS=$((ROOTFS_SQUASHFS_SIZE / CHECK_BS)) ROOTFS_MD5=$(dd if=$ROOTFS_PATH bs=$CHECK_BS count=$ROOTFS_CHECK_BLOCKS 2>&- | mkhash md5) ROOTFS_MD5_FULL=$(mkhash md5 $ROOTFS_PATH) ROOTFS_SHA256_FULL=$(mkhash sha256 $ROOTFS_PATH) -ROOTFS_CHECK_SIZE=$(printf '0x%x' $(($ROOTFS_CHECK_BLOCKS * $CHECK_BS))) +ROOTFS_CHECK_SIZE=$(printf '0x%x' $ROOTFS_SQUASHFS_SIZE) ROOTFS_PART_SIZE_KB=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE_KB)) ROOTFS_PART_SIZE=$(printf $SIZE_FORMAT $(($ROOTFS_PART_SIZE_KB * $SIZE_FACTOR))) From f244143609adcccc978d3c15884be6b98bc9789b Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sat, 31 Oct 2020 21:23:33 -0400 Subject: [PATCH 38/97] ath79: add support for Senao Engenius ECB1200 FCC ID: A8J-ECB1200 Engenius ECB1200 is an indoor wireless access point with a GbE port, 2.4 GHz and 5 GHz wireless, external antennas, and 802.3af PoE. **Specification:** - QCA9557 SOC MIPS, 2.4 GHz (2x2) - QCA9882 WLAN PCIe card, 5 GHz (2x2) - AR8035-A switch RGMII, GbE with 802.3af PoE, 25 MHz clock - 40 MHz reference clock - 16 MB FLASH 25L12845EMI-10G - 2x 64 MB RAM 1538ZFZ V59C1512164QEJ25 - UART at JP1 (unpopulated, RX shorted to ground) - 4 external antennas - 4 LEDs, 1 button (power, eth, wifi2g, wifi5g) (reset) **MAC addresses:** MAC Addresses are labeled as ETH and 5GHZ U-boot environment has the vendor MAC addresses MAC addresses in ART do not match vendor eth0 ETH *:5c u-boot-env ethaddr phy0 5GHZ *:5d u-boot-env athaddr ---- ---- ???? art 0x0/0x6 **Installation:** Method 1: Firmware upgrade page: OEM webpage at 192.168.1.1 username and password "admin" Navigate to "Firmware" page from left pane Click Browse and select the factory.bin image Upload and verify checksum Click Continue to confirm and wait 3 minutes Method 2: Serial to load Failsafe webpage: After connecting to serial console and rebooting... Interrupt uboot with any key pressed rapidly (see TFTP recovery) perform a sysupgrade **Serial Access:** the RX line on the board for UART is shorted to ground by resistor R176 therefore it must be removed to use the console but it is not necessary to remove to view boot log optionally, R175 can be replaced with a solder bridge short the resistors R175 and R176 are next to the UART pinout at JP1 **Return to OEM:** If you have a serial cable, see Serial Failsafe instructions Unlike most Engenius boards, this does not have a 'failsafe' image the only way to return to OEM is TFTP or serial access to u-boot **TFTP recovery:** Unlike most Engenius boards, TFTP is reliable here rename initramfs-kernel.bin to 'ap.bin' make the file available on a TFTP server at 192.168.1.10 power board while holding or pressing reset button repeatedly or with serial access: run `tftpboot` or `run factory_boot` with initramfs-kernel.bin then `bootm` with the load address **Format of OEM firmware image:** The OEM software of ECB1200 is a heavily modified version of Openwrt Altitude Adjustment 12.09. This Engenius board, like ECB1750, uses a proprietary header with a unique Product ID. The header for factory.bin is generated by the mksenaofw program included in openwrt. **Note on PLL-data cells:** The default PLL register values will not work because of the AR8035 switch between the SOC and the ethernet port. For QCA955x series, the PLL registers for eth0 and eth1 can be see in the DTSI as 0x28 and 0x48 respectively. Therefore the PLL registers can be read from uboot for each link speed after attempting tftpboot or another network action using that link speed with `md 0x18050028 1` and `md 0x18050048 1`. However the registers that u-boot sets are not ideal and sometimes wrong... the at803x driver supports setting the RGMII clock/data delay on the PHY side. This way the pll-data register only needs to handle invert and phase. for this board clock invert is needed on the MAC side all link speeds functional Signed-off-by: Michael Pratt --- package/boot/uboot-envtools/files/ath79 | 1 + .../ath79/dts/qca9557_engenius_ecb1200.dts | 140 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 2 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + target/linux/ath79/image/generic.mk | 13 ++ 6 files changed, 158 insertions(+) create mode 100644 target/linux/ath79/dts/qca9557_engenius_ecb1200.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 259c52c770..dd8c2d36d7 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -24,6 +24,7 @@ arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ engenius,eap300-v2|\ +engenius,ecb1200|\ engenius,ecb1750|\ engenius,enh202-v1|\ engenius,ens202ext-v1|\ diff --git a/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts b/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts new file mode 100644 index 0000000000..ee46cd79e7 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + compatible = "engenius,ecb1200", "qca,qca9557"; + model = "EnGenius ECB1200"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + debounce-interval = <60>; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xf50000>; + }; + + partition@fa0000 { + label = "userconfig"; + reg = <0xfa0000 0x050000>; + read-only; + }; + + partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy5: ethernet-phy@5 { + reg = <5>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy5>; + phy-mode = "rgmii-id"; + + pll-data = <0x82000000 0x80000101 0x80001313>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0,0 { + compatible = "qcom,ath10k"; + reg = <0x0 0 0 0 0>; + qca,no-eeprom; + }; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 866d74fae4..b712154eb1 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -29,6 +29,7 @@ ath79_setup_interfaces() dlink,dap-1365-a1|\ dlink,dir-505|\ engenius,eap300-v2|\ + engenius,ecb1200|\ engenius,ecb1750|\ enterasys,ws-ap3705i|\ glinet,gl-ar300m-lite|\ @@ -500,6 +501,7 @@ ath79_setup_macs() elecom,wrc-300ghbk2-i) wan_mac=$(macaddr_add "$(mtd_get_mac_binary art 0x1002)" -2) ;; + engenius,ecb1200|\ engenius,ecb1750) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) label_mac=$(mtd_get_mac_ascii u-boot-env athaddr) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 194df74292..5d5e25b401 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -37,6 +37,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac") ;; + engenius,ecb1200|\ engenius,ecb1750) caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env "athaddr") +1) 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 0d09cd3140..5a38e7f421 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 @@ -62,6 +62,7 @@ case "$FIRMWARE" in elecom,wrc-1750ghbk2-i) caldata_extract "art" 0x5000 0x844 ;; + engenius,ecb1200|\ engenius,ecb1750) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_ascii u-boot-env athaddr) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 4d181245a6..a7f1a76e11 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -942,6 +942,19 @@ define Device/engenius_eap300-v2 endef TARGET_DEVICES += engenius_eap300-v2 +define Device/engenius_ecb1200 + SOC := qca9557 + DEVICE_VENDOR := EnGenius + DEVICE_MODEL := ECB1200 + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct + IMAGE_SIZE := 15680k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | \ + senao-header -r 0x101 -p 0x6e -t 2 +endef +TARGET_DEVICES += engenius_ecb1200 + define Device/engenius_ecb1750 SOC := qca9558 DEVICE_VENDOR := EnGenius From 3381392557fe5cd1dd00d6f63dc5aa7e37333021 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 26 Nov 2020 18:57:31 -0500 Subject: [PATCH 39/97] ath79: create common DTSI for ECB1200 and ECB1750 These boards are sister boards exactly the same hardware except that ECB1200 has: - QCA9557 - 2 RF circuits/antennas per band instead of 3 - a resistor blocking UART RX line Tested-by: sven friedmann Signed-off-by: Michael Pratt --- .../ath79/dts/qca9557_engenius_ecb1200.dts | 134 +---------------- .../ath79/dts/qca9558_engenius_ecb1750.dts | 133 +---------------- .../ath79/dts/qca955x_engenius_ecb1xxx.dtsi | 137 ++++++++++++++++++ 3 files changed, 139 insertions(+), 265 deletions(-) create mode 100644 target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi diff --git a/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts b/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts index ee46cd79e7..955f17f0f3 100644 --- a/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts +++ b/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts @@ -1,140 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca955x.dtsi" - -#include -#include +#include "qca955x_engenius_ecb1xxx.dtsi" / { compatible = "engenius,ecb1200", "qca,qca9557"; model = "EnGenius ECB1200"; - - aliases { - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - debounce-interval = <60>; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_power: power { - label = "amber:power"; - gpios = <&gpio 22 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - wifi2g { - label = "blue:wifi2g"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - wifi5g { - label = "blue:wifi5g"; - gpios = <&gpio 23 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - }; -}; - -&uart { - status = "okay"; -}; - -&spi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x000000 0x040000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x040000 0x010000>; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x050000 0xf50000>; - }; - - partition@fa0000 { - label = "userconfig"; - reg = <0xfa0000 0x050000>; - read-only; - }; - - partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - }; - }; - }; -}; - -&mdio0 { - status = "okay"; - - phy5: ethernet-phy@5 { - reg = <5>; - eee-broken-100tx; - eee-broken-1000t; - }; -}; - -ð0 { - status = "okay"; - - phy-handle = <&phy5>; - phy-mode = "rgmii-id"; - - pll-data = <0x82000000 0x80000101 0x80001313>; - - gmac-config { - device = <&gmac>; - rgmii-enabled = <1>; - }; -}; - -&pcie0 { - status = "okay"; - - wifi@0,0,0 { - compatible = "qcom,ath10k"; - reg = <0x0 0 0 0 0>; - qca,no-eeprom; - }; -}; - -&wmac { - status = "okay"; - - qca,no-eeprom; }; diff --git a/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts b/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts index 159ccc1872..4ee4c8ea69 100644 --- a/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts +++ b/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts @@ -1,139 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca955x.dtsi" - -#include -#include +#include "qca955x_engenius_ecb1xxx.dtsi" / { compatible = "engenius,ecb1750", "qca,qca9558"; model = "EnGenius ECB1750"; - - aliases { - led-boot = &led_power_orange; - led-failsafe = &led_power_orange; - led-running = &led_power_orange; - led-upgrade = &led_power_orange; - }; - - leds { - compatible = "gpio-leds"; - - led_power_orange: power_orange { - label = "orange:power"; - gpios = <&gpio 22 GPIO_ACTIVE_LOW>; - default-state = "on"; - }; - - wlan2g { - label = "blue:wlan2g"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - wlan5g { - label = "blue:wlan5g"; - gpios = <&gpio 23 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - lan { - label = "blue:lan"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&pcie0 { - status = "okay"; -}; - -&uart { - status = "okay"; -}; - -&spi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <25000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - uboot: partition@0 { - label = "u-boot"; - reg = <0x000000 0x040000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x040000 0x010000>; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x050000 0xf50000>; - }; - - partition@fa0000 { - label = "userconfig"; - reg = <0xfa0000 0x050000>; - read-only; - }; - - art: partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - }; - }; - }; -}; - -&wmac { - status = "okay"; - - qca,no-eeprom; -}; - -&mdio0 { - status = "okay"; - - phy5: ethernet-phy@5 { - reg = <5>; - eee-broken-100tx; - eee-broken-1000t; - }; -}; - -ð0 { - status = "okay"; - - pll-data = <0x9a000000 0x80000101 0x80001313>; - - phy-handle = <&phy5>; - - gmac-config { - device = <&gmac>; - rgmii-gmac0 = <1>; - rxd-delay = <3>; - rxdv-delay = <3>; - }; }; diff --git a/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi b/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi new file mode 100644 index 0000000000..0051eb2508 --- /dev/null +++ b/target/linux/ath79/dts/qca955x_engenius_ecb1xxx.dtsi @@ -0,0 +1,137 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + debounce-interval = <60>; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xf50000>; + }; + + partition@fa0000 { + label = "userconfig"; + reg = <0xfa0000 0x050000>; + read-only; + }; + + partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy5: ethernet-phy@5 { + reg = <5>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy5>; + phy-mode = "rgmii-id"; + + pll-data = <0x82000000 0x80000101 0x80001313>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0,0 { + compatible = "qcom,ath10k"; + reg = <0x0 0 0 0 0>; + qca,no-eeprom; + }; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; From 73bdbb3d2025512241061aaf18f7719cf6767452 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 26 Nov 2020 19:11:15 -0500 Subject: [PATCH 40/97] ath79: enable factory.bin and adjust profile of ECB1750 factory.bin was not tested for ECB1750... but it was tested on it's sister board ECB1200 The product ID for the header can be verified by inspecting the header of OEM images, or in the u-boot environment. Also: - the LAN LED is controlled directly by the AR8035 switch - the labelled (first increment) MAC for both is ethaddr (eth0) - list packages in alphabetical order - use default sysupgrade.bin recipe Signed-off-by: Michael Pratt --- target/linux/ath79/generic/base-files/etc/board.d/01_leds | 1 - target/linux/ath79/generic/base-files/etc/board.d/02_network | 2 +- .../base-files/etc/hotplug.d/firmware/10-ath9k-eeprom | 2 +- target/linux/ath79/image/generic.mk | 5 ++--- 4 files changed, 4 insertions(+), 6 deletions(-) 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 a0ed21e318..084281562f 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 @@ -151,7 +151,6 @@ telco,t1) ;; comfast,cf-wr752ac-v1|\ engenius,eap300-v2|\ -engenius,ecb1750|\ enterasys,ws-ap3705i) ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" ;; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index b712154eb1..e42d889847 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -504,7 +504,7 @@ ath79_setup_macs() engenius,ecb1200|\ engenius,ecb1750) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) - label_mac=$(mtd_get_mac_ascii u-boot-env athaddr) + label_mac=$lan_mac ;; engenius,enh202-v1|\ ubnt,airrouter|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 5d5e25b401..ebad4e72cd 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -40,7 +40,7 @@ case "$FIRMWARE" in engenius,ecb1200|\ engenius,ecb1750) caldata_extract "art" 0x1000 0x440 - ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env "athaddr") +1) + ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) +1) ;; engenius,epg5000|\ iodata,wn-ac1167dgr|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index a7f1a76e11..e44e780e8c 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -959,13 +959,12 @@ define Device/engenius_ecb1750 SOC := qca9558 DEVICE_VENDOR := EnGenius DEVICE_MODEL := ECB1750 - DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct IMAGE_SIZE := 15680k + IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | check-size | \ senao-header -r 0x101 -p 0x6d -t 2 - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ - append-metadata | check-size endef TARGET_DEVICES += engenius_ecb1750 From a1b5a43fc4b0edda5bbbb4eb0130ba9160dc515b Mon Sep 17 00:00:00 2001 From: Chen Minqiang Date: Wed, 25 Nov 2020 01:53:39 +0800 Subject: [PATCH 41/97] ath79: add support for GL.iNet GL-USB150 Add support for the ar71xx supported GL.iNet GL-USB150 to ath79. GL.iNet GL-USB150 is an USB dongle WiFi router, based on Atheros AR9331. Specification: - 400/400/200 MHz (CPU/DDR/AHB) - 64 MB of RAM (DDR2) - 16 MB of FLASH (SPI NOR) - Realtek RTL8152B USB to Ethernet bridge (connected with AR9331 PHY4) - 1T1R 2.4 GHz - 2x LED, 1x button - UART header on PCB Flash instruction: Vendor software is based on openwrt so you can flash the sysupgrade image via the vendor GUI or using command line sysupgrade utility. Make sure to not save configuration over reflash as uci settings differ between versions. Signed-off-by: Chen Minqiang --- .../ath79/dts/ar9331_glinet_gl-usb150.dts | 120 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + target/linux/ath79/image/generic.mk | 9 ++ 3 files changed, 130 insertions(+) create mode 100644 target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts new file mode 100644 index 0000000000..c75684be04 --- /dev/null +++ b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9331.dtsi" + +#include +#include + +/ { + compatible = "glinet,gl-usb150", "qca,ar9331"; + model = "GL.iNet GL-USB150"; + + aliases { + serial0 = &uart; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + wlan { + label = "green:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + led_power: power { + label = "green:power"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_lan_reset { + gpio-export,name = "lan:reset"; + gpio-export,output = <0>; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + gmac-config { + device = <&gmac>; + switch-phy-addr-swap = <0>; + switch-phy-swap = <0>; + }; +}; + +ð1 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <33000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xfa0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index e42d889847..e3e0547ee7 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -33,6 +33,7 @@ ath79_setup_interfaces() engenius,ecb1750|\ enterasys,ws-ap3705i|\ glinet,gl-ar300m-lite|\ + glinet,gl-usb150|\ hak5,wifi-pineapple-nano|\ meraki,mr16|\ netgear,ex6400|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index e44e780e8c..661d4203ed 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1111,6 +1111,15 @@ define Device/glinet_gl-mifi endef TARGET_DEVICES += glinet_gl-mifi +define Device/glinet_gl-usb150 + SOC := ar9331 + DEVICE_VENDOR := GL.iNET + DEVICE_MODEL := GL-USB150 + IMAGE_SIZE := 16000k + SUPPORTED_DEVICES += gl-usb150 +endef +TARGET_DEVICES += glinet_gl-usb150 + define Device/glinet_gl-x750 SOC := qca9531 DEVICE_VENDOR := GL.iNet From 7073ebf0f917619dc08f2f9b2ae659d2f91ba8b0 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 3 Nov 2020 18:00:02 -0500 Subject: [PATCH 42/97] ath79: add support for Senao Engenius ECB350 v1 FCC ID: A8J-ECB350 Engenius ECB350 v1 is an indoor wireless access point with a gigabit ethernet port, 2.4 GHz wireless, external antennas, and PoE. **Specification:** - AR7242 SOC - AR9283 WLAN 2.4 GHz (2x2), PCIe on-board - AR8035-A switch RGMII, GbE with 802.3af PoE - 40 MHz reference clock - 8 MB FLASH 25L6406EM2I-12G - 32 MB RAM - UART at J2 (populated) - 2 external antennas - 3 LEDs, 1 button (power, lan, wlan) (reset) **MAC addresses:** MACs are labeled as WLAN and WAN vendor MAC addresses in flash are duplicate phy0 WLAN *:b8 --- eth0 WAN *:b9 art 0x0/0x6 **Installation:** - if you get Failsafe Mode from failed flash: only use it to flash Original firmware from Engenius or risk kernel loop or halt which requires serial cable Method 1: Firmware upgrade page: OEM webpage at 192.168.1.1 username and password "admin" Navigate to "Firmware" page from left pane Click Browse and select the factory.bin image Upload and verify checksum Click Continue to confirm and wait 3 minutes Method 2: Serial to load Failsafe webpage: After connecting to serial console and rebooting... Interrupt uboot with any key pressed rapidly execute `run failsafe_boot` OR `bootm 0x9f670000` wait a minute connect to ethernet and navigate to "192.168.1.1/index.htm" Select the factory.bin image and upload wait about 3 minutes **Return to OEM:** If you have a serial cable, see Serial Failsafe instructions otherwise, uboot-env can be used to make uboot load the failsafe image *DISCLAIMER* The Failsafe image is unique to Engenius boards. If the failsafe image is missing or damaged this will not work DO NOT downgrade to ar71xx this way, it can cause kernel loop or halt ssh into openwrt and run `fw_setenv rootfs_checksum 0` reboot, wait 3 minutes connect to ethernet and navigate to 192.168.1.1/index.htm select OEM firmware image from Engenius and click upgrade **TFTP recovery** (unstable / not reliable): rename initramfs to 'vmlinux-art-ramdisk' make available on TFTP server at 192.168.1.101 power board while holding or pressing reset button repeatedly NOTE: for some Engenius boards TFTP is not reliable try setting MTU to 600 and try many times **Format of OEM firmware image:** The OEM software of ECB350 v1 is a heavily modified version of Openwrt Kamikaze. One of the many modifications is to the sysupgrade program. Image verification is performed by the successful ungzip and untar of the supplied file and name check and header verification of the resulting contents. To form a factory.bin that is accepted by OEM Openwrt build, the kernel and rootfs must have specific names and begin with the respective headers (uImage, squashfs). Then the files must be tarballed and gzipped. The resulting binary is actually a tar.gz file in disguise. This can be verified by using binwalk on the OEM firmware images, ungzipping then untaring. The OEM upgrade script is at /etc/fwupgrade.sh. OKLI kernel loader is required because the OEM software expects the kernel size to be no greater than 1536k and otherwise the factory.bin upgrade procedure would overwrite part of the kernel when writing rootfs. The factory upgrade script follows the original mtd partitions. **Note on PLL-data cells:** The default PLL register values will not work because of the AR8035 switch between the SOC and the ethernet port. For AR724x series, the PLL register for GMAC0 can be seen in the DTSI as 0x2c. Therefore the PLL register can be read from u-boot for each link speed after attempting tftpboot or another network action using that link speed with `md 0x1805002c 1` However the registers that u-boot sets are not ideal and sometimes wrong... the at803x driver supports setting the RGMII clock/data delay on the PHY side. This way the pll-data register only needs to handle invert and phase. for this board no extra adjustements are needed on the MAC side all link speeds functional Signed-off-by: Michael Pratt --- package/boot/uboot-envtools/files/ath79 | 1 + .../ath79/dts/ar7242_engenius_ecb350-v1.dts | 174 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 + target/linux/ath79/image/generic.mk | 11 ++ 5 files changed, 188 insertions(+) create mode 100644 target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index dd8c2d36d7..39400a33a6 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -26,6 +26,7 @@ devolo,magic-2-wifi|\ engenius,eap300-v2|\ engenius,ecb1200|\ engenius,ecb1750|\ +engenius,ecb350-v1|\ engenius,enh202-v1|\ engenius,ens202ext-v1|\ etactica,eg200|\ diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts new file mode 100644 index 0000000000..8931a206ba --- /dev/null +++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7242.dtsi" + +#include +#include + +/ { + compatible = "engenius,ecb350-v1", "qca,ar7242"; + model = "EnGenius ECB350 v1"; + + aliases { + label-mac-device = &ath9k; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wlan { + label = "green:wlan"; + gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x50000 0x50000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0xa0000 0x10000>; + read-only; + }; + + firmware2: partition@b0000 { + label = "firmware2"; + reg = <0xb0000 0xf0000>; + }; + + partition@1a0000 { + label = "fakeroot"; + reg = <0x1a0000 0x10000>; + read-only; + }; + + firmware1: partition@1b0000 { + label = "firmware1"; + reg = <0x1b0000 0x4c0000>; + }; + + partition@670000 { + label = "failsafe"; + reg = <0x670000 0x180000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + phy-handle = <&phy4>; + phy-mode = "rgmii-id"; + + pll-data = <0x02000000 0x00000101 0x00001313>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0,0 { + compatible = "pci168c,002a"; + reg = <0x0 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-1)>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index e3e0547ee7..766c0d0712 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -31,6 +31,7 @@ ath79_setup_interfaces() engenius,eap300-v2|\ engenius,ecb1200|\ engenius,ecb1750|\ + engenius,ecb350-v1|\ enterasys,ws-ap3705i|\ glinet,gl-ar300m-lite|\ glinet,gl-usb150|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index ebad4e72cd..2746cf4137 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -75,6 +75,7 @@ case "$FIRMWARE" in caldata_extract_reverse "urloader" 0x1541 0x440 ;; buffalo,wzr-hp-g302h-a1a0|\ + engenius,ecb350-v1|\ engenius,enh202-v1) caldata_extract "art" 0x1000 0xeb8 ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 661d4203ed..333420c827 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -968,6 +968,17 @@ define Device/engenius_ecb1750 endef TARGET_DEVICES += engenius_ecb1750 +define Device/engenius_ecb350-v1 + $(Device/engenius_loader_okli) + SOC := ar7242 + DEVICE_MODEL := ECB350 + DEVICE_VARIANT := v1 + IMAGE_SIZE := 4864k + LOADER_FLASH_OFFS := 0x1b0000 + ENGENIUS_IMGNAME := senao-ecb350 +endef +TARGET_DEVICES += engenius_ecb350-v1 + define Device/engenius_enh202-v1 $(Device/engenius_loader_okli) SOC := ar7240 From 622ce713ca246aa465bf28d2a743f96999085ea2 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Sun, 6 Dec 2020 16:50:40 +0900 Subject: [PATCH 43/97] ipq806x: disable SPC of IPQ8064 on NEC WG2600HP to fix boot issue The SPC (Standalone Power Collapse) of IPQ8064 on NEC Aterm WG2600HP need to be disabled to fix the boot stucking issue on WG2600HP with kernel 5.4. log: [ 3.036965] cpuidle: enable-method property 'qcom,kpss-acc-v1' found operations [ 3.038007] cpuidle: enable-method property 'qcom,kpss-acc-v1' found operations [ 3.045849] sdhci: Secure Digital Host Controller Interface driver [ 3.052385] sdhci: Copyright(c) Pierre Ossman [ 3.058712] sdhci-pltfm: SDHCI platform and OF driver helper [ 3.065469] NET: Registered protocol family 10 [ 3.070184] Segment Routing with IPv6 [ 3.073141] NET: Registered protocol family 17 [ 3.078157] 8021q: 802.1Q VLAN Support v1.8 [ 3.081149] Registering SWP/SWPB emulation handler [ 3.107125] qcom_rpm 108000.rpm: RPM firmware 3.0.16777371 [ 3.120475] s1a: Bringing 0uV into 1050000-1050000uV [ 3.120747] s1a: supplied by regulator-dummy [ 3.124775] s1b: Bringing 0uV into 1050000-1050000uV [ 3.128969] s1b: supplied by regulator-dummy [ 3.133905] s2a: Bringing 0uV into 800000-800000uV [ 3.138190] s2a: supplied by regulator-dummy [ 3.142693] s2b: Bringing 0uV into 800000-800000uV [ 3.147266] s2b: supplied by regulator-dummy [ (stuck) Signed-off-by: INAGAKI Hiroshi --- .../ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts index 1a6b7eb4d6..23898e0221 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts @@ -119,6 +119,10 @@ }; }; +&CPU_SPC { + status = "disabled"; +}; + &adm_dma { status = "okay"; }; From 3599ea5263a1a39740948110d96cfccdf409f336 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sun, 22 Nov 2020 13:12:09 +0100 Subject: [PATCH 44/97] images: Fix sysupgrade.tar for devices with NOR flash The NOR flash rootfs images stored in a sysupgrade.tar must end with the JFFS2 marker. Otherwise, devices like OpenMesh A42/A62 are not able to calculate the md5sum of the fixed squashfs part and store it inside the u-boot-env. But the commit ee76bd11bbe7 ("images: fix boot failures on NAND with small sub pages") adds up to 1020 0x00 bytes after the 0xdead0de EOF marker. The calculated md5sum will be wrong due do this change and u-boot will fail to boot the newly flashed device with a message like: Validating MD5Sum of 'vmlinux'... Passed! Validating MD5Sum of 'rootfs'... Failed! 583a1b7b54b8601efa64ade42742459b != 8850ee812dfd7638e94083329d5d2781 Data validation failed! and boot the old image again. Since the original change should not change the behavior of NOR images, just check for the deadc0de marker at the end of the squashfs-jffs2 image do avoid the problematic behavior for these images. Fixes: ee76bd11bbe7 ("images: fix boot failures on NAND with small sub pages") Signed-off-by: Sven Eckelmann --- scripts/functions.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index 9a7fcde627..ec0618c272 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -5,6 +5,19 @@ get_magic_word() { dd if=$1 bs=4 count=1 2>/dev/null | od -A n -N 4 -t x1 | tr -d ' ' } +get_post_padding_word() { + local rootfs_length="$(stat -c%s "$1")" + [ "$rootfs_length" -ge 4 ] || return + rootfs_length=$((rootfs_length-4)) + + # the JFFS2 end marker must be on a 4K boundary (often 64K or 256K) + local unaligned_bytes=$((rootfs_length%4096)) + [ "$unaligned_bytes" = 0 ] || return + + # skip rootfs data except the potential EOF marker + dd if="$1" bs=1 skip="$rootfs_length" 2>/dev/null | od -A n -N 4 -t x1 | tr -d ' ' +} + get_fs_type() { local magic_word="$(get_magic_word "$1")" @@ -13,7 +26,16 @@ get_fs_type() { echo "ubifs" ;; "68737173") - echo "squashfs" + local post_padding_word="$(get_post_padding_word "$1")" + + case "$post_padding_word" in + "deadc0de") + echo "squashfs-jffs2" + ;; + *) + echo "squashfs" + ;; + esac ;; *) echo "unknown" From 727eebbad1b9dea91174ea675cb64ea13484f790 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 16:57:31 +0100 Subject: [PATCH 45/97] ath79: Fix fallback to bootloader cmdline on empty DT bootargs The MIPS code is supposed to fall back to u-boots bootargs whenever the /chosen/bootargs property is missing. But this feature was accidentally disabled when the boot_command_line was initialized with an empty space just to work around problems with early_init_dt_scan_chosen. But this feature is necessary for some boards which have a dualboot mechanism and whose u-boot is calculating the correct partition at runtime without writing this information back to the u-boot-env. Signed-off-by: Sven Eckelmann --- ...an-up-boot_command_line-initializati.patch | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch diff --git a/target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch b/target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch new file mode 100644 index 0000000000..4cadd5a86f --- /dev/null +++ b/target/linux/ath79/patches-5.4/0001-MIPS-cmdline-Clean-up-boot_command_line-initializati.patch @@ -0,0 +1,194 @@ +From: Paul Burton +Date: Wed, 9 Oct 2019 23:09:45 +0000 +Subject: MIPS: cmdline: Clean up boot_command_line initialization + +Our current code to initialize boot_command_line is a mess. Some of this +is due to the addition of too many options over the years, and some of +this is due to workarounds for early_init_dt_scan_chosen() performing +actions specific to options from other architectures that probably +shouldn't be in generic code. + +Clean this up by introducing a new bootcmdline_init() function that +simplifies the initialization somewhat. The major changes are: + +- Because bootcmdline_init() is a function it can return early in the + CONFIG_CMDLINE_OVERRIDE case. + +- We clear boot_command_line rather than inheriting whatever + early_init_dt_scan_chosen() may have left us. This means we no longer + need to set boot_command_line to a space character in an attempt to + prevent early_init_dt_scan_chosen() from copying CONFIG_CMDLINE into + boot_command_line without us knowing about it. + +- Indirection via USE_PROM_CMDLINE, USE_DTB_CMDLINE, EXTEND_WITH_PROM & + BUILTIN_EXTEND_WITH_PROM macros is removed; they seemingly served only + to obfuscate the code. + +- The logic is cleaner, clearer & commented. + +Two minor drawbacks of this approach are: + +1) We call of_scan_flat_dt(), which means we scan through the DT again. + The overhead is fairly minimal & shouldn't be noticeable. + +2) cmdline_scan_chosen() duplicates a small amount of the logic from + early_init_dt_scan_chosen(). Alternatives might be to allow the + generic FDT code to keep & expose a copy of the arguments taken from + the /chosen node's bootargs property, or to introduce a function like + early_init_dt_scan_chosen() that retrieves them without modification + to handle CONFIG_CMDLINE. Neither of these sounds particularly + cleaner though, and this way we at least keep the extra work in + arch/mips. + +Origin: upstream, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7784cac697351f0cc0a4bb619594c0c99348c5aa +Signed-off-by: Paul Burton +Cc: linux-mips@vger.kernel.org + +diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c +index b8884de89c81e1b444b218a15519556b4a374089..e56dd6c25d46336fcb9af21326f697d0c37aac1c 100644 +--- a/arch/mips/kernel/setup.c ++++ b/arch/mips/kernel/setup.c +@@ -538,11 +538,88 @@ static void __init check_kernel_sections_mem(void) + } + } + +-#define USE_PROM_CMDLINE IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER) +-#define USE_DTB_CMDLINE IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_DTB) +-#define EXTEND_WITH_PROM IS_ENABLED(CONFIG_MIPS_CMDLINE_DTB_EXTEND) +-#define BUILTIN_EXTEND_WITH_PROM \ +- IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND) ++static void __init bootcmdline_append(const char *s, size_t max) ++{ ++ if (!s[0] || !max) ++ return; ++ ++ if (boot_command_line[0]) ++ strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); ++ ++ strlcat(boot_command_line, s, max); ++} ++ ++static int __init bootcmdline_scan_chosen(unsigned long node, const char *uname, ++ int depth, void *data) ++{ ++ bool *dt_bootargs = data; ++ const char *p; ++ int l; ++ ++ if (depth != 1 || !data || ++ (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) ++ return 0; ++ ++ p = of_get_flat_dt_prop(node, "bootargs", &l); ++ if (p != NULL && l > 0) { ++ bootcmdline_append(p, min(l, COMMAND_LINE_SIZE)); ++ *dt_bootargs = true; ++ } ++ ++ return 1; ++} ++ ++static void __init bootcmdline_init(char **cmdline_p) ++{ ++ bool dt_bootargs = false; ++ ++ /* ++ * If CMDLINE_OVERRIDE is enabled then initializing the command line is ++ * trivial - we simply use the built-in command line unconditionally & ++ * unmodified. ++ */ ++ if (IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) { ++ strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); ++ return; ++ } ++ ++ /* ++ * If the user specified a built-in command line & ++ * MIPS_CMDLINE_BUILTIN_EXTEND, then the built-in command line is ++ * prepended to arguments from the bootloader or DT so we'll copy them ++ * to the start of boot_command_line here. Otherwise, empty ++ * boot_command_line to undo anything early_init_dt_scan_chosen() did. ++ */ ++ if (IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND)) ++ strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); ++ else ++ boot_command_line[0] = 0; ++ ++ /* ++ * If we're configured to take boot arguments from DT, look for those ++ * now. ++ */ ++ if (IS_ENABLED(CONFIG_MIPS_CMDLINE_FROM_DTB)) ++ of_scan_flat_dt(bootcmdline_scan_chosen, &dt_bootargs); ++ ++ /* ++ * If we didn't get any arguments from DT (regardless of whether that's ++ * because we weren't configured to look for them, or because we looked ++ * & found none) then we'll take arguments from the bootloader. ++ * plat_mem_setup() should have filled arcs_cmdline with arguments from ++ * the bootloader. ++ */ ++ if (IS_ENABLED(CONFIG_MIPS_CMDLINE_DTB_EXTEND) || !dt_bootargs) ++ bootcmdline_append(arcs_cmdline, COMMAND_LINE_SIZE); ++ ++ /* ++ * If the user specified a built-in command line & we didn't already ++ * prepend it, we append it to boot_command_line here. ++ */ ++ if (IS_ENABLED(CONFIG_CMDLINE_BOOL) && ++ !IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND)) ++ bootcmdline_append(builtin_cmdline, COMMAND_LINE_SIZE); ++} + + /* + * arch_mem_init - initialize memory management subsystem +@@ -570,48 +647,12 @@ static void __init arch_mem_init(char **cmdline_p) + { + extern void plat_mem_setup(void); + +- /* +- * Initialize boot_command_line to an innocuous but non-empty string in +- * order to prevent early_init_dt_scan_chosen() from copying +- * CONFIG_CMDLINE into it without our knowledge. We handle +- * CONFIG_CMDLINE ourselves below & don't want to duplicate its +- * content because repeating arguments can be problematic. +- */ +- strlcpy(boot_command_line, " ", COMMAND_LINE_SIZE); +- + /* call board setup routine */ + plat_mem_setup(); + memblock_set_bottom_up(true); + +-#if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE) +- strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); +-#else +- if ((USE_PROM_CMDLINE && arcs_cmdline[0]) || +- (USE_DTB_CMDLINE && !boot_command_line[0])) +- strlcpy(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); +- +- if (EXTEND_WITH_PROM && arcs_cmdline[0]) { +- if (boot_command_line[0]) +- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); +- strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); +- } +- +-#if defined(CONFIG_CMDLINE_BOOL) +- if (builtin_cmdline[0]) { +- if (boot_command_line[0]) +- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); +- strlcat(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); +- } +- +- if (BUILTIN_EXTEND_WITH_PROM && arcs_cmdline[0]) { +- if (boot_command_line[0]) +- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); +- strlcat(boot_command_line, arcs_cmdline, COMMAND_LINE_SIZE); +- } +-#endif +-#endif ++ bootcmdline_init(cmdline_p); + strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); +- + *cmdline_p = command_line; + + parse_early_param(); From 5fc28ef47959c1256f2553d507224bb481b08494 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 46/97] ath79: Add support for Plasma Cloud PA300 Device specifications: * Qualcomm/Atheros QCA9533 v2 * 650/600/217 MHz (CPU/DDR/AHB) * 64 MB of RAM * 16 MB of SPI NOR flash (mx25l12805d) - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2x 10/100 Mbps Ethernet * 2T2R 2.4 GHz Wi-Fi * multi-color LED (controlled via red/green/blue GPIOs) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x fast ethernet - eth0 + Label: Ethernet 1 + 24V passive POE (mode B) + used as WAN interface - eth1 + Label: Ethernet 2 + 802.3af POE + builtin switch port 2 + used as LAN interface * 12-24V 1A DC * internal antennas Flashing instructions: The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the factory image to the u-boot when the device boots up. Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/files/ath79 | 3 + scripts/om-fwupgradecfg-gen.sh | 3 +- .../ath79/dts/qca9533_plasmacloud_pa300.dts | 8 + .../ath79/dts/qca9533_plasmacloud_pa300.dtsi | 140 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../lib/upgrade/dualboot_datachk.sh | 104 +++++++++++++ .../base-files/lib/upgrade/platform.sh | 7 + target/linux/ath79/image/generic.mk | 18 +++ 8 files changed, 283 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/qca9533_plasmacloud_pa300.dts create mode 100644 target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi create mode 100644 target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 39400a33a6..40fbc96a07 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -81,6 +81,9 @@ netgear,wndr4300tn|\ netgear,wndr4300sw) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" ;; +plasmacloud,pa300) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" + ;; qihoo,c301) ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" ;; diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index ce33454a24..98464c631b 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -7,7 +7,7 @@ # usage() { - echo "Usage: $0 " + echo "Usage: $0 " rm -f $CFG_OUT exit 1 } @@ -20,6 +20,7 @@ KERNEL_PATH=$3 ROOTFS_PATH=$4 case $CE_TYPE in + PA300|\ OM2P) MAX_PART_SIZE=7168 KERNEL_FLASH_ADDR=0x1c0000 diff --git a/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dts b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dts new file mode 100644 index 0000000000..8de89292ea --- /dev/null +++ b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_plasmacloud_pa300.dtsi" + +/ { + compatible = "plasmacloud,pa300", "qca,qca9533"; + model = "Plasma Cloud PA300"; +}; diff --git a/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi new file mode 100644 index 0000000000..0bc6d4fa28 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include + +/ { + chosen { + /delete-property/ bootargs; + }; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_green; + led-running = &led_status_green; + led-upgrade = &led_status_green; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + status_red { + label = "red:status"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + + led_status_green: status_green { + label = "green:status"; + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + }; + + status_blue { + label = "blue:status"; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + /* hw_margin_ms is actually 300s but driver limits it to 60s */ + hw_margin_ms = <60000>; + always-running; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + /* partitions are passed via bootloader */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x040000>; + }; + + partition@80000 { + label = "custom"; + reg = <0x080000 0x140000>; + read-only; + }; + + partition@1c0000 { + label = "inactive"; + reg = <0x1c0000 0x700000>; + }; + + partition@8c0000 { + label = "inactive2"; + reg = <0x8c0000 0x700000>; + }; + + art: partition@fc0000 { + label = "ART"; + reg = <0xfc0000 0x040000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + /* Workaround: keep the Ethernet interfaces order/mapping correct + * (GMAC0 -> eth0, GMAC1 -> eth1, same as in old ar71xx target) + */ + compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; + + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <2>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 766c0d0712..f868d8dc94 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -149,6 +149,7 @@ ath79_setup_interfaces() comfast,cf-e120a-v3|\ comfast,cf-e314n-v2|\ compex,wpj531-16m|\ + plasmacloud,pa300|\ tplink,cpe210-v1|\ tplink,cpe220-v2|\ tplink,cpe220-v3|\ diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh b/target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh new file mode 100644 index 0000000000..68733ccf15 --- /dev/null +++ b/target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh @@ -0,0 +1,104 @@ +# The U-Boot loader with the datachk patchset for dualbooting requires image +# sizes and checksums to be provided in the U-Boot environment. +# The devices come with 2 main partitions - while one is active +# sysupgrade will flash the other. The boot order is changed to boot the +# newly flashed partition. If the new partition can't be booted due to +# upgrade failures the previously used partition is loaded. + +platform_do_upgrade_dualboot_datachk() { + local tar_file="$1" + local restore_backup + local primary_kernel_mtd + + local setenv_script="/tmp/fw_env_upgrade" + + local inactive_mtd="$(find_mtd_index $PART_NAME)" + local inactive_offset="$(cat /sys/class/mtd/mtd${inactive_mtd}/offset)" + local total_size="$(cat /sys/class/mtd/mtd${inactive_mtd}/size)" + local flash_start_mem=0x9f000000 + + # detect to which flash region the new image is written to. + # + # 1. check what is the mtd index for the first flash region on this + # device + # 2. check if the target partition ("inactive") has the mtd index of + # the first flash region + # + # - when it is: the new bootseq will be 1,2 and the first region is + # modified + # - when it isnt: bootseq will be 2,1 and the second region is + # modified + # + # The detection has to be done via the hardcoded mtd partition because + # the current boot might be done with the fallback region. Let us + # assume that the current bootseq is 1,2. The bootloader detected that + # the image in flash region 1 is corrupt and thus switches to flash + # region 2. The bootseq in the u-boot-env is now still the same and + # the sysupgrade code can now only rely on the actual mtd indexes and + # not the bootseq variable to detect the currently booted flash + # region/image. + # + # In the above example, an implementation which uses bootseq ("1,2") to + # detect the currently booted image would assume that region 1 is booted + # and then overwrite the variables for the wrong flash region (aka the + # one which isn't modified). This could result in a device which doesn't + # boot anymore to Linux until it was reflashed with ap51-flash. + local next_boot_part="1" + case "$(board_name)" in + plasmacloud,pa300) + primary_kernel_mtd=3 + ;; + *) + echo "failed to detect primary kernel mtd partition for board" + return 1 + ;; + esac + [ "$inactive_mtd" = "$primary_kernel_mtd" ] || next_boot_part="2" + + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + local kernel_length=$(tar xf $tar_file ${board_dir}/kernel -O | wc -c) + local rootfs_length=$(tar xf $tar_file ${board_dir}/root -O | wc -c) + # rootfs without EOF marker + rootfs_length=$((rootfs_length-4)) + + local kernel_md5=$(tar xf $tar_file ${board_dir}/kernel -O | md5sum); kernel_md5="${kernel_md5%% *}" + # md5 checksum of rootfs with EOF marker + local rootfs_md5=$(tar xf $tar_file ${board_dir}/root -O | dd bs=1 count=$rootfs_length | md5sum); rootfs_md5="${rootfs_md5%% *}" + + # + # add tar support to get_image() to use default_do_upgrade() instead? + # + + # take care of restoring a saved config + [ -n "$UPGRADE_BACKUP" ] && restore_backup="${MTD_CONFIG_ARGS} -j ${UPGRADE_BACKUP}" + + mtd -q erase inactive + tar xf $tar_file ${board_dir}/root -O | mtd -n -p $kernel_length $restore_backup write - $PART_NAME + tar xf $tar_file ${board_dir}/kernel -O | mtd -n write - $PART_NAME + + # prepare new u-boot env + if [ "$next_boot_part" = "1" ]; then + echo "bootseq 1,2" > $setenv_script + else + echo "bootseq 2,1" > $setenv_script + fi + + printf "kernel_size_%i %i\n" $next_boot_part $((kernel_length / 1024)) >> $setenv_script + printf "vmlinux_start_addr 0x%08x\n" $((flash_start_mem + inactive_offset)) >> $setenv_script + printf "vmlinux_size 0x%08x\n" ${kernel_length} >> $setenv_script + printf "vmlinux_checksum %s\n" ${kernel_md5} >> $setenv_script + + printf "rootfs_size_%i %i\n" $next_boot_part $(((total_size-kernel_length) / 1024)) >> $setenv_script + printf "rootfs_start_addr 0x%08x\n" $((flash_start_mem+inactive_offset+kernel_length)) >> $setenv_script + printf "rootfs_size 0x%08x\n" ${rootfs_length} >> $setenv_script + printf "rootfs_checksum %s\n" ${rootfs_md5} >> $setenv_script + + # store u-boot env changes + mkdir -p /var/lock + fw_setenv -s $setenv_script || { + echo "failed to update U-Boot environment" + return 1 + } +} diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index f4fca06384..3ce273990f 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -5,6 +5,9 @@ PART_NAME=firmware REQUIRE_IMAGE_METADATA=1 +RAMFS_COPY_BIN='fw_printenv fw_setenv' +RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' + redboot_fis_do_upgrade() { local append local sysup_file="$1" @@ -47,6 +50,10 @@ platform_do_upgrade() { jjplus,ja76pf2) redboot_fis_do_upgrade "$1" linux ;; + plasmacloud,pa300) + PART_NAME="inactive" + platform_do_upgrade_dualboot_datachk "$1" + ;; ubnt,routerstation|\ ubnt,routerstation-pro) redboot_fis_do_upgrade "$1" kernel diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 333420c827..935dee75d7 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1579,6 +1579,24 @@ define Device/pisen_wmm003n endef TARGET_DEVICES += pisen_wmm003n +define Device/plasmacloud_pa300-common + SOC := qca9533 + DEVICE_VENDOR := Plasma Cloud + DEVICE_PACKAGES := uboot-envtools + IMAGE_SIZE := 7168k + BLOCKSIZE := 64k + IMAGES += factory.bin + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-to $$(BLOCKSIZE) + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA300 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata +endef + +define Device/plasmacloud_pa300 + $(Device/plasmacloud_pa300-common) + DEVICE_MODEL := PA300 +endef +TARGET_DEVICES += plasmacloud_pa300 + define Device/qihoo_c301 $(Device/seama) SOC := ar9344 From 17e592049005f3f7e65429966b21b2d834f9c2f0 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 23 Nov 2020 13:41:34 +0100 Subject: [PATCH 47/97] ath79: Add support for Plasma Cloud PA300E Device specifications: * Qualcomm/Atheros QCA9533 v2 * 650/600/217 MHz (CPU/DDR/AHB) * 64 MB of RAM * 16 MB of SPI NOR flash (mx25l12805d) - 2x 7 MB available; but one of the 7 MB regions is the recovery image * 2x 10/100 Mbps Ethernet * 2T2R 2.4 GHz Wi-Fi * multi-color LED (controlled via red/green/blue GPIOs) * 1x GPIO-button (reset) * external h/w watchdog (enabled by default) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x fast ethernet - eth0 + Label: Ethernet 1 + 24V passive POE (mode B) + used as WAN interface - eth1 + Label: Ethernet 2 + 802.3af POE + builtin switch port 2 + used as LAN interface * 12-24V 1A DC * external antennas Flashing instructions: The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the factory image to the u-boot when the device boots up. Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/files/ath79 | 3 ++- target/linux/ath79/dts/qca9533_plasmacloud_pa300e.dts | 8 ++++++++ .../linux/ath79/generic/base-files/etc/board.d/02_network | 1 + .../generic/base-files/lib/upgrade/dualboot_datachk.sh | 3 ++- .../ath79/generic/base-files/lib/upgrade/platform.sh | 3 ++- target/linux/ath79/image/generic.mk | 6 ++++++ 6 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 target/linux/ath79/dts/qca9533_plasmacloud_pa300e.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 40fbc96a07..496a27ceb2 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -81,7 +81,8 @@ netgear,wndr4300tn|\ netgear,wndr4300sw) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" ;; -plasmacloud,pa300) +plasmacloud,pa300|\ +plasmacloud,pa300e) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" ;; qihoo,c301) diff --git a/target/linux/ath79/dts/qca9533_plasmacloud_pa300e.dts b/target/linux/ath79/dts/qca9533_plasmacloud_pa300e.dts new file mode 100644 index 0000000000..1527a796bb --- /dev/null +++ b/target/linux/ath79/dts/qca9533_plasmacloud_pa300e.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_plasmacloud_pa300.dtsi" + +/ { + compatible = "plasmacloud,pa300e", "qca,qca9533"; + model = "Plasma Cloud PA300E"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index f868d8dc94..ac1fc4406d 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -150,6 +150,7 @@ ath79_setup_interfaces() comfast,cf-e314n-v2|\ compex,wpj531-16m|\ plasmacloud,pa300|\ + plasmacloud,pa300e|\ tplink,cpe210-v1|\ tplink,cpe220-v2|\ tplink,cpe220-v3|\ diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh b/target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh index 68733ccf15..002f5f9668 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/dualboot_datachk.sh @@ -45,7 +45,8 @@ platform_do_upgrade_dualboot_datachk() { # boot anymore to Linux until it was reflashed with ap51-flash. local next_boot_part="1" case "$(board_name)" in - plasmacloud,pa300) + plasmacloud,pa300|\ + plasmacloud,pa300e) primary_kernel_mtd=3 ;; *) diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 3ce273990f..98861685dc 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -50,7 +50,8 @@ platform_do_upgrade() { jjplus,ja76pf2) redboot_fis_do_upgrade "$1" linux ;; - plasmacloud,pa300) + plasmacloud,pa300|\ + plasmacloud,pa300e) PART_NAME="inactive" platform_do_upgrade_dualboot_datachk "$1" ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 935dee75d7..037d572d97 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1597,6 +1597,12 @@ define Device/plasmacloud_pa300 endef TARGET_DEVICES += plasmacloud_pa300 +define Device/plasmacloud_pa300e + $(Device/plasmacloud_pa300-common) + DEVICE_MODEL := PA300E +endef +TARGET_DEVICES += plasmacloud_pa300e + define Device/qihoo_c301 $(Device/seama) SOC := ar9344 From 8a891bfaa01d9592ea86c6b0cbbd5c04688c09f8 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 21 Nov 2020 22:27:11 +0100 Subject: [PATCH 48/97] ipq40xx: Change name for openmesh.sh to vendor-free name Other vendors are using functionality similar to the ones OpenMesh used to implement two areas on the flash to store the default image and a fallback image. So just change the name to dualboot_datachk.sh to avoid duplicated code just to have the same script for different vendors. Signed-off-by: Sven Eckelmann --- .../lib/upgrade/{openmesh.sh => dualboot_datachk.sh} | 8 ++++---- target/linux/ipq40xx/base-files/lib/upgrade/platform.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) rename target/linux/ipq40xx/base-files/lib/upgrade/{openmesh.sh => dualboot_datachk.sh} (94%) diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh similarity index 94% rename from target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh rename to target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh index 8e02186eb8..807a85d43c 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh @@ -1,11 +1,11 @@ -# The U-Boot loader of the OpenMesh devices requires image sizes and -# checksums to be provided in the U-Boot environment. -# The OpenMesh devices come with 2 main partitions - while one is active +# The U-Boot loader with the datachk patchset for dualbooting requires image +# sizes and checksums to be provided in the U-Boot environment. +# The devices come with 2 main partitions - while one is active # sysupgrade will flash the other. The boot order is changed to boot the # newly flashed partition. If the new partition can't be booted due to # upgrade failures the previously used partition is loaded. -platform_do_upgrade_openmesh() { +platform_do_upgrade_dualboot_datachk() { local tar_file="$1" local restore_backup local primary_kernel_mtd diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 09ea396469..0fbce92f3b 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -113,7 +113,7 @@ platform_do_upgrade() { openmesh,a42 |\ openmesh,a62) PART_NAME="inactive" - platform_do_upgrade_openmesh "$1" + platform_do_upgrade_dualboot_datachk "$1" ;; zyxel,nbg6617) zyxel_do_upgrade "$1" From ea5bb6bbfee06f44f714aff40c8929505face221 Mon Sep 17 00:00:00 2001 From: Marek Lindner Date: Sun, 25 Nov 2018 21:46:54 +0800 Subject: [PATCH 49/97] ipq40xx: add support for Plasma Cloud PA1200 Device specifications: * QCA IPQ4018 * 256 MB of RAM * 32 MB of SPI NOR flash (w25q256) - 2x 15 MB available; but one of the 15 MB regions is the recovery image * 2T2R 2.4 GHz - QCA4019 hw1.0 (SoC) - requires special BDF in QCA4019/hw1.0/board-2.bin with bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=PlasmaCloud-PA1200 * 2T2R 5 GHz - QCA4019 hw1.0 (SoC) - requires special BDF in QCA4019/hw1.0/board-2.bin with bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=PlasmaCloud-PA1200 * 3x GPIO-LEDs for status (cyan, purple, yellow) * 1x GPIO-button (reset) * 1x USB (xHCI) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x gigabit ethernet - phy@mdio4: + Label: Ethernet 1 + gmac0 (ethaddr) in original firmware + used as LAN interface - phy@mdio3: + Label: Ethernet 2 + gmac1 (eth1addr) in original firmware + 802.3af/at POE(+) + used as WAN interface * 12V/24V 1A DC Flashing instructions: The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the factory image to the u-boot when the device boots up. Signed-off-by: Marek Lindner [sven@narfation.org: prepare commit message, rebase, use all LEDs, switch to dualboot_datachk upgrade script, use eth1 as designated WAN interface] Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/files/ipq40xx | 3 +- package/firmware/ipq-wifi/Makefile | 2 + .../ipq-wifi/board-plasmacloud_pa1200.ipq4019 | Bin 0 -> 24324 bytes scripts/om-fwupgradecfg-gen.sh | 4 +- .../ipq40xx/base-files/etc/board.d/02_network | 3 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 + .../lib/upgrade/dualboot_datachk.sh | 1 + .../base-files/lib/upgrade/platform.sh | 3 +- .../arch/arm/boot/dts/qcom-ipq4018-pa1200.dts | 197 ++++++++++++++++++ target/linux/ipq40xx/image/Makefile | 16 ++ .../901-arm-boot-add-dts-files.patch | 3 +- 11 files changed, 228 insertions(+), 6 deletions(-) create mode 100644 package/firmware/ipq-wifi/board-plasmacloud_pa1200.ipq4019 create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx index 27aab6b286..9252c0ffac 100644 --- a/package/boot/uboot-envtools/files/ipq40xx +++ b/package/boot/uboot-envtools/files/ipq40xx @@ -36,7 +36,8 @@ edgecore,ecw5211 |\ glinet,gl-b1300 |\ luma,wrtq-329acn |\ openmesh,a42 |\ -openmesh,a62) +openmesh,a62 |\ +plasmacloud,pa1200) ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000" ;; buffalo,wtr-m2133hp) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 9aa6852046..e26269a710 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -42,6 +42,7 @@ ALLWIFIBOARDS:= \ linksys_mr8300-v0 \ luma_wrtq-329acn \ mobipromo_cm520-79f \ + plasmacloud_pa1200 \ qxwlan_e2600ac ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD)) @@ -120,6 +121,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) $(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300)) $(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN)) $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F)) +$(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200)) $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC)) $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE)))) diff --git a/package/firmware/ipq-wifi/board-plasmacloud_pa1200.ipq4019 b/package/firmware/ipq-wifi/board-plasmacloud_pa1200.ipq4019 new file mode 100644 index 0000000000000000000000000000000000000000..99d6df8c8c2bd6ed8058b290e00aef09d74dbfb8 GIT binary patch literal 24324 zcmeHPdsI_L8lQw9>e7`P0;1q0gzyMLfIu}!l&6$OiWC(Ix(L(>q9S>~8;9_t>s_PJ7Po>dw94lAD(#np7V5 zgPHl}oB3wG`DI9M?)}d2ZjRxEfFyjlL2}E=P8Ylr^p@$b%1u*xD!!-t;n`b;82OA22xVX4yPoB_3 zta;#H}EyIBdNpF;;3?$84VDKE+qhQr}n>MDxzg)tKjVW#m-QLBS8MHka%%E1&5 z>$TZ{lJ%9%ENl0%(%OXWVFdv>cUr3sWXSnjeNu1rSGH#y4X^SmX&>0!o^X_1?Ooc_ zRH{fQ3thh~Yvkna`nA%?%|2_s>Z?1m?kK-{+50yJYTMsE7F8RtWB7RazBSu<1xUh8 z*e_ki-|W5SQjhd(X4CRo|MKgf)trw$5Ln?|GP6*kq9qV;_gL_ow-zDZK8u(5FC*UY zNhS6k`!a#!zzZTQqtod$EO&E*AItM5#G|*NFvjoxhj{{&%MFIVA)KI~U``N+Q^1%H zubn9Ql@TZ`%+KX;0^zJb|NP{~=g+Y#AR#X#*kJqbkAL}rY{NP(^YoxI82^L)7Qq+H z=>PQTlYblfx_Su}I(R(-C#g8ltiuvEUu0xt#6*gW2oDYAa$(I0T0}TL7>C1gj%E!T z1VxY(GzE!8W04BQ{sV_TZf-qmsQ?`&dOV*{L=!SHsi-Z4i8A@j2TWusx|F|E?1g$E zerPJ1%1?ceie#hN{A_VDnv7(k0#v{kJP;tO&{h0Z;utgr5u%epXuGVdpo<7c*EOX| z1St|t#%rn?N9ZQ0Q@XjTgT?`wG6w5ok=(pd@5kPVKkCo-7pI|VkJFGGG>4xfjzi-f z$03PmB0o`VcoE2X$EQ#_$T>dbh@-hi3q?cDEl0riZpFu19XW-(rjR~btg6=jUS8EU z8?H&IHQ4j&Qz%g=*+78W8a9A2G0#bqOc07go7M;Egoa%VWJGn~$e^EMQ2DcM%8I(ho6rn9?O zH#mIl)))7_dFXfpaQKpSra1uo98}C~Bu+x{Gf;7ABXJ6fpMQ!4jl>D4;~?7fnEmL^ zwB0aE;UsV(e`YSX^4_NVLPV}(g?tM_y(=;qk~I-qT%TXERTFo z1N*pi(66I|fuHE$;Wan#Si}H}ZZSa8YIlJ6xVd{cCj@E~3IPg%IfsCeH*bx1|DS*U z{rm5}`!hskbz;Iwc&ilh?&r^A&>ube2eg^I^w{}ad~3Y> z=x9D4OW1h>cITXfpFF(27P%b15zm1q1y0edZ7_Rz_r!Ox5r-7l^6rUHObPUq6-Qvi z5ghEfheBrD8+6hh2JcdL{#i7){BU$K$fVc`Hev}zT~jS~L&p#GF< zk1Ssz)DLSrWim;wFmmh<+7_i;k}70l4!7=vg#o;qOj)2T7{8&{s1&mGl9l=!sy10w zX1Y)S9a@#U2#3)-VLUKCqVG`Ez;WLm8`NJ^)ypIjk$z02mhH`48}5hC@PTZzA*8W8 zFr@M8dbReTN-kSFc3I!0ZGz6Z`kShDSxshUxc}HS?I(Chfmlel?}qaLTu{E@4_p5d&b75nLYM(4m5)A`s zS1KeqLf-gQ{W(>YY+WW7bNJ#852AEstX*5JDpsbCUxSU+$}O^N80H0tWwH>3tr~5u zEG=^h?r;yT!4a8;m-q5SR^H!^YAm^PENC?9lE@NvES4{cA4hf2U4A z5mvus_ujUQL%hnRWu6(gySE=-tqk6|SaM-#@1@k%=th6V(BKYj_NnE+_uq4(v!FS4 zKU=ma_p82LEy)cb@+HNp!HwsIrvmGlvc|q*jo=8XV3u9$t!zvFh*!njc(-5Ln$!@y z%dfb8U}HyA{iHCx#SjFf1O50P81ywVPPxnaAiH-zUdv7`3yy?Su8D}#yd8ofylY2b8)^Gcq z-8j_3DFkK#0nJ5ITB49zge`?mvUebrN`YZ7k2X+u#|nrSmNAyI%9%6 z4`}I-w;z$ft(^Yrq#`s&0OQ3oATPe~Z0|i+@Z!zqb9UVp-=46)NzOesw`+O#y#oUS z#?vZ;hCfovW`lWeSJbgbL0KKwW`otN1XC rOFySJ_OYeE8t)#TTxZBN*d$#RxehZ=C5A;9at+>@oEz-3n|J?zwKcxt literal 0 HcmV?d00001 diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index 98464c631b..c5dcfb0018 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -7,7 +7,7 @@ # usage() { - echo "Usage: $0 " + echo "Usage: $0 " rm -f $CFG_OUT exit 1 } @@ -33,7 +33,7 @@ case $CE_TYPE in SIZE_FACTOR=1 SIZE_FORMAT="%d" ;; - A42) + A42|PA1200) MAX_PART_SIZE=15616 KERNEL_FLASH_ADDR=0x180000 SIZE_FACTOR=1024 diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 86787eeffd..b9e79c3b68 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -17,7 +17,8 @@ ipq40xx_setup_interfaces() alfa-network,ap120c-ac|\ engenius,emr3500|\ engenius,ens620ext|\ - luma,wrtq-329acn) + luma,wrtq-329acn|\ + plasmacloud,pa1200) ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; aruba,ap-303|\ diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index f33d3f331c..ade0d74341 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -101,6 +101,7 @@ case "$FIRMWARE" in luma,wrtq-329acn|\ openmesh,a42 |\ openmesh,a62 |\ + plasmacloud,pa1200 |\ qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2 |\ unielec,u4019-32m) @@ -198,6 +199,7 @@ case "$FIRMWARE" in luma,wrtq-329acn|\ openmesh,a42 |\ openmesh,a62 |\ + plasmacloud,pa1200 |\ qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2 |\ unielec,u4019-32m) diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh b/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh index 807a85d43c..60886071c9 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh @@ -44,6 +44,7 @@ platform_do_upgrade_dualboot_datachk() { # boot anymore to Linux until it was reflashed with ap51-flash. local next_boot_part="1" case "$(board_name)" in + plasmacloud,pa1200|\ openmesh,a42) primary_kernel_mtd=8 ;; diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 0fbce92f3b..22e9ffe114 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -111,7 +111,8 @@ platform_do_upgrade() { nand_do_upgrade "$1" ;; openmesh,a42 |\ - openmesh,a62) + openmesh,a62 |\ + plasmacloud,pa1200) PART_NAME="inactive" platform_do_upgrade_dualboot_datachk "$1" ;; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts new file mode 100644 index 0000000000..bcb9552ce7 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts @@ -0,0 +1,197 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2017-2020, Sven Eckelmann + * Copyright (c) 2018, Marek Lindner + */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Plasma Cloud PA1200"; + compatible = "plasmacloud,pa1200"; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2: usb2@60f8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 59 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + aliases { + led-boot = &led_status_purple; + led-failsafe = &led_status_yellow; + led-running = &led_status_cyan; + led-upgrade = &led_status_yellow; + }; + + leds { + compatible = "gpio-leds"; + + led_status_cyan: status_cyan { + label = "cyan:status"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + }; + + led_status_purple: status_purple { + label = "purple:status"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + led_status_yellow: status_yellow { + label = "yellow:status"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + }; + +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + /* partitions are passed via bootloader */ + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <2 0x20>; +}; + +&gmac1 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA1200"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA1200"; +}; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index b3f2d1f755..b0fde22813 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -648,6 +648,22 @@ define Device/openmesh_a62 endef TARGET_DEVICES += openmesh_a62 +define Device/plasmacloud_pa1200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := Plasma Cloud + DEVICE_MODEL := PA1200 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@pc.pa1200 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15616k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := uboot-envtools ipq-wifi-plasmacloud-pa1200 +endef +TARGET_DEVICES += plasmacloud_pa1200 + define Device/qcom_ap-dk01.1-c1 DEVICE_VENDOR := Qualcomm Atheros DEVICE_MODEL := AP-DK01.1 diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index 06dd135a59..8d725ebf9e 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,54 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,55 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -31,6 +31,7 @@ Signed-off-by: John Crispin + qcom-ipq4018-meshpoint-one.dtb \ + qcom-ipq4018-nbg6617.dtb \ + qcom-ipq4019-oap100.dtb \ ++ qcom-ipq4018-pa1200.dtb \ + qcom-ipq4018-rt-ac58u.dtb \ + qcom-ipq4018-wre6606.dtb \ + qcom-ipq4018-wrtq-329acn.dtb \ From 4871fd2616acb03fefe69b068955dba36eb00770 Mon Sep 17 00:00:00 2001 From: Marek Lindner Date: Fri, 14 Dec 2018 23:46:53 +0800 Subject: [PATCH 50/97] ipq40xx: add support for Plasma Cloud PA2200 Device specifications: * QCA IPQ4019 * 256 MB of RAM * 32 MB of SPI NOR flash (w25q256) - 2x 15 MB available; but one of the 15 MB regions is the recovery image * 2T2R 2.4 GHz - QCA4019 hw1.0 (SoC) - requires special BDF in QCA4019/hw1.0/board-2.bin with bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=PlasmaCloud-PA2200 * 2T2R 5 GHz (channel 36-64) - QCA9888 hw2.0 (PCI) - requires special BDF in QCA9888/hw2.0/board-2.bin bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=PlasmaCloud-PA2200 * 2T2R 5 GHz (channel 100-165) - QCA4019 hw1.0 (SoC) - requires special BDF in QCA4019/hw1.0/board-2.bin with bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=PlasmaCloud-PA2200 * GPIO-LEDs for 2.4GHz, 5GHz-SoC and 5GHz-PCIE * GPIO-LEDs for power (orange) and status (blue) * 1x GPIO-button (reset) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x gigabit ethernet - phy@mdio3: + Label: Ethernet 1 + gmac0 (ethaddr) in original firmware + used as LAN interface - phy@mdio4: + Label: Ethernet 2 + gmac1 (eth1addr) in original firmware + 802.3at POE+ + used as WAN interface * 12V 2A DC Flashing instructions: The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the factory image to the u-boot when the device boots up. Signed-off-by: Marek Lindner [sven@narfation.org: prepare commit message, rebase, use all LEDs, switch to dualboot_datachk upgrade script, use eth1 as designated WAN interface] Signed-off-by: Sven Eckelmann --- package/boot/uboot-envtools/files/ipq40xx | 3 +- package/firmware/ipq-wifi/Makefile | 2 + .../ipq-wifi/board-plasmacloud_pa2200.ipq4019 | Bin 0 -> 24324 bytes .../ipq-wifi/board-plasmacloud_pa2200.qca9888 | Bin 0 -> 12172 bytes scripts/om-fwupgradecfg-gen.sh | 4 +- .../ipq40xx/base-files/etc/board.d/02_network | 3 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 5 +- .../lib/upgrade/dualboot_datachk.sh | 1 + .../base-files/lib/upgrade/platform.sh | 3 +- .../arch/arm/boot/dts/qcom-ipq4019-pa2200.dts | 210 ++++++++++++++++++ target/linux/ipq40xx/image/Makefile | 16 ++ .../901-arm-boot-add-dts-files.patch | 3 +- 12 files changed, 243 insertions(+), 7 deletions(-) create mode 100644 package/firmware/ipq-wifi/board-plasmacloud_pa2200.ipq4019 create mode 100644 package/firmware/ipq-wifi/board-plasmacloud_pa2200.qca9888 create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx index 9252c0ffac..bcb4c5c962 100644 --- a/package/boot/uboot-envtools/files/ipq40xx +++ b/package/boot/uboot-envtools/files/ipq40xx @@ -37,7 +37,8 @@ glinet,gl-b1300 |\ luma,wrtq-329acn |\ openmesh,a42 |\ openmesh,a62 |\ -plasmacloud,pa1200) +plasmacloud,pa1200 |\ +plasmacloud,pa2200) ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000" ;; buffalo,wtr-m2133hp) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index e26269a710..dfb9e0feb3 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -43,6 +43,7 @@ ALLWIFIBOARDS:= \ luma_wrtq-329acn \ mobipromo_cm520-79f \ plasmacloud_pa1200 \ + plasmacloud_pa2200 \ qxwlan_e2600ac ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD)) @@ -122,6 +123,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300)) $(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN)) $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F)) $(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200)) +$(eval $(call generate-ipq-wifi-package,plasmacloud_pa2200,Plasma Cloud PA2200)) $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC)) $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE)))) diff --git a/package/firmware/ipq-wifi/board-plasmacloud_pa2200.ipq4019 b/package/firmware/ipq-wifi/board-plasmacloud_pa2200.ipq4019 new file mode 100644 index 0000000000000000000000000000000000000000..d1db0f5f4b8b734c0c43df38d9eedb0b84f72109 GIT binary patch literal 24324 zcmeHPdr(tX8b3S~>)Of<0TJRggb)%M0tBj2qdcWNQlPY=K}&)9AgNIv2E@<>J3bI2 zDp1NRg497?O%WOE6RfR$%qX)n`_In)(eCV{JG0K(9qmp#v%9$8$>oLwhy;Z;!2ObQ z&UYT)Ip6u+M{aU{Ij_e?2S>k|5Ehyo9FrQI9)~m<4Fbsz!7)Nn5OTFe8*}n<#km?) z@H=^`{9x72jiIJo?*5#@oj5BE6&L3es&e)n*qF9Ar%00%yLZ2KXK-4yR2mxU1buL! zKW@ldpE)@pmvUA_1{9&7Hi)tjTI%Kw3PNmzUJ5s9lSd*E4|j!7czF1aj~+S6*^AN7 ze>ojV2N&qz8RhnPyED{C=m`kajpoL;8lPW|4s)YXbet=4AAQj+u#dDpmPS6i$77v< zw$wZ>7f~;(YRIrzmL-vFH#fIMix#<92tv2;Ozjj;XlEI`Aa5D$?8e+|Ifywk$Cdo* zUVPe&iuGg$dz(*|?#fI~lnq{Pt}WGMzL^*^*xh`*s!;WM;+nx8(27*)iLd+&a`!7y zAR7F*xvDfbGZ8BLn$MJ~GSd<_4R+yXP$mO|lT{^|io^{jgRcXF(BP%!Q!v77iR%VG z0Ry$kpaVL|%S@IDp}U&W{LFM&=%_)UwSQCON4lRy zCF^ztW^j`4)E1V*MF)cfoA(xfDx?+@<)o}ZsT&yUB;a9v{WGYRc0lRiHJ+qR{r z@OZ1Cqo00y^ux#qegcw-0{p46|NijD?=8!4!&S@NoLyc22kn-_0UNV_{P^Jms_pZ8 z_4FR{d*OKmn&g*P_u_zC^UT8Kk|c-Ys3?uTjhmM@6ZfNfX zr5v={26G9_v7IOG6?b+Dg`Glaztm`ykIGH6!eZ6HyRNRr+q(hYO-&6fk|kl?V-Y^2 zkHkmePP!A`WDFT2iMba;B#}vyBt;Y%MI?|?QYw+&lM?I6^^*09P%@N|k!B|>{4unf zOAYOa#3B#~I@$pC$y7cTu~^*OA@Ih+<#OAad?r_+j?1MwgIFM-%zUs=X7n`Wa`TL5 zQT3WiIAg+^N-X*sv*K7-d5|6tJqTaYSK_OPC1W4P63Jw;Bv}zohCd7^Hjo=68x(;2 ziH1@9DV@Vzg20#3s}zz--1|Uf6_+p*IjXjX*48eD3C-F!Wl6 zfaes8kCsW*$*z}YEt?O|q|6-bIr3<3-S3<3-S z3<3)nffdpf#A?>7(pQO8)>`RWB9gU)7L=Y_)87BNWo-JcJ?&`X7%$K=V`D7fL&!{h zng~3eAk*w%wwl|?T9~gZ35p$g`hoihL3&W%HgJD@DhY<4OoN1cF6o#WI2RNo6o7vY zs)2i>{yC&JTbI>L^&5o<08EjcHIdp5U{%J?7HMbknP3*OcxgP5!dfF;Lu_JYHsRMq zWBPNBPUp%4&vbeBVRrHE*{htKfOLQGjEM#A*#@X&1Ap6%LI+q(Pv_k$XN`A%net#P zo-N)zNsNtw5XFCYTkNvP)y#lL=*pAn((&!!-CGU|<632(CBtU35e~EfQwHHc%QW*Z zg3zYVn(}NKMzP!2zhmF_tSK?JT1{QPAeVEQNl$%Z zAmo53+2c0ThCzTqfI(ocA~43ApNx0^pMU)IPv3p_2bdhi#mBt+C;$BWpC3H<8p%ia_WaQufnt3k%Jm=k;>GtCk^RG8I=`Uq=DKo;mw<6nH^6qI@W|98BK!&jA zHxvqa%h&`Cbso%mjPG%loO`T4C+$7}e(An--~9FB_hyY&@R(1NZ~KSp48^((WyrVJ zhMEm!x-6w^=!&6USD=iS1q}5YFX(k@rHq6BD|YjCpb&vUtwF2XqLd8x8PDqXtJ9S- zqR9lUw4O)FRxMVOK z)fecL#!H4)wI(527BYOp*sd>CZ&v_7gZwD3z+E}eT38)h zCf0bRfBi|)Npb1Q-R@hv`u4QN*YFRqcQSYt8?9(|SBGI!H19037*c*71HTz@}5o?ixXm|Zv~a^h*){gN45v!6Hy zO}l?##>SWgex`^)U{VAo(C#0PYi2L$W2W1Ub7P@pr{di^=3X<5S2MK>kfWdPTtqkx zxa?iZfwU!6x6+b-e*t!(8D3#rz=fJS#Fs3ug^bamfDpp1&mas4TC3>5!V%OW{@}~DxbUGEL%{N9 zrimrbA*sgrE6Bl$&A16xnGDl$(`KBECzE8x_T)!?WTt=m)4%+~^?359sJl8J7D$Sv z2DeUg&uMqxecyfG-FcQ3WUzLn>9_sBJI9zS+>m2IutnV8f?kP3b>2zAH z1jSIGc#5(s4H5~txoy--A{EH4MOg;`!*3=b0f0;Zk}9x}w0adTmZQ5H;7|ZmR8%~E z^a$vsKLf#FutrF$q{}_xuK#^`OK+$r3639JZi`)C3r;G4qOKts%>~US40w#Vnooo& zK@CVrNm;#mb#ijDL?Yn@0B$AFBOh&zq&O)JT)LD7%o6?z?*+?Csi|37UEVmJdRA5z zz)3((P7c6HKze#Qz$s3orN!CsN6-xKnP>RV2Rw$5khka%4_zWlFNCFdf{JZK21Eu# z1`=i9x<>+1C6c7%RP;eYJpN2a59j^*n{RR3Z-aB_nd;-96eWBK{)dBx;Qe4na1EFT z)94bg2FwM|qtu4l&IHdcw)c8R+AS95H#Er1Ont<+ri(XiR4O;1iZtcPcMA*INaA%^ zxjsE5DLMIHNSA^hUXgzX@1K#8^wj^rf%Z0DCzFLePw~N5Ah*xj-Loi;{e*iKCmgaQ z3~Du11R++ud{VUO6ObV4U>#8o%L)7NkrTgnxhMRBaB)!p`lt9?LIMd%4SAO&WKgD& zF_|!v$b$xG&=~F-h(_3`X=G|)En$Q@sMF}~>WE5Msi|bNP)pEov2WkA@hlM+$E4RU zj!G0G)+ZiHvS8N3EMgs8r&-6;!}^EygbA87CZ+;bJggw9V3nqd;nyQP4|T;;|HAWV zd-sRxm|eDKFBVax=f&p&>{;sw-IAwv_}NLLjc&~=;cl=_YaiW6mHR$)xLAjACtdp; z0#H#Z!2OAxzz){3! z>p`xTyjPIKS%+vd^-JGP#~Jph@ztje#VQK;ZaCalo6$;@a5Jn6xiVBa3gSXNpdf)c z&dm;5Ep)}=kbKjehqYss?~e{AJ8Cr1l_-dlJ!0HJR|l^8#vL}c-KYsU6sy$0=jSHa zH?RYD)!}B38=L5Dfe$#29k902y4&yj-sTRo79+*aL8StLS2%>h?w(1Hair{^+>%i_cljt+IaJt{ZJxZ+ zex~NAyqkRW%#_t#b83T4YMq%Ja%~wKv~>$UO0d@^e8u%Gl!&wcv!KOQ`I5M=~WLaw+fSC>m{Ah+wb6FbN)x-CQv znJNJ6>^kfJ=uUVpy!t0rM)r{=V8!}aabm=P|F;Z0dGh4(-R`FjAMa+I5%zqhqjh}&A2p15pA_!iI z=meh^RWiHKm+SQWSFuV}(Wb)xW#Uin__I3xbdE7wcJ1!yv2osW7pJDL-I$%5zxByy zpMP~PaRX2k78WTGBA#1|)asHVgb0HSLWK+=!mxr06h03lA|x6q#E39RrBV_j!T>_& zpbY60PC`Rxpp3yOoPvhVKN+1s7$ z5)(H>#Qu>gV(zOIG$g)7WA5FUhIr15o7?staG$?26ZrG(FJj5^q9VDll;N@x{SSqp z&rv9Ho+k_TA6kar^Wk#%EsyVWp`V!Yf|QU$xkk=NLBm1=!9YgCFb!by!e&Ab^%_01 xIm-LBT#n-^l{n7{%{e^B+W5eKZ}DGJQYrQc&-oaUzh>>1@fF!aWXqRd^Ka5;p}hbA literal 0 HcmV?d00001 diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index c5dcfb0018..bf7c047c5b 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -7,7 +7,7 @@ # usage() { - echo "Usage: $0 " + echo "Usage: $0 " rm -f $CFG_OUT exit 1 } @@ -39,7 +39,7 @@ case $CE_TYPE in SIZE_FACTOR=1024 SIZE_FORMAT="0x%08x" ;; - A62) + A62|PA2200) MAX_PART_SIZE=15552 KERNEL_FLASH_ADDR=0x1a0000 SIZE_FACTOR=1024 diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index b9e79c3b68..4361b7c395 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -18,7 +18,8 @@ ipq40xx_setup_interfaces() engenius,emr3500|\ engenius,ens620ext|\ luma,wrtq-329acn|\ - plasmacloud,pa1200) + plasmacloud,pa1200|\ + plasmacloud,pa2200) ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; aruba,ap-303|\ diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index ade0d74341..e50732586a 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -36,7 +36,8 @@ case "$FIRMWARE" in ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x32) ;; engenius,eap2200 |\ - openmesh,a62) + openmesh,a62 |\ + plasmacloud,pa2200) caldata_extract "0:ART" 0x9000 0x2f20 ;; linksys,ea8300 |\ @@ -102,6 +103,7 @@ case "$FIRMWARE" in openmesh,a42 |\ openmesh,a62 |\ plasmacloud,pa1200 |\ + plasmacloud,pa2200 |\ qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2 |\ unielec,u4019-32m) @@ -200,6 +202,7 @@ case "$FIRMWARE" in openmesh,a42 |\ openmesh,a62 |\ plasmacloud,pa1200 |\ + plasmacloud,pa2200 |\ qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2 |\ unielec,u4019-32m) diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh b/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh index 60886071c9..81418fe0ba 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/dualboot_datachk.sh @@ -48,6 +48,7 @@ platform_do_upgrade_dualboot_datachk() { openmesh,a42) primary_kernel_mtd=8 ;; + plasmacloud,pa2200|\ openmesh,a62) primary_kernel_mtd=10 ;; diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 22e9ffe114..e43225cbb2 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -112,7 +112,8 @@ platform_do_upgrade() { ;; openmesh,a42 |\ openmesh,a62 |\ - plasmacloud,pa1200) + plasmacloud,pa1200 |\ + plasmacloud,pa2200) PART_NAME="inactive" platform_do_upgrade_dualboot_datachk "$1" ;; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts new file mode 100644 index 0000000000..2d0655114b --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts @@ -0,0 +1,210 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2017-2020, Sven Eckelmann + * Copyright (c) 2018, Marek Lindner + */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "Plasma Cloud PA2200"; + compatible = "plasmacloud,pa2200"; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + switch_lan_bmp = <0x10>; + switch_wan_bmp = <0x20>; + + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + aliases { + led-boot = &led_power_orange; + led-failsafe = &led_status_blue; + led-running = &led_power_orange; + led-upgrade = &led_status_blue; + }; + + leds { + compatible = "gpio-leds"; + + led_power_orange: power_orange { + label = "orange:power"; + gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; + }; + + 2g_blue { + label = "blue:2g"; + gpios = <&tlmm 46 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + 2g_green { + label = "green:5g1"; + gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + 5g2_green { + label = "green:5g2"; + gpios = <&tlmm 48 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy2tpt"; + }; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio13", "gpio14", "gpio15"; + drive-strength = <12>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + /* partitions are passed via bootloader */ + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x10>; +}; + +&pcie0 { + status = "okay"; + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi2: wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; + ieee80211-freq-limit = <5170000 5350000>; + }; + }; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "PlasmaCloud-PA2200"; + ieee80211-freq-limit = <5470000 5875000>; +}; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index b0fde22813..86bf5a2ccb 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -664,6 +664,22 @@ define Device/plasmacloud_pa1200 endef TARGET_DEVICES += plasmacloud_pa1200 +define Device/plasmacloud_pa2200 + $(call Device/FitImageLzma) + DEVICE_VENDOR := Plasma Cloud + DEVICE_MODEL := PA2200 + SOC := qcom-ipq4019 + DEVICE_DTS_CONFIG := config@pc.pa2200 + BLOCKSIZE := 64k + KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE) + IMAGE_SIZE := 15552k + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200 + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200 uboot-envtools +endef +TARGET_DEVICES += plasmacloud_pa2200 + define Device/qcom_ap-dk01.1-c1 DEVICE_VENDOR := Qualcomm Atheros DEVICE_MODEL := AP-DK01.1 diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index 8d725ebf9e..c4502aa3f7 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,55 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,56 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -52,6 +52,7 @@ Signed-off-by: John Crispin + qcom-ipq4019-e2600ac-c1.dtb \ + qcom-ipq4019-e2600ac-c2.dtb \ + qcom-ipq4019-habanero-dvk.dtb \ ++ qcom-ipq4019-pa2200.dtb \ + qcom-ipq4019-rtl30vw.dtb \ + qcom-ipq4019-u4019-32m.dtb \ + qcom-ipq4019-wpj419.dtb \ From 817bf0204569ca28121576c13f48186ed7b7c2ae Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Mon, 16 Nov 2020 16:54:54 +0100 Subject: [PATCH 51/97] ath79: add support for MikroTik RouterBOARD wAPR-2nD (wAP R) This patch adds support for the MikroTik RouterBOARD wAPR-2nD (wAP R) router, a weatherproof 2.4 GHz access point with a miniPCI-e slot and a SIM card slot. Specifications: - SoC: Qualcomm Atheros QCA9533 - Flash: 16 MB (SPI) - RAM: 64 MB - Ethernet: 1x 10/100 Mbps (PoE in) - WiFi: AR9531 2T2R 2.4 GHz (SoC) - miniPCI-e slot - 4x green LEDs (1x WiFi, 3x RSSI) - 1x reset button See https://mikrotik.com/product/RBwAPR-2nD for more details. Flashing: TFTP boot initramfs image and then perform sysupgrade. Follow common MikroTik procedure as in https://openwrt.org/toh/mikrotik/common. Signed-off-by: Roger Pueyo Centelles --- .../qca9533_mikrotik_routerboard-wapr-2nd.dts | 71 +++++++++++++++++++ target/linux/ath79/image/mikrotik.mk | 9 +++ .../mikrotik/base-files/etc/board.d/01_leds | 6 ++ .../base-files/etc/board.d/02_network | 6 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 3 +- 5 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts new file mode 100644 index 0000000000..ba674c13d8 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wapr-2nd.dts @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_mikrotik_routerboard-16m.dtsi" + +/ { + compatible = "mikrotik,routerboard-wapr-2nd", "qca,qca9533"; + model = "MikroTik RouterBOARD wAPR-2nD (wAP R)"; + + aliases { + led-boot = &led_rssilow; + led-failsafe = &led_rssilow; + led-upgrade = &led_rssilow; + led-running = &led_rssilow; + serial0 = &uart; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + + led_rssilow: rssilow { + label = "green:rssilow"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + rssimedium { + label = "green:rssimedium"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "green:rssihigh"; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + minipcie { + gpio-export,name = "minipcie"; + gpio-export,output = <1>; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; +}; + +&pcie0 { + status = "okay"; +}; diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index 3752c891a7..b7d745bc77 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -53,3 +53,12 @@ define Device/mikrotik_routerboard-wap-g-5hact2hnd SUPPORTED_DEVICES += rb-wapg-5hact2hnd endef TARGET_DEVICES += mikrotik_routerboard-wap-g-5hact2hnd + +define Device/mikrotik_routerboard-wapr-2nd + $(Device/mikrotik_nor) + SOC := qca9533 + DEVICE_MODEL := RouterBOARD wAPR-2nD (wAP R) + DEVICE_PACKAGES += rssileds + IMAGE_SIZE := 16256k +endef +TARGET_DEVICES += mikrotik_routerboard-wapr-2nd diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds index 60dcef4ff6..0d3209c2e3 100755 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds @@ -10,6 +10,12 @@ case "$board" in mikrotik,routerboard-lhg-2nd) ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" ;; +mikrotik,routerboard-wapr-2nd) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimedium" "rssimedium" "green:rssimedium" "wlan0" "33" "100" + ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "66" "100" + ;; mikrotik,routerboard-sxt-5nd-r2) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100" diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index 6bc4822551..584acc0feb 100755 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -19,7 +19,8 @@ ath79_setup_interfaces() mikrotik,routerboard-922uags-5hpacd|\ mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ - mikrotik,routerboard-wap-g-5hact2hnd) + mikrotik,routerboard-wap-g-5hact2hnd|\ + mikrotik,routerboard-wapr-2nd) ucidef_set_interface_lan "eth0" ;; *) @@ -40,7 +41,8 @@ ath79_setup_macs() mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ - mikrotik,routerboard-wap-g-5hact2hnd) + mikrotik,routerboard-wap-g-5hact2hnd|\ + mikrotik,routerboard-wapr-2nd) label_mac="$mac_base" lan_mac="$mac_base" ;; diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index f2cb1f774f..7ef6fdbe0f 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -24,7 +24,8 @@ case "$FIRMWARE" in "ath9k-eeprom-ahb-18100000.wmac.bin") case $board in mikrotik,routerboard-lhg-2nd|\ - mikrotik,routerboard-sxt-5nd-r2) + mikrotik,routerboard-sxt-5nd-r2|\ + mikrotik,routerboard-wapr-2nd) caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +1) ;; mikrotik,routerboard-wap-g-5hact2hnd) From 491ae3357e10be46ff6342cad5d2f820bf2cd9f9 Mon Sep 17 00:00:00 2001 From: Roman Kuzmitskii Date: Sun, 4 Oct 2020 05:43:41 +0000 Subject: [PATCH 52/97] ath79: add support for Ubiquiti airCube AC The Ubiquiti Network airCube AC is a cube shaped device supporting 2.4 GHz and 5 GHz with internal 2x2 MIMO antennas. It can be powered with either one of: - 24v power supply with 3.0mm x 1.0mm barrel plug - 24v passive PoE on first LAN port There are four 10/100/1000 Mbps ports (1 * WAN + 3 * LAN). First LAN port have optional PoE passthrough to the WAN port. SoC: Qualcomm / Atheros AR9342 RAM: 64 MB DDR2 Flash: 16 MB SPI NOR Ethernet: 4x 10/100/1000 Mbps (1 WAN + 3 LAN) LEDS: 1x via a SPI controller (not yet supported) Buttons: 1x Reset Serial: 1x (only RX and TX); 115200 baud, 8N1 Missing features: - LED control is not supported Physical to internal switch port mapping: - physical port #1 (poe in) = switchport 2 - physical port #2 = switchport 3 - physical port #3 = switchport 5 - physical port #4 (wan/poe out) = switchport 4 Factory update is tested and is the same as for Ubiquiti AirCube ISP hence the shared configuration between that devices. Signed-off-by: Roman Kuzmitskii --- .../ath79/dts/ar9342_ubnt_aircube-ac.dts | 117 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 4 + .../base-files/etc/board.d/03_gpio_switches | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + target/linux/ath79/image/generic-ubnt.mk | 23 +++- tools/firmware-utils/src/mkfwimage.c | 2 +- 6 files changed, 142 insertions(+), 6 deletions(-) create mode 100644 target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts diff --git a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts new file mode 100644 index 0000000000..8e0955e182 --- /dev/null +++ b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + compatible = "ubnt,aircube-ac", "qca,ar9342"; + model = "Ubiquiti airCube AC"; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xf60000>; + }; + + partition@fb0000 { + label = "cfg"; + reg = <0xfb0000 0x040000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <4>; + phy0: ethernet-phy@0 { + phy-mode = "rgmii"; + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + /* default for ar934x, except for 1000M and 10M */ + pll-data = <0x06000000 0x00000101 0x00001313>; + + mtd-mac-address = <&art 0x0>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; + + gmac-config { + device = <&gmac>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index ac1fc4406d..103da30379 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -376,6 +376,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0" ;; + ubnt,aircube-ac) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:1" "3:lan:2" "5:lan:3" "4:wan" + ;; ubnt,aircube-isp) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ diff --git a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches index 8ec0af53d4..b3e0d0dd31 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches @@ -73,6 +73,7 @@ tplink,wbs510-v1|\ tplink,wbs510-v2) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20" ;; +ubnt,aircube-ac|\ ubnt,aircube-isp) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" ;; 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 5a38e7f421..23cd4497ba 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 @@ -26,6 +26,7 @@ case "$FIRMWARE" in qxwlan,e1700ac-v2-16m|\ qxwlan,e600gac-v2-8m|\ qxwlan,e600gac-v2-16m|\ + ubnt,aircube-ac|\ ubnt,unifiac-lite|\ ubnt,unifiac-lr|\ ubnt,unifiac-mesh|\ diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index c347bd1cf1..710ab54772 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -110,15 +110,28 @@ define Device/ubnt-xw UBNT_VERSION := 6.0.4 endef -define Device/ubnt_aircube-isp +define Device/ubnt-acb $(Device/ubnt) - SOC := qca9533 - DEVICE_MODEL := airCube ISP IMAGE_SIZE := 15744k - UBNT_BOARD := ACB-ISP - UBNT_CHIP := qca9533 + UBNT_BOARD := ACB UBNT_TYPE := ACB UBNT_VERSION := 2.5.0 +endef + +define Device/ubnt_aircube-ac + $(Device/ubnt-acb) + SOC := ar9342 + DEVICE_MODEL := airCube AC + UBNT_CHIP := ar9342 + DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct +endef +TARGET_DEVICES += ubnt_aircube-ac + +define Device/ubnt_aircube-isp + $(Device/ubnt-acb) + SOC := qca9533 + DEVICE_MODEL := airCube ISP + UBNT_CHIP := qca9533 SUPPORTED_DEVICES += ubnt,acb-isp endef TARGET_DEVICES += ubnt_aircube-isp diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c index 591ce44a78..5b749a3f66 100644 --- a/tools/firmware-utils/src/mkfwimage.c +++ b/tools/firmware-utils/src/mkfwimage.c @@ -148,7 +148,7 @@ struct fw_info fw_info[] = { .sign = true, }, { - .name = "ACB-ISP", + .name = "ACB", .fw_layout = { .kern_start = 0x9f050000, .kern_entry = 0x80002000, From 8ec997d0063bbc1ac41d1025f4c94ae6337899fa Mon Sep 17 00:00:00 2001 From: Sebastian Schaper Date: Tue, 29 Sep 2020 20:02:17 +0200 Subject: [PATCH 53/97] ath79: add support for D-Link DAP-2660 A1 Specifications: * QCA9557, 16 MiB Flash, 128 MiB RAM, 802.11n 2T2R * QCA9882, 802.11ac 2T2R * Gigabit LAN Port (AR8035), 802.11af PoE Installation: * Factory Web UI is at 192.168.0.50 login with 'admin' and blank password, flash factory.bin * Recovery Web UI is at 192.168.0.50 connect network cable, hold reset button during power-on and keep it pressed until uploading has started (only required when checksum is ok, e.g. for reverting back to oem firmware), flash factory.bin After flashing factory.bin, additional free space can be reclaimed by flashing sysupgrade.bin, since the factory image requires some padding to be accepted for upgrading via OEM Web UI. Signed-off-by: Sebastian Schaper --- .../ath79/dts/qca9557_dlink_dap-2660-a1.dts | 89 +++++++++++++++++++ .../ath79/dts/qca95xx_dlink_dap-2xxx.dtsi | 54 +++++++++++ .../generic/base-files/etc/board.d/02_network | 4 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 + .../etc/uci-defaults/09_fix-checksum | 1 + target/linux/ath79/image/generic.mk | 22 +++++ 7 files changed, 175 insertions(+) create mode 100644 target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts create mode 100644 target/linux/ath79/dts/qca95xx_dlink_dap-2xxx.dtsi diff --git a/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts new file mode 100644 index 0000000000..1a2974a688 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" +#include "qca95xx_dlink_dap-2xxx.dtsi" + +/ { + compatible = "dlink,dap-2660-a1", "qca,qca9557"; + model = "D-Link DAP-2660 A1"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_red; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_red: power_red { + label = "red:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; +}; + +&partitions { + partition@70000 { + label = "firmware"; + reg = <0x70000 0xee0000>; + compatible = "wrg"; + }; + + partition@f50000 { + label = "dlink"; + reg = <0xf50000 0xa0000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@4 { + reg = <0x4>; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x82000000 0x80000101 0x80001313>; + + phy-handle = <&phy0>; + phy-mode = "rgmii-id"; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + rxd-delay = <3>; + rxdv-delay = <3>; + }; +}; + +&pcie0 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca95xx_dlink_dap-2xxx.dtsi b/target/linux/ath79/dts/qca95xx_dlink_dap-2xxx.dtsi new file mode 100644 index 0000000000..82d50b85e8 --- /dev/null +++ b/target/linux/ath79/dts/qca95xx_dlink_dap-2xxx.dtsi @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "bdcfg"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "rgdb"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "unused"; + reg = <0x60000 0x10000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 103da30379..3ea0815ff2 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -476,6 +476,10 @@ ath79_setup_macs() lan_mac=$(mtd_get_mac_text "mp" 0x1) label_mac=$lan_mac ;; + dlink,dap-2660-a1) + lan_mac=$(mtd_get_mac_ascii bdcfg "lanmac") + label_mac=$lan_mac + ;; dlink,dap-2695-a1) label_mac=$(mtd_get_mac_ascii bdcfg "wlanmac") ;; 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 23cd4497ba..e492c5f542 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 @@ -52,6 +52,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) -1) ;; + dlink,dap-2660-a1|\ dlink,dap-2695-a1) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index b592da00e3..f382e255f1 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -22,6 +22,10 @@ case "$board" in dlink,dch-g020-a1) mtd_get_mac_text "mp" 0x13 > /sys${DEVPATH}/macaddress ;; + dlink,dap-2660-a1) + [ "$PHYNBR" -eq 1 ] && \ + mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress + ;; iodata,wn-ac1600dgr) # There is no eeprom data for 5 GHz wlan in "art" partition # which would allow to patch the macaddress diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum index 74c608b96d..9a2cca79a1 100644 --- a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum @@ -13,6 +13,7 @@ fixwrgg() { board=$(board_name) case "$board" in +dlink,dap-2660-a1|\ dlink,dap-2695-a1) fixwrgg ;; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 037d572d97..e1b0c4c1e1 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -738,6 +738,28 @@ define Device/dlink_dap-1365-a1 endef TARGET_DEVICES += dlink_dap-1365-a1 +define Device/dlink_dap-2xxx + IMAGES += factory.img sysupgrade.bin + IMAGE/factory.img := append-kernel | pad-offset 6144k 160 | \ + append-rootfs | wrgg-pad-rootfs | mkwrggimg | check-size + IMAGE/sysupgrade.bin := append-kernel | mkwrggimg | \ + pad-to $$$$(BLOCKSIZE) | append-rootfs | append-metadata | check-size + KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma + KERNEL_INITRAMFS := $$(KERNEL) | mkwrggimg +endef + +define Device/dlink_dap-2660-a1 + $(Device/dlink_dap-2xxx) + SOC := qca9557 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DAP-2660 + DEVICE_VARIANT := A1 + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct + IMAGE_SIZE := 15232k + DAP_SIGNATURE := wapac09_dkbs_dap2660 +endef +TARGET_DEVICES += dlink_dap-2660-a1 + define Device/dlink_dap-2695-a1 SOC := qca9558 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct From 40437b18f41918d7bbbb7da986b8842bf82f9ff0 Mon Sep 17 00:00:00 2001 From: Andrew Pikler Date: Mon, 5 Oct 2020 17:13:38 +0300 Subject: [PATCH 54/97] firmware: add tool for signing d-link ru router factory firmware images Some Russian d-link routers require that their firmware be signed with a salted md5 checksum followed by the bytes 0x00 0xc0 0xff 0xee. This tool signs factory images the OEM's firmware accepts them. Signed-off-by: Andrew Pikler --- target/linux/ramips/image/Makefile | 5 + tools/firmware-utils/Makefile | 1 + tools/firmware-utils/src/sign_dlink_ru.c | 225 +++++++++++++++++++++++ 3 files changed, 231 insertions(+) create mode 100644 tools/firmware-utils/src/sign_dlink_ru.c diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 309ccbdf90..4274c24884 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -148,6 +148,11 @@ define Build/sercom-seal $(1) endef +define Build/sign-dlink-ru + sign_dlink_ru $@ $1 $2 + mv $@.new $@ +endef + define Build/trx $(STAGING_DIR_HOST)/bin/trx $(1) \ -o $@ \ diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 9a68b80c71..6074ecc608 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -84,6 +84,7 @@ define Host/Compile $(call cc,pc1crypt) $(call cc,ptgen cyg_crc32) $(call cc,seama md5) + $(call cc,sign_dlink_ru md5,-Wall) $(call cc,spw303v) $(call cc,srec2bin) $(call cc,tplink-safeloader md5,-Wall --std=gnu99) diff --git a/tools/firmware-utils/src/sign_dlink_ru.c b/tools/firmware-utils/src/sign_dlink_ru.c new file mode 100644 index 0000000000..9c02ed50af --- /dev/null +++ b/tools/firmware-utils/src/sign_dlink_ru.c @@ -0,0 +1,225 @@ +/* + * This program is designed to sign firmware images so they are accepted + * by D-Link DIR-882 R1 WebUIs. + * + * Copyright (C) 2020 Andrew Pikler + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "md5.h" + +#define BUF_SIZE 4096 +#define MD5_HASH_LEN 16 + + +typedef struct _md5_digest_t { + uint8_t digest[MD5_HASH_LEN]; +} md5_digest_t; + +typedef struct _salt_t { + char* salt_ascii; + uint8_t* salt_bin; + size_t salt_bin_len; +} salt_t; + +void read_file_bytes(FILE* f, MD5_CTX* md5_ctx) { + uint8_t buf[BUF_SIZE]; + size_t bytes_read; + rewind(f); + + while (0 != (bytes_read = fread(buf, sizeof(uint8_t), BUF_SIZE, f))) { + MD5_Update(md5_ctx, buf, bytes_read); + } + + if (!feof(f)) { + printf("Error: expected to be at EOF\n"); + exit(-1); + } +} + +void add_magic_bytes(FILE* f) { + char magic_bytes[] = { 0x00, 0xc0, 0xff, 0xee }; + size_t magic_bytes_len = 4; + fwrite(magic_bytes, magic_bytes_len, 1, f); +} + +/** + * Add the signature produced by this salt to the file + * The signature consists by creating an MD5 digest wht the salt bytes plus + * all of the bytes in the firmware file, then adding the magic bytes to the + * file + */ +void add_signature(FILE* f, salt_t* salt) { + md5_digest_t digest; + MD5_CTX md5_context; + + MD5_Init(&md5_context); + MD5_Update(&md5_context, salt->salt_bin, salt->salt_bin_len); + read_file_bytes(f, &md5_context); + MD5_Final(digest.digest, &md5_context); + + fwrite(&digest.digest, sizeof(uint8_t), MD5_HASH_LEN, f); + add_magic_bytes(f); +} + +void add_version_suffix(FILE* f) { + char* version_suffix = "c0ffeef0rge"; + fseek(f, 0, SEEK_END); + fwrite(version_suffix, sizeof(char), strlen(version_suffix), f); +} + +int asciihex_to_int(char c) { + if(c >= '0' && c <= 'F') + return c - '0'; + + if(c >= 'a' && c <= 'f') + return 10 + c - 'a'; + return -1; +} + +/** + * Verify this is a valid hex string to convert + */ +void verify_valid_hex_str(char* s) { + int i; + int s_len = strlen(s); + if (s_len == 0) { + printf("invalid empty salt: %s\n", s); + exit(-1); + } + + if (s_len % 2 != 0) { + printf("invalid odd len salt: %s\n", s); + exit(-1); + } + + for (i = 0; i < s_len; ++i) { + if (asciihex_to_int(s[i]) < 0) { + printf("invalid salt (invalid hex char): %s\n", s); + exit(-1); + } + } +} + +/** + * Convert a hex ascii string to an allocated binary array. This array must be free'd + */ +uint8_t* convert_hex_to_bin(char * s) { + int i; + int s_len = strlen(s); + + uint8_t* ret = malloc(s_len / 2); + for (i = 0; i < s_len; i += 2) { + ret[i / 2] = (asciihex_to_int(s[i]) << 4) | asciihex_to_int(s[i + 1]); + } + + return ret; +} + +void init_salt(salt_t* salt, char * salt_ascii) { + salt->salt_ascii = salt_ascii; + salt->salt_bin = convert_hex_to_bin(salt_ascii); + salt->salt_bin_len = strlen(salt_ascii) / 2; +} + +void free_salt(salt_t* salt) { + free(salt->salt_bin); +} + +/** + * Verify that the arguments are valid, or exit with failure + */ +void verify_args(int argc, char** argv) { + int i; + + if (argc < 3) { + printf("Usage: %s ... \n", argv[0]); + exit(1); + } + + for (i = 2; i < argc; i++) { + verify_valid_hex_str(argv[i]); + } +} + +FILE* make_out_file(char* filename) { + uint8_t buf[BUF_SIZE]; + int bytes_read; + char* suffix = ".new"; + int new_filename_len = strlen(filename) + strlen(suffix) + 1; + char* new_filename = malloc(new_filename_len); + strcpy(new_filename, filename); + strcat(new_filename, suffix); + + FILE* f = fopen(filename, "r+"); + if (!f) { + printf("cannot open file %s\n", filename); + exit(2); + } + + FILE* out = fopen(new_filename, "w+"); + free(new_filename); + if (!out) { + printf("cannot open file %s\n", filename); + exit(2); + } + + while (0 != (bytes_read = fread(buf, sizeof(uint8_t), BUF_SIZE, f))) { + fwrite(buf, sizeof(uint8_t), bytes_read, out); + } + fclose(f); + return out; +} + +/** + * Sign the firmware file after all of our checks have completed + */ +void sign_firmware(char* filename, char** salts, int num_salts) { + int i; + salt_t salt; + FILE* f = make_out_file(filename); + + // add a version suffix string - dlink versions do something similar before the first signature + add_version_suffix(f); + + //for each of the salts we are supplied with + for (i = 0; i < num_salts; i++) { + char* salt_str = salts[i]; + // convert this str to binary + init_salt(&salt, salt_str); + + // add the signature to the firmware file produced from this salt + add_signature(f, &salt); + free_salt(&salt); + printf("Signed with salt: %s\n", salt_str); + } + + fclose(f); +} + + +int main(int argc, char ** argv) { + verify_args(argc, argv); + sign_firmware(argv[1], argv+2, argc-2); + return 0; +} From 28262f815e4d0fe5302babc696ed5ce518b33759 Mon Sep 17 00:00:00 2001 From: Andrew Pikler Date: Mon, 5 Oct 2020 17:16:44 +0300 Subject: [PATCH 55/97] ramips: add support for D-Link DIR-882 R1 Specifications: - SoC: MediaTek MT7621AT - RAM: 128 MB (DDR3) - Flash: 16 MB (SPI NOR) - WiFi: MediaTek MT7615N (x2) - Switch: 1 WAN, 4 LAN (Gigabit) - Ports: 1 USB 2.0, 1 USB 3.0 - Buttons: Reset, WiFi Toggle, WPS - LEDs: Power, Internet, WiFi 2.4G WiFi 5G, USB 2.0, USB 3.0 The R1 revision is identical to the A1 revision except - No Config2 Parition, therefore - factory partition resized to 64k from 128K - Firmware partition offset is 0x50000 not 0x60000 - Firmware partitions size increased by 64K - Firmware partition type is "denx,uimage", not "sge,uimage" - Padding of image creation "uimage-padhdr 96" removed Installation: - Older firmware versions: put the factory image on a USB stick, turn on the telnet console, and flash using the following cmd "fw_updater Linux /mnt/usb_X_X/firmware.bin" - D-Link FailsafeUI: Power down the router, press and hold the reset button, then re-plug it. Keep the reset button pressed until the internet LED stops flashing, then jack into any lan port and manually assign a static IP address in 192.168.0.0/24 other than 192.168.0.0 (e.g. 192.168.0.2) and go to http://192.168.0.1 Flash with the factory image. Signed-off-by: Andrew Pikler --- .../ramips/dts/mt7621_dlink_dir-882-a1.dts | 17 +-- .../ramips/dts/mt7621_dlink_dir-882-r1.dts | 9 ++ .../ramips/dts/mt7621_dlink_dir-882-x1.dtsi | 17 +++ .../ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi | 132 +---------------- .../ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi | 43 ++++++ .../ramips/dts/mt7621_dlink_dir-8xx-x1.dtsi | 133 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 22 +++ .../mt7621/base-files/etc/board.d/01_leds | 3 +- 8 files changed, 228 insertions(+), 148 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts create mode 100644 target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi create mode 100644 target/linux/ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi create mode 100644 target/linux/ramips/dts/mt7621_dlink_dir-8xx-x1.dtsi diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts index bc2c6dfe86..cef0705393 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts @@ -1,24 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "mt7621_dlink_dir-8xx-a1.dtsi" +#include "mt7621_dlink_dir-882-x1.dtsi" / { compatible = "dlink,dir-882-a1", "mediatek,mt7621-soc"; model = "D-Link DIR-882 A1"; }; - -&leds { - usb2 { - label = "green:usb2"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - trigger-sources = <&ehci_port2>; - linux,default-trigger = "usbport"; - }; - - usb3 { - label = "green:usb3"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - trigger-sources = <&xhci_ehci_port1>; - linux,default-trigger = "usbport"; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts new file mode 100644 index 0000000000..26b6f34707 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_dlink_dir-8xx-r1.dtsi" +#include "mt7621_dlink_dir-882-x1.dtsi" + +/ { + compatible = "dlink,dir-882-r1", "mediatek,mt7621-soc"; + model = "D-Link DIR-882 R1"; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi new file mode 100644 index 0000000000..cafb1df964 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +&leds { + usb2 { + label = "green:usb2"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + trigger-sources = <&ehci_port2>; + linux,default-trigger = "usbport"; + }; + + usb3 { + label = "green:usb3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + trigger-sources = <&xhci_ehci_port1>; + linux,default-trigger = "usbport"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi index e451d6a39f..c43cc49aa1 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi @@ -1,65 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621.dtsi" - -#include -#include - -/ { - aliases { - label-mac-device = &gmac0; - led-boot = &led_power_orange; - led-failsafe = &led_power_green; - led-running = &led_power_green; - led-upgrade = &led_net_orange; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wifi { - label = "wifi"; - gpios = <&gpio 7 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - leds: leds { - compatible = "gpio-leds"; - - led_power_orange: power_orange { - label = "orange:power"; - gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - }; - - led_power_green: power_green { - label = "green:power"; - gpios = <&gpio 16 GPIO_ACTIVE_LOW>; - }; - - led_net_orange: net_orange { - label = "orange:net"; - gpios = <&gpio 4 GPIO_ACTIVE_LOW>; - }; - - net_green { - label = "green:net"; - gpios = <&gpio 3 GPIO_ACTIVE_LOW>; - }; - }; -}; +#include "mt7621_dlink_dir-8xx-x1.dtsi" &spi0 { status = "okay"; @@ -100,74 +41,3 @@ }; }; }; - -&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>; - - led { - led-active-low; - }; - }; -}; - -&pcie1 { - wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - ieee80211-freq-limit = <5000000 6000000>; - - led { - led-active-low; - }; - }; -}; - -&gmac0 { - mtd-mac-address = <&factory 0xe000>; -}; - -&switch0 { - ports { - port@0 { - status = "okay"; - label = "lan4"; - }; - - port@1 { - status = "okay"; - label = "lan3"; - }; - - port@2 { - status = "okay"; - label = "lan2"; - }; - - port@3 { - status = "okay"; - label = "lan1"; - }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe006>; - }; - }; -}; - -&state_default { - gpio { - groups = "i2c", "uart3", "jtag", "wdt"; - function = "gpio"; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi new file mode 100644 index 0000000000..e93a06d9fe --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_dlink_dir-8xx-x1.dtsi" + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-x1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-x1.dtsi new file mode 100644 index 0000000000..7ab0e8bd5d --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_dir-8xx-x1.dtsi @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + aliases { + label-mac-device = &gmac0; + led-boot = &led_power_orange; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_net_orange; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wifi { + label = "wifi"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds: leds { + compatible = "gpio-leds"; + + led_power_orange: power_orange { + label = "orange:power"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led_net_orange: net_orange { + label = "orange:net"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + net_green { + label = "green:net"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&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>; + + led { + led-active-low; + }; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-active-low; + }; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xe000>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + + port@4 { + status = "okay"; + label = "wan"; + mtd-mac-address = <&factory 0xe006>; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index cc0eb1d279..cf81a862ff 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -235,6 +235,17 @@ define Device/dlink_dir-8xx-a1 check-size endef +define Device/dlink_dir-8xx-r1 + $(Device/dsa-migration) + IMAGE_SIZE := 16064k + DEVICE_VENDOR := D-Link + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware + KERNEL_INITRAMFS := $$(KERNEL) + IMAGES += factory.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs |\ + pad-rootfs | append-metadata | check-size +endef + define Device/dlink_dir-xx60-a1 $(Device/dsa-migration) BLOCKSIZE := 128k @@ -312,6 +323,17 @@ define Device/dlink_dir-882-a1 endef TARGET_DEVICES += dlink_dir-882-a1 +define Device/dlink_dir-882-r1 + $(Device/dlink_dir-8xx-r1) + DEVICE_MODEL := DIR-882 + DEVICE_VARIANT := R1 + DEVICE_PACKAGES += kmod-usb3 kmod-usb-ledtrig-usbport + IMAGE/factory.bin := append-kernel | append-rootfs | check-size | \ + sign-dlink-ru 57c5375741c30ca9ebcb36713db4ba51 \ + ab0dff19af8842cdb70a86b4b68d23f7 +endef +TARGET_DEVICES += dlink_dir-882-r1 + define Device/d-team_newifi-d2 $(Device/dsa-migration) $(Device/uimage-lzma-loader) 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 cd1814cc2b..8d91b36346 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 @@ -30,7 +30,8 @@ dlink,dir-2660-a1) dlink,dir-860l-b1|\ dlink,dir-867-a1|\ dlink,dir-878-a1|\ -dlink,dir-882-a1) +dlink,dir-882-a1|\ +dlink,dir-882-r1) ucidef_set_led_netdev "wan" "wan" "green:net" "wan" ;; gnubee,gb-pc1|\ From 1941ac06f0d78074e6f3239eac81936f2d09f40f Mon Sep 17 00:00:00 2001 From: Wiktor Stasiak Date: Sun, 27 Sep 2020 16:27:59 +0200 Subject: [PATCH 56/97] apm821xx: Netgear WNDR4700 limit kernel lzma dictionary WNDR4700 uboot has an issue with decompressing kernel with default dictionary size (-d23 which is about 8MB). Limiting lzma dictionary lowers memory footprint and allows device to boot the kernel. The highest bootable dictonary size is 18, choosing 16 for an extra safety margin. Kernel size befor and after: -d23: 2663665 Bytes -d16: 2892757 Bytes Kernel size increased by 230kB (9%) Fixes: FS#3258 Signed-off-by: Wiktor Stasiak --- target/linux/apm821xx/image/nand.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/apm821xx/image/nand.mk b/target/linux/apm821xx/image/nand.mk index 845770b89f..26676c8d8b 100644 --- a/target/linux/apm821xx/image/nand.mk +++ b/target/linux/apm821xx/image/nand.mk @@ -106,7 +106,7 @@ define Device/netgear_wndr4700 KERNEL_SIZE := 3584k # append a fake/empty rootfs to fool netgear's uboot # CHECK_DNI_FIRMWARE_ROOTFS_INTEGRITY in do_chk_dniimg() - KERNEL := kernel-bin | lzma | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | \ + KERNEL := kernel-bin | lzma -d16 | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | \ append-uImage-fakehdr filesystem | dtb | create-uImage-dtb | prepend-dtb KERNEL_INITRAMFS := kernel-bin | gzip | dtb | MuImage-initramfs gzip IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ @@ -117,6 +117,5 @@ define Device/netgear_wndr4700 NETGEAR_HW_ID := 29763875+128+256 UBINIZE_OPTS := -E 5 SUPPORTED_DEVICES += wndr4700 - DEFAULT := n endef TARGET_DEVICES += netgear_wndr4700 From fe2f53f21c4f52febd8070588791c16c349e0fd8 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 25 Aug 2020 00:17:28 -0400 Subject: [PATCH 57/97] ath79: add support for Senao Engenius EnStationAC v1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FCC ID: A8J-ENSTAC Engenius EnStationAC v1 is an outdoor wireless access point/bridge with 2 gigabit ethernet ports on 2 external ethernet switches, 5 GHz only wireless, internal antenna plates, and proprietery PoE. Specification: - QCA9557 SOC - QCA9882 WLAN (PCI card, 5 GHz, 2x2, 26dBm) - AR8035-A switch (RGMII GbE with PoE+ IN) - AR8031 switch (SGMII GbE with PoE OUT) - 40 MHz reference clock - 16 MB FLASH MX25L12845EMI-10G - 2x 64 MB RAM NT5TU32M16FG - UART at J10 (unpopulated) - internal antenna plates (19 dbi, directional) - 7 LEDs, 1 button (power, eth, wlan, RSSI) (reset) MAC addresses: MAC addresses are labeled as ETH and 5GHz Vendor MAC addresses in flash are duplicate eth0 ETH *:d3 art 0x0/0x6 eth1 ---- *:d4 --- phy0 5GHz *:d5 --- Installation: 2 ways to flash factory.bin from OEM: - if you get Failsafe Mode from failed flash: only use it to flash Original firmware from Engenius or risk kernel loop or halt which requires serial cable Method 1: Firmware upgrade page: OEM webpage at 192.168.1.1 username and password "admin" Navigate to "Firmware" page from left pane Click Browse and select the factory.bin image Upload and verify checksum Click Continue to confirm and wait 3 minutes Method 2: Serial to load Failsafe webpage: After connecting to serial console and rebooting... Interrupt uboot with any key pressed rapidly execute `run failsafe_boot` OR `bootm 0x9fd70000` wait a minute connect to ethernet and navigate to "192.168.1.1/index.htm" Select the factory.bin image and upload wait about 3 minutes Return to OEM: If you have a serial cable, see Serial Failsafe instructions otherwise, uboot-env can be used to make uboot load the failsafe image *DISCLAIMER* The Failsafe image is unique to Engenius boards. If the failsafe image is missing or damaged this will not work DO NOT downgrade to ar71xx this way, it can cause kernel loop or halt ssh into openwrt and run `fw_setenv rootfs_checksum 0` reboot, wait 3 minutes connect to ethernet and navigate to 192.168.1.1/index.htm select OEM firmware image from Engenius and click upgrade TFTP recovery: rename initramfs to 'vmlinux-art-ramdisk' make available on TFTP server at 192.168.1.101 power board hold or press reset button repeatedly NOTE: for some Engenius boards TFTP is not reliable try setting MTU to 600 and try many times Format of OEM firmware image: The OEM software of EnStationAC is a heavily modified version of Openwrt Altitude Adjustment 12.09. One of the many modifications is to the sysupgrade program. Image verification is performed simply by the successful ungzip and untar of the supplied file and name check and header verification of the resulting contents. To form a factory.bin that is accepted by OEM Openwrt build, the kernel and rootfs must have specific names... openwrt-ar71xx-enstationac-uImage-lzma.bin openwrt-ar71xx-enstationac-root.squashfs and begin with the respective headers (uImage, squashfs). Then the files must be tarballed and gzipped. The resulting binary is actually a tar.gz file in disguise. This can be verified by using binwalk on the OEM firmware images, ungzipping then untaring. Newer EnGenius software requires more checks but their script includes a way to skip them, otherwise the tar must include a text file with the version and md5sums in a deprecated format. The OEM upgrade script is at /etc/fwupgrade.sh. OKLI kernel loader is required because the OEM software expects the kernel to be no greater than 1536k and the factory.bin upgrade procedure would otherwise overwrite part of the kernel when writing rootfs. Note on PLL-data cells: The default PLL register values will not work because of the external AR8033 switch between the SOC and the ethernet PHY chips. For QCA955x series, the PLL registers for eth0 and eth1 can be see in the DTSI as 0x28 and 0x48 respectively. Therefore the PLL registers can be read from uboot for each link speed after attempting tftpboot or another network action using that link speed with `md 0x18050028 1` and `md 0x18050048 1`. For eth0 at 1000 speed, the value returned was ae000000 but that didn't work, so following the logical pattern from the rest of the values, the guessed value of a3000000 works better. later discovered that delay can be placed on the PHY end only with phy-mode as 'rgmii-id' and set register to 0x82... Tested from master, all link speeds functional Signed-off-by: Michael Pratt [fixed SoB to match From:] Signed-off-by: Petr Štetiar --- package/boot/uboot-envtools/files/ath79 | 1 + .../dts/qca9557_engenius_enstationac-v1.dts | 201 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 3 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + target/linux/ath79/image/generic.mk | 12 ++ 5 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 496a27ceb2..2c6a730fbf 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -29,6 +29,7 @@ engenius,ecb1750|\ engenius,ecb350-v1|\ engenius,enh202-v1|\ engenius,ens202ext-v1|\ +engenius,enstationac-v1|\ etactica,eg200|\ glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand|\ diff --git a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts new file mode 100644 index 0000000000..952747ade0 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + compatible = "engenius,enstationac-v1", "qca,qca9557"; + model = "EnGenius EnStationAC v1"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + rssilow { + label = "red:rssilow"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + rssimedium { + label = "amber:rssimedium"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "green:rssihigh"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x050000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0x0a0000 0x010000>; + read-only; + }; + + firmware2: partition@b0000 { + label = "firmware2"; + reg = <0x0b0000 0x170000>; + }; + + partition@220000 { + label = "fakeroot"; + reg = <0x220000 0x010000>; + read-only; + }; + + firmware1: partition@230000 { + label = "firmware1"; + reg = <0x230000 0xb40000>; + }; + + partition@d70000 { + label = "failsafe"; + reg = <0xd70000 0x280000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy1: ethernet-phy@1 { + reg = <1>; + eee-broken-100tx; + eee-broken-1000t; + }; + + phy2: ethernet-phy@2 { + reg = <2>; + eee-broken-100tx; + eee-broken-1000t; + at803x-override-sgmii-link-check; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + phy-handle = <&phy1>; + phy-mode = "rgmii-id"; + + pll-data = <0x82000000 0x80000101 0x80001313>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; + + phy-handle = <&phy2>; + + pll-data = <0x03000000 0x00000101 0x00001313>; + + qca955x-sgmii-fixup; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0,0 { + compatible = "qcom,ath10k"; + reg = <0x0 0 0 0 0>; + qca,no-eeprom; + }; +}; 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 084281562f..443cccce81 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 @@ -184,7 +184,8 @@ engenius,enh202-v1) ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "amber:rssimedium" "wlan0" "33" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:rssihigh" "wlan0" "67" "100" ;; -engenius,ens202ext-v1) +engenius,ens202ext-v1|\ +engenius,enstationac-v1) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "red:rssilow" "wlan0" "1" "100" ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "amber:rssimedium" "wlan0" "33" "100" 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 e492c5f542..3ab01afcf3 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 @@ -11,6 +11,7 @@ case "$FIRMWARE" in "ath10k/cal-pci-0000:00:00.0.bin") case $board in allnet,all-wap02860ac|\ + engenius,enstationac-v1|\ glinet,gl-x750) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index e1b0c4c1e1..5bb247c58e 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1025,6 +1025,18 @@ define Device/engenius_ens202ext-v1 endef TARGET_DEVICES += engenius_ens202ext-v1 +define Device/engenius_enstationac-v1 + $(Device/engenius_loader_okli) + SOC := qca9557 + DEVICE_MODEL := EnStationAC + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct rssileds + IMAGE_SIZE := 11520k + LOADER_FLASH_OFFS := 0x230000 + ENGENIUS_IMGNAME := ar71xx-generic-enstationac +endef +TARGET_DEVICES += engenius_enstationac-v1 + define Device/engenius_epg5000 SOC := qca9558 DEVICE_VENDOR := EnGenius From 4d0c442a0a2fdc84ff0dc2c7106455d15c03defe Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sun, 4 Oct 2020 22:54:36 -0400 Subject: [PATCH 58/97] ath79: expand factory.bin support for some Senao Engenius boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Newer EnGenius software that still uses the tar.gz platform instead of the custom header requires more checks for upgrading, but their script includes a way to skip them... the existence of a file in the tar.gz called failsafe.bin Their upgrade script has these lines: \#pass check when upload with full image file [ "${errcode}" -eq "1" ] && [ -f failsafe.bin ] && errcode="0" This overrides the script's "errcode" variable which can be set if any of the following actions/checks fail: - untarring of the upload - magic number for kernel: "2705" - magic num for rootfs: "7371" or "6873" - md5sums for each file in the format filename:md5 - existence of a file matching FWINFO* that it has boardname in the name somewhere (grep) that the 4th field of separator "-" is at least 3 (version) Otherwise we would need to generate md5sums in this strange format and touch a file with specific requirements in the name. This does not effect boards where the advanced checks do not apply. Signed-off-by: Michael Pratt [fixed SoB to match From:] Signed-off-by: Petr Štetiar --- target/linux/ath79/image/generic.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 5bb247c58e..101c7597b8 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -75,6 +75,7 @@ endef define Build/engenius-tar-gz -[ -f "$@" ] && \ mkdir -p $@.tmp && \ + touch $@.tmp/failsafe.bin && \ echo '#!/bin/sh' > $@.tmp/before-upgrade.sh && \ echo ': > /tmp/_sys/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \ $(CP) $(KDIR)/loader-$(DEVICE_NAME).uImage \ From 98b86296e67dd2b467212fe1a577656e6d3725da Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 12 Oct 2019 00:49:15 +0200 Subject: [PATCH 59/97] ipq806x: add support for ASRock G10 The ASRock G10 is a 2.4/5 GHz band 11ac "Gaming" router, based on Qualcomm IPQ8064. Specifications: SoC: Qualcomm IPQ8064 CPU: Dual-Core A15 @ (384 - 1,400 MHz, 2C2T) DRAM: 512 MiB (~467 MiB available) NAND: 128 MB (Micron MT29F1G08ABBEAH4) WLAN0: 4T4R 5 GHz Wlan (QCA9980) WLAN1: 4T4R 2.4 GHz Wlan (QCA9980) ETH: 5x 10/100/1000 Mbps Ethernet (QCA8337) INPUT: Reset Button, WPS 2.4G and WPS 5G Button LEDS: 1 multicolor status LED USB: 2x USB 3.0 Type-A POWER: 12VDC/3A AC Adapter + dedicated Power Switch UART: Setting is 115200-8-N-1. 1x4 .1" unpopulated header on the PCB (J6 - very tiny silkscreen next to TX). Pinout: 1. 3v3 (Square - best skipped!), 2. RX, 3. GND, 4. TX WARNING: The serial port needs a TTL/RS-232 3.3v level converter! (Depending on the serial adapter RX and TX might need to be swapped). Note about the IR-Remote: There's a 8-Bit MCU (SONIX SN8F25E21SG) which is controlling the IR-Remote and is fed by the IR-Photodiode. The SoC can talk to the device via I2C. The vendor's GPL archive comes with the source of the interface driver for this as a (character driver), the main control software is however a blob. Installation Instructions: 1. Download factory image to disk 2. Apply factory image via stock web-gui Back to stock: 1. Login to router via ssh 2. run "asrock_g10_back_to_factory" script from /sbin Notes: - If something goes wrong durring sysupgrade, router will go back to factory image. - Asrock G10 uses partition layout from smem. So partition layout can be normal or alternate. - 900-arm-add-cmdline-override.patch was copied from 102-powerpc-add-cmdline-override.patch from powerpc target. Knowledge about BOOTCONFIG partition was based on user "jmomo" post from old OpenWrt forum (Post #50): https://forum.archive.openwrt.org/viewtopic.php?id=65956&p=2 Signed-off-by: Christian Lamparter [bump to 5.4, add factory image, fix sysupgrade, convert partition layout to smem, remove ipq-wifi-asrock-g10 and use ART, minor fixes] Co-Authored-by: Pawel Dembicki Signed-off-by: Pawel Dembicki Tested-by: Lukasz Ostapiuk --- .../ipq806x/base-files/etc/board.d/02_network | 9 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 6 + .../ipq806x/base-files/etc/init.d/bootcount | 8 + .../lib/preinit/05_set_iface_mac_ipq806x.sh | 14 + .../ipq806x/base-files/lib/upgrade/asrock.sh | 55 ++++ .../base-files/lib/upgrade/platform.sh | 4 + .../sbin/asrock_g10_back_to_factory | 16 ++ target/linux/ipq806x/config-5.4 | 1 + .../arch/arm/boot/dts/qcom-ipq8064-g10.dts | 242 ++++++++++++++++++ target/linux/ipq806x/image/Makefile | 24 ++ .../0069-arm-boot-add-dts-files.patch | 3 +- .../900-arm-add-cmdline-override.patch | 37 +++ .../patches-5.4/997-device_tree_cmdline.patch | 4 +- 13 files changed, 416 insertions(+), 7 deletions(-) create mode 100644 target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh create mode 100644 target/linux/ipq806x/base-files/lib/upgrade/asrock.sh create mode 100755 target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory create mode 100644 target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-g10.dts create mode 100644 target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 3f9d96881d..eecf81a8cd 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -12,6 +12,11 @@ board_config_update board=$(board_name) case "$board" in +asrock,g10 |\ +nec,wg2600hp) + ucidef_add_switch "switch0" \ + "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "1:wan" "0@eth0" + ;; buffalo,wxr-2533dhp |\ compex,wpq864 |\ netgear,d7800 |\ @@ -41,10 +46,6 @@ linksys,ea8500) ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$hw_mac_addr" ;; -nec,wg2600hp) - ucidef_add_switch "switch0" \ - "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "1:wan" "0@eth0" - ;; netgear,r7800 |\ tplink,c2600) ucidef_add_switch "switch0" \ diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 74ad00c5ce..a22af9b676 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -9,6 +9,9 @@ board=$(board_name) case "$FIRMWARE" in "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in + asrock,g10) + caldata_extract "0:ART" 0x1000 0x2f20 + ;; buffalo,wxr-2533dhp) caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e) @@ -47,6 +50,9 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-pci-0001:01:00.0.bin") case $board in + asrock,g10) + caldata_extract "0:ART" 0x5000 0x2f20 + ;; buffalo,wxr-2533dhp) caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary ART 0x18) diff --git a/target/linux/ipq806x/base-files/etc/init.d/bootcount b/target/linux/ipq806x/base-files/etc/init.d/bootcount index 77965e647b..7a54c34dba 100755 --- a/target/linux/ipq806x/base-files/etc/init.d/bootcount +++ b/target/linux/ipq806x/base-files/etc/init.d/bootcount @@ -2,8 +2,16 @@ START=99 +. /lib/upgrade/asrock.sh + boot() { case $(board_name) in + asrock,g10) + asrock_bootconfig_mangle "bootcheck" + if [ $? -eq 0 ]; then + reboot + fi + ;; edgecore,ecw5410) fw_setenv bootcount 0 ;; diff --git a/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh new file mode 100644 index 0000000000..ca8d0b1555 --- /dev/null +++ b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh @@ -0,0 +1,14 @@ +. /lib/functions.sh + +preinit_set_mac_address() { + case $(board_name) in + asrock,g10) + lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address) + wan_mac=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address) + ip link set dev eth0 address "${lan_mac}" + ip link set dev eth1 address "${wan_mac}" + ;; + esac +} + +boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh new file mode 100644 index 0000000000..71cac3faac --- /dev/null +++ b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh @@ -0,0 +1,55 @@ +. /lib/functions.sh + + +asrock_bootconfig_mangle() { + local mtdnum="$( find_mtd_index 0:BOOTCONFIG )" + + if [ -z "$mtdnum" ]; then + echo "cannot find bootconfig mtd partition" + return 1 + fi + dd if=/dev/mtd$mtdnum of=/tmp/mtd$mtdnum bs=1k + + local partition_byte="$(dd if=/tmp/mtd$mtdnum bs=1 skip=52 count=1)" + local upgrade_byte="$(dd if=/tmp/mtd$mtdnum bs=1 skip=4 count=1)" + + if [ $1 = "bootcheck" ]; then + if [ ! -s $upgrade_byte ]; then + dd if=/dev/mtd$mtdnum of=/tmp/mtd$mtdnum bs=1k + printf '\x00' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=4 + printf '\x00' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=56 + else + return 1 + fi + elif [ $1 = "sysupgrade" ]; then + printf '\x01' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=4 + printf '\x01' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=56 + fi + + if [ -s $partition_byte ]; then + printf '\x01' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=52 + else + printf '\x00' | dd of=/tmp/mtd$mtdnum conv=notrunc bs=1 seek=52 + fi + + mtd write /tmp/mtd$mtdnum /dev/mtd$mtdnum + return 0 +} + +asrock_upgrade_prepare() { + local ubidev="$( nand_find_ubi ubi )" + + #Set upgrade flag. If something goes wrong, router will boot with + #factory firmware. + asrock_bootconfig_mangle 'sysupgrade' + + if [ $? -ne 0 ]; then + echo "cannot find bootconfig mtd partition" + exit 1 + fi + + # Just delete these partitions if present and use + # OpenWrt's standard names for those. + ubirmvol /dev/$ubidev -N ubi_rootfs &> /dev/null || true + ubirmvol /dev/$ubidev -N ubi_rootfs_data &> /dev/null || true +} diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index f61e8ee878..f5d6c5d55d 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -10,6 +10,10 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in + asrock,g10) + asrock_upgrade_prepare + nand_do_upgrade "$1" + ;; buffalo,wxr-2533dhp) buffalo_upgrade_prepare_ubi CI_ROOTPART="ubi_rootfs" diff --git a/target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory b/target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory new file mode 100755 index 0000000000..55aa91eab6 --- /dev/null +++ b/target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory @@ -0,0 +1,16 @@ +#!/bin/sh + +. /lib/upgrade/asrock.sh + +case $(board_name) in +asrock,g10) + asrock_bootconfig_mangle "factory" + if [ $? -eq 0 ]; then + reboot + fi + ;; +*) + echo "Unsupported hardware." + ;; +esac + diff --git a/target/linux/ipq806x/config-5.4 b/target/linux/ipq806x/config-5.4 index 2c8e6bbbb0..e6160bd455 100644 --- a/target/linux/ipq806x/config-5.4 +++ b/target/linux/ipq806x/config-5.4 @@ -78,6 +78,7 @@ CONFIG_CC_HAS_KASAN_GENERIC=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE_OVERRIDE=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y CONFIG_COMPAT_32BIT_TIME=y diff --git a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-g10.dts b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-g10.dts new file mode 100644 index 0000000000..15ed5b4773 --- /dev/null +++ b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8064-g10.dts @@ -0,0 +1,242 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "qcom-ipq8064-v2.0.dtsi" + +#include +#include + +/ { + compatible = "asrock,g10", "qcom,ipq8064"; + model = "ASRock G10"; + + aliases { + ethernet0 = &gmac1; + ethernet1 = &gmac0; + + led-boot = &led_status_blue; + led-failsafe = &led_status_amber; + led-running = &led_status_blue; + led-upgrade = &led_status_amber; + }; + + chosen { + bootargs-override = "console=ttyMSM0,115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + + /* + * this is a bit misleading. Because there are about seven + * multicolor LEDs connected all wired together in parallel. + */ + + status_yellow { + label = "yellow:status"; + gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>; + }; + + led_status_amber: status_amber { + label = "amber:status"; + gpios = <&qcom_pinmux 7 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&qcom_pinmux 9 GPIO_ACTIVE_HIGH>; + }; + + /* + * LED is declared in vendors boardfile but it's not + * working and the manual doesn't mention anything + * about the LED being white. + + status_white { + label = "white:status"; + gpios = <&qcom_pinmux 26 GPIO_ACTIVE_HIGH>; + }; + */ + }; + + i2c-gpio { + #address-cells = <1>; + #size-cells = <0>; + + compatible = "i2c-gpio"; + gpios = <&qcom_pinmux 53 GPIO_ACTIVE_HIGH>, /* sda */ + <&qcom_pinmux 54 GPIO_ACTIVE_HIGH>; /* scl */ + i2c-gpio,delay-us = <5>; + i2c-gpio,scl-output-only; + + mcu@50 { + reg = <0x50>; + compatible = "sonix,sn8f25e21"; + }; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + ir-remote { + label = "ir-remote"; + gpios = <&qcom_pinmux 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps5g { + label = "wps5g"; + gpios = <&qcom_pinmux 64 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps2g { + label = "wps2g"; + gpios = <&qcom_pinmux 65 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&adm_dma { + status = "okay"; +}; + +&gmac1 { + status = "okay"; + + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + + phy-mode = "rgmii"; + qcom,id = <1>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gmac2 { + status = "okay"; + + phy-mode = "sgmii"; + qcom,id = <2>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gsbi4_serial { + pinctrl-0 = <&uart0_pins>; + pinctrl-names = "default"; +}; + +&mdio0 { + status = "okay"; + + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + ethernet-phy@0 { + reg = <0>; + qca,ar8327-initvals = < + 0x00004 0x7600000 /* PAD0_MODE */ + 0x00008 0x1000000 /* PAD5_MODE */ + 0x0000c 0x80 /* PAD6_MODE */ + 0x000e4 0x6a545 /* MAC_POWER_SEL */ + 0x000e0 0xc74164de /* SGMII_CTRL */ + 0x0007c 0x4e /* PORT0_STATUS */ + 0x00094 0x4e /* PORT6_STATUS */ + >; + }; +}; + +&nand_controller { + status = "okay"; + + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + nand@0 { + reg = <0>; + compatible = "qcom,nandcs"; + + nand-ecc-strength = <4>; + nand-bus-width = <8>; + nand-ecc-step-size = <512>; + + partitions { + compatible = "qcom,smem"; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&pcie1 { + status = "okay"; +}; + +&qcom_pinmux { + led_pins: led_pins { + mux { + pins = "gpio7", "gpio8", "gpio9", "gpio26"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + button_pins: button_pins { + mux { + pins = "gpio15", "gpio16", "gpio64", "gpio65"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + uart0_pins: uart0_pins { + mux { + pins = "gpio10", "gpio11"; + function = "gsbi4"; + drive-strength = <10>; + bias-disable; + }; + }; +}; + +&rpm { + pinctrl-0 = <&i2c4_pins>; + pinctrl-names = "default"; +}; + +&usb3_0 { + status = "okay"; +}; + +&usb3_1 { + status = "okay"; +}; + +&tcsr { + qcom,usb-ctrl-select = ; +}; + +/delete-node/ &pcie2_pins; +/delete-node/ &pcie2; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index ec73630ae5..ad7c4b94d2 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -13,6 +13,16 @@ define Build/buffalo-rootfs-cksum ) >> $@ endef +define Build/edimax-header + $(eval edimax_model=$(word 1,$(1))) + + $(STAGING_DIR_HOST)/bin/mkedimaximg \ + -b -s CSYS -m $(edimax_model) \ + -f 0x70000 -S 0x1200000 \ + -i $@ -o $@.new + @mv $@.new $@ +endef + define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) @@ -82,6 +92,20 @@ define Device/ZyXELImage IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata endef +define Device/asrock_g10 + $(call Device/FitImage) + $(call Device/UbiFit) + SOC := qcom-ipq8064 + DEVICE_VENDOR := ASRock + DEVICE_MODEL := G10 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 5332k + DEVICE_PACKAGES := kmod-i2c-gpio ath10k-firmware-qca99x0-ct + IMAGE/nand-factory.bin := append-ubi | edimax-header RN67 +endef +TARGET_DEVICES += asrock_g10 + define Device/buffalo_wxr-2533dhp $(call Device/LegacyImage) SOC := qcom-ipq8064 diff --git a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch index 7e15b87e39..6bbf184ac7 100644 --- a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -843,6 +843,20 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -843,6 +843,21 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-ipq4019-ap.dk07.1-c1.dtb \ qcom-ipq4019-ap.dk07.1-c2.dtb \ qcom-ipq8064-ap148.dtb \ @@ -20,6 +20,7 @@ Signed-off-by: John Crispin + qcom-ipq8064-ap161.dtb \ + qcom-ipq8064-ea7500-v1.dtb \ + qcom-ipq8064-ea8500.dtb \ ++ qcom-ipq8064-g10.dtb \ + qcom-ipq8064-r7500.dtb \ + qcom-ipq8064-r7500v2.dtb \ + qcom-ipq8064-wg2600hp.dtb \ diff --git a/target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch b/target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch new file mode 100644 index 0000000000..bb3aa2622c --- /dev/null +++ b/target/linux/ipq806x/patches-5.4/900-arm-add-cmdline-override.patch @@ -0,0 +1,37 @@ +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -1836,6 +1836,14 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGL + Only command line ATAG will be processed, the rest of the ATAGs + sent by bootloader will be ignored. + ++config CMDLINE_OVERRIDE ++ bool "Use alternative cmdline from device tree" ++ help ++ Some bootloaders may have uneditable bootargs. While CMDLINE_FORCE can ++ be used, this is not a good option for kernels that are shared across ++ devices. This setting enables using "chosen/cmdline-override" as the ++ cmdline if it exists in the device tree. ++ + endchoice + + config CMDLINE +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -1060,6 +1060,17 @@ int __init early_init_dt_scan_chosen(uns + if (p != NULL && l > 0) + strlcpy(data, p, min(l, COMMAND_LINE_SIZE)); + ++ /* CONFIG_CMDLINE_OVERRIDE is used to fallback to a different ++ * device tree option of chosen/bootargs-override. This is ++ * helpful on boards where u-boot sets bootargs, and is unable ++ * to be modified. ++ */ ++#ifdef CONFIG_CMDLINE_OVERRIDE ++ p = of_get_flat_dt_prop(node, "bootargs-override", &l); ++ if (p != NULL && l > 0) ++ strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); ++#endif ++ + /* + * CONFIG_CMDLINE is meant to be a default in case nothing else + * managed to set the command line, unless CONFIG_CMDLINE_FORCE diff --git a/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch b/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch index 3cc032fdd2..b6b1b04765 100644 --- a/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch +++ b/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch @@ -8,5 +8,5 @@ + if (p != NULL && l > 0) + strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE)); - /* - * CONFIG_CMDLINE is meant to be a default in case nothing else + /* CONFIG_CMDLINE_OVERRIDE is used to fallback to a different + * device tree option of chosen/bootargs-override. This is From 6ffe8a473eedf6f4f472bb5e64a1e1775917f3c8 Mon Sep 17 00:00:00 2001 From: Kip Porterfield Date: Mon, 3 Aug 2020 14:07:51 +0000 Subject: [PATCH 60/97] kirkwood: add support for Seagate BlackArmor NAS220 The Seagate BlackArmor NAS220 is a consumer NAS with two internal drive bays. The stock OS runs RAID 1 over the disks via mdadm. Device specification: - SoC: Marvell 88F6192 800 MHz - RAM: 128 MB - Flash: 32 MB - 2 x internal SATA II drives - Ethernet: 10/100/1000 Mbps (single port, no switch) - WLAN: None - LED: Power, Status, Sata Activity - Key: Power, Reset - Serial: 10 pin header, (115200,8,N,1), 3.3V TTL 9|x - x|10 7|x - x|8 5|x - GND|6 3|x - RX|4 1|TX - x|2 front of case - USB ports: 2 x USB 2.0 Flash instruction: NOTE: this process uses a serial connection. It will upgrade the bootloader and reset the bootloader environment variables TFTP server setup - Setup PC with TFTP server set the PC IP to 10.4.50.5 as TFTP server - Copy these files to TFTP server location - u-boot.kwb - seagate_blackarmor-nas220-initramfs-uImage - seagate_blackarmor-nas220-squashfs-sysupgrade.bin - seagate_blackarmor-nas220-squashfs-factory.bin Seagate NAS setup - Connect LAN cable between PC and seagate device - Connect to serial to seagate device Install u-boot - Boot seagate device and stop in bootloader by pressing any key - run 'printenv' from u-boot and save the values - tftpboot 0x2000000 u-boot.kwb - nand erase.part uboot - nand write 0x2000000 0x0 ${filesize} - reset Update MAC address in u-boot env - Stop in u-boot by pressing any key - Get your MAC address from your saved printenv. Is also on chassis - setenv ethaddr - saveenv Option 1 (recommended) - Install OpenWrt via initramfs and sysupgrade - tftpboot 0x2000000 seagate_blackarmor-nas220-initramfs-uImage - bootm 0x2000000 - *OpenWrt should be running now, however it is not written to flash yet* - From the running instance of OpenWrt use Luci's "flash image" feature from the web site or use sysupgrade from the console to write seagate_blackarmor-nas220-squashfs-sysupgrade.bin to flash Option 2 - Install OpenWrt by flashing factory image from u-boot - nand erase.part ubi - tftpboot 0x2000000 seagate_blackarmor-nas220-squashfs-factory.bin - nand write 0x2000000 ubi ${filesize} - reset Signed-off-by: Kip Porterfield --- package/boot/uboot-kirkwood/Makefile | 6 ++ .../patches/201-blackarmor-nas220.patch | 29 ++++++ .../base-files/etc/board.d/02_network | 1 + .../base-files/etc/init.d/hwmon_fancontrol | 14 +++ target/linux/kirkwood/image/Makefile | 12 +++ .../patches-5.4/203-blackarmor-nas220.patch | 99 +++++++++++++++++++ 6 files changed, 161 insertions(+) create mode 100644 package/boot/uboot-kirkwood/patches/201-blackarmor-nas220.patch create mode 100644 target/linux/kirkwood/patches-5.4/203-blackarmor-nas220.patch diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index e1493bf0e8..1ed1743e21 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -59,6 +59,11 @@ define U-Boot/l-50 BUILD_DEVICES:=checkpoint_l-50 endef +define U-Boot/nas220 + NAME:=Seagate Blackarmor NAS220 + BUILD_DEVICES:=seagate_blackarmor-nas220 +endef + define U-Boot/nsa310 NAME:=Zyxel NSA310 BUILD_DEVICES:=zyxel_nsa310b @@ -95,6 +100,7 @@ UBOOT_TARGETS := \ ib62x0 ib62x0_second_stage \ iconnect iconnect_second_stage \ l-50 \ + nas220 \ nsa310 \ nsa310s \ nsa325 \ diff --git a/package/boot/uboot-kirkwood/patches/201-blackarmor-nas220.patch b/package/boot/uboot-kirkwood/patches/201-blackarmor-nas220.patch new file mode 100644 index 0000000000..50de4e7b82 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/201-blackarmor-nas220.patch @@ -0,0 +1,29 @@ +--- a/include/configs/nas220.h ++++ b/include/configs/nas220.h +@@ -54,17 +54,22 @@ + /* + * Default environment variables + */ +-#define CONFIG_BOOTCOMMAND "" ++#define CONFIG_BOOTCOMMAND \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" + + #define CONFIG_EXTRA_ENV_SETTINGS \ + "bootargs=console=ttyS0,115200\0" \ + "mtdparts=mtdparts=orion_nand:0xa0000@0x0(uboot),"\ + "0x010000@0xa0000(env),"\ +- "0x500000@0xc0000(uimage),"\ +- "0x1a40000@0x5c0000(rootfs)\0" \ ++ "0x1e80000@0xc0000(ubi)\0"\ + "mtdids=nand0=orion_nand\0"\ + "autostart=no\0"\ +- "autoload=no\0" ++ "autoload=no\0"\ ++ "ipaddr=10.4.50.165\0"\ ++ "serverip=10.4.50.5\0"\ ++ "bootdelay=3" + + /* + * Ethernet Driver configuration diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index a60b87c912..c3d31affda 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -22,6 +22,7 @@ case "$board" in "iom,iconnect-1.1"|\ "iom,ix2-200"|\ "raidsonic,ib-nas62x0"|\ +"seagate,blackarmor-nas220"|\ "seagate,dockstar"|\ "seagate,goflexhome"|\ "seagate,goflexnet"|\ diff --git a/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol b/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol index a0e3de062b..c64ed1100c 100755 --- a/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol +++ b/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol @@ -11,6 +11,20 @@ boot() { path_to_hwmon='/sys/class/hwmon/hwmon0' echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1 ;; + seagate,blackarmor-nas220) + path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0' + # adt7476 fan control chip. 3 temp sensors. Set to 1/4 speed at 35C and max speed at 48C. + echo 7 > "$path_to_hwmon/pwm1_auto_channels_temp" + echo 64 > "$path_to_hwmon/pwm1_auto_point1_pwm" + echo 255 > "$path_to_hwmon/pwm1_auto_point2_pwm" + echo 35000 > "$path_to_hwmon/temp1_auto_point1_temp" + echo 48000 > "$path_to_hwmon/temp1_auto_point2_temp" + echo 35000 > "$path_to_hwmon/temp2_auto_point1_temp" + echo 48000 > "$path_to_hwmon/temp2_auto_point2_temp" + echo 35000 > "$path_to_hwmon/temp3_auto_point1_temp" + echo 48000 > "$path_to_hwmon/temp3_auto_point2_temp" + echo 2 > "$path_to_hwmon/pwm1_enable" + ;; zyxel,nsa310b) path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0' echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1 diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 0816add474..a9aad01f7f 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -145,6 +145,18 @@ define Device/raidsonic_ib-nas62x0 endef TARGET_DEVICES += raidsonic_ib-nas62x0 +define Device/seagate_blackarmor-nas220 + DEVICE_VENDOR := Seagate + DEVICE_MODEL := Blackarmor NAS220 + DEVICE_PACKAGES := kmod-hwmon-adt7475 kmod-fs-ext4 kmod-ata-marvell-sata \ + mdadm kmod-gpio-button-hotplug + PAGESIZE := 512 + SUBPAGESIZE := 256 + BLOCKSIZE := 16k + UBINIZE_OPTS := -e 1 +endef +TARGET_DEVICES += seagate_blackarmor-nas220 + define Device/seagate_dockstar DEVICE_VENDOR := Seagate DEVICE_MODEL := FreeAgent Dockstar diff --git a/target/linux/kirkwood/patches-5.4/203-blackarmor-nas220.patch b/target/linux/kirkwood/patches-5.4/203-blackarmor-nas220.patch new file mode 100644 index 0000000000..e04a28206a --- /dev/null +++ b/target/linux/kirkwood/patches-5.4/203-blackarmor-nas220.patch @@ -0,0 +1,99 @@ +--- a/arch/arm/boot/dts/kirkwood-blackarmor-nas220.dts ++++ b/arch/arm/boot/dts/kirkwood-blackarmor-nas220.dts +@@ -17,6 +17,13 @@ + compatible = "seagate,blackarmor-nas220","marvell,kirkwood-88f6192", + "marvell,kirkwood"; + ++ aliases { ++ led-boot = &led_status_amber; ++ led-failsafe = &led_status_amber; ++ led-running = &led_status_blue; ++ led-upgrade = &led_status_amber; ++ }; ++ + memory { /* 128 MB */ + device_type = "memory"; + reg = <0x00000000 0x8000000>; +@@ -36,14 +43,14 @@ + compatible = "gpio-keys"; + + reset { +- label = "Reset"; +- linux,code = ; ++ label = "Reset Button"; ++ linux,code = ; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + +- button { +- label = "Power"; +- linux,code = ; ++ power { ++ label = "Power Button"; ++ linux,code = ; + gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; + }; + }; +@@ -51,11 +58,27 @@ + gpio-leds { + compatible = "gpio-leds"; + +- blue-power { ++ led_power_blue: power_blue { + label = "nas220:blue:power"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-on"; + }; ++ ++ disk_blue { ++ label = "nas220:blue:disk"; ++ gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "disk-activity"; ++ }; ++ ++ led_status_blue: status_blue { ++ label = "nas220:blue:status"; ++ gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led_status_amber: status_amber { ++ label = "nas220:amber:status"; ++ gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; ++ }; + }; + + regulators { +@@ -153,6 +176,33 @@ + + &nand { + status = "okay"; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ ++ partition@0 { ++ label = "uboot"; ++ reg = <0x0 0xa0000>; ++ read-only; ++ }; ++ ++ partition@a0000 { ++ label = "uboot-env"; ++ reg = <0xa0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@b0000 { ++ label = "reserved"; ++ reg = <0xb0000 0x10000>; ++ read-only; ++ }; ++ ++ partition@c0000 { ++ label = "ubi"; ++ reg = <0xc0000 0x1e80000>; ++ }; ++ }; + }; + + &mdio { From 9361964a3a330882ddb1ed60eec127821f350014 Mon Sep 17 00:00:00 2001 From: Andy Walsh Date: Tue, 30 Jun 2020 00:52:25 +0200 Subject: [PATCH 61/97] kernel: add KERNEL_IO_URING option * add KERNEL_IO_URING option NOTES: Adds configurable support for the io_uring interface (CONFIG_IO_URING) via KERNEL_IO_URING option. The kernel only zImage grows by about 5-9KB ? I would like to enable this by default for all 5.4 kernels, so i can use the new io_uring samba-4.12.x vfs module by default. The associated liburing was already submitted and merged. The kernel + liburing was tested on ARM/mvebu via samba4 vfs_io_uring module and i have no issues so far. Some extra reads on it and why we should enable it by default, since i expect more packages to use this in the future. https://wiki.samba.org/index.php/Samba_4.12_Features_added/changed#.27io_uring.27_vfs_module https://lwn.net/Articles/810414/ https://kernel.dk/io_uring.pdf https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.6-IO-uring-Tests Signed-off-by: Andy Walsh --- config/Config-kernel.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 22e2286b8d..c9efed84d3 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -373,6 +373,11 @@ config KERNEL_AIO bool "Compile the kernel with asynchronous IO support" default y if !SMALL_FLASH +config KERNEL_IO_URING + bool "Compile the kernel with io_uring support" + default y if !SMALL_FLASH + depends on LINUX_5_4 + config KERNEL_FHANDLE bool "Compile the kernel with support for fhandle syscalls" default y if !SMALL_FLASH From 4943bc5cff47a482c3010033e04c6d489a4b733c Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 9 Dec 2020 21:17:47 +0100 Subject: [PATCH 62/97] kernel: only strip proc for small flash devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, you are not able to get statistics about IPv4 and IPv6 usage. This information can be collected via the snmp and snmp6. However, in the current state this interface is disabled as you can read in the "902-debloat_proc.patch": "Strip non-essential /proc functionality to reduce code size" Tools like netstat use the snmp/6 interface to collect interface statistics. Some prometheus exporters also mention this: - prometheus-collectors/netstat.lua - prometheus-collectors/snmp6 (still a PR) - collectd/snmp6 (still a PR) PRs: - https://github.com/collectd/collectd/pull/3789 - https://github.com/openwrt/packages/pull/14158 Instead of enabling it as default for all devices we condition it default y if SMALL_FLASH A test shows it needs around 16 kiB. Signed-off-by: Nick Hainke [fixed whitespace issue] Signed-off-by: Petr Štetiar --- config/Config-kernel.in | 6 +++++- target/linux/generic/config-5.4 | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index c9efed84d3..e22fcf6382 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -35,6 +35,10 @@ config KERNEL_SWAP bool "Support for paging of anonymous memory (swap)" default y if !SMALL_FLASH +config KERNEL_PROC_STRIPPED + bool "Strip non-essential /proc functionality to reduce code size" + default y if SMALL_FLASH + config KERNEL_DEBUG_FS bool "Compile the kernel with debug filesystem enabled" default y @@ -376,7 +380,7 @@ config KERNEL_AIO config KERNEL_IO_URING bool "Compile the kernel with io_uring support" default y if !SMALL_FLASH - depends on LINUX_5_4 + depends on LINUX_5_4 config KERNEL_FHANDLE bool "Compile the kernel with support for fhandle syscalls" diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 00fbd93ff4..8473817000 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -4123,7 +4123,6 @@ CONFIG_PRINT_STACK_DEPTH=64 CONFIG_PROC_FS=y # CONFIG_PROC_KCORE is not set # CONFIG_PROC_PAGE_MONITOR is not set -CONFIG_PROC_STRIPPED=y CONFIG_PROC_SYSCTL=y # CONFIG_PROC_VMCORE_DEVICE_DUMP is not set # CONFIG_PROFILE_ALL_BRANCHES is not set From ceb612e463fc0dc6fbd7be66dc1a244544213c24 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 11 Dec 2020 08:07:40 +0100 Subject: [PATCH 63/97] hostapd: pass respawn settings when registering the service When hostapd gets restarted to often/quickly will cause procd to not restart it anymore. it will think that hapd is in a crash loop. Signed-off-by: John Crispin Signed-off-by: Felix Fietkau [adjust respawn time] --- package/network/services/hostapd/files/wpad.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/hostapd/files/wpad.init b/package/network/services/hostapd/files/wpad.init index 3198e9801f..8471796774 100644 --- a/package/network/services/hostapd/files/wpad.init +++ b/package/network/services/hostapd/files/wpad.init @@ -11,7 +11,7 @@ start_service() { mkdir -p /var/run/hostapd procd_open_instance hostapd procd_set_param command /usr/sbin/hostapd -s -g /var/run/hostapd/global - procd_set_param respawn + procd_set_param respawn 3600 1 0 procd_close_instance fi @@ -19,7 +19,7 @@ start_service() { mkdir -p /var/run/wpa_supplicant procd_open_instance supplicant procd_set_param command /usr/sbin/wpa_supplicant -n -s -g /var/run/wpa_supplicant/global - procd_set_param respawn + procd_set_param respawn 3600 1 0 procd_close_instance fi } From d3c88811942a9dc9bbb01ca0443ae9cd790d1988 Mon Sep 17 00:00:00 2001 From: Stefan Schake Date: Fri, 2 Oct 2020 14:32:55 +0200 Subject: [PATCH 64/97] ipq40xx: add support for devolo Magic 2 WiFi next SOC: IPQ4018 / QCA Dakota CPU: Quad-Core ARMv7 Processor rev 5 (v71) Cortex-A7 DRAM: 256 MiB NOR: 32 MiB ETH: Qualcomm Atheros QCA8075 (2 ports) PLC: MaxLinear G.hn 88LX5152 WLAN1: Qualcomm Atheros QCA4018 2.4GHz 802.11bgn 2:2x2 WLAN2: Qualcomm Atheros QCA4018 5GHz 802.11a/n/ac 2:2x2 INPUT: RESET, WiFi, PLC Button LEDS: red/white home, white WiFi To modify a retail device to run OpenWRT firmware: 1) Setup a TFTP server on IP address 192.168.0.100 and copy the OpenWRT initramfs (initramfs-fit-uImage.itb) to the TFTP root as 'uploadfile'. 2) Power on the device while pressing the recessed reset button next to the Ethernet ports. This causes the bootloader to retrieve and start the initramfs. 3) Once the initramfs is booted, the device will come up with IP 192.168.1.1. You can then connect through SSH (allow some time for the first connection). 4) On the device shell, run 'fw_printenv' to show the U-boot environment. Backup this information since it contains device unique factory data. 5) Change the boot command to support booting OpenWRT: # fw_setenv bootcmd 'sf probe && sf read 0x84000000 0x180000 0x400000 && bootm' 6) Change directory to /tmp, download the sysupgrade (e.g. through wget) and install it with sysupgrade. The device will reboot into OpenWRT. Notice that there is currently no support for booting the G.hn chip. This requires userland software we lack the rights to share right now. Signed-off-by: Stefan Schake --- package/boot/uboot-envtools/files/ipq40xx | 1 + package/firmware/ipq-wifi/Makefile | 2 + .../board-devolo_magic-2-wifi-next.qca4019 | Bin 0 -> 24340 bytes .../ipq40xx/base-files/etc/board.d/02_network | 7 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 8 + .../preinit/06_set_preinit_iface_ipq40xx.sh | 3 + .../dts/qcom-ipq4018-magic-2-wifi-next.dts | 268 ++++++++++++++++++ target/linux/ipq40xx/image/Makefile | 19 ++ .../901-arm-boot-add-dts-files.patch | 3 +- 9 files changed, 310 insertions(+), 1 deletion(-) create mode 100644 package/firmware/ipq-wifi/board-devolo_magic-2-wifi-next.qca4019 create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-magic-2-wifi-next.dts diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx index bcb4c5c962..34aea1b999 100644 --- a/package/boot/uboot-envtools/files/ipq40xx +++ b/package/boot/uboot-envtools/files/ipq40xx @@ -32,6 +32,7 @@ ubootenv_mtdinfo () { case "$board" in alfa-network,ap120c-ac |\ +devolo,magic-2-wifi-next |\ edgecore,ecw5211 |\ glinet,gl-b1300 |\ luma,wrtq-329acn |\ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index dfb9e0feb3..f1a0c1c474 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -30,6 +30,7 @@ ALLWIFIBOARDS:= \ avm_fritzrepeater-1200 \ buffalo_wtr-m2133hp \ cellc_rtl30vw \ + devolo_magic-2-wifi-next \ dlink_dap2610 \ edgecore_ecw5410 \ edgecore_oap100 \ @@ -110,6 +111,7 @@ $(eval $(call generate-ipq-wifi-package,aruba_ap-303,Aruba AP-303)) $(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-1200,AVM FRITZRepeater 1200)) $(eval $(call generate-ipq-wifi-package,buffalo_wtr-m2133hp,Buffalo WTR-M2133HP)) $(eval $(call generate-ipq-wifi-package,cellc_rtl30vw, Cell C RTL30VW)) +$(eval $(call generate-ipq-wifi-package,devolo_magic-2-wifi-next,devolo Magic 2 WiFi next)) $(eval $(call generate-ipq-wifi-package,dlink_dap2610,D-Link DAP-2610)) $(eval $(call generate-ipq-wifi-package,edgecore_ecw5410,Edgecore ECW5410)) $(eval $(call generate-ipq-wifi-package,edgecore_oap100,Edgecore OAP100)) diff --git a/package/firmware/ipq-wifi/board-devolo_magic-2-wifi-next.qca4019 b/package/firmware/ipq-wifi/board-devolo_magic-2-wifi-next.qca4019 new file mode 100644 index 0000000000000000000000000000000000000000..cf86721feabb1cbceb2ffe470dccd6628355062a GIT binary patch literal 24340 zcmeHPYfuwe7QP@a6-GJPSt|AytV;B5G8Xt3-#(n(8$g z2RIiW&dZNF8}Hx%)*WZX<)avz2Z19f1Ym=!C)x#YD~N@?8+_1-P#BA*0w6Xv_CK#) zfh3L#c>V8l$)>iBL+AB=8y`44nLnzViUi(5nSadk{-)VOp0FD9FbT@hq`&KvX)~U% zGUB^&8)m2E1L`qrm{B+^a|?akhcIsWJ@avvbyS&oW5a#acry)lHp#|~pM7SN1I=Io zjqPKYy3k28D|0h=F+AScsa9nwlV6PYcQltOvop6&j`W}EtW|xHxn*(`YIUl-%-_C- za_62f9K0MEKhasK+Nn%=G1`B!xk9PPOq#rfhAA^MrO@F_XCt&FQV!vp!OLsoEzSFs z37L`5wY|ASnGT2D=R}7WgZk+-m-2*C}ybK*_hGjryHuM2)=i$5(1vGRg#* z?1V?xs@t=w!}fTm-@Kvfm3RK8(ZAxsc*8){@xU5(;nK2ZygwEK&K{dEwwI5ee?Xww z8T(E}@3AvNpCY=-aBy&RbaX)5b?cm+on2dHc5D!LPCP!U#K7`C|D3A z5ac_#ftf25`iU9qN+8hP-O#Xmw<1FdHg0rrp(03yp}_({Al%`&{`d8pH(pSqY{(ek z?&|2|^gnW_1EBM#W?8vy%~(y>7@WT5c-I(eC{o0XgdqtL@Npic@n^Ng*+NJ`zOxFY zkuhwy(V>Fj7?z5sVlj9OR&(^&@%GbQ7kU>ez!!;+k53PdBp@K*GJKhl(l*mOwk;gP z!dYV0Qx?X>xni!u6Zgb?aTzWX%bv=xEIdn`rAWb3FgY&4C1S}_36_8-h!Ygicr+%( zXOl1t(W`)m#GlLM`svM7Q#y{0Z2}}gd_F&Lz|2aonv(bSo-L8bn=KMfM(?&#ROsY}i^e4?1^iP8-I|Tj&zy-6spZM)!JItj!*-Ntqg~dG;BU7?dm^z?>Qu zfSF@nlPJwWfZ1UXU=UysU=UysU=Uct2>3{Rut3)5lFzYStawR0mdtW93CJrxKXm7j z`8H`$vM|PalPp_|HT)DZrP~Vv)~*m(JMI(1MRA})H}MPr*f;40C!WpkKe2L{bnOg* zi>??*i332#!W_JzbkFn`XZi>?3?zXhrxbvJzdsVT0uTd&F#!0Gcq4#(9#cz#cA2yA zxy)7g57=%Kzx7|68j-_w~0xmE+I=OuV zYO5X_r3##r4_pFi@lczuMLmg zp1A+;FF*YB%=QD|-Kv(IYJgk^Rj@itE1~2Xs6y6ZS_LK7KNXS=(+a5VAX@aWe{}8i zq*?7{S+i!GlYg+htLMrM;@;HXEa|Jg&c)`(dBeeYI8V$|a6tN-bWDLO#0o_^h4S2_MykZe9O>MFKdl=^X zd7;2^^Y2lPCY&ILvHAqcCG$Y{d?ruw4zkVh8 z_bHq~&U4z|I#^fl=;)|*1IbbFxi%9U9On&PlgqkH(eus%+TB%%5^bK0kwJh#fI+}c z5GX8E=2QH87R%FvD#}LweIe!V;o#TFbvTeZOn7 zNm*I`y(yIsPL8*`z}EaPh58YM`IdyC?Za%*OTwIckMt$d??V-ELDB51#RBzxFT?56 z#wtQ#h|%$;JB*b?wn3r`n7U`^(H<$tkcLj(A+G7P>H;Yb{buZPZ+HZlzF=%7l!g?Y zX!?>-OYAqubWy~FVNk6u$dN`){mF1%t0|C4`N+Yb4-W^^eZ~{SAw#Zi+w_3(G*M;P zqZJX~>Uz|*@^q;LI$Y3JnH;X@!-W72J4@8)^3+?VuNyBAO}c&RBw|X}udbKxi0~yN zRI2w=DH-}uN(N&mQK?NY2$>!-o+D~?d(_*B?{s=~gIpfrKXu=5iA*UFrF5k)0!HXH zenpgMx68TEwS!P;WpaPwkA?xYMxH8-GJZ!4>6+DhrCj7N&?gK7(>=ykqEMS4_nX!m z+lf+blH3m_qSqcR$d(F?_lQ1St$LR{go+@9DV;Mm5&N_fIcNH7<1s=BHO%;cxC*gM zk>W4zPF*%Ms?+3tR0LRqEwTzP^_i5cc>)=f7?dm^U=OE;h0+)^MBv>A^IC%A-szU# z?T8Wa{9LYgR2_(y1Os<@vh*`FhnMxf~aGvUUAACt~Wo_Im7iaI5%y!f}43 z*Zzlwssp*{ks+AV#85-+4!I!0i`%K+buzBOx4>O~cl7s{q-}v3uY(i4^(C3xBZJv4 zBZh{$Ooc@1HE60Y)4k4#EW~jYwwqFYQcV1%AJwA z%QdiRbqRW3u=qq=fBMZk24|X@@_B1JzB0@t$;2*pb z2R}F{ND!3oylU>ov5*^YqTjpGtlckMH@C*JFoubKzkbDr6i`}p_hCN${oGkl!XkV0uIY%|^UhL4jP8TZ$0IL)}#Vhcfc)*5wnKd8;6mYJo>KZzbDRPp24?PmehD zuB{tjL%lPfl|))MdDWdE4l zdlY+R`S;|zHQdbH#te1T3Y(e1q*4by#C938`l$SSi*;B$U^}|YIF;?eKQRxBSXn$^ zdx6V1mBrxJtQlM4+?(5Bu6#a97)F|>BP(gQn8XSkfDxA^pT+U-!-60d2!|!sZOuIP H&A +#include + +/ { + model = "devolo Magic 2 WiFi next"; + compatible = "devolo,magic-2-wifi-next"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 59 GPIO_ACTIVE_LOW>; + reset-delay-us = <2000>; + + /delete-node/ ethernet-phy@0; + /delete-node/ ethernet-phy@1; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + switch_lan_bmp = <0x3e>; + switch_wan_bmp = <0x0>; + }; + + edma@c080000 { + status = "okay"; + qcom,num_gmac = <3>; + + gmac0 { + qcom,phy_mdio_addr = <3>; + qcom,poll_required = <1>; + /delete-property/ qcom,forced_speed; + /delete-property/ qcom,forced_duplex; + vlan_tag = <1 0x10>; + }; + + gmac1 { + qcom,phy_mdio_addr = <2>; + qcom,poll_required = <1>; + /delete-property/ qcom,forced_speed; + /delete-property/ qcom,forced_duplex; + vlan_tag = <1 0x08>; + }; + + gmac2 { + local-mac-address = [00 00 00 00 00 00]; + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + /delete-property/ qcom,forced_speed; + /delete-property/ qcom,forced_duplex; + vlan_tag = <1 0x20>; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + plc { + gpio-export,name = "plc-enable"; + gpio-export,output = <1>; + gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; + }; + }; + + }; + + keys { + compatible = "gpio-keys"; + + wlan { + label = "WLAN"; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "Reset"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + status_dlan { + label = "white:dlan"; + gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + status_wlan { + label = "white:wlan"; + gpios = <&tlmm 58 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + error_dlan { + label = "red:dlan"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + }; + }; +}; + +&tlmm { + spi_0_pins: spi_0_pinmux { + mux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + mux_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio53"; + function = "mdio"; + bias-pull-up; + }; + mux_2 { + pins = "gpio52"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio61", "gpio60"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + button_pins: button_pinmux { + mux { + function = "gpio"; + pins = "gpio0", "gpio5"; + bias-disable; + input; + }; + }; +}; + +&cryptobam { + status = "okay"; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "devolo,magic-2-wifi-next"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "devolo,magic-2-wifi-next"; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + linux,modalias = "n25q128a11"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + partition@40000 { + label = "MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + partition@60000 { + label = "QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + partition@c0000 { + label = "CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + partition@d0000 { + label = "DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + partition@e0000 { + label = "APPSBLENV"; /* uboot env*/ + reg = <0x000e0000 0x00010000>; + }; + partition@f0000 { + label = "APPSBL"; /* uboot */ + reg = <0x000f0000 0x00080000>; + read-only; + }; + partition@170000 { + label = "ART"; + reg = <0x00170000 0x00010000>; + read-only; + }; + firmware@180000 { + compatible = "denx,fit"; + label = "firmware"; + reg = <0x00180000 0x01a80000>; + }; + }; + }; +}; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 86bf5a2ccb..487f3b5638 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -317,6 +317,25 @@ define Device/compex_wpj428 endef TARGET_DEVICES += compex_wpj428 +define Device/devolo_magic-2-wifi-next + $(call Device/FitImage) + DEVICE_VENDOR := devolo + DEVICE_MODEL := Magic 2 WiFi next + SOC := qcom-ipq4018 + KERNEL_SIZE := 4096k + + # If the bootloader sees 0xDEADC0DE and this trailer at the 64k boundary of a TFTP image + # it will bootm it, just like we want for the initramfs. + KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to 64k |\ + append-string -e '\xDE\xAD\xC0\xDE{"fl_initramfs":""}\x00' + + IMAGE_SIZE := 26624k + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next uboot-envtools +endef +TARGET_DEVICES += devolo_magic-2-wifi-next + define Device/dlink_dap-2610 $(call Device/FitImageLzma) DEVICE_VENDOR := D-Link diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index c4502aa3f7..d470bb7204 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,56 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,57 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -18,6 +18,7 @@ Signed-off-by: John Crispin + qcom-ipq4018-ap120c-ac.dtb \ + qcom-ipq4018-dap-2610.dtb \ + qcom-ipq4018-cs-w3-wd1200g-eup.dtb \ ++ qcom-ipq4018-magic-2-wifi-next.dtb \ + qcom-ipq4018-ea6350v3.dtb \ + qcom-ipq4018-eap1300.dtb \ + qcom-ipq4018-ecw5211.dtb \ From 67790f569514fd612dad3ca4026cde652875be08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Tue, 22 Dec 2020 20:38:13 +0100 Subject: [PATCH 65/97] Revert "ccache: update to 4.1" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b1952dc259ce3eb7ac6023c9e02d5adf2546efca as it's causing issues on the buildbot which uses some kind of ccache wrapper and so the breakage needs to be investigated further: bash: cmake: command not found time: tools/ccache/compile#0.05#0.03#0.15 ERROR: tools/ccache failed to build. Signed-off-by: Petr Štetiar --- tools/ccache/Makefile | 13 ++++++++----- tools/ccache/patches/100-honour-copts.patch | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index ee9ed08b28..6e55001fd5 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -8,22 +8,25 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=4.1 +PKG_VERSION:=3.7.11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=5fdc804056632d722a1182e15386696f0ea6c59cb4ab4d65a54f0b269ae86f99 - -HOST_BUILD_PARALLEL:=1 +PKG_HASH:=8d450208099a4d202bd7df87caaec81baee20ce9dd62da91e9ea7b95a9072f68 include $(INCLUDE_DIR)/host-build.mk -include $(INCLUDE_DIR)/cmake.mk + +HOST_CONFIGURE_VARS += CC="$(HOSTCC_NOCACHE)" define Host/Install/ccache $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ $(CP) ./files/* $(STAGING_DIR_HOST)/bin/ endef +define Host/Clean + -$(MAKE) -C $(HOST_BUILD_DIR) uninstall + $(call Host/Clean/Default) +endef define Host/Install $(call Host/Install/Default) $(call Host/Install/ccache) diff --git a/tools/ccache/patches/100-honour-copts.patch b/tools/ccache/patches/100-honour-copts.patch index e4045ef9be..ccfa1c0247 100644 --- a/tools/ccache/patches/100-honour-copts.patch +++ b/tools/ccache/patches/100-honour-copts.patch @@ -1,10 +1,10 @@ ---- a/src/ccache.cpp -+++ b/src/ccache.cpp -@@ -1654,6 +1654,7 @@ calculate_result_name(Context& ctx, - "CPLUS_INCLUDE_PATH", - "OBJC_INCLUDE_PATH", - "OBJCPLUS_INCLUDE_PATH", // clang -+ "GCC_HONOUR_COPTS", - nullptr}; - for (const char** p = envvars; *p; ++p) { - const char* v = getenv(*p); +--- a/src/ccache.c ++++ b/src/ccache.c +@@ -2277,6 +2277,7 @@ calculate_object_hash(struct args *args, + "CPLUS_INCLUDE_PATH", + "OBJC_INCLUDE_PATH", + "OBJCPLUS_INCLUDE_PATH", // clang ++ "GCC_HONOUR_COPTS", + NULL + }; + for (const char **p = envvars; *p; ++p) { From 8c28da9724636251adf000ef411f57cbff39a383 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Sun, 16 Jun 2019 22:07:50 +0200 Subject: [PATCH 66/97] base-files: drop banner.failsafe if failsafe is disabled Signed-off-by: Piotr Dymacz --- package/base-files/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index fb1267ea5b..47d4e73b42 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:=241 +PKG_RELEASE:=242 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ @@ -202,6 +202,9 @@ define Package/base-files/install $(VERSION_SED_SCRIPT) $(1)/etc/opkg/distfeeds.conf) $(if $(CONFIG_IPK_FILES_CHECKSUMS),, \ rm -f $(1)/sbin/pkg_check) + + $(if $(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE), \ + rm -f $(1)/etc/banner.failsafe,) endef ifneq ($(DUMP),1) From 212ad9163063381fef48aac8628d346df696d2a6 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 22 Dec 2020 20:24:18 +0100 Subject: [PATCH 67/97] ipq806x: remove unneeded empty lines This removes two unneeded empty lines in base-files. Signed-off-by: Adrian Schmutzler --- target/linux/ipq806x/base-files/lib/upgrade/asrock.sh | 1 - target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory | 1 - 2 files changed, 2 deletions(-) diff --git a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh index 71cac3faac..9e1376a578 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh @@ -1,6 +1,5 @@ . /lib/functions.sh - asrock_bootconfig_mangle() { local mtdnum="$( find_mtd_index 0:BOOTCONFIG )" diff --git a/target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory b/target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory index 55aa91eab6..0ab6f176d0 100755 --- a/target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory +++ b/target/linux/ipq806x/base-files/sbin/asrock_g10_back_to_factory @@ -13,4 +13,3 @@ asrock,g10) echo "Unsupported hardware." ;; esac - From d0b7e186e622872626dc462162a66fdff826d2bd Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 19 Dec 2020 20:16:03 +0100 Subject: [PATCH 68/97] ramips: mt7621: create DTSI for ELECOM WRC GS devices with 2 PCI This creates a dedicated DTSI for ELECOM WRC GS devices with 2 PCI WiFi chips in preparation for the 1 chip - dual radio devices, so the latter can reuse part of the common definitions. Signed-off-by: Adrian Schmutzler --- .../ramips/dts/mt7621_elecom_wrc-1750gs.dts | 2 +- .../ramips/dts/mt7621_elecom_wrc-1750gsv.dts | 2 +- .../ramips/dts/mt7621_elecom_wrc-1900gst.dts | 2 +- .../ramips/dts/mt7621_elecom_wrc-2533gst.dts | 2 +- .../ramips/dts/mt7621_elecom_wrc-2533gst2.dts | 2 +- .../ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi | 46 +++++++++++++++++++ .../ramips/dts/mt7621_elecom_wrc-gs.dtsi | 40 ---------------- 7 files changed, 51 insertions(+), 45 deletions(-) create mode 100644 target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts index 320a15d162..71e4c16ddd 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621_elecom_wrc-gs.dtsi" +#include "mt7621_elecom_wrc-gs-2pci.dtsi" / { compatible = "elecom,wrc-1750gs", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts index 5d637dc5fe..6719c347f1 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621_elecom_wrc-gs.dtsi" +#include "mt7621_elecom_wrc-gs-2pci.dtsi" / { compatible = "elecom,wrc-1750gsv", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts index 00a7d5b1e4..675e086a82 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only -#include "mt7621_elecom_wrc-gs.dtsi" +#include "mt7621_elecom_wrc-gs-2pci.dtsi" / { compatible = "elecom,wrc-1900gst", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts index 5026778fdc..dacd540b28 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts @@ -1,4 +1,4 @@ -#include "mt7621_elecom_wrc-gs.dtsi" +#include "mt7621_elecom_wrc-gs-2pci.dtsi" / { compatible = "elecom,wrc-2533gst", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts index 1fa2986bc7..a998b61b73 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621_elecom_wrc-gs.dtsi" +#include "mt7621_elecom_wrc-gs-2pci.dtsi" / { compatible = "elecom,wrc-2533gst2", "mediatek,mt7621-soc"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi new file mode 100644 index 0000000000..642724da10 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include "mt7621_elecom_wrc-gs.dtsi" + +&gmac0 { + mtd-mac-address = <&factory 0xe000>; +}; + +&wan { + mtd-mac-address = <&factory 0xe006>; +}; + +&state_default { + gpio { + groups = "uart3", "jtag", "wdt", "sdhci"; + function = "gpio"; + }; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + + led { + led-sources = <0>; + led-active-low; + }; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <0>; + led-active-low; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi index fd54ead0bc..790c5fed70 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi @@ -83,16 +83,11 @@ }; }; -&gmac0 { - mtd-mac-address = <&factory 0xe000>; -}; - &switch0 { ports { wan: port@0 { status = "okay"; label = "wan"; - mtd-mac-address = <&factory 0xe006>; }; port@1 { @@ -151,45 +146,10 @@ }; }; -&state_default { - gpio { - groups = "uart3", "jtag", "wdt", "sdhci"; - function = "gpio"; - }; -}; - &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>; - - led { - led-sources = <0>; - led-active-low; - }; - }; -}; - -&pcie1 { - wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - ieee80211-freq-limit = <5000000 6000000>; - - led { - led-sources = <0>; - led-active-low; - }; - }; -}; - &xhci { status = "disabled"; }; From a04d733e561f0c44020c89121d43c91f0621442b Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Sat, 28 Nov 2020 18:41:12 +0900 Subject: [PATCH 69/97] ramips: add support for ELECOM WRC-1167GS2-B MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ELECOM WRC-1167GS2-B is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on MT7621A. Specification: - SoC : MediaTek MT7621A - RAM : DDR3 128 MiB - Flash : SPI-NOR 16 MiB - WLAN : 2.4/5 GHz 2T2R (MediaTek MT7615D) - Ethernet : 10/100/1000 Mbps x5 - Switch : MediaTek MT7530 (SoC) - LED/keys : 6x/6x (2x buttons, 1x slide-switch) - UART : through-hole on PCB - J4: 3.3V, GND, TX, RX from ethernet port side - 57600n8 - Power : 12VDC, 1A MAC addresses: LAN : 04:AB:18:**:**:13 (Factory, 0xFFF4 (hex)) WAN : 04:AB:18:**:**:14 (Factory, 0xFFFA (hex)) 2.4 GHz : 04:AB:18:**:**:15 (none) 5 GHz : 04:AB:18:**:**:16 (Factory, 0x4 (hex)) Flash instruction using factory image: 1. Boot WRC-1167GS2-B normally 2. Access to "http://192.168.2.1/" and open firmware update page ("ファームウェア更新") 3. Select the OpenWrt factory image and click apply ("適用") button 4. Wait ~120 seconds to complete flashing Notes: - there is no way to configure the correct MAC address for secondary phy (5GHz) on MT7615D - Wi-Fi band on primary phy (2.4GHz) cannot be limitted by specifying ieee80211-freq-limit (fail to register secondary phy due to error) - mtd-mac-address in the wifi node is required for using mtd-mac-address-increment Signed-off-by: INAGAKI Hiroshi [rebase onto split DTSI patch] Signed-off-by: Adrian Schmutzler --- .../dts/mt7621_elecom_wrc-1167gs2-b.dts | 53 +++++++++++++++++++ .../ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi | 30 +++++++++++ .../ramips/dts/mt7621_elecom_wrc-gs.dtsi | 2 +- target/linux/ramips/image/mt7621.mk | 8 +++ 4 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts create mode 100644 target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts new file mode 100644 index 0000000000..6349fd487e --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_elecom_wrc-gs-1pci.dtsi" + +/ { + compatible = "elecom,wrc-1167gs2-b", "mediatek,mt7621-soc"; + model = "ELECOM WRC-1167GS2-B"; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xfff4>; +}; + +&wan { + mtd-mac-address = <&factory 0xfffa>; +}; + +&partitions { + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xb00000>; + }; + + partition@b50000 { + label = "tm_pattern"; + reg = <0xb50000 0x380000>; + read-only; + }; + + partition@ed0000 { + label = "tm_key"; + reg = <0xed0000 0x80000>; + read-only; + }; + + partition@f50000 { + label = "nvram"; + reg = <0xf50000 0x30000>; + read-only; + }; + + partition@f80000 { + label = "user_data"; + reg = <0xf80000 0x80000>; + read-only; + }; +}; + +&wifi { + mtd-mac-address = <&factory 0x4>; + mtd-mac-address-increment = <(-1)>; +}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi new file mode 100644 index 0000000000..7495453d45 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include "mt7621_elecom_wrc-gs.dtsi" + +&leds { + wlan2g { + label = "white:wlan2g"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "white:wlan5g"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt", "sdhci"; + function = "gpio"; + }; +}; + +&pcie0 { + wifi: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi index 790c5fed70..9cf2b666b4 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi @@ -14,7 +14,7 @@ label-mac-device = &wan; }; - leds { + leds: leds { compatible = "gpio-leds"; led_power_green: power_green { diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index cf81a862ff..7b61529584 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -426,6 +426,14 @@ define Device/elecom_wrc-gs DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware endef +define Device/elecom_wrc-1167gs2-b + $(Device/elecom_wrc-gs) + IMAGE_SIZE := 11264k + DEVICE_MODEL := WRC-1167GS2-B + ELECOM_HWNAME := WRC-1167GS2 +endef +TARGET_DEVICES += elecom_wrc-1167gs2-b + define Device/elecom_wrc-1750gs $(Device/elecom_wrc-gs) IMAGE_SIZE := 11264k From 7ba2f5c96f2697e828c28bf2daf2e4978e950207 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Sat, 28 Nov 2020 18:41:13 +0900 Subject: [PATCH 70/97] ramips: add support for ELECOM WRC-1167GST2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ELECOM WRC-1167GST2 is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on MT7621A. Specification: - SoC : MediaTek MT7621A - RAM : DDR3 256 MiB - Flash : SPI-NOR 32 MiB - WLAN : 2.4/5 GHz 2T2R (MediaTek MT7615D) - Ethernet : 10/100/1000 Mbps x5 - Switch : MediaTek MT7530 (SoC) - LED/keys : 6x/6x (2x buttons, 1x slide-switch) - UART : through-hole on PCB - J4: 3.3V, GND, TX, RX from ethernet port side - 57600n8 - Power : 12VDC, 1A MAC addresses: LAN : 04:AB:18:**:**:07 (Factory, 0xE000 (hex)) WAN : 04:AB:18:**:**:08 (Factory, 0xE006 (hex)) 2.4 GHz : 04:AB:18:**:**:09 (none) 5 GHz : 04:AB:18:**:**:0A (none) Flash instruction using factory image: 1. Boot WRC-1167GST2 normally 2. Access to "http://192.168.2.1/" and open firmware update page ("ファームウェア更新") 3. Select the OpenWrt factory image and click apply ("適用") button 4. Wait ~150 seconds to complete flashing Notes: - there is no way to configure the correct MAC address for secondary phy (5GHz) on MT7615D - Wi-Fi band on primary phy (2.4GHz) cannot be limitted by specifying ieee80211-freq-limit (fail to register secondary phy due to error) - mtd-mac-address in the wifi node is required for using mtd-mac-address-increment Signed-off-by: INAGAKI Hiroshi [rebase onto split DTSI] Signed-off-by: Adrian Schmutzler --- .../ramips/dts/mt7621_elecom_wrc-1167gst2.dts | 53 +++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 8 +++ 2 files changed, 61 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts new file mode 100644 index 0000000000..11b782488a --- /dev/null +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_elecom_wrc-gs-1pci.dtsi" + +/ { + compatible = "elecom,wrc-1167gst2", "mediatek,mt7621-soc"; + model = "ELECOM WRC-1167GST2"; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xe000>; +}; + +&wan { + mtd-mac-address = <&factory 0xe006>; +}; + +&partitions { + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x1800000>; + }; + + partition@1850000 { + label = "tm_pattern"; + reg = <0x1850000 0x400000>; + read-only; + }; + + partition@1c50000 { + label = "tm_key"; + reg = <0x1c50000 0x100000>; + read-only; + }; + + partition@1d50000 { + label = "nvram"; + reg = <0x1d50000 0xb0000>; + read-only; + }; + + partition@1e00000 { + label = "user_data"; + reg = <0x1e00000 0x200000>; + read-only; + }; +}; + +&wifi { + mtd-mac-address = <&factory 0xe006>; + mtd-mac-address-increment = <1>; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 7b61529584..f6b72a699d 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -434,6 +434,14 @@ define Device/elecom_wrc-1167gs2-b endef TARGET_DEVICES += elecom_wrc-1167gs2-b +define Device/elecom_wrc-1167gst2 + $(Device/elecom_wrc-gs) + IMAGE_SIZE := 24576k + DEVICE_MODEL := WRC-1167GST2 + ELECOM_HWNAME := WRC-1167GST2 +endef +TARGET_DEVICES += elecom_wrc-1167gst2 + define Device/elecom_wrc-1750gs $(Device/elecom_wrc-gs) IMAGE_SIZE := 11264k From 920b692667470cf666ebb573f9213eccf3117702 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 23 Dec 2020 00:32:41 +0100 Subject: [PATCH 71/97] toolchain: Fix glibc selection on ARC targets Without this change no libc is selected and the build will fail. This will select glibc for ARC CPUs. Fixes: 95f1002acab5 ("toolchain: default to glibc for ARC") Signed-off-by: Hauke Mehrtens --- toolchain/Config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/toolchain/Config.in b/toolchain/Config.in index bb8729d805..6dda9af92d 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -260,6 +260,7 @@ config GDB Enable if you want to build the gdb. config USE_GLIBC + default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc) bool config USE_MUSL From 3d8d2c3a80813b3e648a49468a0dcb3c7f6a92fa Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 23 Dec 2020 11:22:08 +0100 Subject: [PATCH 72/97] netifd: update to the latest version 88c6003e2b4f netifd: fix a typo in vlandev hotplug support Signed-off-by: Felix Fietkau --- package/network/config/netifd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index ed35719aaa..b25ce559b9 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2020-12-13 -PKG_SOURCE_VERSION:=458b1a7e9473c150a40cae5d8be174f4bb03bd39 -PKG_MIRROR_HASH:=424aefb55aedebfcffd540a2c02a42aeb574b7ebb1a6b546ca9965d9280d82e5 +PKG_SOURCE_DATE:=2020-12-14 +PKG_SOURCE_VERSION:=88c6003e2b4fdc0c990045ff140bf19b37ba745a +PKG_MIRROR_HASH:=6b4c98f1dfff65e4e2bc5aee7c7ad9a48ad530a4acac69ee3cd6809974305900 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 From 1a9b896d8bce5f31a965dd22b01503313436b9ed Mon Sep 17 00:00:00 2001 From: Dobroslaw Kijowski Date: Wed, 26 Aug 2020 10:05:18 +0200 Subject: [PATCH 73/97] treewide: nuke DRIVER_11W_SUPPORT As of hostapd upstream commit 7d2ed8ba "Remove CONFIG_IEEE80211W build parameter" https://w1.fi/cgit/hostap/commit?id=7d2ed8bae86a31dd2df45c24b3f7281d55315482 802.11w feature is always enabled in the build time. It doesn't make sense to opt-in 802.11w per driver as hostapd will always be compiled with this feature enabled. As suggested by Hauke Mehrtens, for now keep 11w enabled in build_features.h for compatibility reasons. This option will be dropped when LuCI is adjusted. Signed-off-by: Dobroslaw Kijowski --- package/kernel/ath10k-ct/Makefile | 4 ++-- package/kernel/mac80211/Makefile | 10 +++++----- package/kernel/mac80211/ath.mk | 8 ++++---- package/kernel/mac80211/broadcom.mk | 6 +++--- package/kernel/mac80211/intel.mk | 2 +- package/kernel/mac80211/ralink.mk | 2 +- package/kernel/mac80211/realtek.mk | 4 ++-- package/kernel/mt76/Makefile | 4 ++-- package/kernel/mwlwifi/Makefile | 4 ++-- package/network/services/hostapd/Config.in | 4 ---- package/network/services/hostapd/Makefile | 6 +----- .../services/hostapd/src/src/utils/build_features.h | 2 -- 12 files changed, 23 insertions(+), 33 deletions(-) diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index e38c7e0b10..b02c6389e7 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-ct -PKG_RELEASE=2 +PKG_RELEASE=3 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= @@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk define KernelPackage/ath10k-ct SUBMENU:=Wireless Drivers TITLE:=ath10k-ct driver optimized for CT ath10k firmware - DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT @PCI_SUPPORT +kmod-hwmon-core + DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT +kmod-hwmon-core FILES:=\ $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \ $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 396b9c4bb8..e2e5b59825 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 PKG_VERSION:=5.8.18-1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.8.18/ PKG_HASH:=f04a8172423c6a945fc7d9844b04f33fda9ae574e552f8f18ee3bdfcfb494563 @@ -265,7 +265,7 @@ endef define KernelPackage/mac80211-hwsim $(call KernelPackage/mac80211/Default) TITLE:=mac80211 HW simulation device - DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko AUTOLOAD:=$(call AutoProbe,mac80211_hwsim) endef @@ -274,7 +274,7 @@ endef define KernelPackage/mt7601u $(call KernelPackage/mac80211/Default) TITLE:=MT7601U-based USB dongles Wireless Driver - DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT @USB_SUPPORT +kmod-usb-core +mt7601u-firmware + DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core +mt7601u-firmware FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko AUTOLOAD:=$(call AutoProbe,mt7601u) endef @@ -290,7 +290,7 @@ endef define KernelPackage/p54-common $(call KernelPackage/p54/Default) - DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +kmod-lib-crc-ccitt +@DRIVER_11W_SUPPORT + DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +kmod-lib-crc-ccitt TITLE+= (COMMON) FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54common.ko endef @@ -388,7 +388,7 @@ $(eval $(call Download,zd1211rw)) define KernelPackage/zd1211rw $(call KernelPackage/mac80211/Default) TITLE:=Zydas ZD1211 support - DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211 +@DRIVER_11W_SUPPORT + DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211 FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zydas/zd1211rw/zd1211rw.ko AUTOLOAD:=$(call AutoProbe,zd1211rw) endef diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/ath.mk index be3f4ed136..957c9da939 100644 --- a/package/kernel/mac80211/ath.mk +++ b/package/kernel/mac80211/ath.mk @@ -134,7 +134,7 @@ define KernelPackage/ath5k $(call KernelPackage/mac80211/Default) TITLE:=Atheros 5xxx wireless cards support URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k - DEPENDS+= @(PCI_SUPPORT||TARGET_ath25) +kmod-ath +@DRIVER_11W_SUPPORT + DEPENDS+= @(PCI_SUPPORT||TARGET_ath25) +kmod-ath FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko AUTOLOAD:=$(call AutoProbe,ath5k) endef @@ -186,7 +186,7 @@ define KernelPackage/ath9k-common TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc) URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k HIDDEN:=1 - DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ath79 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ath79 +kmod-ath +@DRIVER_11N_SUPPORT FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko @@ -250,7 +250,7 @@ define KernelPackage/ath10k $(call KernelPackage/mac80211/Default) TITLE:=Atheros 802.11ac wireless cards support URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath10k - DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT \ + DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT \ +ATH10K_THERMAL:kmod-hwmon-core +ATH10K_THERMAL:kmod-thermal FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \ @@ -280,7 +280,7 @@ endef define KernelPackage/carl9170 $(call KernelPackage/mac80211/Default) TITLE:=Driver for Atheros AR9170 USB sticks - DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT +carl9170-firmware + DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +@DRIVER_11N_SUPPORT +carl9170-firmware FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko AUTOLOAD:=$(call AutoProbe,carl9170) endef diff --git a/package/kernel/mac80211/broadcom.mk b/package/kernel/mac80211/broadcom.mk index 4dfc4e29a7..fb8071e747 100644 --- a/package/kernel/mac80211/broadcom.mk +++ b/package/kernel/mac80211/broadcom.mk @@ -105,7 +105,7 @@ define KernelPackage/b43 CONFIG_HW_RANDOM=y # Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb DEPENDS += \ - @PCI_SUPPORT +@DRIVER_11W_SUPPORT +kmod-mac80211 +kmod-lib-cordic \ + @PCI_SUPPORT +kmod-mac80211 +kmod-lib-cordic \ $(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \ $(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma) FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43/b43.ko @@ -347,7 +347,7 @@ define KernelPackage/b43legacy URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43 KCONFIG:= \ CONFIG_HW_RANDOM=y - DEPENDS+= +kmod-mac80211 +!(TARGET_bcm47xx||TARGET_bcm63xx):kmod-ssb @!TARGET_bcm47xx_mips74k +b43legacy-firmware +@DRIVER_11W_SUPPORT + DEPENDS+= +kmod-mac80211 +!(TARGET_bcm47xx||TARGET_bcm63xx):kmod-ssb @!TARGET_bcm47xx_mips74k +b43legacy-firmware FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43legacy/b43legacy.ko AUTOLOAD:=$(call AutoProbe,b43legacy) MENU:=1 @@ -433,7 +433,7 @@ define KernelPackage/brcmfmac $(call KernelPackage/mac80211/Default) TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211 - DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT \ + DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT \ +kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc @!TARGET_uml \ +BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko diff --git a/package/kernel/mac80211/intel.mk b/package/kernel/mac80211/intel.mk index a8ae4ff7c7..8bab727a41 100644 --- a/package/kernel/mac80211/intel.mk +++ b/package/kernel/mac80211/intel.mk @@ -15,7 +15,7 @@ config-$(call config_package,ipw2200) += IPW2200 define KernelPackage/iwlwifi $(call KernelPackage/mac80211/Default) - DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT TITLE:=Intel AGN Wireless support FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \ diff --git a/package/kernel/mac80211/ralink.mk b/package/kernel/mac80211/ralink.mk index 6aca170773..7bbdc1c22c 100644 --- a/package/kernel/mac80211/ralink.mk +++ b/package/kernel/mac80211/ralink.mk @@ -90,7 +90,7 @@ endef define KernelPackage/rt2800-lib $(call KernelPackage/rt2x00/Default) - DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-lib-crc-ccitt +@DRIVER_11N_SUPPORT HIDDEN:=1 TITLE+= (rt2800 LIB) FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800lib.ko diff --git a/package/kernel/mac80211/realtek.mk b/package/kernel/mac80211/realtek.mk index bcf35e35c4..75cb94d7b6 100644 --- a/package/kernel/mac80211/realtek.mk +++ b/package/kernel/mac80211/realtek.mk @@ -63,7 +63,7 @@ endef define KernelPackage/rtlwifi $(call KernelPackage/mac80211/Default) TITLE:=Realtek common driver part - DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +@DRIVER_11N_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtlwifi/rtlwifi.ko HIDDEN:=1 endef @@ -178,7 +178,7 @@ endef define KernelPackage/rtw88 $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822BE/RTL8822CE/RTL8723DE - DEPENDS+= @(PCI_SUPPORT) +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + DEPENDS+= @(PCI_SUPPORT) +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT FILES:=\ $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko \ diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 8e971f2ada..d22cf8d2ce 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mt76 -PKG_RELEASE=3 +PKG_RELEASE=4 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= @@ -39,7 +39,7 @@ define KernelPackage/mt76-default SUBMENU:=Wireless Drivers DEPENDS:= \ +kmod-mac80211 \ - +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT + +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT endef define KernelPackage/mt76 diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 79addeda8a..ebd88bb352 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_RELEASE=1 +PKG_RELEASE=2 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= @@ -28,7 +28,7 @@ include $(INCLUDE_DIR)/package.mk define KernelPackage/mwlwifi SUBMENU:=Wireless Drivers TITLE:=Marvell 88W8864/88W8897/88W8964/88W8997 wireless driver - DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT @PCI_SUPPORT @TARGET_mvebu + DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT @PCI_SUPPORT @TARGET_mvebu FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko AUTOLOAD:=$(call AutoLoad,50,mwlwifi) endef diff --git a/package/network/services/hostapd/Config.in b/package/network/services/hostapd/Config.in index 8aa878d207..5c00f3e24e 100644 --- a/package/network/services/hostapd/Config.in +++ b/package/network/services/hostapd/Config.in @@ -79,10 +79,6 @@ config DRIVER_11AX_SUPPORT bool default n -config DRIVER_11W_SUPPORT - bool - default n - config WPA_ENABLE_WEP bool "Enable support for unsecure and obsolete WEP" help diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 45e2e3e337..deb1d565bb 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=19 +PKG_RELEASE:=20 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -94,10 +94,6 @@ DRIVER_MAKEOPTS= \ CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \ CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \ -ifneq ($(LOCAL_VARIANT),mini) - DRIVER_MAKEOPTS += CONFIG_IEEE80211W=$(CONFIG_DRIVER_11W_SUPPORT) -endif - ifeq ($(SSL_VARIANT),openssl) DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y TARGET_LDFLAGS += -lcrypto -lssl diff --git a/package/network/services/hostapd/src/src/utils/build_features.h b/package/network/services/hostapd/src/src/utils/build_features.h index 7ca65fa391..c7fccad413 100644 --- a/package/network/services/hostapd/src/src/utils/build_features.h +++ b/package/network/services/hostapd/src/src/utils/build_features.h @@ -23,10 +23,8 @@ static inline int has_feature(const char *feat) if (!strcmp(feat, "11r")) return 1; #endif -#ifdef CONFIG_IEEE80211W if (!strcmp(feat, "11w")) return 1; -#endif #ifdef CONFIG_ACS if (!strcmp(feat, "acs")) return 1; From 49795690e6986d537a8202b9b5b50df6d9be8916 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 17 Dec 2020 18:34:25 +0100 Subject: [PATCH 74/97] ipq40xx: refresh kernel config Generic kernel config changed a lot, so lets refresh ipq40xx to reduce the diff. Signed-off-by: Robert Marko --- target/linux/ipq40xx/config-5.4 | 66 --------------------------------- 1 file changed, 66 deletions(-) diff --git a/target/linux/ipq40xx/config-5.4 b/target/linux/ipq40xx/config-5.4 index b8cd8da408..d8945aa293 100644 --- a/target/linux/ipq40xx/config-5.4 +++ b/target/linux/ipq40xx/config-5.4 @@ -4,22 +4,6 @@ CONFIG_ALIGNMENT_TRAP=y CONFIG_AR40XX_PHY=y CONFIG_ARCH_32BIT_OFF_T=y CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_ARCH_HAS_BINFMT_FLAT=y -CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_ARCH_HAS_FORTIFY_SOURCE=y -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_KCOV=y -CONFIG_ARCH_HAS_KEEPINITRD=y -CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y -CONFIG_ARCH_HAS_PHYS_TO_DMA=y -CONFIG_ARCH_HAS_SETUP_DMA_OPS=y -CONFIG_ARCH_HAS_SET_MEMORY=y -CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y -CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y -CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_IPQ40XX=y CONFIG_ARCH_KEEP_MEMBLOCK=y @@ -35,15 +19,7 @@ CONFIG_ARCH_NR_GPIO=0 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y CONFIG_ARCH_QCOM=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y -CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_ARM=y CONFIG_ARM_AMBA=y CONFIG_ARM_APPENDED_DTB=y @@ -73,7 +49,6 @@ CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y # CONFIG_CACHE_L2X0 is not set -CONFIG_CC_HAS_KASAN_GENERIC=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y @@ -214,48 +189,7 @@ CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_PFN_VALID=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_ARM_ARCH_TIMER=y -CONFIG_HAVE_ARM_SMCCC=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_COPY_THREAD_TLS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_DEBUG_KMEMLEAK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y -CONFIG_HAVE_EBPF_JIT=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_IDE=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_OPTPROBES=y -CONFIG_HAVE_PCI=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_RSEQ=y CONFIG_HAVE_SMP=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_UID16=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HIGHMEM=y # CONFIG_HIGHPTE is not set CONFIG_HWSPINLOCK=y From 4cdc8d20fa6f0acdac532ad972cd664a5927e9f3 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Fri, 13 Nov 2020 14:24:59 +0100 Subject: [PATCH 75/97] ipq40xx: backport upstream MDIO driver IPQ40xx MDIO driver was upstreamed in kernel version 5.8. So lets backport the upstream version and drop our local one. This also refreshed the kernel config since the symbol name has changed. Signed-off-by: Robert Marko --- target/linux/ipq40xx/config-5.4 | 2 +- ...net-phy-mdio-add-IPQ4019-MDIO-driver.patch | 210 ++++++++++++++++ ...-ARM-dts-qcom-ipq4019-add-MDIO-node.patch} | 0 .../700-net-add-qualcomm-mdio.patch | 225 ------------------ 4 files changed, 211 insertions(+), 226 deletions(-) create mode 100644 target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch rename target/linux/ipq40xx/patches-5.4/{0005-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch => 0005-02-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch} (100%) delete mode 100644 target/linux/ipq40xx/patches-5.4/700-net-add-qualcomm-mdio.patch diff --git a/target/linux/ipq40xx/config-5.4 b/target/linux/ipq40xx/config-5.4 index d8945aa293..5c42be48bd 100644 --- a/target/linux/ipq40xx/config-5.4 +++ b/target/linux/ipq40xx/config-5.4 @@ -233,7 +233,7 @@ CONFIG_MDIO_BITBANG=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MDIO_GPIO=y -CONFIG_MDIO_IPQ40XX=y +CONFIG_MDIO_IPQ4019=y # CONFIG_MDM_GCC_9615 is not set # CONFIG_MDM_LCC_9615 is not set CONFIG_MEMFD_CREATE=y diff --git a/target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch b/target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch new file mode 100644 index 0000000000..d678f761f5 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/0005-01-v5.8-net-phy-mdio-add-IPQ4019-MDIO-driver.patch @@ -0,0 +1,210 @@ +From 466ed24fb22342f3ae1c10758a6a0c6a8c081b2d Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Thu, 30 Apr 2020 11:07:05 +0200 +Subject: [PATCH] net: phy: mdio: add IPQ4019 MDIO driver + +This patch adds the driver for the MDIO interface +inside of Qualcomm IPQ40xx series SoC-s. + +Signed-off-by: Christian Lamparter +Signed-off-by: Robert Marko +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Cc: Luka Perkov +Signed-off-by: David S. Miller +--- + drivers/net/phy/Kconfig | 7 ++ + drivers/net/phy/Makefile | 1 + + drivers/net/phy/mdio-ipq4019.c | 160 +++++++++++++++++++++++++++++++++ + 3 files changed, 168 insertions(+) + create mode 100644 drivers/net/phy/mdio-ipq4019.c + +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -156,6 +156,13 @@ config MDIO_I2C + + This is library mode. + ++config MDIO_IPQ4019 ++ tristate "Qualcomm IPQ4019 MDIO interface support" ++ depends on HAS_IOMEM && OF_MDIO ++ help ++ This driver supports the MDIO interface found in Qualcomm ++ IPQ40xx series Soc-s. ++ + config MDIO_MOXART + tristate "MOXA ART MDIO interface support" + depends on ARCH_MOXART || COMPILE_TEST +--- a/drivers/net/phy/Makefile ++++ b/drivers/net/phy/Makefile +@@ -50,6 +50,7 @@ obj-$(CONFIG_MDIO_CAVIUM) += mdio-cavium + obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o + obj-$(CONFIG_MDIO_HISI_FEMAC) += mdio-hisi-femac.o + obj-$(CONFIG_MDIO_I2C) += mdio-i2c.o ++obj-$(CONFIG_MDIO_IPQ4019) += mdio-ipq4019.o + obj-$(CONFIG_MDIO_MOXART) += mdio-moxart.o + obj-$(CONFIG_MDIO_MSCC_MIIM) += mdio-mscc-miim.o + obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o +--- /dev/null ++++ b/drivers/net/phy/mdio-ipq4019.c +@@ -0,0 +1,160 @@ ++// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause ++/* Copyright (c) 2015, The Linux Foundation. All rights reserved. */ ++/* Copyright (c) 2020 Sartura Ltd. */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define MDIO_ADDR_REG 0x44 ++#define MDIO_DATA_WRITE_REG 0x48 ++#define MDIO_DATA_READ_REG 0x4c ++#define MDIO_CMD_REG 0x50 ++#define MDIO_CMD_ACCESS_BUSY BIT(16) ++#define MDIO_CMD_ACCESS_START BIT(8) ++#define MDIO_CMD_ACCESS_CODE_READ 0 ++#define MDIO_CMD_ACCESS_CODE_WRITE 1 ++ ++#define ipq4019_MDIO_TIMEOUT 10000 ++#define ipq4019_MDIO_SLEEP 10 ++ ++struct ipq4019_mdio_data { ++ void __iomem *membase; ++}; ++ ++static int ipq4019_mdio_wait_busy(struct mii_bus *bus) ++{ ++ struct ipq4019_mdio_data *priv = bus->priv; ++ unsigned int busy; ++ ++ return readl_poll_timeout(priv->membase + MDIO_CMD_REG, busy, ++ (busy & MDIO_CMD_ACCESS_BUSY) == 0, ++ ipq4019_MDIO_SLEEP, ipq4019_MDIO_TIMEOUT); ++} ++ ++static int ipq4019_mdio_read(struct mii_bus *bus, int mii_id, int regnum) ++{ ++ struct ipq4019_mdio_data *priv = bus->priv; ++ unsigned int cmd; ++ ++ /* Reject clause 45 */ ++ if (regnum & MII_ADDR_C45) ++ return -EOPNOTSUPP; ++ ++ if (ipq4019_mdio_wait_busy(bus)) ++ return -ETIMEDOUT; ++ ++ /* issue the phy address and reg */ ++ writel((mii_id << 8) | regnum, priv->membase + MDIO_ADDR_REG); ++ ++ cmd = MDIO_CMD_ACCESS_START | MDIO_CMD_ACCESS_CODE_READ; ++ ++ /* issue read command */ ++ writel(cmd, priv->membase + MDIO_CMD_REG); ++ ++ /* Wait read complete */ ++ if (ipq4019_mdio_wait_busy(bus)) ++ return -ETIMEDOUT; ++ ++ /* Read and return data */ ++ return readl(priv->membase + MDIO_DATA_READ_REG); ++} ++ ++static int ipq4019_mdio_write(struct mii_bus *bus, int mii_id, int regnum, ++ u16 value) ++{ ++ struct ipq4019_mdio_data *priv = bus->priv; ++ unsigned int cmd; ++ ++ /* Reject clause 45 */ ++ if (regnum & MII_ADDR_C45) ++ return -EOPNOTSUPP; ++ ++ if (ipq4019_mdio_wait_busy(bus)) ++ return -ETIMEDOUT; ++ ++ /* issue the phy address and reg */ ++ writel((mii_id << 8) | regnum, priv->membase + MDIO_ADDR_REG); ++ ++ /* issue write data */ ++ writel(value, priv->membase + MDIO_DATA_WRITE_REG); ++ ++ cmd = MDIO_CMD_ACCESS_START | MDIO_CMD_ACCESS_CODE_WRITE; ++ /* issue write command */ ++ writel(cmd, priv->membase + MDIO_CMD_REG); ++ ++ /* Wait write complete */ ++ if (ipq4019_mdio_wait_busy(bus)) ++ return -ETIMEDOUT; ++ ++ return 0; ++} ++ ++static int ipq4019_mdio_probe(struct platform_device *pdev) ++{ ++ struct ipq4019_mdio_data *priv; ++ struct mii_bus *bus; ++ int ret; ++ ++ bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv)); ++ if (!bus) ++ return -ENOMEM; ++ ++ priv = bus->priv; ++ ++ priv->membase = devm_platform_ioremap_resource(pdev, 0); ++ if (IS_ERR(priv->membase)) ++ return PTR_ERR(priv->membase); ++ ++ bus->name = "ipq4019_mdio"; ++ bus->read = ipq4019_mdio_read; ++ bus->write = ipq4019_mdio_write; ++ bus->parent = &pdev->dev; ++ snprintf(bus->id, MII_BUS_ID_SIZE, "%s%d", pdev->name, pdev->id); ++ ++ ret = of_mdiobus_register(bus, pdev->dev.of_node); ++ if (ret) { ++ dev_err(&pdev->dev, "Cannot register MDIO bus!\n"); ++ return ret; ++ } ++ ++ platform_set_drvdata(pdev, bus); ++ ++ return 0; ++} ++ ++static int ipq4019_mdio_remove(struct platform_device *pdev) ++{ ++ struct mii_bus *bus = platform_get_drvdata(pdev); ++ ++ mdiobus_unregister(bus); ++ ++ return 0; ++} ++ ++static const struct of_device_id ipq4019_mdio_dt_ids[] = { ++ { .compatible = "qcom,ipq4019-mdio" }, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, ipq4019_mdio_dt_ids); ++ ++static struct platform_driver ipq4019_mdio_driver = { ++ .probe = ipq4019_mdio_probe, ++ .remove = ipq4019_mdio_remove, ++ .driver = { ++ .name = "ipq4019-mdio", ++ .of_match_table = ipq4019_mdio_dt_ids, ++ }, ++}; ++ ++module_platform_driver(ipq4019_mdio_driver); ++ ++MODULE_DESCRIPTION("ipq4019 MDIO interface driver"); ++MODULE_AUTHOR("Qualcomm Atheros"); ++MODULE_LICENSE("Dual BSD/GPL"); diff --git a/target/linux/ipq40xx/patches-5.4/0005-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch b/target/linux/ipq40xx/patches-5.4/0005-02-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch similarity index 100% rename from target/linux/ipq40xx/patches-5.4/0005-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch rename to target/linux/ipq40xx/patches-5.4/0005-02-v5.8-02-ARM-dts-qcom-ipq4019-add-MDIO-node.patch diff --git a/target/linux/ipq40xx/patches-5.4/700-net-add-qualcomm-mdio.patch b/target/linux/ipq40xx/patches-5.4/700-net-add-qualcomm-mdio.patch deleted file mode 100644 index 3345d84fb8..0000000000 --- a/target/linux/ipq40xx/patches-5.4/700-net-add-qualcomm-mdio.patch +++ /dev/null @@ -1,225 +0,0 @@ ---- a/drivers/net/phy/Kconfig -+++ b/drivers/net/phy/Kconfig -@@ -577,6 +577,13 @@ config XILINX_GMII2RGMII - the Reduced Gigabit Media Independent Interface(RGMII) between - Ethernet physical media devices and the Gigabit Ethernet controller. - -+config MDIO_IPQ40XX -+ tristate "Qualcomm Atheros ipq40xx MDIO interface" -+ depends on HAS_IOMEM && OF -+ ---help--- -+ This driver supports the MDIO interface found in Qualcomm -+ Atheros ipq40xx Soc chip. -+ - endif # PHYLIB - - config MICREL_KS8995MA ---- a/drivers/net/phy/Makefile -+++ b/drivers/net/phy/Makefile -@@ -50,6 +50,7 @@ obj-$(CONFIG_MDIO_CAVIUM) += mdio-cavium - obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o - obj-$(CONFIG_MDIO_HISI_FEMAC) += mdio-hisi-femac.o - obj-$(CONFIG_MDIO_I2C) += mdio-i2c.o -+obj-$(CONFIG_MDIO_IPQ40XX) += mdio-ipq40xx.o - obj-$(CONFIG_MDIO_MOXART) += mdio-moxart.o - obj-$(CONFIG_MDIO_MSCC_MIIM) += mdio-mscc-miim.o - obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o ---- /dev/null -+++ b/drivers/net/phy/mdio-ipq40xx.c -@@ -0,0 +1,196 @@ -+/* -+ * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. -+ * -+ * Permission to use, copy, modify, and/or distribute this software for -+ * any purpose with or without fee is hereby granted, provided that the -+ * above copyright notice and this permission notice appear in all copies. -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define MDIO_CTRL_0_REG 0x40 -+#define MDIO_CTRL_1_REG 0x44 -+#define MDIO_CTRL_2_REG 0x48 -+#define MDIO_CTRL_3_REG 0x4c -+#define MDIO_CTRL_4_REG 0x50 -+#define MDIO_CTRL_4_ACCESS_BUSY BIT(16) -+#define MDIO_CTRL_4_ACCESS_START BIT(8) -+#define MDIO_CTRL_4_ACCESS_CODE_READ 0 -+#define MDIO_CTRL_4_ACCESS_CODE_WRITE 1 -+#define CTRL_0_REG_DEFAULT_VALUE 0x150FF -+ -+#define IPQ40XX_MDIO_RETRY 1000 -+#define IPQ40XX_MDIO_DELAY 10 -+ -+struct ipq40xx_mdio_data { -+ struct mii_bus *mii_bus; -+ void __iomem *membase; -+ struct device *dev; -+}; -+ -+static int ipq40xx_mdio_wait_busy(struct ipq40xx_mdio_data *am) -+{ -+ int i; -+ -+ for (i = 0; i < IPQ40XX_MDIO_RETRY; i++) { -+ unsigned int busy; -+ -+ busy = readl(am->membase + MDIO_CTRL_4_REG) & -+ MDIO_CTRL_4_ACCESS_BUSY; -+ if (!busy) -+ return 0; -+ -+ /* BUSY might take to be cleard by 15~20 times of loop */ -+ udelay(IPQ40XX_MDIO_DELAY); -+ } -+ -+ dev_err(am->dev, "%s: MDIO operation timed out\n", am->mii_bus->name); -+ -+ return -ETIMEDOUT; -+} -+ -+static int ipq40xx_mdio_read(struct mii_bus *bus, int mii_id, int regnum) -+{ -+ struct ipq40xx_mdio_data *am = bus->priv; -+ int value = 0; -+ unsigned int cmd = 0; -+ -+ lockdep_assert_held(&bus->mdio_lock); -+ -+ if (ipq40xx_mdio_wait_busy(am)) -+ return -ETIMEDOUT; -+ -+ /* issue the phy address and reg */ -+ writel((mii_id << 8) | regnum, am->membase + MDIO_CTRL_1_REG); -+ -+ cmd = MDIO_CTRL_4_ACCESS_START|MDIO_CTRL_4_ACCESS_CODE_READ; -+ -+ /* issue read command */ -+ writel(cmd, am->membase + MDIO_CTRL_4_REG); -+ -+ /* Wait read complete */ -+ if (ipq40xx_mdio_wait_busy(am)) -+ return -ETIMEDOUT; -+ -+ /* Read data */ -+ value = readl(am->membase + MDIO_CTRL_3_REG); -+ -+ return value; -+} -+ -+static int ipq40xx_mdio_write(struct mii_bus *bus, int mii_id, int regnum, -+ u16 value) -+{ -+ struct ipq40xx_mdio_data *am = bus->priv; -+ unsigned int cmd = 0; -+ -+ lockdep_assert_held(&bus->mdio_lock); -+ -+ if (ipq40xx_mdio_wait_busy(am)) -+ return -ETIMEDOUT; -+ -+ /* issue the phy address and reg */ -+ writel((mii_id << 8) | regnum, am->membase + MDIO_CTRL_1_REG); -+ -+ /* issue write data */ -+ writel(value, am->membase + MDIO_CTRL_2_REG); -+ -+ cmd = MDIO_CTRL_4_ACCESS_START|MDIO_CTRL_4_ACCESS_CODE_WRITE; -+ /* issue write command */ -+ writel(cmd, am->membase + MDIO_CTRL_4_REG); -+ -+ /* Wait write complete */ -+ if (ipq40xx_mdio_wait_busy(am)) -+ return -ETIMEDOUT; -+ -+ return 0; -+} -+ -+static int ipq40xx_mdio_probe(struct platform_device *pdev) -+{ -+ struct ipq40xx_mdio_data *am; -+ struct resource *res; -+ int i; -+ -+ am = devm_kzalloc(&pdev->dev, sizeof(*am), GFP_KERNEL); -+ if (!am) -+ return -ENOMEM; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (!res) { -+ dev_err(&pdev->dev, "no iomem resource found\n"); -+ return -ENXIO; -+ } -+ -+ am->membase = devm_ioremap_resource(&pdev->dev, res); -+ if (IS_ERR(am->membase)) { -+ dev_err(&pdev->dev, "unable to ioremap registers\n"); -+ return PTR_ERR(am->membase); -+ } -+ -+ am->mii_bus = devm_mdiobus_alloc(&pdev->dev); -+ if (!am->mii_bus) -+ return -ENOMEM; -+ -+ writel(CTRL_0_REG_DEFAULT_VALUE, am->membase + MDIO_CTRL_0_REG); -+ -+ am->mii_bus->name = "ipq40xx_mdio"; -+ am->mii_bus->read = ipq40xx_mdio_read; -+ am->mii_bus->write = ipq40xx_mdio_write; -+ am->mii_bus->priv = am; -+ am->mii_bus->parent = &pdev->dev; -+ snprintf(am->mii_bus->id, MII_BUS_ID_SIZE, "%s", dev_name(&pdev->dev)); -+ -+ am->dev = &pdev->dev; -+ platform_set_drvdata(pdev, am); -+ -+ return of_mdiobus_register(am->mii_bus, pdev->dev.of_node); -+} -+ -+static int ipq40xx_mdio_remove(struct platform_device *pdev) -+{ -+ struct ipq40xx_mdio_data *am = platform_get_drvdata(pdev); -+ -+ mdiobus_unregister(am->mii_bus); -+ -+ return 0; -+} -+ -+static const struct of_device_id ipq40xx_mdio_dt_ids[] = { -+ { .compatible = "qcom,ipq4019-mdio" }, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, ipq40xx_mdio_dt_ids); -+ -+static struct platform_driver ipq40xx_mdio_driver = { -+ .probe = ipq40xx_mdio_probe, -+ .remove = ipq40xx_mdio_remove, -+ .driver = { -+ .name = "ipq40xx-mdio", -+ .of_match_table = ipq40xx_mdio_dt_ids, -+ }, -+}; -+ -+module_platform_driver(ipq40xx_mdio_driver); -+ -+#define DRV_VERSION "1.0" -+ -+MODULE_DESCRIPTION("IPQ40XX MDIO interface driver"); -+MODULE_AUTHOR("Qualcomm Atheros"); -+MODULE_VERSION(DRV_VERSION); -+MODULE_LICENSE("Dual BSD/GPL"); From 03bae3cafd92d21dd58686c702b2c4d5d69c946c Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 7 Oct 2020 17:27:31 +0200 Subject: [PATCH 76/97] ipq40xx: edma: convert to of_mdio_find_bus() With the reworked MDIO driver, EDMA will fail to get the MII BUS as it used the MII BUS stored inside the MDIO structure private data. This obviously does not work with the modernized driver, so lets switch to using a purpose build of_mdio_find_bus() which will return the MII BUS and only requires the MDIO node to be passed. This is easy as we already have the node parsed. Also, since we now require OF_MDIO add that as dependency. Signed-off-by: Robert Marko --- .../net/ethernet/qualcomm/essedma/edma_axi.c | 25 +++---------------- ...add-qualcomm-essedma-ethernet-driver.patch | 5 ++-- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c index 68718de9f4..af55ee4dd5 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -713,9 +714,7 @@ static int edma_axi_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct device_node *pnp; struct device_node *mdio_node = NULL; - struct platform_device *mdio_plat = NULL; struct mii_bus *miibus = NULL; - struct edma_mdio_data *mdio_data = NULL; int i, j, k, err = 0; int portid_bmp; int idx = 0, idx_mac = 0; @@ -889,25 +888,9 @@ static int edma_axi_probe(struct platform_device *pdev) goto err_mdiobus_init_fail; } - mdio_plat = of_find_device_by_node(mdio_node); - if (!mdio_plat) { - dev_err(&pdev->dev, - "cannot find platform device from mdio node"); - of_node_put(mdio_node); - err = -EIO; - goto err_mdiobus_init_fail; - } - - mdio_data = dev_get_drvdata(&mdio_plat->dev); - if (!mdio_data) { - dev_err(&pdev->dev, - "cannot get mii bus reference from device data"); - of_node_put(mdio_node); - err = -EIO; - goto err_mdiobus_init_fail; - } - - miibus = mdio_data->mii_bus; + miibus = of_mdio_find_bus(mdio_node); + if (!miibus) + return -EINVAL; } if (of_property_read_bool(np, "qcom,single-phy") && diff --git a/target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch b/target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch index 657d81c5c2..793ce72142 100644 --- a/target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch +++ b/target/linux/ipq40xx/patches-5.4/710-net-add-qualcomm-essedma-ethernet-driver.patch @@ -11,13 +11,14 @@ Signed-off-by: Christian Lamparter --- a/drivers/net/ethernet/qualcomm/Kconfig +++ b/drivers/net/ethernet/qualcomm/Kconfig -@@ -62,4 +62,13 @@ config QCOM_EMAC +@@ -62,4 +62,14 @@ config QCOM_EMAC source "drivers/net/ethernet/qualcomm/rmnet/Kconfig" +config ESSEDMA + tristate "Qualcomm Atheros ESS Edma support" -+ ---help--- ++ depends on OF_MDIO ++ help + This driver supports ethernet edma adapter. + Say Y to build this driver. + From b5c93edd7485e8c07b34cb96e180245080454960 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 19 Oct 2020 18:50:00 +0200 Subject: [PATCH 77/97] ipq40xx: add Qualcomm QCA807x driver This adds driver for the Qualcomm QCA8072 and QCA8075 PHY-s. They are 2 or 5 port IEEE 802.3 clause 22 compliant 10BASE-Te, 100BASE-TX and 1000BASE-T PHY-s. They feature 2 SerDes, one for PSGMII or QSGMII connection with MAC, while second one is SGMII for connection to MAC or fiber. Both models have a combo port that supports 1000BASE-X and 100BASE-FX fiber. Each PHY inside of QCA807x series has 2 digitally controlled output only pins that natively drive LED-s. But some vendors used these to driver generic LED-s controlled by user space, so lets enable registering each PHY as GPIO controller and add driver for it. This also adds the ability to specify DT properties so that 1000 Base-T LED will also be lit up for 100 and 10 Base connections. This is usually done by U-boot, but boards running mainline U-boot are not configuring this yet. These PHY-s are commonly used in Qualcomm IPQ40xx, IPQ60xx and IPQ807x boards. Signed-off-by: Robert Marko --- target/linux/ipq40xx/config-5.4 | 1 + .../ipq40xx/files/drivers/net/phy/qca807x.c | 828 ++++++++++++++++++ .../706-dt-bindings-net-add-QCA807x-PHY.patch | 61 ++ ...7-net-phy-Add-Qualcom-QCA807x-driver.patch | 50 ++ 4 files changed, 940 insertions(+) create mode 100644 target/linux/ipq40xx/files/drivers/net/phy/qca807x.c create mode 100644 target/linux/ipq40xx/patches-5.4/706-dt-bindings-net-add-QCA807x-PHY.patch create mode 100644 target/linux/ipq40xx/patches-5.4/707-net-phy-Add-Qualcom-QCA807x-driver.patch diff --git a/target/linux/ipq40xx/config-5.4 b/target/linux/ipq40xx/config-5.4 index 5c42be48bd..01c51006d6 100644 --- a/target/linux/ipq40xx/config-5.4 +++ b/target/linux/ipq40xx/config-5.4 @@ -353,6 +353,7 @@ CONFIG_POWER_SUPPLY=y CONFIG_PPS=y CONFIG_PRINTK_TIME=y CONFIG_PTP_1588_CLOCK=y +CONFIG_QCA807X_PHY=y CONFIG_QCOM_A53PLL=y CONFIG_QCOM_BAM_DMA=y # CONFIG_QCOM_COMMAND_DB is not set diff --git a/target/linux/ipq40xx/files/drivers/net/phy/qca807x.c b/target/linux/ipq40xx/files/drivers/net/phy/qca807x.c new file mode 100644 index 0000000000..10d38d94a6 --- /dev/null +++ b/target/linux/ipq40xx/files/drivers/net/phy/qca807x.c @@ -0,0 +1,828 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2020 Sartura Ltd. + * + * Author: Robert Marko + * + * Qualcomm QCA8072 and QCA8075 PHY driver + */ + +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) +#include +#endif +#include +#include + +#include + +#define PHY_ID_QCA8072 0x004dd0b2 +#define PHY_ID_QCA8075 0x004dd0b1 +#define PHY_ID_QCA807X_PSGMII 0x06820805 + +/* Downshift */ +#define QCA807X_SMARTSPEED_EN BIT(5) +#define QCA807X_SMARTSPEED_RETRY_LIMIT_MASK GENMASK(4, 2) +#define QCA807X_SMARTSPEED_RETRY_LIMIT_DEFAULT 5 +#define QCA807X_SMARTSPEED_RETRY_LIMIT_MIN 2 +#define QCA807X_SMARTSPEED_RETRY_LIMIT_MAX 9 + +/* Cable diagnostic test (CDT) */ +#define QCA807X_CDT 0x16 +#define QCA807X_CDT_ENABLE BIT(15) +#define QCA807X_CDT_ENABLE_INTER_PAIR_SHORT BIT(13) +#define QCA807X_CDT_STATUS BIT(11) +#define QCA807X_CDT_MMD3_STATUS 0x8064 +#define QCA807X_CDT_MDI0_STATUS_MASK GENMASK(15, 12) +#define QCA807X_CDT_MDI1_STATUS_MASK GENMASK(11, 8) +#define QCA807X_CDT_MDI2_STATUS_MASK GENMASK(7, 4) +#define QCA807X_CDT_MDI3_STATUS_MASK GENMASK(3, 0) +#define QCA807X_CDT_RESULTS_INVALID 0x0 +#define QCA807X_CDT_RESULTS_OK 0x1 +#define QCA807X_CDT_RESULTS_OPEN 0x2 +#define QCA807X_CDT_RESULTS_SAME_SHORT 0x3 +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OK 0x4 +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OK 0x8 +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OK 0xc +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OPEN 0x6 +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OPEN 0xa +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OPEN 0xe +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_SHORT 0x7 +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_SHORT 0xb +#define QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_SHORT 0xf +#define QCA807X_CDT_RESULTS_BUSY 0x9 +#define QCA807X_CDT_MMD3_MDI0_LENGTH 0x8065 +#define QCA807X_CDT_MMD3_MDI1_LENGTH 0x8066 +#define QCA807X_CDT_MMD3_MDI2_LENGTH 0x8067 +#define QCA807X_CDT_MMD3_MDI3_LENGTH 0x8068 +#define QCA807X_CDT_SAME_SHORT_LENGTH_MASK GENMASK(15, 8) +#define QCA807X_CDT_CROSS_SHORT_LENGTH_MASK GENMASK(7, 0) + +#define QCA807X_CHIP_CONFIGURATION 0x1f +#define QCA807X_BT_BX_REG_SEL BIT(15) +#define QCA807X_CHIP_CONFIGURATION_MODE_CFG_MASK GENMASK(3, 0) +#define QCA807X_CHIP_CONFIGURATION_MODE_QSGMII_SGMII 4 +#define QCA807X_CHIP_CONFIGURATION_MODE_PSGMII_FIBER 3 +#define QCA807X_CHIP_CONFIGURATION_MODE_PSGMII_ALL_COPPER 0 + +#define QCA807X_MEDIA_SELECT_STATUS 0x1a +#define QCA807X_MEDIA_DETECTED_COPPER BIT(5) +#define QCA807X_MEDIA_DETECTED_1000_BASE_X BIT(4) +#define QCA807X_MEDIA_DETECTED_100_BASE_FX BIT(3) + +#define QCA807X_MMD7_FIBER_MODE_AUTO_DETECTION 0x807e +#define QCA807X_MMD7_FIBER_MODE_AUTO_DETECTION_EN BIT(0) + +#define QCA807X_MMD7_1000BASE_T_POWER_SAVE_PER_CABLE_LENGTH 0x801a +#define QCA807X_CONTROL_DAC_MASK GENMASK(2, 0) + +#define QCA807X_MMD7_LED_100N_1 0x8074 +#define QCA807X_MMD7_LED_100N_2 0x8075 +#define QCA807X_MMD7_LED_1000N_1 0x8076 +#define QCA807X_MMD7_LED_1000N_2 0x8077 +#define QCA807X_LED_TXACT_BLK_EN_2 BIT(10) +#define QCA807X_LED_RXACT_BLK_EN_2 BIT(9) +#define QCA807X_LED_GT_ON_EN_2 BIT(6) +#define QCA807X_LED_HT_ON_EN_2 BIT(5) +#define QCA807X_LED_BT_ON_EN_2 BIT(4) +#define QCA807X_GPIO_FORCE_EN BIT(15) +#define QCA807X_GPIO_FORCE_MODE_MASK GENMASK(14, 13) + +#define QCA807X_INTR_ENABLE 0x12 +#define QCA807X_INTR_STATUS 0x13 +#define QCA807X_INTR_ENABLE_AUTONEG_ERR BIT(15) +#define QCA807X_INTR_ENABLE_SPEED_CHANGED BIT(14) +#define QCA807X_INTR_ENABLE_DUPLEX_CHANGED BIT(13) +#define QCA807X_INTR_ENABLE_LINK_FAIL BIT(11) +#define QCA807X_INTR_ENABLE_LINK_SUCCESS BIT(10) + +#define QCA807X_FUNCTION_CONTROL 0x10 +#define QCA807X_FC_MDI_CROSSOVER_MODE_MASK GENMASK(6, 5) +#define QCA807X_FC_MDI_CROSSOVER_AUTO 3 +#define QCA807X_FC_MDI_CROSSOVER_MANUAL_MDIX 1 +#define QCA807X_FC_MDI_CROSSOVER_MANUAL_MDI 0 + +#define QCA807X_PHY_SPECIFIC_STATUS 0x11 +#define QCA807X_SS_SPEED_AND_DUPLEX_RESOLVED BIT(11) +#define QCA807X_SS_SPEED_MASK GENMASK(15, 14) +#define QCA807X_SS_SPEED_1000 2 +#define QCA807X_SS_SPEED_100 1 +#define QCA807X_SS_SPEED_10 0 +#define QCA807X_SS_DUPLEX BIT(13) +#define QCA807X_SS_MDIX BIT(6) + +/* PSGMII PHY specific */ +#define PSGMII_QSGMII_DRIVE_CONTROL_1 0xb +#define PSGMII_QSGMII_TX_DRIVER_MASK GENMASK(7, 4) +#define PSGMII_MODE_CTRL 0x6d +#define PSGMII_MODE_CTRL_AZ_WORKAROUND_MASK GENMASK(3, 0) +#define PSGMII_MMD3_SERDES_CONTROL 0x805a + +struct qca807x_gpio_priv { + struct phy_device *phy; +}; + +static int qca807x_get_downshift(struct phy_device *phydev, u8 *data) +{ + int val, cnt, enable; + + val = phy_read(phydev, MII_NWAYTEST); + if (val < 0) + return val; + + enable = FIELD_GET(QCA807X_SMARTSPEED_EN, val); + cnt = FIELD_GET(QCA807X_SMARTSPEED_RETRY_LIMIT_MASK, val) + 2; + + *data = enable ? cnt : DOWNSHIFT_DEV_DISABLE; + + return 0; +} + +static int qca807x_set_downshift(struct phy_device *phydev, u8 cnt) +{ + int ret, val; + + if (cnt > QCA807X_SMARTSPEED_RETRY_LIMIT_MAX || + (cnt < QCA807X_SMARTSPEED_RETRY_LIMIT_MIN && cnt != DOWNSHIFT_DEV_DISABLE)) + return -EINVAL; + + if (!cnt) { + ret = phy_clear_bits(phydev, MII_NWAYTEST, QCA807X_SMARTSPEED_EN); + } else { + val = QCA807X_SMARTSPEED_EN; + val |= FIELD_PREP(QCA807X_SMARTSPEED_RETRY_LIMIT_MASK, cnt - 2); + + phy_modify(phydev, MII_NWAYTEST, + QCA807X_SMARTSPEED_EN | + QCA807X_SMARTSPEED_RETRY_LIMIT_MASK, + val); + } + + ret = genphy_soft_reset(phydev); + + return ret; +} + +static int qca807x_get_tunable(struct phy_device *phydev, + struct ethtool_tunable *tuna, void *data) +{ + switch (tuna->id) { + case ETHTOOL_PHY_DOWNSHIFT: + return qca807x_get_downshift(phydev, data); + default: + return -EOPNOTSUPP; + } +} + +static int qca807x_set_tunable(struct phy_device *phydev, + struct ethtool_tunable *tuna, const void *data) +{ + switch (tuna->id) { + case ETHTOOL_PHY_DOWNSHIFT: + return qca807x_set_downshift(phydev, *(const u8 *)data); + default: + return -EOPNOTSUPP; + } +} + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) +static bool qca807x_distance_valid(int result) +{ + switch (result) { + case QCA807X_CDT_RESULTS_OPEN: + case QCA807X_CDT_RESULTS_SAME_SHORT: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_SHORT: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_SHORT: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_SHORT: + return true; + } + return false; +} + +static int qca807x_report_length(struct phy_device *phydev, + int pair, int result) +{ + int length; + int ret; + + ret = phy_read_mmd(phydev, MDIO_MMD_PCS, QCA807X_CDT_MMD3_MDI0_LENGTH + pair); + if (ret < 0) + return ret; + + switch (result) { + case ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT: + length = (FIELD_GET(QCA807X_CDT_SAME_SHORT_LENGTH_MASK, ret) * 800) / 10; + break; + case ETHTOOL_A_CABLE_RESULT_CODE_OPEN: + case ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT: + length = (FIELD_GET(QCA807X_CDT_CROSS_SHORT_LENGTH_MASK, ret) * 800) / 10; + break; + } + + ethnl_cable_test_fault_length(phydev, pair, length); + + return 0; +} + +static int qca807x_cable_test_report_trans(int result) +{ + switch (result) { + case QCA807X_CDT_RESULTS_OK: + return ETHTOOL_A_CABLE_RESULT_CODE_OK; + case QCA807X_CDT_RESULTS_OPEN: + return ETHTOOL_A_CABLE_RESULT_CODE_OPEN; + case QCA807X_CDT_RESULTS_SAME_SHORT: + return ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT; + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OK: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_OPEN: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI1_SAME_SHORT: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI2_SAME_SHORT: + case QCA807X_CDT_RESULTS_CROSS_SHORT_WITH_MDI3_SAME_SHORT: + return ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT; + default: + return ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC; + } +} + +static int qca807x_cable_test_report(struct phy_device *phydev) +{ + int pair0, pair1, pair2, pair3; + int ret; + + ret = phy_read_mmd(phydev, MDIO_MMD_PCS, QCA807X_CDT_MMD3_STATUS); + if (ret < 0) + return ret; + + pair0 = FIELD_GET(QCA807X_CDT_MDI0_STATUS_MASK, ret); + pair1 = FIELD_GET(QCA807X_CDT_MDI1_STATUS_MASK, ret); + pair2 = FIELD_GET(QCA807X_CDT_MDI2_STATUS_MASK, ret); + pair3 = FIELD_GET(QCA807X_CDT_MDI3_STATUS_MASK, ret); + + ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_A, + qca807x_cable_test_report_trans(pair0)); + ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_B, + qca807x_cable_test_report_trans(pair1)); + ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_C, + qca807x_cable_test_report_trans(pair2)); + ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_D, + qca807x_cable_test_report_trans(pair3)); + + if (qca807x_distance_valid(pair0)) + qca807x_report_length(phydev, 0, qca807x_cable_test_report_trans(pair0)); + if (qca807x_distance_valid(pair1)) + qca807x_report_length(phydev, 1, qca807x_cable_test_report_trans(pair1)); + if (qca807x_distance_valid(pair2)) + qca807x_report_length(phydev, 2, qca807x_cable_test_report_trans(pair2)); + if (qca807x_distance_valid(pair3)) + qca807x_report_length(phydev, 3, qca807x_cable_test_report_trans(pair3)); + + return 0; +} + +static int qca807x_cable_test_get_status(struct phy_device *phydev, + bool *finished) +{ + int val; + + *finished = false; + + val = phy_read(phydev, QCA807X_CDT); + if (!((val & QCA807X_CDT_ENABLE) && (val & QCA807X_CDT_STATUS))) { + *finished = true; + + return qca807x_cable_test_report(phydev); + } + + return 0; +} + +static int qca807x_cable_test_start(struct phy_device *phydev) +{ + int val, ret; + + val = phy_read(phydev, QCA807X_CDT); + /* Enable inter-pair short check as well */ + val &= ~QCA807X_CDT_ENABLE_INTER_PAIR_SHORT; + val |= QCA807X_CDT_ENABLE; + ret = phy_write(phydev, QCA807X_CDT, val); + + return ret; +} +#endif + +#ifdef CONFIG_GPIOLIB +static int qca807x_gpio_get_direction(struct gpio_chip *gc, unsigned int offset) +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) + return GPIO_LINE_DIRECTION_OUT; +#else + return GPIOF_DIR_OUT; +#endif +} + +static int qca807x_gpio_get_reg(unsigned int offset) +{ + return QCA807X_MMD7_LED_100N_2 + (offset % 2) * 2; +} + +static int qca807x_gpio_get(struct gpio_chip *gc, unsigned int offset) +{ + struct qca807x_gpio_priv *priv = gpiochip_get_data(gc); + int val; + + val = phy_read_mmd(priv->phy, MDIO_MMD_AN, qca807x_gpio_get_reg(offset)); + + return FIELD_GET(QCA807X_GPIO_FORCE_MODE_MASK, val); +} + +static void qca807x_gpio_set(struct gpio_chip *gc, unsigned int offset, int value) +{ + struct qca807x_gpio_priv *priv = gpiochip_get_data(gc); + int val; + + val = phy_read_mmd(priv->phy, MDIO_MMD_AN, qca807x_gpio_get_reg(offset)); + val &= ~QCA807X_GPIO_FORCE_MODE_MASK; + val |= FIELD_PREP(QCA807X_GPIO_FORCE_MODE_MASK, value); + + phy_write_mmd(priv->phy, MDIO_MMD_AN, qca807x_gpio_get_reg(offset), val); +} + +static int qca807x_gpio_dir_out(struct gpio_chip *gc, unsigned int offset, int value) +{ + qca807x_gpio_set(gc, offset, value); + + return 0; +} + +static int qca807x_gpio(struct phy_device *phydev) +{ + struct device *dev = &phydev->mdio.dev; + struct qca807x_gpio_priv *priv; + struct gpio_chip *gc; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->phy = phydev; + + gc = devm_kzalloc(dev, sizeof(*gc), GFP_KERNEL); + if (!gc) + return -ENOMEM; + + gc->label = dev_name(dev); + gc->base = -1; + gc->ngpio = 2; + gc->parent = dev; + gc->owner = THIS_MODULE; + gc->can_sleep = true; + gc->get_direction = qca807x_gpio_get_direction; + gc->direction_output = qca807x_gpio_dir_out; + gc->get = qca807x_gpio_get; + gc->set = qca807x_gpio_set; + + return devm_gpiochip_add_data(dev, gc, priv); +} +#endif + +static int qca807x_read_copper_status(struct phy_device *phydev, bool combo_port) +{ + int ss, err, page, old_link = phydev->link; + + /* Only combo port has dual pages */ + if (combo_port) { + /* Check whether copper page is set and set if needed */ + page = phy_read(phydev, QCA807X_CHIP_CONFIGURATION); + if (!(page & QCA807X_BT_BX_REG_SEL)) { + page |= QCA807X_BT_BX_REG_SEL; + phy_write(phydev, QCA807X_CHIP_CONFIGURATION, page); + } + } + + /* Update the link, but return if there was an error */ + err = genphy_update_link(phydev); + if (err) + return err; + + /* why bother the PHY if nothing can have changed */ + if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link) + return 0; + + phydev->speed = SPEED_UNKNOWN; + phydev->duplex = DUPLEX_UNKNOWN; + phydev->pause = 0; + phydev->asym_pause = 0; + + err = genphy_read_lpa(phydev); + if (err < 0) + return err; + + /* Read the QCA807x PHY-Specific Status register copper page, + * which indicates the speed and duplex that the PHY is actually + * using, irrespective of whether we are in autoneg mode or not. + */ + ss = phy_read(phydev, QCA807X_PHY_SPECIFIC_STATUS); + if (ss < 0) + return ss; + + if (ss & QCA807X_SS_SPEED_AND_DUPLEX_RESOLVED) { + int sfc; + + sfc = phy_read(phydev, QCA807X_FUNCTION_CONTROL); + if (sfc < 0) + return sfc; + + switch (FIELD_GET(QCA807X_SS_SPEED_MASK, ss)) { + case QCA807X_SS_SPEED_10: + phydev->speed = SPEED_10; + break; + case QCA807X_SS_SPEED_100: + phydev->speed = SPEED_100; + break; + case QCA807X_SS_SPEED_1000: + phydev->speed = SPEED_1000; + break; + } + if (ss & QCA807X_SS_DUPLEX) + phydev->duplex = DUPLEX_FULL; + else + phydev->duplex = DUPLEX_HALF; + + if (ss & QCA807X_SS_MDIX) + phydev->mdix = ETH_TP_MDI_X; + else + phydev->mdix = ETH_TP_MDI; + + switch (FIELD_GET(QCA807X_FC_MDI_CROSSOVER_MODE_MASK, sfc)) { + case QCA807X_FC_MDI_CROSSOVER_MANUAL_MDI: + phydev->mdix_ctrl = ETH_TP_MDI; + break; + case QCA807X_FC_MDI_CROSSOVER_MANUAL_MDIX: + phydev->mdix_ctrl = ETH_TP_MDI_X; + break; + case QCA807X_FC_MDI_CROSSOVER_AUTO: + phydev->mdix_ctrl = ETH_TP_MDI_AUTO; + break; + } + } + + if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) + phy_resolve_aneg_pause(phydev); + + return 0; +} + +static int qca807x_read_fiber_status(struct phy_device *phydev, bool combo_port) +{ + int ss, err, page, lpa, old_link = phydev->link; + + /* Check whether fiber page is set and set if needed */ + page = phy_read(phydev, QCA807X_CHIP_CONFIGURATION); + if (page & QCA807X_BT_BX_REG_SEL) { + page &= ~QCA807X_BT_BX_REG_SEL; + phy_write(phydev, QCA807X_CHIP_CONFIGURATION, page); + } + + /* Update the link, but return if there was an error */ + err = genphy_update_link(phydev); + if (err) + return err; + + /* why bother the PHY if nothing can have changed */ + if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link) + return 0; + + phydev->speed = SPEED_UNKNOWN; + phydev->duplex = DUPLEX_UNKNOWN; + phydev->pause = 0; + phydev->asym_pause = 0; + + if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) { + lpa = phy_read(phydev, MII_LPA); + if (lpa < 0) + return lpa; + + linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, + phydev->lp_advertising, lpa & LPA_LPACK); + linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, + phydev->lp_advertising, lpa & LPA_1000XFULL); + linkmode_mod_bit(ETHTOOL_LINK_MODE_Pause_BIT, + phydev->lp_advertising, lpa & LPA_1000XPAUSE); + linkmode_mod_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, + phydev->lp_advertising, + lpa & LPA_1000XPAUSE_ASYM); + + phy_resolve_aneg_linkmode(phydev); + } + + /* Read the QCA807x PHY-Specific Status register fiber page, + * which indicates the speed and duplex that the PHY is actually + * using, irrespective of whether we are in autoneg mode or not. + */ + ss = phy_read(phydev, QCA807X_PHY_SPECIFIC_STATUS); + if (ss < 0) + return ss; + + if (ss & QCA807X_SS_SPEED_AND_DUPLEX_RESOLVED) { + switch (FIELD_GET(QCA807X_SS_SPEED_MASK, ss)) { + case QCA807X_SS_SPEED_100: + phydev->speed = SPEED_100; + break; + case QCA807X_SS_SPEED_1000: + phydev->speed = SPEED_1000; + break; + } + + if (ss & QCA807X_SS_DUPLEX) + phydev->duplex = DUPLEX_FULL; + else + phydev->duplex = DUPLEX_HALF; + } + + return 0; +} + +static int qca807x_read_status(struct phy_device *phydev) +{ + int val; + + /* Check for Combo port */ + if (phy_read(phydev, QCA807X_CHIP_CONFIGURATION)) { + /* Check for fiber mode first */ + if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported)) { + /* Check for actual detected media */ + val = phy_read(phydev, QCA807X_MEDIA_SELECT_STATUS); + if (val & QCA807X_MEDIA_DETECTED_COPPER) { + qca807x_read_copper_status(phydev, true); + } else if ((val & QCA807X_MEDIA_DETECTED_1000_BASE_X) || + (val & QCA807X_MEDIA_DETECTED_100_BASE_FX)) { + qca807x_read_fiber_status(phydev, true); + } + } else { + qca807x_read_copper_status(phydev, true); + } + } else { + qca807x_read_copper_status(phydev, false); + } + + return 0; +} + +static int qca807x_config_intr(struct phy_device *phydev) +{ + int ret, val; + + val = phy_read(phydev, QCA807X_INTR_ENABLE); + + if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { + /* Check for combo port as it has fewer interrupts */ + if (phy_read(phydev, QCA807X_CHIP_CONFIGURATION)) { + val |= QCA807X_INTR_ENABLE_SPEED_CHANGED; + val |= QCA807X_INTR_ENABLE_LINK_FAIL; + val |= QCA807X_INTR_ENABLE_LINK_SUCCESS; + } else { + val |= QCA807X_INTR_ENABLE_AUTONEG_ERR; + val |= QCA807X_INTR_ENABLE_SPEED_CHANGED; + val |= QCA807X_INTR_ENABLE_DUPLEX_CHANGED; + val |= QCA807X_INTR_ENABLE_LINK_FAIL; + val |= QCA807X_INTR_ENABLE_LINK_SUCCESS; + } + ret = phy_write(phydev, QCA807X_INTR_ENABLE, val); + } else { + ret = phy_write(phydev, QCA807X_INTR_ENABLE, 0); + } + + return ret; +} + +static int qca807x_ack_intr(struct phy_device *phydev) +{ + int ret; + + ret = phy_read(phydev, QCA807X_INTR_STATUS); + + return (ret < 0) ? ret : 0; +} + +static int qca807x_led_config(struct phy_device *phydev) +{ + struct device_node *node = phydev->mdio.dev.of_node; + bool led_config = false; + int val; + + val = phy_read_mmd(phydev, MDIO_MMD_AN, QCA807X_MMD7_LED_1000N_1); + if (val < 0) + return val; + + if (of_property_read_bool(node, "qcom,single-led-1000")) { + val |= QCA807X_LED_TXACT_BLK_EN_2; + val |= QCA807X_LED_RXACT_BLK_EN_2; + val |= QCA807X_LED_GT_ON_EN_2; + + led_config = true; + } + + if (of_property_read_bool(node, "qcom,single-led-100")) { + val |= QCA807X_LED_HT_ON_EN_2; + + led_config = true; + } + + if (of_property_read_bool(node, "qcom,single-led-10")) { + val |= QCA807X_LED_BT_ON_EN_2; + + led_config = true; + } + + if (led_config) + return phy_write_mmd(phydev, MDIO_MMD_AN, QCA807X_MMD7_LED_1000N_1, val); + else + return 0; +} + +static const struct sfp_upstream_ops qca807x_sfp_ops = { + .attach = phy_sfp_attach, + .detach = phy_sfp_detach, +}; + +static int qca807x_config(struct phy_device *phydev) +{ + struct device_node *node = phydev->mdio.dev.of_node; + int control_dac, ret = 0; + u32 of_control_dac; + + /* Check for Combo port */ + if (phy_read(phydev, QCA807X_CHIP_CONFIGURATION)) { + int fiber_mode_autodect; + int psgmii_serdes; + int chip_config; + + if (of_property_read_bool(node, "qcom,fiber-enable")) { + /* Enable fiber mode autodection (1000Base-X or 100Base-FX) */ + fiber_mode_autodect = phy_read_mmd(phydev, MDIO_MMD_AN, + QCA807X_MMD7_FIBER_MODE_AUTO_DETECTION); + fiber_mode_autodect |= QCA807X_MMD7_FIBER_MODE_AUTO_DETECTION_EN; + phy_write_mmd(phydev, MDIO_MMD_AN, QCA807X_MMD7_FIBER_MODE_AUTO_DETECTION, + fiber_mode_autodect); + + /* Enable 4 copper + combo port mode */ + chip_config = phy_read(phydev, QCA807X_CHIP_CONFIGURATION); + chip_config &= ~QCA807X_CHIP_CONFIGURATION_MODE_CFG_MASK; + chip_config |= FIELD_PREP(QCA807X_CHIP_CONFIGURATION_MODE_CFG_MASK, + QCA807X_CHIP_CONFIGURATION_MODE_PSGMII_FIBER); + phy_write(phydev, QCA807X_CHIP_CONFIGURATION, chip_config); + + linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->supported); + linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, phydev->advertising); + } + + /* Prevent PSGMII going into hibernation via PSGMII self test */ + psgmii_serdes = phy_read_mmd(phydev, MDIO_MMD_PCS, PSGMII_MMD3_SERDES_CONTROL); + psgmii_serdes &= ~BIT(1); + ret = phy_write_mmd(phydev, MDIO_MMD_PCS, + PSGMII_MMD3_SERDES_CONTROL, + psgmii_serdes); + } + + if (!of_property_read_u32(node, "qcom,control-dac", &of_control_dac)) { + control_dac = phy_read_mmd(phydev, MDIO_MMD_AN, + QCA807X_MMD7_1000BASE_T_POWER_SAVE_PER_CABLE_LENGTH); + control_dac &= ~QCA807X_CONTROL_DAC_MASK; + control_dac |= FIELD_PREP(QCA807X_CONTROL_DAC_MASK, of_control_dac); + ret = phy_write_mmd(phydev, MDIO_MMD_AN, + QCA807X_MMD7_1000BASE_T_POWER_SAVE_PER_CABLE_LENGTH, + control_dac); + } + + /* Optionally configure LED-s */ + if (IS_ENABLED(CONFIG_GPIOLIB)) { + /* Check whether PHY-s pins are used as GPIO-s */ + if (!of_property_read_bool(node, "gpio-controller")) + ret = qca807x_led_config(phydev); + } else { + ret = qca807x_led_config(phydev); + } + + return ret; +} + +static int qca807x_probe(struct phy_device *phydev) +{ + struct device_node *node = phydev->mdio.dev.of_node; + int ret = 0; + + if (IS_ENABLED(CONFIG_GPIOLIB)) { + /* Do not register a GPIO controller unless flagged for it */ + if (of_property_read_bool(node, "gpio-controller")) + ret = qca807x_gpio(phydev); + } + + /* Attach SFP bus on combo port*/ + if (of_property_read_bool(node, "qcom,fiber-enable")) { + if (phy_read(phydev, QCA807X_CHIP_CONFIGURATION)) + ret = phy_sfp_probe(phydev, &qca807x_sfp_ops); + } + + return ret; +} + +static int qca807x_psgmii_config(struct phy_device *phydev) +{ + struct device_node *node = phydev->mdio.dev.of_node; + int psgmii_az, tx_amp, ret = 0; + u32 tx_driver_strength; + + /* Workaround to enable AZ transmitting ability */ + if (of_property_read_bool(node, "qcom,psgmii-az")) { + psgmii_az = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, PSGMII_MODE_CTRL); + psgmii_az &= ~PSGMII_MODE_CTRL_AZ_WORKAROUND_MASK; + psgmii_az |= FIELD_PREP(PSGMII_MODE_CTRL_AZ_WORKAROUND_MASK, 0xc); + ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, PSGMII_MODE_CTRL, psgmii_az); + psgmii_az = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, PSGMII_MODE_CTRL); + } + + /* PSGMII/QSGMII TX amp set to DT defined value instead of default 600mV */ + if (!of_property_read_u32(node, "qcom,tx-driver-strength", &tx_driver_strength)) { + tx_amp = phy_read(phydev, PSGMII_QSGMII_DRIVE_CONTROL_1); + tx_amp &= ~PSGMII_QSGMII_TX_DRIVER_MASK; + tx_amp |= FIELD_PREP(PSGMII_QSGMII_TX_DRIVER_MASK, tx_driver_strength); + ret = phy_write(phydev, PSGMII_QSGMII_DRIVE_CONTROL_1, tx_amp); + } + + return ret; +} + +static struct phy_driver qca807x_drivers[] = { + { + PHY_ID_MATCH_EXACT(PHY_ID_QCA8072), + .name = "Qualcomm QCA8072", +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) + .flags = PHY_POLL_CABLE_TEST, +#endif + /* PHY_GBIT_FEATURES */ + .probe = qca807x_probe, + .config_init = qca807x_config, + .read_status = qca807x_read_status, + .config_intr = qca807x_config_intr, + .ack_interrupt = qca807x_ack_intr, + .soft_reset = genphy_soft_reset, + .get_tunable = qca807x_get_tunable, + .set_tunable = qca807x_set_tunable, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) + .cable_test_start = qca807x_cable_test_start, + .cable_test_get_status = qca807x_cable_test_get_status, +#endif + }, + { + PHY_ID_MATCH_EXACT(PHY_ID_QCA8075), + .name = "Qualcomm QCA8075", +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) + .flags = PHY_POLL_CABLE_TEST, +#endif + /* PHY_GBIT_FEATURES */ + .probe = qca807x_probe, + .config_init = qca807x_config, + .read_status = qca807x_read_status, + .config_intr = qca807x_config_intr, + .ack_interrupt = qca807x_ack_intr, + .soft_reset = genphy_soft_reset, + .get_tunable = qca807x_get_tunable, + .set_tunable = qca807x_set_tunable, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0) + .cable_test_start = qca807x_cable_test_start, + .cable_test_get_status = qca807x_cable_test_get_status, +#endif + }, + { + PHY_ID_MATCH_EXACT(PHY_ID_QCA807X_PSGMII), + .name = "Qualcomm QCA807x PSGMII", + .probe = qca807x_psgmii_config, + }, +}; +module_phy_driver(qca807x_drivers); + +static struct mdio_device_id __maybe_unused qca807x_tbl[] = { + { PHY_ID_MATCH_EXACT(PHY_ID_QCA8072) }, + { PHY_ID_MATCH_EXACT(PHY_ID_QCA8075) }, + { PHY_ID_MATCH_MODEL(PHY_ID_QCA807X_PSGMII) }, + { } +}; + +MODULE_AUTHOR("Robert Marko"); +MODULE_DESCRIPTION("Qualcomm QCA807x PHY driver"); +MODULE_DEVICE_TABLE(mdio, qca807x_tbl); +MODULE_LICENSE("GPL"); diff --git a/target/linux/ipq40xx/patches-5.4/706-dt-bindings-net-add-QCA807x-PHY.patch b/target/linux/ipq40xx/patches-5.4/706-dt-bindings-net-add-QCA807x-PHY.patch new file mode 100644 index 0000000000..dfb8d692ab --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/706-dt-bindings-net-add-QCA807x-PHY.patch @@ -0,0 +1,61 @@ +From c66863c1ba8995b61e6d727d78a241c734f5bb57 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Thu, 1 Oct 2020 15:05:35 +0200 +Subject: [PATCH] dt-bindings: net: add QCA807x PHY + +Add DT bindings for Qualcomm QCA807x PHY series. + +Signed-off-by: Robert Marko +--- + include/dt-bindings/net/qcom-qca807x.h | 45 ++++++++++++++++++++++++++ + 1 file changed, 45 insertions(+) + create mode 100644 include/dt-bindings/net/qcom-qca807x.h + +--- /dev/null ++++ b/include/dt-bindings/net/qcom-qca807x.h +@@ -0,0 +1,45 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Device Tree constants for the Qualcomm QCA807X PHYs ++ */ ++ ++#ifndef _DT_BINDINGS_QCOM_QCA807X_H ++#define _DT_BINDINGS_QCOM_QCA807X_H ++ ++#define PSGMII_QSGMII_TX_DRIVER_140MV 0 ++#define PSGMII_QSGMII_TX_DRIVER_160MV 1 ++#define PSGMII_QSGMII_TX_DRIVER_180MV 2 ++#define PSGMII_QSGMII_TX_DRIVER_200MV 3 ++#define PSGMII_QSGMII_TX_DRIVER_220MV 4 ++#define PSGMII_QSGMII_TX_DRIVER_240MV 5 ++#define PSGMII_QSGMII_TX_DRIVER_260MV 6 ++#define PSGMII_QSGMII_TX_DRIVER_280MV 7 ++#define PSGMII_QSGMII_TX_DRIVER_300MV 8 ++#define PSGMII_QSGMII_TX_DRIVER_320MV 9 ++#define PSGMII_QSGMII_TX_DRIVER_400MV 10 ++#define PSGMII_QSGMII_TX_DRIVER_500MV 11 ++/* Default value */ ++#define PSGMII_QSGMII_TX_DRIVER_600MV 12 ++ ++/* Full amplitude, full bias current */ ++#define QCA807X_CONTROL_DAC_FULL_VOLT_BIAS 0 ++/* Amplitude follow DSP (amplitude is adjusted based on cable length), half bias current */ ++#define QCA807X_CONTROL_DAC_DSP_VOLT_HALF_BIAS 1 ++/* Full amplitude, bias current follow DSP (bias current is adjusted based on cable length) */ ++#define QCA807X_CONTROL_DAC_FULL_VOLT_DSP_BIAS 2 ++/* Both amplitude and bias current follow DSP */ ++#define QCA807X_CONTROL_DAC_DSP_VOLT_BIAS 3 ++/* Full amplitude, half bias current */ ++#define QCA807X_CONTROL_DAC_FULL_VOLT_HALF_BIAS 4 ++/* Amplitude follow DSP setting; 1/4 bias current when cable<10m, ++ * otherwise half bias current ++ */ ++#define QCA807X_CONTROL_DAC_DSP_VOLT_QUARTER_BIAS 5 ++/* Full amplitude; same bias current setting with “010” and “011”, ++ * but half more bias is reduced when cable <10m ++ */ ++#define QCA807X_CONTROL_DAC_FULL_VOLT_HALF_BIAS_SHORT 6 ++/* Amplitude follow DSP; same bias current setting with “110”, default value */ ++#define QCA807X_CONTROL_DAC_DSP_VOLT_HALF_BIAS_SHORT 7 ++ ++#endif diff --git a/target/linux/ipq40xx/patches-5.4/707-net-phy-Add-Qualcom-QCA807x-driver.patch b/target/linux/ipq40xx/patches-5.4/707-net-phy-Add-Qualcom-QCA807x-driver.patch new file mode 100644 index 0000000000..b71b28d941 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/707-net-phy-Add-Qualcom-QCA807x-driver.patch @@ -0,0 +1,50 @@ +From f825cdc8bfde7616a14e2163f16303a8973031d2 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Wed, 7 Oct 2020 17:38:48 +0200 +Subject: [PATCH] net: phy: Add Qualcom QCA807x driver + +This adds driver for the Qualcomm QCA8072 and QCA8075 PHY-s. + +They are 2 or 5 port IEEE 802.3 clause 22 compliant 10BASE-Te, 100BASE-TX and 1000BASE-T PHY-s. + +They feature 2 SerDes, one for PSGMII or QSGMII connection with MAC, while second one is SGMII for connection to MAC or fiber. + +Both models have a combo port that supports 1000BASE-X and 100BASE-FX fiber. + +Each PHY inside of QCA807x series has 4 digitally controlled output only pins that natively drive LED-s. +But some vendors used these to driver generic LED-s controlled by userspace, +so lets enable registering each PHY as GPIO controller and add driver for it. + +These are commonly used in Qualcomm IPQ40xx, IPQ60xx and IPQ807x boards. + +Signed-off-by: Robert Marko +--- + drivers/net/phy/Kconfig | 6 ++++++ + drivers/net/phy/Makefile | 1 + + 2 files changed, 7 insertions(+) + +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -537,6 +537,12 @@ config NXP_TJA11XX_PHY + ---help--- + Currently supports the NXP TJA1100 and TJA1101 PHY. + ++config QCA807X_PHY ++ tristate "Qualcomm QCA807X PHYs" ++ depends on OF_MDIO ++ help ++ Currently supports the QCA8072 and QCA8075 models. ++ + config QSEMI_PHY + tristate "Quality Semiconductor PHYs" + ---help--- +--- a/drivers/net/phy/Makefile ++++ b/drivers/net/phy/Makefile +@@ -103,6 +103,7 @@ obj-$(CONFIG_MICROSEMI_PHY) += mscc.o + obj-$(CONFIG_NATIONAL_PHY) += national.o + obj-$(CONFIG_NXP_TJA11XX_PHY) += nxp-tja11xx.o + obj-$(CONFIG_QSEMI_PHY) += qsemi.o ++obj-$(CONFIG_QCA807X_PHY) += qca807x.o + obj-$(CONFIG_REALTEK_PHY) += realtek.o + obj-$(CONFIG_RENESAS_PHY) += uPD60620.o + obj-$(CONFIG_ROCKCHIP_PHY) += rockchip.o From 26b1f72381fbf96102c2c7c44a929881c70b15b9 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 8 Oct 2020 12:20:39 +0200 Subject: [PATCH 78/97] ipq40xx: net: phy: ar40xx: remove PHY handling Since we now have proper PHY driver for the QCA807x PHY-s, lets remove PHY handling from AR40xx. This removes PHY driver, PHY GPIO driver and PHY init code. AR40xx still needs to handle PSGMII calibration as that requires R/W from the switch, so I am unable to move it into PHY driver. This also converted the AR40xx driver to use OF_MDIO to find the MDIO bus as it now cant be set through the PHY driver. So lets depend on OF_MDIO in KConfig. Signed-off-by: Robert Marko --- .../ipq40xx/files/drivers/net/phy/ar40xx.c | 241 ++---------------- .../705-net-add-qualcomm-ar40xx-phy.patch | 8 +- 2 files changed, 20 insertions(+), 229 deletions(-) diff --git a/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c b/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c index 18ff26affc..c35ba2799f 100644 --- a/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c +++ b/target/linux/ipq40xx/files/drivers/net/phy/ar40xx.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -1245,42 +1246,6 @@ ar40xx_init_globals(struct ar40xx_priv *priv) ar40xx_write(priv, AR40XX_REG_PORT_FLOWCTRL_THRESH(0), t); } -static void -ar40xx_malibu_init(struct ar40xx_priv *priv) -{ - int i; - struct mii_bus *bus; - u16 val; - - bus = priv->mii_bus; - - /* war to enable AZ transmitting ability */ - ar40xx_phy_mmd_write(priv, AR40XX_PSGMII_ID, 1, - AR40XX_MALIBU_PSGMII_MODE_CTRL, - AR40XX_MALIBU_PHY_PSGMII_MODE_CTRL_ADJUST_VAL); - for (i = 0; i < AR40XX_NUM_PORTS - 1; i++) { - /* change malibu control_dac */ - val = ar40xx_phy_mmd_read(priv, i, 7, - AR40XX_MALIBU_PHY_MMD7_DAC_CTRL); - val &= ~AR40XX_MALIBU_DAC_CTRL_MASK; - val |= AR40XX_MALIBU_DAC_CTRL_VALUE; - ar40xx_phy_mmd_write(priv, i, 7, - AR40XX_MALIBU_PHY_MMD7_DAC_CTRL, val); - if (i == AR40XX_MALIBU_PHY_LAST_ADDR) { - /* to avoid goes into hibernation */ - val = ar40xx_phy_mmd_read(priv, i, 3, - AR40XX_MALIBU_PHY_RLP_CTRL); - val &= (~(1<<1)); - ar40xx_phy_mmd_write(priv, i, 3, - AR40XX_MALIBU_PHY_RLP_CTRL, val); - } - } - - /* adjust psgmii serdes tx amp */ - mdiobus_write(bus, AR40XX_PSGMII_ID, AR40XX_PSGMII_TX_DRIVER_1_CTRL, - AR40XX_MALIBU_PHY_PSGMII_REDUCE_SERDES_TX_AMP); -} - static int ar40xx_hw_init(struct ar40xx_priv *priv) { @@ -1288,9 +1253,7 @@ ar40xx_hw_init(struct ar40xx_priv *priv) ar40xx_ess_reset(priv); - if (priv->mii_bus) - ar40xx_malibu_init(priv); - else + if (!priv->mii_bus) return -1; ar40xx_psgmii_self_test(priv); @@ -1763,183 +1726,13 @@ static const struct switch_dev_ops ar40xx_sw_ops = { .get_port_link = ar40xx_sw_get_port_link, }; -/* Start of phy driver support */ - -static const u32 ar40xx_phy_ids[] = { - 0x004dd0b1, - 0x004dd0b2, /* AR40xx */ -}; - -static bool -ar40xx_phy_match(u32 phy_id) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(ar40xx_phy_ids); i++) - if (phy_id == ar40xx_phy_ids[i]) - return true; - - return false; -} - -static bool -is_ar40xx_phy(struct mii_bus *bus) -{ - unsigned i; - - for (i = 0; i < 4; i++) { - u32 phy_id; - - phy_id = mdiobus_read(bus, i, MII_PHYSID1) << 16; - phy_id |= mdiobus_read(bus, i, MII_PHYSID2); - if (!ar40xx_phy_match(phy_id)) - return false; - } - - return true; -} - -static int -ar40xx_phy_probe(struct phy_device *phydev) -{ - if (!is_ar40xx_phy(phydev->mdio.bus)) - return -ENODEV; - - ar40xx_priv->mii_bus = phydev->mdio.bus; - phydev->priv = ar40xx_priv; - if (phydev->mdio.addr == 0) - ar40xx_priv->phy = phydev; - - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->supported); - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->advertising); - return 0; -} - -static void -ar40xx_phy_remove(struct phy_device *phydev) -{ - ar40xx_priv->mii_bus = NULL; - phydev->priv = NULL; -} - -static int -ar40xx_phy_config_init(struct phy_device *phydev) -{ - return 0; -} - -static int -ar40xx_phy_read_status(struct phy_device *phydev) -{ - if (phydev->mdio.addr != 0) - return genphy_read_status(phydev); - - return 0; -} - -static int -ar40xx_phy_config_aneg(struct phy_device *phydev) -{ - if (phydev->mdio.addr == 0) - return 0; - - return genphy_config_aneg(phydev); -} - -static struct phy_driver ar40xx_phy_driver = { - .phy_id = 0x004d0000, - .name = "QCA Malibu", - .phy_id_mask = 0xffff0000, - .features = PHY_GBIT_FEATURES, - .probe = ar40xx_phy_probe, - .remove = ar40xx_phy_remove, - .config_init = ar40xx_phy_config_init, - .config_aneg = ar40xx_phy_config_aneg, - .read_status = ar40xx_phy_read_status, -}; - -static uint16_t ar40xx_gpio_get_phy(unsigned int offset) -{ - return offset / 4; -} - -static uint16_t ar40xx_gpio_get_reg(unsigned int offset) -{ - return 0x8074 + offset % 4; -} - -static void ar40xx_gpio_set(struct gpio_chip *gc, unsigned int offset, - int value) -{ - struct ar40xx_priv *priv = gpiochip_get_data(gc); - - ar40xx_phy_mmd_write(priv, ar40xx_gpio_get_phy(offset), 0x7, - ar40xx_gpio_get_reg(offset), - value ? 0xA000 : 0x8000); -} - -static int ar40xx_gpio_get(struct gpio_chip *gc, unsigned offset) -{ - struct ar40xx_priv *priv = gpiochip_get_data(gc); - - return ar40xx_phy_mmd_read(priv, ar40xx_gpio_get_phy(offset), 0x7, - ar40xx_gpio_get_reg(offset)) == 0xA000; -} - -static int ar40xx_gpio_get_dir(struct gpio_chip *gc, unsigned offset) -{ - return 0; /* only out direction */ -} - -static int ar40xx_gpio_dir_out(struct gpio_chip *gc, unsigned offset, - int value) -{ - /* - * the direction out value is used to set the initial value. - * support of this function is required by leds-gpio.c - */ - ar40xx_gpio_set(gc, offset, value); - return 0; -} - -static void ar40xx_register_gpio(struct device *pdev, - struct ar40xx_priv *priv, - struct device_node *switch_node) -{ - struct gpio_chip *gc; - int err; - - gc = devm_kzalloc(pdev, sizeof(*gc), GFP_KERNEL); - if (!gc) - return; - - gc->label = "ar40xx_gpio", - gc->base = -1, - gc->ngpio = 5 /* mmd 0 - 4 */ * 4 /* 0x8074 - 0x8077 */, - gc->parent = pdev; - gc->owner = THIS_MODULE; - - gc->get_direction = ar40xx_gpio_get_dir; - gc->direction_output = ar40xx_gpio_dir_out; - gc->get = ar40xx_gpio_get; - gc->set = ar40xx_gpio_set; - gc->can_sleep = true; - gc->label = priv->dev.name; - gc->of_node = switch_node; - - err = devm_gpiochip_add_data(pdev, gc, priv); - if (err != 0) - dev_err(pdev, "Failed to register gpio %d.\n", err); -} - -/* End of phy driver support */ - /* Platform driver probe function */ static int ar40xx_probe(struct platform_device *pdev) { struct device_node *switch_node; struct device_node *psgmii_node; + struct device_node *mdio_node; const __be32 *mac_mode; struct clk *ess_clk; struct switch_dev *swdev; @@ -2010,12 +1803,6 @@ static int ar40xx_probe(struct platform_device *pdev) return -EIO; } - ret = phy_driver_register(&ar40xx_phy_driver, THIS_MODULE); - if (ret) { - dev_err(&pdev->dev, "Failed to register ar40xx phy driver!\n"); - return -EIO; - } - mutex_init(&priv->reg_mutex); mutex_init(&priv->mib_lock); INIT_DELAYED_WORK(&priv->mib_work, ar40xx_mib_work_func); @@ -2023,6 +1810,15 @@ static int ar40xx_probe(struct platform_device *pdev) /* register switch */ swdev = &priv->dev; + mdio_node = of_find_compatible_node(NULL, NULL, "qcom,ipq4019-mdio"); + if (!mdio_node) { + dev_err(&pdev->dev, "Probe failed - Cannot find mdio node by phandle!\n"); + ret = -ENODEV; + goto err_missing_phy; + } + + priv->mii_bus = of_mdio_find_bus(mdio_node); + if (priv->mii_bus == NULL) { dev_err(&pdev->dev, "Probe failed - Missing PHYs!\n"); ret = -ENODEV; @@ -2037,8 +1833,10 @@ static int ar40xx_probe(struct platform_device *pdev) swdev->ports = AR40XX_NUM_PORTS; swdev->ops = &ar40xx_sw_ops; ret = register_switch(swdev, NULL); - if (ret) - goto err_unregister_phy; + if (ret < 0) { + dev_err(&pdev->dev, "Switch registration failed!\n"); + return ret; + } num_mibs = ARRAY_SIZE(ar40xx_mibs); len = priv->dev.ports * num_mibs * @@ -2051,15 +1849,10 @@ static int ar40xx_probe(struct platform_device *pdev) ar40xx_start(priv); - if (of_property_read_bool(switch_node, "gpio-controller")) - ar40xx_register_gpio(&pdev->dev, ar40xx_priv, switch_node); - return 0; err_unregister_switch: unregister_switch(&priv->dev); -err_unregister_phy: - phy_driver_unregister(&ar40xx_phy_driver); err_missing_phy: platform_set_drvdata(pdev, NULL); return ret; @@ -2074,8 +1867,6 @@ static int ar40xx_remove(struct platform_device *pdev) unregister_switch(&priv->dev); - phy_driver_unregister(&ar40xx_phy_driver); - return 0; } diff --git a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch index 6f080892d5..9adddcabc3 100644 --- a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch +++ b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch @@ -1,12 +1,12 @@ --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -584,6 +584,13 @@ config MDIO_IPQ40XX - This driver supports the MDIO interface found in Qualcomm - Atheros ipq40xx Soc chip. +@@ -584,6 +584,13 @@ config XILINX_GMII2RGMII + the Reduced Gigabit Media Independent Interface(RGMII) between + Ethernet physical media devices and the Gigabit Ethernet controller. +config AR40XX_PHY + tristate "Driver for Qualcomm Atheros IPQ40XX switches" -+ depends on HAS_IOMEM && OF ++ depends on HAS_IOMEM && OF && OF_MDIO + select SWCONFIG + help + This is the driver for Qualcomm Atheros IPQ40XX ESS switches. From 053c3d8e0b1b8d9371df8d989942243e9839acf0 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 8 Oct 2020 12:19:05 +0200 Subject: [PATCH 79/97] ipq40xx: net: ethernet: edma: fix link detection PHY needs to be soft reset before starting it from ethernet driver as AR40xx calibration will leave it in unwanted state. Signed-off-by: Robert Marko --- .../files/drivers/net/ethernet/qualcomm/essedma/edma.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c index 5f2630ae50..ecbc946de9 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c @@ -2023,6 +2023,10 @@ int edma_open(struct net_device *netdev) */ if (adapter->poll_required) { if (!IS_ERR(adapter->phydev)) { + /* AR40xx calibration will leave the PHY in unwanted state, + * so a soft reset is required before phy_start() + */ + genphy_soft_reset(adapter->phydev); phy_start(adapter->phydev); phy_start_aneg(adapter->phydev); adapter->link_state = __EDMA_LINKDOWN; From c8af7ea205daa60a24862ed3e43c4af92304284d Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 8 Oct 2020 12:23:08 +0200 Subject: [PATCH 80/97] ipq40xx: dts: add QCA807x properties This adds necessary DT properties for QCA807x PHY-s to IPQ4019 DTSI. Also adds the PSGMII PHY as it wont get probed otherwise. Signed-off-by: Robert Marko --- ...8-arm-dts-ipq4019-QCA807x-properties.patch | 62 +++++++++++++++++++ ...ts-ipq4019-add-ethernet-essedma-node.patch | 4 +- 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 target/linux/ipq40xx/patches-5.4/708-arm-dts-ipq4019-QCA807x-properties.patch diff --git a/target/linux/ipq40xx/patches-5.4/708-arm-dts-ipq4019-QCA807x-properties.patch b/target/linux/ipq40xx/patches-5.4/708-arm-dts-ipq4019-QCA807x-properties.patch new file mode 100644 index 0000000000..4b04a3ce9a --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/708-arm-dts-ipq4019-QCA807x-properties.patch @@ -0,0 +1,62 @@ +From e0fa88eaa3c176b71e563da68949ac2ab45aaa61 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Fri, 2 Oct 2020 10:43:26 +0200 +Subject: [PATCH] arm: dts: ipq4019: QCA807x properties + +This adds necessary DT properties for QCA807x PHY-s to IPQ4019 DTSI. + +Signed-off-by: Robert Marko +--- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + / { + #address-cells = <1>; +@@ -597,22 +598,39 @@ + + ethphy0: ethernet-phy@0 { + reg = <0>; ++ ++ qcom,control-dac = ; + }; + + ethphy1: ethernet-phy@1 { + reg = <1>; ++ ++ qcom,control-dac = ; + }; + + ethphy2: ethernet-phy@2 { + reg = <2>; ++ ++ qcom,control-dac = ; + }; + + ethphy3: ethernet-phy@3 { + reg = <3>; ++ ++ qcom,control-dac = ; + }; + + ethphy4: ethernet-phy@4 { + reg = <4>; ++ ++ qcom,control-dac = ; ++ }; ++ ++ psgmiiphy: psgmii-phy@5 { ++ reg = <5>; ++ ++ qcom,tx-driver-strength = ; ++ qcom,psgmii-az; + }; + }; + diff --git a/target/linux/ipq40xx/patches-5.4/711-dts-ipq4019-add-ethernet-essedma-node.patch b/target/linux/ipq40xx/patches-5.4/711-dts-ipq4019-add-ethernet-essedma-node.patch index 6db4241234..7b2ddfe00d 100644 --- a/target/linux/ipq40xx/patches-5.4/711-dts-ipq4019-add-ethernet-essedma-node.patch +++ b/target/linux/ipq40xx/patches-5.4/711-dts-ipq4019-add-ethernet-essedma-node.patch @@ -16,7 +16,7 @@ Signed-off-by: Christian Lamparter --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -38,6 +38,8 @@ +@@ -39,6 +39,8 @@ spi1 = &blsp1_spi2; i2c0 = &blsp1_i2c3; i2c1 = &blsp1_i2c4; @@ -25,7 +25,7 @@ Signed-off-by: Christian Lamparter }; cpus { -@@ -639,6 +641,64 @@ +@@ -657,6 +659,64 @@ status = "disabled"; }; From 2a5bfb6600d5d8a20cf361b7b99ef66027fe412e Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 19 Oct 2020 18:49:29 +0200 Subject: [PATCH 81/97] ipq40xx: dts: convert PHY GPIO bindings Since the new PHY driver manages each PHY individually and therefore registers each PHY that is marked with gpio-controller; DT property as a GPIO controller we need to convert old DT bindings to account for this. Only 2 boards use this so its not much of an issue. Signed-off-by: Robert Marko --- .../arm/boot/dts/qcom-ipq4018-ap120c-ac.dts | 12 +++-- .../boot/dts/qcom-ipq4018-fritzbox-4040.dts | 51 ++++++++++++------- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts index 28d27d9959..c35ce5ccc4 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts @@ -37,7 +37,7 @@ wan { label = "amber:wan"; - gpios = <&qca8075 19 GPIO_ACTIVE_HIGH>; + gpios = <ðphy4 1 GPIO_ACTIVE_HIGH>; }; wlan2g { @@ -119,14 +119,11 @@ status = "okay"; }; - qca8075: ess-switch@c000000 { + ess-switch@c000000 { status = "okay"; switch_lan_bmp = <0x10>; switch_wan_bmp = <0x20>; - - #gpio-cells = <2>; - gpio-controller; }; edma@c080000 { @@ -264,6 +261,11 @@ status = "okay"; }; +ðphy4 { + gpio-controller; + #gpio-cells = <2>; +}; + &gmac0 { qcom,forced_duplex = <1>; qcom,forced_speed = <1000>; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts index fb1762cc05..77b1810f09 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-fritzbox-4040.dts @@ -70,18 +70,8 @@ status = "okay"; }; - qca8075: ess-switch@c000000 { + ess-switch@c000000 { status = "okay"; - - #gpio-cells = <2>; - gpio-controller; - - enable-usb-power { - gpio-hog; - line-name = "enable USB3 power"; - gpios = <7 GPIO_ACTIVE_HIGH>; - output-high; - }; }; edma@c080000 { @@ -110,33 +100,33 @@ wlan { label = "green:wlan"; - gpios = <&qca8075 1 GPIO_ACTIVE_HIGH>; + gpios = <ðphy0 0 GPIO_ACTIVE_HIGH>; }; panic: info_red { label = "red:info"; - gpios = <&qca8075 3 GPIO_ACTIVE_HIGH>; + gpios = <ðphy0 1 GPIO_ACTIVE_HIGH>; panic-indicator; }; wan { label = "green:wan"; - gpios = <&qca8075 5 GPIO_ACTIVE_HIGH>; + gpios = <ðphy1 0 GPIO_ACTIVE_HIGH>; }; power: power { label = "green:power"; - gpios = <&qca8075 11 GPIO_ACTIVE_HIGH>; + gpios = <ðphy2 1 GPIO_ACTIVE_HIGH>; }; lan { label = "green:lan"; - gpios = <&qca8075 13 GPIO_ACTIVE_HIGH>; + gpios = <ðphy3 0 GPIO_ACTIVE_HIGH>; }; flash: info_amber { label = "amber:info"; - gpios = <&qca8075 15 GPIO_ACTIVE_HIGH>; + gpios = <ðphy3 1 GPIO_ACTIVE_HIGH>; }; }; }; @@ -269,6 +259,33 @@ status = "okay"; }; +ðphy0 { + gpio-controller; + #gpio-cells = <2>; +}; + +ðphy1 { + gpio-controller; + #gpio-cells = <2>; + + enable-usb-power { + gpio-hog; + line-name = "enable USB3 power"; + gpios = <1 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +ðphy2 { + gpio-controller; + #gpio-cells = <2>; +}; + +ðphy3 { + gpio-controller; + #gpio-cells = <2>; +}; + &usb3_ss_phy { status = "okay"; }; From 9d69505194145e20eeab73c646d9fa03dc5831e8 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 26 Nov 2020 13:41:54 +0100 Subject: [PATCH 82/97] ipq40xx: net: ethernet: edma: use generic ksettings functions Since we now have a proper PHY driver for QCA807x and AR803x has already been supported properly there is no need for the driver to be poking on PHY registers for ethtool ops. So, lets simply use the generic phy_ethtool_ksettings_get/phy_ethtool_ksettings_set functions. This also has the advantage of properly populating stuff other than speeds like, transceiver type, MDI-X etc. ethtool before: root@OpenWrt:/# ethtool eth1 Settings for eth1: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full 1000baseX/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full 1000baseX/Full Advertised pause frame use: Symmetric Receive-only Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Link partner advertised pause frame use: No Link partner advertised auto-negotiation: No Link partner advertised FEC modes: Not reported Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 4 Transceiver: internal Auto-negotiation: on MDI-X: Unknown Supports Wake-on: d Wake-on: d Current message level: 0x00000000 (0) Link detected: yes ethtool after: root@OpenWrt:/# ethtool eth1 Settings for eth1: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full 1000baseX/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full 1000baseX/Full Advertised pause frame use: Symmetric Receive-only Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Link partner advertised pause frame use: Symmetric Receive-only Link partner advertised auto-negotiation: Yes Link partner advertised FEC modes: Not reported Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 4 Transceiver: external Auto-negotiation: on MDI-X: off (auto) Supports Wake-on: d Wake-on: d Current message level: 0x00000000 (0) Link detected: yes Signed-off-by: Robert Marko --- .../ethernet/qualcomm/essedma/edma_ethtool.c | 62 ++----------------- 1 file changed, 6 insertions(+), 56 deletions(-) diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c index 1270e20a90..ac5cb50961 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_ethtool.c @@ -186,55 +186,15 @@ static int edma_get_settings(struct net_device *netdev, struct edma_adapter *adapter = netdev_priv(netdev); if (adapter->poll_required) { - struct phy_device *phydev = NULL; - uint16_t phyreg; - if ((adapter->forced_speed != SPEED_UNKNOWN) && !(adapter->poll_required)) return -EPERM; - phydev = adapter->phydev; - - linkmode_copy(cmd->link_modes.advertising, phydev->advertising); - linkmode_copy(cmd->link_modes.supported, phydev->supported); - - cmd->base.autoneg = phydev->autoneg; - - if (adapter->link_state == __EDMA_LINKDOWN) { - cmd->base.speed = SPEED_UNKNOWN; - cmd->base.duplex = DUPLEX_UNKNOWN; - } else { - cmd->base.speed = phydev->speed; - cmd->base.duplex = phydev->duplex; - } - - cmd->base.phy_address = adapter->phy_mdio_addr; - - phyreg = (uint16_t)phy_read(adapter->phydev, MII_LPA); - if (phyreg & LPA_10HALF) - linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, - cmd->link_modes.lp_advertising); - - if (phyreg & LPA_10FULL) - linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, - cmd->link_modes.lp_advertising); - - if (phyreg & LPA_100HALF) - linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, - cmd->link_modes.lp_advertising); - - if (phyreg & LPA_100FULL) - linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, - cmd->link_modes.lp_advertising); - - phyreg = (uint16_t)phy_read(adapter->phydev, MII_STAT1000); - if (phyreg & LPA_1000HALF) - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, - cmd->link_modes.lp_advertising); - - if (phyreg & LPA_1000FULL) - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, - cmd->link_modes.lp_advertising); + phy_ethtool_ksettings_get(adapter->phydev, cmd); + if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, adapter->phydev->advertising)) + cmd->base.port = PORT_FIBRE; + else + cmd->base.port = PORT_TP; } else { /* If the speed/duplex for this GMAC is forced and we * are not polling for link state changes, return the @@ -272,22 +232,12 @@ static int edma_set_settings(struct net_device *netdev, const struct ethtool_link_ksettings *cmd) { struct edma_adapter *adapter = netdev_priv(netdev); - struct phy_device *phydev = NULL; if ((adapter->forced_speed != SPEED_UNKNOWN) && !adapter->poll_required) return -EPERM; - phydev = adapter->phydev; - linkmode_copy(phydev->advertising, cmd->link_modes.advertising); - linkmode_copy(phydev->supported, cmd->link_modes.supported); - phydev->autoneg = cmd->base.autoneg; - phydev->speed = cmd->base.speed; - phydev->duplex = cmd->base.duplex; - - genphy_config_aneg(phydev); - - return 0; + return phy_ethtool_ksettings_set(adapter->phydev, cmd); } /* edma_get_coalesce From fd033364f655f129b438fe67c87f95ef7b56fda1 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 26 Nov 2020 13:54:34 +0100 Subject: [PATCH 83/97] ipq40xx: net: ethernet: edma: use generic PHY print Lets use the generic upstream phy_print_status() instead of doing something similar by hand. Before: ess_edma c080000.edma: eth1: GMAC Link is up with phy_speed=1000 After: ess_edma c080000.edma eth1: Link is Up - 1Gbps/Full - flow control rx/tx Signed-off-by: Robert Marko --- .../files/drivers/net/ethernet/qualcomm/essedma/edma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c index ecbc946de9..80db1f0acb 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma.c @@ -1310,7 +1310,7 @@ void edma_adjust_link(struct net_device *netdev) status = edma_check_link(adapter); if (status == __EDMA_LINKUP && adapter->link_state == __EDMA_LINKDOWN) { - dev_info(&adapter->pdev->dev, "%s: GMAC Link is up with phy_speed=%d\n", netdev->name, phydev->speed); + phy_print_status(phydev); adapter->link_state = __EDMA_LINKUP; if (adapter->edma_cinfo->is_single_phy) { ess_set_port_status_speed(adapter->edma_cinfo, phydev, @@ -1320,7 +1320,7 @@ void edma_adjust_link(struct net_device *netdev) if (netif_running(netdev)) netif_tx_wake_all_queues(netdev); } else if (status == __EDMA_LINKDOWN && adapter->link_state == __EDMA_LINKUP) { - dev_info(&adapter->pdev->dev, "%s: GMAC Link is down\n", netdev->name); + phy_print_status(phydev); adapter->link_state = __EDMA_LINKDOWN; netif_carrier_off(netdev); netif_tx_stop_all_queues(netdev); From b0b7f2b8f3a6bba4c2e0a08b700d8522332aecd3 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 23 Dec 2020 21:00:58 +0000 Subject: [PATCH 84/97] oxnas: now longer build KD20 factory image The image never worked in any release and is also broken in snapshots due to stock bootloader not loading more than 4 MiB. Hence it's better to remove the image for now, users who want to flash OpenWrt on new devices may build LEDE 17.01 with everything possible disabled to get a small enough and working factory image. Signed-off-by: Daniel Golle --- target/linux/oxnas/image/ox820.mk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/linux/oxnas/image/ox820.mk b/target/linux/oxnas/image/ox820.mk index f00cfe8608..a52e09786b 100644 --- a/target/linux/oxnas/image/ox820.mk +++ b/target/linux/oxnas/image/ox820.mk @@ -68,10 +68,6 @@ define Device/shuttle_kd20 DEVICE_VENDOR := Shuttle DEVICE_MODEL := KD20 SUPPORTED_DEVICES += kd20 - KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-factory - KERNEL_INITRAMFS_SUFFIX := .tar.gz - KERNEL_INITRAMFS = kernel-bin | append-dtb | uImage none | omninas-factory | \ - encrypt-3des sohmuntitnlaes DEVICE_PACKAGES := kmod-usb2-oxnas kmod-usb3 kmod-usb-ledtrig-usbport \ kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper kmod-hwmon-drivetemp \ kmod-hwmon-gpiofan kmod-ata-oxnas-sata kmod-md-mod kmod-md-raid0 \ From 8348896357ff79d1a25edcfb8c8e568f495b252b Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 24 Dec 2020 11:11:59 +0000 Subject: [PATCH 85/97] opkg: update to git HEAD 9bbc7ea pkg_hash: pkg_hash_check_unresolved: fix segfault Signed-off-by: Daniel Golle --- package/system/opkg/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 4a7288d2e4..ffcb15a369 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -14,9 +14,9 @@ PKG_FLAGS:=essential PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git -PKG_SOURCE_DATE:=2020-12-05 -PKG_SOURCE_VERSION:=efb26a35e4e5446f135307c4ff7df9e9563c23a9 -PKG_MIRROR_HASH:=9294140567f1b122a7229fc80ab1b70e167b478c1a3062e0b64631c189beeda5 +PKG_SOURCE_DATE:=2020-12-24 +PKG_SOURCE_VERSION:=9bbc7eae91edc3dbb020e2a50d51d9a3fbbf31ca +PKG_MIRROR_HASH:=baa32d1b381d0eb2e224f4742974581c6705c13814662442ebd1288a91c2d577 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From bc99b56d7ea05f59a6fc3401508d28130f9cec90 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 24 Dec 2020 17:21:17 +0100 Subject: [PATCH 86/97] odhcpd: update to latest git HEAD b75bcad dhcpv6-ia: remove assignment equal to 0 checks d1ae052 dhcpv6-ia: fix logic to include IA_PD prefix with lifetimes set to 0 9d5e379 dhcpv6-ia: fix prefix delegation behavior Signed-off-by: Hans Dedecker --- package/network/services/odhcpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 1ab68ec33b..66263ba51d 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2020-12-13 -PKG_SOURCE_VERSION:=2cf6232fd170a24b801d71d497947d7aabd12015 -PKG_MIRROR_HASH:=097a6b186bc85cc8ff95a611e23ab50a6d8025988f19e0d48520e12a1020274d +PKG_SOURCE_DATE:=2020-12-24 +PKG_SOURCE_VERSION:=b75bcad7bd5fd03f64011a532b9960d78e4aac22 +PKG_MIRROR_HASH:=f795e0268b6fe09eaf15b5701a236c3a74c11deb8436af6b6ab0a59d251fc3fd PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 57e6f3ae65e1e77db6291f29b40002646b76db3b Mon Sep 17 00:00:00 2001 From: Sven Wegener Date: Thu, 24 Dec 2020 21:20:53 +0100 Subject: [PATCH 87/97] ath79: update image command for Plasma Cloud PA300 Commit 5fc28ef47959 ("ath79: Add support for Plasma Cloud PA300") added the IMAGE/sysupgrade.bin/squashfs definition, which leaks into other devices, resulting in sysupgrade.bin images that are actually tarballs and do not boot when directly written to flash. We can use the normal sysupgrade.bin command variable for this device. Signed-off-by: Sven Wegener [fix format, spelling] Signed-off-by: David Bauer --- target/linux/ath79/image/generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 101c7597b8..ec2b1d2bde 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1623,7 +1623,7 @@ define Device/plasmacloud_pa300-common IMAGES += factory.bin KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-to $$(BLOCKSIZE) IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA300 - IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata endef define Device/plasmacloud_pa300 From 4a55ef639dabed9546003f37948b772fd5024292 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 15 Sep 2020 13:44:39 -0400 Subject: [PATCH 88/97] ath79: add support for Senao Engenius ECB600 FCC ID: A8J-ECB600 Engenius ECB600 is a wireless access point with 1 gigabit PoE ethernet port, dual-band wireless, external ethernet switch, and 4 external antennas. Specification: - AR9344 SOC (5 GHz, 2x2, WMAC) - AR9382 WLAN (2.4 GHz, 2x2, PCIe on-board) - AR8035-A switch (GbE with 802.3af PoE) - 40 MHz reference clock - 16 MB FLASH MX25L12845EMI-10G - 2x 64 MB RAM NT5TU32M16DG - UART at H1 (populated) - 4 LEDs, 1 button (power, eth, 2.4 GHz, 5 GHz) (reset) - 4 external antennas MAC addresses: MAC addresses are labeled MAC1 and MAC2 The MAC address in flash is not on the label The OEM software reports these MACs for the ifconfig phy1 MAC 1 *:52 --- (2.4 GHz) phy0 MAC 2 *:53 --- (5 GHz) eth0 ----- *:54 art 0x0 Installation: 2 ways to flash factory.bin from OEM: - if you get Failsafe Mode from failed flash: only use it to flash Original firmware from Engenius or risk kernel loop or halt which requires serial cable Method 1: Firmware upgrade page: OEM webpage at 192.168.1.1 username and password "admin" Navigate to "Upgrade Firmware" page from left pane Click Browse and select the factory.bin image Upload and verify checksum Click Continue to confirm and wait 3 minutes Method 2: Serial to load Failsafe webpage: After connecting to serial console and rebooting... Interrupt uboot with any key pressed rapidly execute `run failsafe_boot` OR `bootm 0x9fdf0000` wait a minute connect to ethernet and navigate to "192.168.1.1/index.htm" Select the factory.bin image and upload wait about 3 minutes Return to OEM: If you have a serial cable, see Serial Failsafe instructions otherwise, uboot-env can be used to make uboot load the failsafe image *DISCLAIMER* The Failsafe image is unique to Engenius boards. If the failsafe image is missing or damaged this will not work DO NOT downgrade to ar71xx this way, it can cause kernel loop or halt ssh into openwrt and run `fw_setenv rootfs_checksum 0` reboot, wait 3 minutes connect to ethernet and navigate to 192.168.1.1/index.htm select OEM firmware image from Engenius and click upgrade Format of OEM firmware image: The OEM software of ECB600 is a heavily modified version of Openwrt Kamikaze. One of the many modifications is to the sysupgrade program. Image verification is performed simply by the successful ungzip and untar of the supplied file and name check and header verification of the resulting contents. To form a factory.bin that is accepted by OEM Openwrt build, the kernel and rootfs must have specific names... openwrt-senao-ecb600-uImage-lzma.bin openwrt-senao-ecb600-root.squashfs and begin with the respective headers (uImage, squashfs). Then the files must be tarballed and gzipped. The resulting binary is actually a tar.gz file in disguise. This can be verified by using binwalk on the OEM firmware images, ungzipping then untaring. The OEM upgrade script is at /etc/fwupgrade.sh Later models in the ECB series likely have a different platform and the upgrade and image verification process differs. OKLI kernel loader is required because the OEM software expects the kernel to be no greater than 1536k and the factory.bin upgrade procedure would overwrite part of the kernel when writing rootfs. Note on PLL-data cells: The default PLL register values will not work because of the external AR8035-A switch between the SOC and the ethernet PHY chips. For AR934x series, the PLL register for GMAC0 can be seen in the DTSI as 0x2c. Therefore the PLL register can be read from uboot for each link speed after attempting tftpboot or another network action using that link speed with `md 0x1805002c 1`. Unfortunately uboot did not have the best values so they were taken from other similar DTS files. Tested from master, all link speeds functional Signed-off-by: Michael Pratt --- package/boot/uboot-envtools/files/ath79 | 1 + .../ath79/dts/ar9344_engenius_ecb600.dts | 203 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 9 +- target/linux/ath79/image/generic.mk | 10 + 5 files changed, 220 insertions(+), 4 deletions(-) create mode 100644 target/linux/ath79/dts/ar9344_engenius_ecb600.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 2c6a730fbf..4cfcdd3066 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -27,6 +27,7 @@ engenius,eap300-v2|\ engenius,ecb1200|\ engenius,ecb1750|\ engenius,ecb350-v1|\ +engenius,ecb600|\ engenius,enh202-v1|\ engenius,ens202ext-v1|\ engenius,enstationac-v1|\ diff --git a/target/linux/ath79/dts/ar9344_engenius_ecb600.dts b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts new file mode 100644 index 0000000000..8f838607cc --- /dev/null +++ b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts @@ -0,0 +1,203 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + model = "EnGenius ECB600"; + compatible = "engenius,ecb600", "qca,ar9344"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + serial0 = &uart; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x050000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0x0a0000 0x010000>; + read-only; + }; + + firmware2: partition@b0000 { + label = "firmware2"; + reg = <0x0b0000 0x170000>; + }; + + partition@220000 { + label = "fakeroot"; + reg = <0x220000 0x010000>; + read-only; + }; + + firmware1: partition@230000 { + label = "firmware1"; + reg = <0x230000 0xbc0000>; + }; + + partition@df0000 { + label = "failsafe"; + reg = <0xdf0000 0x200000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + phy-handle = <&phy0>; + phy-mode = "rgmii-id"; + + pll-data = <0x02000000 0x00000101 0x00001313>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxdv-delay = <3>; + rxd-delay = <3>; + }; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0,0 { + compatible = "pci168c,0030"; + reg = <0x0 0 0 0 0>; + qca,no-eeprom; + qca,disable-5ghz; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-2)>; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&wmac { + status = "okay"; + + qca,disable-2ghz; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-1)>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 3ea0815ff2..a3b5d45ad2 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -32,6 +32,7 @@ ath79_setup_interfaces() engenius,ecb1200|\ engenius,ecb1750|\ engenius,ecb350-v1|\ + engenius,ecb600|\ enterasys,ws-ap3705i|\ glinet,gl-ar300m-lite|\ glinet,gl-usb150|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 2746cf4137..867a1dac44 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -88,10 +88,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x440 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1) ;; - enterasys,ws-ap3705i) - caldata_extract "calibrate" 0x5000 0x440 - ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0) - ;; + engenius,ecb600|\ mercury,mw4530r-v1|\ ocedo,raccoon|\ tplink,tl-wdr3500-v1|\ @@ -104,6 +101,10 @@ case "$FIRMWARE" in winchannel,wb2000) caldata_extract "art" 0x5000 0x440 ;; + enterasys,ws-ap3705i) + caldata_extract "calibrate" 0x5000 0x440 + ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0) + ;; netgear,wnr2200-8m|\ netgear,wnr2200-16m|\ pcs,cap324|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index ec2b1d2bde..064177fcaf 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1002,6 +1002,16 @@ define Device/engenius_ecb350-v1 endef TARGET_DEVICES += engenius_ecb350-v1 +define Device/engenius_ecb600 + $(Device/engenius_loader_okli) + SOC := ar9344 + DEVICE_MODEL := ECB600 + IMAGE_SIZE := 12032k + LOADER_FLASH_OFFS := 0x230000 + ENGENIUS_IMGNAME := senao-ecb600 +endef +TARGET_DEVICES += engenius_ecb600 + define Device/engenius_enh202-v1 $(Device/engenius_loader_okli) SOC := ar7240 From 23281ebe9634f833a35079921524454bf9d52ca1 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 23 Dec 2020 10:31:08 -0500 Subject: [PATCH 89/97] ath79: Create common DTSI for EAP600 and ECB600 The boards have equivalent hardware except for LEDs and equivalent device config except for MACs also use naming convention for mtd-concat partitions to prepare for upcoming patch "treewide: use more descriptive names for concatenated partitions" Signed-off-by: Michael Pratt --- .../ath79/dts/ar9344_engenius_ecb600.dts | 167 +--------------- .../ath79/dts/ar9344_engenius_exx600.dtsi | 178 ++++++++++++++++++ 2 files changed, 180 insertions(+), 165 deletions(-) create mode 100644 target/linux/ath79/dts/ar9344_engenius_exx600.dtsi diff --git a/target/linux/ath79/dts/ar9344_engenius_ecb600.dts b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts index 8f838607cc..13167adc4d 100644 --- a/target/linux/ath79/dts/ar9344_engenius_ecb600.dts +++ b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts @@ -1,34 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "ar9344.dtsi" - -#include -#include +#include "ar9344_engenius_exx600.dtsi" / { model = "EnGenius ECB600"; compatible = "engenius,ecb600", "qca,ar9344"; - aliases { - label-mac-device = ð0; - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - serial0 = &uart; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - linux,code = ; - }; - }; - leds { compatible = "gpio-leds"; @@ -44,160 +21,20 @@ linux,default-trigger = "phy0tpt"; }; }; - - ath9k-leds { - compatible = "gpio-leds"; - - wifi2g { - label = "blue:wifi2g"; - gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - }; - - virtual_flash { - compatible = "mtd-concat"; - - devices = <&firmware1 &firmware2>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - compatible = "openwrt,okli"; - label = "firmware"; - reg = <0x0 0x0>; - }; - }; - }; -}; - -&ref { - clock-frequency = <40000000>; -}; - -&uart { - status = "okay"; -}; - -&spi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x000000 0x040000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x040000 0x010000>; - }; - - partition@50000 { - label = "custom"; - reg = <0x050000 0x050000>; - read-only; - }; - - partition@a0000 { - label = "loader"; - reg = <0x0a0000 0x010000>; - read-only; - }; - - firmware2: partition@b0000 { - label = "firmware2"; - reg = <0x0b0000 0x170000>; - }; - - partition@220000 { - label = "fakeroot"; - reg = <0x220000 0x010000>; - read-only; - }; - - firmware1: partition@230000 { - label = "firmware1"; - reg = <0x230000 0xbc0000>; - }; - - partition@df0000 { - label = "failsafe"; - reg = <0xdf0000 0x200000>; - read-only; - }; - - art: partition@ff0000 { - label = "art"; - reg = <0xff0000 0x010000>; - read-only; - }; - }; - }; -}; - -&mdio0 { - status = "okay"; - - phy0: ethernet-phy@0 { - reg = <0>; - eee-broken-100tx; - eee-broken-1000t; - }; }; ð0 { - status = "okay"; - mtd-mac-address = <&art 0x0>; - - phy-handle = <&phy0>; - phy-mode = "rgmii-id"; - - pll-data = <0x02000000 0x00000101 0x00001313>; - - gmac-config { - device = <&gmac>; - rgmii-gmac0 = <1>; - rxdv-delay = <3>; - rxd-delay = <3>; - }; }; &pcie { - status = "okay"; - - ath9k: wifi@0,0,0 { - compatible = "pci168c,0030"; - reg = <0x0 0 0 0 0>; - qca,no-eeprom; - qca,disable-5ghz; + wifi@0,0,0 { mtd-mac-address = <&art 0x0>; mtd-mac-address-increment = <(-2)>; - #gpio-cells = <2>; - gpio-controller; }; }; &wmac { - status = "okay"; - - qca,disable-2ghz; - - mtd-cal-data = <&art 0x1000>; mtd-mac-address = <&art 0x0>; mtd-mac-address-increment = <(-1)>; }; diff --git a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi new file mode 100644 index 0000000000..5ae2ea66ef --- /dev/null +++ b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + serial0 = &uart; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x050000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0x0a0000 0x010000>; + read-only; + }; + + fwconcat1: partition@b0000 { + label = "fwconcat1"; + reg = <0x0b0000 0x170000>; + }; + + partition@220000 { + label = "fakeroot"; + reg = <0x220000 0x010000>; + read-only; + }; + + fwconcat0: partition@230000 { + label = "fwconcat0"; + reg = <0x230000 0xbc0000>; + }; + + partition@df0000 { + label = "failsafe"; + reg = <0xdf0000 0x200000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy0>; + phy-mode = "rgmii-id"; + + pll-data = <0x02000000 0x00000101 0x00001313>; + + gmac-config { + device = <&gmac>; + rgmii-gmac0 = <1>; + rxdv-delay = <3>; + rxd-delay = <3>; + }; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0,0 { + compatible = "pci168c,0030"; + reg = <0x0 0 0 0 0>; + qca,disable-5ghz; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&wmac { + status = "okay"; + + qca,disable-2ghz; + + mtd-cal-data = <&art 0x1000>; +}; From 6c98edaae20ac1dd0364963aadeecb022f6a80a1 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 9 Oct 2020 12:28:11 -0400 Subject: [PATCH 90/97] ath79: add support for Senao Engenius EAP600 FCC ID: A8J-EAP600 Engenius EAP600 is a wireless access point with 1 gigabit ethernet port, dual-band wireless, external ethernet switch, 4 internal antennas and 802.3af PoE. Specification: - AR9344 SOC (5 GHz, 2x2, WMAC) - AR9382 WLAN (2.4 GHz, 2x2, PCIe on-board) - AR8035-A switch (GbE with 802.3af PoE) - 40 MHz reference clock - 16 MB FLASH MX25L12845EMI-10G - 2x 64 MB RAM NT5TU32M16DG - UART at H1 (populated) - 5 LEDs, 1 button (power, eth, 2.4 GHz, 5 GHz, wps) (reset) - 4 internal antennas MAC addresses: MAC addresses are labeled MAC1 and MAC2 The MAC address in flash is not on the label The OEM software reports these MACs for the ifconfig eth0 MAC 1 *:5e --- phy1 MAC 2 *:5f --- (2.4 GHz) phy0 ----- *:60 art 0x0 (5 GHz) Installation: 2 ways to flash factory.bin from OEM: - if you get Failsafe Mode from failed flash: only use it to flash Original firmware from Engenius or risk kernel loop or halt which requires serial cable Method 1: Firmware upgrade page: OEM webpage at 192.168.1.1 username and password "admin" Navigate to "Upgrade Firmware" page from left pane Click Browse and select the factory.bin image Upload and verify checksum Click Continue to confirm and wait 3 minutes Method 2: Serial to load Failsafe webpage: After connecting to serial console and rebooting... Interrupt uboot with any key pressed rapidly execute `run failsafe_boot` OR `bootm 0x9fdf0000` wait a minute connect to ethernet and navigate to "192.168.1.1/index.htm" Select the factory.bin image and upload wait about 3 minutes Return to OEM: If you have a serial cable, see Serial Failsafe instructions otherwise, uboot-env can be used to make uboot load the failsafe image *DISCLAIMER* The Failsafe image is unique to Engenius boards. If the failsafe image is missing or damaged this will not work DO NOT downgrade to ar71xx this way, it can cause kernel loop or halt ssh into openwrt and run `fw_setenv rootfs_checksum 0` reboot, wait 3 minutes connect to ethernet and navigate to 192.168.1.1/index.htm select OEM firmware image from Engenius and click upgrade Format of OEM firmware image: The OEM software of EAP600 is a heavily modified version of Openwrt Kamikaze. One of the many modifications is to the sysupgrade program. Image verification is performed simply by the successful ungzip and untar of the supplied file and name check and header verification of the resulting contents. To form a factory.bin that is accepted by OEM Openwrt build, the kernel and rootfs must have specific names... openwrt-senao-eap600-uImage-lzma.bin openwrt-senao-eap600-root.squashfs and begin with the respective headers (uImage, squashfs). Then the files must be tarballed and gzipped. The resulting binary is actually a tar.gz file in disguise. This can be verified by using binwalk on the OEM firmware images, ungzipping then untaring. The OEM upgrade script is at /etc/fwupgrade.sh Later models in the EAP series likely have a different platform and the upgrade and image verification process differs. OKLI kernel loader is required because the OEM software expects the kernel to be no greater than 1536k and the factory.bin upgrade procedure would overwrite part of the kernel when writing rootfs. Note on PLL-data cells: The default PLL register values will not work because of the external AR8035-A switch between the SOC and the ethernet PHY chips. For AR934x series, the PLL register for GMAC0 can be seen in the DTSI as 0x2c. Therefore the PLL register can be read from uboot for each link speed after attempting tftpboot or another network action using that link speed with `md 0x1805002c 1`. Unfortunately uboot did not have the best values so they were taken from other similar DTS files. Tested from master, all link speeds functional Signed-off-by: Michael Pratt --- package/boot/uboot-envtools/files/ath79 | 1 + .../ath79/dts/ar9344_engenius_eap600.dts | 45 +++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 + target/linux/ath79/image/generic.mk | 10 +++++ 5 files changed, 58 insertions(+) create mode 100644 target/linux/ath79/dts/ar9344_engenius_eap600.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 4cfcdd3066..8f4b8ef31e 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -24,6 +24,7 @@ arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ engenius,eap300-v2|\ +engenius,eap600|\ engenius,ecb1200|\ engenius,ecb1750|\ engenius,ecb350-v1|\ diff --git a/target/linux/ath79/dts/ar9344_engenius_eap600.dts b/target/linux/ath79/dts/ar9344_engenius_eap600.dts new file mode 100644 index 0000000000..c6961f636e --- /dev/null +++ b/target/linux/ath79/dts/ar9344_engenius_eap600.dts @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_engenius_exx600.dtsi" + +/ { + model = "EnGenius EAP600"; + compatible = "engenius,eap600", "qca,ar9344"; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + wifi5g { + label = "green:wifi5g"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +ð0 { + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-2)>; +}; + +&pcie { + wifi@0,0,0 { + mtd-mac-address = <&art 0x0>; + }; +}; + +&wmac { + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <(-1)>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index a3b5d45ad2..355ea25b4d 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -29,6 +29,7 @@ ath79_setup_interfaces() dlink,dap-1365-a1|\ dlink,dir-505|\ engenius,eap300-v2|\ + engenius,eap600|\ engenius,ecb1200|\ engenius,ecb1750|\ engenius,ecb350-v1|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 867a1dac44..553db59231 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -88,6 +88,7 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x440 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1) ;; + engenius,eap600|\ engenius,ecb600|\ mercury,mw4530r-v1|\ ocedo,raccoon|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 064177fcaf..8f9e7159d1 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -965,6 +965,16 @@ define Device/engenius_eap300-v2 endef TARGET_DEVICES += engenius_eap300-v2 +define Device/engenius_eap600 + $(Device/engenius_loader_okli) + SOC := ar9344 + DEVICE_MODEL := EAP600 + IMAGE_SIZE := 12032k + LOADER_FLASH_OFFS := 0x230000 + ENGENIUS_IMGNAME := senao-eap600 +endef +TARGET_DEVICES += engenius_eap600 + define Device/engenius_ecb1200 SOC := qca9557 DEVICE_VENDOR := EnGenius From 33d26a9a4048e942f091b58a8d592fc809cdb19c Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Sat, 19 Sep 2020 03:09:11 -0400 Subject: [PATCH 91/97] ath79: add support for Senao Engenius EAP350 v1 FCC ID: U2M-EAP350 Engenius EAP350 is a wireless access point with 1 gigabit PoE ethernet port, 2.4 GHz wireless, external ethernet switch, and 2 internal antennas. Specification: - AR7242 SOC - AR9283 WLAN (2.4 GHz, 2x2, PCIe on-board) - AR8035-A switch (GbE with 802.3af PoE) - 40 MHz reference clock - 8 MB FLASH MX25L6406E - 32 MB RAM EM6AA160TSA-5G - UART at J2 (populated) - 3 LEDs, 1 button (power, eth, 2.4 GHz) (reset) - 2 internal antennas MAC addresses: MAC address is labeled as "MAC" Only 1 address on label and in flash The OEM software reports these MACs for the ifconfig eth0 MAC *:0c art 0x0 phy0 --- *:0d --- Installation: 2 ways to flash factory.bin from OEM: - if you get Failsafe Mode from failed flash: only use it to flash Original firmware from Engenius or risk kernel loop or halt which requires serial cable Method 1: Firmware upgrade page: OEM webpage at 192.168.10.1 username and password "admin" Navigate to "Upgrade Firmware" page from left pane Click Browse and select the factory.bin image Upload and verify checksum Click Continue to confirm and wait 3 minutes Method 2: Serial to load Failsafe webpage: After connecting to serial console and rebooting... Interrupt uboot with any key pressed rapidly execute `run failsafe_boot` OR `bootm 0x9f670000` wait a minute connect to ethernet and navigate to "192.168.1.1/index.htm" Select the factory.bin image and upload wait about 3 minutes Return to OEM: If you have a serial cable, see Serial Failsafe instructions otherwise, uboot-env can be used to make uboot load the failsafe image *DISCLAIMER* The Failsafe image is unique to Engenius boards. If the failsafe image is missing or damaged this will not work DO NOT downgrade to ar71xx this way, it can cause kernel loop or halt ssh into openwrt and run `fw_setenv rootfs_checksum 0` reboot, wait 3 minutes connect to ethernet and navigate to 192.168.1.1/index.htm select OEM firmware image from Engenius and click upgrade Format of OEM firmware image: The OEM software of EAP350 is a heavily modified version of Openwrt Kamikaze. One of the many modifications is to the sysupgrade program. Image verification is performed simply by the successful ungzip and untar of the supplied file and name check and header verification of the resulting contents. To form a factory.bin that is accepted by OEM Openwrt build, the kernel and rootfs must have specific names... openwrt-senao-eap350-uImage-lzma.bin openwrt-senao-eap350-root.squashfs and begin with the respective headers (uImage, squashfs). Then the files must be tarballed and gzipped. The resulting binary is actually a tar.gz file in disguise. This can be verified by using binwalk on the OEM firmware images, ungzipping then untaring. The OEM upgrade script is at /etc/fwupgrade.sh Later models in the EAP series likely have a different platform and the upgrade and image verification process differs. OKLI kernel loader is required because the OEM software expects the kernel to be no greater than 1024k and the factory.bin upgrade procedure would overwrite part of the kernel when writing rootfs. Note on PLL-data cells: The default PLL register values will not work because of the external AR8035-A switch between the SOC and the ethernet PHY chips. For AR724x series, the PLL register for GMAC0 can be seen in the DTSI as 0x2c. Therefore the PLL register can be read from uboot for each link speed after attempting tftpboot or another network action using that link speed with `md 0x1805002c 1`. uboot did not have a good value for 1 GBps so it was taken from other similar DTS file. Tested from master, all link speeds functional Signed-off-by: Michael Pratt --- package/boot/uboot-envtools/files/ath79 | 1 + .../ath79/dts/ar7242_engenius_eap350-v1.dts | 174 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 + target/linux/ath79/image/generic.mk | 11 ++ 5 files changed, 188 insertions(+) create mode 100644 target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 8f4b8ef31e..1eaaa06f0e 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -24,6 +24,7 @@ arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ engenius,eap300-v2|\ +engenius,eap350-v1|\ engenius,eap600|\ engenius,ecb1200|\ engenius,ecb1750|\ diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts new file mode 100644 index 0000000000..b530f6aa8a --- /dev/null +++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7242.dtsi" + +#include +#include + +/ { + compatible = "engenius,eap350-v1", "qca,ar7242"; + model = "EnGenius EAP350 v1"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "blue:power"; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wlan { + label = "blue:wlan"; + gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x50000 0x50000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0xa0000 0x10000>; + read-only; + }; + + firmware2: partition@b0000 { + label = "firmware2"; + reg = <0xb0000 0xf0000>; + }; + + partition@1a0000 { + label = "fakeroot"; + reg = <0x1a0000 0x10000>; + read-only; + }; + + firmware1: partition@1b0000 { + label = "firmware1"; + reg = <0x1b0000 0x4c0000>; + }; + + partition@670000 { + label = "failsafe"; + reg = <0x670000 0x180000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + phy-handle = <&phy4>; + phy-mode = "rgmii-id"; + + pll-data = <0x02000000 0x00000101 0x00001313>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0,0 { + compatible = "pci168c,002a"; + reg = <0x0 0 0 0 0>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 355ea25b4d..14e858b8fa 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -29,6 +29,7 @@ ath79_setup_interfaces() dlink,dap-1365-a1|\ dlink,dir-505|\ engenius,eap300-v2|\ + engenius,eap350-v1|\ engenius,eap600|\ engenius,ecb1200|\ engenius,ecb1750|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 553db59231..28ac38e1d4 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -75,6 +75,7 @@ case "$FIRMWARE" in caldata_extract_reverse "urloader" 0x1541 0x440 ;; buffalo,wzr-hp-g302h-a1a0|\ + engenius,eap350-v1|\ engenius,ecb350-v1|\ engenius,enh202-v1) caldata_extract "art" 0x1000 0xeb8 diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 8f9e7159d1..870007f044 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -965,6 +965,17 @@ define Device/engenius_eap300-v2 endef TARGET_DEVICES += engenius_eap300-v2 +define Device/engenius_eap350-v1 + $(Device/engenius_loader_okli) + SOC := ar7242 + DEVICE_MODEL := EAP350 + DEVICE_VARIANT := v1 + IMAGE_SIZE := 4864k + LOADER_FLASH_OFFS := 0x1b0000 + ENGENIUS_IMGNAME := senao-eap350 +endef +TARGET_DEVICES += engenius_eap350-v1 + define Device/engenius_eap600 $(Device/engenius_loader_okli) SOC := ar9344 From dafa201b3e121a7cfe5be222041d700707a8851c Mon Sep 17 00:00:00 2001 From: Marty Jones Date: Tue, 22 Dec 2020 17:02:34 -0500 Subject: [PATCH 92/97] rockchip: use USB host by default on rk3399-rock-pi-4 This backport fix connections errors on the upper USB3 port of the Radxa ROCK Pi 4 . Signed-off-by: Marty Jones --- ...-host-by-default-on-rk3399-rock-pi-4.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch diff --git a/target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch b/target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch new file mode 100644 index 0000000000..1abab5e2eb --- /dev/null +++ b/target/linux/rockchip/patches-5.4/104-rockchip-use-USB-host-by-default-on-rk3399-rock-pi-4.patch @@ -0,0 +1,32 @@ +From e12f67fe83446432ef16704c22ec23bd1dbcd094 Mon Sep 17 00:00:00 2001 +From: Vicente Bergas +Date: Tue, 1 Dec 2020 16:41:32 +0100 +Subject: arm64: dts: rockchip: use USB host by default on rk3399-rock-pi-4 + +Based on the board schematics at +https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi_4c_v12_sch_20200620.pdf +on page 19 there is an USB Type-A receptacle being used as an USB-OTG port. + +But the Type-A connector is not valid for OTG operation, for this reason +there is a switch to select host or device role. +This is non-compliant and error prone because switching is manual. +So, use host mode as it corresponds for a Type-A receptacle. + +Signed-off-by: Vicente Bergas +Link: https://lore.kernel.org/r/20201201154132.1286-4-vicencb@gmail.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts +@@ -684,7 +684,7 @@ + + &usbdrd_dwc3_0 { + status = "okay"; +- dr_mode = "otg"; ++ dr_mode = "host"; + }; + + &usbdrd3_1 { From 1c557e27fd8b24a1337a1ccfcab34a8b9904cfee Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 23 Dec 2020 16:23:25 +0100 Subject: [PATCH 93/97] ipq-wifi: Fix suffix for Plasma Cloud PA1200 QCA4019 board-2.bin The Makefile is rejecting all files with for a given prefix (here "board-plasmacloud_pa1200") when it didn't match a known suffix. Instead it stops the build with an error like: Makefile:135: *** Unrecognized board-file suffix '.ipq4019' for 'board-plasmacloud_pa1200.ipq4019'. Stop. The correct suffix for the QCA4019/hw1.0 is qca4019 and not ipq4019. Fixes: ea5bb6bbfee0 ("ipq40xx: add support for Plasma Cloud PA1200") Signed-off-by: Sven Eckelmann --- ...200.ipq4019 => board-plasmacloud_pa1200.qca4019} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename package/firmware/ipq-wifi/{board-plasmacloud_pa1200.ipq4019 => board-plasmacloud_pa1200.qca4019} (100%) diff --git a/package/firmware/ipq-wifi/board-plasmacloud_pa1200.ipq4019 b/package/firmware/ipq-wifi/board-plasmacloud_pa1200.qca4019 similarity index 100% rename from package/firmware/ipq-wifi/board-plasmacloud_pa1200.ipq4019 rename to package/firmware/ipq-wifi/board-plasmacloud_pa1200.qca4019 From b4009f453ce81fba0e26479cc54c1b798a00bbae Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 23 Dec 2020 16:23:25 +0100 Subject: [PATCH 94/97] ipq-wifi: Fix suffix for Plasma Cloud PA2200 QCA4019 board-2.bin The Makefile is rejecting all files with for a given prefix (here "board-plasmacloud_pa2200") when it didn't match a known suffix. Instead it stops the build with an error like: Makefile:135: *** Unrecognized board-file suffix '.ipq4019' for 'board-plasmacloud_pa2200.ipq4019'. Stop. The correct suffix for the QCA4019/hw1.0 is qca4019 and not ipq4019. Fixes: 4871fd2616ac ("ipq40xx: add support for Plasma Cloud PA2200") Signed-off-by: Sven Eckelmann --- ...200.ipq4019 => board-plasmacloud_pa2200.qca4019} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename package/firmware/ipq-wifi/{board-plasmacloud_pa2200.ipq4019 => board-plasmacloud_pa2200.qca4019} (100%) diff --git a/package/firmware/ipq-wifi/board-plasmacloud_pa2200.ipq4019 b/package/firmware/ipq-wifi/board-plasmacloud_pa2200.qca4019 similarity index 100% rename from package/firmware/ipq-wifi/board-plasmacloud_pa2200.ipq4019 rename to package/firmware/ipq-wifi/board-plasmacloud_pa2200.qca4019 From d64102e00a8e3aebda8427df3b2c36bf4639928f Mon Sep 17 00:00:00 2001 From: Yanase Yuki Date: Sat, 18 Apr 2020 14:49:13 +0900 Subject: [PATCH 95/97] ipq806x: add support for Qualcomm IPQ8062 SoC This commit adds support for Qualcomm IPQ8062 SoC. IPQ8062 is a lower clock variant of IPQ8064. CPU and NSS clocks: - CPU: 384 MHz - 1 GHz - NSS: 110 MHz - 550 MHz opp and l2 clock values are taken from WG2600HP3 GPL source code [1]. Due to a lack of devices, I didn't test the following features. - SATA - NAND flash memory controller - SD - USB - GSBI2, GSBI7 - PCIE2 - GMAC0, GMAC3 Works properly: - GSBI4 UART - GSBI5 SPI - GMAC1, GMAC2 - PCIE0, PCIE1 - MDIO0 Does not work properly: - CPU SPC - This can cause a system hang. Same as IPQ8065. See 2336c2dbb1929837f7e42d4315c8073342a5b46b [1] https://www.aterm.jp/function/wg2600hp3/appendix/opensource.html Signed-off-by: Yanase Yuki --- .../files/arch/arm/boot/dts/qcom-ipq8062.dtsi | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi new file mode 100644 index 0000000000..caef2bc824 --- /dev/null +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062.dtsi @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include "qcom-ipq8064.dtsi" + +/ { + model = "Qualcomm IPQ8062"; + compatible = "qcom,ipq8062", "qcom,ipq8064"; + + aliases { + serial0 = &gsbi4_serial; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + cpus { + qcom,l2 { + qcom,l2-rates = <384000000 1000000000 1000000000>; + qcom,l2-cpufreq = <384000000 600000000 1000000000>; + qcom,l2-volt = <1100000 1100000 1100000>; + }; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + rsvd@41200000 { + reg = <0x41200000 0x300000>; + no-map; + }; + }; +}; + +&gsbi4 { + qcom,mode = ; + status = "okay"; + + serial@16340000 { + status = "okay"; + }; + /* + * The i2c device on gsbi4 should not be enabled. + * On ipq806x designs gsbi4 i2c is meant for exclusive + * RPM usage. Turning this on in kernel manifests as + * i2c failure for the RPM. + */ +}; + +&opp_table0 { + /delete-node/opp-1200000000; + /delete-node/opp-1400000000; + + opp-384000000 { + opp-microvolt-speed0-pvs0-v0 = <950000>; + opp-microvolt-speed0-pvs1-v0 = <900000>; + opp-microvolt-speed0-pvs2-v0 = <850000>; + opp-microvolt-speed0-pvs3-v0 = <800000>; + }; + + opp-600000000 { + opp-microvolt-speed0-pvs0-v0 = <1000000>; + opp-microvolt-speed0-pvs1-v0 = <950000>; + opp-microvolt-speed0-pvs2-v0 = <900000>; + opp-microvolt-speed0-pvs3-v0 = <850000>; + }; + + opp-800000000 { + opp-microvolt-speed0-pvs0-v0 = <1050000>; + opp-microvolt-speed0-pvs1-v0 = <1000000>; + opp-microvolt-speed0-pvs2-v0 = <950000>; + opp-microvolt-speed0-pvs3-v0 = <900000>; + }; + + opp-1000000000 { + opp-microvolt-speed0-pvs0-v0 = <1100000>; + opp-microvolt-speed0-pvs1-v0 = <1050000>; + opp-microvolt-speed0-pvs2-v0 = <1000000>; + opp-microvolt-speed0-pvs3-v0 = <950000>; + }; +}; + +&pcie0 { + compatible = "qcom,pcie-ipq8064-v2"; +}; + +&pcie1 { + compatible = "qcom,pcie-ipq8064-v2"; +}; + +&pcie2 { + compatible = "qcom,pcie-ipq8064-v2"; +}; + +&smb208_s2a { + regulator-max-microvolt = <1150000>; +}; + +&smb208_s2b { + regulator-max-microvolt = <1150000>; +}; From 3bb16185737c011b74e3166cf436785604b5f47f Mon Sep 17 00:00:00 2001 From: Yanase Yuki Date: Tue, 21 Apr 2020 15:06:12 +0900 Subject: [PATCH 96/97] ipq806x: add support for NEC Platforms Aterm WG2600HP3 NEC Platforms Aterm WG2600HP3 is a dual-band router based on Qualcomm IPQ8062. Specification ------------- - SoC: Qualcomm IPQ8062 - RAM: 512MiB - Flash memory: SPI-NOR 32MiB (Cypress S25FL256S) - Wi-Fi: Qualcomm QCA9984 (2.4GHz, 1ch - 13ch) - Wi-Fi: Qualcomm QCA9984 (5GHz, 36ch - 64ch, 100ch - 140ch) - Ethernet: 4x 100/1000 Mbps (1x WAN, 4x LAN) - LED: 6x green LED, 6x red LED - Input: 2x tactile switch, 1x SP3T slide switch - Serial console: 115200bps, through-hole J3 - [ ] [GND] [ ] [TX] [RX] ----> DC jack - Power: DC 12V 1.5A This device does not support VHT160 and VHT80+80. Custom BDFs are required to limit VHT capabilities. Flash instructions ------------------ 1. Setup TFTP server (IP address: 192.168.1.2) 2. Put initramfs image into TFTP server directory 3. Connect WG2600HP3 lan port and computer that runs TFTP server 4. Connect to the serial console 5. Interrupt booting by Esc key (password: chiron) 6. Execute the following commands # setenv bootcmd "nboot 0x44000000 1 0x860000" # saveenv # setenv ipaddr 192.168.1.1 # setenv serverip 192.168.1.2 # tftpboot 0x44000000 openwrt-ipq806x-generic-nec_wg2600hp3-initramfs-uImage 7. After booting OpenWrt initramfs image, backup SPI-NOR flash memory 8. Erase firmware partition # mtd erase firmware 9. Run sysupgrade Signed-off-by: Yanase Yuki --- package/firmware/ipq-wifi/Makefile | 2 + .../ipq-wifi/board-nec_wg2600hp3.qca9984 | Bin 0 -> 24332 bytes .../ipq806x/base-files/etc/board.d/01_leds | 3 + .../ipq806x/base-files/etc/board.d/02_network | 4 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 6 +- .../arm/boot/dts/qcom-ipq8062-wg2600hp3.dts | 430 ++++++++++++++++++ target/linux/ipq806x/image/Makefile | 14 + .../0069-arm-boot-add-dts-files.patch | 3 +- 8 files changed, 459 insertions(+), 3 deletions(-) create mode 100644 package/firmware/ipq-wifi/board-nec_wg2600hp3.qca9984 create mode 100644 target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index f1a0c1c474..f42704b8d3 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -43,6 +43,7 @@ ALLWIFIBOARDS:= \ linksys_mr8300-v0 \ luma_wrtq-329acn \ mobipromo_cm520-79f \ + nec_wg2600hp3 \ plasmacloud_pa1200 \ plasmacloud_pa2200 \ qxwlan_e2600ac @@ -124,6 +125,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) $(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300)) $(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN)) $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F)) +$(eval $(call generate-ipq-wifi-package,nec_wg2600hp3,NEC Platforms WG2600HP3)) $(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200)) $(eval $(call generate-ipq-wifi-package,plasmacloud_pa2200,Plasma Cloud PA2200)) $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC)) diff --git a/package/firmware/ipq-wifi/board-nec_wg2600hp3.qca9984 b/package/firmware/ipq-wifi/board-nec_wg2600hp3.qca9984 new file mode 100644 index 0000000000000000000000000000000000000000..f95ccd251e785d4db96b9953b655801e95b02431 GIT binary patch literal 24332 zcmeHPYfuwe7Vd-~_*&`khS2hI2nZnrA1$CfbTp6#0tPhk#Y;?Dgb0X)_?+1p2-5^c zL_vrmgRBo=*(qwuaYw8v%N?gmsr|7(rfO?<+^U^FJGEBLthMV_xn^&t)8s)S$pAAT zeLCIu+|%dWd;3e1+`i`v1=}+dGG*cUs+RotS({CF3~2T zP%KSmfp)?{o8gK0P8N&1p}4Vw+X8I<&%mJslzZ5u3&eq-)kacbdwP(Cy@a5o3y|dG zcATMH!HQ*5{YqKXW*^{ZV@S8H+MIK- z!u9oqtoML`0LXfGu^HNJIS^W3>?L{6SmdW)jRuHY(M*6Va4{&&3remu%J?t{FbFUR zxQoDzb{6E#VzD{i-~|*{;<1tnqT`Q$`iAuV#yAG%RQHU2U?(>^zTTK+oHUjgS3u)X zKiFtl0gV|ifxQ^`4jC^@`FC_QC}c8hCkpxac$=Nk*mY5nk!wNi-+%kd%h#{{fkxR# zUy93)4OgJmEYuow{`B7x|M2u?v#1Syyh5yB`kH3-9iV|8jwX=ziVV$^Bx zk1LS)BEHXk;ZP)05Q=R_wm;tvOAv`bf+Zu#&y(R)Bvp`#QE!6v(bN?M{k$I?-Mh23 zVSANC|M>l6i?j5TjW(}4nN6oN2|lN;zBgz zB@ifv9|IA;#XHFW{$}kB{IXmF0^*1fyiHz%O87!zK--R=7t7ErQvja~7{Ht5)o3nX zMBK*PL8vTfJm9l@l)d6=7883K4iG5)ytJ)IX|8l!gU}N<0pYebf5>& z$mkfM$7|#=GjfsN{ z14Ji&oD3kYYxVdUaW1-T^fp1@)$$@#^xzZ22ShzC6Z5HSh>3wlhlvhwQi=*e4?0{U z&Ox_~-XK22Ritflc=ThU3eS~`sDL;=G&%%^R0~>5G7M_lKo5Cn>VpA;PFsZ^5~Gth zMs);^OXNaRKpa1IrnkxFJoC6>1Ba6egOU?qY|IQwHgGtpFeo_zhB3bp0XDUaZR6wG zvx-f~qODxMcH}~0L)c-sps(xQ#&~6L(WZ{kkk|SgC*EoojWS zq6Va#TQG82q7fY76|LSf*mtx|P{TXuBe^$F-JX3u{IH+w`T%}W(i~kKc%Z9Y+>m&L zCtIB|cI6b2QWst3FYUUjXiY!GE9dTR?UU=%&#zVb$%ne?bepRq4+dZl2M*{GYIuj> z+{a@YL!LhI^cq=Te?@!hnHV)!_EmRX3)UF1&tG!!io9iO6Y$G_IFi?vs0~$e6}RWul6tc{8P;*i60>KK4pfhhda_v$5eBrgzkWb zzdtZ%&6eh_y&s|{_$puN?}twsgr|`z?!GUF%G>7r4Yt*s5tfGK!Kvdt4Z1w7 zsEWI*z3ZqhvndV_mM_{jo*6iU0D}PJwS493HL$OLU~p*ITH6ORQ;nSdze&8T#Q~n( z=St9^$ET$tWZk-G@QR9z2#<=0h>R$Pynk}$bE+S<2ZzIgJiu|8X=%#KlU!!=@}iEO z95$%U>=P&ogx7L+iFU#H+|8oRa5~qU7O1f7!oa5wt&jAhzkB8MKFI8$N#?ANDOebV zL0|?1Uc7kmFI%w-aB007#LTsy-7uC~72B^Q#-BnEC>z1D*;D&6Y?|UKNeayzT)b4lYdKV7@#<5j?98LwaxBKQJGOu|V z$aNs}72E|f8ynrue3jT<@Zs7&{uTC z2>4i|R_sQF6GOeN8l^%4`WorI0BnUQMFfcjR16yumR=pKyp;YP|3qNf7CJ7>_#7kPX`ODf`pl=*H)YyPAJ|}SXqp_d*nqeJ$mMJg5Abcg z%q(90=SnidP1!cv$z5bIXAZJ$j<0DUT1oCb36F_;Pfc289H#m+i;EOWvsA1!k(F+( zPFnHpt?ht2-$3!?SFT*Pj5=fC-oN_C-=BT^ElKvbaPOD@=ZAlO|NVEswgx-~IEuG! ze?D}EdvAU+`+|N#dy~R&@2Ajlg#u4Q`m_7GvW{ZSx~Fv0aH$KN_v3v0Ez{pC&dRy$ zb4gBOnTvMi7Gh9hP;!C*b89#O#>V_Mpk#AFOoc&!L4ZMkL4ZMkL0}0ZFr61qQ}4a! zEN?%(4>R)~{QE9zWR$?azYZogUwQq1$f?RUnxr|rKa@1E?N;oiG5 z+nwgiaPOx9h?TZ};XX9tM_kd+JMa8!x%-dCM`B?7p_MJ@x{twDM Bvkw3O literal 0 HcmV?d00001 diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index c23f25540b..fed821663a 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -27,6 +27,9 @@ nec,wg2600hp) ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy0tpt" ucidef_set_led_switch "wan" "WAN" "green:active" "switch0" "0x2" ;; +nec,wg2600hp3) + ucidef_set_led_switch "wan" "WAN" "green:active" "switch0" "0x2" + ;; netgear,d7800 |\ netgear,r7500 |\ netgear,r7500v2 |\ diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index eecf81a8cd..10b2ec0148 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -46,6 +46,10 @@ linksys,ea8500) ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$hw_mac_addr" ;; +nec,wg2600hp3) + ucidef_add_switch "switch0" \ + "2:lan" "3:lan" "4:lan" "5:lan" "0@eth1" "1:wan" "6@eth0" + ;; netgear,r7800 |\ tplink,c2600) ucidef_add_switch "switch0" \ diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index a22af9b676..8788fc92f6 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -24,7 +24,8 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +1) ;; - nec,wg2600hp) + nec,wg2600hp |\ + nec,wg2600hp3) caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0x12) ;; @@ -62,7 +63,8 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +2) ;; - nec,wg2600hp) + nec,wg2600hp |\ + nec,wg2600hp3) caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0xc) ;; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts new file mode 100644 index 0000000000..d234b94a46 --- /dev/null +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts @@ -0,0 +1,430 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq8062.dtsi" +#include + +/delete-node/ &nand_pins; + +/ { + model = "NEC Platforms Aterm WG2600HP3"; + compatible = "nec,wg2600hp3", "qcom,ipq8062", "qcom,ipq8064"; + + memory { + device_type = "memory"; + reg = <0x42000000 0x1e000000>; + }; + + aliases { + label-mac-device = &gmac2; + + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_red; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-0 = <&buttons_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 24 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&qcom_pinmux 22 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + mode0 { + label = "mode0"; + gpios = <&qcom_pinmux 40 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + mode1 { + label = "mode1"; + gpios = <&qcom_pinmux 41 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-0 = <&leds_pins>; + pinctrl-names = "default"; + + led_power_green: power_green { + label = "green:power"; + gpios = <&qcom_pinmux 14 GPIO_ACTIVE_HIGH>; + }; + + led_power_red: power_red { + label = "red:power"; + gpios = <&qcom_pinmux 35 GPIO_ACTIVE_HIGH>; + }; + + active_green { + label = "green:active"; + gpios = <&qcom_pinmux 42 GPIO_ACTIVE_HIGH>; + }; + + active_red { + label = "red:active"; + gpios = <&qcom_pinmux 38 GPIO_ACTIVE_HIGH>; + }; + + wlan2g_green { + label = "green:wlan2g"; + gpios = <&qcom_pinmux 55 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + + wlan2g_red { + label = "red:wlan2g"; + gpios = <&qcom_pinmux 56 GPIO_ACTIVE_HIGH>; + }; + + wlan5g_green { + label = "green:wlan5g"; + gpios = <&qcom_pinmux 57 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g_red { + label = "red:wlan5g"; + gpios = <&qcom_pinmux 58 GPIO_ACTIVE_HIGH>; + }; + + tv_green { + label = "green:tv"; + gpios = <&qcom_pinmux 46 GPIO_ACTIVE_HIGH>; + }; + + tv_red { + label = "red:tv"; + gpios = <&qcom_pinmux 36 GPIO_ACTIVE_HIGH>; + }; + + converter_green { + label = "green:converter"; + gpios = <&qcom_pinmux 43 GPIO_ACTIVE_HIGH>; + }; + + converter_red { + label = "red:converter"; + gpios = <&qcom_pinmux 15 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&qcom_pinmux { + pinctrl-0 = <&akro_pins>; + pinctrl-names = "default"; + + spi_pins: spi_pins { + mux { + pins = "gpio18", "gpio19", "gpio21"; + function = "gsbi5"; + bias-pull-down; + }; + + data { + pins = "gpio18", "gpio19"; + drive-strength = <10>; + }; + + cs { + pins = "gpio20"; + drive-strength = <10>; + }; + + clk { + pins = "gpio21"; + drive-strength = <12>; + }; + }; + + buttons_pins: buttons_pins { + mux { + pins = "gpio22", "gpio24", "gpio40", + "gpio41"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + leds_pins: leds_pins { + mux { + pins = "gpio14", "gpio15", "gpio35", + "gpio36", "gpio38", "gpio42", + "gpio43", "gpio46", "gpio55", + "gpio56", "gpio57", "gpio58"; + function = "gpio"; + bias-pull-down; + }; + + akro2 { + pins = "gpio15", "gpio35", "gpio38", + "gpio42", "gpio43", "gpio46", + "gpio55", "gpio56", "gpio57", + "gpio58"; + drive-strength = <2>; + }; + + akro4 { + pins = "gpio14", "gpio36"; + drive-strength = <4>; + }; + }; + + /* + * Stock firmware has the following settings, so let's do the same. + * I don't sure why these are required. + */ + akro_pins: akro_pinmux { + akro { + pins = "gpio17", "gpio26", "gpio47"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + reset { + pins = "gpio45"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + output-low; + }; + + gmac0_rgmii { + pins = "gpio25"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + }; + }; +}; + +&gsbi5 { + status = "okay"; + qcom,mode = ; + + spi@1a280000 { + status = "okay"; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x0000000 0x0020000>; + read-only; + }; + + partition@20000 { + label = "MIBIB"; + reg = <0x0020000 0x0020000>; + read-only; + }; + + partition@40000 { + label = "SBL2"; + reg = <0x0040000 0x0040000>; + read-only; + }; + + partition@80000 { + label = "SBL3"; + reg = <0x0080000 0x0080000>; + read-only; + }; + + partition@100000 { + label = "DDRCONFIG"; + reg = <0x0100000 0x0010000>; + read-only; + }; + + partition@110000 { + label = "SSD"; + reg = <0x0110000 0x0010000>; + read-only; + }; + + partition@120000 { + label = "TZ"; + reg = <0x0120000 0x0080000>; + read-only; + }; + + partition@1a0000 { + label = "RPM"; + reg = <0x01a0000 0x0080000>; + read-only; + }; + + partition@220000 { + label = "APPSBL"; + reg = <0x0220000 0x0080000>; + read-only; + }; + + partition@2a0000 { + label = "APPSBLENV"; + reg = <0x02a0000 0x0010000>; + read-only; + }; + + factory: partition@2b0000 { + label = "PRODUCTDATA"; + reg = <0x02b0000 0x0030000>; + read-only; + }; + + partition@2e0000 { + label = "ART"; + reg = <0x02e0000 0x0040000>; + read-only; + }; + + partition@320000 { + label = "TP"; + reg = <0x0320000 0x0040000>; + read-only; + }; + + partition@360000 { + label = "TINY"; + reg = <0x0360000 0x0500000>; + read-only; + }; + + partition@860000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0860000 0x17a0000>; + }; + }; + }; + }; +}; + +&adm_dma { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + reg = <0x00010000 0 0 0 0>; + + qcom,ath10k-calibration-variant = "NEC-Platforms-WG2600HP3"; + }; + }; +}; + +&pcie1 { + status = "okay"; + force_gen1 = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + reg = <0x00010000 0 0 0 0>; + + ieee80211-freq-limit = <2400000 2483000>; + qcom,ath10k-calibration-variant = "NEC-Platforms-WG2600HP3"; + }; + }; +}; + +&mdio0 { + status = "okay"; + + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + phy0: ethernet-phy@0 { + reg = <0>; + qca,ar8327-initvals = < + 0x04 0x80080080 /* PAD0_MODE */ + 0x0c 0x06000000 /* PAD6_MODE */ + 0x10 0x002613a0 /* PWS_REG */ + 0x50 0xcc36cc36 /* LED_CTRL0 */ + 0x54 0xca36ca36 /* LED_CTRL1 */ + 0x58 0xc936c936 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x0000004e /* PORT0_STATUS */ + 0x94 0x0000004e /* PORT6_STATUS */ + 0xe0 0xc74164de /* SGMII_CTRL */ + 0xe4 0x0006a545 /* MAC_PWR_SEL */ + >; + }; +}; + +&gmac1 { + status = "okay"; + + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + + phy-mode = "rgmii"; + qcom,id = <1>; + mdiobus = <&mdio0>; + mtd-mac-address = <&factory 0x0>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gmac2 { + status = "okay"; + phy-mode = "sgmii"; + qcom,id = <2>; + mdiobus = <&mdio0>; + mtd-mac-address = <&factory 0x6>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index ad7c4b94d2..80bfec5ad9 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -193,6 +193,20 @@ define Device/nec_wg2600hp endef TARGET_DEVICES += nec_wg2600hp +define Device/nec_wg2600hp3 + $(call Device/LegacyImage) + DEVICE_VENDOR := NEC Platforms + DEVICE_MODEL := Aterm WG2600HP3 + SOC := qcom-ipq8062 + BLOCKSIZE := 64k + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := -kmod-ata-ahci -kmod-ata-ahci-platform -kmod-usb-ohci -kmod-usb2 \ + -kmod-usb-ledtrig-usbport -kmod-usb-phy-qcom-dwc3 -kmod-usb3 -kmod-usb-dwc3-qcom \ + ath10k-firmware-qca9984-ct ipq-wifi-nec_wg2600hp3 +endef +TARGET_DEVICES += nec_wg2600hp3 + define Device/netgear_d7800 $(call Device/DniImage) DEVICE_VENDOR := NETGEAR diff --git a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch index 6bbf184ac7..795684cdf5 100644 --- a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch @@ -10,9 +10,10 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -843,6 +843,21 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -843,6 +843,22 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-ipq4019-ap.dk07.1-c1.dtb \ qcom-ipq4019-ap.dk07.1-c2.dtb \ ++ qcom-ipq8062-wg2600hp3.dtb \ qcom-ipq8064-ap148.dtb \ + qcom-ipq8064-c2600.dtb \ + qcom-ipq8064-d7800.dtb \ From b9389186b012e5bd99ea6523b8220aaee6ca0085 Mon Sep 17 00:00:00 2001 From: Dongming Han Date: Wed, 22 Jul 2020 15:12:17 +0800 Subject: [PATCH 97/97] ipq40xx: add support for GL.iNet GL-AP1300 Specifications: SOC: Qualcomm IPQ4018 (DAKOTA) ARM Quad-Core RAM: 256 MiB FLASH1: 4 MiB NOR FLASH2: 128 MiB NAND ETH: Qualcomm QCA8075 WLAN1: Qualcomm Atheros QCA4018 2.4GHz 802.11b/g/n 2x2 WLAN2: Qualcomm Atheros QCA4018 5GHz 802.11n/ac W2 2x2 INPUT: Reset LED: Power, Internet UART1: On board pin header near to LED (3.3V, TX, RX, GND), 3.3V without pin - 115200 8N1 OTHER: On board with BLE module - by cp210x USB serial chip On board hareware watchdog with GPIO0 high to turn on, and GPIO4 for watchdog feed Install via uboot tftp or uboot web failsafe. By uboot tftp: (IPQ40xx) # tftpboot 0x84000000 openwrt-ipq40xx-generic-glinet_gl-ap1300-squashfs-nand-factory.ubi (IPQ40xx) # run lf By uboot web failsafe: Push the reset button for 10 seconds util the power led flash faster, then use broswer to access http://192.168.1.1 Afterwards upgrade can use sysupgrade image. Signed-off-by: Dongming Han --- package/boot/uboot-envtools/files/ipq40xx | 1 + package/firmware/ipq-wifi/Makefile | 2 + .../ipq-wifi/board-glinet_gl-ap1300.qca4019 | Bin 0 -> 48596 bytes .../ipq40xx/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 + .../base-files/lib/upgrade/platform.sh | 1 + .../arm/boot/dts/qcom-ipq4018-gl-ap1300.dts | 269 ++++++++++++++++++ target/linux/ipq40xx/image/Makefile | 15 + .../901-arm-boot-add-dts-files.patch | 3 +- 9 files changed, 293 insertions(+), 1 deletion(-) create mode 100644 package/firmware/ipq-wifi/board-glinet_gl-ap1300.qca4019 create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx index 34aea1b999..8a0de7a548 100644 --- a/package/boot/uboot-envtools/files/ipq40xx +++ b/package/boot/uboot-envtools/files/ipq40xx @@ -34,6 +34,7 @@ case "$board" in alfa-network,ap120c-ac |\ devolo,magic-2-wifi-next |\ edgecore,ecw5211 |\ +glinet,gl-ap1300 |\ glinet,gl-b1300 |\ luma,wrtq-329acn |\ openmesh,a42 |\ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index f42704b8d3..e5f10a1f98 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -38,6 +38,7 @@ ALLWIFIBOARDS:= \ engenius_emd1 \ engenius_emr3500 \ ezviz_cs-w3-wd1200g-eup \ + glinet_gl-ap1300 \ glinet_gl-s1300 \ linksys_ea8300 \ linksys_mr8300-v0 \ @@ -120,6 +121,7 @@ $(eval $(call generate-ipq-wifi-package,engenius_eap2200,EnGenius EAP2200)) $(eval $(call generate-ipq-wifi-package,engenius_emd1,EnGenius EMD1)) $(eval $(call generate-ipq-wifi-package,engenius_emr3500,EnGenius EMR3500)) $(eval $(call generate-ipq-wifi-package,ezviz_cs-w3-wd1200g-eup,EZVIZ CS-W3-WD1200G EUP)) +$(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300)) $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300)) $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) $(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300)) diff --git a/package/firmware/ipq-wifi/board-glinet_gl-ap1300.qca4019 b/package/firmware/ipq-wifi/board-glinet_gl-ap1300.qca4019 new file mode 100644 index 0000000000000000000000000000000000000000..481dd81b5b15bda95569e4f4acdca078bc0be727 GIT binary patch literal 48596 zcmeHQdsGuw8owZj&jSIOF-0uTVt`puL^R+7ks=wTMMT~nt!)<{fwE#z zgj94{6@e@&$G70FtF`ASr@LqW=wEjK*!^dFww|@E?b)+y_RdU(ykUYt2Xb$?Gv9o3 zzk9#?yEmDc++RM{rKLorKipnfLLJ7$M^q!^7|9AoL(!W?M%12f1d^DU1t1nAC&g0ax<6z0uvBRBEV?RaC_&zx^)Hd z!vlJQrNg~cv4YG@IW#zSw5EW_T*(+jETs(EI;-pQGbPaAH+2;S>*dkI=R1$ql@(;e zwgx(nLtU;snl_L`M40+F!BHJd6BIE$jSNijuzoZXP_o{$>7_m2zpE?xh@>{4^ugu& zZlWc!E?9N<(w>ftCUIpzQAb~4$2(2Jz24iu=qYVaIwaobU;JobLrYA(P~}tju($4H zPLp)+TRU#`)pY#oSX51LX-m)MwuFx(ssl=H4K#Kw-yc%pxBbF-)hWf%w`&%a-5jVs zv+Tg)3h$!ng%a|XMZn!-?)-(Gn76Ng;G(w{v!D2eJ@pwoUV`<|S6~+xS65efF?MyG zH49#iXX}$k_raoM;iLU)Wq4?42>c5ZEm;yGS|SqVyUhXmI~3NJnY{nqXD$#Z7gx7A z@Q=A^nXtPR*9=A0f<(iCkt8#cjm1&jajW-2xvkaJd3i*J9Q8N{o(DzO}%^)y?gHQ0EB;%wYf1m_1X=)NL#J;r$4#zT!YjKb5JL#A7Ku zJTz1!5(>p)K1$Y5!Eg*q!BempJO-=SSAXD>BQ0&GECrCLPj~DR1h_ydcr3tz@E~ar z;e~r)0eC8&DouTyie=$h(kvnwPsS9u43|k|k7ZZ_o*+#iqVZ@ZL z%qt{Xj1Lz`ym9aEy|G33BIzO`4Nv<%4a>%}rP)L*9{YVPwh~_{T}d#5V7#T9VxXV$ zEj4#5j%fOgbJ!~;!k0waa#Q8!6xB;?E>jOZ0RZl6)!jo+%=i5K&Kr5%V|Lca$f282UWlnCZf{hpE&p+41J@)wxDhWXEIc9>(R zqG^wSZg7E*t7{2dfq+ZQaMAQ6OlM(YJ9Y!6SJ4rh;D>AX&{wwh5#eE>Z!$A0cg$KH zvpPqt&D*rOsH9BYdg4@9chANC!J!*>|M1|eC-$E(TF0~R&UM<92J|{8AvnyggwkuE zMCxI76_j58BxHx#6;S&@v}rN((VaHaU}ibWWzBd^{?^i#_AkzBuZ?_ZOP*P%7<%LL z(gzF1gQdZQ4@iHRjuAK^C5Uto_c9Jk#1o~7M4ZE(uMMr*Bl*evFkFx!%fQwM;$`vJ zyMlt#)XTCC_BzMzr^_Rby?px>sttuohBB=MHU)Xk?hm$^R+1i>?uzBzP>(A z<(NXITo^kH&5AnZGA`=0*(|Vn$U~H@`iYbX0fYcT;1v;|`1X)z&+zS`z@<8(s6^fR z^!(BkE4FO7WgJfNo(IS;)BbV3=}gP*dNKOQw)1BiGc;6yilA zH#DEqE-j{9dN3@8EevWJ)haTTOdYub4a#VP%bGJ}xgtfrZ1lGFoVt$OC=a3x9*#)D z!L!ra5>1vmUL8+Mnd;^0<*`EFeJ z-p$_P;|T|ZyL=08b*-+Kl=zdDJyQ>NZfcIM#mg3E4V|fMNo$NO_sf0s`>bP;b%CW`8+%TF(7e1dq(qQa ze>zv4cu2fAu;fCA>hQb!mhSY~Guvvm784qL0YY=foS&vjTER^Ue}gn(59Ui|#?ix)3` zg6YQ}8S1@RF;3rCLmNkzGjqe)4iVp;zmara$FBZz5WUG4*MiJo`CrFW9Yng4m~?QTpH%`-N~Eh+Z)HWr{q@*Zy#o0 z)?1gjd>(KugYJ5{AcasuDA_;&O${5sn5Yp-CUDp|;2}yjJVk1R073vEfDk|kAOxHa z0ZT4C;@dmjByh40TZFg&fhPbsIe#DV?GfLeC+|e7ZlL(~R$)O(2Oxmr+f)CU8pXFa ztf|>0A-=s`aG}D}0Rb*+#>TvQTk>@1>tuXHe0v96cwey!d-?V; zav8<9w}s5ae0$U2?)-~yPerJ()jO_w6yF{$%W?&aF2}=VT;vj$5#%9CT--)w5CRAR zgn+#Wp!oLoB4#L$`1bl|&pYfh=y(F++mE5ch4#)u`r6BK`R?S+^X(1qLdQrbzCDU> zKjBQ`;j;m9X~I#11rSOIB^wCvaBA4_6sesS0TkaJ#kY6b$&Whj^a!B%_5dKhz0 +#include +#include + +/ { + model = "GL.iNet GL-AP1300"; + compatible = "glinet,gl-ap1300"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + bootargs-append = " ubi.mtd=ubi root=/dev/ubiblock0_1 clk_ignore_unused"; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + switch_lan_bmp = <0x18>; + switch_wan_bmp = <0x20>; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + wan { + label = "green:wan"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, <&tlmm 5 GPIO_ACTIVE_HIGH>; + + flash@0 { + status = "okay"; + + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + + partition@40000 { + label = "MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + + partition@60000 { + label = "QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + + partition@c0000 { + label = "CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + + partition@d0000 { + label = "DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + + partition@e0000 { + label = "APPSBLENV"; /* uboot env*/ + reg = <0x000e0000 0x00010000>; + }; + + partition@f0000 { + label = "APPSBL"; /* uboot */ + reg = <0x000f0000 0x00080000>; + read-only; + }; + + partition@170000 { + label = "ART"; + reg = <0x00170000 0x00010000>; + read-only; + }; + }; + }; + + spi-nand@1 { + status = "okay"; + + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x00000000 0x08000000>; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi0_pins: spi0_pinmux { + mux_spi { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + mux_cs { + function = "gpio"; + pins = "gpio54", "gpio5"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "GL-AP1300"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "GL-AP1300"; +}; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 487f3b5638..c19dcb4039 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -482,6 +482,21 @@ define Device/ezviz_cs-w3-wd1200g-eup endef TARGET_DEVICES += ezviz_cs-w3-wd1200g-eup +define Device/glinet_gl-ap1300 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-AP1300 + SOC := qcom-ipq4018 + DEVICE_DTS_CONFIG := config@ap.dk01.1-c2 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 131072k + KERNEL_INSTALL := 1 + DEVICE_PACKAGES := ipq-wifi-glinet_gl-ap1300 +endef +TARGET_DEVICES += glinet_gl-ap1300 + define Device/glinet_gl-b1300 $(call Device/FitImage) DEVICE_VENDOR := GL.iNet diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index d470bb7204..a3d3341587 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,57 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,58 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -28,6 +28,7 @@ Signed-off-by: John Crispin + qcom-ipq4018-ex6100v2.dtb \ + qcom-ipq4018-ex6150v2.dtb \ + qcom-ipq4018-fritzbox-4040.dtb \ ++ qcom-ipq4018-gl-ap1300.dtb \ + qcom-ipq4018-jalapeno.dtb \ + qcom-ipq4018-meshpoint-one.dtb \ + qcom-ipq4018-nbg6617.dtb \