Merge Official Source

This commit is contained in:
CN_SZTL 2020-08-29 01:09:18 +08:00
commit 9ff69cdc06
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
35 changed files with 546 additions and 679 deletions

View File

@ -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

View File

@ -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) */

View File

@ -0,0 +1,27 @@
From b90acc91d0cd276befe7f08f87ba2dc5ee7122ff Mon Sep 17 00:00:00 2001
From: Tesfa Mael <tesfa@wolfssl.com>
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)

View File

@ -0,0 +1,10 @@
--- a/src/crypto/tls_wolfssl.c
+++ b/src/crypto/tls_wolfssl.c
@@ -19,6 +19,7 @@
#include <wolfssl/ssl.h>
#include <wolfssl/error-ssl.h>
#include <wolfssl/wolfcrypt/asn.h>
+#include <wolfssl/openssl/x509v3.h>
#if defined(EAP_FAST) || defined(EAP_FAST_DYNAMIC) || defined(EAP_SERVER_FAST)
#define HAVE_AESGCM

View File

@ -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

View File

@ -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 <kaloz@openwrt.org>
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))

View File

@ -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:

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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";
};
};
&eth1 {
@ -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 */

View File

@ -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

View File

@ -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))

View File

@ -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 <dgcbueu@gmail.com>
+ */
+
+#include <linux/module.h>
+#include <linux/notifier.h>
+#include <linux/of.h>
+#include <linux/of_mdio.h>
+#include <linux/of_platform.h>
+#include <linux/reboot.h>
+#include <linux/phy.h>
+
+/* 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 <dgcbueu@gmail.com>");
+MODULE_DESCRIPTION("LinkStation power off driver");
+MODULE_LICENSE("GPL v2");

View File

@ -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

View File

@ -0,0 +1,184 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
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 = <KEY_RESTART>;
};
touch { /* RH6015C touch sensor -> GPIO 14 */
label = "Touch Button";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
linux,code = <BTN_0>;
};
turbo {
label = "Turbo Button";
gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
linux,code = <BTN_1>;
};
wps {
label = "WPS Button";
gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
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";
};

View File

@ -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 = <KEY_RESTART>;
};
};
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>;
};

View File

@ -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)

View File

@ -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);
}

View File

@ -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

View File

@ -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 */

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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|\

View File

@ -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"
;;

View File

@ -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|\

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -70,7 +70,7 @@
#include <sys/types.h>
--- 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);

View File

@ -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;

View File

@ -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);

View File

@ -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':