openwrt/openwrt.git
4 years agobuild: Add option KERNEL_UBSAN
Hauke Mehrtens [Wed, 12 Feb 2020 10:48:59 +0000 (11:48 +0100)]
build: Add option KERNEL_UBSAN

The kernel Undefined Behavior Sanitizer is able to detect some memory
bugs in the kernel like out of range array accesses.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
4 years agox86: Add missing kernel option CONFIG_X86_DECODER_SELFTEST
Hauke Mehrtens [Tue, 11 Feb 2020 18:01:24 +0000 (19:01 +0100)]
x86: Add missing kernel option CONFIG_X86_DECODER_SELFTEST

This option has now a different dependency and can be activated, set a
default value.

Fixes: 20b5a4ca01ca ("kernel: bump 4.19 to 4.19.101")
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
Tested-by: Alexandru Ardelean <ardeleanalex@gmail.com>
4 years agorssileds: add dependencies based on LDFLAGS
Adrian Schmutzler [Thu, 20 Feb 2020 17:38:04 +0000 (18:38 +0100)]
rssileds: add dependencies based on LDFLAGS

This adds the direct dependencies introduced by TARGET_LDFLAGS
to the package's DEPENDS variable.

This was found by accidentally building rssileds on octeon, which
resulted in:

"Package rssileds is missing dependencies for the following libraries:
libnl-tiny.so"

Though the dependencies are provided when building for the
relevant targets ar71xx, ath79 and ramips, it seems more tidy to
specify them explicitly.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agokirkwood: do not expose status LED to user config by default
Adrian Schmutzler [Fri, 21 Feb 2020 20:09:25 +0000 (21:09 +0100)]
kirkwood: do not expose status LED to user config by default

So far, the state of status LEDs is set up in 01_leds for many devices
in kirkwood target. As those LEDs are also controlled by diag.sh,
exposing them to the user via uci config by default seems not helpful
and might even have confusing results for the user.

Thus, remove the ucidef_set_led_default setup for power/status LED, but
do not touch the rest where user control is actually a feature.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agokirkwood: set default state for status LEDs in device tree
Adrian Schmutzler [Wed, 19 Feb 2020 16:03:04 +0000 (17:03 +0100)]
kirkwood: set default state for status LEDs in device tree

This adds the default-state = "on"; statement for the power or
primary status LED in DTS on kirkwood. This will ensure that this
LED will be lit up very early in the boot process (i.e. before
diag.sh is executed) and thus will provide an additional hint to the
user when problems arise during early boot process.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agokirkwood: add diag LEDs for ZyXEL NSA325
Adrian Schmutzler [Wed, 19 Feb 2020 15:39:32 +0000 (16:39 +0100)]
kirkwood: add diag LEDs for ZyXEL NSA325

This device has had no diag LEDs set up so far, so let's just
add them.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agokirkwood: use generic diag.sh
Pawel Dembicki [Tue, 4 Feb 2020 16:26:47 +0000 (17:26 +0100)]
kirkwood: use generic diag.sh

This commit removes the target-specific diag.sh script. This way, the
generic one is used for the target, which uses DT-aliases to specify the
LEDs used.

Generic diag.sh allow to use different LEDs to indicate different states.
Non-red status LEDs for indicating boot and a running system.
Where possible, the red or orange LEDs are used to indicate failsafe
mode and a running upgrade.

Compile-tested: all target devices.
Run-tested: CheckPoint L-50

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[remove unrelated cosmetic changes, rename some labels, add pogo_e02]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agolldpd: bump to 1.0.5
Stijn Tintel [Thu, 20 Feb 2020 21:39:06 +0000 (23:39 +0200)]
lldpd: bump to 1.0.5

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
4 years agoath79: add support for Teltonika RUT955
Daniel Golle [Sun, 2 Feb 2020 16:09:50 +0000 (18:09 +0200)]
ath79: add support for Teltonika RUT955

Specification:

- 550/400/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 4x 10/100 Mbps Ethernet, with passive PoE support on LAN1
- 2T2R 2,4 GHz (AR9344)
- built-in 4G/3G module (example: Quectel EC-25EU)
- internal microSD slot (spi-mmc, buggy and disabled for now)
- RS232 on D-Sub9 port (Cypress ACM via USB, /dev/ttyACM0)
- RS422/RS485 (AR934x high speed UART, /dev/ttyATH1)
- analog 0-24V input (MCP3221)
- various digital inputs and outputs incl. a relay
- 11x LED (4 are driven by AR9344, 7 by 74HC595)
- 2x miniSIM slot (can be swapped via GPIO)
- 2x RP-SMA/F (Wi-Fi), 3x SMA/F (2x WWAN, GPS)
- 1x button (reset)
- DC jack for main power input (9-30 V)
- debugging UART available on PCB edge connector

Serial console (/dev/ttyS0) pinout:

- RX: pin1 (square) on top side of the main PCB (AR9344 is on top)
- TX: pin1 (square) on bottom side

Flash instruction:

Vendor firmware is based on OpenWrt CC release. Use the "factory" image
directly in GUI (make sure to uncheck "keep settings") or in U-Boot web
based recovery. To avoid any problems, make sure to first update vendor
firmware to latest version - "factory" image was successfully tested on
device running "RUT9XX_R_00.06.051" firmware and U-Boot "3.0.2".

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoserial: ar933x_uart: add rs485 support
Daniel Golle [Wed, 5 Feb 2020 15:00:57 +0000 (17:00 +0200)]
serial: ar933x_uart: add rs485 support

Add support for RS485 tranceiver with transmit/receive switch hooked
to a RTS GPIO pin.
Use the 'rts-gpios' and 'rs485-rts-active-low' properties as described
in devicetree/bindings/serial/rs485.yaml.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoath79: add support for TP-Link TL-WA701ND/730RE/801ND/901ND v1
Adrian Schmutzler [Fri, 14 Feb 2020 14:38:55 +0000 (15:38 +0100)]
ath79: add support for TP-Link TL-WA701ND/730RE/801ND/901ND v1

This adds support for the various clones of the TL-WA830RE recently
supported in fb99ac6807f2 ("ath79: add support for TP-Link TL-WA830RE v1"):

- tplink,tl-wa701nd-v1
- tplink,tl-wa730re-v1
- tplink,tl-wa801nd-v1
- tplink,tl-wa830re-v1 (already supported)
- tplink,tl-wa901nd-v1

Since these devices are 100%-clones in ar71xx, this patch adds all
of them without run-testing (as this has been done for TL-WA830RE v1).

Specifications:
- SOC: Atheros AR7240
- CPU: 400MHz
- Flash: 4 MiB (Spansion S25FL032P)
- RAM: 32 MiB (Zentel A3S56D40FTP-G5)
- WLAN: Atheros AR9280 bgn 2x2
- Ethernet: 1 port (100M)

Flash instructions:
- install from u-boot with tftp (requires serial access)
  > setenv ipaddr a.b.c.d
  > setenv serverip e.f.g.h
  > tftpboot 0x80000000 \
      openwrt-ath79-tiny-tplink_tl-waxxxxx-v1-squashfs-factory.bin
  > erase 0x9f020000 +0x3c0000
  > cp.b 0x80000000 0x9f020000 0x3c0000
  > bootm 0x9f020000
- flash factory image from OEM WebUI
- sysupgrade from ar71xx image

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: fix HiWiFi HC5761A USB port
DENG Qingfang [Wed, 12 Feb 2020 13:14:26 +0000 (21:14 +0800)]
ramips: fix HiWiFi HC5761A USB port

Export GPIO 41 to power USB port

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years agoramips: gsw_mt7621: disable PORT 5 MAC RX/TX flow control by default
Petr Štetiar [Tue, 11 Feb 2020 10:17:41 +0000 (11:17 +0100)]
ramips: gsw_mt7621: disable PORT 5 MAC RX/TX flow control by default

Looking at the current upstream driver implementation, it seems like the
TX/RX flow control is enabled only if the flow control pause option is
resolved from the device/link partner advertisements (or otherwise set).

