openwrt/openwrt.git
4 years agokernel: act_ctinfo: really fix backport this time
Kevin Darbyshire-Bryant [Fri, 24 Jan 2020 14:18:26 +0000 (14:18 +0000)]
kernel: act_ctinfo: really fix backport this time

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agokernel: act_ctinfo: fixup build error on 4.14
Kevin Darbyshire-Bryant [Fri, 24 Jan 2020 13:37:58 +0000 (13:37 +0000)]
kernel: act_ctinfo: fixup build error on 4.14

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agokernel: bump 4.19 to 4.19.98
Koen Vandeputte [Fri, 24 Jan 2020 10:20:03 +0000 (11:20 +0100)]
kernel: bump 4.19 to 4.19.98

Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: bump 4.14 to 4.14.167
Koen Vandeputte [Fri, 24 Jan 2020 10:13:35 +0000 (11:13 +0100)]
kernel: bump 4.14 to 4.14.167

Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: act_ctinfo: backport memory leak fix
Kevin Darbyshire-Bryant [Fri, 24 Jan 2020 11:21:47 +0000 (11:21 +0000)]
kernel: act_ctinfo: backport memory leak fix

[ Upstream commit 09d4f10a5e78d76a53e3e584f1e6a701b6d24108 ]

Implement a cleanup method to properly free ci->params

