[PATCH v2] wireguard-tools: drop the dependency on ip-{tiny,full}

2020-11-05 Thread Rui Salvaterra
BusyBox ip already provides the required functionality and is enabled by default
in OpenWrt. This patch drops the ip dependency and makes the BusyBox ip required
dependencies explicit, allowing for a significant image size reduction.

openwrt-ath79-generic-ubnt_nanostation-loco-m-squashfs-sysupgrade.bin size:
4588354 bytes (with ip-tiny)
4457282 bytes (with BusyBox ip)

Signed-off-by: Rui Salvaterra 
---
v2: take more accurate size measurements, with the same GCC version. (I hadn't
noticed I had also bumped GCC from 9 to 10, which inlines more aggressively.)

 package/network/utils/wireguard-tools/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/utils/wireguard-tools/Makefile 
b/package/network/utils/wireguard-tools/Makefile
index a5264a50b4..07258fde98 100644
--- a/package/network/utils/wireguard-tools/Makefile
+++ b/package/network/utils/wireguard-tools/Makefile
@@ -32,7 +32,7 @@ MAKE_VARS += PLATFORM=linux
 define Package/wireguard-tools
   $(call Package/wireguard/Default)
   TITLE:=WireGuard userspace control program (wg)
-  DEPENDS:=+ip
+  DEPENDS:=+@BUSYBOX_CONFIG_IP +@BUSYBOX_CONFIG_FEATURE_IP_LINK
 endef
 
 define Package/wireguard-tools/description
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] toolchain: allow compiling with -march=native

2020-11-10 Thread Rui Salvaterra
If the toolchain will only be executed on the system where it is built (or a
system with the exact same CPU), this will squeeze out the last few (single
digit) percent of performance.

Signed-off-by: Rui Salvaterra 
---
 rules.mk| 2 +-
 toolchain/Config.in | 8 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/rules.mk b/rules.mk
index 3214395e1f..e416126030 100644
--- a/rules.mk
+++ b/rules.mk
@@ -249,7 +249,7 @@ export PKG_CONFIG
 HOSTCC:=gcc
 HOSTCXX:=g++
 HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include $(if 
$(IS_PACKAGE_BUILD),-I$(STAGING_DIR_HOSTPKG)/include 
-I$(STAGING_DIR)/host/include)
-HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
+HOST_CFLAGS:=$(if $(CONFIG_BUILD_NATIVE_ARCH),-march=native) -O2 
$(HOST_CPPFLAGS)
 HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib $(if 
$(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib)
 
 ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
diff --git a/toolchain/Config.in b/toolchain/Config.in
index cb557d4ad3..3149d7bc66 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -164,6 +164,14 @@ menuconfig TOOLCHAINOPTS
bool "Toolchain Options"  if DEVEL
depends on NEED_TOOLCHAIN
 
+config BUILD_NATIVE_ARCH
+   def_bool n
+   prompt "Build the toolchain with -march=native" if TOOLCHAINOPTS
+   help
+ When building the toolchain, optimize for the CPU in this specific 
machine.
+ Only choose Y if you're not going to run the compiled toolchain on 
any other
+ system.
+
 menuconfig EXTRA_TARGET_ARCH
bool
prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] tools: sstrip: update to latest version

2020-11-11 Thread Rui Salvaterra
Drop our local sstrip copy and use the current ELFKickers upstream version.
Patch the original makefile in order to avoid building elftoc, since it fails
with musl's elf.h. This is fine, since we only need sstrip anyway.
Finally, add the possibility to pass additional arguments to sstrip (-z being
the obvious candidate).

Signed-off-by: Rui Salvaterra 
---
 config/Config-build.in |   8 +
 rules.mk   |   2 +-
 tools/sstrip/Makefile  |  15 +-
 tools/sstrip/patches/001-compile.patch |  19 +
 tools/sstrip/src/sstrip.c  | 466 -
 5 files changed, 36 insertions(+), 474 deletions(-)
 create mode 100644 tools/sstrip/patches/001-compile.patch
 delete mode 100644 tools/sstrip/src/sstrip.c

diff --git a/config/Config-build.in b/config/Config-build.in
index 178afbdb94..c54bc243c5 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -182,6 +182,14 @@ menu "Global build settings"
help
  Specifies arguments passed to the strip command when 
stripping binaries.
 
+   config SSTRIP_ARGS
+   string
+   prompt "Sstrip arguments"
+   depends on USE_SSTRIP
+   default ""
+   help
+ Specifies arguments passed to the sstrip command when 
stripping binaries.
+
config STRIP_KERNEL_EXPORTS
bool "Strip unnecessary exports from the kernel image"
help
diff --git a/rules.mk b/rules.mk
index e416126030..5c1c141c11 100644
--- a/rules.mk
+++ b/rules.mk
@@ -328,7 +328,7 @@ else
 STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS))
   else
 ifneq ($(CONFIG_USE_SSTRIP),)
-  STRIP:=$(STAGING_DIR_HOST)/bin/sstrip
+  STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(call 
qstrip,$(CONFIG_SSTRIP_ARGS))
 endif
   endif
   RSTRIP= \
diff --git a/tools/sstrip/Makefile b/tools/sstrip/Makefile
index bab172a95a..590d183db0 100644
--- a/tools/sstrip/Makefile
+++ b/tools/sstrip/Makefile
@@ -6,18 +6,19 @@
 #
 include $(TOPDIR)/rules.mk
 
-PKG_NAME:=sstrip
-PKG_VERSION:=2.0
+PKG_NAME:=ELFkickers
+PKG_VERSION:=3.1a
+
+PKG_SOURCE_URL:=https://www.muppetlabs.com/~breadbox/pub/software
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=06430880aaf4919c5f99fc629da7000347421668c2cf32bced2d401aac276508
+
 PKG_RELEASE:=1
 
 include $(INCLUDE_DIR)/host-build.mk
 