On the other hand, our current in-tree driver force enables TX/RX
flow control by default, thus possibly leading to TX timeouts if the
other end sends pause frames (which are not properly handled?):

 WARNING: CPU: 3 PID: 0 at net/sched/sch_generic.c:320 dev_watchdog+0x1ac/0x324
 NETDEV WATCHDOG: eth0 (mtk_soc_eth): transmit queue 0 timed out

Disabling the flow control on PORT 5 MAC seems to fix this issues as the
pause frames are then filtered out. While at it, I'm removing the if
condition completely as suggested, since this code is run only on mt7621
SoC, so there is no need to check for the silicon revisions.

Ref: https://lists.openwrt.org/pipermail/openwrt-devel/2017-November/009882.html
Ref: https://forum.openwrt.org/t/mtk-soc-eth-watchdog-timeout-after-r11573/50000/12
Suggested-by: Felix Fietkau <nbd@nbd.name>
Reported-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agomt76: update to the latest version
Felix Fietkau [Thu, 20 Feb 2020 14:06:14 +0000 (15:06 +0100)]
mt76: update to the latest version

f4415afce213 mt76: mt76u: loop over all possible rx queues in mt76u_rx_tasklet
5b9f949cb760 mt76: mt76u: fix a possible memory leak in mt76u_init
fd892bc033fb mt76: mt76u: rely only on data buffer for usb control messagges

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agoath79: correct Siemens WS-AP3610 blocksize
David Bauer [Thu, 20 Feb 2020 09:29:09 +0000 (10:29 +0100)]
ath79: correct Siemens WS-AP3610 blocksize

With the wrong blocksize, the rootfs was not positioned on the boundary
of a block, thus breaking the mtdsplit driver.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agoppp: backport security fixes
Petr Štetiar [Thu, 20 Feb 2020 08:03:54 +0000 (09:03 +0100)]
ppp: backport security fixes

8d45443bb5c9 pppd: Ignore received EAP messages when not doing EAP
8d7970b8f3db pppd: Fix bounds check in EAP code
858976b1fc31 radius: Prevent buffer overflow in rc_mksid()

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoutil-linux: Update to 2.35.1
Daniel Engberg [Mon, 3 Feb 2020 17:11:35 +0000 (17:11 +0000)]
util-linux: Update to 2.35.1

Update util-linux to 2.35.1 and refresh patches.

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
[commit subject and description tweaks]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoath79: add label MAC address for Ubiquiti Picostation M (XM)
Adrian Schmutzler [Wed, 19 Feb 2020 22:34:41 +0000 (23:34 +0100)]
ath79: add label MAC address for Ubiquiti Picostation M (XM)

This adds the label MAC address for the Ubiquiti Picostation M (XM).
This was overlooked when adding support in the previous patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for Ubiquiti Picostation M (XM)
Adrian Schmutzler [Mon, 17 Feb 2020 23:08:18 +0000 (00:08 +0100)]
ath79: add support for Ubiquiti Picostation M (XM)

This adds support for the Ubiquiti Picostation M (XM), which has the
same board/LEDs as the Bullet M XM, but different case and antennas.

Specifications:
- AR7241 SoC @ 400 MHz
- 32 MB RAM
- 8 MB SPI flash
- 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
- External antenna: 5 dBi (USA), 2 dBi (EU)
- POWER/LAN green LEDs
- 4x RSSI LEDs (red, orange, green, green)
- UART (115200 8N1) on PCB

Flashing via WebUI:
  Upload the factory image via the stock firmware web UI.

  Attention: airOS firmware versions >= 5.6 have a new bootloader with
  an incompatible partition table!

  Please downgrade to <= 5.5 _before_ flashing OpenWrt!
  Refer to the device's Wiki page for further information.

Flashing via TFTP:
  Same procedure as other NanoStation M boards.

- Use a pointy tool (e.g., pen cap, paper clip) and keep the reset
  button on the device or on the PoE supply pressed
- Power on the device via PoE (keep reset button pressed)
- Keep pressing until LEDs flash alternatively LED1+LED3 =>
  LED2+LED4 => LED1+LED3, etc.
- Release reset button
- The device starts a TFTP server at 192.168.1.20
- Set a static IP on the computer (e.g., 192.168.1.21/24)
- Upload via tftp the factory image:
  $ tftp 192.168.1.20
  tftp> bin
  tftp> trace
  tftp> put openwrt-ath79-generic-xxxxx-ubnt_picostation-m-squashfs-factory.bin

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for Ubiquiti Nanostation Loco M (XM)
Sven Roederer [Mon, 17 Feb 2020 11:22:53 +0000 (12:22 +0100)]
ath79: add support for Ubiquiti Nanostation Loco M (XM)

This adds support for the Ubiquiti Nanostation Loco M (XM), which
has the same board/LEDs as the Bullet M XM, but different case and
antennas.

Specifications:
- AR7241 SoC @ 400 MHz
- 32 MB RAM
- 8 MB SPI flash
- 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
- NS Loco M2: built-in antenna: 8 dBi; AR9287
- NS Loco M5: built-in antenna: 13 dBi; 2T2R 5 GHz radio
- POWER/LAN green LEDs
- 4x RSSI LEDs (red, orange, green, green)
- UART (115200 8N1) on PCB

Flashing via WebUI:
  Upload the factory image via the stock firmware web UI.
  Note that only certain firmware versions accept unsigned
  images. Refer to the device's Wiki page for further information.

Flashing via TFTP:
  Same procedure as other NanoStation M boards.

- Use a pointy tool (e.g., pen cap, paper clip) and keep the reset
  button on the device or on the PoE supply pressed
- Power on the device via PoE (keep reset button pressed)
- Keep pressing until LEDs flash alternatively LED1+LED3 =>
  LED2+LED4 => LED1+LED3, etc.
- Release reset button
- The device starts a TFTP server at 192.168.1.20
- Set a static IP on the computer (e.g., 192.168.1.21/24)
- Upload via tftp the factory image:
  $ tftp 192.168.1.20
  tftp> bin
  tftp> trace
  tftp> put openwrt-ath79-generic-xxxxx-ubnt_nanostation-loco-m-squashfs-factory.bin

Tested on NanoStation Loco M2.

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
Co-developed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: move TPLINK_HWID/_HWREV to parent for tplink-safeloader
Adrian Schmutzler [Sun, 16 Feb 2020 09:40:53 +0000 (10:40 +0100)]
ath79: move TPLINK_HWID/_HWREV to parent for tplink-safeloader

Several devices with tplink-safeloader contain default values (0x0)
for TPLINK_HWID and TPLINK_HWREV in their device definitions.
Move those to common tplink-safeloader definition so they do not
have to be repeated each time.

While at it, set default value for tplink-v1 and tplink-v2 as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agomt76: update to the latest version
Felix Fietkau [Wed, 19 Feb 2020 21:12:04 +0000 (22:12 +0100)]
mt76: update to the latest version

bd0df1b017a8 mt76: avoid extra RCU synchronization on station removal
d5a5e97b67c7 mt76: mt76x2: avoid starting the MAC too early
a67e42990d8a mt76: mt7615: fix msdu_id endianness in mt7615_write_hw_txp
d3af8bd3c722 mt76: mt7615: set proper length in strncmp
9c43417db17c mt76: mt7615: fix max_nss in mt7615_eeprom_parse_hw_cap
764e1d208a06 mt76: mt7615: fix tx power reporting
1881241c7ee5 mt76: fix rounding issues on converting per-chain and combined txpower
fa14e7f33199 mt76: mt7615: rework rx phy index handling
a205ce3e3e2d mt76: mt7615: fix ext_phy flag for stations
457a93203690 mt76: mt7615: fix MT_TX_HW_QUEUE_EXT_PHY to deal with mac80211 changes
c75cf513c674 mt76: do not set HOST_BROADCAST_PS_BUFFERING for mt7615
cc56c400167c mt76: fix LED link time failure
4dbd56b86970 mt76: mt76x0u: add support to TP-Link T2UHP
e226309c4bc4 mt76: mt7615: rely on mt76_queues_read for mt7622
c6a025318075 mt76: mt76u: extend RX scatter gather number
dfc24bc504e3 mt76: mt76u: rename stat_wq in wq
2bbffd2cb37b mt76: mt7615: remove rx_mask in mt7615_eeprom_parse_hw_cap
f408a2b7566c mt76: Introduce mt76_mcu data structure
17ecf0762542 mt76: mt76x02: fix handling MCU timeouts during hw restart
284e9fd72912 mt76: mt7615: fix monitor injection of beacon frames
8f8e9161b355 mt76: fix array overflow on receiving too many fragments for a packet

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agokernel: avoid underscore in *6lowpan package names
Eneas U de Queiroz [Tue, 18 Feb 2020 20:47:20 +0000 (17:47 -0300)]
kernel: avoid underscore in *6lowpan package names