BUG: memory leak
unreferenced object 0xffff88811746e2c0 (size 64):
 comm "syz-executor617", pid 7106, jiffies 4294943055 (age 14.250s)
 hex dump (first 32 bytes):
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
   c0 34 60 84 ff ff ff ff 00 00 00 00 00 00 00 00  .4`.............
 backtrace:
   [<0000000015aa236f>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
   [<0000000015aa236f>] slab_post_alloc_hook mm/slab.h:586 [inline]
   [<0000000015aa236f>] slab_alloc mm/slab.c:3320 [inline]
   [<0000000015aa236f>] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3549
   [<000000002c946bd1>] kmalloc include/linux/slab.h:556 [inline]
   [<000000002c946bd1>] kzalloc include/linux/slab.h:670 [inline]
   [<000000002c946bd1>] tcf_ctinfo_init+0x21a/0x530 net/sched/act_ctinfo.c:236
   [<0000000086952cca>] tcf_action_init_1+0x400/0x5b0 net/sched/act_api.c:944
   [<000000005ab29bf8>] tcf_action_init+0x135/0x1c0 net/sched/act_api.c:1000
   [<00000000392f56f9>] tcf_action_add+0x9a/0x200 net/sched/act_api.c:1410
   [<0000000088f3c5dd>] tc_ctl_action+0x14d/0x1bb net/sched/act_api.c:1465
   [<000000006b39d986>] rtnetlink_rcv_msg+0x178/0x4b0 net/core/rtnetlink.c:5424
   [<00000000fd6ecace>] netlink_rcv_skb+0x61/0x170 net/netlink/af_netlink.c:2477
   [<0000000047493d02>] rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5442
   [<00000000bdcf8286>] netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
   [<00000000bdcf8286>] netlink_unicast+0x223/0x310 net/netlink/af_netlink.c:1328
   [<00000000fc5b92d9>] netlink_sendmsg+0x2c0/0x570 net/netlink/af_netlink.c:1917
   [<00000000da84d076>] sock_sendmsg_nosec net/socket.c:639 [inline]
   [<00000000da84d076>] sock_sendmsg+0x54/0x70 net/socket.c:659
   [<0000000042fb2eee>] ____sys_sendmsg+0x2d0/0x300 net/socket.c:2330
   [<000000008f23f67e>] ___sys_sendmsg+0x8a/0xd0 net/socket.c:2384
   [<00000000d838e4f6>] __sys_sendmsg+0x80/0xf0 net/socket.c:2417
   [<00000000289a9cb1>] __do_sys_sendmsg net/socket.c:2426 [inline]
   [<00000000289a9cb1>] __se_sys_sendmsg net/socket.c:2424 [inline]
   [<00000000289a9cb1>] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2424

Fixes: 24ec483cec98 ("net: sched: Introduce act_ctinfo action")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agowireguard-tools: bump to 1.0.20200121
Jason A. Donenfeld [Tue, 21 Jan 2020 15:42:58 +0000 (16:42 +0100)]
wireguard-tools: bump to 1.0.20200121

* Makefile: remove pwd from compile output
* Makefile: add standard 'all' target
* Makefile: evaluate git version lazily

Quality of life improvements for packagers.

* ipc: simplify inflatable buffer and add fuzzer
* fuzz: add generic command argument fuzzer
* fuzz: add set and setconf fuzzers

More fuzzers and a slicker string list implementation. These fuzzers now find
themselves configuring wireguard interfaces from scratch after several million
mutations, which is fun to watch.

* netlink: make sure to clear return value when trying again

Prior, if a dump was interrupted by a concurrent set operation, we'd try
again, but forget to reset an error flag, so we'd keep trying again forever.
Now we do the right thing and succeed when we succeed.

* Makefile: sort inputs to linker so that build is reproducible

Earlier versions of make(1) passed GLOB_NOSORT to glob(3), resulting in the
linker receiving its inputs in a filesystem-dependent order. This screwed up
reproducible builds.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years agowireguard: bump to 0.0.20200121
Jason A. Donenfeld [Tue, 21 Jan 2020 15:42:57 +0000 (16:42 +0100)]
wireguard: bump to 0.0.20200121

* Makefile: strip prefixed v from version.h

This fixes a mistake in dmesg output and when parsing the sysfs entry in the
filesystem.

* device: skb_list_walk_safe moved upstream

This is a 5.6 change, which we won't support here, but it does make the code
cleaner, so we make this change to keep things in sync.

* curve25519: x86_64: replace with formally verified implementation

This comes from INRIA's HACL*/Vale. It implements the same algorithm and
implementation strategy as the code it replaces, only this code has been
formally verified, sans the base point multiplication, which uses code
similar to prior, only it uses the formally verified field arithmetic
alongside reproducable ladder generation steps. This doesn't have a
pure-bmi2 version, which means haswell no longer benefits, but the
increased (doubled) code complexity is not worth it for a single
generation of chips that's already old.

Performance-wise, this is around 1% slower on older microarchitectures,
and slightly faster on newer microarchitectures, mainly 10nm ones or
backports of 10nm to 14nm. This implementation is "everest" below:

Xeon E5-2680 v4 (Broadwell)

armfazh: 133340 cycles per call
everest: 133436 cycles per call

Xeon Gold 5120 (Sky Lake Server)

armfazh: 112636 cycles per call
everest: 113906 cycles per call

Core i5-6300U (Sky Lake Client)

armfazh: 116810 cycles per call
everest: 117916 cycles per call

Core i7-7600U (Kaby Lake)

armfazh: 119523 cycles per call
everest: 119040 cycles per call

Core i7-8750H (Coffee Lake)

armfazh: 113914 cycles per call
everest: 113650 cycles per call

Core i9-9880H (Coffee Lake Refresh)

armfazh: 112616 cycles per call
everest: 114082 cycles per call

Core i3-8121U (Cannon Lake)

armfazh: 113202 cycles per call
everest: 111382 cycles per call

Core i7-8265U (Whiskey Lake)

armfazh: 127307 cycles per call
everest: 127697 cycles per call

Core i7-8550U (Kaby Lake Refresh)

armfazh: 127522 cycles per call
everest: 127083 cycles per call

Xeon Platinum 8275CL (Cascade Lake)

armfazh: 114380 cycles per call
everest: 114656 cycles per call

Achieving these kind of results with formally verified code is quite
remarkable, especialy considering that performance is favorable for
newer chips.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years agoath10k-firmware: fix mirror hash
DENG Qingfang [Mon, 20 Jan 2020 17:06:22 +0000 (01:06 +0800)]
ath10k-firmware: fix mirror hash

Fix PKG_MIRROR_HASH hash mismatch.

Fixes: 641a93f0f226 ("ath10k-firmware: update wave 1 firmware to 10.2.4-1.0-00047")
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
[added missing commit description]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoprocd: update to version 2020-01-24
Petr Štetiar [Fri, 24 Jan 2020 05:41:56 +0000 (06:41 +0100)]
procd: update to version 2020-01-24

00aafc4f439e procd: show process's exit code
856b5f8be046 state: fix reboot causing shutdown inside LXC container
b44417c20c7f instance: provide error feedback if ujail binary is missing

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agokernel: fix dst reference leak in flow offload
Felix Fietkau [Thu, 23 Jan 2020 16:40:06 +0000 (17:40 +0100)]
kernel: fix dst reference leak in flow offload

Fixes a significant amount of leaked memory with lots of connections

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agoath79: fix SUPPORTED_DEVICES not matching ar71xx board names
Adrian Schmutzler [Thu, 23 Jan 2020 14:42:48 +0000 (15:42 +0100)]
ath79: fix SUPPORTED_DEVICES not matching ar71xx board names

Based on a script for comparison, this fixes (hopefully) all errors
in SUPPORTED_DEVICES for ar71xx->ath79 upgrade.

Devices where old string is removed as the device does not exist
in ar71xx:
- dlink_dir-859-a1
- tplink_archer-a7-v5
- tplink_cpe510-v3

Devices where string is changed because it did not match the board
name in ar71xx:
- tplink_tl-mr3220-v1
- tplink_tl-mr3420-v1
- tplink_tl-wr2543-v1
- tplink_tl-wr741nd-v4
- tplink_tl-wr841-v7
- ubnt_unifiac-mesh
- ubnt_unifiac-mesh-pro
- ubnt_unifiac-pro

For this device, the correct string could not be found, but we could
not determine the correct one. Thus, the string is removed for now:
- tplink_tl-wr740n-v4

The script for checking this is quite simple (note that newer
entries, i.e. ath79->ath79 upgrade, are displayed as missing):

  newpath=target/linux/ath79/image/
  oldpath=target/linux/ar71xx/base-files/lib/ar71xx.sh

  for s in $(grep -roh "SUPPORTED_DEVICES.*" $newpath | sed 's/SUPPORTED_DEVICES *.= *//'); do
    found="Missing"
    grep -q -r "\"$s\"" $oldpath && found="Found"
    echo "$s: $found."
  done

The errors might be filtered by appending 'grep "Missing"' to the script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: move lzma-loader to the end of available RAM
Adrian Schmutzler [Wed, 22 Jan 2020 17:06:07 +0000 (18:06 +0100)]
ath79: move lzma-loader to the end of available RAM

In certain cases, the uncompressed initramfs image will overwrite
the lzma-loader, which is currently only 10 MB away from kernel image
start. To prevent this, change LZMA_TEXT_START to 24 MB, so loader
and compressed image have 8 MB at the end of RAM and uncompressed
image has 24 MB available.

This is only enabled for ath79 at the moment, as there we can be sure
that all devices have 32+ MB RAM and TARGET_INITRAMFS_COMPRESSION_LZMA
is not enabled there.

Despite, since lzma-loader is currently build specifically for ath79
anyway, there is no need to re-specify LOADADDR and LZMA_TEXT_START
in image/Makefile, so the values are set directly in
image/lzma-loader/Makefile and the overwrite in image/Makefile is
removed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agoath79: add support for MikroTik RouterBOARD wAP G-5HacT2HnD
Roger Pueyo Centelles [Thu, 28 Nov 2019 11:53:01 +0000 (12:53 +0100)]
ath79: add support for MikroTik RouterBOARD wAP G-5HacT2HnD

This commit adds support for the MikroTik RouterBOARD wAP G-5HacT2HnD
(wAP AC), a small weatherproof dual band, dual-radio 802.11ac
wireless AP with integrated omnidirectional anntennae and one
10/100/1000 Mbps Ethernet port.

See https://mikrotik.com/product/RBwAPG-5HacT2HnD for more info.

Specifications:
 - SoC: Qualcomm Atheros QCA9556
 - RAM: 64 MB
 - Storage: 16 MB NOR
 - Wireless:
   · Atheros AR9550 (SoC) 802.11b/g/n 2x2:2, 2 dBi antennae
   · Qualcomm QCA9880 802.11a/n/ac 3x3:3, 2 dBi antennae
 - Ethernet: Atheros AG71xx (SoC, AR8033), 1x 1000/100/10 port,
   passive PoE in

Working:
 - Board/system detection
 - Sysupgrade
 - Serial console
 - Ethernet
 - 2.4 GHz radio
 - 5 GHz radio and LED
 - Reset button

Not working/Unsupported:
 - 2.4 GHz LED
 - AP/CAP LED
 - ZT2046Q SPI temperature and voltage sensor

This adds the basic features for supporting MikroTik devices:
 - a common recipe for mikrotik images in common-mikrotik.mk
 - support for minor (MikroTik NOR) split firmware (only for
   generic subtarget so far)

Acknowledgments: Robert Marko <robimarko@gmail.com>
                 Andrew Cameron <apcameron@softhome.net>
                 Koen Vandeputte <koen.vandeputte@ncentric.com>
                 Chuanhong Guo <gch981213@gmail.com>

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Co-developed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agoath79: allow to override AR8033 SGMII aneg status
David Bauer [Thu, 11 Apr 2019 15:59:44 +0000 (17:59 +0200)]
ath79: allow to override AR8033 SGMII aneg status

In order to make the QCA955x SGMII workaround work, the unsuccessful
SGMII autonegotiation on the AR8033 should not block the PHY
state-machine.

Otherwise, the ag71xx driver never becomes aware of the copper-side
link-establishment and the workaround is never executed.

Signed-off-by: David Bauer <mail@david-bauer.net>
[remove one trailing whitespace per file]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add QCA955x SGMII link loss workaround
David Bauer [Thu, 11 Apr 2019 15:59:43 +0000 (17:59 +0200)]
ath79: add QCA955x SGMII link loss workaround

This commit adds a workaround for the loss of the SGMII link observed on
the QCA955x generation of SoCs. The workaround originates part from the
U-Boot source code, part from the implementation from AVM found in the
GPL tarball for the AVM FRITZ!WLAN Repeater 450E.

The bug results in a stuck SGMII link between the PHY device and the SoC
side. This has only been observed with the Atheros AR8033 PHY and most
likely all devices using such combination are affected.

It is worked around by reading a hidden SGMII status register and
issuing a SGMII PHY reset until the link becomes useable again.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agorbextract: support devices directly showing ERD magic
Roger Pueyo Centelles [Thu, 28 Nov 2019 12:29:12 +0000 (13:29 +0100)]
rbextract: support devices directly showing ERD magic

Older ath79-based MikroTik devices have the ERD calibration data
compressed and stored different to newer IPQ40xx ones. This commit
adds support for these former ones.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Acked-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agorbextract: add package
Roger Pueyo Centelles [Thu, 28 Nov 2019 12:23:34 +0000 (13:23 +0100)]
rbextract: add package

This utility extracts the radio calibration data, as well as other
board-related information (model, serial number, etc.), from MikroTik
Routerboard devices' flash.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Acked-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agorbcfg: make package available for ath79
Roger Pueyo Centelles [Thu, 28 Nov 2019 12:11:59 +0000 (13:11 +0100)]
rbcfg: make package available for ath79

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
4 years agohostapd: fix faulty WMM IE parameters with ETSI regulatory domains
Felix Fietkau [Thu, 23 Jan 2020 13:51:58 +0000 (14:51 +0100)]
hostapd: fix faulty WMM IE parameters with ETSI regulatory domains

hostapd sets minimum values for CWmin/CWmax/AIFS and maximum for TXOP.
The code for applying those values had a few bugs leading to bogus values,
which caused significant latency and packet loss.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agokirkwood: exploit BOARD_NAME to set DEVICE_DTS and SUPPORTED_DEVICES
Adrian Schmutzler [Sat, 18 Jan 2020 01:21:15 +0000 (02:21 +0100)]
kirkwood: exploit BOARD_NAME to set DEVICE_DTS and SUPPORTED_DEVICES

Due to the history of the target, all devices added before a certain
point have the same device string in BOARD_NAME, DEVICE_DTS and added
to SUPPORTED_DEVICES.

Thus, we can set this one automatically for all devices where
BOARD_NAME is specified, removing the explicit DEVICE_DTS and
SUPPORTED_DEVICES addition there.

For new devices, nothing has changed, and just DEVICE_DTS has to
be set manually.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agosunxi: tidy up and sort alphabetically in image Makefiles
Adrian Schmutzler [Thu, 23 Jan 2020 13:21:19 +0000 (14:21 +0100)]
sunxi: tidy up and sort alphabetically in image Makefiles

This tidies up the image Makefiles for the sunxi target by:
- Move the if-condition for the subtarget to the parent Makefile
- Remove lots of unnecessary empty lines
- Sort device definitions alphabetically
- Harmonize line wrapping for DEVICE_PACKAGES

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agouboot-envtools: ath79: add support for glinet,gl-ar150
Kimmo Vuorinen [Wed, 22 Jan 2020 21:36:26 +0000 (23:36 +0200)]
uboot-envtools: ath79: add support for glinet,gl-ar150

Add ubootenv uci config for GL.inet GL-AR150

Signed-off-by: Kimmo Vuorinen <kimmo.vuorinen@gmail.com>
[commit title/message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agouboot-envtools: ar71xx: add support for gl-ar150/-domino/-mifi
Kimmo Vuorinen [Wed, 22 Jan 2020 21:34:58 +0000 (23:34 +0200)]
uboot-envtools: ar71xx: add support for gl-ar150/-domino/-mifi

Add ubootenv uci config for gl-ar150, gl-domino and gl-mifi

Signed-off-by: Kimmo Vuorinen <kimmo.vuorinen@gmail.com>
[commit message/title facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoar71xx: change u-boot-env to read-write for gl-ar150/-domino/mifi
Kimmo Vuorinen [Wed, 22 Jan 2020 21:38:35 +0000 (23:38 +0200)]
ar71xx: change u-boot-env to read-write for gl-ar150/-domino/mifi

Change u-boot-env partitions to be mounted as read-write for gl-ar150,
gl-domino and gl-mifi so uboot-envtools support is possible.

Signed-off-by: Kimmo Vuorinen <kimmo.vuorinen@gmail.com>
[commit title/message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for TP-Link TL-WA850RE v2
Adrian Schmutzler [Thu, 16 Jan 2020 13:41:44 +0000 (14:41 +0100)]
ath79: add support for TP-Link TL-WA850RE v2

TP-Link TL-WA850RE v2 is a wall-plug N300 Wi-Fi range extender,
based on Qualcomm/Atheros QCA9533 v2.

Short specification:

- 550/391/195 MHz (CPU/DDR/AHB)
- 1x 10/100 Mbps Ethernet
- 32 MB of RAM (DDR1)
- 4 MB of FLASH
- 2T2R 2.4 GHz
- 2x internal antennas (embedded on PCB)
- 9x LED (all can be turned off with GPIO15), 2x button
- UART (J3) header on PCB

Flash instruction: use "factory" image directly in vendor GUI.

Warning: this device does not include any kind of recovery mechanism
in the bootloader and disassembling process is not trivial.

You can access vendor firmware over serial line using:
- login: root
- password: sohoadmin

Stock firmware uses label MAC address for WiFi and same with local
bit set for ethernet. Since this is difficult to reproduce with
the toolset of OpenWrt, we just keep both ethernet and WiFi to
the same address here.

This is the first tiny device with tplink-safeloader in ath79.
Firmware partition is only 3648k and thus even smaller than for
the tplink-4m(lzma) devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoar71xx: use dynamic partitioning for TP-Link TL-WA850RE v2
Adrian Schmutzler [Thu, 16 Jan 2020 14:37:22 +0000 (15:37 +0100)]
ar71xx: use dynamic partitioning for TP-Link TL-WA850RE v2

This moves the TP-Link TL-WA850RE v2 to dynamic partitioning and
will allow to use this for ath79 as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agogeneric at803x: remove unneeded patches
David Bauer [Tue, 21 Jan 2020 20:11:20 +0000 (21:11 +0100)]
generic at803x: remove unneeded patches

- Remove the "RGMII TX delay fixup" hack and the associated
   DT-property. It was never used in a DT-based platform and
   solved a problem which can be mitigated by using correct
   delays on the MAC side.

 - Remove the patch to enable platform-data support for the
   at803x driver. It was only used by ar71xx which does not
   (and never will) support kernel 4.19 or later.

 - Remove the SmartEEE DT-configuration patch. As explained
   previously, this patch never disabled the Atheros SmartEEE
   implementation, but rather "standard" EEE. This can be done
   on device-tree compatible platforms by adding the
   "eee-broken-1000t" or "eee-broken-100tx" properties to the PHY
   node. As all usages of the old properties are migrated, this
   patch can be removed.

Signed-off-by: David Bauer <mail@david-bauer.net>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
4 years agoath79: use upstream properties to disable EEE
David Bauer [Tue, 21 Jan 2020 20:11:19 +0000 (21:11 +0100)]
ath79: use upstream properties to disable EEE

The hack-patch which introduced the "at803x-disable-smarteee" for
disabling SmartEEE did in fact not disable SmartEEE but rather disabled
802.3az "standard" EEE.

This can be done by using the upstream properties "eee-broken-100tx" and
"eee-broken-1000t". EEE is then disabled by the PHY subsystem.

Tested on devolo WiFi pro 1200e.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agoath79: add support for TP-Link TL-WA850RE v1
Adrian Schmutzler [Mon, 9 Dec 2019 13:51:07 +0000 (14:51 +0100)]
ath79: add support for TP-Link TL-WA850RE v1

This ports support for the TL-WA850RE v1 range extender from ar71xx
to ath79.

Specifications:
  Board: AP123 / AR9341 rev. 3
  Flash/RAM: 4/32 MiB
  CPU: 535 MHz
  WiFi: 2.4 GHz b/g/n
  Ethernet: 1 port (100M)

Flashing instructions:
Upload the factory image via the vendor firmware upgrade option.

Recovery:
Note that this device does not provide TFTP via ethernet like many
other TP-Link devices do. You will have to open the case if you
require recovery beyond failsafe.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agomac80211: add support for wds_bridge hostapd feature
Daniel Golle [Wed, 22 Jan 2020 12:14:14 +0000 (14:14 +0200)]
mac80211: add support for wds_bridge hostapd feature

hostapd allows putting WDS (4addr mode) clients into a separate bridge
other than the bridge regular (3addr mode) clients end up in. This is
useful for example giving WDS clients access to several VLANs
(trunking) while regular clients will end up inside a specific VLAN.

Add 'wds_bridge' config parameter for wifi-iface which contains the
name of the bridge. hostapd-mini already supports this feature, so all
needed is to add the UCI wrapping in mac80211.sh.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agokernel: sfp: re-attempt probing for phy
Jonas Gorski [Wed, 4 Dec 2019 22:11:34 +0000 (23:11 +0100)]
kernel: sfp: re-attempt probing for phy

Add patches retrying to probe the PHY to restore support for PHYs taking
longer to initialize without breaking modules without PHYs.

Patches taken from http://git.armlinux.org.uk/cgit/linux-arm.git/log/?h=phy

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years agokernel: sfp: add two fixes submitted to upstream
Jonas Gorski [Wed, 4 Dec 2019 22:09:41 +0000 (23:09 +0100)]
kernel: sfp: add two fixes submitted to upstream

Add two small fixes for SFP that were submitted upstream.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years agomvebu: add uDPU update patches
Russell King [Wed, 27 Nov 2019 11:45:35 +0000 (11:45 +0000)]
mvebu: add uDPU update patches

Update the uDPU kernel support, fixing a number of issues:
* make ethernet work again by adding comphy definitions
* slow the I2C bus to give it more chance of actually working
* the SFP cages are designed to support up to 3W modules, which
  would be prevented from initialising without this patch.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: rename to mvebu, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years agokernel: add SFP support for Methode DM7052 NBASE-T module
Russell King [Wed, 27 Nov 2019 11:45:30 +0000 (11:45 +0000)]
kernel: add SFP support for Methode DM7052 NBASE-T module

Add support for Methode DM7052 NBASE-T module to OpenWRT. These
patches are taken from my "phy" branch, and will be sent for the
next kernel merge window.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: move patches to pending, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years agokernel: add backported phy/phylink/sfp patches
Russell King [Wed, 27 Nov 2019 11:45:25 +0000 (11:45 +0000)]
kernel: add backported phy/phylink/sfp patches

Backport the phy/phylink/sfp patches currently queued in netdev or in
mainline necessary to support GPON popular modules, specifically to
support Huawei and Nokia GPON modules.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: include kernel version in file names, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years agokernel: move phylink patches from mvebu to generic
Russell King [Wed, 27 Nov 2019 11:45:20 +0000 (11:45 +0000)]
kernel: move phylink patches from mvebu to generic

Move two phylink patches from mvebu to generic, so that everyone can
benefit from them.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: add kernel version to file names]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years agokernel: remove obsolete phylink/SFP patches
Russell King [Wed, 27 Nov 2019 11:45:15 +0000 (11:45 +0000)]
kernel: remove obsolete phylink/SFP patches

Remove the old phylink/SFP patches from the OpenWRT build; these will
be updated with a new set in subsequent.

450-reprobe_sfp_phy is also removed for several reasons:
1) it is not in mainline.
2) it breaks copper modules that do not have a PHY.
3) it makes backporting the current patch set harder.

Discussion is ongoing with the patch author for a mainline Linux kernel
patch for this.

Signed-off-by: Russell King <linux@armlinux.org.uk>
4 years agocurl: update to version 7.68.0 (security fix)
Jan Pavlinec [Fri, 10 Jan 2020 15:42:33 +0000 (16:42 +0100)]
curl: update to version 7.68.0 (security fix)

Fixes
CVE-2019-15601

Signed-off-by: Jan Pavlinec <jan.pavlinec@nic.cz>
4 years agotools/bison: update to 3.5
Hannu Nyman [Sat, 18 Jan 2020 18:56:33 +0000 (20:56 +0200)]
tools/bison: update to 3.5

Update bison to 3.5

Release notes:
https://lists.gnu.org/archive/html/info-gnu/2019-12/msg00002.html

Note for future: release notes mention that YYPRINT macro is
declared deprecated, but apparently still works for now. I found
one possible use of that in scripts/config/zconf.tab.c_shipped
That might be modernized at some point, but as the file is synced
with the one from upstream Linux, it might get fixed there.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
4 years agoath79: remove usused TPLINK_BOARD_NAME variable for DEVICE_VARS
Adrian Schmutzler [Tue, 21 Jan 2020 17:00:31 +0000 (18:00 +0100)]
ath79: remove usused TPLINK_BOARD_NAME variable for DEVICE_VARS

TPLINK_BOARD_NAME has been renamed to TPLINK_BOARD_ID a long time
ago (7d6c63d87542: "build: rename TPLINK_BOARD_NAME to
TPLINK_BOARD_ID" for ar71xx), and before introducing ath79 target
at all.

TPLINK_BOARD_NAME seems to have been introduced into ath79 target
only by mistake. It has never been used. Remove it.

Fixes: 53c474abbdfe ("ath79: add new OF only target for QCA MIPS silicon")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoRevert "kernel: mtd: Make subpartitions inherit parent's access mode"
Petr Štetiar [Tue, 21 Jan 2020 16:05:19 +0000 (17:05 +0100)]
Revert "kernel: mtd: Make subpartitions inherit parent's access mode"

This reverts commit de80424f706682e8bba27c60bcd2a9c1b4a5e875 which needs
more work and testing as it broke at least jffs2 overlays at least on
ath79 platform, marking them as read-only, thus unusable:

 jffs2_build_filesystem(): erasing all blocks after the end marker...
 jffs2: Erase at 0x009e0000 failed immediately: -EROFS. Is the sector locked?

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2020-January/021344.html
Reported-by: Steve Brown <sbrown@ewol.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofstools: update to version 2020-01-21
Petr Štetiar [Tue, 21 Jan 2020 16:14:57 +0000 (17:14 +0100)]
fstools: update to version 2020-01-21

deb745f82b93 Revert "fstools: Add support to read-only MTD partitions (eg. recovery images)"

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agourngd: update to version 2020-01-21
Petr Štetiar [Tue, 21 Jan 2020 16:03:21 +0000 (17:03 +0100)]
urngd: update to version 2020-01-21

c7f7b6b65b82 Tag version 1.0.2
236b7a0aef21 Fix blocked entropy generation

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agozynq: derive DEVICE_DTS from device definition name
Adrian Schmutzler [Sat, 18 Jan 2020 01:21:14 +0000 (02:21 +0100)]
zynq: derive DEVICE_DTS from device definition name

In zynq target, the DEVICE_DTS variable is always set consistent
with the model part of the device definition name.

This patch replaces the redundant definitions for the individual
devices with a common recipe.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agomvebu: split base-files across subtargets
Adrian Schmutzler [Sat, 18 Jan 2020 01:21:13 +0000 (02:21 +0100)]
mvebu: split base-files across subtargets

For the mvebu target in particular, there is a lot of files in
base-files that are only relevant for one subtarget. Improve
overview and reduce size per subtarget by moving/splitting
base-files depending on the subtarget they belong to.

While at it, consolidate 01_leds by using the model part of
the board name as variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years agomvebu: use SOC to derive DEVICE_DTS
Adrian Schmutzler [Sat, 18 Jan 2020 01:21:12 +0000 (02:21 +0100)]
mvebu: use SOC to derive DEVICE_DTS

This introduces the SOC variable to mvebu target to derive some of
the DEVICE_DTS variables based on the SOC prefix and the device
definition name.

Since DTS names and compatible are inconsistent also in the kernel
for this target, the scheme cannot be applied to all devices, though.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years agomvebu: move subtarget image Makefile switch to parent Makefile
Adrian Schmutzler [Sat, 18 Jan 2020 01:21:11 +0000 (02:21 +0100)]
mvebu: move subtarget image Makefile switch to parent Makefile

This moves the if conditions for choosing which image Makefiles
are used to the parent image/Makefile. It seems more convenient
to have "codeflow" in the parent while the subtarget-specific
files only contain the definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years agoath79: add support for TP-Link TL-MR6400
Enrico Mioso [Fri, 17 Jan 2020 12:15:52 +0000 (13:15 +0100)]
ath79: add support for TP-Link TL-MR6400

This device is an LTE router supported in ar71xx so far.
As per original commit, hardware specifications (v1.0 EU):
- SoC: QCA9531
- Flash: Winbond W25Q64FV (8MiB)
- RAM: EtronTech EM6AB160TSE-5G (64MiB)
- Wireless: SoC platform only (2.4GHz b/g/n, 2x internal antenna)
- Ethernet: 2NIC (3x100M + 1x100M)
- WWAN: TP-LINK LTE MODULE (2x external detachable antenna)
- Power: DC 12V 1A

Flashing instructions:
You can flash via tftp recovery (serve factory image as /mr6400_tp_recovery.bin
on 192.168.0.66/24, connect to any ethernet port and power on device while
holding the reset button). Flashing via OEM web interface does not work.

Known issues:
- LTE module does not always come up during boot (showing USB enumeration errors). Similar behavior has been reported at least from one user for ar71xx, too. Turning USB off and on again will serve as a workaround.
- eth0 (LAN) always shows carrier as 1 even if no cable is plugged in (this works "correctly" on ar71xx)

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
[several adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Filip Moc <lede@moc6.cz>
4 years agoar71xx: ubnt-rocket-m-ti: fix RSSI LED definitions
Lech Perczak [Sun, 17 Nov 2019 19:57:10 +0000 (20:57 +0100)]
ar71xx: ubnt-rocket-m-ti: fix RSSI LED definitions

When mapping for RSSI LEDs was defined for interface wlan0 on
Ubiquiti Rocket M Titanium, it missed connection to actual interface.
Therefore create the mapping to interface, so RSSI LEDs work without
additional configuration, after starting rssileds service.

While at that, split RSSI into ~equal intervals for 6 LEDs,
and remove coefficients needed for PWM LEDs, as this board does not
support PWM LEDs.

Finally, for complete support, enable 'rssileds' package in per-device
rootfs, so the indicator works out of box.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 years agoprocd: update to latest git HEAD
Daniel Golle [Tue, 21 Jan 2020 10:52:12 +0000 (12:52 +0200)]
procd: update to latest git HEAD

 58c12f7 jail: add basic support for network namespaces
 ba69639 jail: create resolv.conf symlink for netns jails
 81b88b1 jail: more strict mount options for /tmp/resolv.conf.d/

Add new 'netns' flag for procd_add_jail to make ujail setup a new
network namespace for the jailed service.
See previous netifd commit for example configuration for netns jailed
service.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agonetifd: add basic support for jail network namespaces
Daniel Golle [Tue, 21 Jan 2020 08:18:10 +0000 (10:18 +0200)]
netifd: add basic support for jail network namespaces

Prepare netifd for handling procd service jails having their own
network namespace.
Intefaces having the jail attribute will only be brought up inside the
jail's network namespace by procd calling the newly introduced ubus
method 'netns_updown'.
Currently proto 'static' is supported and configuration changes are
not yet being handled (ie. you'll have to restart the jailed service
for changes to take effect).

Example /etc/config/network snippet:
config device 'veth0'
    option type 'veth'
    option name 'vhost0'
    option peer_name 'virt0'

config interface 'virt'
    option type 'bridge'
    list ifname 'vhost0'
    option proto 'static'
    option ipaddr '10.0.0.1'
    option netmask '255.255.255.0'

config interface 'virt0'
    option ifname 'virt0'
    option proto 'static'
    option ipaddr '10.0.0.2'
    option netmask '255.255.255.0'
    option gateway '10.0.0.1'
    option dns '10.0.0.1'
    option jail 'transmission'

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoath79: fix SUPPORTED_DEVICES for WNDR4300 and WNDR3700v4
Michal Cieslakiewicz [Mon, 20 Jan 2020 20:34:02 +0000 (21:34 +0100)]
ath79: fix SUPPORTED_DEVICES for WNDR4300 and WNDR3700v4

Kernel partition increase to 4 MiBs for Netgear WNDR3700v4 and WNDR4300
routers breaks sysupgrade image compatibility with ar71xx builds.
Therefore, SUPPORTED_DEVICES variable has to be removed for both devices
from target makefile.

Reported-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years agolibubox: update to version 2020-01-20
Petr Štetiar [Mon, 20 Jan 2020 15:22:07 +0000 (16:22 +0100)]
libubox: update to version 2020-01-20

 43a103ff17ee blobmsg: blobmsg_parse and blobmsg_parse_array oob read fixes
 5c0faaf4f5e2 tests: prefer dynamically allocated buffers
 1ffa41535369 blobmsg_json: prefer snprintf usage
 132ecb563da7 blobmsg: blobmsg_vprintf: prefer vsnprintf
 a2aab30fc918 jshn: prefer snprintf usage
 b0886a37f39a cmake: add a possibility to set library version
 a36ee96618a9 blobmsg: blobmsg_add_json_element() 64-bit values
 f0da3a4283b7 blobmsg_json: fix int16 serialization
 20a070f08139 tests: blobmsg/json: add more test cases
 379cd33d1992 tests: include json script shunit2 based testing

Acked-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agokernel: mtd: Make subpartitions inherit parent's access mode
Bruno Pena [Sat, 9 Nov 2019 14:23:58 +0000 (15:23 +0100)]
kernel: mtd: Make subpartitions inherit parent's access mode

Currently it's not possible to effectively mark a "firmware" partition
as read-only. The sub-partitions "kernel", "rootfs" and "rootfs_data"
are always created as read-write (ignoring the parent access mode).

This patch enforces the access mode of sub-partitions to match the
parent partition, which is useful for recovery images that are meant
to be fully read-only to avoid accidental damage from end-user.

An example of such implementation (read-only firmware image) is the
recovery image used on the Zsun-SD100 [1].

Please note the related patch for fstools [2] to enable this read-only
concept.

[1] https://github.com/brunompena/zsun-resources
[2] http://lists.infradead.org/pipermail/openwrt-devel/2020-January/021043.html

Signed-off-by: Bruno Pena <brunompena@gmail.com>
[removed already obsolete 4.9 kernel patch]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofstools: update to version 2020-01-18
Petr Štetiar [Sat, 18 Jan 2020 13:49:11 +0000 (14:49 +0100)]
fstools: update to version 2020-01-18

 f5c7c1813f52 fstools: Add support to read-only MTD partitions (eg. recovery images)
 189b41b6b487 libblkid-tiny: fix f2fs labels by increasing label buffer

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agokernel: bump 4.19 to 4.19.97
Koen Vandeputte [Mon, 20 Jan 2020 11:25:02 +0000 (12:25 +0100)]
kernel: bump 4.19 to 4.19.97

Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: bump 4.14 to 4.14.166
Koen Vandeputte [Mon, 20 Jan 2020 11:23:38 +0000 (12:23 +0100)]
kernel: bump 4.14 to 4.14.166

Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: bump 4.19 to 4.19.96
Koen Vandeputte [Mon, 20 Jan 2020 10:04:32 +0000 (11:04 +0100)]
kernel: bump 4.19 to 4.19.96

Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: bump 4.14 to 4.14.165
Koen Vandeputte [Mon, 20 Jan 2020 10:00:59 +0000 (11:00 +0100)]
kernel: bump 4.14 to 4.14.165

Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: bump 4.19 to 4.19.95
Koen Vandeputte [Tue, 14 Jan 2020 15:34:24 +0000 (16:34 +0100)]
kernel: bump 4.19 to 4.19.95

Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: bump 4.14 to 4.14.164
Koen Vandeputte [Tue, 14 Jan 2020 13:39:40 +0000 (14:39 +0100)]
kernel: bump 4.14 to 4.14.164

Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agobrcm47xx: fix switch port order for Netgear WN2500RP V1
Walter Sonius [Fri, 27 Dec 2019 11:41:35 +0000 (12:41 +0100)]
brcm47xx: fix switch port order for Netgear WN2500RP V1

The Netgear WN2500RP V1 switch0 already works for LAN
however the port order for the LAN ports is inverted. Correct
physical port order watched from the back of the device is:
4 / 3 / 2 / 1
WAN port is absent on this device and therefore removed
from switch config.

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
[move block to maintain alphabetic sorting]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: apply LED_POLARITY rt3050-esw on MT7628AN/MT7688
Maximilian Pachl [Wed, 13 Nov 2019 11:57:28 +0000 (12:57 +0100)]
ramips: apply LED_POLARITY rt3050-esw on MT7628AN/MT7688

The device tree property "mediatek,led_polarity" is ignored for
MT7628AN and MT7688. According to the datasheet both SoCs have
the matching register. Therefore the property should be applied
on these two devices as well.

Signed-off-by: Maximilian Pachl <m@ximilian.info>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
Tested-by: Sungbo Eo <mans0n@gorani.run>
4 years agotools: tplink-safeloader: update soft_ver for TP-Link Archer C6 v2 (EU)
Anderson Vulczak [Wed, 27 Nov 2019 23:31:52 +0000 (21:31 -0200)]
tools: tplink-safeloader: update soft_ver for TP-Link Archer C6 v2 (EU)

This patch updates "soft_ver" for TP-Link Archer C6 v2 (EU).

It makes possible to upload OpenWrt on lastest vendor's firmware
as the web-based updater checks for major.minor version during upload.

Due to that on next major/minor version update TP-Link will stop
us from using the web-based firmware update tool, so it will
require a new patch on soft_ver to match major and minor version.
Up to today's latest stock firmware the patch (major.minor.patch)
version does not matters, that allows downgrade from 1.1.4 to 1.1.1
but do not allow downgrade from 1.1.X to 1.0.X.

Signed-off-by: Anderson Vulczak <andi@andi.com.br>
4 years agokirkwood: fix HDD LED labels for Zyxel NSA325 in 01_leds
Stephan Knauss [Sat, 18 Jan 2020 18:37:08 +0000 (19:37 +0100)]
kirkwood: fix HDD LED labels for Zyxel NSA325 in 01_leds

Change the LED labels for hdd1/hdd2 in 01_leds to match their
counterpart in DTS.

Signed-off-by: Stephan Knauss <openwrt@stephans-server.de>
[improve commit title and message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobrcm47xx: fix switch port order for Netgear WNR3500 V2
Walter Sonius [Fri, 27 Dec 2019 11:25:39 +0000 (12:25 +0100)]
brcm47xx: fix switch port order for Netgear WNR3500 V2

The Netgear WNR3500 V2 switch0 already works for WAN/LAN
however the port order for the LAN ports is inverted. Correct
physical port order watched from the back of the device is:
Internet / 4 / 3 / 2 / 1 this resembles the Linksys E3000 V1.

Verfied with imagebuilder edit FILES=/etc/board.d/01_network

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
4 years agoramips: add support for TP-Link RE305 v1
Steffen Förster [Mon, 23 Dec 2019 21:48:06 +0000 (22:48 +0100)]
ramips: add support for TP-Link RE305 v1

Specification:

SoC: MediaTek MT7628AN
RAM: 64MiB
Flash: 8MiB
Wifi:
  - 2.4GHz: MT7628AN
  - 5GHz: MT7612EN
LAN: 1x 10/100 Mbps

Flash instructions:
Flash factory image through stock firmware WEB UI.
Back to stock is possible by using TFTP and stripping down the Firmware
provided by TP-Link to a initramfs.

The flash space between 0x650000 and 0x7f0000
is blank in the stock firmware so I left it out as well.

Signed-off-by: Steffen Förster <nemesis@chemnitz.freifunk.net>
4 years agokernel: remove further obsolete kernel version switches
Sungbo Eo [Sat, 18 Jan 2020 14:32:01 +0000 (23:32 +0900)]
kernel: remove further obsolete kernel version switches

Most of the kernel version switches below 4.14 were removed in commit
97940f876616 ("kernel: remove obsolete kernel version switches"),
but some of them still remained. Remove them now.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agoath79: add led_ prefix for Phicomm K2T LED label
Adrian Schmutzler [Sat, 18 Jan 2020 18:02:44 +0000 (19:02 +0100)]
ath79: add led_ prefix for Phicomm K2T LED label

Using the led_ prefix for the node label is now common in ath79,
so also apply it here.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: use rssihigh LED instead of WAN LED for status indication
Adrian Schmutzler [Sat, 18 Jan 2020 17:58:10 +0000 (18:58 +0100)]
ath79: use rssihigh LED instead of WAN LED for status indication

Using the LED of network interfaces for status (boot/failsafe/...)
indication is somewhat misleading, as the blinking might be
mistaken for network activity. This uses rssi LEDs instead, which
do not blink normally and thus are less ambiguous.

The rssihigh LED has also been used consistently for the TP-Link CPE
devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoocteon: remove redundant network setup
Adrian Schmutzler [Sat, 18 Jan 2020 01:17:28 +0000 (02:17 +0100)]
octeon: remove redundant network setup

No need to have specific setup when default case does the same.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agotools/cmake: update to 3.16.2
Hannu Nyman [Sat, 18 Jan 2020 08:30:27 +0000 (10:30 +0200)]
tools/cmake: update to 3.16.2

Update cmake to 3.16.2 and refresh patches.

Release notes:
https://cmake.org/cmake/help/v3.16/release/3.16.html

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
4 years agoramips: rt305x: remove unnecessary mediatek,portmap
Sungbo Eo [Wed, 1 Jan 2020 12:34:33 +0000 (21:34 +0900)]
ramips: rt305x: remove unnecessary mediatek,portmap

"#mediatek,portmap" is not a valid property name.

If mediatek,portmap equals 0x0, then the esw driver ditches it and uses
the default value, 0x3f.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agoramips: mt76x8: fix bogus mediatek,portmap
Sungbo Eo [Wed, 1 Jan 2020 12:34:10 +0000 (21:34 +0900)]
ramips: mt76x8: fix bogus mediatek,portmap

mt76x8 uses esw_rt3050 driver, which does not accept mediatek,portmap with
string values. Convert the strings to integers to make it work.

According to its switch setup, WRTnode 2P/2R have a WAN port at port 0,
so the correct value should be 0x3e.

tplink_8m.dtsi uses "llllw", but it does not match switch setups of any
device using the DTSI. Remove it from the DTSI and add correct value to DTS
for each device.

These devices have a WAN port at port 0. Set the value to 0x3e.
- tplink,archer-c20-v4
- tplink,archer-c50-v3
- tplink,tl-mr3420-v5
- tplink,tl-wr840n-v4
- tplink,tl-wr841n-v13
- tplink,tl-wr842n-v5

These devices have only one ethernet port. They don't need portmap setting.
- tplink,tl-wa801nd-v5
- tplink,tl-wr802n-v4
- tplink,tl-wr902ac-v3

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agoramips: mt7620/mt7621: remove invalid mediatek,portmap
Sungbo Eo [Wed, 1 Jan 2020 12:33:10 +0000 (21:33 +0900)]
ramips: mt7620/mt7621: remove invalid mediatek,portmap

mt7620 and mt7621 use mt7530 driver, which only accepts "llllw", "wllll",
and "lwlll" values.

According to its switch setup, Mi Router 3G v2 has a WAN port at port 4,
so the correct value should be "llllw".

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agobase-files/functions.sh: use grep -q instead of []
Rosen Penev [Fri, 17 Jan 2020 22:36:29 +0000 (14:36 -0800)]
base-files/functions.sh: use grep -q instead of []

It's cleaner and faster as it does not need to do extra work.

Also removed $() to avoid executing the output. The shell can handle it.

https://github.com/koalaman/shellcheck/wiki/SC2143

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[correct || to && for one conversion]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: fix wps leds/btn for TP-Link TL-WA801ND v5
Jan Alexander [Wed, 15 Jan 2020 20:12:33 +0000 (21:12 +0100)]
ramips: fix wps leds/btn for TP-Link TL-WA801ND v5

- fix color and active mode for existing wps led
- add green wps led
- add wps button

Signed-off-by: Jan Alexander <jan@nalx.net>
[wrap line]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agobase-files/system.sh: remove $ in $(())
Rosen Penev [Fri, 17 Jan 2020 04:43:59 +0000 (20:43 -0800)]
base-files/system.sh: remove $ in $(())

Not needed.

https://github.com/koalaman/shellcheck/wiki/Sc2004

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years agobase-files/functions.sh: use && instead of -a
Rosen Penev [Fri, 17 Jan 2020 04:43:57 +0000 (20:43 -0800)]
base-files/functions.sh: use && instead of -a

-a is not well defined.

https://github.com/koalaman/shellcheck/wiki/SC2166

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years agobase-files/functions.sh: remove useless cat
Rosen Penev [Fri, 17 Jan 2020 04:43:56 +0000 (20:43 -0800)]
base-files/functions.sh: remove useless cat

The cut command can take a file as an input.

https://github.com/koalaman/shellcheck/wiki/SC2002

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years agobase-files/functions.sh: don't use $var in $(())
Rosen Penev [Fri, 17 Jan 2020 04:43:53 +0000 (20:43 -0800)]
base-files/functions.sh: don't use $var in $(())

It's not needed. It can also lead to subtle bugs.

https://github.com/koalaman/shellcheck/wiki/Sc2004

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years agolibcxx: fix build for x86/64
Stijn Tintel [Thu, 16 Jan 2020 22:05:53 +0000 (00:05 +0200)]
libcxx: fix build for x86/64

When building libcxx for x86/64, the library is installed in /usr/lib64.
As the install section tries to copy the library from /usr/lib, this
breaks build on x86/64. Override the lib dir suffix to fix this.

Fixes: 856ea2bad3b3 ("libcxx: Add package")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Rosen Penev <rosenp@gmail.com>
4 years agoodhcpd: update to version 2020-01-14
Hans Dedecker [Thu, 16 Jan 2020 20:50:11 +0000 (21:50 +0100)]
odhcpd: update to version 2020-01-14

6db312a dhcpv6-ia: use dhcp leasetime to set preferred/valid statefull lifetimes
2520c48 dhcpv6-ia: introduce DHCPv6 pd and ia assignments flags
b413d8a dhcpv6-ia: cleanup prefix delegation routes
b0902af dhcpv6-ia: remove passing interface as parameter to apply_lease

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agoccache: update to 3.7.7
DENG Qingfang [Thu, 16 Jan 2020 15:35:00 +0000 (23:35 +0800)]
ccache: update to 3.7.7

Update ccache to 3.7.7

Release notes:
https://ccache.dev/releasenotes.html#_ccache_3_7_7

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years agoramips: fix HiWiFi HC5962 status LED
DENG Qingfang [Thu, 16 Jan 2020 16:27:59 +0000 (00:27 +0800)]
ramips: fix HiWiFi HC5962 status LED

Match LED behavior to stock firmware:

Red: booting
White: running

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years agoramips: fix HiWiFi HC5962 switch configuration
DENG Qingfang [Thu, 16 Jan 2020 16:24:43 +0000 (00:24 +0800)]
ramips: fix HiWiFi HC5962 switch configuration

HC5962 has only 3 LAN ports, switch port 0 is unused

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years agohostapd: add support for system cert bundle validation
David Lam [Thu, 16 Jan 2020 08:01:35 +0000 (00:01 -0800)]
hostapd: add support for system cert bundle validation

Currently, it is very cumbersome for a user to connect to a WPA-Enterprise
based network securely because the RADIUS server's CA certificate must first be
extracted from the EAPOL handshake using tcpdump or other methods before it can
be pinned using the ca_cert(2) fields. To make this process easier and more
secure (combined with changes in openwrt/openwrt#2654), this commit adds
support for validating against the built-in CA bundle when the ca-bundle
package is installed. Related LuCI changes in openwrt/luci#3513.

Signed-off-by: David Lam <david@thedavid.net>
[bump PKG_RELEASE]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agohostapd: cleanup IBSS-RSN
Daniel Golle [Thu, 16 Jan 2020 08:13:51 +0000 (10:13 +0200)]
hostapd: cleanup IBSS-RSN

set noscan also for IBSS and remove redundant/obsolete variable.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoath79: ar934x: use reset for usb-phy-analog
Johann Neuhauser [Thu, 19 Dec 2019 12:11:26 +0000 (13:11 +0100)]
ath79: ar934x: use reset for usb-phy-analog

This was already available on ar71xx, but is missing on ath79.
This solves the slow usb speed on TP-Link WDR3600/WDR4300 and similar,
as reported in Flyspray [0], OpenWRT Forum [1] and GitHub PR [2].

[0] https://bugs.openwrt.org/index.php?do=details&task_id=2567
[1] https://forum.openwrt.org/t/usb-wdr4300-low-speed-on-external-storage/46794
[2] https://github.com/openwrt/openwrt/pull/964

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
4 years agoath79: phy-ar7200-usb: adapt old behavior of arch/mips/ath79/dev-usb.c
Johann Neuhauser [Thu, 19 Dec 2019 12:07:17 +0000 (13:07 +0100)]
ath79: phy-ar7200-usb: adapt old behavior of arch/mips/ath79/dev-usb.c

Do not put usb-phy into reset if clearing the usb-phy reset or
setting the suspend_override has failed.

Reorder (de)asserts like in arch/mips/ath79/dev-usb.c.

Add an optional reset_control "usb-phy-analog", which is needed for
ar934x SoCs like in the old mach-driver arch/mips/ath79/dev-usb.c.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
4 years agoar71xx/mikrotik: use ath10k-ct-smallbuffers for 64 MiB devices
Thomas Nixon [Sun, 5 Jan 2020 21:38:36 +0000 (21:38 +0000)]
ar71xx/mikrotik: use ath10k-ct-smallbuffers for 64 MiB devices

This image is only needed on one device (wAP AC); since this target is
going to be removed anyway it doesn't make sense to add an extra "low
RAM" image.

Fixes OOM issues on RouterBoard wAP AC.

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
4 years agouboot-oxnas: fix memory leak in tool mkox820crc
Andrea Dalla Costa [Sat, 28 Dec 2019 16:43:40 +0000 (17:43 +0100)]
uboot-oxnas: fix memory leak in tool mkox820crc

In function `main` add calls to `free` for the variable `executable`.
This is needed because the variable `executable` is allocated but
never freed. This cause a memory leak.

Signed-off-by: Andrea Dalla Costa <andrea@dallacosta.me>
4 years agoath79: use caldata partition label consistently
Adrian Schmutzler [Wed, 15 Jan 2020 22:03:16 +0000 (23:03 +0100)]
ath79: use caldata partition label consistently

Change the caldata partition DTS node label to be consistent with
the label property for some Netgear WNDR devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agomalta: enable HighMem on MIPS32
Aleksander Jan Bajkowski [Mon, 6 Jan 2020 11:02:36 +0000 (12:02 +0100)]
malta: enable HighMem on MIPS32

It allows to use more than 256MB memory on MIPS32.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years agodropbear: fix compile error
John Crispin [Wed, 15 Jan 2020 20:31:12 +0000 (21:31 +0100)]
dropbear: fix compile error

Fixes: 0da193ee6943 ("dropbear: move failsafe code out of base-files")
Signed-off-by: John Crispin <john@phrozen.org>
4 years agowireguard: skip peer config if public key of the peer is not defined
Florian Eckert [Thu, 5 Dec 2019 10:33:38 +0000 (11:33 +0100)]
wireguard: skip peer config if public key of the peer is not defined

If a config section of a peer does not have a public key defined, the
whole interface does not start. The following log is shown

daemon.notice netifd: test (21071): Line unrecognized: `PublicKey='
daemon.notice netifd: test (21071): Configuration parsing erro