-define Host/Compile
-   $(HOSTCC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/sstrip 
src/sstrip.c
-endef
-
 define Host/Install
-   $(CP) $(HOST_BUILD_DIR)/sstrip $(STAGING_DIR_HOST)/bin/
+   $(CP) $(HOST_BUILD_DIR)/bin/sstrip $(STAGING_DIR_HOST)/bin/
 endef
 
 define Host/Clean
diff --git a/tools/sstrip/patches/001-compile.patch 
b/tools/sstrip/patches/001-compile.patch
new file mode 100644
index 00..9d3346edfb
--- /dev/null
+++ b/tools/sstrip/patches/001-compile.patch
@@ -0,0 +1,19 @@
+--- a/Makefile
 b/Makefile
+@@ -2,7 +2,7 @@
+ 
+ prefix = /usr/local
+ 
+-PROGRAMS = elfls objres rebind sstrip elftoc ebfc infect
++PROGRAMS = elfls objres rebind sstrip ebfc infect
+ 
+ all: $(PROGRAMS)
+ 
+@@ -19,7 +19,6 @@ elfls: bin/elfls doc/elfls.1
+ objres: bin/objres doc/objres.1
+ rebind: bin/rebind doc/rebind.1
+ sstrip: bin/sstrip doc/sstrip.1
+-elftoc: bin/elftoc doc/elftoc.1
+ ebfc: bin/ebfc doc/ebfc.1
+ infect: bin/infect doc/infect.1
+ 
diff --git a/tools/sstrip/src/sstrip.c b/tools/sstrip/src/sstrip.c
deleted file mode 100644
index 12cf12e095..00
--- a/tools/sstrip/src/sstrip.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/* http://www.muppetlabs.com/~breadbox/software/elfkickers.html */
-
-/* sstrip: Copyright (C) 1999-2001 by Brian Raiter, under the GNU
- * General Public License. No warranty. See COPYING for details.
- *
- * Aug 23, 2004 Hacked by Manuel Novoa III  to
- * handle targets of different endianness and/or elf class, making
- * it more useful in a cross-devel environment.
- */
-
-/* == original README ===
- *
- * sstrip is a small utility that removes the contents at the end of an
- * ELF file that are not part of the program's memory image.
- * 
- * Most ELF executables are built with both a program header table and a
- * section header table. However, only the former is required in order
- * for the OS to load, link and execute a program. sstrip attempts to
- * extract the ELF header, the program header table, and its contents,
- * leaving everything else in the bit bucket. It can only remove parts of
- * the file that occur at the end, after the parts to be saved. However,
- * this almost always includes the section header table, and occasionally
- * a few random sections that are not used when running a program.
- * 
- * It should be noted that the GNU bfd library is (understandably)
- * dependent on the section header table as an index to the file's
- * contents. Thus, an executable f

[PATCH] Revert "netifd: update to the latest version"

2020-11-13 Thread Rui Salvaterra
This broke the switch VLAN configuration on at least Archer C6 v2 EU and Archer
C7 (both switchdev-based one-armed routers).

Signed-off-by: Rui Salvaterra 
---
 package/network/config/netifd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/config/netifd/Makefile 
b/package/network/config/netifd/Makefile
index 92bdb34fc8..2c26517f44 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
-PKG_SOURCE_DATE:=2020-11-05
-PKG_SOURCE_VERSION:=ed11f0c0ffe4fdacfe3f8223049ef8a61d9c53e9
-PKG_MIRROR_HASH:=0abd8aaa3818147b6a550a054d97c6cd21d22e806195d863aa87b6b2c808d409
+PKG_SOURCE_DATE:=2020-10-22
+PKG_SOURCE_VERSION:=24ce1eab4910869576406bafd0489daf0d3e6e28
+PKG_MIRROR_HASH:=aa73b4e470e81165baba0262144f410bb05a3ff141cf72ad451914f033868ea1
 PKG_MAINTAINER:=Felix Fietkau 
 
 PKG_LICENSE:=GPL-2.0
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] Revert "netifd: update to the latest version"

2020-11-13 Thread Rui Salvaterra
Hi, Felix,

On Fri, 13 Nov 2020 at 10:25, Felix Fietkau  wrote:
>
> Please git-bisect this and show me the config that doesn't work anymore,
> so that I can fix it properly.

I can't bisect this now, as I'm using the router. The config (in
/etc/config/network), however, is trivial:

config switch
option enable_vlan '1'
option name 'switch0'
option reset '1'

config switch_vlan
option device 'switch0'
option ports '2 3 4 5 0t'
option vlan '1'

config switch_vlan
option device 'switch0'
option ports '1 0t'
option vlan '2'

Symptom: with the netifd update, only the VLAN 1 (eth0.1@eth0)
interface exists, VLAN 2 (eth0.2@eth0) doesn't.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] Revert "netifd: update to the latest version"

2020-11-13 Thread Rui Salvaterra
On Fri, 13 Nov 2020 at 10:35, Felix Fietkau  wrote:
>
> Please show me the full /etc/config/network so I can test with it as-is.

Here it goes (WG keys redacted):

config interface 'loopback'
option ifname 'lo'
option proto 'static'
list ipaddr '127.0.0.1/8'

config interface 'lan'
option ifname 'eth0.1'
option ipv6 '0'
option proto 'static'
option type 'bridge'
list ipaddr '192.168.16.1/24'

config interface 'tor'
option ipv6 '0'
option proto 'static'
option type 'bridge'
list ipaddr '192.168.17.1/24'

config interface 'gst'
option ipv6 '0'
option proto 'static'
option type 'bridge'
list ipaddr '192.168.18.1/24'

config interface 'pub'
option ipv6 '0'
option proto 'static'
option type 'bridge'
list ipaddr '192.168.19.1/24'

config interface 'wgl'
option ipv6 '0'
option listen_port '995'
option proto 'wireguard'
list addresses '10.0.0.1/29'

config wireguard_wgl
option route_allowed_ips '1'
list allowed_ips '192.168.240.0/24'

config wireguard_wgl
list allowed_ips '10.0.0.4/32'

config wireguard_wgl
list allowed_ips '10.0.0.5/32'

config interface 'wgt'
option ipv6 '0'
option listen_port '443'
option proto 'wireguard'
list addresses '10.0.1.1/30'

config wireguard_wgt
list allowed_ips '10.0.1.2/32'

config interface 'wgk'
option ipv6 '0'
option listen_port '80'
option proto 'wireguard'
list addresses '10.0.2.2/30'

config wireguard_wgk
option endpoint_host '62.28.38.138'
option endpoint_port '443'
option route_allowed_ips '1'
list allowed_ips '192.168.1.0/24'

config interface 'wan'
option ifname 'eth0.2'
option ipv6 '0'
option proto 'dhcp'

config switch
option enable_vlan '1'
option name 'switch0'
option reset '1'

config switch_vlan
option device 'switch0'
option ports '2 3 4 5 0t'
option vlan '1'

config switch_vlan
option device 'switch0'
option ports '1 0t'
option vlan '2'

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 0/3] dropbear: overhaul the crypto algorithm selection

2020-11-15 Thread Rui Salvaterra
This patch series enables a much more fine-grained configuration of the public
key, encryption and key exchange algorithms in Dropbear.

v3: rebase against current master.
v2: correct file permissions.

Rui Salvaterra (3):
  dropbear: create a submenu for public key algorithms
  dropbear: create a submenu for encryption algorithms
  dropbear: create a submenu for key exchange algorithms

 package/network/services/dropbear/Config.in   | 60 +--
 package/network/services/dropbear/Makefile| 44 ++
 .../dropbear/files/dropbear.failsafe.ecc  |  8 +++
 .../dropbear/files/dropbear.failsafe.ed25519  |  8 +++
 ...ropbear.failsafe => dropbear.failsafe.rsa} |  0
 ...nkey-fix-use-of-rsa-sha2-256-pubkeys.patch | 12 +++-
 6 files changed, 113 insertions(+), 19 deletions(-)
 create mode 100644 
package/network/services/dropbear/files/dropbear.failsafe.ecc
 create mode 100644 
package/network/services/dropbear/files/dropbear.failsafe.ed25519
 rename package/network/services/dropbear/files/{dropbear.failsafe => 
dropbear.failsafe.rsa} (100%)
 mode change 100755 => 100644

-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 3/3] dropbear: create a submenu for key exchange algorithms

2020-11-15 Thread Rui Salvaterra
This allows the user to select only the key exchange algorithms (s)he requires
(e.g., disabling group 14 SHA-{1,256} and keeping only Curve25519). The default
selection maintains the current functionality.

Additionally, make sure at least one key exchange algorithm is selected, lest
the build would fail.

Signed-off-by: Rui Salvaterra 
---
 package/network/services/dropbear/Config.in | 12 
 package/network/services/dropbear/Makefile  | 13 ++---
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/package/network/services/dropbear/Config.in 
b/package/network/services/dropbear/Config.in
index 9cea6242a6..066dab0a9b 100644
--- a/package/network/services/dropbear/Config.in
+++ b/package/network/services/dropbear/Config.in
@@ -94,6 +94,16 @@ config DROPBEAR_AUTOSEL_EA
 
 endmenu
 
+menu "Key exchange algorithm selection"
+
+config DROPBEAR_DH_GROUP14_SHA1
+   bool "Group 14 SHA-1"
+   default y
+
+config DROPBEAR_DH_GROUP14_SHA256
+   bool "Group 14 SHA-256"
+   default y
+
 config DROPBEAR_CURVE25519
bool "Curve25519 support"
default y
@@ -103,6 +113,8 @@ config DROPBEAR_CURVE25519
 
Increases binary size by about 4 kB (MIPS).
 
+endmenu
+
 config DROPBEAR_ZLIB
bool "Enable compression"
default n
diff --git a/package/network/services/dropbear/Makefile 
b/package/network/services/dropbear/Makefile
index a91c8d93e4..b77c96579e 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -32,6 +32,7 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_DROPBEAR_RSA CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \
CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_AES128 CONFIG_DROPBEAR_AES256 \
CONFIG_DROPBEAR_CHACHA20POLY1305 CONFIG_DROPBEAR_UTMP \
+   CONFIG_DROPBEAR_DH_GROUP14_SHA1 CONFIG_DROPBEAR_DH_GROUP14_SHA256 \
CONFIG_DROPBEAR_PUTUTLINE CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP
 
 include $(INCLUDE_DIR)/package.mk
@@ -110,9 +111,6 @@ define Build/Configure
echo '#define DROPBEAR_RSA $(if $(CONFIG_DROPBEAR_RSA),1,0)' >> \
$(PKG_BUILD_DIR)/localoptions.h
 
-   echo '#define DROPBEAR_CURVE25519 $(if 
$(CONFIG_DROPBEAR_CURVE25519),1,0)' >> \
-   $(PKG_BUILD_DIR)/localoptions.h
-
for OPTION in DROPBEAR_ECDSA DROPBEAR_ECDH; do \
echo "#define OPTION $(if $(CONFIG_DROPBEAR_ECC),1,0)" >> \
$(PKG_BUILD_DIR)/localoptions.h; \
@@ -130,6 +128,15 @@ define Build/Configure
echo '#define DROPBEAR_CHACHA20POLY1305 $(if 
$(CONFIG_DROPBEAR_CHACHA20POLY1305),1,0)' >> \
$(PKG_BUILD_DIR)/localoptions.h
 
+   echo '#define DROPBEAR_DH_GROUP14_SHA1 $(if 
$(CONFIG_DROPBEAR_DH_GROUP14_SHA1),1,0)' >> \
+   $(PKG_BUILD_DIR)/localoptions.h
+
+   echo '#define DROPBEAR_DH_GROUP14_SHA256 $(if 
$(CONFIG_DROPBEAR_DH_GROUP14_SHA256),1,0)' >> \
+   $(PKG_BUILD_DIR)/localoptions.h
+
+   echo '#define DROPBEAR_CURVE25519 $(if 
$(CONFIG_DROPBEAR_CURVE25519),1,0)' >> \
+   $(PKG_BUILD_DIR)/localoptions.h
+
# remove protocol idented software version number
$(ESED) 's,^(#define LOCAL_IDENT) .*,\1 "SSH-2.0-dropbear",g' \
$(PKG_BUILD_DIR)/sysoptions.h
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 2/3] dropbear: create a submenu for encryption algorithms

2020-11-15 Thread Rui Salvaterra
This allows the user to select only the encryption algorithms (s)he requires
(e.g., disabling AES and keeping only ChaCha20-Poly1305). The default selection
maintains the current functionality.

Additionally, make sure at least one encryption algorithm is selected, lest the
build would fail.

Signed-off-by: Rui Salvaterra 
---
 package/network/services/dropbear/Config.in | 21 +
 package/network/services/dropbear/Makefile  | 12 +---
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/package/network/services/dropbear/Config.in 
b/package/network/services/dropbear/Config.in
index d2771eca93..9cea6242a6 100644
--- a/package/network/services/dropbear/Config.in
+++ b/package/network/services/dropbear/Config.in
@@ -64,6 +64,20 @@ config DROPBEAR_AUTOSEL_PK
 
 endmenu
 
+menu "Encryption algorithm selection"
+
+config DROPBEAR_AES128
+   bool "AES-128 support"
+   default y
+   help
+   This enables support for the 128-bit AES cipher
+
+config DROPBEAR_AES256
+   bool "AES-256 support"
+   default y
+   help
+   This enables support for the 256-bit AES cipher
+
 config DROPBEAR_CHACHA20POLY1305
bool "Chacha20-Poly1305 support"
default y
@@ -73,6 +87,13 @@ config DROPBEAR_CHACHA20POLY1305
 
Increases binary size by about 4 kB (MIPS).
 
+config DROPBEAR_AUTOSEL_EA
+   def_bool y
+   depends on !(DROPBEAR_AES256 || DROPBEAR_CHACHA20POLY1305)
+   select DROPBEAR_AES128
+
+endmenu
+
 config DROPBEAR_CURVE25519
bool "Curve25519 support"
default y
diff --git a/package/network/services/dropbear/Makefile 
b/package/network/services/dropbear/Makefile
index 7087d96b87..a91c8d93e4 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -30,9 +30,9 @@ PKG_FLAGS:=nonshared
 PKG_CONFIG_DEPENDS:= \
CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC CONFIG_DROPBEAR_ECC_FULL \
CONFIG_DROPBEAR_RSA CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \
-   CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_CHACHA20POLY1305 \
-   CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE \
-   CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP
+   CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_AES128 CONFIG_DROPBEAR_AES256 \
+   CONFIG_DROPBEAR_CHACHA20POLY1305 CONFIG_DROPBEAR_UTMP \
+   CONFIG_DROPBEAR_PUTUTLINE CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -121,6 +121,12 @@ define Build/Configure
echo '#define DROPBEAR_ED25519 $(if $(CONFIG_DROPBEAR_ED25519),1,0)' >> 
\
$(PKG_BUILD_DIR)/localoptions.h
 
+   echo '#define DROPBEAR_AES128 $(if $(CONFIG_DROPBEAR_AES128),1,0)' >> \
+   $(PKG_BUILD_DIR)/localoptions.h
+
+   echo '#define DROPBEAR_AES256 $(if $(CONFIG_DROPBEAR_AES256),1,0)' >> \
+   $(PKG_BUILD_DIR)/localoptions.h
+
echo '#define DROPBEAR_CHACHA20POLY1305 $(if 
$(CONFIG_DROPBEAR_CHACHA20POLY1305),1,0)' >> \
$(PKG_BUILD_DIR)/localoptions.h
 
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 1/3] dropbear: create a submenu for public key algorithms

2020-11-15 Thread Rui Salvaterra
This allows the user to select only the public key algorithms (s)he requires
(e.g., disabling RSA and keeping only Ed25519). The default selection maintains
the current functionality.

Additionally, make sure at least one public key algorithm is selected, lest the
build would fail.

Dropbear executable sizes (ath79, -O2):

RSA + Ed25519:  210101 bytes
RSA only:   197765 bytes
Ed25519 only:   189637 bytes

Signed-off-by: Rui Salvaterra 
---
 package/network/services/dropbear/Config.in   | 27 ++-
 package/network/services/dropbear/Makefile| 23 +++-
 .../dropbear/files/dropbear.failsafe.ecc  |  8 ++
 .../dropbear/files/dropbear.failsafe.ed25519  |  8 ++
 ...ropbear.failsafe => dropbear.failsafe.rsa} |  0
 ...nkey-fix-use-of-rsa-sha2-256-pubkeys.patch | 12 ++---
 6 files changed, 63 insertions(+), 15 deletions(-)
 create mode 100644 
package/network/services/dropbear/files/dropbear.failsafe.ecc
 create mode 100644 
package/network/services/dropbear/files/dropbear.failsafe.ed25519
 rename package/network/services/dropbear/files/{dropbear.failsafe => 
dropbear.failsafe.rsa} (100%)
 mode change 100755 => 100644

diff --git a/package/network/services/dropbear/Config.in 
b/package/network/services/dropbear/Config.in
index 6aa5a7e4e1..d2771eca93 100644
--- a/package/network/services/dropbear/Config.in
+++ b/package/network/services/dropbear/Config.in
@@ -1,14 +1,13 @@
 menu "Configuration"
depends on PACKAGE_dropbear
 
-config DROPBEAR_CURVE25519
-   bool "Curve25519 support"
+menu "Public key algorithm selection"
+
+config DROPBEAR_RSA
+   bool "RSA support"
default y
help
-   This enables the following key exchange algorithm:
- curve25519-sha...@libssh.org
-
-   Increases binary size by about 4 kB (MIPS).
+   Enable support for the RSA public key algorithm.
 
 config DROPBEAR_ECC
bool "Elliptic curve cryptography (ECC)"
@@ -58,6 +57,13 @@ config DROPBEAR_ED25519
 
Increases binary size by about 12 kB (MIPS).
 
+config DROPBEAR_AUTOSEL_PK
+   def_bool y
+   depends on !(DROPBEAR_ECC || DROPBEAR_ED25519)
+   select DROPBEAR_RSA
+
+endmenu
+
 config DROPBEAR_CHACHA20POLY1305
bool "Chacha20-Poly1305 support"
default y
@@ -67,6 +73,15 @@ config DROPBEAR_CHACHA20POLY1305
 
Increases binary size by about 4 kB (MIPS).
 
+config DROPBEAR_CURVE25519
+   bool "Curve25519 support"
+   default y
+   help
+   This enables the following key exchange algorithm:
+ curve25519-sha...@libssh.org
+
+   Increases binary size by about 4 kB (MIPS).
+
 config DROPBEAR_ZLIB
bool "Enable compression"
default n
diff --git a/package/network/services/dropbear/Makefile 
b/package/network/services/dropbear/Makefile
index 8520426382..7087d96b87 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -29,7 +29,7 @@ PKG_FLAGS:=nonshared
 
 PKG_CONFIG_DEPENDS:= \
CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC CONFIG_DROPBEAR_ECC_FULL \
-   CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \
+   CONFIG_DROPBEAR_RSA CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \
CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_CHACHA20POLY1305 \
CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE \
CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP
@@ -67,9 +67,9 @@ define Package/dropbear/description
 endef
 
 define Package/dropbear/conffiles
+$(if $(CONFIG_DROPBEAR_RSA),/etc/dropbear/dropbear_rsa_host_key)
 $(if $(CONFIG_DROPBEAR_ED25519),/etc/dropbear/dropbear_ed25519_host_key)
 $(if $(CONFIG_DROPBEAR_ECC),/etc/dropbear/dropbear_ecdsa_host_key)
-/etc/dropbear/dropbear_rsa_host_key
 /etc/config/dropbear
 endef
 
@@ -107,6 +107,9 @@ define Build/Configure
echo '#define DEFAULT_PATH "$(TARGET_INIT_PATH)"' >> \
$(PKG_BUILD_DIR)/localoptions.h
 
+   echo '#define DROPBEAR_RSA $(if $(CONFIG_DROPBEAR_RSA),1,0)' >> \
+   $(PKG_BUILD_DIR)/localoptions.h
+
echo '#define DROPBEAR_CURVE25519 $(if 
$(CONFIG_DROPBEAR_CURVE25519),1,0)' >> \
$(PKG_BUILD_DIR)/localoptions.h
 
@@ -169,10 +172,18 @@ define Package/dropbear/install
$(INSTALL_DIR) $(1)/usr/lib/opkg/info
$(INSTALL_DIR) $(1)/etc/dropbear
$(INSTALL_DIR) $(1)/lib/preinit
-   $(INSTALL_DATA) ./files/dropbear.failsafe 
$(1)/lib/preinit/99_10_failsafe_dropbear
-   $(if $(CONFIG_DROPBEAR_ED25519),touch 
$(1)/etc/dropbear/dropbear_ed25519_host_key)
-   $(if $(CONFIG_DROPBEAR_ECC),touch 
$(1)/etc/dropbear/dropbear_ecdsa_host_key)
-   touch $(1)/etc/dropbear/dropbear_rsa_host_key
+
+ifdef CONFIG_DROPBEAR_ED25519
+  

Re: [PATCH] tools: sstrip: update to latest version

2020-11-18 Thread Rui Salvaterra
Hi, Paul,

On Wed, 18 Nov 2020 at 04:47, Paul Spooren  wrote:
>
> LGTM, tested and works fine.
>
> Could you please create a slightly more verbose patch name for
> 001-compile.patch?

Sure, I'll send a follow-up patch to make it more explanatory.

> Do you see any possible success in pinging upstream to unify their
> versioning? sstrip 3.1a still outputs version 2.0.

Heh… You already pinged them in July, I guess I'll add another
comment, but don't hold your breath, upstream doesn't seem very
responsive… :/

> Please create an additional patch to enable -z by default.

I'll also include this in the follow-up patch.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] tools: sstrip: reword compile patch and enable -z by default

2020-11-18 Thread Rui Salvaterra
Match the previous behaviour of removing trailing zero bytes by default (-z
option). Additionally, rename and reword the patch required for successful
compilation.

Signed-off-by: Rui Salvaterra 
---
 config/Config-build.in   | 2 +-
 ...ompile.patch => 001-disable-elftoc-compilation.patch} | 9 +
 2 files changed, 10 insertions(+), 1 deletion(-)
 rename tools/sstrip/patches/{001-compile.patch => 
001-disable-elftoc-compilation.patch} (61%)

diff --git a/config/Config-build.in b/config/Config-build.in
index c54bc243c5..2d97691104 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -186,7 +186,7 @@ menu "Global build settings"
string
prompt "Sstrip arguments"
depends on USE_SSTRIP
-   default ""
+   default "-z"
help
  Specifies arguments passed to the sstrip command when 
stripping binaries.
 
diff --git a/tools/sstrip/patches/001-compile.patch 
b/tools/sstrip/patches/001-disable-elftoc-compilation.patch
similarity index 61%
rename from tools/sstrip/patches/001-compile.patch
rename to tools/sstrip/patches/001-disable-elftoc-compilation.patch
index 9d3346edfb..787c51ce5b 100644
--- a/tools/sstrip/patches/001-compile.patch
+++ b/tools/sstrip/patches/001-disable-elftoc-compilation.patch
@@ -1,3 +1,12 @@
+From: Rui Salvaterra 
+Subject: sstrip: don't try to compile elftoc
+
+We only need sstrip itself and elftoc doesn't compile with musl's elf.h, so
+disable the elftoc compilation in the makefile.
+
+Signed-off-by: Rui Salvaterra 
+---
+
 --- a/Makefile
 +++ b/Makefile
 @@ -2,7 +2,7 @@
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ath79: move the squashfs feature to the parent target

2020-11-22 Thread Rui Salvaterra
All subtargets define it. Move it to the parent target and remove it from all
subtargets.

Signed-off-by: Rui Salvaterra 
---
 target/linux/ath79/Makefile   | 2 +-
 target/linux/ath79/generic/target.mk  | 1 -
 target/linux/ath79/mikrotik/target.mk | 2 +-
 target/linux/ath79/nand/target.mk | 2 +-
 target/linux/ath79/tiny/target.mk | 2 +-
 5 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/target/linux/ath79/Makefile b/target/linux/ath79/Makefile
index e074cde8ce..2a9857bfb1 100644
--- a/target/linux/ath79/Makefile
+++ b/target/linux/ath79/Makefile
@@ -6,7 +6,7 @@ BOARDNAME:=Atheros ATH79
 CPU_TYPE:=24kc
 SUBTARGETS:=generic mikrotik nand tiny
 
-FEATURES:=ramdisk usbgadget
+FEATURES:=ramdisk squashfs usbgadget
 
 KERNEL_PATCHVER:=5.4
 KERNEL_TESTING_PATCHVER:=5.4
diff --git a/target/linux/ath79/generic/target.mk 
b/target/linux/ath79/generic/target.mk
index 0624f79572..4e53c89260 100644
--- a/target/linux/ath79/generic/target.mk
+++ b/target/linux/ath79/generic/target.mk
@@ -1,5 +1,4 @@
 BOARDNAME:=Generic
-FEATURES += squashfs
 
 DEFAULT_PACKAGES += wpad-basic-wolfssl
 
diff --git a/target/linux/ath79/mikrotik/target.mk 
b/target/linux/ath79/mikrotik/target.mk
index fb5171fea7..f5df904487 100644
--- a/target/linux/ath79/mikrotik/target.mk
+++ b/target/linux/ath79/mikrotik/target.mk
@@ -1,5 +1,5 @@
 BOARDNAME := MikroTik devices
-FEATURES += minor nand squashfs
+FEATURES += minor nand
 KERNELNAME := vmlinux vmlinuz
 IMAGES_DIR := ../../..
 
diff --git a/target/linux/ath79/nand/target.mk 
b/target/linux/ath79/nand/target.mk
index a4069d7610..7ea9b57f45 100644
--- a/target/linux/ath79/nand/target.mk
+++ b/target/linux/ath79/nand/target.mk
@@ -1,6 +1,6 @@
 BOARDNAME := Generic devices with NAND flash
 
-FEATURES += squashfs nand
+FEATURES += nand
 
 DEFAULT_PACKAGES += wpad-basic-wolfssl
 
diff --git a/target/linux/ath79/tiny/target.mk 
b/target/linux/ath79/tiny/target.mk
index 2ee71ea921..91f135b56e 100644
--- a/target/linux/ath79/tiny/target.mk
+++ b/target/linux/ath79/tiny/target.mk
@@ -1,5 +1,5 @@
 BOARDNAME:=Devices with small flash
-FEATURES += squashfs small_flash
+FEATURES += small_flash
 
 DEFAULT_PACKAGES += wpad-basic-wolfssl
 
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] treewide: clean up target/subtarget features

2020-11-25 Thread Rui Salvaterra
Move features common to all subtargets to the parent target, where applicable.

Signed-off-by: Rui Salvaterra 
---
After cleaning up ath79, I noticed other targets had the same issue. I think I
cleaned up all the remaning ones, but I may have missed something.

 target/linux/apm821xx/Makefile| 2 +-
 target/linux/apm821xx/nand/target.mk  | 2 +-
 target/linux/apm821xx/sata/target.mk  | 2 +-
 target/linux/lantiq/ase/target.mk | 2 +-
 target/linux/lantiq/falcon/target.mk  | 2 +-
 target/linux/lantiq/xrx200/target.mk  | 2 +-
 target/linux/lantiq/xway/target.mk| 2 +-
 target/linux/lantiq/xway_legacy/target.mk | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/linux/apm821xx/Makefile b/target/linux/apm821xx/Makefile
index c7e27d3214..bae20d0d04 100644
--- a/target/linux/apm821xx/Makefile
+++ b/target/linux/apm821xx/Makefile
@@ -8,7 +8,7 @@ ARCH:=powerpc
 BOARD:=apm821xx
 BOARDNAME:=AppliedMicro APM821xx
 CPU_TYPE:=464fp
-FEATURES:=fpu dt gpio
+FEATURES:=fpu dt gpio ramdisk squashfs usb
 SUBTARGETS:=nand sata
 
 KERNEL_PATCHVER:=5.4
diff --git a/target/linux/apm821xx/nand/target.mk 
b/target/linux/apm821xx/nand/target.mk
index d40b0fbc19..208ea10b91 100644
--- a/target/linux/apm821xx/nand/target.mk
+++ b/target/linux/apm821xx/nand/target.mk
@@ -1,5 +1,5 @@
 BOARDNAME:=Devices with NAND flash (Routers)
-FEATURES += nand pcie ramdisk squashfs usb
+FEATURES += nand pcie
 
 DEFAULT_PACKAGES += kmod-ath9k swconfig wpad-basic-wolfssl
 
diff --git a/target/linux/apm821xx/sata/target.mk 
b/target/linux/apm821xx/sata/target.mk
index 43b1aa0324..b27b7ff583 100644
--- a/target/linux/apm821xx/sata/target.mk
+++ b/target/linux/apm821xx/sata/target.mk
@@ -1,6 +1,6 @@
 BOARDNAME := Devices which boot from SATA (NAS)
 DEVICE_TYPE := nas
-FEATURES += ext4 usb ramdisk squashfs rootfs-part boot-part
+FEATURES += boot-part ext4 rootfs-part
 DEFAULT_PACKAGES += badblocks block-mount e2fsprogs kmod-hwmon-drivetemp \
kmod-dm kmod-md-mod partx-utils mkf2fs f2fsck
 
diff --git a/target/linux/lantiq/ase/target.mk 
b/target/linux/lantiq/ase/target.mk
index 5f6c03b38e..82a162bbb1 100644
--- a/target/linux/lantiq/ase/target.mk
+++ b/target/linux/lantiq/ase/target.mk
@@ -7,7 +7,7 @@
 ARCH:=mips
 SUBTARGET:=ase
 BOARDNAME:=Amazon-SE
-FEATURES:=squashfs atm mips16 small_flash
+FEATURES:=atm mips16 small_flash
 CPU_TYPE:=mips32
 
 DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug \
diff --git a/target/linux/lantiq/falcon/target.mk 
b/target/linux/lantiq/falcon/target.mk
index 3c848dfda7..ddab198849 100644
--- a/target/linux/lantiq/falcon/target.mk
+++ b/target/linux/lantiq/falcon/target.mk
@@ -1,7 +1,7 @@
 ARCH:=mips
 SUBTARGET:=falcon
 BOARDNAME:=Falcon
-FEATURES:=squashfs nand
+FEATURES:=nand
 CPU_TYPE:=24kc
 
 DEFAULT_PACKAGES+= kmod-leds-gpio \
diff --git a/target/linux/lantiq/xrx200/target.mk 
b/target/linux/lantiq/xrx200/target.mk
index 4d92b25bcb..8497db51ba 100644
--- a/target/linux/lantiq/xrx200/target.mk
+++ b/target/linux/lantiq/xrx200/target.mk
@@ -1,7 +1,7 @@
 ARCH:=mips
 SUBTARGET:=xrx200
 BOARDNAME:=XRX200
-FEATURES:=squashfs atm nand ramdisk
+FEATURES:=atm nand ramdisk
 CPU_TYPE:=24kc
 
 DEFAULT_PACKAGES+=kmod-leds-gpio \
diff --git a/target/linux/lantiq/xway/target.mk 
b/target/linux/lantiq/xway/target.mk
index 550c61edf0..9ad240e8ca 100644
--- a/target/linux/lantiq/xway/target.mk
+++ b/target/linux/lantiq/xway/target.mk
@@ -1,7 +1,7 @@
 ARCH:=mips
 SUBTARGET:=xway
 BOARDNAME:=XWAY
-FEATURES:=squashfs atm nand ramdisk
+FEATURES:=atm nand ramdisk
 CPU_TYPE:=24kc
 
 DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug swconfig
diff --git a/target/linux/lantiq/xway_legacy/target.mk 
b/target/linux/lantiq/xway_legacy/target.mk
index 7678030ead..641c590d48 100644
--- a/target/linux/lantiq/xway_legacy/target.mk
+++ b/target/linux/lantiq/xway_legacy/target.mk
@@ -1,7 +1,7 @@
 ARCH:=mips
 SUBTARGET:=xway_legacy
 BOARDNAME:=XWAY Legacy
-FEATURES:=squashfs atm ramdisk small_flash
+FEATURES:=atm ramdisk small_flash
 CPU_TYPE:=24kc
 
 DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug swconfig
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2] tools/sstrip: update to latest version

2020-11-25 Thread Rui Salvaterra
Drop our local sstrip copy and use the current ELFKickers upstream version.

Patch the original makefile in order to avoid building elftoc, since it fails
with musl's elf.h. This is fine, since we only need sstrip anyway.

Finally, add the possibility to pass additional arguments to sstrip and pass -z
(remove trailing zeros) by default, which matches the behaviour of the previous
version.

Signed-off-by: Rui Salvaterra 
---
v2: squshed all changes in a single patch.

Although the upstream project is called ELFKickers, I haven't changed PKG_NAME.
Should we do it, or leave it as it is?

 config/Config-build.in|   8 +
 rules.mk  |   2 +-
 tools/sstrip/Makefile |  15 +-
 .../001-disable-elftoc-compilation.patch  |  28 ++
 tools/sstrip/src/sstrip.c | 466 --
 5 files changed, 45 insertions(+), 474 deletions(-)
 create mode 100644 tools/sstrip/patches/001-disable-elftoc-compilation.patch
 delete mode 100644 tools/sstrip/src/sstrip.c

diff --git a/config/Config-build.in b/config/Config-build.in
index 8e12199cbd..3448d46726 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -182,6 +182,14 @@ menu "Global build settings"
help
  Specifies arguments passed to the strip command when 
stripping binaries.
 
+   config SSTRIP_ARGS
+   string
+   prompt "Sstrip arguments"
+   depends on USE_SSTRIP
+   default "-z"
+   help
+ Specifies arguments passed to the sstrip command when 
stripping binaries.
+
config STRIP_KERNEL_EXPORTS
bool "Strip unnecessary exports from the kernel image"
help
diff --git a/rules.mk b/rules.mk
index e416126030..5c1c141c11 100644
--- a/rules.mk
+++ b/rules.mk
@@ -328,7 +328,7 @@ else
 STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS))
   else
 ifneq ($(CONFIG_USE_SSTRIP),)
-  STRIP:=$(STAGING_DIR_HOST)/bin/sstrip
+  STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(call 
qstrip,$(CONFIG_SSTRIP_ARGS))
 endif
   endif
   RSTRIP= \
diff --git a/tools/sstrip/Makefile b/tools/sstrip/Makefile
index bab172a95a..590d183db0 100644
--- a/tools/sstrip/Makefile
+++ b/tools/sstrip/Makefile
@@ -6,18 +6,19 @@
 #
 include $(TOPDIR)/rules.mk
 
-PKG_NAME:=sstrip
-PKG_VERSION:=2.0
+PKG_NAME:=ELFkickers
+PKG_VERSION:=3.1a
+
+PKG_SOURCE_URL:=https://www.muppetlabs.com/~breadbox/pub/software
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=06430880aaf4919c5f99fc629da7000347421668c2cf32bced2d401aac276508
+
 PKG_RELEASE:=1
 
 include $(INCLUDE_DIR)/host-build.mk
 
-define Host/Compile
-   $(HOSTCC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/sstrip 
src/sstrip.c
-endef
-
 define Host/Install
-   $(CP) $(HOST_BUILD_DIR)/sstrip $(STAGING_DIR_HOST)/bin/
+   $(CP) $(HOST_BUILD_DIR)/bin/sstrip $(STAGING_DIR_HOST)/bin/
 endef
 
 define Host/Clean
diff --git a/tools/sstrip/patches/001-disable-elftoc-compilation.patch 
b/tools/sstrip/patches/001-disable-elftoc-compilation.patch
new file mode 100644
index 00..787c51ce5b
--- /dev/null
+++ b/tools/sstrip/patches/001-disable-elftoc-compilation.patch
@@ -0,0 +1,28 @@
+From: Rui Salvaterra 
+Subject: sstrip: don't try to compile elftoc
+
+We only need sstrip itself and elftoc doesn't compile with musl's elf.h, so
+disable the elftoc compilation in the makefile.
+
+Signed-off-by: Rui Salvaterra 
+---
+
+--- a/Makefile
 b/Makefile
+@@ -2,7 +2,7 @@
+ 
+ prefix = /usr/local
+ 
+-PROGRAMS = elfls objres rebind sstrip elftoc ebfc infect
++PROGRAMS = elfls objres rebind sstrip ebfc infect
+ 
+ all: $(PROGRAMS)
+ 
+@@ -19,7 +19,6 @@ elfls: bin/elfls doc/elfls.1
+ objres: bin/objres doc/objres.1
+ rebind: bin/rebind doc/rebind.1
+ sstrip: bin/sstrip doc/sstrip.1
+-elftoc: bin/elftoc doc/elftoc.1
+ ebfc: bin/ebfc doc/ebfc.1
+ infect: bin/infect doc/infect.1
+ 
diff --git a/tools/sstrip/src/sstrip.c b/tools/sstrip/src/sstrip.c
deleted file mode 100644
index 12cf12e095..00
--- a/tools/sstrip/src/sstrip.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/* http://www.muppetlabs.com/~breadbox/software/elfkickers.html */
-
-/* sstrip: Copyright (C) 1999-2001 by Brian Raiter, under the GNU
- * General Public License. No warranty. See COPYING for details.
- *
- * Aug 23, 2004 Hacked by Manuel Novoa III  to
- * handle targets of different endianness and/or elf class, making
- * it more useful in a cross-devel environment.
- */
-
-/* == original README ===
- *
- * sstrip is a small utility that removes the contents at the end of an
- * ELF file that are not part of the program's memory image.
- * 
- * Most ELF executables are built with both a program header table and a
- * section header table. However, only the former is required in order
- * for the OS to lo

[PATCH v3] tools/sstrip: update to latest version

2020-11-25 Thread Rui Salvaterra
Drop our local sstrip copy and use the current ELFKickers upstream version.

Patch the original makefile in order to avoid building elftoc, since it fails
with musl's elf.h. This is fine, since we only need sstrip anyway.

Finally, add the possibility to pass additional arguments to sstrip and pass -z
(remove trailing zeros) by default, which matches the behaviour of the previous
version.

Signed-off-by: Rui Salvaterra 
---
v3: don't change the PKG_NAME.
v2: squshed all changes in a single patch.

 config/Config-build.in|   8 +
 rules.mk  |   2 +-
 tools/sstrip/Makefile |  13 +-
 .../001-disable-elftoc-compilation.patch  |  28 ++
 tools/sstrip/src/sstrip.c | 466 --
 5 files changed, 44 insertions(+), 473 deletions(-)
 create mode 100644 tools/sstrip/patches/001-disable-elftoc-compilation.patch
 delete mode 100644 tools/sstrip/src/sstrip.c

diff --git a/config/Config-build.in b/config/Config-build.in
index bae1552096..a54df11566 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -182,6 +182,14 @@ menu "Global build settings"
help
  Specifies arguments passed to the strip command when 
stripping binaries.
 
+   config SSTRIP_ARGS
+   string
+   prompt "Sstrip arguments"
+   depends on USE_SSTRIP
+   default "-z"
+   help
+ Specifies arguments passed to the sstrip command when 
stripping binaries.
+
config STRIP_KERNEL_EXPORTS
bool "Strip unnecessary exports from the kernel image"
help
diff --git a/rules.mk b/rules.mk
index e416126030..5c1c141c11 100644
--- a/rules.mk
+++ b/rules.mk
@@ -328,7 +328,7 @@ else
 STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS))
   else
 ifneq ($(CONFIG_USE_SSTRIP),)
-  STRIP:=$(STAGING_DIR_HOST)/bin/sstrip
+  STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(call 
qstrip,$(CONFIG_SSTRIP_ARGS))
 endif
   endif
   RSTRIP= \
diff --git a/tools/sstrip/Makefile b/tools/sstrip/Makefile
index bab172a95a..a521963fa5 100644
--- a/tools/sstrip/Makefile
+++ b/tools/sstrip/Makefile
@@ -7,17 +7,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sstrip
-PKG_VERSION:=2.0
+PKG_VERSION:=3.1a
+
+PKG_SOURCE_URL:=https://www.muppetlabs.com/~breadbox/pub/software
+PKG_SOURCE:=ELFkickers-$(PKG_VERSION).tar.gz
+PKG_HASH:=06430880aaf4919c5f99fc629da7000347421668c2cf32bced2d401aac276508
+
 PKG_RELEASE:=1
 
 include $(INCLUDE_DIR)/host-build.mk
 
-define Host/Compile
-   $(HOSTCC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/sstrip 
src/sstrip.c
-endef
-
 define Host/Install
-   $(CP) $(HOST_BUILD_DIR)/sstrip $(STAGING_DIR_HOST)/bin/
+   $(CP) $(HOST_BUILD_DIR)/bin/sstrip $(STAGING_DIR_HOST)/bin/
 endef
 
 define Host/Clean
diff --git a/tools/sstrip/patches/001-disable-elftoc-compilation.patch 
b/tools/sstrip/patches/001-disable-elftoc-compilation.patch
new file mode 100644
index 00..787c51ce5b
--- /dev/null
+++ b/tools/sstrip/patches/001-disable-elftoc-compilation.patch
@@ -0,0 +1,28 @@
+From: Rui Salvaterra 
+Subject: sstrip: don't try to compile elftoc
+
+We only need sstrip itself and elftoc doesn't compile with musl's elf.h, so
+disable the elftoc compilation in the makefile.
+
+Signed-off-by: Rui Salvaterra 
+---
+
+--- a/Makefile
 b/Makefile
+@@ -2,7 +2,7 @@
+ 
+ prefix = /usr/local
+ 
+-PROGRAMS = elfls objres rebind sstrip elftoc ebfc infect
++PROGRAMS = elfls objres rebind sstrip ebfc infect
+ 
+ all: $(PROGRAMS)
+ 
+@@ -19,7 +19,6 @@ elfls: bin/elfls doc/elfls.1
+ objres: bin/objres doc/objres.1
+ rebind: bin/rebind doc/rebind.1
+ sstrip: bin/sstrip doc/sstrip.1
+-elftoc: bin/elftoc doc/elftoc.1
+ ebfc: bin/ebfc doc/ebfc.1
+ infect: bin/infect doc/infect.1
+ 
diff --git a/tools/sstrip/src/sstrip.c b/tools/sstrip/src/sstrip.c
deleted file mode 100644
index 12cf12e095..00
--- a/tools/sstrip/src/sstrip.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/* http://www.muppetlabs.com/~breadbox/software/elfkickers.html */
-
-/* sstrip: Copyright (C) 1999-2001 by Brian Raiter, under the GNU
- * General Public License. No warranty. See COPYING for details.
- *
- * Aug 23, 2004 Hacked by Manuel Novoa III  to
- * handle targets of different endianness and/or elf class, making
- * it more useful in a cross-devel environment.
- */
-
-/* == original README ===
- *
- * sstrip is a small utility that removes the contents at the end of an
- * ELF file that are not part of the program's memory image.
- * 
- * Most ELF executables are built with both a program header table and a
- * section header table. However, only the former is required in order
- * for the OS to load, link and execute a program. sstrip attempts to
- * extract the ELF header, the program header table, and it

[PATCH v4] tools/sstrip: update to latest version

2020-11-25 Thread Rui Salvaterra
Drop our local sstrip copy and use the current ELFKickers upstream version.

Patch the original makefile in order to avoid building elftoc, since it fails
with musl's elf.h. This is fine, since we only need sstrip anyway.

Finally, add the possibility to pass additional arguments to sstrip and pass -z
(remove trailing zeros) by default, which matches the behaviour of the previous
version.

Signed-off-by: Rui Salvaterra 
---
v4: brown paper bag build fix.
v3: don't change the PKG_NAME.
v2: squshed all changes in a single patch.

 config/Config-build.in|   8 +
 rules.mk  |   2 +-
 tools/sstrip/Makefile |  14 +-
 .../001-disable-elftoc-compilation.patch  |  28 ++
 tools/sstrip/src/sstrip.c | 466 --
 5 files changed, 45 insertions(+), 473 deletions(-)
 create mode 100644 tools/sstrip/patches/001-disable-elftoc-compilation.patch
 delete mode 100644 tools/sstrip/src/sstrip.c

diff --git a/config/Config-build.in b/config/Config-build.in
index bae1552096..a54df11566 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -182,6 +182,14 @@ menu "Global build settings"
help
  Specifies arguments passed to the strip command when 
stripping binaries.
 
+   config SSTRIP_ARGS
+   string
+   prompt "Sstrip arguments"
+   depends on USE_SSTRIP
+   default "-z"
+   help
+ Specifies arguments passed to the sstrip command when 
stripping binaries.
+
config STRIP_KERNEL_EXPORTS
bool "Strip unnecessary exports from the kernel image"
help
diff --git a/rules.mk b/rules.mk
index e416126030..5c1c141c11 100644
--- a/rules.mk
+++ b/rules.mk
@@ -328,7 +328,7 @@ else
 STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS))
   else
 ifneq ($(CONFIG_USE_SSTRIP),)
-  STRIP:=$(STAGING_DIR_HOST)/bin/sstrip
+  STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(call 
qstrip,$(CONFIG_SSTRIP_ARGS))
 endif
   endif
   RSTRIP= \
diff --git a/tools/sstrip/Makefile b/tools/sstrip/Makefile
index bab172a95a..b41c46d95c 100644
--- a/tools/sstrip/Makefile
+++ b/tools/sstrip/Makefile
@@ -7,17 +7,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sstrip
-PKG_VERSION:=2.0
+PKG_VERSION:=3.1a
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/ELFkickers-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://www.muppetlabs.com/~breadbox/pub/software
+PKG_SOURCE:=ELFkickers-$(PKG_VERSION).tar.gz
+PKG_HASH:=06430880aaf4919c5f99fc629da7000347421668c2cf32bced2d401aac276508
+
 PKG_RELEASE:=1
 
 include $(INCLUDE_DIR)/host-build.mk
 
-define Host/Compile
-   $(HOSTCC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/sstrip 
src/sstrip.c
-endef
-
 define Host/Install
-   $(CP) $(HOST_BUILD_DIR)/sstrip $(STAGING_DIR_HOST)/bin/
+   $(CP) $(HOST_BUILD_DIR)/bin/sstrip $(STAGING_DIR_HOST)/bin/
 endef
 
 define Host/Clean
diff --git a/tools/sstrip/patches/001-disable-elftoc-compilation.patch 
b/tools/sstrip/patches/001-disable-elftoc-compilation.patch
new file mode 100644
index 00..787c51ce5b
--- /dev/null
+++ b/tools/sstrip/patches/001-disable-elftoc-compilation.patch
@@ -0,0 +1,28 @@
+From: Rui Salvaterra 
+Subject: sstrip: don't try to compile elftoc
+
+We only need sstrip itself and elftoc doesn't compile with musl's elf.h, so
+disable the elftoc compilation in the makefile.
+
+Signed-off-by: Rui Salvaterra 
+---
+
+--- a/Makefile
 b/Makefile
+@@ -2,7 +2,7 @@
+ 
+ prefix = /usr/local
+ 
+-PROGRAMS = elfls objres rebind sstrip elftoc ebfc infect
++PROGRAMS = elfls objres rebind sstrip ebfc infect
+ 
+ all: $(PROGRAMS)
+ 
+@@ -19,7 +19,6 @@ elfls: bin/elfls doc/elfls.1
+ objres: bin/objres doc/objres.1
+ rebind: bin/rebind doc/rebind.1
+ sstrip: bin/sstrip doc/sstrip.1
+-elftoc: bin/elftoc doc/elftoc.1
+ ebfc: bin/ebfc doc/ebfc.1
+ infect: bin/infect doc/infect.1
+ 
diff --git a/tools/sstrip/src/sstrip.c b/tools/sstrip/src/sstrip.c
deleted file mode 100644
index 12cf12e095..00
--- a/tools/sstrip/src/sstrip.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/* http://www.muppetlabs.com/~breadbox/software/elfkickers.html */
-
-/* sstrip: Copyright (C) 1999-2001 by Brian Raiter, under the GNU
- * General Public License. No warranty. See COPYING for details.
- *
- * Aug 23, 2004 Hacked by Manuel Novoa III  to
- * handle targets of different endianness and/or elf class, making
- * it more useful in a cross-devel environment.
- */
-
-/* == original README ===
- *
- * sstrip is a small utility that removes the contents at the end of an
- * ELF file that are not part of the program's memory image.
- * 
- * Most ELF executables are built with both a program header table and a
- * section header table. However, only the former is required in order
- * for the OS to load, link and execute

[PATCH] hostapd: enable airtime policy for the -basic variants

2020-11-25 Thread Rui Salvaterra
Airtime policy configuration is extremely useful in multiple BSS scenarios.
Since nowadays most people configure both private and guest networks (at
least), it makes sense to enable it by default, except for the most limited
of the variants.

Size of the hostapd-basic-openssl binary (mipsel 24Kc -O2):
543944 bytes (airtime policy disabled)
548040 bytes (airtime policy enabled)

Signed-off-by: Rui Salvaterra 
---
The -mesh variants are basically -full with extra mesh functionality, so they
already have airtime policy enabled by default.

 package/network/services/hostapd/files/hostapd-basic.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd-basic.config 
b/package/network/services/hostapd/files/hostapd-basic.config
index 947e2fa200..33c38192b1 100644
--- a/package/network/services/hostapd/files/hostapd-basic.config
+++ b/package/network/services/hostapd/files/hostapd-basic.config
@@ -384,7 +384,7 @@ CONFIG_TLS=internal
 #CONFIG_OWE=y
 
 # Airtime policy support
-#CONFIG_AIRTIME_POLICY=y
+CONFIG_AIRTIME_POLICY=y
 
 # Override default value for the wpa_disable_eapol_key_retries configuration
 # parameter. See that parameter in hostapd.conf for more details.
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] hostapd: enable airtime policy for the -basic variants

2020-11-28 Thread Rui Salvaterra
Hi, Daniel,

On Fri, 27 Nov 2020 at 22:31, Daniel Golle  wrote:
>
> On Wed, Nov 25, 2020 at 11:03:48PM +0000, Rui Salvaterra wrote:
> > Airtime policy configuration is extremely useful in multiple BSS scenarios.
> > Since nowadays most people configure both private and guest networks (at
> > least), it makes sense to enable it by default, except for the most limited
> > of the variants.
> >
> > Size of the hostapd-basic-openssl binary (mipsel 24Kc -O2):
> > 543944 bytes (airtime policy disabled)
> > 548040 bytes (airtime policy enabled)
> >
> > Signed-off-by: Rui Salvaterra 
> Acked-by: Daniel Golle 
>
> Are there any new UCI options to be added to make use of this?

They were added recently:
https://git.openwrt.org/?p=openwrt%2Fopenwrt.git&a=search&h=HEAD&st=commit&s=airtime+policy

However, I've been playing with them and I still wasn't able to see a
change in station airtime weight, in either of the three modes. I've
only tested mt76 hardware yet, but I'll soon test ath9k and ath10k.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ramips/mt7621: refresh the kernel config

2020-12-02 Thread Rui Salvaterra
The removed config symbols are already enabled by the generic kernel
configuration (or by default), while the added ones are forcefully enabled by
the specific architecture.

Signed-off-by: Rui Salvaterra 
---
Trivial make kernel_oldconfig CONFIG_TARGET=subtarget.

 target/linux/ramips/mt7621/config-5.4 | 54 ++-
 1 file changed, 4 insertions(+), 50 deletions(-)

diff --git a/target/linux/ramips/mt7621/config-5.4 
b/target/linux/ramips/mt7621/config-5.4
index b4c8ab1f1c..eaef2e40d1 100644
--- a/target/linux/ramips/mt7621/config-5.4
+++ b/target/linux/ramips/mt7621/config-5.4
@@ -1,24 +1,9 @@
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
-CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN=y
-CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y
-CONFIG_ARCH_HAS_DMA_WRITE_COMBINE=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-CONFIG_ARCH_HAS_RESET_CONTROLLER=y
-CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y
-CONFIG_ARCH_HAS_TICK_BROADCAST=y
-CONFIG_ARCH_HAS_UNCACHED_SEGMENT=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_MMAP_RND_BITS_MAX=15
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
-CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_MEMREMAP_PROT=y
-CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
-CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
-CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_AT803X_PHY=y
 CONFIG_BLK_MQ_PCI=y
 CONFIG_BOARD_SCACHE=y
@@ -65,6 +50,7 @@ CONFIG_CRYPTO_NULL2=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CSRC_R4K=y
 CONFIG_DEBUG_PINCTRL=y
+CONFIG_DIMLIB=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DMA_NONCOHERENT_CACHE_SYNC=y
 # CONFIG_DMA_RALINK is not set
@@ -108,46 +94,12 @@ CONFIG_GPIO_MT7621=y
 # CONFIG_GPIO_RALINK is not set
 CONFIG_GPIO_WATCHDOG=y
 # CONFIG_GPIO_WATCHDOG_ARCH_INITCALL is not set
+CONFIG_GRO_CELLS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDWARE_WATCHPOINTS=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
-CONFIG_HAVE_ARCH_COMPILER_H=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_ASM_MODVERSIONS=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_COPY_THREAD_TLS=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FAST_GUP=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_GENERIC_VDSO=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IOREMAP_PROT=y
-CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KVM=y
-CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
-CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PCI=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_RSEQ=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
 CONFIG_HIGHMEM=y
 CONFIG_HZ=250
 CONFIG_HZ_250=y
@@ -177,6 +129,7 @@ CONFIG_MIKROTIK_RB_SYSFS=y
 CONFIG_MIPS=y
 CONFIG_MIPS_ASID_BITS=8
 CONFIG_MIPS_ASID_SHIFT=0
+CONFIG_MIPS_CBPF_JIT=y
 CONFIG_MIPS_CLOCK_VSYSCALL=y
 CONFIG_MIPS_CM=y
 # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
@@ -316,6 +269,7 @@ CONFIG_SYS_SUPPORTS_MIPS_CPS=y
 CONFIG_SYS_SUPPORTS_MULTITHREADING=y
 CONFIG_SYS_SUPPORTS_SCHED_SMT=y
 CONFIG_SYS_SUPPORTS_SMP=y
+CONFIG_SYS_SUPPORTS_ZBOOT=y
 CONFIG_TARGET_ISA_REV=2
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TIMER_OF=y
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] ramips/mt7621: refresh the kernel config

2020-12-02 Thread Rui Salvaterra
Hey, guys,

On Wed, 2 Dec 2020 at 19:12, Adrian Schmutzler  wrote:
>
> > -Original Message-
> > From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org]
> > On Behalf Of Felix Fietkau
> > Sent: Mittwoch, 2. Dezember 2020 19:46
> > To: Adrian Schmutzler ; 'Rui Salvaterra'
> > ; openwrt-devel@lists.openwrt.org
> > Subject: Re: [PATCH] ramips/mt7621: refresh the kernel config
> >
> > That's just an artifact to keep it in kconfig.pl syntax (since that's 
> > what's being
> > used to filter). The value of the symbols is irrelevant, symbols matching 
> > the
> > name will be filtered.
>
> Okay, thanks. So, this is essentially a misunderstanding from my side then, 
> as the new concept is not really explained in detail ;-)
>
> I will set the patch from Rui back to "New" then, as it's technically not 
> wrong, but I was misled in my judgement.

I did a simple test, built an image with/without my refreshed config,
and the resulting kernel .configs had absolutely no differences, as
expected. My Redmi AC2100 also never had any problems (I've had this
patch in my tree for almost two weeks now).

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] kernel/kmod-lib-lzo: include the lzo-rle kmod in the package

2020-12-10 Thread Rui Salvaterra
Albeit a separate crypto module, lzo-rle uses the same kernel library as lzo.
Crypto API users (zram, for example) expect both lzo and lzo-rle to be
available, so let's include lzo-rle (about 5.5 kiB) in the lib-lzo package.

Based on e9hack's original patch: 
https://patchwork.ozlabs.org/project/openwrt/patch/541cbfbd-76f2-59b3-a867-47b6f0fc7...@gmail.com/

Signed-off-by: Rui Salvaterra 
---

Sven, I read your original reply [1], but I don't think a less than 6 kiB
difference is worth the violation of the principle of least surprise. Besides,
at least for the zram use case, we'll soon be able to rely on a single
compression algorithm, without a hard dependency on lzo [2] (zstd being the
obvious candidate). Thoughts?

[1] https://lists.openwrt.org/pipermail/openwrt-devel/2020-September/031434.html
[2] 
https://lore.kernel.org/linux-block/20201207121245.50529-1-rsalvate...@gmail.com/

 package/kernel/linux/modules/lib.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/lib.mk 
b/package/kernel/linux/modules/lib.mk
index 9a341932bd..8dba905f50 100644
--- a/package/kernel/linux/modules/lib.mk
+++ b/package/kernel/linux/modules/lib.mk
@@ -109,9 +109,10 @@ define KernelPackage/lib-lzo
   HIDDEN:=1
   FILES:= \
$(LINUX_DIR)/crypto/lzo.ko \
+   $(LINUX_DIR)/crypto/lzo-rle.ko \
$(LINUX_DIR)/lib/lzo/lzo_compress.ko \
$(LINUX_DIR)/lib/lzo/lzo_decompress.ko
-  AUTOLOAD:=$(call AutoProbe,lzo lzo_compress lzo_decompress)
+  AUTOLOAD:=$(call AutoProbe,lzo lzo-rle lzo_compress lzo_decompress)
 endef
 
 define KernelPackage/lib-lzo/description
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] utils: simplify mkdir_p boolean conditions

2020-12-13 Thread Rui Salvaterra
Just a trivial simplification.

Signed-off-by: Rui Salvaterra 
---
 utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils.c b/utils.c
index db63238..82af887 100644
--- a/utils.c
+++ b/utils.c
@@ -164,7 +164,7 @@ int mkdir_p(char *dir, mode_t mask)
int ret;
 
ret = mkdir(dir, mask);
-   if (!ret || (ret && errno == EEXIST))
+   if (!ret || errno == EEXIST)
return 0;
 
if (ret && (errno != ENOENT))
@@ -182,7 +182,7 @@ int mkdir_p(char *dir, mode_t mask)
*l = '/';
 
ret = mkdir(dir, mask);
-   if (!ret || (ret && errno == EEXIST))
+   if (!ret || errno == EEXIST)
return 0;
else
return -1;
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v3 3/3] dropbear: create a submenu for key exchange algorithms

2020-12-15 Thread Rui Salvaterra
Hi,

Please, always use "reply to all", in order to copy the mailing list on replies.

On Tue, 15 Dec 2020 at 01:49, Patrick Kent  wrote:
>
> These patches have been outdate.
> Can you please update them for latest development openwrt.
> Thanks. Regards.

The general consensus seems to be that this patch series makes the
configuration too complex. I'll rebase and resend, but I'm not
expecting it to be applied.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v4 0/3] dropbear: overhaul the crypto algorithm selection

2020-12-15 Thread Rui Salvaterra
This patch series enables a much more fine-grained configuration of the public
key, encryption and key exchange algorithms in Dropbear.

v4: rebase against current master.
v3: rebase against current master.
v2: correct file permissions.

Rui Salvaterra (3):
  dropbear: create a submenu for public key algorithms
  dropbear: create a submenu for encryption algorithms
  dropbear: create a submenu for key exchange algorithms

 package/network/services/dropbear/Config.in   | 65 +--
 package/network/services/dropbear/Makefile| 28 ++--
 .../dropbear/files/dropbear.failsafe.ecc  |  8 +++
 .../dropbear/files/dropbear.failsafe.ed25519  |  8 +++
 ...ropbear.failsafe => dropbear.failsafe.rsa} |  0
 ...nkey-fix-use-of-rsa-sha2-256-pubkeys.patch | 12 +++-
 6 files changed, 105 insertions(+), 16 deletions(-)
 create mode 100644 
package/network/services/dropbear/files/dropbear.failsafe.ecc
 create mode 100644 
package/network/services/dropbear/files/dropbear.failsafe.ed25519
 rename package/network/services/dropbear/files/{dropbear.failsafe => 
dropbear.failsafe.rsa} (100%)
 mode change 100755 => 100644

-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v4 1/3] dropbear: create a submenu for public key algorithms

2020-12-15 Thread Rui Salvaterra
This allows the user to select only the public key algorithms (s)he requires
(e.g., disabling RSA and keeping only Ed25519). The default selection maintains
the current functionality.

Additionally, make sure at least one public key algorithm is selected, lest the
build would fail.

Dropbear executable sizes (ath79, -O2):

RSA + Ed25519:  210101 bytes
RSA only:   197765 bytes
Ed25519 only:   189637 bytes

Signed-off-by: Rui Salvaterra 
---
 package/network/services/dropbear/Config.in   | 27 ++-
 package/network/services/dropbear/Makefile| 23 +++-
 .../dropbear/files/dropbear.failsafe.ecc  |  8 ++
 .../dropbear/files/dropbear.failsafe.ed25519  |  8 ++
 ...ropbear.failsafe => dropbear.failsafe.rsa} |  0
 ...nkey-fix-use-of-rsa-sha2-256-pubkeys.patch | 12 ++---
 6 files changed, 62 insertions(+), 16 deletions(-)
 create mode 100644 
package/network/services/dropbear/files/dropbear.failsafe.ecc
 create mode 100644 
package/network/services/dropbear/files/dropbear.failsafe.ed25519
 rename package/network/services/dropbear/files/{dropbear.failsafe => 
dropbear.failsafe.rsa} (100%)
 mode change 100755 => 100644

diff --git a/package/network/services/dropbear/Config.in 
b/package/network/services/dropbear/Config.in
index 15000eff53..5b7be04ade 100644
--- a/package/network/services/dropbear/Config.in
+++ b/package/network/services/dropbear/Config.in
@@ -1,14 +1,13 @@
 menu "Configuration"
depends on PACKAGE_dropbear
 
-config DROPBEAR_CURVE25519
-   bool "Curve25519 support"
+menu "Public key algorithm selection"
+
+config DROPBEAR_RSA
+   bool "RSA support"
default y
help
-   This enables the following key exchange algorithm:
- curve25519-sha...@libssh.org
-
-   Increases binary size by about 4 kB (MIPS).
+   Enable support for the RSA public key algorithm.
 
 config DROPBEAR_ECC
bool "Elliptic curve cryptography (ECC)"
@@ -58,6 +57,13 @@ config DROPBEAR_ED25519
 
Increases binary size by about 12 kB (MIPS).
 
+config DROPBEAR_AUTOSEL_PK
+   def_bool y
+   depends on !(DROPBEAR_ECC || DROPBEAR_ED25519)
+   select DROPBEAR_RSA
+
+endmenu
+
 config DROPBEAR_CHACHA20POLY1305
bool "Chacha20-Poly1305 support"
default y
@@ -67,6 +73,15 @@ config DROPBEAR_CHACHA20POLY1305
 
Increases binary size by about 4 kB (MIPS).
 
+config DROPBEAR_CURVE25519
+   bool "Curve25519 support"
+   default y
+   help
+   This enables the following key exchange algorithm:
+ curve25519-sha...@libssh.org
+
+   Increases binary size by about 4 kB (MIPS).
+
 config DROPBEAR_ZLIB
bool "Enable compression"
default n
diff --git a/package/network/services/dropbear/Makefile 
b/package/network/services/dropbear/Makefile
index 8bbb26f829..d0b6a4b7ea 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -32,7 +32,8 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \
CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_CHACHA20POLY1305 \
CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE \
-   CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP CONFIG_DROPBEAR_ASKPASS
+   CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP CONFIG_DROPBEAR_ASKPASS \
+   CONFIG_DROPBEAR_RSA
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -67,9 +68,9 @@ define Package/dropbear/description
 endef
 
 define Package/dropbear/conffiles
+$(if $(CONFIG_DROPBEAR_RSA),/etc/dropbear/dropbear_rsa_host_key)
 $(if $(CONFIG_DROPBEAR_ED25519),/etc/dropbear/dropbear_ed25519_host_key)
 $(if $(CONFIG_DROPBEAR_ECC),/etc/dropbear/dropbear_ecdsa_host_key)
-/etc/dropbear/dropbear_rsa_host_key
 /etc/config/dropbear
 endef
 
@@ -137,7 +138,7 @@ DB_OPT_CONFIG = \
!!DROPBEAR_ECC_384|CONFIG_DROPBEAR_ECC_FULL|1|0 \
!!DROPBEAR_ECC_521|CONFIG_DROPBEAR_ECC_FULL|1|0 \
DROPBEAR_CLI_ASKPASS_HELPER|CONFIG_DROPBEAR_ASKPASS|1|0 \
-
+   DROPBEAR_RSA|CONFIG_DROPBEAR_RSA|1|0 \
 
 TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections -flto
 TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver
@@ -199,10 +200,18 @@ define Package/dropbear/install
$(INSTALL_DIR) $(1)/usr/lib/opkg/info
$(INSTALL_DIR) $(1)/etc/dropbear
$(INSTALL_DIR) $(1)/lib/preinit
-   $(INSTALL_DATA) ./files/dropbear.failsafe 
$(1)/lib/preinit/99_10_failsafe_dropbear
-   $(if $(CONFIG_DROPBEAR_ED25519),touch 
$(1)/etc/dropbear/dropbear_ed25519_host_key)
-   $(if $(CONFIG_DROPBEAR_ECC),touch 
$(1)/etc/dropbear/dropbear_ecdsa_host_key)
-   touch $(1)/etc/dropbear/dropbear_rsa_host_key
+
+ifdef CONFIG_DROPBEAR_ED25519
+   $(INSTALL_DATA) ./files/dropbear.failsafe.ed25519 
$(1)/lib/preinit/99_10_failsafe_dropbear
+

[PATCH v4 3/3] dropbear: create a submenu for key exchange algorithms

2020-12-15 Thread Rui Salvaterra
This allows the user to select only the key exchange algorithms (s)he requires
(e.g., disabling group 14 SHA-{1,256} and keeping only Curve25519). The default
selection maintains the current functionality.

Additionally, make sure at least one key exchange algorithm is selected, lest
the build would fail.

Signed-off-by: Rui Salvaterra 
---
 package/network/services/dropbear/Config.in | 17 +
 package/network/services/dropbear/Makefile  |  7 +--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/package/network/services/dropbear/Config.in 
b/package/network/services/dropbear/Config.in
index 6d2b4cdfae..b0ad21f907 100644
--- a/package/network/services/dropbear/Config.in
+++ b/package/network/services/dropbear/Config.in
@@ -94,6 +94,16 @@ config DROPBEAR_AUTOSEL_EA
 
 endmenu
 
+menu "Key exchange algorithm selection"
+
+config DROPBEAR_DH_GROUP14_SHA1
+   bool "Group 14 SHA-1"
+   default y
+
+config DROPBEAR_DH_GROUP14_SHA256
+   bool "Group 14 SHA-256"
+   default y
+
 config DROPBEAR_CURVE25519
bool "Curve25519 support"
default y
@@ -103,6 +113,13 @@ config DROPBEAR_CURVE25519
 
Increases binary size by about 4 kB (MIPS).
 
+config DROPBEAR_AUTOSEL_KEX
+   def_bool y
+   depends on !(DROPBEAR_DH_GROUP14_SHA1 || DROPBEAR_CURVE25519)
+   select DROPBEAR_DH_GROUP14_SHA256
+
+endmenu
+
 config DROPBEAR_ZLIB
bool "Enable compression"
default n
diff --git a/package/network/services/dropbear/Makefile 
b/package/network/services/dropbear/Makefile
index 1d131455a2..7a6cc96f94 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -33,7 +33,8 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_CHACHA20POLY1305 \
CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE \
CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP CONFIG_DROPBEAR_ASKPASS \
-   CONFIG_DROPBEAR_RSA CONFIG_DROPBEAR_AES128 CONFIG_DROPBEAR_AES256
+   CONFIG_DROPBEAR_RSA CONFIG_DROPBEAR_AES128 CONFIG_DROPBEAR_AES256 \
+   DROPBEAR_DH_GROUP14_SHA1 DROPBEAR_DH_GROUP14_SHA256
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -140,7 +141,9 @@ DB_OPT_CONFIG = \
DROPBEAR_CLI_ASKPASS_HELPER|CONFIG_DROPBEAR_ASKPASS|1|0 \
DROPBEAR_RSA|CONFIG_DROPBEAR_RSA|1|0 \
DROPBEAR_AES128|CONFIG_DROPBEAR_AES128|1|0 \
-   DROPBEAR_AES256|CONFIG_DROPBEAR_AES256|1|0
+   DROPBEAR_AES256|CONFIG_DROPBEAR_AES256|1|0 \
+   DROPBEAR_DH_GROUP14_SHA1|CONFIG_DROPBEAR_DH_GROUP14_SHA1|1|0 \
+   DROPBEAR_DH_GROUP14_SHA256|CONFIG_DROPBEAR_DH_GROUP14_SHA256|1|0
 
 TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections -flto
 TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v4 2/3] dropbear: create a submenu for encryption algorithms

2020-12-15 Thread Rui Salvaterra
This allows the user to select only the encryption algorithms (s)he requires
(e.g., disabling AES and keeping only ChaCha20-Poly1305). The default selection
maintains the current functionality.

Additionally, make sure at least one encryption algorithm is selected, lest the
build would fail.

Signed-off-by: Rui Salvaterra 
---
 package/network/services/dropbear/Config.in | 21 +
 package/network/services/dropbear/Makefile  |  4 +++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/package/network/services/dropbear/Config.in 
b/package/network/services/dropbear/Config.in
index 5b7be04ade..6d2b4cdfae 100644
--- a/package/network/services/dropbear/Config.in
+++ b/package/network/services/dropbear/Config.in
@@ -64,6 +64,20 @@ config DROPBEAR_AUTOSEL_PK
 
 endmenu
 
+menu "Encryption algorithm selection"
+
+config DROPBEAR_AES128
+   bool "AES-128 support"
+   default y
+   help
+   This enables support for the 128-bit AES cipher
+
+config DROPBEAR_AES256
+   bool "AES-256 support"
+   default y
+   help
+   This enables support for the 256-bit AES cipher
+
 config DROPBEAR_CHACHA20POLY1305
bool "Chacha20-Poly1305 support"
default y
@@ -73,6 +87,13 @@ config DROPBEAR_CHACHA20POLY1305
 
Increases binary size by about 4 kB (MIPS).
 
+config DROPBEAR_AUTOSEL_EA
+   def_bool y
+   depends on !(DROPBEAR_AES256 || DROPBEAR_CHACHA20POLY1305)
+   select DROPBEAR_AES128
+
+endmenu
+
 config DROPBEAR_CURVE25519
bool "Curve25519 support"
default y
diff --git a/package/network/services/dropbear/Makefile 
b/package/network/services/dropbear/Makefile
index d0b6a4b7ea..1d131455a2 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -33,7 +33,7 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_CHACHA20POLY1305 \
CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE \
CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP CONFIG_DROPBEAR_ASKPASS \
-   CONFIG_DROPBEAR_RSA
+   CONFIG_DROPBEAR_RSA CONFIG_DROPBEAR_AES128 CONFIG_DROPBEAR_AES256
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -139,6 +139,8 @@ DB_OPT_CONFIG = \
!!DROPBEAR_ECC_521|CONFIG_DROPBEAR_ECC_FULL|1|0 \
DROPBEAR_CLI_ASKPASS_HELPER|CONFIG_DROPBEAR_ASKPASS|1|0 \
DROPBEAR_RSA|CONFIG_DROPBEAR_RSA|1|0 \
+   DROPBEAR_AES128|CONFIG_DROPBEAR_AES128|1|0 \
+   DROPBEAR_AES256|CONFIG_DROPBEAR_AES256|1|0
 
 TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections -flto
 TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver
-- 
2.29.2


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 0/2] kernel/udptunnel: clean up the dependency awkwardness

2020-12-23 Thread Rui Salvaterra
This trivial series makes the kernel UDP tunnel a visible selection and drops
the VXLAN dependency from the udptunnel{4,6} packages, reducing the size of a
monolithic (no modules) by about 15 kiB.

Rui Salvaterra (2):
  kernel/hack-5.4: make UDP tunneling user-selectable
  kernel/modules: remove fake users from udptunnel{4,6} modules

 package/kernel/linux/modules/netsupport.mk|  8 ++--
 .../generic/hack-5.4/249-udp-tunnel-selection.patch   | 11 +++
 2 files changed, 13 insertions(+), 6 deletions(-)
 create mode 100644 target/linux/generic/hack-5.4/249-udp-tunnel-selection.patch

-- 
2.30.0.rc1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/2] kernel/modules: remove fake users from udptunnel{4,6}

2020-12-23 Thread Rui Salvaterra
Since we're now able to select CONFIG_NET_UDP_TUNNEL at will, drop the fake
dependencies.

This is a partial revert of commit d7e040f8bccec06b64c82963be6435101423dbf1
"kernel: add fake users for udptunnel and iptunnel modules".

Signed-off-by: Rui Salvaterra 
---
 package/kernel/linux/modules/netsupport.mk | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/package/kernel/linux/modules/netsupport.mk 
b/package/kernel/linux/modules/netsupport.mk
index 0c68b394d1..7b8605175e 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -60,9 +60,7 @@ $(eval $(call KernelPackage,bonding))
 define KernelPackage/udptunnel4
   SUBMENU:=$(NETWORK_SUPPORT_MENU)
   TITLE:=IPv4 UDP tunneling support
-  KCONFIG:= \
-   CONFIG_NET_UDP_TUNNEL \
-   CONFIG_VXLAN=m
+  KCONFIG:=CONFIG_NET_UDP_TUNNEL
   HIDDEN:=1
   FILES:=$(LINUX_DIR)/net/ipv4/udp_tunnel.ko
   AUTOLOAD:=$(call AutoLoad,32,udp_tunnel)
@@ -75,9 +73,7 @@ define KernelPackage/udptunnel6
   SUBMENU:=$(NETWORK_SUPPORT_MENU)
   TITLE:=IPv6 UDP tunneling support
   DEPENDS:=@IPV6
-  KCONFIG:= \
-   CONFIG_NET_UDP_TUNNEL \
-   CONFIG_VXLAN=m
+  KCONFIG:=CONFIG_NET_UDP_TUNNEL
   HIDDEN:=1
   FILES:=$(LINUX_DIR)/net/ipv6/ip6_udp_tunnel.ko
   AUTOLOAD:=$(call AutoLoad,32,ip6_udp_tunnel)
-- 
2.30.0.rc1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/2] kernel/hack-5.4: make UDP tunneling user-selectable

2020-12-23 Thread Rui Salvaterra
UDP tunneling support isn't user-selectable, but it's required by WireGuard
which is, for the time being, an out-of-tree module. We currently work around
this issue by selecting an unrelated module which depends on UDP tunnelling
(VXLAN). This is inconvenient, as it implies this unrelated module needs to be
built-in when doing a monolithic build.

Fix this inconvenience by making UDP tunneling user-selectable in the kernel
configuration.

Signed-off-by: Rui Salvaterra 
---
 .../generic/hack-5.4/249-udp-tunnel-selection.patch   | 11 +++
 1 file changed, 11 insertions(+)
 create mode 100644 target/linux/generic/hack-5.4/249-udp-tunnel-selection.patch

diff --git a/target/linux/generic/hack-5.4/249-udp-tunnel-selection.patch 
b/target/linux/generic/hack-5.4/249-udp-tunnel-selection.patch
new file mode 100644
index 00..2c74298dfe
--- /dev/null
+++ b/target/linux/generic/hack-5.4/249-udp-tunnel-selection.patch
@@ -0,0 +1,11 @@
+--- a/net/ipv4/Kconfig
 b/net/ipv4/Kconfig
+@@ -315,7 +315,7 @@ config NET_IPVTI
+ on top.
+ 
+ config NET_UDP_TUNNEL
+-  tristate
++  tristate "IP: UDP tunneling support"
+   select NET_IP_TUNNEL
+   default n
+ 
-- 
2.30.0.rc1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] kernel-build: fix STRIP_KERNEL_EXPORTS for 64-bit kernels

2020-12-30 Thread Rui Salvaterra
While parsing the nm output, we need to account for the fact that 64-bit kernels
have 64-bit wide addresses. While at it, replace the grep | sed combo with a
single awk invocation and a stronger regex.

Fixes: 2ef0acc5fcda557fa5aaad35d27cb8cf75be96d2 "kernel-build: fix
STRIP_KERNEL_EXPORTS for recent kernels"

Signed-off-by: Rui Salvaterra 
---
 include/kernel-build.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 22f7c4c7c7..6123c9d456 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -105,7 +105,7 @@ define BuildKernel
xargs $(TARGET_CROSS)nm | \
awk '1 == "U" { print 2 } ' | \
sort -u > $(KERNEL_BUILD_DIR)/mod_symtab.txt
-   $(TARGET_CROSS)nm -n $(LINUX_DIR)/vmlinux.o | grep ' [rR] __ksymtab' | 
sed -e 's, [rR] __ksymtab_,,' > $(KERNEL_BUILD_DIR)/kernel_symtab.txt
+   $(TARGET_CROSS)nm -n $(LINUX_DIR)/vmlinux.o | awk '/^[0-9a-f]+ [rR] 
__ksymtab_/ {print substr(3,11)}' > $(KERNEL_BUILD_DIR)/kernel_symtab.txt
grep -Ff $(KERNEL_BUILD_DIR)/mod_symtab.txt 
$(KERNEL_BUILD_DIR)/kernel_symtab.txt > $(KERNEL_BUILD_DIR)/sym_include.txt
grep -Fvf $(KERNEL_BUILD_DIR)/mod_symtab.txt 
$(KERNEL_BUILD_DIR)/kernel_symtab.txt > $(KERNEL_BUILD_DIR)/sym_exclude.txt
( \
-- 
2.30.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] kernel-build: fix STRIP_KERNEL_EXPORTS for 64-bit kernels

2020-12-31 Thread Rui Salvaterra
Hi, Hauke,

On Thu, 31 Dec 2020 at 19:07, Hauke Mehrtens  wrote:
>
> Hi,
>
> On the ipq40xx target the results of both commands are different. The
> original command removed the __ksymtab_ prefix, you do not remove it.
>
> Original result:
> 
> hauke@hauke-t480:~/openwrt/openwrt$
> ./staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/bin/arm-openwrt-linux-nm
> -n
> build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/linux-5.4.85/vmlinux.o
> | grep ' [rR] __ksymtab' | sed -e 's, [rR] __ksymtab_,,'  |sort
> |head -5
> __ablkcipher_walk_complete
> ablkcipher_walk_done
> ablkcipher_walk_phys
> abort
> abort_creds
> 
>
> Result with your change:
> 
> hauke@hauke-t480:~/openwrt/openwrt$
> ./staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/bin/arm-openwrt-linux-nm
> -n
> build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/linux-5.4.85/vmlinux.o
> | awk '/^[0-9a-f]+ [rR] __ksymtab_/ {print substr(3,11)}' |sort |head -5
>   __ksymtab___ablkcipher_walk_complete
>   __ksymtab_ablkcipher_walk_done
>   __ksymtab_ablkcipher_walk_phys
>   __ksymtab_abort
>   __ksymtab_abort_creds
> 

Hm… strange. The substr should have taken care of it, I wonder what I've missed.
Anyway, thanks for the heads-up, I'm going to fix and respin.

> I build the kernel with this configuration:
>
> hauke@hauke-t480:~/openwrt/openwrt$ ./scripts/diffconfig.sh
> CONFIG_TARGET_ipq40xx=y
> CONFIG_TARGET_ipq40xx_generic=y
> CONFIG_TARGET_ipq40xx_generic_DEVICE_avm_fritzbox-7530=y
> hauke@hauke-t480:~/openwrt/openwrt$

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] kernel-build: fix STRIP_KERNEL_EXPORTS for 64-bit kernels

2020-12-31 Thread Rui Salvaterra
Hi again,

On Thu, 31 Dec 2020 at 19:30, Rui Salvaterra  wrote:
>
> On Thu, 31 Dec 2020 at 19:07, Hauke Mehrtens  wrote:
> >
> > Result with your change:
> > 
> > hauke@hauke-t480:~/openwrt/openwrt$
> > ./staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi/bin/arm-openwrt-linux-nm
> > -n
> > build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx_generic/linux-5.4.85/vmlinux.o
> > | awk '/^[0-9a-f]+ [rR] __ksymtab_/ {print substr(3,11)}' |sort |head -5
> >   __ksymtab___ablkcipher_walk_complete
> >   __ksymtab_ablkcipher_walk_done
> >   __ksymtab_ablkcipher_walk_phys
> >   __ksymtab_abort
> >   __ksymtab_abort_creds
> > 
>
> Hm… strange. The substr should have taken care of it, I wonder what I've 
> missed.
> Anyway, thanks for the heads-up, I'm going to fix and respin.

Ok, I see the problem. You're executing it in the terminal and not
removing the makefile escaping from the awk script. Try $3 instead of
3.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] kernel/pending-5.4: enable DCDE for x86(-64)

2021-01-02 Thread Rui Salvaterra
Port and adapt Nick Piggin's original patch [1]. This enables dead code and
data elimination at linking time (gc-sections) on x86(-64).

openwrt-x86-64-generic-kernel.bin size, with my config:

Before: 3138048 bytes
After:  2937344 bytes

In other words, we save about 100 kB.

[1] https://lore.kernel.org/lkml/20170709031333.29443-1-npig...@gmail.com/

Signed-off-by: Rui Salvaterra 
---
 ...nable-dead-code-and-data-elimination.patch | 127 ++
 1 file changed, 127 insertions(+)
 create mode 100644 
target/linux/generic/pending-5.4/350-x86-enable-dead-code-and-data-elimination.patch

diff --git 
a/target/linux/generic/pending-5.4/350-x86-enable-dead-code-and-data-elimination.patch
 
b/target/linux/generic/pending-5.4/350-x86-enable-dead-code-and-data-elimination.patch
new file mode 100644
index 00..392ddd71ce
--- /dev/null
+++ 
b/target/linux/generic/pending-5.4/350-x86-enable-dead-code-and-data-elimination.patch
@@ -0,0 +1,127 @@
+From f08a0e4e59f92b4a88501653761cbca08935b9b6 Mon Sep 17 00:00:00 2001
+From: Rui Salvaterra 
+Date: Wed, 4 Nov 2020 19:45:04 +
+Subject: [PATCH] x86: enable dead code and data elimination
+
+Adapt Nick Piggin's original patch [1]. This saves nearly 300 kiB on the final
+vmlinuz (zstd-compressed).
+
+[1] https://lore.kernel.org/lkml/20170709031333.29443-1-npig...@gmail.com/
+
+Signed-off-by: Rui Salvaterra 
+---
+ arch/x86/Kconfig  |  1 +
+ arch/x86/kernel/vmlinux.lds.S | 24 
+ 2 files changed, 13 insertions(+), 12 deletions(-)
+
+--- a/arch/x86/Kconfig
 b/arch/x86/Kconfig
+@@ -184,6 +184,7 @@ config X86
+   select HAVE_FUNCTION_ERROR_INJECTION
+   select HAVE_KRETPROBES
+   select HAVE_KVM
++  select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
+   select HAVE_LIVEPATCH   if X86_64
+   select HAVE_MEMBLOCK_NODE_MAP
+   select HAVE_MIXED_BREAKPOINTS_REGS
+--- a/arch/x86/kernel/vmlinux.lds.S
 b/arch/x86/kernel/vmlinux.lds.S
+@@ -242,14 +242,14 @@ SECTIONS
+* See static_cpu_has() for an example.
+*/
+   .altinstr_aux : AT(ADDR(.altinstr_aux) - LOAD_OFFSET) {
+-  *(.altinstr_aux)
++  KEEP(*(.altinstr_aux))
+   }
+ 
+   INIT_DATA_SECTION(16)
+ 
+   .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
+   __x86_cpu_dev_start = .;
+-  *(.x86_cpu_dev.init)
++  KEEP(*(.x86_cpu_dev.init))
+   __x86_cpu_dev_end = .;
+   }
+ 
+@@ -257,7 +257,7 @@ SECTIONS
+   .x86_intel_mid_dev.init : AT(ADDR(.x86_intel_mid_dev.init) - \
+   LOAD_OFFSET) {
+   __x86_intel_mid_dev_start = .;
+-  *(.x86_intel_mid_dev.init)
++  KEEP(*(.x86_intel_mid_dev.init))
+   __x86_intel_mid_dev_end = .;
+   }
+ #endif
+@@ -271,7 +271,7 @@ SECTIONS
+   . = ALIGN(8);
+   .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
+   __parainstructions = .;
+-  *(.parainstructions)
++  KEEP(*(.parainstructions))
+   __parainstructions_end = .;
+   }
+ 
+@@ -283,7 +283,7 @@ SECTIONS
+   . = ALIGN(8);
+   .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
+   __alt_instructions = .;
+-  *(.altinstructions)
++  KEEP(*(.altinstructions))
+   __alt_instructions_end = .;
+   }
+ 
+@@ -293,7 +293,7 @@ SECTIONS
+* get the address and the length of them to patch the kernel safely.
+*/
+   .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
+-  *(.altinstr_replacement)
++  KEEP(*(.altinstr_replacement))
+   }
+ 
+   /*
+@@ -304,14 +304,14 @@ SECTIONS
+*/
+   .iommu_table : AT(ADDR(.iommu_table) - LOAD_OFFSET) {
+   __iommu_table = .;
+-  *(.iommu_table)
++  KEEP(*(.iommu_table))
+   __iommu_table_end = .;
+   }
+ 
+   . = ALIGN(8);
+   .apicdrivers : AT(ADDR(.apicdrivers) - LOAD_OFFSET) {
+   __apicdrivers = .;
+-  *(.apicdrivers);
++  KEEP(*(.apicdrivers))
+   __apicdrivers_end = .;
+   }
+ 
+@@ -346,7 +346,7 @@ SECTIONS
+   . = ALIGN(PAGE_SIZE);
+   .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
+   __smp_locks = .;
+-  *(.smp_locks)
++  KEEP(*(.smp_locks))
+   . = ALIGN(PAGE_SIZE);
+   __smp_locks_end = .;
+   }
+@@ -380,8 +380,8 @@ SECTIONS
+   . = ALIGN(PAGE_SIZE);
+   .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
+   __brk_base = .;
+-  . += 64 * 1024; /* 64k alignment slop space */
+-  *(.brk_reservation) /* areas brk users have reserved */
++  . += 64 * 1024; /* 64k alignment slop space */
++