Packages kmod-bluetooth_6lowpan and kmod-ieee802154_6lowpan contain an
underscore in the package name.  This causes problems in package/install
because when building a list of package files to install offline using
opkg, it uses a wildcard of the form $(dir)/$(pkg)_*.ipk.

If you were to select kmod-bluetooth=y, but kmod-bluetooth_6lowpan=m,
the latter would be picked up by that wildcard, and make package/install
would fail:

Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies
 * for kmod-bluetooth_6lowpan:
 *      kmod-6lowpan
 * opkg_install_cmd: Cannot install package kmod-bluetooth_6lowpan.

Changing the wildcard pattern is not trivial, and there may be other
places in the build system making this assumption about the package name
format.

Using a dash in place of the underscore avoids the issue.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
4 years agodnsmasq: fix uci-defaults script to exit 0 so it is cleaned up
Russell Senior [Tue, 18 Feb 2020 06:16:10 +0000 (22:16 -0800)]
dnsmasq: fix uci-defaults script to exit 0 so it is cleaned up

A file, package/network/services/dnsmasq/files/50-dnsmasq-migrate-resolv-conf-auto.sh,
was added in commit 6a2855212096d2c486961a0841b037bae4b75de7, but it
does not exit in a way that tells the uci-defaults mechanism that it
succeeded, and so it is not cleaned up after running successfully. Add
an exit 0 to the end to correct that.

Signed-off-by: Russell Senior <russell@personaltelco.net>
4 years agotools/bison: Update to 3.5.1
Daniel Engberg [Mon, 3 Feb 2020 13:30:01 +0000 (13:30 +0000)]
tools/bison: Update to 3.5.1

Update bison to 3.5.1
Use POSIX threads as the previous option is no longer valid
Disable NLS support to be consistent with other tools such as e2fsprogs and sed

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
4 years agotools/e2fsprogs: Update to 1.45.5
Daniel Engberg [Mon, 3 Feb 2020 13:21:56 +0000 (13:21 +0000)]
tools/e2fsprogs: Update to 1.45.5

Update e2fsprogs to 1.45.5
Enable pthreads support

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
4 years agotools/gmp: Remove obsolete options
Daniel Engberg [Mon, 3 Feb 2020 13:04:07 +0000 (13:04 +0000)]
tools/gmp: Remove obsolete options

Remove mpbsd argument

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
4 years agotools/sed: Update to 4.8
Daniel Engberg [Mon, 3 Feb 2020 13:09:49 +0000 (13:09 +0000)]
tools/sed: Update to 4.8

Update sed to 4.8
Use POSIX threads
Disable i18n and selinux support

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
4 years agotools/patchelf: Update to 0.10
Daniel Engberg [Mon, 3 Feb 2020 13:13:27 +0000 (13:13 +0000)]
tools/patchelf: Update to 0.10

Update patchelf to 0.10

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
4 years agotools/libressl: Update to 3.0.2
Daniel Engberg [Mon, 3 Feb 2020 15:47:47 +0000 (15:47 +0000)]
tools/libressl: Update to 3.0.2

Update libressl to 3.0.2 and remove 010-avoid-glibc.patch as fix is added by upstream

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
4 years agoath79: add gpio4 pinmux on TL-WR841N/ND v8, WR842N v2, MR3420 v2
Adrian Schmutzler [Thu, 30 Jan 2020 13:59:25 +0000 (14:59 +0100)]
ath79: add gpio4 pinmux on TL-WR841N/ND v8, WR842N v2, MR3420 v2

This adds a pinmux to the shared DTSI for TP-Link TL-WR841N/ND v8,
TL-WR842N v2 and TL-MR3420 v2. It is supposed to be the equivalent
of:

/* config gpio4 as normal gpio function */
ath79_gpio_output_select(TL_MR3420V2_GPIO_USB_POWER,AR934X_GPIO_OUT_GPIO);

This allows to enable USB power on these devices.

While at it, move the jtag_disable_pins to &gpio node and remove the
redundant status=okay there.

Tested on TP-Link TL-WR842N v2.

Fixes: FS#2753
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Armin Fuerst <armin@fuerst.priv.at>
4 years agoath79: move mikrotik-caldata.sh to target base-files
Adrian Schmutzler [Mon, 17 Feb 2020 19:16:17 +0000 (20:16 +0100)]
ath79: move mikrotik-caldata.sh to target base-files

Mikrotik devices will be found in both generic and nand subtargets.

The file mikrotik-caldata.sh, currently used in generic, contains
a few lines of code that would need to be duplicated for nand
support. Instead of duplicating it, move it to target base-files,
as size impact is small and the maintenance gain should outweigh it.

This is changed separately to make life easier for the people
currently working on Mikrotik NAND support.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for Siemens WS-AP3610
David Bauer [Sat, 8 Feb 2020 11:58:25 +0000 (12:58 +0100)]
ath79: add support for Siemens WS-AP3610

Hardware
--------
SoC:  Atheros AR7161
RAM:  Samsung K4H511638D-UCCC
      2x 64M DDR1
SPI:  Micron M25P128 (16M)
WiFi: Atheros AR9160 bgn
      Atheros AR9160 an
ETH:  Broadcom BCM5481
LED:  Power (Green/Red)
      ETH (Green / Blue / Yellow)
          (PHY-controlled)
      WiFi 5 (Green / Blue)
      WiFi 2 (Green / Blue)
BTN:  Reset

Serial: Cisco-Style RJ45 - 115200 8N1

Installation
------------

1. Download the OpenWrt initramfs-image. Place it into a TFTP server
   root directory and rename it to 1401A8C0.img. Configure the TFTP
   server to listen at 192.168.1.66/24.

2. Connect the TFTP server to the access point.

3. Connect to the serial console of the access point. Attach power and
   interrupt the boot procedure when prompted (bootdelay is 1 second).

4. Configure the U-Boot environment for booting OpenWrt from Ram and
   flash:

   $ setenv boot_openwrt 'setenv bootargs; bootm 0xbf080000'
   $ setenv ramboot_openwrt 'setenv serverip 192.168.1.66;
     tftpboot; bootm'
   $ saveenv

5. Load OpenWrt into memory:

   $ run ramboot_openwrt

   Wait for the image to boot.

6. Transfer the OpenWrt sysupgrade image to the device. Write the image
   to flash using sysupgrade:

   $ sysupgrade -n /path/to/openwrt-sysuograde.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agoath79: backport phy reset-controller patches
David Bauer [Sat, 8 Feb 2020 22:36:12 +0000 (23:36 +0100)]
ath79: backport phy reset-controller patches

The Siemens WS-AP3610 asserts reset to the ethernet PHY with the
reset-register. Backport the necessary patches to de-assert reset
when probing the PHY.

These patches can be dropped when using kernel 5.4.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agowireguard: bump to 0.0.20200215
Jason A. Donenfeld [Fri, 14 Feb 2020 23:05:17 +0000 (00:05 +0100)]
wireguard: bump to 0.0.20200215

* send: cleanup skb padding calculation
* socket: remove useless synchronize_net