The command 'wg show' does only show the interface name.

With this change we skip the peer for this interface and emit a log
message. So the other peers get configured.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
4 years agobusybox: fix build issues
John Crispin [Wed, 15 Jan 2020 20:17:13 +0000 (21:17 +0100)]
busybox: fix build issues

Fixes: f704f97e4c57 ("busybox: Include hdparm by default on nas type device")
Signed-off-by: John Crispin <john@phrozen.org>
4 years agoath79: add support for Netgear WNDR4500 v3
Michal Cieslakiewicz [Sun, 22 Dec 2019 20:55:54 +0000 (21:55 +0100)]
ath79: add support for Netgear WNDR4500 v3

This patch introduces support for Netgear WNDR4500v3. Router
is very similar to WNDR4300v2 and is based on the same PCB.

Information gathered from various Internet sources (including
https://patchwork.ozlabs.org/patch/809227/) shows following
differences to WNDR4300v2:

 * two USB 2.0 ports with separate LEDs
 * USB LEDs soldered to secondary pads
 * WPS and RFKILL buttons soldered to secondary pads
 * described as N900 device with 3x3:3 MIMO for 2.4GHz radio
 * power supply requirement is DC 12V 2.5A
 * vendor HW ID suffix differs in one digit
 * bigger chassis

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years agoath79: add support for Netgear WNDR4300 v2
Michal Cieslakiewicz [Sun, 22 Dec 2019 20:54:33 +0000 (21:54 +0100)]
ath79: add support for Netgear WNDR4300 v2

This patch introduces support for Netgear WNDR4300v2.

Specification
=============
  * Description: Netgear WNDR4300 v2
  * Loader: U-boot
  * SOC: Qualcomm Atheros QCA9563 (775 MHz)
  * RAM: 128 MiB
  * Flash: 2 MiB SPI-NOR + 128 MiB SPI-NAND
- NOR: U-boot binary: 256 KiB
- NOR: U-boot environment: 64 KiB
- NOR: ART Backup: 64 KiB
  - NOR: Config: 64 KiB
- NOR: Traffic Meter: 64 KiB
- NOR: POT: 64 KiB
- NOR: Reserved: 1408 KiB
- NOR: ART: 64 KiB
- NAND: Firmware: 25600 KiB (see notes for OpenWrt)
- NAND: Language: 2048 KiB
- NAND: mtdoops Crash Dump: 128 KiB
- NAND: Reserved: 103296 KiB
  * Ethernet: 5 x 10/100/1000 (4 x LAN, 1 x WAN) (AR8337)
  * Wireless:
- 2.4 GHz b/g/n (internal)
- 5 GHz a/n (AR9580)
  * USB: yes, 1 x USB 2.0
  * Buttons:
- Reset
- WiFi (rfkill)
- WPS
  * LEDs:
- Power (amber/green)
- WAN (amber/green)
- WLAN 2G (green)
- WLAN 5G (blue)
- 4 x LAN (amber/green)
- USB (green)
- WPS (green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 1.5A
  * MAC addresses: LAN=WLAN2G on case label, WAN +1, WLAN5G +2

Important Notes
===============
0. NOR Flash (2 MiB) is not touched by OpenWrt installation.
1. NAND Flash (128 MiB) layout under OpenWrt is changed as follows:
   all space is split between 4 MiB kernel and 124 MiB UBI areas;
   vendor partitions (language and mtdoops) are removed; kernel space
   size can be further expanded if needed; maximum image size is set
   to 25600k for compatibility reasons and can also be increased.
2. CPU clock is 775 MHz, not 750 MHz.
3. 5 GHz wireless radio chip is Atheros AR9580-AR1A with bogus PCI
   device ID 0xabcd. For ath9k driver to load successfully, this is
   overriden in DTS with correct value for this chip, 0x0033.
4. RFKILL button is wired to AR9580 pin 9 which is normally disabled
   by chip definition in ath9k code (0x0000F4FF gpio mask). Therefore
   'qca,gpio-mask=<0xf6ff>' hack must be used for button to work
   properly.
5. USB port is always on, no GPIO for 5V power control has been
   identified.

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_nand=y
CONFIG_TARGET_ath79_nand_DEVICE_netgear_wndr4300-v2=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years agoath79: WNDR4300: increase kernel partition to 4M
Michal Cieslakiewicz [Sun, 22 Dec 2019 20:53:29 +0000 (21:53 +0100)]
ath79: WNDR4300: increase kernel partition to 4M

Increase kernel partition from 2 MiB to 4 MiB for Netgear WNDR routers
with NAND flash. Change affects following devices:
 * Netgear WNDR3700 v4
 * Netgear WNDR4300

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>