Re: [PATCH] kernel/pending-5.4: enable DCDE for x86(-64)

2021-01-03 Thread Rui Salvaterra
On Sun, 3 Jan 2021 at 00:33, Rui Salvaterra  wrote:
>
> openwrt-x86-64-generic-kernel.bin size, with my config:
>
> Before: 3138048 bytes
> After:  2937344 bytes
>
> In other words, we save about 100 kB.

Make it 200 kB. I obviously fail at math. :P

Cheers,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] kernel/pending-5.4: enable DCDE for x86(-64)

2021-01-03 Thread Rui Salvaterra
Hi, Adrian,

On Sun, 3 Jan 2021 at 12:22, Adrian Schmutzler  wrote:
>
> Shouldn't it be in target/linux/x86 then?

You tell me. :) My rationale was, this being a pending upstream patch
(it hasn't hit mainline because this is a stop-gap solution while
people are working on "real" LTO, at least for Clang), it made sense
to include in generic/pending-5.4, but I have no strong feelings
either way, so just let me know what works best for you.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] kernel/pending-5.4: enable DCDE for x86(-64)

2021-01-04 Thread Rui Salvaterra
Hi again, Adrian,

On Sun, 3 Jan 2021 at 12:36, Rui Salvaterra  wrote:
> On Sun, 3 Jan 2021 at 12:22, Adrian Schmutzler  
> wrote:
> >
> > Shouldn't it be in target/linux/x86 then?
>
> You tell me. :) My rationale was, this being a pending upstream patch
> (it hasn't hit mainline because this is a stop-gap solution while
> people are working on "real" LTO, at least for Clang), it made sense
> to include in generic/pending-5.4, but I have no strong feelings
> either way, so just let me know what works best for you.