Sorry for the back-to-back releases. This fixes a regression spotted by Eric
Dumazet.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years agobrcm2708: rename target to bcm27xx
Adrian Schmutzler [Sat, 8 Feb 2020 20:58:55 +0000 (21:58 +0100)]
brcm2708: rename target to bcm27xx

This change makes the names of Broadcom targets consistent by using
the common notation based on SoC/CPU ID (which is used internally
anyway), bcmXXXX instead of brcmXXXX.
This is even used for target TITLE in make menuconfig already,
only the short target name used brcm so far.

Despite, since subtargets range from bcm2708 to bcm2711, it seems
appropriate to use bcm27xx instead of bcm2708 (again, as already done
for BOARDNAME).

This also renames the packages brcm2708-userland and brcm2708-gpu-fw.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years agobrcm63xx: rename target to bcm63xx
Adrian Schmutzler [Sat, 8 Feb 2020 19:33:30 +0000 (20:33 +0100)]
brcm63xx: rename target to bcm63xx

This change makes the names of Broadcom targets consistent by using
the common notation based on SoC/CPU ID (which is used internally
anyway), bcmXXXX instead of brcmXXXX.
This is even used for target TITLE in make menuconfig already,
only the short target name used brcm so far.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobrcm47xx: rename target to bcm47xx
Adrian Schmutzler [Fri, 7 Feb 2020 14:42:54 +0000 (15:42 +0100)]
brcm47xx: rename target to bcm47xx

This change makes the names of Broadcom targets consistent by using
the common notation based on SoC/CPU ID (which is used internally
anyway), bcmXXXX instead of brcmXXXX.
This is even used for target TITLE in make menuconfig already,
only the short target name used brcm so far.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: fix HiWiFi HC5761A switch settings
DENG Qingfang [Wed, 12 Feb 2020 13:17:23 +0000 (21:17 +0800)]
ramips: fix HiWiFi HC5761A switch settings

HC5761A has only 2 LAN ports

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years agoiproute2: update to 5.5.0, enable LTO
DENG Qingfang [Wed, 12 Feb 2020 12:23:01 +0000 (20:23 +0800)]
iproute2: update to 5.5.0, enable LTO

Update iproute2 to 5.5.0
Enable LTO to save several KB of size

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years agobuild: fix empty SUBTARGET in json files
Paul Spooren [Wed, 12 Feb 2020 03:27:24 +0000 (17:27 -1000)]
build: fix empty SUBTARGET in json files

Some targets like kirkwood or omap don't use a subtarget which results
in a malformed JSON info file.

Instead of having a valid value like `"target": "ath79/tiny"` for these
targets the value is `"target": "kirkwood/"`.

This patch uses the same if condition to use `generic` if the subtarget
is empty.

Tested for the kirkwood target.

Signed-off-by: Paul Spooren <mail@aparcar.org>
4 years agomac80211: expose chanbw support to debugfs for ath9k_htc
Tomislav Požega [Thu, 6 Sep 2018 14:20:13 +0000 (16:20 +0200)]
mac80211: expose chanbw support to debugfs for ath9k_htc

This will ensure the htc suffixed driver also gets created
chanbw debugfs entry.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
4 years agoath10k-firmware: update ath10k-ct firmware
Michael Yartys [Wed, 29 Jan 2020 22:22:02 +0000 (23:22 +0100)]
ath10k-firmware: update ath10k-ct firmware

This supports better per-chain noise floor reporting, which in turn allows for
better RSSI reporting in the driver.

Wave-2 fixes a long-standing rate-ctrl problem when connected to xbox (and probably other devices).

Wave-2 has fix for crash likely related to rekeying.

Wave-1 has some debugging code added where a user reported a crash.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ipq806x+qca9984,ipq4019+qca9986]
Signed-off-by: Michael Yartys <michael.yartys@protonmail.com>
4 years agoath10k-ct: update to 2020-01-29
Michael Yartys [Wed, 29 Jan 2020 22:19:30 +0000 (23:19 +0100)]
ath10k-ct: update to 2020-01-29

Changes:

ath10k-ct: Support better RSSI measurements.

When used with recent firmware, these changes allow the driver to
query per-chain noise-floor from the radio to better calculate the
per-chain RSSI. The per-chain RSSI is then summed to provide the
'combined RSSI'. This gives better per-chain RSSI as well as combined
RSSI, especially when running with more than 20Mhz bandwidths.

Refresh patches.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ipq806x+qca9984,ipq4019+qca9986]
Signed-off-by: Michael Yartys <michael.yartys@protonmail.com>
4 years agosunxi: backport increased SATA/AHCI DMA TX/RX FIFOs
Aleksander Jan Bajkowski [Wed, 5 Feb 2020 19:31:00 +0000 (20:31 +0100)]
sunxi: backport increased SATA/AHCI DMA TX/RX FIFOs

This backports SATA performance boost from 5.3 kernel:

 Increasing the SATA/AHCI DMA TX/RX FIFOs (P0DMACR.TXTS and .RXTS, ie.
 TX_TRANSACTION_SIZE and RX_TRANSACTION_SIZE) from default 0x0 each to
 0x3 each, gives a write performance boost of 120 MiB/s to 132 MiB/s from
 lame 36 MiB/s to 45 MiB/s previously.  Read performance is above 200
 MiB/s. [tested on SSD using dd bs=4K/8K/12K/16K/20K/24K/32K: peak-perf
 at 12K]

 dd bs  Before MB/s  After MB/s  Increase
 4k            14.4        16.5       15%
 64k           34.5        74.4      116%
 1M            40.5        93.2      130%

Ref: https://forum.openwrt.org/t/sunxi-sata-write-speed-patch/54555/5
Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
[commit subject & description tweaks]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoath79: add support for TP-Link TL-WR940N v6
Adrian Schmutzler [Mon, 5 Aug 2019 15:51:16 +0000 (17:51 +0200)]
ath79: add support for TP-Link TL-WR940N v6

The TL-WR940N v6 is similar to v3/v4, it just has different
LEDs and MAC address assignment.

Specification:
- 750 MHz CPU
- 32 MB of RAM
- 4 MB of FLASH
- 2.4 GHz WiFi
- 4x 10/100 Mbps Ethernet

The use of LEDs is based on ar71xx, so blue LED is used for WAN
and orange LED for diag (boot/failsafe/etc.).

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.0.66
2. Download *-factory.bin image and rename it to
   wr940nv6_tp_recovery.bin
3. Start a tftp server with the image file in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Thanks to Manuel Kock for reviewing and testing this patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Manuel Kock <github.web@manu.li>
4 years agoath79: enable forceless sysupgrade from ar71xx on fritz300e
Adrian Schmutzler [Thu, 13 Feb 2020 13:46:52 +0000 (14:46 +0100)]
ath79: enable forceless sysupgrade from ar71xx on fritz300e

This adds the ar71xx board name to the SUPPORTED_DEVICES on ath79,
so forceless sysupgrade on this device becomes possible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agokernel: swconfig: make compatible with kernel 5.2
Mathias Kresin [Thu, 18 Jul 2019 08:29:08 +0000 (10:29 +0200)]
kernel: swconfig: make compatible with kernel 5.2

Since kernel 5.2 within netlink messages the NLA_F_NESTED nested flag is
validated. But swconfig/swlib doesn't set the flag for
SWITCH_ATTR_OP_VALUE_PORTS related netlink messages and assigning ports
to vlans via

  swconfig dev switch0 vlan 1 set ports '0 1 2 3 4 6t'

Errors put with "Failed to set attribute: Invalid input data or
parameter".

Relax the validation rules and use the deprecated functions, to use the
same level of validation as it was till kernel 5.1. Depending on who has
swconfig related netlink messages implemented, there might be more
broken tools out there and we should keep backward compatibility if
possible.

Signed-off-by: Mathias Kresin <dev@kresin.me>
Tested-by: Rafał Miłecki <rafal@milecki.pl>
4 years agouhttpd: update to latest Git HEAD
Jo-Philipp Wich [Wed, 12 Feb 2020 17:00:42 +0000 (18:00 +0100)]
uhttpd: update to latest Git HEAD

