diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 159cfbc53f..eb77caee33 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=4.4.0-stable -PKG_RELEASE:=2 +PKG_VERSION:=4.5.0-stable +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) -PKG_HASH:=7f854804c8ae0ca49cc77809e38e9a3b5a8c91ba7855ea928e6d6651b0d35f18 +PKG_HASH:=7de62300ce14daa0051bfefc7c4d6302f96cabc768b6ae49eda77523b118250c PKG_FIXUP:=libtool PKG_INSTALL:=1 diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch index 5d83eca770..43337ba970 100644 --- a/package/libs/wolfssl/patches/100-disable-hardening-check.patch +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -1,6 +1,6 @@ --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h -@@ -1930,7 +1930,7 @@ extern void uITRON4_free(void *p) ; +@@ -2128,7 +2128,7 @@ extern void uITRON4_free(void *p) ; #endif /* warning for not using harden build options (default with ./configure) */ diff --git a/package/libs/wolfssl/patches/110-fix-build-on-big-endian.patch b/package/libs/wolfssl/patches/110-fix-build-on-big-endian.patch new file mode 100644 index 0000000000..3838865559 --- /dev/null +++ b/package/libs/wolfssl/patches/110-fix-build-on-big-endian.patch @@ -0,0 +1,27 @@ +From b90acc91d0cd276befe7f08f87ba2dc5ee7122ff Mon Sep 17 00:00:00 2001 +From: Tesfa Mael +Date: Wed, 26 Aug 2020 10:13:06 -0700 +Subject: [PATCH] Make ByteReverseWords available for big and little endian + +--- + wolfcrypt/src/misc.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/wolfcrypt/src/misc.c ++++ b/wolfcrypt/src/misc.c +@@ -120,7 +120,6 @@ WC_STATIC WC_INLINE word32 ByteReverseWo + return rotlFixed(value, 16U); + #endif + } +-#if defined(LITTLE_ENDIAN_ORDER) + /* This routine performs a byte swap of words array of a given count. */ + WC_STATIC WC_INLINE void ByteReverseWords(word32* out, const word32* in, + word32 byteCount) +@@ -131,7 +130,6 @@ WC_STATIC WC_INLINE void ByteReverseWord + out[i] = ByteReverseWord32(in[i]); + + } +-#endif /* LITTLE_ENDIAN_ORDER */ + + #if defined(WORD64_AVAILABLE) && !defined(WOLFSSL_NO_WORD64_OPS) + diff --git a/package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch b/package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch new file mode 100644 index 0000000000..a7b5409602 --- /dev/null +++ b/package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch @@ -0,0 +1,10 @@ +--- a/src/crypto/tls_wolfssl.c ++++ b/src/crypto/tls_wolfssl.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #if defined(EAP_FAST) || defined(EAP_FAST_DYNAMIC) || defined(EAP_SERVER_FAST) + #define HAVE_AESGCM diff --git a/package/network/utils/curl/Config.in b/package/network/utils/curl/Config.in deleted file mode 100644 index cebf16b6cb..0000000000 --- a/package/network/utils/curl/Config.in +++ /dev/null @@ -1,160 +0,0 @@ -if PACKAGE_libcurl - -comment "SSL support" - -choice - prompt "Selected SSL library" - default LIBCURL_OPENSSL - - config LIBCURL_MBEDTLS - bool "mbed TLS" - - config LIBCURL_WOLFSSL - bool "wolfSSL" - - config LIBCURL_OPENSSL - bool "OpenSSL" - - config LIBCURL_GNUTLS - bool "GNUTLS" - - config LIBCURL_NOSSL - bool "No SSL support" - -endchoice - -comment "Supported protocols" - -config LIBCURL_DICT - bool "DICT protocol" - default n - -config LIBCURL_FILE - bool "FILE protocol" - default y - -config LIBCURL_FTP - bool "FTP / FTPS protocol" - default y - -config LIBCURL_GOPHER - bool "Gopher protocol" - default n - -config LIBCURL_HTTP - bool "HTTP / HTTPS protocol" - default y - -config LIBCURL_COOKIES - bool "Enable Cookies support" - depends on LIBCURL_HTTP - default y - -config LIBCURL_IMAP - bool "IMAP / IMAPS protocol" - default n - -config LIBCURL_LDAP - bool "LDAP protocol" - default y - -config LIBCURL_LDAPS - bool "Enable LDAPS support" - depends on LIBCURL_LDAP && !LIBCURL_NOSSL - default y - -config LIBCURL_POP3 - bool "POP3 / POP3S protocol" - default n - -config LIBCURL_RTSP - bool "RTSP protocol" - depends on LIBCURL_HTTP - default n -config LIBCURL_NO_RTSP - string "RTSP require HTTP protocol" - depends on !LIBCURL_HTTP - default "!" - -config LIBCURL_SSH2 - bool "SCP / SFTP protocol" - default n - -config LIBCURL_SMB - bool "SMB protocol (CIFS)" - depends on LIBCURL_CRYPTO_AUTH && (LIBCURL_GNUTLS || LIBCURL_OPENSSL) - default n -config LIBCURL_NO_SMB - string "SMB require 'cryptographic authentication' and either 'GnuTLS' or 'OpenSSL'" - depends on !LIBCURL_CRYPTO_AUTH || (!LIBCURL_GNUTLS && !LIBCURL_OPENSSL) - default "!" - -config LIBCURL_SMTP - bool "SMTP / SMTPS protocol" - default n - -config LIBCURL_TELNET - bool "TELNET protocol" - default n - -config LIBCURL_TFTP - bool "TFTP protocol" - default y - -config LIBCURL_NGHTTP2 - bool "HTTP2 protocol" - default y - -comment "Miscellaneous" - -config LIBCURL_PROXY - bool "Enable proxy support" - default y - -config LIBCURL_CRYPTO_AUTH - bool "Enable cryptographic authentication" - default y - -config LIBCURL_TLS_SRP - bool "Enable TLS-SRP authentication" - default y - -config LIBCURL_LIBIDN2 - bool "Enable IDN2 support" - default n - -config LIBCURL_THREADED_RESOLVER - bool "Enable threaded DNS resolver" - default y - help - Enable POSIX threaded asynchronous DNS resolution - -config LIBCURL_ZLIB - bool "Enable zlib support" - default n - -config LIBCURL_UNIX_SOCKETS - bool "Enable unix domain socket support" - default n - help - Enable HTTP over unix domain sockets. - To use this with the curl command line, you specify the socket path to the new --unix-domain option. - This feature is actually not limited to HTTP, you can do all the TCP-based protocols - except FTP over the unix domain socket, but it is only HTTP that is regularly used this way. - The reason FTP isn't supported is of course its use of two connections - which would be even weirder to do like this. - -config LIBCURL_LIBCURL_OPTION - bool "Enable generation of C code" - default n - -config LIBCURL_VERBOSE - bool "Enable verbose error strings" - default n - -config LIBCURL_NTLM - bool "Enable NTLM support" - depends on LIBCURL_CRYPTO_AUTH && !LIBCURL_NOSSL - default n - -endif diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile deleted file mode 100644 index c70bfdff20..0000000000 --- a/package/network/utils/curl/Makefile +++ /dev/null @@ -1,189 +0,0 @@ -# -# Copyright (C) 2007-2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=curl -PKG_VERSION:=7.72.0 -PKG_RELEASE:=2 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \ - https://curl.mirror.anstey.ca/ \ - https://curl.askapache.com/download/ \ - https://curl.haxx.se/download/ -PKG_HASH:=0ded0808c4d85f2ee0db86980ae610cc9d165e9ca9da466196cc73c346513713 - -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=COPYING -PKG_CPE_ID:=cpe:/a:haxx:libcurl - -PKG_FIXUP:=autoreconf -PKG_BUILD_PARALLEL:=1 - -PKG_CONFIG_DEPENDS:= \ - CONFIG_IPV6 \ - \ - CONFIG_LIBCURL_WOLFSSL \ - CONFIG_LIBCURL_GNUTLS \ - CONFIG_LIBCURL_OPENSSL \ - CONFIG_LIBCURL_MBEDTLS \ - CONFIG_LIBCURL_NOSSL \ - \ - CONFIG_LIBCURL_LIBIDN2 \ - CONFIG_LIBCURL_SSH2 \ - CONFIG_LIBCURL_ZLIB \ - \ - CONFIG_LIBCURL_DICT \ - CONFIG_LIBCURL_FILE \ - CONFIG_LIBCURL_FTP \ - CONFIG_LIBCURL_GOPHER \ - CONFIG_LIBCURL_HTTP \ - CONFIG_LIBCURL_IMAP \ - CONFIG_LIBCURL_LDAP \ - CONFIG_LIBCURL_LDAPS \ - CONFIG_LIBCURL_POP3 \ - CONFIG_LIBCURL_RTSP \ - CONFIG_LIBCURL_NO_RTSP \ - CONFIG_LIBCURL_SMB \ - CONFIG_LIBCURL_NO_SMB \ - CONFIG_LIBCURL_SMTP \ - CONFIG_LIBCURL_TELNET \ - CONFIG_LIBCURL_TFTP \ - CONFIG_LIBCURL_NGHTTP2 \ - \ - CONFIG_LIBCURL_COOKIES \ - CONFIG_LIBCURL_CRYPTO_AUTH \ - CONFIG_LIBCURL_LIBCURL_OPTION \ - CONFIG_LIBCURL_PROXY \ - CONFIG_LIBCURL_THREADED_RESOLVER \ - CONFIG_LIBCURL_TLS_SRP \ - CONFIG_LIBCURL_UNIX_SOCKETS \ - CONFIG_LIBCURL_VERBOSE \ - CONFIG_LIBCURL_NTLM \ - $(if $(CONFIG_LIBCURL_OPENSSL), \ - CONFIG_OPENSSL_ENGINE \ - CONFIG_OPENSSL_WITH_COMPRESSION \ - CONFIG_OPENSSL_WITH_NPN) - -include $(INCLUDE_DIR)/package.mk - -define Package/curl/Default - SECTION:=net - CATEGORY:=Network - URL:=http://curl.haxx.se/ - MAINTAINER:=Imre Kaloz -endef - -define Package/curl - $(call Package/curl/Default) - SUBMENU:=File Transfer - DEPENDS:=+libcurl - TITLE:=A client-side URL transfer utility -endef - -define Package/libcurl - $(call Package/curl/Default) - SECTION:=libs - CATEGORY:=Libraries - DEPENDS:= +LIBCURL_WOLFSSL:libwolfssl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls - DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN2:libidn2 - DEPENDS += +LIBCURL_SSH2:libssh2 +LIBCURL_NGHTTP2:libnghttp2 +ca-bundle - TITLE:=A client-side URL transfer library - MENU:=1 - ABI_VERSION:=4 -endef - -define Package/libcurl/config - source "$(SOURCE)/Config.in" -endef - -TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -TARGET_CPPFLAGS += $(if $(CONFIG_LIBCURL_NTLM),,-DCURL_DISABLE_NTLM) -TARGET_LDFLAGS += -Wl,--gc-sections - -CONFIGURE_ARGS += \ - --disable-debug \ - --disable-ares \ - --enable-shared \ - --enable-static \ - --disable-manual \ - --without-nss \ - --without-libmetalink \ - --without-librtmp \ - --without-libidn \ - --without-ca-path \ - --without-libpsl \ - --without-zstd \ - --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \ - \ - $(call autoconf_bool,CONFIG_IPV6,ipv6) \ - \ - $(if $(CONFIG_LIBCURL_WOLFSSL),--with-wolfssl="$(STAGING_DIR)/usr",--without-wolfssl) \ - $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \ - $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \ - $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr",--without-mbedtls) \ - \ - $(if $(CONFIG_LIBCURL_LIBIDN2),--with-libidn2="$(STAGING_DIR)/usr",--without-libidn2) \ - $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \ - $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \ - $(if $(CONFIG_LIBCURL_NGHTTP2),--with-nghttp2="$(STAGING_DIR)/usr",--without-nghttp2) \ - \ - $(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \ - $(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \ - $(call autoconf_bool,CONFIG_LIBCURL_FTP,ftp) \ - $(call autoconf_bool,CONFIG_LIBCURL_GOPHER,gopher) \ - $(call autoconf_bool,CONFIG_LIBCURL_HTTP,http) \ - $(call autoconf_bool,CONFIG_LIBCURL_IMAP,imap) \ - $(call autoconf_bool,CONFIG_LIBCURL_LDAP,ldap) \ - $(call autoconf_bool,CONFIG_LIBCURL_LDAPS,ldaps) \ - $(call autoconf_bool,CONFIG_LIBCURL_POP3,pop3) \ - $(call autoconf_bool,CONFIG_LIBCURL_RTSP,rtsp) \ - $(call autoconf_bool,CONFIG_LIBCURL_SMB,smb) \ - $(call autoconf_bool,CONFIG_LIBCURL_SMTP,smtp) \ - $(call autoconf_bool,CONFIG_LIBCURL_TELNET,telnet) \ - $(call autoconf_bool,CONFIG_LIBCURL_TFTP,tftp) \ - \ - $(call autoconf_bool,CONFIG_LIBCURL_COOKIES,cookies) \ - $(call autoconf_bool,CONFIG_LIBCURL_CRYPTO_AUTH,crypto-auth) \ - $(call autoconf_bool,CONFIG_LIBCURL_LIBCURL_OPTION,libcurl-option) \ - $(call autoconf_bool,CONFIG_LIBCURL_PROXY,proxy) \ - $(call autoconf_bool,CONFIG_LIBCURL_THREADED_RESOLVER,threaded-resolver) \ - $(call autoconf_bool,CONFIG_LIBCURL_TLS_SRP,tls-srp) \ - $(call autoconf_bool,CONFIG_LIBCURL_UNIX_SOCKETS,unix-sockets) \ - $(call autoconf_bool,CONFIG_LIBCURL_VERBOSE,verbose) \ - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - CC="$(TARGET_CC)" \ - install -endef - -define Build/InstallDev - $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl-config $(1)/usr/bin/ - $(CP) $(PKG_INSTALL_DIR)/usr/include/curl $(1)/usr/include/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.{a,so*} $(1)/usr/lib/ - $(CP) $(PKG_BUILD_DIR)/libcurl.pc $(1)/usr/lib/pkgconfig/ - $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(1)/usr/bin/curl-config - [ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/libcurl.pc || true - $(LN) $(STAGING_DIR)/usr/bin/curl-config $(2)/bin/ -endef - -define Package/curl/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/curl $(1)/usr/bin/ -endef - -define Package/libcurl/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurl.so.* $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,curl)) -$(eval $(call BuildPackage,libcurl)) diff --git a/package/network/utils/curl/patches/200-no_docs_tests.patch b/package/network/utils/curl/patches/200-no_docs_tests.patch deleted file mode 100644 index b5f92b58c8..0000000000 --- a/package/network/utils/curl/patches/200-no_docs_tests.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/Makefile.am -+++ b/Makefile.am -@@ -192,7 +192,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) - bin_SCRIPTS = curl-config - - SUBDIRS = lib src --DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs -+DIST_SUBDIRS = $(SUBDIRS) packages include - - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = libcurl.pc -@@ -303,8 +303,8 @@ cygwinbin: - # We extend the standard install with a custom hook: - install-data-hook: - (cd include && $(MAKE) install) -- (cd docs && $(MAKE) install) -- (cd docs/libcurl && $(MAKE) install) -+ #(cd docs && $(MAKE) install) -+ #(cd docs/libcurl && $(MAKE) install) - - # We extend the standard uninstall with a custom hook: - uninstall-hook: diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile index 8acd46747e..6e5e72783f 100644 --- a/package/utils/mtd-utils/Makefile +++ b/package/utils/mtd-utils/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=2.1.1 +PKG_VERSION:=2.1.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/mtd-utils/ -PKG_HASH:=8d15e8b70f036d6af1a66011f8ca0e048e9675fa7983d33bea92c24313a232d2 +PKG_HASH:=8ad4c5f34716d40646aa28724a2f5616d325a6f119254f914e26976f1f76e9d6 PKG_INSTALL:=1 PKG_FIXUP:=autoreconf diff --git a/package/utils/mtd-utils/patches/130-lzma_jffs2.patch b/package/utils/mtd-utils/patches/130-lzma_jffs2.patch index d9cbfeebec..9778aa6d0a 100644 --- a/package/utils/mtd-utils/patches/130-lzma_jffs2.patch +++ b/package/utils/mtd-utils/patches/130-lzma_jffs2.patch @@ -5015,7 +5015,7 @@ +} --- a/jffsX-utils/mkfs.jffs2.c +++ b/jffsX-utils/mkfs.jffs2.c -@@ -1666,11 +1666,11 @@ int main(int argc, char **argv) +@@ -1667,11 +1667,11 @@ int main(int argc, char **argv) } erase_block_size *= units; diff --git a/target/linux/at91/sam9x/config-default b/target/linux/at91/sam9x/config-default index 43e2a02dd9..a05831fe17 100644 --- a/target/linux/at91/sam9x/config-default +++ b/target/linux/at91/sam9x/config-default @@ -181,6 +181,7 @@ CONFIG_TIMER_PROBE=y CONFIG_TINY_SRCU=y CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNWINDER_ARM=y +CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y # CONFIG_VFP is not set CONFIG_ZBOOT_ROM_BSS=0x0 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 ea392f9e41..e0c0cb55a0 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,12 +209,6 @@ gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; }; }; - - /* FIXME: this driver needs to be aware of the LED2 eth phy use, - which must be set to off state before shutting down the machine */ - restart_poweroff { - compatible = "restart-poweroff"; - }; }; ð1 { @@ -243,13 +237,6 @@ ethphy0: ethernet-phy@0 { /* Marvell 88E1518 */ reg = <0>; - /* - * LED2 is used to inform, at restart time, if the power - * switch was slided to the "off" position. - * Page 0x3, Register 0x10, bits 8-11: - * 0x800: LED2 off, power off the machine - * 0x900: LED2 on, boot the machine - */ marvell,reg-init = <0x3 0x10 0x1 0x1991>, /* LED function */ <0x3 0x11 0x1 0x4401>, /* LED polarity */ <0x3 0x12 0x1 0x4905>; /* LED timer */ diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 7c2069ed2f..824f142a8b 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -24,8 +24,8 @@ define Device/buffalo_ls421de DEVICE_DTS := armada-370-buffalo-ls421de DEVICE_PACKAGES := \ kmod-rtc-rs5c372a kmod-hwmon-gpiofan kmod-hwmon-drivetemp kmod-usb3 \ - kmod-md-raid0 kmod-md-raid1 kmod-md-mod kmod-fs-xfs mkf2fs e2fsprogs \ - partx-utils + kmod-linkstation-poweroff kmod-md-raid0 kmod-md-raid1 kmod-md-mod \ + kmod-fs-xfs mkf2fs e2fsprogs partx-utils endef TARGET_DEVICES += buffalo_ls421de diff --git a/target/linux/mvebu/modules.mk b/target/linux/mvebu/modules.mk new file mode 100644 index 0000000000..3a5e316788 --- /dev/null +++ b/target/linux/mvebu/modules.mk @@ -0,0 +1,21 @@ +define KernelPackage/linkstation-poweroff + SUBMENU:=$(OTHER_MENU) + DEPENDS:=@TARGET_mvebu + TITLE:=Buffalo LinkStation power off driver + KCONFIG:= \ + CONFIG_POWER_RESET=y \ + CONFIG_POWER_RESET_LINKSTATION \ + CONFIG_POWER_RESET_QNAP=n + + FILES:=$(LINUX_DIR)/drivers/power/reset/linkstation-poweroff.ko + AUTOLOAD:=$(call AutoLoad,31,linkstation-poweroff,1) +endef + +define KernelPackage/linkstation-poweroff/description + This driver supports turning off some Buffalo LinkStations by + setting an output pin at the ethernet PHY to the correct state. + It also makes the device compatible with the WoL function. + Say Y here if you have a Buffalo LinkStation LS421D/E. +endef + +$(eval $(call KernelPackage,linkstation-poweroff)) diff --git a/target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch b/target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch new file mode 100644 index 0000000000..e4dee5c09e --- /dev/null +++ b/target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch @@ -0,0 +1,177 @@ +--- a/drivers/power/reset/Kconfig ++++ b/drivers/power/reset/Kconfig +@@ -99,6 +99,17 @@ + help + Reboot support for Hisilicon boards. + ++config POWER_RESET_LINKSTATION ++ tristate "Buffalo LinkStation power-off driver" ++ depends on ARCH_MVEBU || COMPILE_TEST ++ depends on OF_MDIO && PHYLIB ++ help ++ This driver supports turning off some Buffalo LinkStations by ++ setting an output pin at the ethernet PHY to the correct state. ++ It also makes the device compatible with the WoL function. ++ ++ Say Y here if you have a Buffalo LinkStation LS421D/E. ++ + config POWER_RESET_MSM + bool "Qualcomm MSM power-off driver" + depends on ARCH_QCOM +--- a/drivers/power/reset/Makefile ++++ b/drivers/power/reset/Makefile +@@ -10,6 +10,7 @@ + obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o + obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o + obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o ++obj-${CONFIG_POWER_RESET_LINKSTATION} += linkstation-poweroff.o + obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o + obj-$(CONFIG_POWER_RESET_QCOM_PON) += qcom-pon.o + obj-$(CONFIG_POWER_RESET_OCELOT_RESET) += ocelot-reset.o +--- a/dev/null ++++ b/drivers/power/reset/linkstation-poweroff.c +@@ -0,0 +1,144 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * LinkStation power off restart driver ++ * Copyright (C) 2020 Daniel González Cabanelas ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Defines from the eth phy Marvell driver */ ++#define MII_MARVELL_COPPER_PAGE 0 ++#define MII_MARVELL_LED_PAGE 3 ++#define MII_MARVELL_WOL_PAGE 17 ++#define MII_MARVELL_PHY_PAGE 22 ++ ++#define MII_PHY_LED_CTRL 16 ++#define MII_88E1318S_PHY_LED_TCR 18 ++#define MII_88E1318S_PHY_WOL_CTRL 16 ++#define MII_M1011_IEVENT 19 ++ ++#define MII_88E1318S_PHY_LED_TCR_INTn_ENABLE BIT(7) ++#define MII_88E1318S_PHY_LED_TCR_FORCE_INT BIT(15) ++#define MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS BIT(12) ++#define LED2_FORCE_ON (0x8 << 8) ++#define LEDMASK GENMASK(11,8) ++ ++static struct phy_device *phydev; ++ ++static void mvphy_reg_intn(u16 data) ++{ ++ int rc = 0, saved_page; ++ ++ saved_page = phy_select_page(phydev, MII_MARVELL_LED_PAGE); ++ if (saved_page < 0) ++ goto err; ++ ++ /* Force manual LED2 control to let INTn work */ ++ __phy_modify(phydev, MII_PHY_LED_CTRL, LEDMASK, LED2_FORCE_ON); ++ ++ /* Set the LED[2]/INTn pin to the required state */ ++ __phy_modify(phydev, MII_88E1318S_PHY_LED_TCR, ++ MII_88E1318S_PHY_LED_TCR_FORCE_INT, ++ MII_88E1318S_PHY_LED_TCR_INTn_ENABLE | data); ++ ++ if (!data) { ++ /* Clear interrupts to ensure INTn won't be holded in high state */ ++ __phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_MARVELL_COPPER_PAGE); ++ __phy_read(phydev, MII_M1011_IEVENT); ++ ++ /* If WOL was enabled and a magic packet was received before powering ++ * off, we won't be able to wake up by sending another magic packet. ++ * Clear WOL status. ++ */ ++ __phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_MARVELL_WOL_PAGE); ++ __phy_set_bits(phydev, MII_88E1318S_PHY_WOL_CTRL, ++ MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS); ++ } ++err: ++ rc = phy_restore_page(phydev, saved_page, rc); ++ if (rc < 0) ++ dev_err(&phydev->mdio.dev, "Write register failed, %d\n", rc); ++ ++ if (!data) { ++ /* Slow down the PHY to save energy */ ++ rc= phy_speed_down(phydev, false); ++ if (rc < 0) ++ dev_err(&phydev->mdio.dev, "PHY speed down failed, %d\n", rc); ++ } ++} ++ ++static int linkstation_reboot_notifier(struct notifier_block *nb, ++ unsigned long action, void *unused) ++{ ++ if (action == SYS_RESTART) ++ mvphy_reg_intn(MII_88E1318S_PHY_LED_TCR_FORCE_INT); ++ ++ return NOTIFY_DONE; ++} ++ ++static struct notifier_block linkstation_reboot_nb = { ++ .notifier_call = linkstation_reboot_notifier, ++}; ++ ++static void linkstation_poweroff(void) ++{ ++ unregister_reboot_notifier(&linkstation_reboot_nb); ++ mvphy_reg_intn(0); ++ ++ kernel_restart("Power off"); ++} ++ ++static const struct of_device_id ls_poweroff_of_match[] = { ++ { .compatible = "buffalo,ls421d" }, ++ { .compatible = "buffalo,ls421de" }, ++ { }, ++}; ++ ++static int __init linkstation_poweroff_init(void) ++{ ++ struct mii_bus *bus; ++ struct device_node *dn; ++ ++ dn = of_find_matching_node(NULL, ls_poweroff_of_match); ++ if (!dn) ++ return -ENODEV; ++ of_node_put(dn); ++ ++ dn = of_find_node_by_name(NULL, "mdio"); ++ if (!dn) ++ return -ENODEV; ++ ++ bus = of_mdio_find_bus(dn); ++ of_node_put(dn); ++ if (!bus) ++ return -EPROBE_DEFER; ++ ++ phydev = phy_find_first(bus); ++ if (!phydev) ++ return -EPROBE_DEFER; ++ ++ register_reboot_notifier(&linkstation_reboot_nb); ++ pm_power_off = linkstation_poweroff; ++ ++ pr_info("LinkStation power off driver registered\n"); ++ return 0; ++} ++ ++static void __exit linkstation_poweroff_exit(void) ++{ ++ pm_power_off = NULL; ++ unregister_reboot_notifier(&linkstation_reboot_nb); ++} ++ ++module_init(linkstation_poweroff_init); ++module_exit(linkstation_poweroff_exit); ++ ++MODULE_AUTHOR("Daniel González Cabanelas "); ++MODULE_DESCRIPTION("LinkStation power off driver"); ++MODULE_LICENSE("GPL v2"); diff --git a/target/linux/pistachio/Makefile b/target/linux/pistachio/Makefile index 0bf04dcc56..672cd3f629 100644 --- a/target/linux/pistachio/Makefile +++ b/target/linux/pistachio/Makefile @@ -13,8 +13,7 @@ FEATURES:=fpu usb usbgadget squashfs targz nand CPU_TYPE:=24kc CPU_SUBTYPE:=24kf -KERNEL_PATCHVER:=4.14 -KERNEL_TESTING_PATCHVER:=5.4 +KERNEL_PATCHVER:=5.4 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/ramips/dts/mt7621_wavlink_wl-wn531a6.dts b/target/linux/ramips/dts/mt7621_wavlink_wl-wn531a6.dts new file mode 100644 index 0000000000..0f017fd829 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_wavlink_wl-wn531a6.dts @@ -0,0 +1,184 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "wavlink,wl-wn531a6", "mediatek,mt7621-soc"; + model = "Wavlink WL-WN531A6"; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset Button"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + touch { /* RH6015C touch sensor -> GPIO 14 */ + label = "Touch Button"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + turbo { + label = "Turbo Button"; + gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "WPS Button"; + gpios = <&gpio 24 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: status_blue { + label = "wl-wn531a6:blue:power"; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: status_red { + label = "wl-wn531a6:red:power"; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + }; + + wifi2g { + label = "wl-wn531a6:blue:wifi2g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&i2c { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xeb0000>; + }; + + partition@f00000 { + label = "vendor"; + reg = <0xf00000 0x100000>; + read-only; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&gmac0 { + mtd-mac-address = <&factory 0xe000>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + + port@4 { + status = "okay"; + label = "wan"; + mtd-mac-address = <&factory 0xe006>; + }; + }; +}; + +&state_default { + gpio { + groups = "rgmii2", "jtag", "wdt"; + function = "gpio"; + }; +}; + +&uartlite2 { + status = "okay"; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts new file mode 100644 index 0000000000..192b0aaaf0 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "mt7628an_tplink_8m.dtsi" + +/ { + compatible = "tplink,tl-wr850n-v2", "mediatek,mt7628an-soc"; + model = "TP-Link TL-WR850N v2"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "tl-wr850n-v2:green:power"; + gpios = <&gpio 36 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "tl-wr850n-v2:green:wps"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "tl-wr850n-v2:green:lan"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "tl-wr850n-v2:green:wan"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "tl-wr850n-v2:green:wlan"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&state_default { + gpio { + groups = "p0led_an", "p2led_an", "perst", "refclk", "wdt", "wled_an"; + function = "gpio"; + }; +}; + +&esw { + mediatek,portmap = <0x3e>; +}; diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h index 03d030446a..f10946a173 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h @@ -17,11 +17,7 @@ #define GSW_REG_PHY_TIMEOUT (5 * HZ) -#ifdef CONFIG_SOC_MT7621 -#define MT7620A_GSW_REG_PIAC 0x0004 -#else #define MT7620A_GSW_REG_PIAC 0x7004 -#endif #define GSW_NUM_VLANS 16 #define GSW_NUM_VIDS 4096 @@ -65,11 +61,7 @@ #define PORT_IRQ_ST_CHG 0x7f -#ifdef CONFIG_SOC_MT7621 -#define ESW_PHY_POLLING 0x0000 -#else #define ESW_PHY_POLLING 0x7000 -#endif #define PMCR_IPG BIT(18) #define PMCR_MAC_MODE BIT(16) diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c index 367b8d9ac4..be1b8a6d8e 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c @@ -37,11 +37,7 @@ #define MT7530_CPU_PORT 6 #define MT7530_NUM_PORTS 8 -#ifdef CONFIG_SOC_MT7621 -#define MT7530_NUM_VLANS 4095 -#else #define MT7530_NUM_VLANS 16 -#endif #define MT7530_MAX_VID 4095 #define MT7530_MIN_VID 0 #define MT7530_NUM_ARL_RECORDS 2048 @@ -50,9 +46,6 @@ #define MT7530_PORT_MIB_TXB_ID 2 /* TxGOC */ #define MT7530_PORT_MIB_RXB_ID 6 /* RxGOC */ -#define MT7621_PORT_MIB_TXB_ID 18 /* TxByte */ -#define MT7621_PORT_MIB_RXB_ID 37 /* RxByte */ - /* registers */ #define REG_ESW_WT_MAC_MFC 0x10 @@ -159,50 +152,6 @@ static const struct mt7xxx_mib_desc mt7620_port_mibs[] = { MIB_DESC(1, MT7620_MIB_STATS_PORT_REPC2N, "RxEPC2") }; -static const struct mt7xxx_mib_desc mt7621_mibs[] = { - MIB_DESC(1, MT7621_STATS_TDPC, "TxDrop"), - MIB_DESC(1, MT7621_STATS_TCRC, "TxCRC"), - MIB_DESC(1, MT7621_STATS_TUPC, "TxUni"), - MIB_DESC(1, MT7621_STATS_TMPC, "TxMulti"), - MIB_DESC(1, MT7621_STATS_TBPC, "TxBroad"), - MIB_DESC(1, MT7621_STATS_TCEC, "TxCollision"), - MIB_DESC(1, MT7621_STATS_TSCEC, "TxSingleCol"), - MIB_DESC(1, MT7621_STATS_TMCEC, "TxMultiCol"), - MIB_DESC(1, MT7621_STATS_TDEC, "TxDefer"), - MIB_DESC(1, MT7621_STATS_TLCEC, "TxLateCol"), - MIB_DESC(1, MT7621_STATS_TXCEC, "TxExcCol"), - MIB_DESC(1, MT7621_STATS_TPPC, "TxPause"), - MIB_DESC(1, MT7621_STATS_TL64PC, "Tx64Byte"), - MIB_DESC(1, MT7621_STATS_TL65PC, "Tx65Byte"), - MIB_DESC(1, MT7621_STATS_TL128PC, "Tx128Byte"), - MIB_DESC(1, MT7621_STATS_TL256PC, "Tx256Byte"), - MIB_DESC(1, MT7621_STATS_TL512PC, "Tx512Byte"), - MIB_DESC(1, MT7621_STATS_TL1024PC, "Tx1024Byte"), - MIB_DESC(2, MT7621_STATS_TOC, "TxByte"), - MIB_DESC(1, MT7621_STATS_RDPC, "RxDrop"), - MIB_DESC(1, MT7621_STATS_RFPC, "RxFiltered"), - MIB_DESC(1, MT7621_STATS_RUPC, "RxUni"), - MIB_DESC(1, MT7621_STATS_RMPC, "RxMulti"), - MIB_DESC(1, MT7621_STATS_RBPC, "RxBroad"), - MIB_DESC(1, MT7621_STATS_RAEPC, "RxAlignErr"), - MIB_DESC(1, MT7621_STATS_RCEPC, "RxCRC"), - MIB_DESC(1, MT7621_STATS_RUSPC, "RxUnderSize"), - MIB_DESC(1, MT7621_STATS_RFEPC, "RxFragment"), - MIB_DESC(1, MT7621_STATS_ROSPC, "RxOverSize"), - MIB_DESC(1, MT7621_STATS_RJEPC, "RxJabber"), - MIB_DESC(1, MT7621_STATS_RPPC, "RxPause"), - MIB_DESC(1, MT7621_STATS_RL64PC, "Rx64Byte"), - MIB_DESC(1, MT7621_STATS_RL65PC, "Rx65Byte"), - MIB_DESC(1, MT7621_STATS_RL128PC, "Rx128Byte"), - MIB_DESC(1, MT7621_STATS_RL256PC, "Rx256Byte"), - MIB_DESC(1, MT7621_STATS_RL512PC, "Rx512Byte"), - MIB_DESC(1, MT7621_STATS_RL1024PC, "Rx1024Byte"), - MIB_DESC(2, MT7621_STATS_ROC, "RxByte"), - MIB_DESC(1, MT7621_STATS_RDPC_CTRL, "RxCtrlDrop"), - MIB_DESC(1, MT7621_STATS_RDPC_ING, "RxIngDrop"), - MIB_DESC(1, MT7621_STATS_RDPC_ARL, "RxARLDrop") -}; - enum { /* Global attributes. */ MT7530_ATTR_ENABLE_VLAN, @@ -510,14 +459,6 @@ mt7530_set_vid(struct switch_dev *dev, const struct switch_attr *attr, return 0; } -static int -mt7621_get_vid(struct switch_dev *dev, const struct switch_attr *attr, - struct switch_val *val) -{ - val->value.i = val->port_vlan; - return 0; -} - static int mt7530_get_vid(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) @@ -610,7 +551,6 @@ mt7530_write_vlan_entry(struct mt7530_priv *priv, int vlan, u16 vid, int port; u32 val; -#ifndef CONFIG_SOC_MT7621 /* vid of vlan */ val = mt7530_r32(priv, REG_ESW_VLAN_VTIM(vlan)); if (vlan % 2 == 0) { @@ -621,7 +561,6 @@ mt7530_write_vlan_entry(struct mt7530_priv *priv, int vlan, u16 vid, val |= (vid << 12); } mt7530_w32(priv, REG_ESW_VLAN_VTIM(vlan), val); -#endif /* vlan port membership */ if (ports) @@ -642,11 +581,7 @@ mt7530_write_vlan_entry(struct mt7530_priv *priv, int vlan, u16 vid, mt7530_w32(priv, REG_ESW_VLAN_VAWD2, val); /* write to vlan table */ -#ifdef CONFIG_SOC_MT7621 - mt7530_vtcr(priv, 1, vid); -#else mt7530_vtcr(priv, 1, vlan); -#endif } static int @@ -799,53 +734,6 @@ mt7530_get_port_link(struct switch_dev *dev, int port, return 0; } -static u64 get_mib_counter(struct mt7530_priv *priv, int i, int port) -{ - unsigned int port_base; - u64 lo; - - port_base = MT7621_MIB_COUNTER_BASE + - MT7621_MIB_COUNTER_PORT_OFFSET * port; - - lo = mt7530_r32(priv, port_base + mt7621_mibs[i].offset); - if (mt7621_mibs[i].size == 2) { - u64 hi; - - hi = mt7530_r32(priv, port_base + mt7621_mibs[i].offset + 4); - lo |= hi << 32; - } - - return lo; -} - -static int mt7621_sw_get_port_mib(struct switch_dev *dev, - const struct switch_attr *attr, - struct switch_val *val) -{ - static char buf[4096]; - struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); - int i, len = 0; - - if (val->port_vlan >= MT7530_NUM_PORTS) - return -EINVAL; - - len += snprintf(buf + len, sizeof(buf) - len, - "Port %d MIB counters\n", val->port_vlan); - - for (i = 0; i < ARRAY_SIZE(mt7621_mibs); ++i) { - u64 counter; - len += snprintf(buf + len, sizeof(buf) - len, - "%-11s: ", mt7621_mibs[i].name); - counter = get_mib_counter(priv, i, val->port_vlan); - len += snprintf(buf + len, sizeof(buf) - len, "%llu\n", - counter); - } - - val->value.s = buf; - val->len = len; - return 0; -} - static u64 get_mib_counter_7620(struct mt7530_priv *priv, int i) { return mt7530_r32(priv, MT7620_MIB_COUNTER_BASE + mt7620_mibs[i].offset); @@ -1019,20 +907,6 @@ static int mt7530_get_port_stats(struct switch_dev *dev, int port, return 0; } -static int mt7621_get_port_stats(struct switch_dev *dev, int port, - struct switch_port_stats *stats) -{ - struct mt7530_priv *priv = container_of(dev, struct mt7530_priv, swdev); - - if (port < 0 || port >= MT7530_NUM_PORTS) - return -EINVAL; - - stats->tx_bytes = get_mib_counter(priv, MT7621_PORT_MIB_TXB_ID, port); - stats->rx_bytes = get_mib_counter(priv, MT7621_PORT_MIB_RXB_ID, port); - - return 0; -} - static const struct switch_attr mt7530_global[] = { { .type = SWITCH_TYPE_INT, @@ -1065,41 +939,6 @@ static const struct switch_attr mt7530_global[] = { }, }; -static const struct switch_attr mt7621_port[] = { - { - .type = SWITCH_TYPE_STRING, - .name = "mib", - .description = "Get MIB counters for port", - .get = mt7621_sw_get_port_mib, - .set = NULL, - }, { - .type = SWITCH_TYPE_INT, - .name = "enable_mirror_rx", - .description = "Enable mirroring of RX packets", - .set = mt7530_set_port_mirror_rx, - .get = mt7530_get_port_mirror_rx, - .max = 1, - }, { - .type = SWITCH_TYPE_INT, - .name = "enable_mirror_tx", - .description = "Enable mirroring of TX packets", - .set = mt7530_set_port_mirror_tx, - .get = mt7530_get_port_mirror_tx, - .max = 1, - }, -}; - -static const struct switch_attr mt7621_vlan[] = { - { - .type = SWITCH_TYPE_INT, - .name = "vid", - .description = "VLAN ID (0-4094)", - .set = mt7530_set_vid, - .get = mt7621_get_vid, - .max = 4094, - }, -}; - static const struct switch_attr mt7530_port[] = { { .type = SWITCH_TYPE_STRING, @@ -1135,29 +974,6 @@ static const struct switch_attr mt7530_vlan[] = { }, }; -static const struct switch_dev_ops mt7621_ops = { - .attr_global = { - .attr = mt7530_global, - .n_attr = ARRAY_SIZE(mt7530_global), - }, - .attr_port = { - .attr = mt7621_port, - .n_attr = ARRAY_SIZE(mt7621_port), - }, - .attr_vlan = { - .attr = mt7621_vlan, - .n_attr = ARRAY_SIZE(mt7621_vlan), - }, - .get_vlan_ports = mt7530_get_vlan_ports, - .set_vlan_ports = mt7530_set_vlan_ports, - .get_port_pvid = mt7530_get_port_pvid, - .set_port_pvid = mt7530_set_port_pvid, - .get_port_link = mt7530_get_port_link, - .get_port_stats = mt7621_get_port_stats, - .apply_config = mt7530_apply_config, - .reset_switch = mt7530_reset_switch, -}; - static const struct switch_dev_ops mt7530_ops = { .attr_global = { .attr = mt7530_global, @@ -1201,9 +1017,6 @@ mt7530_probe(struct device *dev, void __iomem *base, struct mii_bus *bus, int vl if (bus) { swdev->alias = "mt7530"; swdev->name = "mt7530"; - } else if (IS_ENABLED(CONFIG_SOC_MT7621)) { - swdev->alias = "mt7621"; - swdev->name = "mt7621"; } else { swdev->alias = "mt7620"; swdev->name = "mt7620"; @@ -1211,10 +1024,7 @@ mt7530_probe(struct device *dev, void __iomem *base, struct mii_bus *bus, int vl swdev->cpu_port = MT7530_CPU_PORT; swdev->ports = MT7530_NUM_PORTS; swdev->vlans = MT7530_NUM_VLANS; - if (IS_ENABLED(CONFIG_SOC_MT7621)) - swdev->ops = &mt7621_ops; - else - swdev->ops = &mt7530_ops; + swdev->ops = &mt7530_ops; ret = register_switch(swdev, NULL); if (ret) { @@ -1229,7 +1039,7 @@ mt7530_probe(struct device *dev, void __iomem *base, struct mii_bus *bus, int vl mt7530_apply_config(swdev); /* magic vodoo */ - if (!IS_ENABLED(CONFIG_SOC_MT7621) && bus && mt7530_r32(mt7530, REG_HWTRAP) != 0x1117edf) { + if (bus && mt7530_r32(mt7530, REG_HWTRAP) != 0x1117edf) { dev_info(dev, "fixing up MHWTRAP register - bootloader probably played with it\n"); mt7530_w32(mt7530, REG_HWTRAP, 0x1117edf); } diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.h index cf725c2f2b..53e1d2ce55 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.h +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.h @@ -137,50 +137,6 @@ /* Rx Event Packet Counter of Port n */ #define MT7620_MIB_STATS_PORT_REPC2N 0x30 -#define MT7621_MIB_COUNTER_BASE 0x4000 -#define MT7621_MIB_COUNTER_PORT_OFFSET 0x100 -#define MT7621_STATS_TDPC 0x00 -#define MT7621_STATS_TCRC 0x04 -#define MT7621_STATS_TUPC 0x08 -#define MT7621_STATS_TMPC 0x0C -#define MT7621_STATS_TBPC 0x10 -#define MT7621_STATS_TCEC 0x14 -#define MT7621_STATS_TSCEC 0x18 -#define MT7621_STATS_TMCEC 0x1C -#define MT7621_STATS_TDEC 0x20 -#define MT7621_STATS_TLCEC 0x24 -#define MT7621_STATS_TXCEC 0x28 -#define MT7621_STATS_TPPC 0x2C -#define MT7621_STATS_TL64PC 0x30 -#define MT7621_STATS_TL65PC 0x34 -#define MT7621_STATS_TL128PC 0x38 -#define MT7621_STATS_TL256PC 0x3C -#define MT7621_STATS_TL512PC 0x40 -#define MT7621_STATS_TL1024PC 0x44 -#define MT7621_STATS_TOC 0x48 -#define MT7621_STATS_RDPC 0x60 -#define MT7621_STATS_RFPC 0x64 -#define MT7621_STATS_RUPC 0x68 -#define MT7621_STATS_RMPC 0x6C -#define MT7621_STATS_RBPC 0x70 -#define MT7621_STATS_RAEPC 0x74 -#define MT7621_STATS_RCEPC 0x78 -#define MT7621_STATS_RUSPC 0x7C -#define MT7621_STATS_RFEPC 0x80 -#define MT7621_STATS_ROSPC 0x84 -#define MT7621_STATS_RJEPC 0x88 -#define MT7621_STATS_RPPC 0x8C -#define MT7621_STATS_RL64PC 0x90 -#define MT7621_STATS_RL65PC 0x94 -#define MT7621_STATS_RL128PC 0x98 -#define MT7621_STATS_RL256PC 0x9C -#define MT7621_STATS_RL512PC 0xA0 -#define MT7621_STATS_RL1024PC 0xA4 -#define MT7621_STATS_ROC 0xA8 -#define MT7621_STATS_RDPC_CTRL 0xB0 -#define MT7621_STATS_RDPC_ING 0xB4 -#define MT7621_STATS_RDPC_ARL 0xB8 - int mt7530_probe(struct device *dev, void __iomem *base, struct mii_bus *bus, int vlan); #endif diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h index 2f6fe1724c..00f1a0e7e6 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h @@ -519,14 +519,5 @@ static inline void *priv_netdev(struct fe_priv *priv) return (char *)priv - ALIGN(sizeof(struct net_device), NETDEV_ALIGN); } -int mtk_ppe_probe(struct fe_priv *eth); -void mtk_ppe_remove(struct fe_priv *eth); -int mtk_flow_offload(struct fe_priv *eth, - enum flow_offload_type type, - struct flow_offload *flow, - struct flow_offload_hw_path *src, - struct flow_offload_hw_path *dest); -int mtk_offload_check_rx(struct fe_priv *eth, struct sk_buff *skb, u32 rxd4); - #endif /* FE_ETH_H */ diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c index c4684d02d6..f442d558e1 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c @@ -27,16 +27,11 @@ #define MT7620A_CDMA_CSG_CFG 0x400 #define MT7620_DMA_VID (MT7620A_CDMA_CSG_CFG | 0x30) -#define MT7621_CDMP_IG_CTRL (MT7620A_CDMA_CSG_CFG + 0x00) -#define MT7621_CDMP_EG_CTRL (MT7620A_CDMA_CSG_CFG + 0x04) #define MT7620A_RESET_FE BIT(21) -#define MT7621_RESET_FE BIT(6) #define MT7620A_RESET_ESW BIT(23) #define MT7620_L4_VALID BIT(23) -#define MT7621_L4_VALID BIT(24) #define MT7620_TX_DMA_UDF BIT(15) -#define MT7621_TX_DMA_UDF BIT(19) #define TX_DMA_FP_BMAP ((0xff) << 19) #define CDMA_ICS_EN BIT(2) @@ -53,11 +48,6 @@ #define MT7620_GDM1_TX_GBCNT (MT7620_REG_MIB_OFFSET + 0x300) #define MT7620_GDM2_TX_GBCNT (MT7620_GDM1_TX_GBCNT + 0x40) -#define MT7621_REG_MIB_OFFSET 0x2000 -#define MT7621_PPE_AC_BCNT0 (MT7621_REG_MIB_OFFSET + 0x00) -#define MT7621_GDM1_TX_GBCNT (MT7621_REG_MIB_OFFSET + 0x400) -#define MT7621_GDM2_TX_GBCNT (MT7621_GDM1_TX_GBCNT + 0x40) - #define GSW_REG_GDMA1_MAC_ADRL 0x508 #define GSW_REG_GDMA1_MAC_ADRH 0x50C @@ -68,8 +58,6 @@ * but after test it should be BIT(13). */ #define MT7620_FE_GDM1_AF BIT(13) -#define MT7621_FE_GDM1_AF BIT(28) -#define MT7621_FE_GDM2_AF BIT(29) static const u16 mt7620_reg_table[FE_REG_COUNT] = { [FE_REG_PDMA_GLO_CFG] = RT5350_PDMA_GLO_CFG, diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 14e180be04..97fddfe274 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1091,6 +1091,15 @@ define Device/unielec_u7621-06-64m endef TARGET_DEVICES += unielec_u7621-06-64m +define Device/wavlink_wl-wn531a6 + $(Device/dsa-migration) + DEVICE_VENDOR := Wavlink + DEVICE_MODEL := WL-WN531A6 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware kmod-usb3 + IMAGE_SIZE := 15040k +endef +TARGET_DEVICES += wavlink_wl-wn531a6 + define Device/wevo_11acnas $(Device/dsa-migration) IMAGE_SIZE := 16064k diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 908e2df529..4e30100c63 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -553,6 +553,19 @@ define Device/tplink_tl-wr842n-v5 endef TARGET_DEVICES += tplink_tl-wr842n-v5 +define Device/tplink_tl-wr850n-v2 + $(Device/tplink-v2) + IMAGE_SIZE := 7808k + DEVICE_MODEL := TL-WR850N + DEVICE_VARIANT := v2 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x08500002 + TPLINK_HWREVADD := 0x2 + IMAGES := sysupgrade.bin tftp-recovery.bin + IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin) +endef +TARGET_DEVICES += tplink_tl-wr850n-v2 + define Device/tplink_tl-wr902ac-v3 $(Device/tplink-v2) IMAGE_SIZE := 7808k diff --git a/target/linux/ramips/image/rt3883.mk b/target/linux/ramips/image/rt3883.mk index 8f4c22097b..f434172c50 100644 --- a/target/linux/ramips/image/rt3883.mk +++ b/target/linux/ramips/image/rt3883.mk @@ -33,6 +33,7 @@ TARGET_DEVICES += belkin_f9k1109v1 define Device/dlink_dir-645 $(Device/seama) + $(Device/uimage-lzma-loader) SOC := rt3662 BLOCKSIZE := 4k IMAGE_SIZE := 7872k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index e4473cfe1b..833b894511 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -124,6 +124,7 @@ ramips_setup_macs() wan_mac=$label_mac lan_mac=$(macaddr_add $label_mac 1) ;; + wavlink,wl-wn531a6|\ winstars,ws-wn583a6|\ zbtlink,zbt-we1326|\ zbtlink,zbt-wg3526-16m|\ diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index 94c5cb5d49..52be48e1ef 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -94,7 +94,8 @@ tplink,tl-wr841n-v13) ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x10" ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" ;; -tplink,tl-wr841n-v14) +tplink,tl-wr841n-v14|\ +tplink,tl-wr850n-v2) ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" ;; diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 5a5ba587d5..f1687c7108 100755 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -73,6 +73,7 @@ ramips_setup_interfaces() tplink,tl-wr841n-v13|\ tplink,tl-wr841n-v14|\ tplink,tl-wr842n-v5|\ + tplink,tl-wr850n-v2|\ unielec,u7628-01-16m|\ wrtnode,wrtnode2p|\ wrtnode,wrtnode2r|\ @@ -203,7 +204,8 @@ ramips_setup_macs() tplink,tl-wr840n-v5|\ tplink,tl-wr841n-v13|\ tplink,tl-wr841n-v14|\ - tplink,tl-wr842n-v5) + tplink,tl-wr842n-v5|\ + tplink,tl-wr850n-v2) wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xf100)" 1) ;; tplink,archer-c20-v5|\ diff --git a/tools/mpc/Makefile b/tools/mpc/Makefile index 70dca2637d..27e9a01c4b 100644 --- a/tools/mpc/Makefile +++ b/tools/mpc/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mpc -PKG_VERSION:=1.1.0 +PKG_VERSION:=1.2.0 PKG_SOURCE_URL:=@GNU/mpc/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_HASH:=6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e +PKG_HASH:=e90f2d99553a9c19911abdb4305bf8217106a957e3994436428572c8dfe8fda6 HOST_BUILD_PARALLEL:=1 diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile index e0e083d2b6..7eebcfb827 100644 --- a/tools/mtd-utils/Makefile +++ b/tools/mtd-utils/Makefile @@ -7,11 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=2.1.1 +PKG_VERSION:=2.1.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/mtd-utils/ -PKG_HASH:=8d15e8b70f036d6af1a66011f8ca0e048e9675fa7983d33bea92c24313a232d2 +PKG_HASH:=8ad4c5f34716d40646aa28724a2f5616d325a6f119254f914e26976f1f76e9d6 PKG_FIXUP:=autoreconf diff --git a/tools/mtd-utils/patches/100-sscanf_fix.patch b/tools/mtd-utils/patches/100-sscanf_fix.patch index ae6f86722b..a36be078d5 100644 --- a/tools/mtd-utils/patches/100-sscanf_fix.patch +++ b/tools/mtd-utils/patches/100-sscanf_fix.patch @@ -1,6 +1,6 @@ --- a/jffsX-utils/mkfs.jffs2.c +++ b/jffsX-utils/mkfs.jffs2.c -@@ -427,7 +427,7 @@ static int interpret_table_entry(struct +@@ -428,7 +428,7 @@ static int interpret_table_entry(struct if (sscanf (line, "%" SCANF_PREFIX "s %c %lo %lu %lu %lu %lu %lu %lu %lu", SCANF_STRING(name), &type, &mode, &uid, &gid, &major, &minor, diff --git a/tools/mtd-utils/patches/110-portability.patch b/tools/mtd-utils/patches/110-portability.patch index 067526171a..181e40653a 100644 --- a/tools/mtd-utils/patches/110-portability.patch +++ b/tools/mtd-utils/patches/110-portability.patch @@ -70,7 +70,7 @@ #include --- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c +++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c -@@ -1503,6 +1503,7 @@ static int add_inode(struct stat *st, in +@@ -1549,6 +1549,7 @@ static int add_inode(struct stat *st, in if (c->default_compr != UBIFS_COMPR_NONE) use_flags |= UBIFS_COMPR_FL; @@ -78,7 +78,7 @@ if (flags & FS_COMPR_FL) use_flags |= UBIFS_COMPR_FL; if (flags & FS_SYNC_FL) -@@ -1515,6 +1516,7 @@ static int add_inode(struct stat *st, in +@@ -1561,6 +1562,7 @@ static int add_inode(struct stat *st, in use_flags |= UBIFS_DIRSYNC_FL; if (fctx) use_flags |= UBIFS_CRYPT_FL; @@ -86,7 +86,7 @@ memset(ino, 0, UBIFS_INO_NODE_SZ); ino_key_init(&key, inum); -@@ -1600,7 +1602,9 @@ static int add_dir_inode(const char *pat +@@ -1646,7 +1648,9 @@ static int add_dir_inode(const char *pat fd = dirfd(dir); if (fd == -1) return sys_err_msg("dirfd failed"); @@ -96,7 +96,7 @@ flags = 0; } -@@ -1811,6 +1815,7 @@ static int add_file(const char *path_nam +@@ -1857,6 +1861,7 @@ static int add_file(const char *path_nam dn->ch.node_type = UBIFS_DATA_NODE; key_write(&key, &dn->key); out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ; @@ -104,7 +104,7 @@ if (c->default_compr == UBIFS_COMPR_NONE && !c->encrypted && (flags & FS_COMPR_FL)) #ifdef WITHOUT_LZO -@@ -1819,6 +1824,7 @@ static int add_file(const char *path_nam +@@ -1865,6 +1870,7 @@ static int add_file(const char *path_nam use_compr = UBIFS_COMPR_LZO; #endif else @@ -112,7 +112,7 @@ use_compr = c->default_compr; compr_type = compress_data(buf, bytes_read, &dn->data, &out_len, use_compr); -@@ -1876,7 +1882,9 @@ static int add_non_dir(const char *path_ +@@ -1924,7 +1930,9 @@ static int add_non_dir(const char *path_ if (fd == -1) return sys_err_msg("failed to open file '%s'", path_name); diff --git a/tools/mtd-utils/patches/130-lzma_jffs2.patch b/tools/mtd-utils/patches/130-lzma_jffs2.patch index d9cbfeebec..9778aa6d0a 100644 --- a/tools/mtd-utils/patches/130-lzma_jffs2.patch +++ b/tools/mtd-utils/patches/130-lzma_jffs2.patch @@ -5015,7 +5015,7 @@ +} --- a/jffsX-utils/mkfs.jffs2.c +++ b/jffsX-utils/mkfs.jffs2.c -@@ -1666,11 +1666,11 @@ int main(int argc, char **argv) +@@ -1667,11 +1667,11 @@ int main(int argc, char **argv) } erase_block_size *= units; diff --git a/tools/mtd-utils/patches/200-libubigen-add-ubigen_write_terminator-function.patch b/tools/mtd-utils/patches/200-libubigen-add-ubigen_write_terminator-function.patch index d95ece184c..90c951500f 100644 --- a/tools/mtd-utils/patches/200-libubigen-add-ubigen_write_terminator-function.patch +++ b/tools/mtd-utils/patches/200-libubigen-add-ubigen_write_terminator-function.patch @@ -77,7 +77,7 @@ out_free: --- a/include/libubigen.h +++ b/include/libubigen.h -@@ -188,6 +188,9 @@ int ubigen_write_layout_vol(const struct +@@ -187,6 +187,9 @@ int ubigen_write_layout_vol(const struct long long ec1, long long ec2, struct ubi_vtbl_record *vtbl, int fd); diff --git a/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch b/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch index 8e58059576..f3ba4d3276 100644 --- a/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch +++ b/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch @@ -9,7 +9,7 @@ int target_endian = __BYTE_ORDER; static uint32_t find_hardlink(struct filesystem_entry *e) -@@ -250,8 +250,8 @@ static struct filesystem_entry *add_host +@@ -251,8 +251,8 @@ static struct filesystem_entry *add_host mode &= ~(S_ISUID | S_ISGID); } } @@ -20,7 +20,7 @@ } entry = xcalloc(1, sizeof(struct filesystem_entry)); -@@ -1557,6 +1557,20 @@ static void parse_image(void){ +@@ -1558,6 +1558,20 @@ static void parse_image(void){ close(in_fd); } @@ -41,7 +41,7 @@ int main(int argc, char **argv) { int c, opt; -@@ -1575,6 +1589,7 @@ int main(int argc, char **argv) +@@ -1576,6 +1590,7 @@ int main(int argc, char **argv) warn_page_size = 1; /* warn user if page size not 4096 */ jffs2_compressors_init(); @@ -49,7 +49,7 @@ while ((opt = getopt_long(argc, argv, "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) -@@ -1625,7 +1640,7 @@ int main(int argc, char **argv) +@@ -1626,7 +1641,7 @@ int main(int argc, char **argv) break; case 'f':