I just noticed we already have a similar patch for ARM [1] in
generic/hack-5.4, so I'm inclined to put the x86 patch in the same
place. Thoughts?

[1] 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/generic/hack-5.4/220-gc_sections.patch;h=22276d4399d2aa2afcd23e94c7e95d29a9beab54;hb=HEAD

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2] x86/patches-5.4: enable DCDE for x86(-64)

2021-01-04 Thread Rui Salvaterra
Port and adapt Nick Piggin's original patch [1]. This enables dead code and
data elimination at linking time (gc-sections) on x86(-64).

openwrt-x86-64-generic-kernel.bin size, with my config:

Before: 3138048 bytes
After:  2937344 bytes

In other words, we save about 200 kB.

[1] https://lore.kernel.org/lkml/20170709031333.29443-1-npig...@gmail.com/

Signed-off-by: Rui Salvaterra 
---
v2: move the patch to x86/patches-5.4.

 ...nable-dead-code-and-data-elimination.patch | 127 ++
 1 file changed, 127 insertions(+)
 create mode 100644 
target/linux/x86/patches-5.4/350-x86-enable-dead-code-and-data-elimination.patch

diff --git 
a/target/linux/x86/patches-5.4/350-x86-enable-dead-code-and-data-elimination.patch
 
b/target/linux/x86/patches-5.4/350-x86-enable-dead-code-and-data-elimination.patch
new file mode 100644
index 00..392ddd71ce
--- /dev/null
+++ 
b/target/linux/x86/patches-5.4/350-x86-enable-dead-code-and-data-elimination.patch
@@ -0,0 +1,127 @@
+From f08a0e4e59f92b4a88501653761cbca08935b9b6 Mon Sep 17 00:00:00 2001
+From: Rui Salvaterra 
+Date: Wed, 4 Nov 2020 19:45:04 +
+Subject: [PATCH] x86: enable dead code and data elimination
+
+Adapt Nick Piggin's original patch [1]. This saves nearly 300 kiB on the final
+vmlinuz (zstd-compressed).
+
+[1] https://lore.kernel.org/lkml/20170709031333.29443-1-npig...@gmail.com/
+
+Signed-off-by: Rui Salvaterra 
+---
+ arch/x86/Kconfig  |  1 +
+ arch/x86/kernel/vmlinux.lds.S | 24 
+ 2 files changed, 13 insertions(+), 12 deletions(-)
+
+--- a/arch/x86/Kconfig
 b/arch/x86/Kconfig
+@@ -184,6 +184,7 @@ config X86
+   select HAVE_FUNCTION_ERROR_INJECTION
+   select HAVE_KRETPROBES
+   select HAVE_KVM
++  select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
+   select HAVE_LIVEPATCH   if X86_64
+   select HAVE_MEMBLOCK_NODE_MAP
+   select HAVE_MIXED_BREAKPOINTS_REGS
+--- a/arch/x86/kernel/vmlinux.lds.S
 b/arch/x86/kernel/vmlinux.lds.S
+@@ -242,14 +242,14 @@ SECTIONS
+* See static_cpu_has() for an example.
+*/
+   .altinstr_aux : AT(ADDR(.altinstr_aux) - LOAD_OFFSET) {
+-  *(.altinstr_aux)
++  KEEP(*(.altinstr_aux))
+   }
+ 
+   INIT_DATA_SECTION(16)
+ 
+   .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
+   __x86_cpu_dev_start = .;
+-  *(.x86_cpu_dev.init)
++  KEEP(*(.x86_cpu_dev.init))
+   __x86_cpu_dev_end = .;
+   }
+ 
+@@ -257,7 +257,7 @@ SECTIONS
+   .x86_intel_mid_dev.init : AT(ADDR(.x86_intel_mid_dev.init) - \
+   LOAD_OFFSET) {
+   __x86_intel_mid_dev_start = .;
+-  *(.x86_intel_mid_dev.init)
++  KEEP(*(.x86_intel_mid_dev.init))
+   __x86_intel_mid_dev_end = .;
+   }
+ #endif
+@@ -271,7 +271,7 @@ SECTIONS
+   . = ALIGN(8);
+   .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
+   __parainstructions = .;
+-  *(.parainstructions)
++  KEEP(*(.parainstructions))
+   __parainstructions_end = .;
+   }
+ 
+@@ -283,7 +283,7 @@ SECTIONS
+   . = ALIGN(8);
+   .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
+   __alt_instructions = .;
+-  *(.altinstructions)
++  KEEP(*(.altinstructions))
+   __alt_instructions_end = .;
+   }
+ 
+@@ -293,7 +293,7 @@ SECTIONS
+* get the address and the length of them to patch the kernel safely.
+*/
+   .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
+-  *(.altinstr_replacement)
++  KEEP(*(.altinstr_replacement))
+   }
+ 
+   /*
+@@ -304,14 +304,14 @@ SECTIONS
+*/
+   .iommu_table : AT(ADDR(.iommu_table) - LOAD_OFFSET) {
+   __iommu_table = .;
+-  *(.iommu_table)
++  KEEP(*(.iommu_table))
+   __iommu_table_end = .;
+   }
+ 
+   . = ALIGN(8);
+   .apicdrivers : AT(ADDR(.apicdrivers) - LOAD_OFFSET) {
+   __apicdrivers = .;
+-  *(.apicdrivers);
++  KEEP(*(.apicdrivers))
+   __apicdrivers_end = .;
+   }
+ 
+@@ -346,7 +346,7 @@ SECTIONS
+   . = ALIGN(PAGE_SIZE);
+   .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
+   __smp_locks = .;
+-  *(.smp_locks)
++  KEEP(*(.smp_locks))
+   . = ALIGN(PAGE_SIZE);
+   __smp_locks_end = .;
+   }
+@@ -380,8 +380,8 @@ SECTIONS
+   . = ALIGN(PAGE_SIZE);
+   .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
+   __brk_base = .;
+-  . += 64 * 1024; /* 64k alignment slop space */
+-  *(.brk_reservation) /* areas brk users have reserved */
++  . += 64 * 1024; /* 64k alignment 

[PATCH] kernel: make lwtunnel support optional

2021-01-14 Thread Rui Salvaterra
Not everyone will want to bloat their kernel by 24 kiB for such a niche
feature.

Fixes: a1a7f3274e0ed27511d45f62ee20281d8d57c7af "kernel: enable SRv6 support by
enabling lwtunnel"

Signed-off-by: Rui Salvaterra 
---
 config/Config-kernel.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index d99ce44c0d..8a78e297cb 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -975,9 +975,10 @@ if KERNEL_IPV6
def_bool n
 
config KERNEL_IPV6_SEG6_LWTUNNEL
-   def_bool y if !SMALL_FLASH
+   bool "Enable support for lightweight tunnels"
+   default y if !SMALL_FLASH
help
- Using lwtunnel requires full-ip package.
+ Using lwtunnel (needed for IPv6 segment routing) requires 
ip-full package.
 
config KERNEL_LWTUNNEL_BPF
def_bool n
-- 
2.30.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] kernel/zram: remove obsolete symbol

2021-02-02 Thread Rui Salvaterra
Zsmalloc page table mappings are dead and gone [1]. Drop the respective kconfig
symbol.

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.4.y&id=69dc72f058c9b98f9b66bed184cfab7c2e9f49b0

Signed-off-by: Rui Salvaterra 
---
 package/kernel/linux/modules/other.mk | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/kernel/linux/modules/other.mk 
b/package/kernel/linux/modules/other.mk
index 83d998c83a..1a1a550968 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -919,7 +919,6 @@ define KernelPackage/zram
CONFIG_ZSMALLOC \
CONFIG_ZRAM \
CONFIG_ZRAM_DEBUG=n \
-   CONFIG_PGTABLE_MAPPING=n \
CONFIG_ZRAM_WRITEBACK=n \
CONFIG_ZSMALLOC_STAT=n
   FILES:= \
-- 
2.30.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] mvebu/omnia: enable hardware buffer management

2021-02-17 Thread Rui Salvaterra
Signed-off-by: Rui Salvaterra 
---
 ...is-omnia-enable-HW-buffer-management.patch | 83 +++
 1 file changed, 83 insertions(+)
 create mode 100644 
target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch

diff --git 
a/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
 
b/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
new file mode 100644
index 00..3420edf075
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
@@ -0,0 +1,83 @@
+From 23f0ff99446cf27cdc73f794a9d767e6af05e11c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= 
+Date: Sun, 15 Nov 2020 14:59:17 +0100
+Subject: [PATCH 1/2] ARM: dts: turris-omnia: enable HW buffer management
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The buffer manager is available on Turris Omnia but needs to be
+described in device-tree to be used.
+
+Signed-off-by: Marek Behún 
+Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
+Cc: linux-arm-ker...@lists.infradead.org
+Cc: Uwe Kleine-König 
+Cc: Jason Cooper 
+Cc: Gregory CLEMENT 
+Cc: Andreas Färber 
+Cc: Andrew Lunn 
+Cc: Rob Herring 
+Cc: devicet...@vger.kernel.org
+Signed-off-by: Gregory CLEMENT 
+Signed-off-by: Rui Salvaterra 
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +
+ 1 file changed, 17 insertions(+)
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -31,7 +31,8 @@
+   ranges = ;
++MBUS_ID(0x09, 0x15) 0 0xf111 0x1
++MBUS_ID(0x0c, 0x04) 0 0xf120 0x10>;
+ 
+   internal-regs {
+ 
+@@ -84,12 +85,23 @@
+   };
+ };
+ 
++&bm {
++  status = "okay";
++};
++
++&bm_bppi {
++  status = "okay";
++};
++
+ /* Connected to 88E6176 switch, port 6 */
+ ð0 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&ge0_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <0>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -103,6 +115,9 @@
+   pinctrl-0 = <&ge1_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <1>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -115,6 +130,9 @@
+   status = "okay";
+   phy-mode = "sgmii";
+   phy = <&phy1>;
++  buffer-manager = <&bm>;
++  bm,pool-long = <2>;
++  bm,pool-short = <3>;
+ };
+ 
+ &i2c0 {
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] mvebu/omnia: enable hardware buffer management

2021-02-17 Thread Rui Salvaterra
Oops! Fat-fingered. I'll resend with a proper description.

On Wed, 17 Feb 2021 at 15:52, Rui Salvaterra  wrote:
>
> Signed-off-by: Rui Salvaterra 
> ---
>  ...is-omnia-enable-HW-buffer-management.patch | 83 +++
>  1 file changed, 83 insertions(+)
>  create mode 100644 
> target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
>
> diff --git 
> a/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
>  
> b/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
> new file mode 100644
> index 00..3420edf075
> --- /dev/null
> +++ 
> b/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
> @@ -0,0 +1,83 @@
> +From 23f0ff99446cf27cdc73f794a9d767e6af05e11c Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= 
> +Date: Sun, 15 Nov 2020 14:59:17 +0100
> +Subject: [PATCH 1/2] ARM: dts: turris-omnia: enable HW buffer management
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +The buffer manager is available on Turris Omnia but needs to be
> +described in device-tree to be used.
> +
> +Signed-off-by: Marek Behún 
> +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
> +Cc: linux-arm-ker...@lists.infradead.org
> +Cc: Uwe Kleine-König 
> +Cc: Jason Cooper 
> +Cc: Gregory CLEMENT 
> +Cc: Andreas Färber 
> +Cc: Andrew Lunn 
> +Cc: Rob Herring 
> +Cc: devicet...@vger.kernel.org
> +Signed-off-by: Gregory CLEMENT 
> +Signed-off-by: Rui Salvaterra 
> +---
> + arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +
> + 1 file changed, 17 insertions(+)
> +
> +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
>  b/arch/arm/boot/dts/armada-385-turris-omnia.dts
> +@@ -31,7 +31,8 @@
> +   ranges =  + MBUS_ID(0x01, 0x1d) 0 0xfff0 0x10
> + MBUS_ID(0x09, 0x19) 0 0xf110 0x1
> +-MBUS_ID(0x09, 0x15) 0 0xf111 0x1>;
> ++MBUS_ID(0x09, 0x15) 0 0xf111 0x1
> ++MBUS_ID(0x0c, 0x04) 0 0xf120 0x10>;
> +
> +   internal-regs {
> +
> +@@ -84,12 +85,23 @@
> +   };
> + };
> +
> ++&bm {
> ++  status = "okay";
> ++};
> ++
> ++&bm_bppi {
> ++  status = "okay";
> ++};
> ++
> + /* Connected to 88E6176 switch, port 6 */
> + ð0 {
> +   pinctrl-names = "default";
> +   pinctrl-0 = <&ge0_rgmii_pins>;
> +   status = "okay";
> +   phy-mode = "rgmii";
> ++  buffer-manager = <&bm>;
> ++  bm,pool-long = <0>;
> ++  bm,pool-short = <3>;
> +
> +   fixed-link {
> +   speed = <1000>;
> +@@ -103,6 +115,9 @@
> +   pinctrl-0 = <&ge1_rgmii_pins>;
> +   status = "okay";
> +   phy-mode = "rgmii";
> ++  buffer-manager = <&bm>;
> ++  bm,pool-long = <1>;
> ++  bm,pool-short = <3>;
> +
> +   fixed-link {
> +   speed = <1000>;
> +@@ -115,6 +130,9 @@
> +   status = "okay";
> +   phy-mode = "sgmii";
> +   phy = <&phy1>;
> ++  buffer-manager = <&bm>;
> ++  bm,pool-long = <2>;
> ++  bm,pool-short = <3>;
> + };
> +
> + &i2c0 {
> --
> 2.30.1
>

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2] mvebu/omnia: enable hardware buffer management

2021-02-17 Thread Rui Salvaterra
Backport (and fix [1]) the required device tree changes in order to support
hardware buffer management on the Turris Omnia.

[1] https://lore.kernel.org/linux-arm-kernel/20210217164232.25a77...@kernel.org/

Signed-off-by: Rui Salvaterra 
---
 ...is-omnia-enable-HW-buffer-management.patch | 83 +++
 1 file changed, 83 insertions(+)
 create mode 100644 
target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch

diff --git 
a/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
 
b/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
new file mode 100644
index 00..3420edf075
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
@@ -0,0 +1,83 @@
+From 23f0ff99446cf27cdc73f794a9d767e6af05e11c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= 
+Date: Sun, 15 Nov 2020 14:59:17 +0100
+Subject: [PATCH 1/2] ARM: dts: turris-omnia: enable HW buffer management
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The buffer manager is available on Turris Omnia but needs to be
+described in device-tree to be used.
+
+Signed-off-by: Marek Behún 
+Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
+Cc: linux-arm-ker...@lists.infradead.org
+Cc: Uwe Kleine-König 
+Cc: Jason Cooper 
+Cc: Gregory CLEMENT 
+Cc: Andreas Färber 
+Cc: Andrew Lunn 
+Cc: Rob Herring 
+Cc: devicet...@vger.kernel.org
+Signed-off-by: Gregory CLEMENT 
+Signed-off-by: Rui Salvaterra 
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +
+ 1 file changed, 17 insertions(+)
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -31,7 +31,8 @@
+   ranges = ;
++MBUS_ID(0x09, 0x15) 0 0xf111 0x1
++MBUS_ID(0x0c, 0x04) 0 0xf120 0x10>;
+ 
+   internal-regs {
+ 
+@@ -84,12 +85,23 @@
+   };
+ };
+ 
++&bm {
++  status = "okay";
++};
++
++&bm_bppi {
++  status = "okay";
++};
++
+ /* Connected to 88E6176 switch, port 6 */
+ ð0 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&ge0_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <0>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -103,6 +115,9 @@
+   pinctrl-0 = <&ge1_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <1>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -115,6 +130,9 @@
+   status = "okay";
+   phy-mode = "sgmii";
+   phy = <&phy1>;
++  buffer-manager = <&bm>;
++  bm,pool-long = <2>;
++  bm,pool-short = <3>;
+ };
+ 
+ &i2c0 {
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 5/5] mvebu: add 5.10 as a testing kernel

2021-02-19 Thread Rui Salvaterra
Keep 5.4 as stable until further validation.

Signed-off-by: Rui Salvaterra 
---
 target/linux/mvebu/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile
index 1e67bcfacb..1550309a92 100644
--- a/target/linux/mvebu/Makefile
+++ b/target/linux/mvebu/Makefile
@@ -10,7 +10,7 @@ FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk 
boot-part rootfs-part
 SUBTARGETS:=cortexa9 cortexa53 cortexa72
 
 KERNEL_PATCHVER:=5.4
-KERNEL_TESTING_PATCHVER:=5.4
+KERNEL_TESTING_PATCHVER:=5.10
 
 include $(INCLUDE_DIR)/target.mk
 
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/5] mvebu: add 5.10 kernel config

2021-02-19 Thread Rui Salvaterra
Basically make kernel_oldconfig from 5.4.

Signed-off-by: Rui Salvaterra 
---
 target/linux/mvebu/config-5.10 | 439 +
 1 file changed, 439 insertions(+)
 create mode 100644 target/linux/mvebu/config-5.10

diff --git a/target/linux/mvebu/config-5.10 b/target/linux/mvebu/config-5.10
new file mode 100644
index 00..9684166739
--- /dev/null
+++ b/target/linux/mvebu/config-5.10
@@ -0,0 +1,439 @@
+CONFIG_AHCI_MVEBU=y
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_32BIT_OFF_T=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_KEEP_MEMBLOCK=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+# CONFIG_ARCH_MSTARV7 is not set
+CONFIG_ARCH_MULTIPLATFORM=y
+CONFIG_ARCH_MULTI_V6_V7=y
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_MVEBU=y
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARM=y
+CONFIG_ARMADA_370_CLK=y
+CONFIG_ARMADA_370_XP_IRQ=y
+CONFIG_ARMADA_370_XP_TIMER=y
+# CONFIG_ARMADA_37XX_WATCHDOG is not set
+CONFIG_ARMADA_38X_CLK=y
+CONFIG_ARMADA_THERMAL=y
+CONFIG_ARMADA_XP_CLK=y
+CONFIG_ARM_APPENDED_DTB=y
+# CONFIG_ARM_ARMADA_37XX_CPUFREQ is not set
+# CONFIG_ARM_ARMADA_8K_CPUFREQ is not set
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARM_CRYPTO=y
+CONFIG_ARM_ERRATA_720789=y
+CONFIG_ARM_ERRATA_764369=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_GLOBAL_TIMER=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_ARM_HEAVY_MB=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_MVEBU_V7_CPUIDLE=y
+CONFIG_ARM_PATCH_IDIV=y
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_UNWIND=y
+CONFIG_ARM_VIRT_EXT=y
+CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
+CONFIG_ATA=y
+CONFIG_ATAGS=y
+CONFIG_AUTO_ZRELADDR=y
+CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_MQ_PCI=y
+CONFIG_BLK_SCSI_REQUEST=y
+CONFIG_BOUNCE=y
+# CONFIG_CACHE_FEROCEON_L2 is not set
+CONFIG_CACHE_L2X0=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_COMMON_CLK=y
+CONFIG_COMPAT_32BIT_TIME=y
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPUFREQ_DT_PLATDEV=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_GOV_ATTR_SET=y
+CONFIG_CPU_FREQ_GOV_COMMON=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_PJ4B=y
+CONFIG_CPU_PM=y
+CONFIG_CPU_RMAP=y
+CONFIG_CPU_SPECTRE=y
+CONFIG_CPU_THERMAL=y
+CONFIG_CPU_THUMB_CAPABLE=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_V7=y
+CONFIG_CRC16=y
+CONFIG_CRYPTO_ACOMP2=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_AES_ARM=y
+CONFIG_CRYPTO_AES_ARM_BS=y
+CONFIG_CRYPTO_AUTHENC=y
+CONFIG_CRYPTO_CRC32=y
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_CRYPTD=y
+# CONFIG_CRYPTO_CURVE25519_NEON is not set
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_DEV_MARVELL=y
+CONFIG_CRYPTO_DEV_MARVELL_CESA=y
+CONFIG_CRYPTO_ESSIV=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_HASH_INFO=y
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_LIB_DES=y
+CONFIG_CRYPTO_LZO=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_NULL=y
+CONFIG_CRYPTO_NULL2=y
+# CONFIG_CRYPTO_POLY1305_ARM is not set
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA1_ARM=y
+CONFIG_CRYPTO_SHA1_ARM_NEON=y
+CONFIG_CRYPTO_SHA256_ARM=y
+CONFIG_CRYPTO_SHA512_ARM=y
+CONFIG_CRYPTO_SIMD=y
+CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_DEBUG_ALIGN_RODATA=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
+CONFIG_DEBUG_MVEBU_UART0=y
+# CONFIG_DEBUG_MVEBU_UART0_ALTERNATE is not set
+# CONFIG_DEBUG_MVEBU_UART1_ALTERNATE is not set
+CONFIG_DEBUG_UART_8250=y
+CONFIG_DEBUG_UART_8250_SHIFT=2
+# CONFIG_DEBUG_UART_8250_WORD is not set
+# CONFIG_DEBUG_UART_FLOW_CONTROL is not set
+CONFIG_DEBUG_UART_PHYS=0xd0012000
+CONFIG_DEBUG_UART_VIRT=0xfec12000
+CONFIG_DEBUG_UNCOMPRESS=y
+CONFIG_DEBUG_USER=y
+CONFIG_DMADEVICES=y
+CONFIG_DMA_ENGINE=y
+CONFIG_DMA_ENGINE_RAID=y
+CONFIG_DMA_OF=y
+CONFIG_DMA_OPS=y
+CONFIG_DMA_REMAP=y
+CONFIG_DTC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+CONFIG_EXT4_FS=y
+CONFIG_EXTCON=y
+CONFIG_F2FS_FS=y
+CONFIG_FIXED_PHY=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_FS_IOMAP=y
+CONFIG_FS_MBCACHE=y
+CONFIG_FW_LOADER_PAGED_BUF=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_GENERIC_ARCH_TOPOLOGY=y
+CONFIG_GEN

[PATCH 4/5] mvebu: update the Turris Omnia device tree

2021-02-19 Thread Rui Salvaterra
Include support for the multicolor LEDs (software controlled, for now) and fix
the hardware buffer management support, due to a missing mbus window.

Signed-off-by: Rui Salvaterra 
---
 ...-dts-turris-omnia-update-device-tree.patch | 276 ++
 1 file changed, 276 insertions(+)
 create mode 100644 
target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch

diff --git 
a/target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch
 