2ee323c file: poke ustream after starting deferred program

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agoprocd: seccomp: fix resource leak
Kevin Darbyshire-Bryant [Tue, 11 Feb 2020 09:16:09 +0000 (09:16 +0000)]
procd: seccomp: fix resource leak

Bump to latest commit:

c30b23e seccomp: fix resource leak

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agokernel: rewrite run_parsers_by_type() to use add_mtd_partitions()
Rafał Miłecki [Thu, 6 Feb 2020 12:57:11 +0000 (13:57 +0100)]
kernel: rewrite run_parsers_by_type() to use add_mtd_partitions()

Make run_parsers_by_type() more similar to the parse_mtd_partitions():
1. Use struct mtd_partitions
2. Use add_mtd_partitions()

This change simplifies run_parsers_by_type() by:
1. Dropping loop
2. Dropping code getting partition properties (name, offset, size)

Moreover this change allows passing more partitions details (e.g.
mask_flags).

One noticeable change introduced by this patch is adding parsed
partitions as children. This results in printing their *relative*
offsets which unifies this code with parse_mtd_partitions() behaviour.

Before:
[    1.785448] 0x00000018f800-0x000000fb0000 : "rootfs"
[    1.791642] mtd: device 4 (rootfs) set to be root filesystem
[    1.797537] 1 squashfs-split partitions found on MTD device rootfs
[    1.804009] 0x0000004e0000-0x000000fb0000 : "rootfs_data"

After:
[    1.785376] 0x00000018f800-0x000000fb0000 : "rootfs"
[    1.791601] mtd: device 4 (rootfs) set to be root filesystem
[    1.797491] 1 squashfs-split partitions found on MTD device rootfs
[    1.803936] Creating 1 MTD partitions on "rootfs":
[    1.808910] 0x000000350800-0x000000e20800 : "rootfs_data"

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agoramips: append tail to WF2881 initramfs image
Sungbo Eo [Fri, 7 Feb 2020 11:26:05 +0000 (20:26 +0900)]
ramips: append tail to WF2881 initramfs image

Stock firmware has a vendor-defined tail at the end of uImage for image
validation. This patch enables OpenWrt installation from stock firmware
without having to access the UART console.

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agoath79: add support for TP-Link TL-WA830RE v1
Christian Buschau [Wed, 5 Feb 2020 21:05:39 +0000 (22:05 +0100)]
ath79: add support for TP-Link TL-WA830RE v1

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

Specifications:
- SOC: Atheros AR7240
- CPU: 400MHz
- Flash: 4 MiB (Spansion S25FL032P)
- RAM: 32 MiB (Zentel A3S56D40FTP-G5)
- WLAN: Atheros AR9280 bgn 2x2
- Ethernet: 1 port (100M)

Flash instructions:
- install from u-boot with tftp (requires serial access)
  > setenv ipaddr a.b.c.d
  > setenv serverip e.f.g.h
  > tftpboot 0x80000000 \
      openwrt-ath79-tiny-tplink_tl-wa830re-v1-squashfs-factory.bin
  > erase 0x9f020000 +0x3c0000
  > cp.b 0x80000000 0x9f020000 0x3c0000
  > bootm 0x9f020000
- flash factory image from OEM WebUI
- sysupgrade from ar71xx image

The device seems to be a clone of the following devices not yet
added to ath79:
- tl-wa701nd-v1
- tl-wa730re-v1
- tl-wa801nd-v1
- tl-wa901nd-v1

Signed-off-by: Christian Buschau <christian.buschau@mailbox.org>
[make use of ar7240_tplink.dtsi, add note about clones]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: reorganize DTSI for ar7240 TP-Link devices
Adrian Schmutzler [Tue, 11 Feb 2020 00:31:05 +0000 (01:31 +0100)]
ath79: reorganize DTSI for ar7240 TP-Link devices

The current set of TP-Link devices with ar7240 SoC all share
the same DTSI file. As the latter is very similar to the
definition required for the to-be-supported TP-Link TL-WA devices
with ar7240, this patch splits the definitions into a shared part
for all TP-Link devices (ar7240_tplink.dtsi) and a file containing
the specific setup for the present TL-WR devices
(ar7240_tplink_tl-wr.dtsi), equivalent to the former
ar7240_tplink_tl-wr74xn-v1.dtsi.

While at it, remove unused firmware partition label and rename
pinmux_switch_led_pins.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: restore pin state on probe for ar934x-spi
Chuanhong Guo [Sun, 9 Feb 2020 15:05:04 +0000 (23:05 +0800)]
ath79: restore pin state on probe for ar934x-spi

If bootloader doesn't terminate its last spi operation properly
before starting kernel, our first transfer in kernel becomes a
continuous transfer to that request instead of a new one.
Fix this flaw by restoring IOC register, which restored all pin
state to default.

Fixes: ebf0d8dade ("ath79: add new ar934x spi driver")
Reported-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agouci: fix PKG_SOURCE_VERSION value
Hans Dedecker [Sun, 9 Feb 2020 20:47:21 +0000 (21:47 +0100)]
uci: fix PKG_SOURCE_VERSION value

Fixes PKG_SOURCE_VERSION value which was wrongly set in commit f6e07c8284

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agowireguard-tools: bump to 1.0.20200206
Jason A. Donenfeld [Fri, 7 Feb 2020 12:27:05 +0000 (13:27 +0100)]
wireguard-tools: bump to 1.0.20200206

* wg-quick: android: split uids into multiple commands

Newer android's ndc implementations have limits on uid size, so we have to
break these into several lists.

* man: document dynamic debug trick for Linux

This comes up occasionally, so it may be useful to mention its
possibility in the man page. At least the Arch Linux and Ubuntu kernels
support dynamic debugging, so this advice will at least help somebody. So that
you don't have to go digging into the commit, this adds this helpful tidbit
to the man page for getting debug logs on Linux:

 # modprobe wireguard && echo module wireguard +p > /sys/kernel/debug/dynamic_debug/control

* extract-{handshakes,keys}: rework for upstream kernel

These tools will now use the source code from the running kernel instead of
from the old monolithic repo. Essential for the functioning of Wireshark.

* netlink: remove libmnl requirement

We no longer require libmnl. It turns out that inlining the small subset of
libmnl that we actually use results in a smaller binary than the overhead of
linking to the external library. And we intend to gradually morph this code
into something domain specific as a libwg emerges. Performance has also
increased, thanks to the inliner. On all platforms, wg(8) only needs a normal
libc. Compile time on my system is still less than one second. So all in all
we have: smaller binary, zero dependencies, faster performance.

Packagers should no longer have their wireguard-tools package depend on
libmnl.

* embeddable-wg-library: use newer string_list
* netlink: don't pretend that sysconf isn't a function

Small cleanups.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years agoprocd: update to latest git HEAD
Hans Dedecker [Sun, 9 Feb 2020 18:21:11 +0000 (19:21 +0100)]
procd: update to latest git HEAD

Fixes c0c988e179a75d33c82ed0621d954fc0ac2c0c14

bcb8655 instance: add 'requirejail' attribute

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agobrcm63xx: apply updated compatibles for selecting board_info
Adrian Schmutzler [Sat, 8 Feb 2020 18:30:39 +0000 (19:30 +0100)]
brcm63xx: apply updated compatibles for selecting board_info