b/target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch
new file mode 100644
index 00..76f52b2c70
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch
@@ -0,0 +1,276 @@
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -12,6 +12,7 @@
+ 
+ #include 
+ #include 
++#include 
+ #include "armada-385.dtsi"
+ 
+ / {
+@@ -31,7 +32,8 @@
+   ranges = ;
++MBUS_ID(0x09, 0x15) 0 0xf111 0x1
++MBUS_ID(0x0c, 0x04) 0 0xf120 0x10>;
+ 
+   internal-regs {
+ 
+@@ -82,6 +84,32 @@
+   };
+   };
+   };
++
++  sfp: sfp {
++  compatible = "sff,sfp";
++  i2c-bus = <&sfp_i2c>;
++  tx-fault-gpios = <&pcawan 0 GPIO_ACTIVE_HIGH>;
++  tx-disable-gpios = <&pcawan 1 GPIO_ACTIVE_HIGH>;
++  rate-select0-gpios = <&pcawan 2 GPIO_ACTIVE_HIGH>;
++  los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>;
++  mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>;
++  maximum-power-milliwatt = <3000>;
++
++  /*
++   * For now this has to be enabled at boot time by U-Boot when
++   * a SFP module is present. Read more in the comment in the
++   * eth2 node below.
++   */
++  status = "disabled";
++  };
++};
++
++&bm {
++  status = "okay";
++};
++
++&bm_bppi {
++  status = "okay";
+ };
+ 
+ /* Connected to 88E6176 switch, port 6 */
+@@ -90,6 +118,9 @@
+   pinctrl-0 = <&ge0_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <0>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -103,6 +134,9 @@
+   pinctrl-0 = <&ge1_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <1>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -112,9 +146,23 @@
+ 
+ /* WAN port */
+ ð2 {
++  /*
++   * eth2 is connected via a multiplexor to both the SFP cage and to
++   * ethernet-phy@1. The multiplexor switches the signal to SFP cage when
++   * a SFP module is present, as determined by the mode-def0 GPIO.
++   *
++   * Until kernel supports this configuration properly, in case SFP module
++   * is present, U-Boot has to enable the sfp node above, remove phy
++   * handle and add managed = "in-band-status" property.
++   */
+   status = "okay";
+   phy-mode = "sgmii";
+-  phy = <&phy1>;
++  phy-handle = <&phy1>;
++  phys = <&comphy5 2>;
++  sfp = <&sfp>;
++  buffer-manager = <&bm>;
++  bm,pool-long = <2>;
++  bm,pool-short = <3>;
+ };
+ 
+ &i2c0 {
+@@ -127,7 +175,6 @@
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0x70>;
+-  status = "okay";
+ 
+   i2c@0 {
+   #address-cells = <1>;
+@@ -135,7 +182,115 @@
+   reg = <0>;
+ 
+   /* STM32F0 command interface at address 0x2a */
+-  /* leds device (in STM32F0) at address 0x2b */
++
++  led-controller@2b {
++  compatible = "cznic,turris-omnia-leds";
++  reg = <0x2b>;
++  #address-cells = <1>;
++  #size-cells = <0>;
++
++  /*
++   * LEDs are controlled by MCU (STM32F0) at
++   * address 0x2b.
++   *
++   * The driver does not support HW control mode
++   * for the LEDs yet. Disable the LEDs for now.
++   *
++   * Also LED function

[PATCH 0/5] mvebu: add support for Linux 5.10

2021-02-19 Thread Rui Salvaterra
This series adds initial support for 5.10 on mvebu. Build/runtime-tested on a
Turris Omnia, no regressions noticed.

Rui Salvaterra (5):
  mvebu: add 5.10 kernel config
  mvebu: copy 5.4 patches to 5.10
  mvebu: refresh 5.10 patches
  mvebu: update the Turris Omnia device tree
  mvebu: add 5.10 as a testing kernel

 target/linux/mvebu/Makefile   |   2 +-
 target/linux/mvebu/config-5.10| 439 ++
 ...s-mcbin-singleshot-add-heartbeat-LED.patch |  65 ++
 ...Mangle-bootloader-s-kernel-arguments.patch | 189 +
 ...-mvebu-armada-38x-enable-libata-leds.patch |  10 +
 .../patches-5.10/302-add_powertables.patch| 770 ++
 ...3-linksys_hardcode_nand_ecc_settings.patch |  17 +
 .../patches-5.10/304-revert_i2c_delay.patch   |  15 +
 .../305-armada-385-rd-mtd-partitions.patch|  19 +
 .../306-ARM-mvebu-385-ap-Add-partitions.patch |  35 +
 ...-armada-xp-linksys-mamba-broken-idle.patch |  10 +
 .../308-armada-xp-linksys-mamba-wan.patch |  11 +
 .../patches-5.10/309-linksys-status-led.patch |  50 ++
 .../310-linksys-use-eth0-as-cpu-port.patch|  25 +
 .../311-adjust-compatible-for-linksys.patch   |  68 ++
 ...da388-clearfog-emmc-on-clearfog-base.patch |  87 ++
 .../312-helios4-dts-status-led-alias.patch|  28 +
 ...ts-marvell-armada37xx-Add-eth0-alias.patch |  20 +
 ...witch-PHY-operation-mode-to-2500base.patch |  34 +
 ...-dts-turris-omnia-update-device-tree.patch | 276 +++
 .../patches-5.10/400-find_active_root.patch   |  60 ++
 .../700-mvneta-tx-queue-workaround.patch  |  34 +
 ...dicate-failure-to-enter-deeper-sleep.patch |  40 +
 ...-pci-mvebu-time-out-reset-on-link-up.patch |  60 ++
 24 files changed, 2363 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/mvebu/config-5.10
 create mode 100644 
target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch
 create mode 100644 target/linux/mvebu/patches-5.10/302-add_powertables.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/303-linksys_hardcode_nand_ecc_settings.patch
 create mode 100644 target/linux/mvebu/patches-5.10/304-revert_i2c_delay.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/305-armada-385-rd-mtd-partitions.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/306-ARM-mvebu-385-ap-Add-partitions.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/307-armada-xp-linksys-mamba-broken-idle.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/308-armada-xp-linksys-mamba-wan.patch
 create mode 100644 target/linux/mvebu/patches-5.10/309-linksys-status-led.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/310-linksys-use-eth0-as-cpu-port.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/311-adjust-compatible-for-linksys.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch
 create mode 100644 target/linux/mvebu/patches-5.10/400-find_active_root.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/700-mvneta-tx-queue-workaround.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/800-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/801-pci-mvebu-time-out-reset-on-link-up.patch

-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 5/5] mvebu: add 5.10 as a testing kernel

2021-02-20 Thread Rui Salvaterra
Keep 5.4 as stable until further validation.

Signed-off-by: Rui Salvaterra 
---
 target/linux/mvebu/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile
index 75564b1000..6e5a125530 100644
--- a/target/linux/mvebu/Makefile
+++ b/target/linux/mvebu/Makefile
@@ -10,7 +10,7 @@ FEATURES:=fpu usb pci pcie gpio squashfs ramdisk boot-part 
rootfs-part
 SUBTARGETS:=cortexa9 cortexa53 cortexa72
 
 KERNEL_PATCHVER:=5.4
-KERNEL_TESTING_PATCHVER:=5.4
+KERNEL_TESTING_PATCHVER:=5.10
 
 include $(INCLUDE_DIR)/target.mk
 
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 0/5] mvebu: add support for Linux 5.10

2021-02-20 Thread Rui Salvaterra
This series adds initial support for 5.10 on mvebu. Build/runtime-tested on a
Turris Omnia, no regressions noticed.

v2: generate the kconfig after patching, since patches can (and do) introduce
new kconfig symbols.

Rui Salvaterra (5):
  mvebu: copy 5.4 patches to 5.10
  mvebu: refresh 5.10 patches
  mvebu: update the Turris Omnia device tree
  mvebu: add 5.10 kernel config
  mvebu: add 5.10 as a testing kernel

 target/linux/mvebu/Makefile   |   2 +-
 target/linux/mvebu/config-5.10| 442 ++
 ...s-mcbin-singleshot-add-heartbeat-LED.patch |  65 ++
 ...Mangle-bootloader-s-kernel-arguments.patch | 189 +
 ...-mvebu-armada-38x-enable-libata-leds.patch |  10 +
 .../patches-5.10/302-add_powertables.patch| 770 ++
 ...3-linksys_hardcode_nand_ecc_settings.patch |  17 +
 .../patches-5.10/304-revert_i2c_delay.patch   |  15 +
 .../305-armada-385-rd-mtd-partitions.patch|  19 +
 .../306-ARM-mvebu-385-ap-Add-partitions.patch |  35 +
 ...-armada-xp-linksys-mamba-broken-idle.patch |  10 +
 .../308-armada-xp-linksys-mamba-wan.patch |  11 +
 .../patches-5.10/309-linksys-status-led.patch |  50 ++
 .../310-linksys-use-eth0-as-cpu-port.patch|  25 +
 .../311-adjust-compatible-for-linksys.patch   |  68 ++
 ...da388-clearfog-emmc-on-clearfog-base.patch |  87 ++
 .../312-helios4-dts-status-led-alias.patch|  28 +
 ...ts-marvell-armada37xx-Add-eth0-alias.patch |  20 +
 ...witch-PHY-operation-mode-to-2500base.patch |  34 +
 ...-dts-turris-omnia-update-device-tree.patch | 276 +++
 .../patches-5.10/400-find_active_root.patch   |  60 ++
 .../700-mvneta-tx-queue-workaround.patch  |  34 +
 ...dicate-failure-to-enter-deeper-sleep.patch |  40 +
 ...-pci-mvebu-time-out-reset-on-link-up.patch |  60 ++
 24 files changed, 2366 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/mvebu/config-5.10
 create mode 100644 
target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch
 create mode 100644 target/linux/mvebu/patches-5.10/302-add_powertables.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/303-linksys_hardcode_nand_ecc_settings.patch
 create mode 100644 target/linux/mvebu/patches-5.10/304-revert_i2c_delay.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/305-armada-385-rd-mtd-partitions.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/306-ARM-mvebu-385-ap-Add-partitions.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/307-armada-xp-linksys-mamba-broken-idle.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/308-armada-xp-linksys-mamba-wan.patch
 create mode 100644 target/linux/mvebu/patches-5.10/309-linksys-status-led.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/310-linksys-use-eth0-as-cpu-port.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/311-adjust-compatible-for-linksys.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch
 create mode 100644 target/linux/mvebu/patches-5.10/400-find_active_root.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/700-mvneta-tx-queue-workaround.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/800-cpuidle-mvebu-indicate-failure-to-enter-deeper-sleep.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/801-pci-mvebu-time-out-reset-on-link-up.patch

-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 3/5] mvebu: update the Turris Omnia device tree

2021-02-20 Thread Rui Salvaterra
Include support for the multicolor LEDs (software controlled, for now) and fix
the hardware buffer management support, due to a missing mbus window.

Signed-off-by: Rui Salvaterra 
---
 ...-dts-turris-omnia-update-device-tree.patch | 276 ++
 1 file changed, 276 insertions(+)
 create mode 100644 
target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch

diff --git 
a/target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch
 
b/target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch
new file mode 100644
index 00..76f52b2c70
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch
@@ -0,0 +1,276 @@
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -12,6 +12,7 @@
+ 
+ #include 
+ #include 
++#include 
+ #include "armada-385.dtsi"
+ 
+ / {
+@@ -31,7 +32,8 @@
+   ranges = ;
++MBUS_ID(0x09, 0x15) 0 0xf111 0x1
++MBUS_ID(0x0c, 0x04) 0 0xf120 0x10>;
+ 
+   internal-regs {
+ 
+@@ -82,6 +84,32 @@
+   };
+   };
+   };
++
++  sfp: sfp {
++  compatible = "sff,sfp";
++  i2c-bus = <&sfp_i2c>;
++  tx-fault-gpios = <&pcawan 0 GPIO_ACTIVE_HIGH>;
++  tx-disable-gpios = <&pcawan 1 GPIO_ACTIVE_HIGH>;
++  rate-select0-gpios = <&pcawan 2 GPIO_ACTIVE_HIGH>;
++  los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>;
++  mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>;
++  maximum-power-milliwatt = <3000>;
++
++  /*
++   * For now this has to be enabled at boot time by U-Boot when
++   * a SFP module is present. Read more in the comment in the
++   * eth2 node below.
++   */
++  status = "disabled";
++  };
++};
++
++&bm {
++  status = "okay";
++};
++
++&bm_bppi {
++  status = "okay";
+ };
+ 
+ /* Connected to 88E6176 switch, port 6 */
+@@ -90,6 +118,9 @@
+   pinctrl-0 = <&ge0_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <0>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -103,6 +134,9 @@
+   pinctrl-0 = <&ge1_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <1>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -112,9 +146,23 @@
+ 
+ /* WAN port */
+ ð2 {
++  /*
++   * eth2 is connected via a multiplexor to both the SFP cage and to
++   * ethernet-phy@1. The multiplexor switches the signal to SFP cage when
++   * a SFP module is present, as determined by the mode-def0 GPIO.
++   *
++   * Until kernel supports this configuration properly, in case SFP module
++   * is present, U-Boot has to enable the sfp node above, remove phy
++   * handle and add managed = "in-band-status" property.
++   */
+   status = "okay";
+   phy-mode = "sgmii";
+-  phy = <&phy1>;
++  phy-handle = <&phy1>;
++  phys = <&comphy5 2>;
++  sfp = <&sfp>;
++  buffer-manager = <&bm>;
++  bm,pool-long = <2>;
++  bm,pool-short = <3>;
+ };
+ 
+ &i2c0 {
+@@ -127,7 +175,6 @@
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <0x70>;
+-  status = "okay";
+ 
+   i2c@0 {
+   #address-cells = <1>;
+@@ -135,7 +182,115 @@
+   reg = <0>;
+ 
+   /* STM32F0 command interface at address 0x2a */
+-  /* leds device (in STM32F0) at address 0x2b */
++
++  led-controller@2b {
++  compatible = "cznic,turris-omnia-leds";
++  reg = <0x2b>;
++  #address-cells = <1>;
++  #size-cells = <0>;
++
++  /*
++   * LEDs are controlled by MCU (STM32F0) at
++   * address 0x2b.
++   *
++   * The driver does not support HW control mode
++   * for the LEDs yet. Disable the LEDs for now.
++   *
++   * Also LED function

[PATCH v2 4/5] mvebu: add 5.10 kernel config

2021-02-20 Thread Rui Salvaterra
Basically make kernel_oldconfig from 5.4.

CONFIG_ARM_ARCH_TIMER is introduced, a per-core high resolution timer which is
part of newer ARMv7+ CPUs.

Signed-off-by: Rui Salvaterra 
---
 target/linux/mvebu/config-5.10 | 442 +
 1 file changed, 442 insertions(+)
 create mode 100644 target/linux/mvebu/config-5.10

diff --git a/target/linux/mvebu/config-5.10 b/target/linux/mvebu/config-5.10
new file mode 100644
index 00..ccde3a24ba
--- /dev/null
+++ b/target/linux/mvebu/config-5.10
@@ -0,0 +1,442 @@
+CONFIG_AHCI_MVEBU=y
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_32BIT_OFF_T=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_KEEP_MEMBLOCK=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+# CONFIG_ARCH_MSTARV7 is not set
+CONFIG_ARCH_MULTIPLATFORM=y
+CONFIG_ARCH_MULTI_V6_V7=y
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_MVEBU=y
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARM=y
+CONFIG_ARMADA_370_CLK=y
+CONFIG_ARMADA_370_XP_IRQ=y
+CONFIG_ARMADA_370_XP_TIMER=y
+# CONFIG_ARMADA_37XX_WATCHDOG is not set
+CONFIG_ARMADA_38X_CLK=y
+CONFIG_ARMADA_THERMAL=y
+CONFIG_ARMADA_XP_CLK=y
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+# CONFIG_ARM_ARMADA_37XX_CPUFREQ is not set
+# CONFIG_ARM_ARMADA_8K_CPUFREQ is not set
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER is not set
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARM_CRYPTO=y
+CONFIG_ARM_ERRATA_720789=y
+CONFIG_ARM_ERRATA_764369=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_GLOBAL_TIMER=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_ARM_HEAVY_MB=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_MVEBU_V7_CPUIDLE=y
+CONFIG_ARM_PATCH_IDIV=y
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_UNWIND=y
+CONFIG_ARM_VIRT_EXT=y
+CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
+CONFIG_ATA=y
+CONFIG_ATAGS=y
+CONFIG_AUTO_ZRELADDR=y
+CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_MQ_PCI=y
+CONFIG_BLK_SCSI_REQUEST=y
+CONFIG_BOUNCE=y
+# CONFIG_CACHE_FEROCEON_L2 is not set
+CONFIG_CACHE_L2X0=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_COMMON_CLK=y
+CONFIG_COMPAT_32BIT_TIME=y
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPUFREQ_DT_PLATDEV=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_GOV_ATTR_SET=y
+CONFIG_CPU_FREQ_GOV_COMMON=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_PJ4B=y
+CONFIG_CPU_PM=y
+CONFIG_CPU_RMAP=y
+CONFIG_CPU_SPECTRE=y
+CONFIG_CPU_THERMAL=y
+CONFIG_CPU_THUMB_CAPABLE=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_V7=y
+CONFIG_CRC16=y
+CONFIG_CRYPTO_ACOMP2=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_AES_ARM=y
+CONFIG_CRYPTO_AES_ARM_BS=y
+CONFIG_CRYPTO_AUTHENC=y
+CONFIG_CRYPTO_CRC32=y
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_CRYPTD=y
+# CONFIG_CRYPTO_CURVE25519_NEON is not set
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_DEV_MARVELL=y
+CONFIG_CRYPTO_DEV_MARVELL_CESA=y
+CONFIG_CRYPTO_ESSIV=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_HASH_INFO=y
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_LIB_DES=y
+CONFIG_CRYPTO_LZO=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_NULL=y
+CONFIG_CRYPTO_NULL2=y
+# CONFIG_CRYPTO_POLY1305_ARM is not set
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA1_ARM=y
+CONFIG_CRYPTO_SHA1_ARM_NEON=y
+CONFIG_CRYPTO_SHA256_ARM=y
+CONFIG_CRYPTO_SHA512_ARM=y
+CONFIG_CRYPTO_SIMD=y
+CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_DEBUG_ALIGN_RODATA=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
+CONFIG_DEBUG_MVEBU_UART0=y
+# CONFIG_DEBUG_MVEBU_UART0_ALTERNATE is not set
+# CONFIG_DEBUG_MVEBU_UART1_ALTERNATE is not set
+CONFIG_DEBUG_UART_8250=y
+CONFIG_DEBUG_UART_8250_SHIFT=2
+# CONFIG_DEBUG_UART_8250_WORD is not set
+# CONFIG_DEBUG_UART_FLOW_CONTROL is not set
+CONFIG_DEBUG_UART_PHYS=0xd0012000
+CONFIG_DEBUG_UART_VIRT=0xfec12000
+CONFIG_DEBUG_UNCOMPRESS=y
+CONFIG_DEBUG_USER=y
+CONFIG_DMADEVICES=y
+CONFIG_DMA_ENGINE=y
+CONFIG_DMA_ENGINE_RAID=y
+CONFIG_DMA_OF=y
+CONFIG_DMA_OPS=y
+CONFIG_DMA_REMAP=y
+CONFIG_DTC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+CONFIG_EXT4_FS=y
+CONFIG_EXTCON=y
+CONFIG

Re: [PATCH v2 3/5] mvebu: update the Turris Omnia device tree

2021-02-20 Thread Rui Salvaterra
Hi, Tomasz,

On Sat, 20 Feb 2021 at 16:55, Tomasz Maciej Nowak  wrote:
>
> W dniu 20.02.2021 o 12:53, Rui Salvaterra pisze:
> > Include support for the multicolor LEDs (software controlled, for now) and 
> > fix
> > the hardware buffer management support, due to a missing mbus window.
>
> I see more stuff added then what the message says. Also some of changes are 
> in Linus tree, please backport relevant patches with proper message and 
> commit hash (git format-patch -1 ), and add proper index according to 
> target/linux/generic/PATCHES.

This is a complete backport of the current (Linux 5.11) Turris Omnia
device tree, including the hardware buffer management fix. I squashed
everyting in a single patch, as it seemed more logical. I can backport
the individual patches, if you prefer.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2 4/5] mvebu: add 5.10 kernel config

2021-02-20 Thread Rui Salvaterra
Hi, Tomasz,

On Sat, 20 Feb 2021 at 16:55, Tomasz Maciej Nowak  wrote:
>
> The cortexa53 and cortexa72 config refresh are missing, also some symbols 
> could be split from this patch and added to generic config, so other targets 
> refresh will produce smaller diffs. Comments inline.

I have no a53/a72 hardware at all (I only have a9, the Omnia), so any
changes to those targets will be completely untested. Maybe I should
have made this point explicit. :/

[sniped]

> > +# CONFIG_ARCH_MSTARV7 is not set
> Split from this commit and move to generic config.

What do you mean? Split this specific kconfig symbol, or the whole block?

[sniped]

> > +# CONFIG_LEDS_TURRIS_OMNIA is not set
>
> You are adding LEDs node to dts but the driver still is disabled, do the LEDs 
> work without it? If not, make it built-in or package as module.

I'm not adding any features yet. First, I want to get to a point where
the system runs exactly as it would run with 5.4. New features will
come afterwards (in this case, as a module, of course).

[sniped]

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2 2/5] mvebu: refresh 5.10 patches

2021-02-20 Thread Rui Salvaterra
Hi, Tomasz,

On Sat, 20 Feb 2021 at 16:55, Tomasz Maciej Nowak  wrote:
>
> Please reset the number of 028 to 001, the backports should be sorted 
> chronologically so any subsequent patch addition will have minimal diff.
> Also reset the number of patch 316 to 315.

Sure, will do!

> >   extern void init_IRQ(void);
> > -@@ -631,6 +635,18 @@ asmlinkage __visible void __init start_k
> > - page_alloc_init();
> > -
> > - pr_notice("Kernel command line: %s\n", boot_command_line);
> > -+
> > -+#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_MANGLE)
> > -+//Show bootloader's original command line for reference
> > -+if(of_chosen) {
> > -+const char *prop = of_get_property(of_chosen, 
> > "bootloader-args", NULL);
> > -+if(prop)
> > -+pr_notice("Bootloader command line (ignored): %s\n", 
> > prop);
> > -+else
> > -+pr_notice("Bootloader command line not present\n");
> > -+}
> > -+#endif
> > -+
>
> Why is this chunk deleted? I see no explanation in commit message.

Oh, my, I honestly haven't noticed it. Will fix too.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2 1/5] mvebu: copy 5.4 patches to 5.10

2021-02-20 Thread Rui Salvaterra
[resending as reply to all, sorry about that]

Hi, Tomasz,

On Sat, 20 Feb 2021 at 16:55, Tomasz Maciej Nowak  wrote:
>
> Hi Rui,
>
> aside from copying patches also files should be split, since some ESPRESSObin 
> variants are merged upstream and with keeping files as they are now, we will 
> overwrite changes done upstream.
> Additionally just a small nit inline.

This is just a brainless copying. The idea is to split the bringup
into logical steps, as suggested by Adrian Schmutzler [1]. Since
setting the kernel testing version is the last of the patch series,
this should have no influence at all in the build.

> W dniu 20.02.2021 o 12:53, Rui Salvaterra pisze:
> >
> >  create mode 100644 
> > target/linux/mvebu/patches-5.10/312-ARM-dts-armada388-clearfog-emmc-on-clearfog-base.patch
> >  create mode 100644 
> > target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch
>
> I missed this, when sorting patches. When copying please change the index of 
> helios4-dts-status-led-alias.patch to 313.

Will do, thanks!

Rui

[1] https://github.com/openwrt/openwrt/pull/3886#issuecomment-781562000

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2 1/5] mvebu: copy 5.4 patches to 5.10

2021-02-21 Thread Rui Salvaterra
Hi, Hauke,

On Sun, 21 Feb 2021 at 18:16, Hauke Mehrtens  wrote:
>
>
> If you copy the patches first could you also copy the kernel
> configuration files, so it is easy to review them.

The new iteration will have the kernel configuration files included in
the copy, yes.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v2 4/5] mvebu: add 5.10 kernel config

2021-02-21 Thread Rui Salvaterra
Hi, Hauke,

On Sun, 21 Feb 2021 at 19:09, Hauke Mehrtens  wrote:
>
> Could you please try to update also the other subtargets in this patch
> set and ask others to test this on some devices.
> If you do not have these devices it should be fine that you only compile
> tested them.

Yes, that's the idea. Working on it.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 8/8] mvebu: add 5.10 as a testing kernel

2021-02-22 Thread Rui Salvaterra
Keep 5.4 as stable until further validation.

Signed-off-by: Rui Salvaterra 
---
 target/linux/mvebu/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile
index 1e67bcfacb..1550309a92 100644
--- a/target/linux/mvebu/Makefile
+++ b/target/linux/mvebu/Makefile
@@ -10,7 +10,7 @@ FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk 
boot-part rootfs-part
 SUBTARGETS:=cortexa9 cortexa53 cortexa72
 
 KERNEL_PATCHVER:=5.4
-KERNEL_TESTING_PATCHVER:=5.4
+KERNEL_TESTING_PATCHVER:=5.10
 
 include $(INCLUDE_DIR)/target.mk
 
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 6/8] mvebu: fix the patch numbering

2021-02-22 Thread Rui Salvaterra
Make each logical patch group numbering contiguous.

Signed-off-by: Rui Salvaterra 
---
 ...tch => 001-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch} | 0
 ...tus-led-alias.patch => 313-helios4-dts-status-led-alias.patch} | 0
 ...15-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch} | 0
 3 files changed, 0 insertions(+), 0 deletions(-)
 rename 
target/linux/mvebu/patches-5.10/{028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
 => 001-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch} (100%)
 rename target/linux/mvebu/patches-5.10/{312-helios4-dts-status-led-alias.patch 
=> 313-helios4-dts-status-led-alias.patch} (100%)
 rename 
target/linux/mvebu/patches-5.10/{316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
 => 315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch} (100%)

diff --git 
a/target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
 
b/target/linux/mvebu/patches-5.10/001-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
rename to 
target/linux/mvebu/patches-5.10/001-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
diff --git 
a/target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch 
b/target/linux/mvebu/patches-5.10/313-helios4-dts-status-led-alias.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch
rename to target/linux/mvebu/patches-5.10/313-helios4-dts-status-led-alias.patch
diff --git 
a/target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
 
b/target/linux/mvebu/patches-5.10/315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
rename to 
target/linux/mvebu/patches-5.10/315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 2/8] mvebu: refresh the 5.4 kernel configs

2021-02-22 Thread Rui Salvaterra
Remove the implicit/inherited symbols. While not strictly necessary, this will
make reviewing the diff between 5.4 and 5.10 easier.

Signed-off-by: Rui Salvaterra 
---
 target/linux/mvebu/config-5.4   |  74 +-
 target/linux/mvebu/cortexa53/config-5.4 | 122 +---
 target/linux/mvebu/cortexa72/config-5.4 | 111 -
 3 files changed, 24 insertions(+), 283 deletions(-)

diff --git a/target/linux/mvebu/config-5.4 b/target/linux/mvebu/config-5.4
index 2858408064..beeecd138e 100644
--- a/target/linux/mvebu/config-5.4
+++ b/target/linux/mvebu/config-5.4
@@ -2,22 +2,6 @@ CONFIG_AHCI_MVEBU=y
 CONFIG_ALIGNMENT_TRAP=y
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
-CONFIG_ARCH_HAS_BINFMT_FLAT=y
-CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
-CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
-CONFIG_ARCH_HAS_KCOV=y
-CONFIG_ARCH_HAS_KEEPINITRD=y
-CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
-CONFIG_ARCH_HAS_PHYS_TO_DMA=y
-CONFIG_ARCH_HAS_SETUP_DMA_OPS=y
-CONFIG_ARCH_HAS_SET_MEMORY=y
-CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
-CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
-CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y
-CONFIG_ARCH_HAS_TICK_BROADCAST=y
-CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_KEEP_MEMBLOCK=y
 CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
@@ -28,16 +12,7 @@ CONFIG_ARCH_MVEBU=y
 CONFIG_ARCH_NR_GPIO=0
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
-CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
-CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
-CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y
-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_ARCH_WANT_LIBATA_LEDS=y
 CONFIG_ARM=y
 CONFIG_ARMADA_370_CLK=y
 CONFIG_ARMADA_370_XP_IRQ=y
@@ -70,8 +45,8 @@ CONFIG_ARM_UNWIND=y
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
 CONFIG_ATA=y
-CONFIG_ATA_LEDS=y
 CONFIG_ATAGS=y
+CONFIG_ATA_LEDS=y
 CONFIG_AUTO_ZRELADDR=y
 CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
 CONFIG_BLK_DEV_LOOP=y
@@ -81,7 +56,6 @@ CONFIG_BLK_SCSI_REQUEST=y
 CONFIG_BOUNCE=y
 # CONFIG_CACHE_FEROCEON_L2 is not set
 CONFIG_CACHE_L2X0=y
-CONFIG_CC_HAS_KASAN_GENERIC=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y
 CONFIG_CLKSRC_MMIO=y
@@ -207,6 +181,7 @@ CONFIG_GENERIC_SCHED_CLOCK=y
 CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GENERIC_STRNCPY_FROM_USER=y
 CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GLOB=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIOLIB_IRQCHIP=y
@@ -215,55 +190,14 @@ CONFIG_GPIO_GENERIC_PLATFORM=y
 CONFIG_GPIO_MVEBU=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_PCA953X_IRQ=y
+CONFIG_GRO_CELLS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDEN_BRANCH_PREDICTOR=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
-CONFIG_HAVE_ARCH_AUDITSYSCALL=y
-CONFIG_HAVE_ARCH_BITREVERSE=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_PFN_VALID=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_ARM_SCU=y
-CONFIG_HAVE_ARM_SMCCC=y
-CONFIG_HAVE_ARM_TWD=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_COPY_THREAD_TLS=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
-CONFIG_HAVE_EBPF_JIT=y
-CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_OPTPROBES=y
-CONFIG_HAVE_PCI=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_PERF_REGS=y
-CONFIG_HAVE_PERF_USER_STACK_DUMP=y
-CONFIG_HAVE_PROC_CPU=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_RSEQ=y
 CONFIG_HAVE_SMP=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_UID16=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HIGHMEM=y
 # CONFIG_HIGHPTE is not set
 CONFIG_HOTPLUG_CPU=y
@@ -279,7 +213,6 @@ CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_MV64XXX=y
 # CONFIG_I2C_PXA is not set
-# CONFIG_I2C_PXA_SLAVE is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IRQCHIP=y
 CONFIG_IRQ_DOMAIN=y
@@ -378,6 +311,7 @@ CONFIG_OUTER_CACHE=y
 CONFIG_OUTER_CACHE_SYNC=y
 CONFIG_PADATA=y
 CONFIG_PAGE_OFFSET=0xC000
+CONFIG_PAGE_POOL=y
 CONFIG_PCI=y
 CONFIG_PCI_BRIDGE_EMUL=y
 CONFIG_PCI_DOMAINS=y
diff --git a/target/linux/mvebu/cortexa53/config-5.4 
b/target/linux/mvebu/cortexa53/config-5.4
index cc44f997da..79d53932d0 100644
--- a/target/linux/mvebu/cortexa53/config-5.4
+++ b/target/linux/mvebu/cortexa53/config-5.4
@@ -1,47 +1,5 @@
 CONF

[PATCH v3 1/8] mvebu: add generic kconfig symbols

2021-02-22 Thread Rui Salvaterra
This will make the specific kconfig smaller.

Signed-off-by: Rui Salvaterra 
---
 target/linux/generic/config-5.10 | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10
index 7148ce7912..5bdf9a2e9f 100644
--- a/target/linux/generic/config-5.10
+++ b/target/linux/generic/config-5.10
@@ -232,6 +232,7 @@ CONFIG_ARCH_MMAP_RND_BITS_MIN=8
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
 # CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_MSTARV7 is not set
 # CONFIG_ARCH_MULTIPLATFORM is not set
 # CONFIG_ARCH_MULTI_V6 is not set
 # CONFIG_ARCH_MULTI_V7 is not set
@@ -1040,6 +1041,7 @@ CONFIG_CRYPTO_ALGAPI2=y
 # CONFIG_CRYPTO_CTR is not set
 # CONFIG_CRYPTO_CTS is not set
 # CONFIG_CRYPTO_CURVE25519 is not set
+# CONFIG_CRYPTO_CURVE25519_NEON is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_DES is not set
 # CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set
@@ -1264,7 +1266,9 @@ CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
 # CONFIG_DEBUG_TIMEKEEPING is not set
 # CONFIG_DEBUG_UART_8250_PALMCHIP is not set
+# CONFIG_DEBUG_UART_8250_WORD is not set
 # CONFIG_DEBUG_UART_BCM63XX is not set
+# CONFIG_DEBUG_UART_FLOW_CONTROL is not set
 # CONFIG_DEBUG_USER is not set
 # CONFIG_DEBUG_VIRTUAL is not set
 # CONFIG_DEBUG_VM is not set
@@ -2906,6 +2910,7 @@ CONFIG_LEDS_TRIGGER_NETDEV=y
 # CONFIG_LEDS_TRIGGER_PATTERN is not set
 CONFIG_LEDS_TRIGGER_TIMER=y
 # CONFIG_LEDS_TRIGGER_TRANSIENT is not set
+# CONFIG_LEDS_TURRIS_OMNIA is not set
 # CONFIG_LEDS_USER is not set
 # CONFIG_LED_TRIGGER_PHY is not set
 # CONFIG_LEGACY_PTYS is not set
@@ -4741,6 +4746,7 @@ CONFIG_RTC_DRV_CMOS=y
 # CONFIG_RTC_DRV_RTC7301 is not set
 # CONFIG_RTC_DRV_RV3028 is not set
 # CONFIG_RTC_DRV_RV3029C2 is not set
+# CONFIG_RTC_DRV_RV3032 is not set
 # CONFIG_RTC_DRV_RV8803 is not set
 # CONFIG_RTC_DRV_RX4581 is not set
 # CONFIG_RTC_DRV_RX6110 is not set
@@ -4986,6 +4992,7 @@ CONFIG_SELECT_MEMORY_MODEL=y
 # CONFIG_SENSORS_CORSAIR_CPRO is not set
 # CONFIG_SENSORS_DELL_SMM is not set
 # CONFIG_SENSORS_DME1737 is not set
+# CONFIG_SENSORS_DRIVETEMP is not set
 # CONFIG_SENSORS_DS1621 is not set
 # CONFIG_SENSORS_DS620 is not set
 # CONFIG_SENSORS_EMC1403 is not set
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v3 7/8] mvebu: fix the Turris Omnia device tree

2021-02-22 Thread Rui Salvaterra
Enable and fix hardware buffer management. Also fix the IRQ storm caused by a
misconfiguration of the PCA9538 interrupt pin.

Signed-off-by: Rui Salvaterra 
---
 ...is-omnia-enable-HW-buffer-management.patch | 74 +++
 ...omnia-fix-hardware-buffer-management.patch | 27 +++
 ...ure-LED-2--INTn-pin-as-interrupt-pin.patch | 64 
 3 files changed, 165 insertions(+)
 create mode 100644 
target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch

diff --git 
a/target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
 
b/target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
new file mode 100644
index 00..7a4b511998
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
@@ -0,0 +1,74 @@
+From 018b88eee1a2efda26ed2f09aab33ccdc40ef18f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= 
+Date: Sun, 15 Nov 2020 14:59:17 +0100
+Subject: ARM: dts: turris-omnia: enable HW buffer management
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The buffer manager is available on Turris Omnia but needs to be
+described in device-tree to be used.
+
+Signed-off-by: Marek Behún 
+Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
+Cc: linux-arm-ker...@lists.infradead.org
+Cc: Uwe Kleine-König 
+Cc: Jason Cooper 
+Cc: Gregory CLEMENT 
+Cc: Andreas Färber 
+Cc: Andrew Lunn 
+Cc: Rob Herring 
+Cc: devicet...@vger.kernel.org
+Signed-off-by: Gregory CLEMENT 
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +
+ 1 file changed, 17 insertions(+)
+
+(limited to 'arch/arm/boot/dts/armada-385-turris-omnia.dts')
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -84,12 +84,23 @@
+   };
+ };
+ 
++&bm {
++  status = "okay";
++};
++
++&bm_bppi {
++  status = "okay";
++};
++
+ /* Connected to 88E6176 switch, port 6 */
+ ð0 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&ge0_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <0>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -103,6 +114,9 @@
+   pinctrl-0 = <&ge1_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <1>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -115,6 +129,9 @@
+   status = "okay";
+   phy-mode = "sgmii";
+   phy = <&phy1>;
++  buffer-manager = <&bm>;
++  bm,pool-long = <2>;
++  bm,pool-short = <3>;
+ };
+ 
+ &i2c0 {
diff --git 
a/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
 
b/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
new file mode 100644
index 000000..2ebdc06f61
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
@@ -0,0 +1,27 @@
+From 9704292ed3230ee19dc4dd64f7484301b728ffb7 Mon Sep 17 00:00:00 2001
+From: Rui Salvaterra 
+Date: Wed, 17 Feb 2021 15:19:30 +
+Subject: [PATCH] ARM: dts: turris-omnia: fix hardware buffer management
+
+Hardware buffer management has never worked on the Turris Omnia, as the
+required MBus window hadn't been reserved. Fix thusly.
+
+Fixes: 018b88eee1a2 ("ARM: dts: turris-omnia: enable HW buffer management")
+
+Signed-off-by: Rui Salvaterra 
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -32,7 +32,8 @@
+   ranges = ;
++MBUS_ID(0x09, 0x15) 0 0xf111 0x1
++MBUS_ID(0x0c, 0x04) 0 0xf120 0x10>;
+ 
+   internal-regs {
+ 
diff --git 
a/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch
 
b/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch
new file mode 100644
index 00..c7509950e0
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch

[PATCH v3 4/8] mvebu: remove 5.10 upstreamed device trees

2021-02-22 Thread Rui Salvaterra
At this point, they're either redundant or obsolete. Factor out common device
trees into the files directory.

Signed-off-by: Rui Salvaterra 
---
 .../boot/dts/armada-370-buffalo-ls421de.dts   | 433 --
 .../arm/boot/dts/armada-385-linksys-venom.dts | 213 -
 .../dts/marvell/armada-3720-gl-mv1000.dts | 162 ---
 .../marvell/armada-3720-espressobin-emmc.dts  |   0
 .../marvell/armada-3720-espressobin-ultra.dts |   0
 .../armada-3720-espressobin-v7-emmc.dts   |   0
 .../marvell/armada-3720-espressobin-v7.dts|   0
 .../marvell/armada-3720-espressobin-emmc.dts  |  28 --
 .../marvell/armada-3720-espressobin-ultra.dts | 241 --
 .../armada-3720-espressobin-v7-emmc.dts   |  43 --
 .../marvell/armada-3720-espressobin-v7.dts|  31 --
 11 files changed, 1151 deletions(-)
 delete mode 100644 
target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
 delete mode 100644 
target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-385-linksys-venom.dts
 delete mode 100644 
target/linux/mvebu/files-5.10/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
 rename target/linux/mvebu/{files-5.10 => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts (100%)
 rename target/linux/mvebu/{files-5.10 => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts (100%)
 rename target/linux/mvebu/{files-5.10 => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts 
(100%)
 rename target/linux/mvebu/{files-5.10 => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts (100%)
 delete mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts
 delete mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
 delete mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts
 delete mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts

diff --git 
a/target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
 
b/target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
deleted file mode 100644
index 57f1acf5f1..00
--- 
a/target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
+++ /dev/null
@@ -1,433 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
-/*
- * Device Tree file for Buffalo LinkStation LS421DE
- *
- * Copyright (C) 2020 Daniel González Cabanelas 
- */
-
-/dts-v1/;
-
-#include "armada-370.dtsi"
-#include "mvebu-linkstation-fan.dtsi"
-#include 
-#include 
-#include 
-
-/ {
-   model = "Buffalo LinkStation LS421DE";
-   compatible = "buffalo,ls421de", "marvell,armada370", 
"marvell,armada-370-xp";
-
-   aliases {
-   led-boot = &led_boot;
-   led-failsafe = &led_failsafe;
-   led-running = &led_power;
-   led-upgrade = &led_upgrade;
-   };
-
-   chosen {
-   bootargs = "console=ttyS0,115200 earlyprintk noinitrd 
rootfstype=squashfs";
-   stdout-path = "serial0:115200n8";
-   append-rootblock = "nullparameter="; /* override the bootloader 
args */
-   };
-
-   memory {
-   device_type = "memory";
-   reg = <0x 0x2000>; /* 512 MB */
-   };
-
-   soc {
-   ranges = ;
-   };
-
-   system_fan: gpio_fan {
-   gpios = <&gpio0 13 GPIO_ACTIVE_HIGH
-&gpio0 14 GPIO_ACTIVE_HIGH>;
-   alarm-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
-
-   #cooling-cells = <2>;
-   };
-
-   thermal-zones {
-   hdd-thermal {
-   polling-delay = <2>;
-   polling-delay-passive = <2000>;
-
-   thermal-sensors = <&hdd0_temp>; /* only one drivetemp 
sensor is supported */
-
-   trips {
-   hdd_alert1: trip1 {
-   temperature = <36000>;
-   hysteresis = <2000>;
-   type = "active";
-   };
-   hdd_alert2: trip2 {
-   temperature = <44000>;
-   hysteresis = <2000>;
-   type = "active";
-   };
-   hdd_alert3: trip3 {
-   temperature = <52000>;
-   hysteresis = <2000>;
-

[PATCH v3 0/8] mvebu: add support for Linux 5.10

2021-02-22 Thread Rui Salvaterra
This series adds initial support for 5.10 on mvebu. Build/runtime-tested on a
Turris Omnia, no regressions noticed.

NOTE: The 64-bit Cortex-A{53,72} targets are build-tested only, as I don't have
the hardware.

v3: addressed Tomasz Nowak's review/comments.

v2: generate the kconfig after patching, since patches can (and do) introduce
new kconfig symbols.

Rui Salvaterra (8):
  mvebu: add generic kconfig symbols
  mvebu: refresh the 5.4 kernel configs
  mvebu: copy 5.4 files/patches/kconfigs to 5.10
  mvebu: remove 5.10 upstreamed device trees
  mvebu: refresh 5.10 kconfigs/patches
  mvebu: fix the patch numbering
  mvebu: fix the Turris Omnia device tree
  mvebu: add 5.10 as a testing kernel

 target/linux/generic/config-5.10  |   7 +
 target/linux/mvebu/Makefile   |   2 +-
 target/linux/mvebu/config-5.10| 435 ++
 target/linux/mvebu/config-5.4 |  74 +-
 target/linux/mvebu/cortexa53/config-5.10  |  87 ++
 target/linux/mvebu/cortexa53/config-5.4   | 122 +--
 target/linux/mvebu/cortexa72/config-5.10  |  94 +++
 target/linux/mvebu/cortexa72/config-5.4   | 111 +--
 .../marvell/armada-3720-espressobin-emmc.dts  |   0
 .../marvell/armada-3720-espressobin-ultra.dts |   0
 .../armada-3720-espressobin-v7-emmc.dts   |   0
 .../marvell/armada-3720-espressobin-v7.dts|   0
 ...s-mcbin-singleshot-add-heartbeat-LED.patch |  65 ++
 ...is-omnia-enable-HW-buffer-management.patch |  74 ++
 ...omnia-fix-hardware-buffer-management.patch |  27 +
 ...ure-LED-2--INTn-pin-as-interrupt-pin.patch |  64 ++
 ...Mangle-bootloader-s-kernel-arguments.patch | 208 +
 ...-mvebu-armada-38x-enable-libata-leds.patch |  10 +
 .../patches-5.10/302-add_powertables.patch| 770 ++
 ...3-linksys_hardcode_nand_ecc_settings.patch |  17 +
 .../patches-5.10/304-revert_i2c_delay.patch   |  15 +
 .../305-armada-385-rd-mtd-partitions.patch|  19 +
 .../306-ARM-mvebu-385-ap-Add-partitions.patch |  35 +
 ...-armada-xp-linksys-mamba-broken-idle.patch |  10 +
 .../308-armada-xp-linksys-mamba-wan.patch |  11 +
 .../patches-5.10/309-linksys-status-led.patch |  50 ++
 .../310-linksys-use-eth0-as-cpu-port.patch|  25 +
 .../311-adjust-compatible-for-linksys.patch   |  68 ++
 ...da388-clearfog-emmc-on-clearfog-base.patch |  87 ++
 .../313-helios4-dts-status-led-alias.patch|  28 +
 ...ts-marvell-armada37xx-Add-eth0-alias.patch |  20 +
 ...witch-PHY-operation-mode-to-2500base.patch |  34 +
 .../patches-5.10/400-find_active_root.patch   |  60 ++
 .../700-mvneta-tx-queue-workaround.patch  |  34 +
 ...dicate-failure-to-enter-deeper-sleep.patch |  40 +
 ...-pci-mvebu-time-out-reset-on-link-up.patch |  60 ++
 36 files changed, 2479 insertions(+), 284 deletions(-)
 create mode 100644 target/linux/mvebu/config-5.10
 create mode 100644 target/linux/mvebu/cortexa53/config-5.10
 create mode 100644 target/linux/mvebu/cortexa72/config-5.10
 rename target/linux/mvebu/{files => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts (100%)
 rename target/linux/mvebu/{files => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts (100%)
 rename target/linux/mvebu/{files => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts 
(100%)
 rename target/linux/mvebu/{files => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts (100%)
 create mode 100644 
target/linux/mvebu/patches-5.10/001-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch
 create mode 100644 target/linux/mvebu/patches-5.10/302-add_powertables.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/303-linksys_hardcode_nand_ecc_settings.patch
 create mode 100644 target/linux/mvebu/patches-5.10/304-revert_i2c_delay.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/305-armada-385-rd-mtd-partitions.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/306-ARM-mvebu-385-ap-Add-partitions.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/307-armada-xp-linksys-mamba-broken-idle.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/308-armada-xp-linksys-mamba-wan.patch
 create mode 100644 target/linux/mvebu/patches-5.10/309-linksys-status-led.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/310-linksys-use-eth0-as-cpu-port.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/311-adjust-compatible-for

Re: [PATCH v3 2/8] mvebu: refresh the 5.4 kernel configs

2021-02-22 Thread Rui Salvaterra
Hi, Hauke,

On Mon, 22 Feb 2021 at 10:25, Hauke Mehrtens  wrote:
>
> On 2/22/21 9:59 AM, Rui Salvaterra wrote:
> > Remove the implicit/inherited symbols. While not strictly necessary, this 
> > will
> > make reviewing the diff between 5.4 and 5.10 easier.
> >
> > Signed-off-by: Rui Salvaterra 
> > ---
> >   target/linux/mvebu/config-5.4   |  74 +-
> >   target/linux/mvebu/cortexa53/config-5.4 | 122 +---
> >   target/linux/mvebu/cortexa72/config-5.4 | 111 -
> >   3 files changed, 24 insertions(+), 283 deletions(-)
> >
> Was this done by running "make kernel_oldconfig" and "make
> kernel_oldconfig CONFIG_TARGET=subtarget" ?

Yes. I executed the former once, and the latter for each
(cortexa{53,72}) subtarget.

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v3 4/8] mvebu: remove 5.10 upstreamed device trees

2021-02-22 Thread Rui Salvaterra
Hi, Hauke,

On Mon, 22 Feb 2021 at 10:27, Hauke Mehrtens  wrote:
>
> On 2/22/21 9:59 AM, Rui Salvaterra wrote:
> > At this point, they're either redundant or obsolete. Factor out common 
> > device
> > trees into the files directory.
> >
> > Signed-off-by: Rui Salvaterra 
> > ---
> >   .../boot/dts/armada-370-buffalo-ls421de.dts   | 433 --
> >   .../arm/boot/dts/armada-385-linksys-venom.dts | 213 -
> >   .../dts/marvell/armada-3720-gl-mv1000.dts | 162 ---
> >   .../marvell/armada-3720-espressobin-emmc.dts  |   0
> >   .../marvell/armada-3720-espressobin-ultra.dts |   0
> >   .../armada-3720-espressobin-v7-emmc.dts   |   0
> >   .../marvell/armada-3720-espressobin-v7.dts|   0
> >   .../marvell/armada-3720-espressobin-emmc.dts  |  28 --
> >   .../marvell/armada-3720-espressobin-ultra.dts | 241 --
> >   .../armada-3720-espressobin-v7-emmc.dts   |  43 --
> >   .../marvell/armada-3720-espressobin-v7.dts|  31 --
> >   11 files changed, 1151 deletions(-)
> >   delete mode 100644 
> > target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
> >   delete mode 100644 
> > target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-385-linksys-venom.dts
>
> I think these two files are not yet upstream.

Yes, that's why they're in the files directory (common to all kernels).

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH v3 4/8] mvebu: remove 5.10 upstreamed device trees

2021-02-22 Thread Rui Salvaterra
Hi, Tomasz,

On Mon, 22 Feb 2021 at 16:39, Tomasz Maciej Nowak  wrote:
>
> Single comment inline.
>
> >  delete mode 100644 
> > target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
>
> Do not delete this dts, it's in kernel tree starting from 5.11, so it will be 
> missing and image build for ESPRESSObin Ultra will fail.

Oh, ouch! I guess I was too eager and didn't notice it hadn't been
upstreamed in 5.10. Will fix and respin, thanks a lot for the
review/testing!

Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v4 6/8] mvebu: fix the patch numbering

2021-02-22 Thread Rui Salvaterra
Make each logical patch group numbering contiguous.

Reviewed-by: Tomasz Maciej Nowak 
Tested-by: Tomasz Maciej Nowak 
Signed-off-by: Rui Salvaterra 
---
 ...tch => 001-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch} | 0
 ...tus-led-alias.patch => 313-helios4-dts-status-led-alias.patch} | 0
 ...15-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch} | 0
 3 files changed, 0 insertions(+), 0 deletions(-)
 rename 
target/linux/mvebu/patches-5.10/{028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
 => 001-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch} (100%)
 rename target/linux/mvebu/patches-5.10/{312-helios4-dts-status-led-alias.patch 
=> 313-helios4-dts-status-led-alias.patch} (100%)
 rename 
target/linux/mvebu/patches-5.10/{316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
 => 315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch} (100%)

diff --git 
a/target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
 
b/target/linux/mvebu/patches-5.10/001-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-5.10/028-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
rename to 
target/linux/mvebu/patches-5.10/001-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
diff --git 
a/target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch 
b/target/linux/mvebu/patches-5.10/313-helios4-dts-status-led-alias.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-5.10/312-helios4-dts-status-led-alias.patch
rename to target/linux/mvebu/patches-5.10/313-helios4-dts-status-led-alias.patch
diff --git 
a/target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
 
b/target/linux/mvebu/patches-5.10/315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-5.10/316-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
rename to 
target/linux/mvebu/patches-5.10/315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v4 0/8] mvebu: add support for Linux 5.10

2021-02-22 Thread Rui Salvaterra
This series adds initial support for 5.10 on mvebu. Build/runtime-tested on
both Turris Omnia (me) and ESPRESSObin v5 (Tomasz Nowak).

NOTE: The Cortex-A72 target is build-tested only.

v4: restored the ESPRESSObin Ultra device tree in patch #4, as it's only been
upstreamed in Linux 5.11; added {Reviewed,Tested}-by tags.

v3: addressed Tomasz Nowak's review/comments.

v2: generate the kconfig after patching, since patches can (and do) introduce
new kconfig symbols.

Rui Salvaterra (8):
  mvebu: add generic kconfig symbols
  mvebu: refresh the 5.4 kernel configs
  mvebu: copy 5.4 files/patches/kconfigs to 5.10
  mvebu: remove 5.10 upstreamed device trees
  mvebu: refresh 5.10 kconfigs/patches
  mvebu: fix the patch numbering
  mvebu: fix the Turris Omnia device tree
  mvebu: add 5.10 as a testing kernel

 target/linux/generic/config-5.10  |   7 +
 target/linux/mvebu/Makefile   |   2 +-
 target/linux/mvebu/config-5.10| 435 ++
 target/linux/mvebu/config-5.4 |  74 +-
 target/linux/mvebu/cortexa53/config-5.10  |  87 ++
 target/linux/mvebu/cortexa53/config-5.4   | 122 +--
 target/linux/mvebu/cortexa72/config-5.10  |  94 +++
 target/linux/mvebu/cortexa72/config-5.4   | 111 +--
 .../marvell/armada-3720-espressobin-emmc.dts  |   0
 .../armada-3720-espressobin-v7-emmc.dts   |   0
 .../marvell/armada-3720-espressobin-v7.dts|   0
 ...s-mcbin-singleshot-add-heartbeat-LED.patch |  65 ++
 ...is-omnia-enable-HW-buffer-management.patch |  74 ++
 ...omnia-fix-hardware-buffer-management.patch |  27 +
 ...ure-LED-2--INTn-pin-as-interrupt-pin.patch |  64 ++
 ...Mangle-bootloader-s-kernel-arguments.patch | 208 +
 ...-mvebu-armada-38x-enable-libata-leds.patch |  10 +
 .../patches-5.10/302-add_powertables.patch| 770 ++
 ...3-linksys_hardcode_nand_ecc_settings.patch |  17 +
 .../patches-5.10/304-revert_i2c_delay.patch   |  15 +
 .../305-armada-385-rd-mtd-partitions.patch|  19 +
 .../306-ARM-mvebu-385-ap-Add-partitions.patch |  35 +
 ...-armada-xp-linksys-mamba-broken-idle.patch |  10 +
 .../308-armada-xp-linksys-mamba-wan.patch |  11 +
 .../patches-5.10/309-linksys-status-led.patch |  50 ++
 .../310-linksys-use-eth0-as-cpu-port.patch|  25 +
 .../311-adjust-compatible-for-linksys.patch   |  68 ++
 ...da388-clearfog-emmc-on-clearfog-base.patch |  87 ++
 .../313-helios4-dts-status-led-alias.patch|  28 +
 ...ts-marvell-armada37xx-Add-eth0-alias.patch |  20 +
 ...witch-PHY-operation-mode-to-2500base.patch |  34 +
 .../patches-5.10/400-find_active_root.patch   |  60 ++
 .../700-mvneta-tx-queue-workaround.patch  |  34 +
 ...dicate-failure-to-enter-deeper-sleep.patch |  40 +
 ...-pci-mvebu-time-out-reset-on-link-up.patch |  60 ++
 35 files changed, 2479 insertions(+), 284 deletions(-)
 create mode 100644 target/linux/mvebu/config-5.10
 create mode 100644 target/linux/mvebu/cortexa53/config-5.10
 create mode 100644 target/linux/mvebu/cortexa72/config-5.10
 rename target/linux/mvebu/{files => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts (100%)
 rename target/linux/mvebu/{files => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts 
(100%)
 rename target/linux/mvebu/{files => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts (100%)
 create mode 100644 
target/linux/mvebu/patches-5.10/001-arm64-dts-mcbin-singleshot-add-heartbeat-LED.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/301-mvebu-armada-38x-enable-libata-leds.patch
 create mode 100644 target/linux/mvebu/patches-5.10/302-add_powertables.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/303-linksys_hardcode_nand_ecc_settings.patch
 create mode 100644 target/linux/mvebu/patches-5.10/304-revert_i2c_delay.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/305-armada-385-rd-mtd-partitions.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/306-ARM-mvebu-385-ap-Add-partitions.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/307-armada-xp-linksys-mamba-broken-idle.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/308-armada-xp-linksys-mamba-wan.patch
 create mode 100644 target/linux/mvebu/patches-5.10/309-linksys-status-led.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/310-linksys-use-eth0-as-cpu-port.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/311-adjust-compatible-for-linksys.patch
 create mode 100644 
target/linux/mvebu/patch

[PATCH v4 1/8] mvebu: add generic kconfig symbols

2021-02-22 Thread Rui Salvaterra
This will make the specific kconfig smaller.

Reviewed-by: Tomasz Maciej Nowak 
Tested-by: Tomasz Maciej Nowak 
Signed-off-by: Rui Salvaterra 
---
 target/linux/generic/config-5.10 | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10
index 7148ce7912..5bdf9a2e9f 100644
--- a/target/linux/generic/config-5.10
+++ b/target/linux/generic/config-5.10
@@ -232,6 +232,7 @@ CONFIG_ARCH_MMAP_RND_BITS_MIN=8
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
 # CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_MSTARV7 is not set
 # CONFIG_ARCH_MULTIPLATFORM is not set
 # CONFIG_ARCH_MULTI_V6 is not set
 # CONFIG_ARCH_MULTI_V7 is not set
@@ -1040,6 +1041,7 @@ CONFIG_CRYPTO_ALGAPI2=y
 # CONFIG_CRYPTO_CTR is not set
 # CONFIG_CRYPTO_CTS is not set
 # CONFIG_CRYPTO_CURVE25519 is not set
+# CONFIG_CRYPTO_CURVE25519_NEON is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_DES is not set
 # CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set
@@ -1264,7 +1266,9 @@ CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
 # CONFIG_DEBUG_TIMEKEEPING is not set
 # CONFIG_DEBUG_UART_8250_PALMCHIP is not set
+# CONFIG_DEBUG_UART_8250_WORD is not set
 # CONFIG_DEBUG_UART_BCM63XX is not set
+# CONFIG_DEBUG_UART_FLOW_CONTROL is not set
 # CONFIG_DEBUG_USER is not set
 # CONFIG_DEBUG_VIRTUAL is not set
 # CONFIG_DEBUG_VM is not set
@@ -2906,6 +2910,7 @@ CONFIG_LEDS_TRIGGER_NETDEV=y
 # CONFIG_LEDS_TRIGGER_PATTERN is not set
 CONFIG_LEDS_TRIGGER_TIMER=y
 # CONFIG_LEDS_TRIGGER_TRANSIENT is not set
+# CONFIG_LEDS_TURRIS_OMNIA is not set
 # CONFIG_LEDS_USER is not set
 # CONFIG_LED_TRIGGER_PHY is not set
 # CONFIG_LEGACY_PTYS is not set
@@ -4741,6 +4746,7 @@ CONFIG_RTC_DRV_CMOS=y
 # CONFIG_RTC_DRV_RTC7301 is not set
 # CONFIG_RTC_DRV_RV3028 is not set
 # CONFIG_RTC_DRV_RV3029C2 is not set
+# CONFIG_RTC_DRV_RV3032 is not set
 # CONFIG_RTC_DRV_RV8803 is not set
 # CONFIG_RTC_DRV_RX4581 is not set
 # CONFIG_RTC_DRV_RX6110 is not set
@@ -4986,6 +4992,7 @@ CONFIG_SELECT_MEMORY_MODEL=y
 # CONFIG_SENSORS_CORSAIR_CPRO is not set
 # CONFIG_SENSORS_DELL_SMM is not set
 # CONFIG_SENSORS_DME1737 is not set
+# CONFIG_SENSORS_DRIVETEMP is not set
 # CONFIG_SENSORS_DS1621 is not set
 # CONFIG_SENSORS_DS620 is not set
 # CONFIG_SENSORS_EMC1403 is not set
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v4 7/8] mvebu: fix the Turris Omnia device tree

2021-02-22 Thread Rui Salvaterra
Enable and fix hardware buffer management. Also fix the IRQ storm caused by a
misconfiguration of the PCA9538 interrupt pin.

Reviewed-by: Tomasz Maciej Nowak 
Tested-by: Tomasz Maciej Nowak 
Signed-off-by: Rui Salvaterra 
---
 ...is-omnia-enable-HW-buffer-management.patch | 74 +++
 ...omnia-fix-hardware-buffer-management.patch | 27 +++
 ...ure-LED-2--INTn-pin-as-interrupt-pin.patch | 64 
 3 files changed, 165 insertions(+)
 create mode 100644 
target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
 create mode 100644 
target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch

diff --git 
a/target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
 
b/target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
new file mode 100644
index 00..7a4b511998
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
@@ -0,0 +1,74 @@
+From 018b88eee1a2efda26ed2f09aab33ccdc40ef18f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= 
+Date: Sun, 15 Nov 2020 14:59:17 +0100
+Subject: ARM: dts: turris-omnia: enable HW buffer management
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The buffer manager is available on Turris Omnia but needs to be
+described in device-tree to be used.
+
+Signed-off-by: Marek Behún 
+Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
+Cc: linux-arm-ker...@lists.infradead.org
+Cc: Uwe Kleine-König 
+Cc: Jason Cooper 
+Cc: Gregory CLEMENT 
+Cc: Andreas Färber 
+Cc: Andrew Lunn 
+Cc: Rob Herring 
+Cc: devicet...@vger.kernel.org
+Signed-off-by: Gregory CLEMENT 
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +
+ 1 file changed, 17 insertions(+)
+
+(limited to 'arch/arm/boot/dts/armada-385-turris-omnia.dts')
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -84,12 +84,23 @@
+   };
+ };
+ 
++&bm {
++  status = "okay";
++};
++
++&bm_bppi {
++  status = "okay";
++};
++
+ /* Connected to 88E6176 switch, port 6 */
+ ð0 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&ge0_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <0>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -103,6 +114,9 @@
+   pinctrl-0 = <&ge1_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <1>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -115,6 +129,9 @@
+   status = "okay";
+   phy-mode = "sgmii";
+   phy = <&phy1>;
++  buffer-manager = <&bm>;
++  bm,pool-long = <2>;
++  bm,pool-short = <3>;
+ };
+ 
+ &i2c0 {
diff --git 
a/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
 
b/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
new file mode 100644
index 000000..2ebdc06f61
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
@@ -0,0 +1,27 @@
+From 9704292ed3230ee19dc4dd64f7484301b728ffb7 Mon Sep 17 00:00:00 2001
+From: Rui Salvaterra 
+Date: Wed, 17 Feb 2021 15:19:30 +
+Subject: [PATCH] ARM: dts: turris-omnia: fix hardware buffer management
+
+Hardware buffer management has never worked on the Turris Omnia, as the
+required MBus window hadn't been reserved. Fix thusly.
+
+Fixes: 018b88eee1a2 ("ARM: dts: turris-omnia: enable HW buffer management")
+
+Signed-off-by: Rui Salvaterra 
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -32,7 +32,8 @@
+   ranges = ;
++MBUS_ID(0x09, 0x15) 0 0xf111 0x1
++MBUS_ID(0x0c, 0x04) 0 0xf120 0x10>;
+ 
+   internal-regs {
+ 
diff --git 
a/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch
 
b/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch
new file mode 100644
index 00..c7509950e0
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.10/101-

[PATCH v4 2/8] mvebu: refresh the 5.4 kernel configs

2021-02-22 Thread Rui Salvaterra
Remove the implicit/inherited symbols. While not strictly necessary, this will
make reviewing the diff between 5.4 and 5.10 easier.

Reviewed-by: Tomasz Maciej Nowak 
Tested-by: Tomasz Maciej Nowak 
Signed-off-by: Rui Salvaterra 
---
 target/linux/mvebu/config-5.4   |  74 +-
 target/linux/mvebu/cortexa53/config-5.4 | 122 +---
 target/linux/mvebu/cortexa72/config-5.4 | 111 -
 3 files changed, 24 insertions(+), 283 deletions(-)

diff --git a/target/linux/mvebu/config-5.4 b/target/linux/mvebu/config-5.4
index 2858408064..beeecd138e 100644
--- a/target/linux/mvebu/config-5.4
+++ b/target/linux/mvebu/config-5.4
@@ -2,22 +2,6 @@ CONFIG_AHCI_MVEBU=y
 CONFIG_ALIGNMENT_TRAP=y
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
-CONFIG_ARCH_HAS_BINFMT_FLAT=y
-CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
-CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
-CONFIG_ARCH_HAS_KCOV=y
-CONFIG_ARCH_HAS_KEEPINITRD=y
-CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
-CONFIG_ARCH_HAS_PHYS_TO_DMA=y
-CONFIG_ARCH_HAS_SETUP_DMA_OPS=y
-CONFIG_ARCH_HAS_SET_MEMORY=y
-CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
-CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
-CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y
-CONFIG_ARCH_HAS_TICK_BROADCAST=y
-CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_KEEP_MEMBLOCK=y
 CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
@@ -28,16 +12,7 @@ CONFIG_ARCH_MVEBU=y
 CONFIG_ARCH_NR_GPIO=0
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
-CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
-CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
-CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y
-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_ARCH_WANT_LIBATA_LEDS=y
 CONFIG_ARM=y
 CONFIG_ARMADA_370_CLK=y
 CONFIG_ARMADA_370_XP_IRQ=y
@@ -70,8 +45,8 @@ CONFIG_ARM_UNWIND=y
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
 CONFIG_ATA=y
-CONFIG_ATA_LEDS=y
 CONFIG_ATAGS=y
+CONFIG_ATA_LEDS=y
 CONFIG_AUTO_ZRELADDR=y
 CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
 CONFIG_BLK_DEV_LOOP=y
@@ -81,7 +56,6 @@ CONFIG_BLK_SCSI_REQUEST=y
 CONFIG_BOUNCE=y
 # CONFIG_CACHE_FEROCEON_L2 is not set
 CONFIG_CACHE_L2X0=y
-CONFIG_CC_HAS_KASAN_GENERIC=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y
 CONFIG_CLKSRC_MMIO=y
@@ -207,6 +181,7 @@ CONFIG_GENERIC_SCHED_CLOCK=y
 CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GENERIC_STRNCPY_FROM_USER=y
 CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GLOB=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIOLIB_IRQCHIP=y
@@ -215,55 +190,14 @@ CONFIG_GPIO_GENERIC_PLATFORM=y
 CONFIG_GPIO_MVEBU=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_PCA953X_IRQ=y
+CONFIG_GRO_CELLS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDEN_BRANCH_PREDICTOR=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
-CONFIG_HAVE_ARCH_AUDITSYSCALL=y
-CONFIG_HAVE_ARCH_BITREVERSE=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_PFN_VALID=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_ARM_SCU=y
-CONFIG_HAVE_ARM_SMCCC=y
-CONFIG_HAVE_ARM_TWD=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_COPY_THREAD_TLS=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
-CONFIG_HAVE_EBPF_JIT=y
-CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_OPTPROBES=y
-CONFIG_HAVE_PCI=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_PERF_REGS=y
-CONFIG_HAVE_PERF_USER_STACK_DUMP=y
-CONFIG_HAVE_PROC_CPU=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_RSEQ=y
 CONFIG_HAVE_SMP=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_UID16=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HIGHMEM=y
 # CONFIG_HIGHPTE is not set
 CONFIG_HOTPLUG_CPU=y
@@ -279,7 +213,6 @@ CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_MV64XXX=y
 # CONFIG_I2C_PXA is not set
-# CONFIG_I2C_PXA_SLAVE is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IRQCHIP=y
 CONFIG_IRQ_DOMAIN=y
@@ -378,6 +311,7 @@ CONFIG_OUTER_CACHE=y
 CONFIG_OUTER_CACHE_SYNC=y
 CONFIG_PADATA=y
 CONFIG_PAGE_OFFSET=0xC000
+CONFIG_PAGE_POOL=y
 CONFIG_PCI=y
 CONFIG_PCI_BRIDGE_EMUL=y
 CONFIG_PCI_DOMAINS=y
diff --git a/target/linux/mvebu/cortexa53/config-5.4 
b/target/linux/mvebu/cortexa53/config-5.4
index cc44f997da..79d53932d0 100644
--- a/target/linux/mvebu/cortexa53/config-5.4
+++ b/ta

[PATCH v4 8/8] mvebu: add 5.10 as a testing kernel

2021-02-22 Thread Rui Salvaterra
Keep 5.4 as stable until further validation.

Reviewed-by: Tomasz Maciej Nowak 
Tested-by: Tomasz Maciej Nowak 
Signed-off-by: Rui Salvaterra 
---
 target/linux/mvebu/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile
index 1e67bcfacb..1550309a92 100644
--- a/target/linux/mvebu/Makefile
+++ b/target/linux/mvebu/Makefile
@@ -10,7 +10,7 @@ FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk 
boot-part rootfs-part
 SUBTARGETS:=cortexa9 cortexa53 cortexa72
 
 KERNEL_PATCHVER:=5.4
-KERNEL_TESTING_PATCHVER:=5.4
+KERNEL_TESTING_PATCHVER:=5.10
 
 include $(INCLUDE_DIR)/target.mk
 
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v4 4/8] mvebu: remove 5.10 upstreamed device trees

2021-02-22 Thread Rui Salvaterra
At this point, they're either redundant or obsolete. Factor out common device
trees into the files directory.

Reviewed-by: Tomasz Maciej Nowak 
Tested-by: Tomasz Maciej Nowak 
Signed-off-by: Rui Salvaterra 
---
 .../boot/dts/armada-370-buffalo-ls421de.dts   | 433 --
 .../arm/boot/dts/armada-385-linksys-venom.dts | 213 -
 .../marvell/armada-3720-espressobin-ultra.dts | 241 --
 .../dts/marvell/armada-3720-gl-mv1000.dts | 162 ---
 .../marvell/armada-3720-espressobin-emmc.dts  |   0
 .../armada-3720-espressobin-v7-emmc.dts   |   0
 .../marvell/armada-3720-espressobin-v7.dts|   0
 .../marvell/armada-3720-espressobin-emmc.dts  |  28 --
 .../armada-3720-espressobin-v7-emmc.dts   |  43 --
 .../marvell/armada-3720-espressobin-v7.dts|  31 --
 10 files changed, 1151 deletions(-)
 delete mode 100644 
target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
 delete mode 100644 
target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-385-linksys-venom.dts
 delete mode 100644 
target/linux/mvebu/files-5.10/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
 delete mode 100644 
target/linux/mvebu/files-5.10/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
 rename target/linux/mvebu/{files-5.10 => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts (100%)
 rename target/linux/mvebu/{files-5.10 => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts 
(100%)
 rename target/linux/mvebu/{files-5.10 => 
files-5.4}/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts (100%)
 delete mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts
 delete mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts
 delete mode 100644 
target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts

diff --git 
a/target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
 
b/target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
deleted file mode 100644
index 57f1acf5f1..00
--- 
a/target/linux/mvebu/files-5.10/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
+++ /dev/null
@@ -1,433 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
-/*
- * Device Tree file for Buffalo LinkStation LS421DE
- *
- * Copyright (C) 2020 Daniel González Cabanelas 
- */
-
-/dts-v1/;
-
-#include "armada-370.dtsi"
-#include "mvebu-linkstation-fan.dtsi"
-#include 
-#include 
-#include 
-
-/ {
-   model = "Buffalo LinkStation LS421DE";
-   compatible = "buffalo,ls421de", "marvell,armada370", 
"marvell,armada-370-xp";
-
-   aliases {
-   led-boot = &led_boot;
-   led-failsafe = &led_failsafe;
-   led-running = &led_power;
-   led-upgrade = &led_upgrade;
-   };
-
-   chosen {
-   bootargs = "console=ttyS0,115200 earlyprintk noinitrd 
rootfstype=squashfs";
-   stdout-path = "serial0:115200n8";
-   append-rootblock = "nullparameter="; /* override the bootloader 
args */
-   };
-
-   memory {
-   device_type = "memory";
-   reg = <0x 0x2000>; /* 512 MB */
-   };
-
-   soc {
-   ranges = ;
-   };
-
-   system_fan: gpio_fan {
-   gpios = <&gpio0 13 GPIO_ACTIVE_HIGH
-&gpio0 14 GPIO_ACTIVE_HIGH>;
-   alarm-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
-
-   #cooling-cells = <2>;
-   };
-
-   thermal-zones {
-   hdd-thermal {
-   polling-delay = <2>;
-   polling-delay-passive = <2000>;
-
-   thermal-sensors = <&hdd0_temp>; /* only one drivetemp 
sensor is supported */
-
-   trips {
-   hdd_alert1: trip1 {
-   temperature = <36000>;
-   hysteresis = <2000>;
-   type = "active";
-   };
-   hdd_alert2: trip2 {
-   temperature = <44000>;
-   hysteresis = <2000>;
-   type = "active";
-   };
-   hdd_alert3: trip3 {
-   temperature = <52000>;
-   hysteresis = <2000>;
-   type = "passive";
-  

[PATCH] mvebu/omnia: fix the device tree

2021-02-23 Thread Rui Salvaterra
Backport [1] and fix [2] hardware buffer management. Also fix the IRQ storm
caused by a misconfiguration of the PCA9538 interrupt pin [3].

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/armada-385-turris-omnia.dts?id=018b88eee1a2efda26ed2f09aab33ccdc40ef18f
[2] 
https://lore.kernel.org/linux-arm-kernel/20210217153038.1068170-1-rsalvate...@gmail.com/
[3] 
https://lore.kernel.org/linux-arm-kernel/20210220231144.32325-1-ka...@kernel.org/

Signed-off-by: Rui Salvaterra 
---
This is against master/5.4, but it needs to be applied to the 21.02 branch too.
As the stable kernel gets updated, it's expected patches 318 and 319 to become
obsolete.

 ...is-omnia-enable-HW-buffer-management.patch | 74 +++
 ...omnia-fix-hardware-buffer-management.patch | 27 +++
 ...ure-LED-2--INTn-pin-as-interrupt-pin.patch | 64 
 3 files changed, 165 insertions(+)
 create mode 100644 
target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
 create mode 100644 
target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
 create mode 100644 
target/linux/mvebu/patches-5.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch

diff --git 
a/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
 
b/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
new file mode 100644
index 00..7a4b511998
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch
@@ -0,0 +1,74 @@
+From 018b88eee1a2efda26ed2f09aab33ccdc40ef18f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marek=20Beh=C3=BAn?= 
+Date: Sun, 15 Nov 2020 14:59:17 +0100
+Subject: ARM: dts: turris-omnia: enable HW buffer management
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The buffer manager is available on Turris Omnia but needs to be
+described in device-tree to be used.
+
+Signed-off-by: Marek Behún 
+Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia")
+Cc: linux-arm-ker...@lists.infradead.org
+Cc: Uwe Kleine-König 
+Cc: Jason Cooper 
+Cc: Gregory CLEMENT 
+Cc: Andreas Färber 
+Cc: Andrew Lunn 
+Cc: Rob Herring 
+Cc: devicet...@vger.kernel.org
+Signed-off-by: Gregory CLEMENT 
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +
+ 1 file changed, 17 insertions(+)
+
+(limited to 'arch/arm/boot/dts/armada-385-turris-omnia.dts')
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -84,12 +84,23 @@
+   };
+ };
+ 
++&bm {
++  status = "okay";
++};
++
++&bm_bppi {
++  status = "okay";
++};
++
+ /* Connected to 88E6176 switch, port 6 */
+ ð0 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&ge0_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <0>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -103,6 +114,9 @@
+   pinctrl-0 = <&ge1_rgmii_pins>;
+   status = "okay";
+   phy-mode = "rgmii";
++  buffer-manager = <&bm>;
++  bm,pool-long = <1>;
++  bm,pool-short = <3>;
+ 
+   fixed-link {
+   speed = <1000>;
+@@ -115,6 +129,9 @@
+   status = "okay";
+   phy-mode = "sgmii";
+   phy = <&phy1>;
++  buffer-manager = <&bm>;
++  bm,pool-long = <2>;
++  bm,pool-short = <3>;
+ };
+ 
+ &i2c0 {
diff --git 
a/target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
 
b/target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
new file mode 100644
index 00..a3f41fb5cb
--- /dev/null
+++ 
b/target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch
@@ -0,0 +1,27 @@
+From 9704292ed3230ee19dc4dd64f7484301b728ffb7 Mon Sep 17 00:00:00 2001
+From: Rui Salvaterra 
+Date: Wed, 17 Feb 2021 15:19:30 +
+Subject: [PATCH] ARM: dts: turris-omnia: fix hardware buffer management
+
+Hardware buffer management has never worked on the Turris Omnia, as the
+required MBus window hadn't been reserved. Fix thusly.
+
+Fixes: 018b88eee1a2 ("ARM: dts: turris-omnia: enable HW buffer management")
+
+Signed-off-by: Rui Salvaterra 
+---
+ arch/arm/boot/dts/armada-385-turris-omnia.dts | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts
 b/arch/arm/boot/dts/armada-385-turris-omnia.dts
+@@ -31,7 +31,8 @@
+   ranges = ;
++MBUS_ID(0x09, 0x15) 0 0xf111

[PATCH] kernel/modules: fix CDC NCM dependencies

2021-02-28 Thread Rui Salvaterra
CDC NCM support only depends on CDC Ethernet with Linux 5.10. Fix thusly.

Signed-off-by: Rui Salvaterra 
---
 package/kernel/linux/modules/usb.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/usb.mk 
b/package/kernel/linux/modules/usb.mk
index e7498af31c..962cb39002 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -1387,7 +1387,7 @@ define KernelPackage/usb-net-cdc-ncm
   KCONFIG:=CONFIG_USB_NET_CDC_NCM
   FILES:= $(LINUX_DIR)/drivers/$(USBNET_DIR)/cdc_ncm.ko
   AUTOLOAD:=$(call AutoProbe,cdc_ncm)
-  $(call AddDepends/usb-net,+kmod-usb-net-cdc-ether)
+  $(call AddDepends/usb-net,+LINUX_5_10:kmod-usb-net-cdc-ether)
 endef
 
 define KernelPackage/usb-net-cdc-ncm/description
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2] kernel/modules: fix CDC NCM dependencies

2021-03-03 Thread Rui Salvaterra
CDC NCM support only depends on CDC Ethernet with Linux 5.10. Fix thusly.

Signed-off-by: Rui Salvaterra 
---
v2: Invert the kernel version check.

 package/kernel/linux/modules/usb.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/usb.mk 
b/package/kernel/linux/modules/usb.mk
index e7498af31c..9ef3fb5974 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -1387,7 +1387,7 @@ define KernelPackage/usb-net-cdc-ncm
   KCONFIG:=CONFIG_USB_NET_CDC_NCM
   FILES:= $(LINUX_DIR)/drivers/$(USBNET_DIR)/cdc_ncm.ko
   AUTOLOAD:=$(call AutoProbe,cdc_ncm)
-  $(call AddDepends/usb-net,+kmod-usb-net-cdc-ether)
+  $(call AddDepends/usb-net,+!LINUX_5_4:kmod-usb-net-cdc-ether)
 endef
 
 define KernelPackage/usb-net-cdc-ncm/description
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] iproute2: fix build with a newer toolchain

2021-03-03 Thread Rui Salvaterra
GCC 10.2.0 complains loudly of missing limits.h. Add a patch to fix this.

Signed-off-by: Rui Salvaterra 
---
 .../050-fix-build-include-limits.patch| 23 +++
 1 file changed, 23 insertions(+)
 create mode 100644 
package/network/utils/iproute2/patches/050-fix-build-include-limits.patch

diff --git 
a/package/network/utils/iproute2/patches/050-fix-build-include-limits.patch 
b/package/network/utils/iproute2/patches/050-fix-build-include-limits.patch
new file mode 100644
index 00..df7d9a0fb7
--- /dev/null
+++ b/package/network/utils/iproute2/patches/050-fix-build-include-limits.patch
@@ -0,0 +1,23 @@
+--- a/lib/bpf_glue.c
 b/lib/bpf_glue.c
+@@ -4,6 +4,9 @@
+  * Authors:   Hangbin Liu 
+  *
+  */
++
++#include 
++
+ #include "bpf_util.h"
+ #ifdef HAVE_LIBBPF
+ #include 
+--- a/lib/bpf_libbpf.c
 b/lib/bpf_libbpf.c
+@@ -5,6 +5,8 @@
+  *
+  */
+ 
++#include 
++
+ #include 
+ #include 
+ #include 
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] iproute2: fix build with a newer toolchain

2021-03-05 Thread Rui Salvaterra
Hi,

On Wed, 3 Mar 2021 at 20:48, Rui Salvaterra  wrote:
>
> GCC 10.2.0 complains loudly of missing limits.h. Add a patch to fix this.
>
> Signed-off-by: Rui Salvaterra 

As a side note, I tried building from a pristine master today and tc
*always* fails to build for me, being a -j n or at -j 1 (that should
exclude possible race conditions). It's not possible I'm the only one
seeing this. :/

Cheers,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] kernel: backport GCC 10 usbip build fix for 5.4

2021-03-05 Thread Rui Salvaterra
>From the original commit message:

"With GCC 10, building usbip triggers error for multiple definition
of 'udev_context', in:
- libsrc/vhci_driver.c:18 and
- libsrc/usbip_host_common.c:27.

Declare as extern the definition in libsrc/usbip_host_common.c."

Signed-off-by: Rui Salvaterra 
---
 ...-build-error-for-multiple-definition.patch | 33 +++
 1 file changed, 33 insertions(+)
 create mode 100644 
target/linux/generic/backport-5.4/831-v5.9-usbip-tools-fix-build-error-for-multiple-definition.patch

diff --git 
a/target/linux/generic/backport-5.4/831-v5.9-usbip-tools-fix-build-error-for-multiple-definition.patch
 
b/target/linux/generic/backport-5.4/831-v5.9-usbip-tools-fix-build-error-for-multiple-definition.patch
new file mode 100644
index 00..03f27fb528
--- /dev/null
+++ 
b/target/linux/generic/backport-5.4/831-v5.9-usbip-tools-fix-build-error-for-multiple-definition.patch
@@ -0,0 +1,33 @@
+From d5efc2e6b98fe661dbd8dd0d5d5bfb961728e57a Mon Sep 17 00:00:00 2001
+From: Antonio Borneo 
+Date: Thu, 18 Jun 2020 02:08:44 +0200
+Subject: usbip: tools: fix build error for multiple definition
+
+With GCC 10, building usbip triggers error for multiple definition
+of 'udev_context', in:
+- libsrc/vhci_driver.c:18 and
+- libsrc/usbip_host_common.c:27.
+
+Declare as extern the definition in libsrc/usbip_host_common.c.
+
+Signed-off-by: Antonio Borneo 
+Acked-by: Shuah Khan 
+Link: 
https://lore.kernel.org/r/20200618000844.1048309-1-borneo.anto...@gmail.com
+Signed-off-by: Greg Kroah-Hartman 
+---
+ tools/usb/usbip/libsrc/usbip_host_common.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+(limited to 'tools/usb/usbip')
+
+--- a/tools/usb/usbip/libsrc/usbip_host_common.c
 b/tools/usb/usbip/libsrc/usbip_host_common.c
+@@ -23,7 +23,7 @@
+ #include "list.h"
+ #include "sysfs_utils.h"
+ 
+-struct udev *udev_context;
++extern struct udev *udev_context;
+ 
+ static int32_t read_attr_usbip_status(struct usbip_usb_device *udev)
+ {
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] mac80211: rtl: update RTL8821AE PHY/RF parameters

2021-03-08 Thread Rui Salvaterra
Create a new directory for Realtek patches and backport the updated PHY and RF
parameters patch. Improves the connectivity in the 5 GHz band [1].

[1] 
https://patchwork.kernel.org/project/linux-wireless/patch/20210219052607.7323-1-pks...@realtek.com/#23988567

Signed-off-by: Rui Salvaterra 
---
 package/kernel/mac80211/Makefile  |   2 +
 ...8821ae-upgrade-PHY-and-RF-parameters.patch | 817 ++
 2 files changed, 819 insertions(+)
 create mode 100644 
package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index f6ad06452f..b92df681cb 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -504,6 +504,7 @@ define Build/Patch
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
+   $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rtl,rtl/)
$(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
 endef
 
@@ -514,6 +515,7 @@ define Quilt/Refresh/Package
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
+   $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rtl,rtl/)
 endef
 
 define Build/Compile
diff --git 
a/package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch
 
b/package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch
new file mode 100644
index 00..7b6cd99d82
--- /dev/null
+++ 
b/package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch
@@ -0,0 +1,817 @@
+From 8f392a72419c4b10e84e635e51bee24670975364 Mon Sep 17 00:00:00 2001
+From: Ping-Ke Shih 
+Date: Fri, 19 Feb 2021 13:26:07 +0800
+Subject: [PATCH] rtlwifi: 8821ae: upgrade PHY and RF parameters
+
+New parameters with new format and its parser are updated by the
+commit 84d26fda52e2 ("rtlwifi: Update 8821ae new phy parameters and its 
parser."),
+but some parameters are missing. Use this commit to update to the novel
+parameters that use new format.
+
+Fixes: 84d26fda52e2 ("rtlwifi: Update 8821ae new phy parameters and its 
parser")
+Signed-off-by: Ping-Ke Shih 
+Tested-by: Kai-Heng Feng 
+---
+ .../realtek/rtlwifi/rtl8821ae/table.c | 500 +-
+ 1 file changed, 370 insertions(+), 130 deletions(-)
+
+--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c
 b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c
+@@ -249,7 +249,7 @@ u32 RTL8821AE_PHY_REG_ARRAY[] = {
+   0x824, 0x00030FE0,
+   0x828, 0x,
+   0x82C, 0x002081DD,
+-  0x830, 0x2AAA8E24,
++  0x830, 0x2AAAEEC8,
+   0x834, 0x0037A706,
+   0x838, 0x06489B44,
+   0x83C, 0x095B,
+@@ -324,10 +324,10 @@ u32 RTL8821AE_PHY_REG_ARRAY[] = {
+   0x9D8, 0x,
+   0x9DC, 0x,
+   0x9E0, 0x5D00,
+-  0x9E4, 0x0002,
++  0x9E4, 0x0003,
+   0x9E8, 0x0001,
+   0xA00, 0x00D047C8,
+-  0xA04, 0x01FF000C,
++  0xA04, 0x01FF800C,
+   0xA08, 0x8C8A8300,
+   0xA0C, 0x2E68000F,
+   0xA10, 0x9500BB78,
+@@ -1320,7 +1320,11 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
+   0x083, 0x00021800,
+   0x084, 0x00028000,
+   0x085, 0x00048000,
++  0x8111, 0x, 0x4000, 0x,
++  0x086, 0x0009483A,
++  0xA000, 0x,
+   0x086, 0x00094838,
++  0xB000, 0x,
+   0x087, 0x00044980,
+   0x088, 0x00048000,
+   0x089, 0xD480,
+@@ -1409,36 +1413,32 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
+   0x03C, 0x000CA000,
+   0x0EF, 0x,
+   0x0EF, 0x1100,
+-  0xFF0F0104, 0xABCD,
++  0x8111, 0x, 0x4000, 0x,
+   0x034, 0x0004ADF3,
+   0x034, 0x00049DF0,
+-  0xFF0F0204, 0xCDEF,
++  0x9110, 0x, 0x4000, 0x,
+   0x034, 0x0004ADF3,
+   0x034, 0x00049DF0,
+-  0xFF0F0404, 0xCDEF,
+-  0x034, 0x0004ADF3,
+-  0x034, 0x00049DF0,
+-  0xFF0F0200, 0xCDEF,
++  0x9210, 0x, 0x4000, 0x,
+   0x034, 0x0004ADF5,
+   0x034, 0x00049DF2,
+-  0xFF0F02C0, 0xCDEF,
++  0x920c, 0x, 0x4000, 0x,
++  0x034, 0x0004A0F3,
++  0x034, 0x000490B1,
++  0x940c, 0x, 0x4000, 0x,
+   0x034, 0x0004A0F3,
+   0x034, 0x000490B1

[PATCH] odhcp6c: add a odhcp6c.user placeholder script

2021-03-09 Thread Rui Salvaterra
Document the existence of this feature. This allows the user to execute a script
at each DHCPv6 event. This is useful, for example, as an ad-hoc way to update a
DDNS entry when (and only when) required.

Signed-off-by: Rui Salvaterra 
---
 package/network/ipv6/odhcp6c/Makefile   | 8 +++-
 package/network/ipv6/odhcp6c/files/odhcp6c.user | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 package/network/ipv6/odhcp6c/files/odhcp6c.user

diff --git a/package/network/ipv6/odhcp6c/Makefile 
b/package/network/ipv6/odhcp6c/Makefile
index c9eaaedb19..b3b2ea11fb 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcp6c
-PKG_RELEASE:=16
+PKG_RELEASE:=17
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
@@ -42,12 +42,18 @@ define Package/odhcp6c/config
 default 0
 endef
 
+define Package/odhcp6c/conffiles
+/etc/odhcp6c.user
+endef
+
 define Package/odhcp6c/install
$(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcp6c $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/lib/netifd/proto
$(INSTALL_BIN) ./files/dhcpv6.sh $(1)/lib/netifd/proto/dhcpv6.sh
$(INSTALL_BIN) ./files/dhcpv6.script $(1)/lib/netifd/
+   $(INSTALL_DIR) $(1)/etc/
+   $(INSTALL_CONF) ./files/odhcp6c.user $(1)/etc/
 endef
 
 $(eval $(call BuildPackage,odhcp6c))
diff --git a/package/network/ipv6/odhcp6c/files/odhcp6c.user 
b/package/network/ipv6/odhcp6c/files/odhcp6c.user
new file mode 100644
index 00..f15a1b1761
--- /dev/null
+++ b/package/network/ipv6/odhcp6c/files/odhcp6c.user
@@ -0,0 +1 @@
+# This script is sourced by odhcp6c's dhcpv6.script at every DHCPv6 event.
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] odhcp6c: add a odhcp6c.user placeholder script

2021-03-09 Thread Rui Salvaterra
Document the existence of this feature. This allows the user to execute a script
at each DHCPv6 event. This is useful, for example, as an ad-hoc way to update a
DDNS entry when (and only when) required.

Signed-off-by: Rui Salvaterra 
---
 package/network/ipv6/odhcp6c/Makefile   | 8 +++-
 package/network/ipv6/odhcp6c/files/odhcp6c.user | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 package/network/ipv6/odhcp6c/files/odhcp6c.user

diff --git a/package/network/ipv6/odhcp6c/Makefile 
b/package/network/ipv6/odhcp6c/Makefile
index c9eaaedb19..b3b2ea11fb 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcp6c
-PKG_RELEASE:=16
+PKG_RELEASE:=17
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
@@ -42,12 +42,18 @@ define Package/odhcp6c/config
 default 0
 endef
 
+define Package/odhcp6c/conffiles
+/etc/odhcp6c.user
+endef
+
 define Package/odhcp6c/install
$(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcp6c $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/lib/netifd/proto
$(INSTALL_BIN) ./files/dhcpv6.sh $(1)/lib/netifd/proto/dhcpv6.sh
$(INSTALL_BIN) ./files/dhcpv6.script $(1)/lib/netifd/
+   $(INSTALL_DIR) $(1)/etc/
+   $(INSTALL_CONF) ./files/odhcp6c.user $(1)/etc/
 endef
 
 $(eval $(call BuildPackage,odhcp6c))
diff --git a/package/network/ipv6/odhcp6c/files/odhcp6c.user 
b/package/network/ipv6/odhcp6c/files/odhcp6c.user
new file mode 100644
index 00..f15a1b1761
--- /dev/null
+++ b/package/network/ipv6/odhcp6c/files/odhcp6c.user
@@ -0,0 +1 @@
+# This script is sourced by odhcp6c's dhcpv6.script at every DHCPv6 event.
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] netifd: add a udhcpc.user placeholder script

2021-03-09 Thread Rui Salvaterra
Document the existence of this feature. This allows the user to execute a script
at each DHCPv4 event. This is useful, for example, as an ad-hoc way to update a
DDNS entry when (and only when) required.

Signed-off-by: Rui Salvaterra 
---
 package/network/config/netifd/Makefile  | 6 +-
 package/network/config/netifd/files/etc/udhcpc.user | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)
 create mode 100644 package/network/config/netifd/files/etc/udhcpc.user

diff --git a/package/network/config/netifd/Makefile 
b/package/network/config/netifd/Makefile
index 7061456b08..3052f43ceb 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netifd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
@@ -25,6 +25,10 @@ define Package/netifd
   TITLE:=OpenWrt Network Interface Configuration Daemon
 endef
 
+define Package/netifd/conffiles
+/etc/udhcpc.user
+endef
+
 TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/libnl-tiny \
-I$(STAGING_DIR)/usr/include \
diff --git a/package/network/config/netifd/files/etc/udhcpc.user 
b/package/network/config/netifd/files/etc/udhcpc.user
new file mode 100644
index 00..78e2ba5f18
--- /dev/null
+++ b/package/network/config/netifd/files/etc/udhcpc.user
@@ -0,0 +1 @@
+# This script is sourced by udhcpc's dhcp.script at every DHCP event.
-- 
2.30.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] odhcp6c: add a odhcp6c.user placeholder script

2021-03-09 Thread Rui Salvaterra
Oops! Fat-fingered and sent twice, sorry about that.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: iproute2 fails to build setting LIBBPF_DYNAMIC unless LIBBPF_DIR is defined.

2021-03-11 Thread Rui Salvaterra
Hi, guys!

On Thu, 11 Mar 2021 at 09:25,  wrote:
>
> The issue with limits.h was exactly one of those intermittent, 
> hard-to-reproduce problems recently reported (by Rui Salvaterra), with 
> similar patches being shared. As in your case, having builds by buildbots and 
> others routinely succeed raises doubts about the root problem. See for 
> example: 
> https://freenode.irclog.whitequark.org/openwrt-devel/2021-03-08#29320461. I 
> also believe doing a "make dirclean" was only one of the things Rui tried 
> before before his builds started succeeding, but I'll let him comment 
> further. And as I noted on IRC, I'd still like to see a patch upstreamed.

In my situation, make dirclean doesn't help, only patching the
relevant files to include limits.h. However, my reluctance to send an
upstream patch comes from the fact that I didn't have any problems
building the iproute2 tools manually (cloning
git://git.kernel.org/pub/scm/network/iproute2/iproute2.git and running
make all).

Cheers,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ramips/mt7621: drop two obsolete patches

2021-03-16 Thread Rui Salvaterra
Although the title is trivial, the potential impact of these changes is enough
in itself to warrant more extensive justification, which follows:

202-weak_reordering.patch - In order to fix random hangs on MT7621, we've been
selecting WEAK_REORDERING_BEYOND_LLSC for years [1]. However, these random hangs
have been most likely caused by an oversight in the MIPS implementation of the
kernel memory consistency model, which has already been fixed for some time (and
stable-backported) [2].

321-mt7621-timer.patch - We've also been carrying this patch for many years [3],
in order to fix a timer calibration issue on MT7621. Turns out, after retesting
with a recent kernel (5.10), the system works perfectly fine without it (no
rcu_sched stalls or inconsistent BogoMIPS values across CPUs).

The GENERIC_CLOCKEVENTS_BROADCAST selection, however, is an unrelated change,
should be kept (although we're not building with cpuidle support), and is thus
moved to a new patch, 202-generic-clockevents-broadcast.patch. This change also
requires a manual refresh of both 322-mt7621-fix-cpu-clk-add-clkdev.patch and
323-mt7621-memory-detect.patch.

[1] 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=5c971cd6fdd7298a2017bdb6bea870088eddb8b9
[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/mips?h=linux-5.4.y&id=42344113ba7a1ed7b5654cd5270af0d5698d8521
[3] 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=6f4a903533361a2906a4d94ac6f597cd9c6c47bc

Suggested-by: Ilya Lipnitskiy 
Tested-by: Donald Hoskins 
Signed-off-by: Rui Salvaterra 
---
 ...> 202-generic-clockevents-broadcast.patch} |  2 +-
 .../patches-5.10/321-mt7621-timer.patch   | 87 ---
 .../322-mt7621-fix-cpu-clk-add-clkdev.patch   | 10 +--
 .../323-mt7621-memory-detect.patch| 10 +--
 4 files changed, 11 insertions(+), 98 deletions(-)
 rename target/linux/ramips/patches-5.10/{202-weak_reordering.patch => 
202-generic-clockevents-broadcast.patch} (82%)
 delete mode 100644 target/linux/ramips/patches-5.10/321-mt7621-timer.patch

diff --git a/target/linux/ramips/patches-5.10/202-weak_reordering.patch 
b/target/linux/ramips/patches-5.10/202-generic-clockevents-broadcast.patch
similarity index 82%
rename from target/linux/ramips/patches-5.10/202-weak_reordering.patch
rename to 
target/linux/ramips/patches-5.10/202-generic-clockevents-broadcast.patch
index 074e16642f..8661c8a3d0 100644
--- a/target/linux/ramips/patches-5.10/202-weak_reordering.patch
+++ b/target/linux/ramips/patches-5.10/202-generic-clockevents-broadcast.patch
@@ -4,7 +4,7 @@
select CLKSRC_MIPS_GIC
select HAVE_PCI if PCI_MT7621
select SOC_BUS
-+  select WEAK_REORDERING_BEYOND_LLSC
++  select GENERIC_CLOCKEVENTS_BROADCAST
  endchoice
  
  choice
diff --git a/target/linux/ramips/patches-5.10/321-mt7621-timer.patch 
b/target/linux/ramips/patches-5.10/321-mt7621-timer.patch
deleted file mode 100644
index 91e14ad63b..00
--- a/target/linux/ramips/patches-5.10/321-mt7621-timer.patch
+++ /dev/null
@@ -1,87 +0,0 @@
 a/arch/mips/ralink/mt7621.c
-+++ b/arch/mips/ralink/mt7621.c
-@@ -9,6 +9,7 @@
- #include 
- #include 
- #include 
-+#include 
- 
- #include 
- #include 
-@@ -16,6 +17,7 @@
- #include 
- #include 
- #include 
-+#include 
- 
- #include 
- 
-@@ -161,6 +163,58 @@ bool plat_cpu_core_present(int core)
-   return true;
- }
- 
-+#define LPS_PREC 8
-+/*
-+*  Re-calibration lpj(loop-per-jiffy).
-+*  (derived from kernel/calibrate.c)
-+*/
-+static int udelay_recal(void)
-+{
-+  unsigned int i, lpj = 0;
-+  unsigned long ticks, loopbit;
-+  int lps_precision = LPS_PREC;
-+
-+  lpj = (1<<12);
-+
-+  while ((lpj <<= 1) != 0) {
-+  /* wait for "start of" clock tick */
-+  ticks = jiffies;
-+  while (ticks == jiffies)
-+  /* nothing */;
-+
-+  /* Go .. */
-+  ticks = jiffies;
-+  __delay(lpj);
-+  ticks = jiffies - ticks;
-+  if (ticks)
-+  break;
-+  }
-+
-+  /*
-+   * Do a binary approximation to get lpj set to
-+   * equal one clock (up to lps_precision bits)
-+   */
-+  lpj >>= 1;
-+  loopbit = lpj;
-+  while (lps_precision-- && (loopbit >>= 1)) {
-+  lpj |= loopbit;
-+  ticks = jiffies;
-+  while (ticks == jiffies)
-+  /* nothing */;
-+  ticks = jiffies;
-+  __delay(lpj);
-+  if (jiffies != ticks)   /* longer than 1 tick */
-+  lpj &= ~loopbit;
-+  }
-+  printk(KERN_INFO "%d CPUs re-calibrate udelay(lpj = %d)\n", NR_CPUS, 
lpj);
-+
-+  for(i=0; i< NR_CPUS; i++)
-+  cpu_data[i].udelay_val = lpj;
-+
-+  return 0;
-+}
-+device_initcall(udela

[PATCH] fstools/overlay: allow forced zstd compression

2021-03-19 Thread Rui Salvaterra
While forced zlib compression is already supported, zstd is much faster at the
same compression ratios. Prepare fstools to mount the overlay with forced zstd
compression, This is already supported in ubifs, while there's a pending patch
for jffs2 [1].

[1] 
https://lore.kernel.org/linux-mtd/20210316141916.447493-1-rsalvate...@gmail.com/

Signed-off-by: Rui Salvaterra 
---
 CMakeLists.txt   | 2 ++
 libfstools/overlay.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 422f27d..3dbc1da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,8 @@ INSTALL(FILES libubi/libubi-tiny.h libubi/libubi.h 
libubi/ubi-media.h
 
 IF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
ADD_DEFINITIONS(-DOVL_MOUNT_COMPRESS_ZLIB)
+ELSEIF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZSTD)
+   ADD_DEFINITIONS(-DOVL_MOUNT_COMPRESS_ZSTD)
 ENDIF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB)
 
 IF(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME)
diff --git a/libfstools/overlay.c b/libfstools/overlay.c
index eadafcf..db083d4 100644
--- a/libfstools/overlay.c
+++ b/libfstools/overlay.c
@@ -355,6 +355,8 @@ static int overlay_mount_fs(struct volume *v)
 #endif
 #ifdef OVL_MOUNT_COMPRESS_ZLIB
"compr=zlib"
+#elif OVL_MOUNT_COMPRESS_ZSTD
+   "compr=zstd"
 #else
NULL
 #endif
-- 
2.31.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] ramips/mt7621: enable support for cpuidle

2021-03-23 Thread Rui Salvaterra
MIPS Coherent Processor Systems (CPS), which include the MT7621 SoC, support
deep sleep idle states and have a specific cpuidle driver for them.
Enable support for it, while also switching from constant timer ticks to the
idle dynticks model, with the TEO governor.

Signed-off-by: Rui Salvaterra 
---
 target/linux/ramips/mt7621/config-5.10 | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/target/linux/ramips/mt7621/config-5.10 
b/target/linux/ramips/mt7621/config-5.10
index c98b33c6cb..26c5c5de6b 100644
--- a/target/linux/ramips/mt7621/config-5.10
+++ b/target/linux/ramips/mt7621/config-5.10
@@ -2,6 +2,7 @@ CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_MMAP_RND_BITS_MAX=15
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
+CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_AT803X_PHY=y
 CONFIG_BLK_MQ_PCI=y
@@ -23,6 +24,9 @@ CONFIG_CPU_HAS_DIEI=y
 CONFIG_CPU_HAS_PREFETCH=y
 CONFIG_CPU_HAS_RIXI=y
 CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_IDLE=y
+# CONFIG_CPU_IDLE_GOV_LADDER is not set
+CONFIG_CPU_IDLE_GOV_TEO=y
 CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_MIPS32_R1 is not set
 CONFIG_CPU_MIPS32_R2=y
@@ -30,6 +34,7 @@ CONFIG_CPU_MIPSR2=y
 CONFIG_CPU_MIPSR2_IRQ_EI=y
 CONFIG_CPU_MIPSR2_IRQ_VI=y
 CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
+CONFIG_CPU_PM=y
 CONFIG_CPU_R4K_CACHE_TLB=y
 CONFIG_CPU_RMAP=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
@@ -97,7 +102,6 @@ CONFIG_HAS_IOPORT_MAP=y
 CONFIG_HIGHMEM=y
 CONFIG_HZ=250
 CONFIG_HZ_250=y
-CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_MT7621=y
@@ -134,7 +138,9 @@ CONFIG_MIPS_CM=y
 CONFIG_MIPS_CMDLINE_FROM_DTB=y
 CONFIG_MIPS_CPC=y
 CONFIG_MIPS_CPS=y
+CONFIG_MIPS_CPS_CPUIDLE=y
 # CONFIG_MIPS_CPS_NS16550_BOOL is not set
+CONFIG_MIPS_CPS_PM=y
 CONFIG_MIPS_CPU_SCACHE=y
 # CONFIG_MIPS_ELF_APPENDED_DTB is not set
 CONFIG_MIPS_GIC=y
@@ -182,6 +188,8 @@ CONFIG_NET_MEDIATEK_SOC=y
 CONFIG_NET_SWITCHDEV=y
 CONFIG_NET_VENDOR_MEDIATEK=y
 # CONFIG_NET_VENDOR_RALINK is not set
+CONFIG_NO_HZ_COMMON=y
+CONFIG_NO_HZ_IDLE=y
 CONFIG_NR_CPUS=4
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
-- 
2.31.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] ramips/mt7621: enable support for cpuidle

2021-03-23 Thread Rui Salvaterra
Hi, Henrique,

On Tue, 23 Mar 2021 at 17:47, Henrique de Moraes Holschuh
 wrote:
>
> Does this change throughput or network behavior ?

I haven't noticed absolutely any differences. And note that I'm
running at HZ = 24 in my personal configuration, so my timer frequency
is under 1/10 of the default one (HZ = 250).

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] ramips/mt7621: drop two obsolete patches

2021-03-30 Thread Rui Salvaterra
On Tue, 16 Mar 2021 at 09:02, Rui Salvaterra  wrote:
>
> Although the title is trivial, the potential impact of these changes is enough
> in itself to warrant more extensive justification, which follows:
>
> 202-weak_reordering.patch - In order to fix random hangs on MT7621, we've been
> selecting WEAK_REORDERING_BEYOND_LLSC for years [1]. However, these random 
> hangs
> have been most likely caused by an oversight in the MIPS implementation of the
> kernel memory consistency model, which has already been fixed for some time 
> (and
> stable-backported) [2].
>
> 321-mt7621-timer.patch - We've also been carrying this patch for many years 
> [3],
> in order to fix a timer calibration issue on MT7621. Turns out, after 
> retesting
> with a recent kernel (5.10), the system works perfectly fine without it (no
> rcu_sched stalls or inconsistent BogoMIPS values across CPUs).
>
> The GENERIC_CLOCKEVENTS_BROADCAST selection, however, is an unrelated change,
> should be kept (although we're not building with cpuidle support), and is thus
> moved to a new patch, 202-generic-clockevents-broadcast.patch. This change 
> also
> requires a manual refresh of both 322-mt7621-fix-cpu-clk-add-clkdev.patch and
> 323-mt7621-memory-detect.patch.
>
> [1] 
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=5c971cd6fdd7298a2017bdb6bea870088eddb8b9
> [2] 
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/mips?h=linux-5.4.y&id=42344113ba7a1ed7b5654cd5270af0d5698d8521
> [3] 
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=6f4a903533361a2906a4d94ac6f597cd9c6c47bc
>
> Suggested-by: Ilya Lipnitskiy 
> Tested-by: Donald Hoskins 
> Signed-off-by: Rui Salvaterra 

[patch snipped]

Ping. Any comments on this? I'm thinking of splitting it in two
patches to make reviewing easier, adding the cpuidle patch as the last
one and resend as a series of three. Thoughts?

Thanks in advance,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH] ramips/mt7621: drop two obsolete patches

2021-03-30 Thread Rui Salvaterra
On Tue, 30 Mar 2021 at 19:27, Ilya Lipnitskiy  wrote:
>
> My opinion is go ahead and supersede the series with your proposed
> updates, since no maintainer appears to have spent any time on this
> yet.

That as my reasoning too. Will respin, thanks!

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 2/3] ramips/mt7621: drop the timer recalibration patch

2021-03-30 Thread Rui Salvaterra
We've been carrying this patch for many years [1], in order to fix a timer
calibration issue on MT7621. Turns out, after retesting with a recent kernel
(Linux 5.10), the system works perfectly fine without it (no rcu_sched stalls
or inconsistent BogoMIPS values across CPUs).

The GENERIC_CLOCKEVENTS_BROADCAST selection, however, is an unrelated change,
and must be kept. It's required by cpuidle, which is supported by the
architecture and will be enabled in the future. Thus, create a new patch
exclusively for this (202-generic-clockevents-broadcast.patch).

Manually refreshed:
322-mt7621-fix-cpu-clk-add-clkdev.patch
323-mt7621-memory-detect.patch

[1] 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=6f4a903533361a2906a4d94ac6f597cd9c6c47bc

Suggested-by: Ilya Lipnitskiy 
Tested-by: Donald Hoskins 
Signed-off-by: Rui Salvaterra 
---
 .../202-generic-clockevents-broadcast.patch   | 10 +++
 .../patches-5.10/321-mt7621-timer.patch   | 87 ---
 .../322-mt7621-fix-cpu-clk-add-clkdev.patch   | 10 +--
 .../323-mt7621-memory-detect.patch| 10 +--
 4 files changed, 20 insertions(+), 97 deletions(-)
 create mode 100644 
target/linux/ramips/patches-5.10/202-generic-clockevents-broadcast.patch
 delete mode 100644 target/linux/ramips/patches-5.10/321-mt7621-timer.patch

diff --git 
a/target/linux/ramips/patches-5.10/202-generic-clockevents-broadcast.patch 
b/target/linux/ramips/patches-5.10/202-generic-clockevents-broadcast.patch
new file mode 100644
index 00..8661c8a3d0
--- /dev/null
+++ b/target/linux/ramips/patches-5.10/202-generic-clockevents-broadcast.patch
@@ -0,0 +1,10 @@
+--- a/arch/mips/ralink/Kconfig
 b/arch/mips/ralink/Kconfig
+@@ -57,6 +57,7 @@ choice
+   select CLKSRC_MIPS_GIC
+   select HAVE_PCI if PCI_MT7621
+   select SOC_BUS
++  select GENERIC_CLOCKEVENTS_BROADCAST
+ endchoice
+ 
+ choice
diff --git a/target/linux/ramips/patches-5.10/321-mt7621-timer.patch 
b/target/linux/ramips/patches-5.10/321-mt7621-timer.patch
deleted file mode 100644
index 08d5935eb0..00
--- a/target/linux/ramips/patches-5.10/321-mt7621-timer.patch
+++ /dev/null
@@ -1,87 +0,0 @@
 a/arch/mips/ralink/mt7621.c
-+++ b/arch/mips/ralink/mt7621.c
-@@ -9,6 +9,7 @@
- #include 
- #include 
- #include 
-+#include 
- 
- #include 
- #include 
-@@ -16,6 +17,7 @@
- #include 
- #include 
- #include 
-+#include 
- 
- #include 
- 
-@@ -161,6 +163,58 @@ bool plat_cpu_core_present(int core)
-   return true;
- }
- 
-+#define LPS_PREC 8
-+/*
-+*  Re-calibration lpj(loop-per-jiffy).
-+*  (derived from kernel/calibrate.c)
-+*/
-+static int udelay_recal(void)
-+{
-+  unsigned int i, lpj = 0;
-+  unsigned long ticks, loopbit;
-+  int lps_precision = LPS_PREC;
-+
-+  lpj = (1<<12);
-+
-+  while ((lpj <<= 1) != 0) {
-+  /* wait for "start of" clock tick */
-+  ticks = jiffies;
-+  while (ticks == jiffies)
-+  /* nothing */;
-+
-+  /* Go .. */
-+  ticks = jiffies;
-+  __delay(lpj);
-+  ticks = jiffies - ticks;
-+  if (ticks)
-+  break;
-+  }
-+
-+  /*
-+   * Do a binary approximation to get lpj set to
-+   * equal one clock (up to lps_precision bits)
-+   */
-+  lpj >>= 1;
-+  loopbit = lpj;
-+  while (lps_precision-- && (loopbit >>= 1)) {
-+  lpj |= loopbit;
-+  ticks = jiffies;
-+  while (ticks == jiffies)
-+  /* nothing */;
-+  ticks = jiffies;
-+  __delay(lpj);
-+  if (jiffies != ticks)   /* longer than 1 tick */
-+  lpj &= ~loopbit;
-+  }
-+  printk(KERN_INFO "%d CPUs re-calibrate udelay(lpj = %d)\n", NR_CPUS, 
lpj);
-+
-+  for(i=0; i< NR_CPUS; i++)
-+  cpu_data[i].udelay_val = lpj;
-+
-+  return 0;
-+}
-+device_initcall(udelay_recal);
-+
- void prom_soc_init(struct ralink_soc_info *soc_info)
- {
-   void __iomem *sysc = (void __iomem *) KSEG1ADDR(MT7621_SYSC_BASE);
 a/arch/mips/ralink/Kconfig
-+++ b/arch/mips/ralink/Kconfig
-@@ -62,6 +62,7 @@ choice
-   select CLKSRC_MIPS_GIC
-   select HAVE_PCI if PCI_MT7621
-   select SOC_BUS
-+  select GENERIC_CLOCKEVENTS_BROADCAST
- endchoice
- 
- choice
diff --git 
a/target/linux/ramips/patches-5.10/322-mt7621-fix-cpu-clk-add-clkdev.patch 
b/target/linux/ramips/patches-5.10/322-mt7621-fix-cpu-clk-add-clkdev.patch
index 723c628790..be5fee54b2 100644
--- a/target/linux/ramips/patches-5.10/322-mt7621-fix-cpu-clk-add-clkdev.patch
+++ b/target/linux/ramips/patches-5.10/322-mt7621-fix-cpu-clk-add-clkdev.patch
@@ -36,10 +36,10 @@
  #define MT7621_DDR2_SIZE_MAX  256
 --- a/arch/mips/ralink/mt7621.c
 +++ b/arch/mips/ralink/mt7621.c
-@@ -10,6 +10,1

[PATCH 0/3] ramips/mt7621: misc 5.10 kernel work

2021-03-30 Thread Rui Salvaterra
Drop two obsolete kernel patches and enable support for cpuidle. More details
in each individual patch.

Rui Salvaterra (3):
  ramips/mt7621: drop the weak reordering patch
  ramips/mt7621: drop the timer recalibration patch
  ramips/mt7621: enable support for cpuidle

 target/linux/ramips/mt7621/config-5.10| 10 ++-
 ...> 202-generic-clockevents-broadcast.patch} |  2 +-
 .../patches-5.10/321-mt7621-timer.patch   | 87 ---
 .../322-mt7621-fix-cpu-clk-add-clkdev.patch   | 10 +--
 .../323-mt7621-memory-detect.patch| 10 +--
 5 files changed, 20 insertions(+), 99 deletions(-)
 rename target/linux/ramips/patches-5.10/{202-weak_reordering.patch => 
202-generic-clockevents-broadcast.patch} (82%)
 delete mode 100644 target/linux/ramips/patches-5.10/321-mt7621-timer.patch

-- 
2.31.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 1/3] ramips/mt7621: drop the weak reordering patch

2021-03-30 Thread Rui Salvaterra
In order to fix random hangs on MT7621, we've been selecting
WEAK_REORDERING_BEYOND_LLSC for years [1]. However, these random hangs have been
most likely caused by an oversight in the MIPS implementation of the kernel
memory consistency model, which has already been fixed for some time (and
backported to stable) [2].

Manually refreshed:
321-mt7621-timer.patch

[1] 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=5c971cd6fdd7298a2017bdb6bea870088eddb8b9
[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/mips?h=linux-5.4.y&id=42344113ba7a1ed7b5654cd5270af0d5698d8521

Suggested-by: Ilya Lipnitskiy 
Tested-by: Donald Hoskins 
Signed-off-by: Rui Salvaterra 
---
 .../ramips/patches-5.10/202-weak_reordering.patch  | 10 --
 .../linux/ramips/patches-5.10/321-mt7621-timer.patch   |  4 ++--
 2 files changed, 2 insertions(+), 12 deletions(-)
 delete mode 100644 target/linux/ramips/patches-5.10/202-weak_reordering.patch

diff --git a/target/linux/ramips/patches-5.10/202-weak_reordering.patch 
b/target/linux/ramips/patches-5.10/202-weak_reordering.patch
deleted file mode 100644
index 074e16642f..00
--- a/target/linux/ramips/patches-5.10/202-weak_reordering.patch
+++ /dev/null
@@ -1,10 +0,0 @@
 a/arch/mips/ralink/Kconfig
-+++ b/arch/mips/ralink/Kconfig
-@@ -57,6 +57,7 @@ choice
-   select CLKSRC_MIPS_GIC
-   select HAVE_PCI if PCI_MT7621
-   select SOC_BUS
-+  select WEAK_REORDERING_BEYOND_LLSC
- endchoice
- 
- choice
diff --git a/target/linux/ramips/patches-5.10/321-mt7621-timer.patch 
b/target/linux/ramips/patches-5.10/321-mt7621-timer.patch
index 91e14ad63b..08d5935eb0 100644
--- a/target/linux/ramips/patches-5.10/321-mt7621-timer.patch
+++ b/target/linux/ramips/patches-5.10/321-mt7621-timer.patch
@@ -77,10 +77,10 @@
void __iomem *sysc = (void __iomem *) KSEG1ADDR(MT7621_SYSC_BASE);
 --- a/arch/mips/ralink/Kconfig
 +++ b/arch/mips/ralink/Kconfig
-@@ -63,6 +63,7 @@ choice
+@@ -62,6 +62,7 @@ choice
+   select CLKSRC_MIPS_GIC
select HAVE_PCI if PCI_MT7621
select SOC_BUS
-   select WEAK_REORDERING_BEYOND_LLSC
 +  select GENERIC_CLOCKEVENTS_BROADCAST
  endchoice
  
-- 
2.31.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH 3/3] ramips/mt7621: enable support for cpuidle

2021-03-30 Thread Rui Salvaterra
MIPS Coherent Processor Systems (CPS), which include the MT7621 SoC, support
deep sleep idle states and have a specific cpuidle driver for them.
Enable support for it, while also switching from constant timer ticks to the
idle dynticks model, with the TEO governor.

Run-tested on a Redmi AC2100.

Signed-off-by: Rui Salvaterra 
---
 target/linux/ramips/mt7621/config-5.10 | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/target/linux/ramips/mt7621/config-5.10 
b/target/linux/ramips/mt7621/config-5.10
index fae046236e..e56f642ab7 100644
--- a/target/linux/ramips/mt7621/config-5.10
+++ b/target/linux/ramips/mt7621/config-5.10
@@ -2,6 +2,7 @@ CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_MMAP_RND_BITS_MAX=15
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
+CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_AT803X_PHY=y
 CONFIG_BLK_MQ_PCI=y
@@ -23,6 +24,9 @@ CONFIG_CPU_HAS_DIEI=y
 CONFIG_CPU_HAS_PREFETCH=y
 CONFIG_CPU_HAS_RIXI=y
 CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_IDLE=y
+# CONFIG_CPU_IDLE_GOV_LADDER is not set
+CONFIG_CPU_IDLE_GOV_TEO=y
 CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_MIPS32_R1 is not set
 CONFIG_CPU_MIPS32_R2=y
@@ -30,6 +34,7 @@ CONFIG_CPU_MIPSR2=y
 CONFIG_CPU_MIPSR2_IRQ_EI=y
 CONFIG_CPU_MIPSR2_IRQ_VI=y
 CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
+CONFIG_CPU_PM=y
 CONFIG_CPU_R4K_CACHE_TLB=y
 CONFIG_CPU_RMAP=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
@@ -97,7 +102,6 @@ CONFIG_HAS_IOPORT_MAP=y
 CONFIG_HIGHMEM=y
 CONFIG_HZ=250
 CONFIG_HZ_250=y
-CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_MT7621=y
@@ -134,7 +138,9 @@ CONFIG_MIPS_CM=y
 CONFIG_MIPS_CMDLINE_FROM_DTB=y
 CONFIG_MIPS_CPC=y
 CONFIG_MIPS_CPS=y
+CONFIG_MIPS_CPS_CPUIDLE=y
 # CONFIG_MIPS_CPS_NS16550_BOOL is not set
+CONFIG_MIPS_CPS_PM=y
 CONFIG_MIPS_CPU_SCACHE=y
 # CONFIG_MIPS_ELF_APPENDED_DTB is not set
 CONFIG_MIPS_GIC=y
@@ -182,6 +188,8 @@ CONFIG_NET_MEDIATEK_SOC=y
 CONFIG_NET_SWITCHDEV=y
 CONFIG_NET_VENDOR_MEDIATEK=y
 # CONFIG_NET_VENDOR_RALINK is not set
+CONFIG_NO_HZ_COMMON=y
+CONFIG_NO_HZ_IDLE=y
 CONFIG_NR_CPUS=4
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
-- 
2.31.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH 2/3] ramips/mt7621: drop the timer recalibration patch

2021-03-30 Thread Rui Salvaterra
Hi, Ilya,

On Tue, 30 Mar 2021 at 20:56, Ilya Lipnitskiy  wrote:
>
> "config MIPS_CPS_CPUIDLE" has "select GENERIC_CLOCKEVENTS_BROADCAST if
> SMP", so it doesn't seem necessary to force it in a dedicated patch.

Oh, indeed?

*goes to look*

Crap, don't know how I missed it [1]. Thanks for the heads-up!

> Can we drop 202-generic-clockevents-broadcast.patch if the CPUIDLE
> change gets accepted?

We can and we should. :) I'll wait for Daniel's call, since he already
marked the series as being reviewed on Patchwork. I can either send a
follow-up patch, or respin a v2 of the series.

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/cpuidle/Kconfig.mips?h=linux-5.10.y

Thanks,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 0/3] misc 5.10 kernel work

2021-03-30 Thread Rui Salvaterra
Drop two obsolete kernel patches and enable support for cpuidle. More details
in each individual patch.

v2: Don't include the generic clock events broadcast patch, as SMP already
selects GENERIC_CLOCKEVENTS_BROADCAST.

Rui Salvaterra (3):
  ramips/mt7621: drop the weak reordering patch
  ramips/mt7621: drop the timer recalibration patch
  ramips/mt7621: enable support for cpuidle

 target/linux/ramips/mt7621/config-5.10| 10 ++-
 .../patches-5.10/202-weak_reordering.patch| 10 ---
 .../patches-5.10/321-mt7621-timer.patch   | 87 ---
 .../322-mt7621-fix-cpu-clk-add-clkdev.patch   | 10 +--
 .../323-mt7621-memory-detect.patch| 10 +--
 5 files changed, 19 insertions(+), 108 deletions(-)
 delete mode 100644 target/linux/ramips/patches-5.10/202-weak_reordering.patch
 delete mode 100644 target/linux/ramips/patches-5.10/321-mt7621-timer.patch

-- 
2.31.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 2/3] ramips/mt7621: drop the timer recalibration patch

2021-03-30 Thread Rui Salvaterra
We've been carrying this patch for many years [1], in order to fix a timer
calibration issue on MT7621. Turns out, after retesting with a recent kernel
(Linux 5.10), the system works perfectly fine without it (no rcu_sched stalls
or inconsistent BogoMIPS values across CPUs).

Manually refreshed:
322-mt7621-fix-cpu-clk-add-clkdev.patch
323-mt7621-memory-detect.patch

[1] 
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=6f4a903533361a2906a4d94ac6f597cd9c6c47bc

Suggested-by: Ilya Lipnitskiy 
Tested-by: Donald Hoskins 
Signed-off-by: Rui Salvaterra 
---
 .../patches-5.10/321-mt7621-timer.patch   | 87 ---
 .../322-mt7621-fix-cpu-clk-add-clkdev.patch   | 10 +--
 .../323-mt7621-memory-detect.patch| 10 +--
 3 files changed, 10 insertions(+), 97 deletions(-)
 delete mode 100644 target/linux/ramips/patches-5.10/321-mt7621-timer.patch

diff --git a/target/linux/ramips/patches-5.10/321-mt7621-timer.patch 
b/target/linux/ramips/patches-5.10/321-mt7621-timer.patch
deleted file mode 100644
index 08d5935eb0..00
--- a/target/linux/ramips/patches-5.10/321-mt7621-timer.patch
+++ /dev/null
@@ -1,87 +0,0 @@
 a/arch/mips/ralink/mt7621.c
-+++ b/arch/mips/ralink/mt7621.c
-@@ -9,6 +9,7 @@
- #include 
- #include 
- #include 
-+#include 
- 
- #include 
- #include 
-@@ -16,6 +17,7 @@
- #include 
- #include 
- #include 
-+#include 
- 
- #include 
- 
-@@ -161,6 +163,58 @@ bool plat_cpu_core_present(int core)
-   return true;
- }
- 
-+#define LPS_PREC 8
-+/*
-+*  Re-calibration lpj(loop-per-jiffy).
-+*  (derived from kernel/calibrate.c)
-+*/
-+static int udelay_recal(void)
-+{
-+  unsigned int i, lpj = 0;
-+  unsigned long ticks, loopbit;
-+  int lps_precision = LPS_PREC;
-+
-+  lpj = (1<<12);
-+
-+  while ((lpj <<= 1) != 0) {
-+  /* wait for "start of" clock tick */
-+  ticks = jiffies;
-+  while (ticks == jiffies)
-+  /* nothing */;
-+
-+  /* Go .. */
-+  ticks = jiffies;
-+  __delay(lpj);
-+  ticks = jiffies - ticks;
-+  if (ticks)
-+  break;
-+  }
-+
-+  /*
-+   * Do a binary approximation to get lpj set to
-+   * equal one clock (up to lps_precision bits)
-+   */
-+  lpj >>= 1;
-+  loopbit = lpj;
-+  while (lps_precision-- && (loopbit >>= 1)) {
-+  lpj |= loopbit;
-+  ticks = jiffies;
-+  while (ticks == jiffies)
-+  /* nothing */;
-+  ticks = jiffies;
-+  __delay(lpj);
-+  if (jiffies != ticks)   /* longer than 1 tick */
-+  lpj &= ~loopbit;
-+  }
-+  printk(KERN_INFO "%d CPUs re-calibrate udelay(lpj = %d)\n", NR_CPUS, 
lpj);
-+
-+  for(i=0; i< NR_CPUS; i++)
-+  cpu_data[i].udelay_val = lpj;
-+
-+  return 0;
-+}
-+device_initcall(udelay_recal);
-+
- void prom_soc_init(struct ralink_soc_info *soc_info)
- {
-   void __iomem *sysc = (void __iomem *) KSEG1ADDR(MT7621_SYSC_BASE);
 a/arch/mips/ralink/Kconfig
-+++ b/arch/mips/ralink/Kconfig
-@@ -62,6 +62,7 @@ choice
-   select CLKSRC_MIPS_GIC
-   select HAVE_PCI if PCI_MT7621
-   select SOC_BUS
-+  select GENERIC_CLOCKEVENTS_BROADCAST
- endchoice
- 
- choice
diff --git 
a/target/linux/ramips/patches-5.10/322-mt7621-fix-cpu-clk-add-clkdev.patch 
b/target/linux/ramips/patches-5.10/322-mt7621-fix-cpu-clk-add-clkdev.patch
index 723c628790..be5fee54b2 100644
--- a/target/linux/ramips/patches-5.10/322-mt7621-fix-cpu-clk-add-clkdev.patch
+++ b/target/linux/ramips/patches-5.10/322-mt7621-fix-cpu-clk-add-clkdev.patch
@@ -36,10 +36,10 @@
  #define MT7621_DDR2_SIZE_MAX  256
 --- a/arch/mips/ralink/mt7621.c
 +++ b/arch/mips/ralink/mt7621.c
-@@ -10,6 +10,10 @@
+@@ -9,6 +9,10 @@
+ #include 
  #include 
  #include 
- #include 
 +#include 
 +#include 
 +#include 
@@ -47,15 +47,15 @@
  
  #include 
  #include 
-@@ -18,6 +22,7 @@
+@@ -16,6 +20,7 @@
+ #include 
  #include 
  #include 
- #include 
 +#include 
  
  #include 
  
-@@ -108,11 +113,89 @@ static struct rt2880_pmx_group mt7621_pi
+@@ -106,11 +111,89 @@ static struct rt2880_pmx_group mt7621_pi
{ 0 }
  };
  
diff --git a/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch 
b/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch
index 07c7588661..9f80d02638 100644
--- a/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch
+++ b/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch
@@ -44,10 +44,10 @@ Signed-off-by: Chuanhong Guo 
  #define MT7621_CHIP_NAME1 0x20203132
 --- a/arch/mips/ralink/mt7621.c
 +++ b/arch/mips/ralink/mt7621.c
-@@ -10,11 +10,13 @@
+@@ -9,11 +9,13 @@
+ #include 
  #include 
  #include 
- #include 
 +#include 
  #include 
  #include 
@@ -58,7 +58,7 @@ 

  1   2   3   4   >