When changing compatibles in e4ba8c82947e ("brcm63xx: use more systematic
names for image and DTS files"), I forgot to update them in kernel
patches as well. So, do it now.

Fixes: e4ba8c82947e ("brcm63xx: use more systematic names for image and DTS files")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobrcm63xx: be more specific about SOC names
Adrian Schmutzler [Sun, 5 Jan 2020 12:14:43 +0000 (13:14 +0100)]
brcm63xx: be more specific about SOC names

This uses the specific SOC names for several devices where the
Chip ID was used incorrectly before.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobrcm63xx: align DTS model with Makefile and compatible
Adrian Schmutzler [Mon, 30 Dec 2019 22:12:53 +0000 (23:12 +0100)]
brcm63xx: align DTS model with Makefile and compatible

Since the model string in DTS is not required to derive board name
anymore, we can now align it with the model name in Makefile and
the compatible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobrcm63xx: use compatible instead of manually setting board name
Adrian Schmutzler [Mon, 30 Dec 2019 20:58:34 +0000 (21:58 +0100)]
brcm63xx: use compatible instead of manually setting board name

This patch removes the translation of device model name into a
board name in lib/brcm63xx.sh. The latter has been actually totally
useless as we have the compatible which can be used instead of
the board name (and actually is at other targets like ath79 or ramips).

The change requires updating the base-files with the new
identifiers based on compatible.

With all "board names" replaced by the compatible, we do not need
the old scripts to detect board name anymore and can also remove
the obsolete treatment of "legacy" devices without DTS, as there
are none of those left. So, this patch removes the target-specific
board detection and uses the standard procedure in
package/base-files/files/lib/preinit/02_sysinfo

This also fixes several cases where the board name was not set or
evaluated correctly:
- asmax,ar1004g in 02_network
- telsey,magic in 09_fix_crc/02_network
- brcm,bcm96338gw in 02_network
- brcm,bcm96338w in 02_network
- brcm,bcm96348gw in 02_network
- dynalink,rta1025w in 02_network
- huawei,echolife-hg520v in 02_network
- several cases in diag.sh

The following orphaned identifiers are removed from board.d files:
- dmv-s0

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobrcm63xx: remove unneeded line break for DEVICE_PACKAGES
Adrian Schmutzler [Mon, 30 Dec 2019 19:37:35 +0000 (20:37 +0100)]
brcm63xx: remove unneeded line break for DEVICE_PACKAGES

In brcm63xx image Makefile DEVICE_PACKAGE definitions are split
into multiple lines with no apparent need.

Merge them into one line to increase readability and maintainability.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobrcm63xx: use more systematic names for image and DTS files
Adrian Schmutzler [Sun, 29 Dec 2019 00:55:54 +0000 (01:55 +0100)]
brcm63xx: use more systematic names for image and DTS files

This changes brcm63xx target to achieve consistency between image
names, device nodes names, compatible, DTS name and device name
as much as possible. As with other targets, having consistent
names is supposed to make life easier for developers and reduces
the number of "variables" in the system. In particular, applying
the DTS scheme will make it easier to find the correct file and
architecture.

DTS files are named based on the increasingly common
soc-vendor-model scheme, using hyphens for separation as this seems
to be the kernel way. Since the compatible is not used at the
moment, I took the chance to also align them with this patch.

For the SOC, the already existing CFE_CHIP_ID can be exploiting
for all but two devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agokernel: move b43 install function to broadcom.mk
Sungbo Eo [Sat, 8 Feb 2020 06:53:45 +0000 (15:53 +0900)]
kernel: move b43 install function to broadcom.mk

Most of the broadcom packaging codes were moved to broadcom.mk in commit
7f984dab1c52 ("mac80211: move broadcom packaging code to broadcom.mk"),
but b43/install still remained. Move it now.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agokernel: fix typos in KernelPackage description
Sungbo Eo [Sat, 8 Feb 2020 00:50:41 +0000 (09:50 +0900)]
kernel: fix typos in KernelPackage description

Fixes: ed2839ac4190 ("kernel/modules: add kmod-pmbus-zl6100 module")
Fixes: bbcb9de93547 ("Add package for gpio rotary encoder")
Fixes: 76854589829a ("package/kernel: package kmod-input-matrixkmap")
Fixes: 8bfef353850a ("kernel: rename kmod-switch-rtl8366_smi to
       kmod-switch-rtl8366-smi to avoid underscores in package names")
Fixes: f03bf608b151 ("kernel: Add dummy sound driver")
Fixes: dda5d9b78643 ("ramips: rename pwm kernel module")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agohostapd: remove erroneous $(space) redefinition
Jo-Philipp Wich [Sat, 8 Feb 2020 10:34:41 +0000 (11:34 +0100)]
hostapd: remove erroneous $(space) redefinition

The $(space) definition in the hostapd Makefile ceased to work with
GNU Make 4.3 and later, leading to syntax errors in the generated
Kconfig files.

Drop the superfluous redefinition and reuse the working $(space)
declaration from rules.mk to fix this issue.

Fixes: GH#2713
Ref: https://github.com/openwrt/openwrt/pull/2713#issuecomment-583722469
Reported-by: Karel Kočí <cynerd@email.cz>
Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
Tested-by: Shaleen Jain <shaleen@jain.sh>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agoramips: fix device name of netis WF-2881 to WF2881
Sungbo Eo [Tue, 8 Oct 2019 13:21:13 +0000 (22:21 +0900)]
ramips: fix device name of netis WF-2881 to WF2881

The correct model name of WF-2881 is WF2881 without hyphen. The former used
boardnames are not added to SUPPORTED_DEVICES, to make it explicit that the
sysupgrade-tar image, which is newly added in the previous commit, should
not be used to upgrade from older version.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[adjust commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: use nand_do_upgrade for netis WF-2881
Sungbo Eo [Wed, 2 Oct 2019 13:12:28 +0000 (22:12 +0900)]
ramips: use nand_do_upgrade for netis WF-2881

WF-2881 sysupgrade image uses UBI rootfs, but still relies on
default_do_upgrade. Because of this, config backup is not restored after
sysupgrade. It can be fixed by switching to nand_do_upgrade and
sysupgrade-tar image. default_do_upgrade does not handle sysupgrade-tar
properly, so one should use factory image to upgrade from older version.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agoath79: add LED trigger for TL-WR902AC v1 WAN LED
Lech Perczak [Thu, 30 Jan 2020 23:47:16 +0000 (00:47 +0100)]
ath79: add LED trigger for TL-WR902AC v1 WAN LED

Inspired by commit c48b571ad708, add an LED trigger for the WAN LED on top of
the TP-Link TL-WR902AC v1. Currently, only the LED on the port itself shows the
link state, while the LED on top of the device stays dark.

The WAN port of the device is a hybrid LAN/WAN one, hence why the LED at the
port was labeled LAN.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 years agoath79: add support for Atheros AR934x HS UART
Daniel Golle [Sun, 2 Feb 2020 16:02:11 +0000 (18:02 +0200)]
ath79: add support for Atheros AR934x HS UART

AR934x chips also got the 'old' qca,ar9330-uart in addition to the
'new' ns16550a compatible one. Add support for UART1 clock selector as
well as device-tree bindings in ar934x.dtsi to make use of that uart.

Reported-by: Piotr Dymacz <pepe2k@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoath79: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE
Daniel Golle [Thu, 6 Feb 2020 18:02:25 +0000 (20:02 +0200)]
ath79: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE

On AR934x this UART is usually not initialized by the bootloader
as it is only used as a secondary serial port while the primary
UART is a newly introduced NS16550-compatible.
In order to make use of the ar933x-uart on AR934x without RTS/CTS
hardware flow control, one needs to set the
UART_CS_{RX,TX}_READY_ORIDE bits as other than on AR933x where this
UART is used as primary/console, the bootloader on AR934x typically
doesn't set those bits.
Setting them explicitely on AR933x does not do any harm, so just set
them unconditionally.

Tested-by: Chuanhong Guo <gch981213@gmail.com
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agobcm53xx: build images for Luxul ABR-4500 and XBR-4500 routers
Dan Haab [Wed, 5 Feb 2020 17:37:44 +0000 (10:37 -0700)]
bcm53xx: build images for Luxul ABR-4500 and XBR-4500 routers

Luxul ABR-4500 and XBR-4500 devices are wired routers with 5 Ethernet
ports and 1 USB 3.0 port. Flashing requires using Luxul firmware 6.4.0
or newer and uploading firmware using "Firmware Update" web UI page.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
4 years agofirmware-utils: add lxlfw tool for generating Luxul firmwares
Dan Haab [Wed, 5 Feb 2020 17:37:43 +0000 (10:37 -0700)]
firmware-utils: add lxlfw tool for generating Luxul firmwares

It's a simple tool prepending image with a Luxul header.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
4 years agoath79: ag71xx: use netif_receive_skb_list on 4.19
Chuanhong Guo [Tue, 7 Jan 2020 00:12:03 +0000 (16:12 -0800)]
ath79: ag71xx: use netif_receive_skb_list on 4.19

This new function make batch processing of network packets possible,
which slightly improves performance.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Tested-by: Rosen Penev <rosenp@gmail.com>
4 years agokernel: remove duplicate flash chip definition
Daniel Golle [Wed, 5 Feb 2020 15:43:03 +0000 (17:43 +0200)]
kernel: remove duplicate flash chip definition

XTX XT25F128A shares it's chip ID with XM25QH128A which got identical
features. Hence there it makes no sense to add it to the driver.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoath79: use ar934x-spi for ar933x as well
Chuanhong Guo [Thu, 6 Feb 2020 14:30:14 +0000 (22:30 +0800)]
ath79: use ar934x-spi for ar933x as well

ar933x appears to have the same spi controller as ar934x but it's
not mentioned in datasheet at all. Use new spi driver instead to
gain more flash operating performance.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agoath79: add new ar934x spi driver
Chuanhong Guo [Wed, 5 Feb 2020 12:25:45 +0000 (20:25 +0800)]
ath79: add new ar934x spi driver

A new shift mode was introduced since ar934x which has a way better
performance than current bitbang driver and can handle higher spi
clock properly. This commit adds a new driver to make use of this
new feature.
This new driver has chipselect properly configured and we don't need
cs-gpios hack in dts anymore. Remove them.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agomac80211: brcm: backport remaining 5.6 kernel patches
Rafał Miłecki [Thu, 6 Feb 2020 10:36:15 +0000 (11:36 +0100)]
mac80211: brcm: backport remaining 5.6 kernel patches

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agowireguard: bump to 0.0.20200205
Jason A. Donenfeld [Wed, 5 Feb 2020 13:46:46 +0000 (14:46 +0100)]
wireguard: bump to 0.0.20200205

* compat: support building for RHEL-8.2
* compat: remove RHEL-7.6 workaround

Bleeding edge RHEL users should be content now (which includes the actual
RedHat employees I've been talking to about getting this into the RHEL kernel
itself). Also, we remove old hacks for versions we no longer support anyway.

* allowedips: remove previously added list item when OOM fail
* noise: reject peers with low order public keys

With this now being upstream, we benefit from increased fuzzing coverage of
the code, uncovering these two bugs.

* netns: ensure non-addition of peers with failed precomputation
* netns: tie socket waiting to target pid

An added test to our test suite for the above and a small fix for high-load CI
scenarios.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years agoramips: add support for I-O DATA WN-AX1167GR2
INAGAKI Hiroshi [Mon, 26 Aug 2019 11:27:22 +0000 (20:27 +0900)]
ramips: add support for I-O DATA WN-AX1167GR2

I-O DATA WN-AX1167GR2 is a 2.4/5 GHz band 11ac router, based on MediaTek
MT7621A.

Specification:

- SoC : MediaTek MT7621A
- RAM : DDR3 128 MiB
- Flash : NAND 128 MiB
- WLAN : MediaTek MT7615D (2.4/5 GHz, 2T2R)
- Ethernet : 5x 10/100/1000 Mbps
  - Switch : MediaTek MT7621A (MT7530)
- LEDs/Input : 2x/3x (2x buttons, 1x slide-switch)
- UART : through-hole on PCB
  - J5: Vcc, TX, RX, NC, GND
  - 57600 bps

Flash instruction using initramfs image:

1. Boot WN-AX1167GR2 normally
2. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
3. Select the OpenWrt initramfs image and click update ("更新")
button to perform firmware update
4. On the initramfs image, perform sysupgrade with squashfs-sysupgrade
image
5. Wait ~120 seconds to complete flashing

Notes:

- configuration in DeviceTree of DBDC (Dual-Band-Dual-Concurrent) mode
for MT7615D chip is not supported in mt76 driver
- last 0x80000 (512 KiB) in NAND flash is not used on stock firmware
- stock firmware requires "customized uImage header" by MSTC
(MitraStar Technology Corp.), but U-Boot doesn't
  - uImage magic (0x0 - 0x3) : 0x434F4D42 (COMB)
  - header crc32 (0x4 - 0x7) : with data length and data crc32
  - image name (0x20 - 0x37) : model ID and firmware versions
  - data length (0x38 - 0x3b): kernel + rootfs
  - data crc32 (0x3c - 0x3f) : kernel + rootfs

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
4 years agoramips: add support for I-O DATA WN-DX1167R
INAGAKI Hiroshi [Tue, 9 Apr 2019 05:48:31 +0000 (14:48 +0900)]
ramips: add support for I-O DATA WN-DX1167R

I-O DATA WN-DX1167R is a 2.4/5 GHz band 11ac rotuer, based on MediaTek
MT7621A.

Specification:

- SoC : MediaTek MT7621A
- RAM : DDR3 128 MiB
- Flash : NAND 128 MiB
- WLAN : MediaTek MT7615D (2.4/5 GHz, 2T2R)
- Ethernet : 5x 10/100/1000 Mbps
  - Switch : MediaTek MT7621A (MT7530)
- LEDs/Input : 2x/3x (2x buttons, 1x slide-switch)
- UART : through-hole on PCB
  - J5: Vcc, TX, RX, NC, GND
  - 57600 bps

Flash instruction using initramfs image:

1. Boot WN-DX1167R normally
2. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
3. Select the OpenWrt initramfs image and click update ("更新")
button to perform firmware update
4. On the initramfs image, perform sysupgrade with squashfs-sysupgrade
image
5. Wait ~120 seconds to complete flashing

Notes:

- configuration in DeviceTree of DBDC (Dual-Band-Dual-Concurrent) mode
for MT7615D chip is not supported in mt76 driver
- last 0x80000 (512 KiB) in NAND flash is not used on stock firmware
- stock firmware requires "customized uImage header" by MSTC
(MitraStar Technology Corp.), but U-Boot doesn't
  - uImage magic (0x0 - 0x3) : 0x434F4D43 (COMC)
  - header crc32 (0x4 - 0x7) : with data length and data crc32
  - image name (0x20 - 0x37) : model ID and firmware versions
  - data length (0x38 - 0x3b): kernel + rootfs
  - data crc32 (0x3c - 0x3f) : kernel + rootfs

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
4 years agoramips: extend and rename wr1201-factory-header
INAGAKI Hiroshi [Tue, 24 Sep 2019 18:02:04 +0000 (03:02 +0900)]
ramips: extend and rename wr1201-factory-header

This commit adds the ability to set custom uImage magic to
Build/wr1201-factory-header and renames it to
"Build/custom-initramfs-uimage".

Custom uImage header in initramfs image is required on following
devices:

- I-O DATA WN-AX1167GR2
- I-O DATA WN-AX2033GR
- I-O DATA WN-AX2033GR2
- I-O DATA WN-DX1167R

While at it, fix typo in comment.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
[shorten commit title, minor commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoRevert "iwinfo: update to latest Git HEAD"
Jo-Philipp Wich [Wed, 5 Feb 2020 14:31:34 +0000 (15:31 +0100)]
Revert "iwinfo: update to latest Git HEAD"

This reverts commit 96424c143dd818b391d9b8da18249eca1d2e6c83.

The commit changed libiwinfo's internal ABI which breaks a number of
downstream projects, including LuCI and rpcd-mod-iwinfo.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agoprocd: support 'requirejail' attribute
Kevin Darbyshire-Bryant [Thu, 30 Jan 2020 18:32:00 +0000 (18:32 +0000)]
procd: support 'requirejail' attribute

Bump procd package to reduce log spam related to missing jail binaries
in a non-jail capable system.

bcb8655 instance: add 'requirejail' attribute

An additional jail attribute 'requirejail' can now be used to indicate
mandatory use of a jailed environment and hence prevent process startup
in the event that the jail subsystem is unavailable.

Procd will now only log errors if jail is unavailable and 1) is a mandatory
requirement or 2) a procd debug level of at least 2 is in use.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agoiwinfo: update to latest Git HEAD
David Bauer [Tue, 4 Feb 2020 13:53:52 +0000 (14:53 +0100)]
iwinfo: update to latest Git HEAD

eba5a20 iwinfo: add device id for BCM43602
a6914dc iwinfo: add BSS load element to scan result
bb21698 iwinfo: add device id for Atheros AR9287
7483398 iwinfo: add device id for MediaTek MT7615E

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agobrcm2708: update to latest patches from RPi foundation
Álvaro Fernández Rojas [Tue, 4 Feb 2020 18:02:53 +0000 (19:02 +0100)]
brcm2708: update to latest patches from RPi foundation

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years agobrcm2708-gpu-fw: update to latest firmware
Álvaro Fernández Rojas [Tue, 4 Feb 2020 18:02:20 +0000 (19:02 +0100)]
brcm2708-gpu-fw: update to latest firmware

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years agokernel: add support for GD25D05 SPI NOR
Koen Vandeputte [Mon, 6 Jan 2020 13:10:42 +0000 (14:10 +0100)]
kernel: add support for GD25D05 SPI NOR

This chip is used on newer RB912UAG-5HPnD r2 boards:

Before:

[    0.642553] m25p80 spi0.0: unrecognized JEDEC id bytes: c8, 40, 10
[    0.649381] NAND flash driver for the RouterBOARD 91x series

After:

[    0.641714] m25p80 spi0.0: found gd25d05, expected m25p80
[    0.649916] m25p80 spi0.0: gd25d05 (64 Kbytes)
[    0.655122] Creating 4 MTD partitions on "spi0.0":
[    0.660164] 0x000000000000-0x00000000c000 : "routerboot"
[    0.667782] 0x00000000c000-0x00000000d000 : "hard_config"
[    0.675073] 0x00000000d000-0x00000000e000 : "bios"
[    0.682613] 0x00000000e000-0x00000000f000 : "soft_config"
[    0.690304] NAND flash driver for the RouterBOARD 91x series

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: bump 4.19 to 4.19.101
Koen Vandeputte [Tue, 4 Feb 2020 12:17:37 +0000 (13:17 +0100)]
kernel: bump 4.19 to 4.19.101

Refreshed all patches.

Fixes:
- CVE-2019-14896
- CVE-2019-14897

Remove upstreamed:
- 023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch
- 950-0202-staging-bcm2835-camera-fix-module-autoloading.patch
- 001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch

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.169
Koen Vandeputte [Tue, 4 Feb 2020 11:04:59 +0000 (12:04 +0100)]
kernel: bump 4.14 to 4.14.169

Refreshed all patches.

Fixes:
- CVE-2019-14896
- CVE-2019-14897

Remove upstreamed:
- 023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch
- 001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agoramips: remove unnecessary execute permission bit
Sungbo Eo [Tue, 4 Feb 2020 16:00:15 +0000 (01:00 +0900)]
ramips: remove unnecessary execute permission bit

dts file does not need to be executable. 644 is enough.

Fixes: f098c612b6db ("ramips: create shared DTSI for Netgear EX2700 and WN3000RP v3")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agomediatek: remove unnecessary execute permission bit
Sungbo Eo [Tue, 4 Feb 2020 15:54:45 +0000 (00:54 +0900)]
mediatek: remove unnecessary execute permission bit

kernel config and patch files do not need to be executable. 644 is enough.

Fixes: 01c8f2e97cc6 ("mediatek: bump to v4.19")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agouboot-envtools: ath79: add Netgear WNDR3700v2
Michal Cieslakiewicz [Mon, 20 Jan 2020 20:20:09 +0000 (21:20 +0100)]
uboot-envtools: ath79: add Netgear WNDR3700v2

Add Netgear WNDR3700v2 to the list of supported boards.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
[rebase, adjusted commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: WNDR3700 v1/v2: make u-boot env partition writable
Michal Cieslakiewicz [Mon, 3 Feb 2020 18:54:31 +0000 (19:54 +0100)]
ath79: WNDR3700 v1/v2: make u-boot env partition writable

Remove read-only flag from U-boot environment partition for Netgear
WNDR3700 v1 and v2 so u-boot-envtools can modify data there.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years agomediatek: remove KERNEL_PATCHVER overwrite for mt7629
Adrian Schmutzler [Tue, 4 Feb 2020 11:15:45 +0000 (12:15 +0100)]
mediatek: remove KERNEL_PATCHVER overwrite for mt7629

Since whole target has been bumped to kernel 4.19 in 01c8f2e97cc6
("mediatek: bump to v4.19") we do not need the overwrite in mt7629
subtarget anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agomediatek: bump to v4.19
John Crispin [Tue, 4 Feb 2020 06:46:52 +0000 (07:46 +0100)]
mediatek: bump to v4.19

Signed-off-by: John Crispin <john@phrozen.org>
4 years agobcm4xxx: fix iwinfo behaviour
John Crispin [Tue, 28 Jan 2020 10:28:03 +0000 (11:28 +0100)]
bcm4xxx: fix iwinfo behaviour

Signed-off-by: John Crispin <john@phrozen.org>
4 years agoath79: add support for COMFAST CF-E560AC
August Huber [Sun, 26 Jan 2020 16:55:11 +0000 (11:55 -0500)]
ath79: add support for COMFAST CF-E560AC

This commit adds support for the COMFAST CF-E560AC, an ap143 based
in-wall access point.

Specifications:
 - SoC: Qualcomm Atheros QCA9531
 - RAM: 128 MB DDR2 (Winbond W971GG6SB-25)
 - Storage: 16 MB NOR (Winbond 25Q128JVSO)
 - WAN: 1x 10/100 PoE ethernet (48v)
 - LAN: 4x 10/100 ethernet
 - WLAN1: QCA9531 - 802.11b/g/n - 2x SKY85303-21 FEM
 - WLAN2: QCA9886 - 802.11ac/n/a - 2x SKY85735-11 FEM
 - USB: one external USB2.0 port
 - UART: 3.3v, 2.54mm headers already populated on board
 - LED: 7x external
 - Button: 1x external
 - Boot: U-Boot 1.1.4 (pepe2k/u-boot_mod)

MAC addressing:

- stock
  LAN    *:40 (label)
  WAN    *:41
  5G     *:42
  2.4G   *:4a

- flash (art partition)
  0x0    *:40 (label)
  0x6    *:42
  0x1002 *:41
  0x5006 *:43

This device contains valid MAC addresses in art 0x0, 0x6, 0x1002 and
0x5006, however the vendor firmware only reads from art:0x0 for the LAN
interface and then increments in 02_network. They also jump 8 addresses
for the second wifi interface (2.4 GHz). This behavior has been duplicated
in the DTS and ath10k hotplug to align addresses with the vendor firmware
v2.6.0.

Recovery instructions:

This device contains built-in u-boot tftp recovery.

1. Configure PC with static IP 192.168.1.10/24 and tftp server.
2. Place desired image at /firmware_auto.bin at tftp root.
3. Connect device to PC, and power on.
4. Device will fetch flash from tftp, flash and reboot into new image.

Signed-off-by: August Huber <auh@google.com>
[move jtag_disable_pins, remove unnecessary statuses in DTS, remove
duplicate entry in 11-ath10k-caldata, remove hub_port0 label in DTS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: WNDR3700 v2: add dash before version in device name
Michal Cieslakiewicz [Mon, 20 Jan 2020 20:19:29 +0000 (21:19 +0100)]
ath79: WNDR3700 v2: add dash before version in device name

Adapt Netgear WNDR3700v2 device identification string to ath79 naming
scheme by changing from 'wndr3700v2' to 'wndr3700-v2' (affects config,
makefile, init scripts and device tree definition).

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