openwrt/staging/stintel.git
4 years agoipq806x: fix missing compatible and rename
Christian Lamparter [Mon, 16 Dec 2019 19:29:17 +0000 (20:29 +0100)]
ipq806x: fix missing compatible and rename

- ipq8064 compatible was missing from nbg6817.
- Rename ap148 with a better descriptive name.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[proper authorship of the patch]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoipq806x: convert ok to okay in dts
Christian Lamparter [Wed, 4 Dec 2019 00:20:45 +0000 (01:20 +0100)]
ipq806x: convert ok to okay in dts

DT spec require okay instead of ok in dts files

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years agoipq806x: refresh 4.19 patches
Christian Lamparter [Thu, 28 Nov 2019 21:28:48 +0000 (22:28 +0100)]
ipq806x: refresh 4.19 patches

Reworked:

 - 0034 patchset update

Added:

 - 080 Add support for pinctrl-msm framework

Removed:

 - 0074-ipq806x-usb-Control-USB-master-reset.patch
   (we now have a dedicated driver for qcom usb)

 - 0047-mtd-nand-Create-a-BBT-flag-to-access-bad-block-marke
   (merged upstream)

 - 310-msm-adhoc-bus-support
   (it looks like it was never actually used in any dts)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[commit subject and description facelift, SoB fix]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agokernel: generic: add missing config symbol to 4.19
Ansuel Smith [Thu, 28 Nov 2019 20:58:19 +0000 (21:58 +0100)]
kernel: generic: add missing config symbol to 4.19

PCI_V3_SEMI config symbol was found missing in generic kernel config
after ipq806x config refresh to 4.19.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[commit subject and description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoipq806x: update 4.19 kernel config
Ansuel Smith [Sun, 15 Dec 2019 13:06:02 +0000 (14:06 +0100)]
ipq806x: update 4.19 kernel config

These changes are needed in order to migrate old kernel 4.14 config to
the upcoming kernel version 4.19.  Also add missing configuration
options that comes up with this SoC.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[line wrap long commit description, add 4.19 to subject, soc->SoC]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoipq806x: copy files from 4.14 to 4.19
Ansuel Smith [Thu, 28 Nov 2019 20:41:20 +0000 (21:41 +0100)]
ipq806x: copy files from 4.14 to 4.19

This copies files from files-4.14 to files-4.19 directory in order to
get clear diffs for any changes done from now on.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[added missing commit description, refreshed ea8500 and wpq864 DTS]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoath79: restore gpio-export on TL-WDR3600/4300
Lech Perczak [Sun, 8 Dec 2019 14:23:54 +0000 (15:23 +0100)]
ath79: restore gpio-export on TL-WDR3600/4300

This partially reverts commit 32144ba275d163ce6e7d93546ab4414f03f508fb.

This commit replaced gpio-exports in favor of gpio-hogs for enabling USB
power at boot, but this rids the user of control of the USB port power
present on this device for a long time. It was agreed on a mailing list
[1] that this is not the way to go, and this patch breaks a very common
use-case of WWAN modem reset by power cycle, used on a lot USB equipped
routers, hence revert this change until a better solution can be found.

[1] http://lists.infradead.org/pipermail/openwrt-devel/2019-November/020151.html

Tested-by: Sungbo Eo <mans0n@gorani.run>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
[adjusted commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for TP-Link TL-WR902AC v1
Lech Perczak [Sun, 1 Dec 2019 18:31:32 +0000 (19:31 +0100)]
ath79: add support for TP-Link TL-WR902AC v1

TP-Link TL-WR902AC v1 is a pocket-size, dual-band (AC750), successor of
TL-MR3020 (both devices use very similar enclosure, in same size). New
device is based on Qualcomm QCA9531 v2 + QCA9887. FCC ID: TE7WR902AC.

Specification:

- 650/391/216 MHz (CPU/DDR/AHB)
- 1x 10/100 Mbps Ethernet
- 1x USB 2.0 (GPIO-controlled power)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH
- 2T2R 2.4 GHz (QCA9531)
- 1T1R 5 GHz (QCA9887)
- 5x LED (GPIO-controlled), 2x button, 1x 3-pos switch
- UART pads on PCB (TP1 -> TX, TP2 -> RX, TP3 -> GND, TP4 -> 3V3, jumper
  resitors are missing on TX/RX lines)
- 1x micro USB (for power only)

Flash instructions:

Use "factory" image under vendor GUI.

Recovery instructions:

This device contains tftp recovery mode inside U-Boot. You can use it to
flash OpenWrt (use "factory" image) or vendor firmware.

1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "openwrt-ath79-generic-tplink_tl-wr902ac-v1-squashfs-factory.bin"
   to "wr902acv1_un_tp_recovery.bin" and place it in tftp server dir.
3. Connect PC with LAN port, press the reset button, power up the router
   and keep button pressed until WPS LED lights up.
4. Router will download file from server, write it to flash and reboot.

MAC Address summary:
- wlan1 (2.4GHz Wi-Fi): Label MAC
- wlan0 (5GHz Wi-Fi): Offset -1 from label
- eth0 (Wired): Offset +1 from label

Root access over serial line in vendor firmware: root/sohoadmin.

Based on support in ar71xx target by: Piotr Dymacz <pepe2k@gmail.com>

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
[remove size-cells from gpio-export]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: fix portmap for TP-Link Archer C50 v4
Maxim Anisimov [Wed, 18 Dec 2019 07:06:14 +0000 (10:06 +0300)]
ramips: fix portmap for TP-Link Archer C50 v4

According to 02_network portmap is wan=0 lan1=1 lan2=2 lan3=3 lan4=4

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
4 years agomac80211: brcm: add support for BCM4359 SDIO chipset
Rafał Miłecki [Thu, 19 Dec 2019 08:16:59 +0000 (09:16 +0100)]
mac80211: brcm: add support for BCM4359 SDIO chipset

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agomac80211: brcm: backport 5.5 and 5.6 kernel patches
Rafał Miłecki [Thu, 19 Dec 2019 07:40:12 +0000 (08:40 +0100)]
mac80211: brcm: backport 5.5 and 5.6 kernel patches

This update doesn't include:
3b1e0a7bdfee brcmfmac: add support for SAE authentication offload
be898fed355e brcmfmac: send port authorized event for FT-802.1X
due to nl80211 dependencies.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agobrcm2708: switch to cypress-nvram package
Álvaro Fernández Rojas [Wed, 4 Sep 2019 15:22:54 +0000 (17:22 +0200)]
brcm2708: switch to cypress-nvram package

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years agocypress-nvram: add new package
Álvaro Fernández Rojas [Wed, 4 Sep 2019 15:21:26 +0000 (17:21 +0200)]
cypress-nvram: add new package

This package contains nvram files for brcmfmac, a mac80211 driver for FullMAC
Cypress devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years agowireguard: bump to 0.0.20191212
Kevin Darbyshire-Bryant [Tue, 17 Dec 2019 14:10:13 +0000 (14:10 +0000)]
wireguard: bump to 0.0.20191212

1ec6ece version: bump snapshot
e13de91 main: remove unused include <linux/version.h>
72eb17c wg-quick: linux: support older nft(8)
1d8e978 global: fix up spelling
e02713e wg-quick: linux: add support for nft and prefer it
b4e3a83 compat: support building for RHEL-8.1 instead of RHEL-8.0
f29e3ac socket: convert to ipv6_dst_lookup_flow for 5.5

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agobrcmfmac-board-rpi: remove uneeded package
Álvaro Fernández Rojas [Wed, 4 Sep 2019 15:32:08 +0000 (17:32 +0200)]
brcmfmac-board-rpi: remove uneeded package

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years agobrcm2708: switch to cypress-firmware package
Álvaro Fernández Rojas [Wed, 4 Sep 2019 15:22:54 +0000 (17:22 +0200)]
brcm2708: switch to cypress-firmware package

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years agocypress-firmware: add new package
Álvaro Fernández Rojas [Wed, 4 Sep 2019 15:20:36 +0000 (17:20 +0200)]
cypress-firmware: add new package

This package contains firmwares provided by Cypress
See https://community.cypress.com/community/linux

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years agouboot-envtools: check for config prior to append
Imran Khan [Tue, 17 Dec 2019 13:59:28 +0000 (05:59 -0800)]
uboot-envtools: check for config prior to append

In the rare event a pre-populated fw_env.config exists in the rootfs prior
to firstboot, calling fw_setenv after the system has initialised will
annihilate the devices environment due to two identical lines in
fw_env.config.

Check for existence prior to blind appendage.

Signed-off-by: Imran Khan <gururug@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: fixed patch format, improved grep, cosmetics]

4 years agoramips: allow to set switchdev by board in ramips_set_preinit_iface
Adrian Schmutzler [Mon, 16 Dec 2019 17:07:03 +0000 (18:07 +0100)]
ramips: allow to set switchdev by board in ramips_set_preinit_iface

This adds the option to determine switchdev by board when setting
preinit iface for failsafe. The patch reorganizes the code to use
functions for setting correct switchdev based on SOC and board,
which is supposed to improve readability and maintainability.

In this patch, the ramips_switchdev_from_board function is added
without specifying an actual device using it. This is meant to
make the life of device supporters waiting for merge easier, as
there is less to rebase and keep track of.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: add support for ipTIME A104ns
Sungbo Eo [Thu, 26 Sep 2019 15:16:33 +0000 (00:16 +0900)]
ramips: add support for ipTIME A104ns

ipTIME A104ns is a 2.4/5GHz band AC750 router, based on MediaTek MT7620A.

Specifications:
- SoC: MT7620A
- RAM: DDR2 64MB
- Flash: SPI NOR 8MB
- WiFi:
  - 2.4GHz: SoC internal
  - 5GHz: MT7610EN
- Ethernet: 5x 10/100Mbps
  - Switch: SoC internal
- USB: 1x 2.0
- UART:
  - J2: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1

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

Revert to stock firmware:
1.  Perform sysupgrade with stock image.

In contrast to to-be-supported A1004ns, the A104ns has no usable
value in 0x1fc40 (uboot), so wan_mac needs to be calculated.
Also note that GPIOs for the LEDs really are inverted compared to
the A1004ns.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[moved state_default to device DTS, reordered properties in wmac,
added comment about wan_mac and LED GPIOs]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: migrate LED paths of TL-WDR4300 board
Sungbo Eo [Sun, 15 Dec 2019 09:16:55 +0000 (18:16 +0900)]
ath79: migrate LED paths of TL-WDR4300 board

TL-WDR4300 board uses only green LED names in DTSI.
This patch adds migration for them.

The actual LED colors on the devices have been reported to vary
across subrevisions (v1.x). Despite, the USB LEDs on the back might
have different color than the other LEDs on the front.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[extended commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: add label MAC address for Edimax RG21S
Adrian Schmutzler [Mon, 16 Dec 2019 13:01:41 +0000 (14:01 +0100)]
ramips: add label MAC address for Edimax RG21S

The Edimax RG21S has a label which bears two MAC addresses:
2.4 GHz (n) and 5 GHz (n+1)

The complete MAC address setup is as follows:
2.4 GHz  *:83  factory 0x4, u-boot-env wlanaddr
5 GHz    *:84  factory 0x8004
LAN      *:83  u-boot-env ethaddr
WAN      *:85  u-boot-env wanaddr

Since 2.4 GHz is the first address on the label and the same
as used for ethernet, take this one for label MAC address.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: increase SPI frequency for Edimax RG21S
Birger Koblitz [Mon, 16 Dec 2019 12:57:44 +0000 (13:57 +0100)]
ramips: increase SPI frequency for Edimax RG21S

This increases SPI frequency from the relatively low 10 MHz to 40 MHz.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
[added commit title/message, split patch]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: remove unnecessary nodes in DTS for Edimax RG21S
Birger Koblitz [Mon, 16 Dec 2019 12:55:03 +0000 (13:55 +0100)]
ramips: remove unnecessary nodes in DTS for Edimax RG21S

This sdhci and i2c nodes were copy-pasted, but are not needed as
the device does not provide that functionality. Remove them.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
[added commit title/message, split patch]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agorpcd: update to latest Git HEAD
Jo-Philipp Wich [Tue, 17 Dec 2019 07:33:33 +0000 (08:33 +0100)]
rpcd: update to latest Git HEAD

aaa0836 file: extend exec acl checks to commands with arguments

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years agoar71xx: indicate upgrade using system LED
David Bauer [Sat, 14 Dec 2019 18:15:21 +0000 (19:15 +0100)]
ar71xx: indicate upgrade using system LED

This enables the system LED to indicate a running firmware upgrade. This
pattern is used on most platforms provided by the generic base-files
package. ar71xx uses it's own implementation for the system-LED, where
the upgrade case is not yet implemented.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agomac80211: fix txpower when using DFS channels
David Bauer [Sat, 14 Dec 2019 22:38:02 +0000 (23:38 +0100)]
mac80211: fix txpower when using DFS channels

With this patch, txpower for the PHY is applied when configuring the PHY
instead of the VIF. Otherwise, the configured txpower is not applied for
the first initialized VIF when using DFS channels, as it is currently
applied too early when the CAC hasn't finished.

Reported-by: Martin Weinelt <martin@darmstadt.freifunk.net
Signed-off-by: David Bauer <mail@david-bauer.net>
Tested-by: Martin Weinelt <martin@darmstadt.freifunk.net>
4 years agoodhcpd: update to latest git HEAD
Hans Dedecker [Sun, 15 Dec 2019 19:52:31 +0000 (20:52 +0100)]
odhcpd: update to latest git HEAD

d60f0a6 treewide: optimize syslog priority values

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agompc85xx: add support for Enterasys WS-AP3710i
David Bauer [Fri, 13 Dec 2019 20:31:50 +0000 (21:31 +0100)]
mpc85xx: add support for Enterasys WS-AP3710i

Hardware
--------

SoC:   NXP P1020 (2x e500 @ 800MHz)
RAM:   256M DDR3 (Micron)
FLASH: 32M NOR (Spansion S29GL128S)
BTN:   1x Reset
WiFi:  1x Atheros AR9590 2.4 bgn 3x3
       2x Atheros AR9590 5.0 an 3x3
ETH:   1x Gigabit Ethernet (Atheros AR8033)
LED:   System (green/red) - Radio{0,1} (green)
       LAN (connected to PHY)
        - GE blue
        - FE green

Serial is a Cisco-compatible RJ45 next to the ethernet port.
115200-N-8 are the settings for OS and U-Boot.

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

1. Grab the OpenWrt initramfs, rename it to 01C8A8C0.img. Place it in
   the root directory of a TFTP server and serve it at
   192.168.200.200/24.

2. Connect to the serial port and boot the AP. Stop autoboot in U-Boot
   by pressing Enter when prompted. Credentials are identical to the one
   in the APs interface. By default it is admin / new2day.

3. Set the bootcmd so the AP can boot OpenWrt by executing

   $ setenv boot_openwrt "setenv bootargs;
     cp.b 0xee000000 0x1000000 0x1000000; bootm 0x1000000"
   $ setenv bootcmd "run boot_openwrt"
   $ saveenv

   If you plan on going back to the vendor firmware - the bootcmd for it
   is stored in the boot_flash variable.

4. Load the initramfs image to RAM and boot by executing

   $ tftpboot 0x1000000 192.168.200.200:01C8A8C0.img; bootm

5. Make a backup of the "firmware" partition if you ever wish to go back
   to the vendor firmware.

6. Upload the OpenWrt sysupgrade image via SCP to the devices /tmp
   folder.

7. Flash OpenWrt using sysupgrade.

   $ sysupgrade -n /tmp/openwrt-sysupgrade.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agoramips: add support for JCG JHR-AC876M
DENG Qingfang [Fri, 13 Dec 2019 16:24:19 +0000 (00:24 +0800)]
ramips: add support for JCG JHR-AC876M

JCG JHR-AC876M is an AC2600M router

Hardware specs:
  SoC: MT7621AT
  2.4GHz: MT7615N 4x4 @ PCIe0
  5GHz: MT7615N 4x4 @ PCIe1
  Flash: Winbond W25Q128JVSQ 16MiB
  RAM: Nanya NT5CB128M16 256MiB
  USB 2.0 and 3.0 ports
  6 LEDs, 3 of which are connected to SoC GPIO
  Reset and WPS buttons

Flash instructions:
Stock to OpenWrt:
  Upload factory.bin in stock firmware's upgrade page,
  do not preserve settings

OpenWrt to stock:
  Push and hold the reset button for 5s while power cycling to
  enter recovery mode;
  Visit 192.168.1.1 and upload stock firmware

MAC addresses map:
  0x0004  *:1c  wlan2g/wan/label
  0x8004  *:20  wlan5g
  0xe000  *:1b  lan
  0xe006  *:1a  not used in stock fw

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years agoramips: allow JCG_MAXSIZE in kiB in Build/jcg-header
Adrian Schmutzler [Thu, 12 Dec 2019 19:26:06 +0000 (20:26 +0100)]
ramips: allow JCG_MAXSIZE in kiB in Build/jcg-header

This allows JCG_MAXSIZE to be specified in kilobytes. This makes
this value more consistent and easier comparable with other size
variables.

This also changes the only occurence of the variable, for Cudy WR1000.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: add support for ipTIME A6ns-M
Sungbo Eo [Mon, 11 Nov 2019 16:25:31 +0000 (01:25 +0900)]
ramips: add support for ipTIME A6ns-M

ipTIME A6ns-M is a 2.4/5GHz band AC1900 router, based on MediaTek MT7621A.

Specifications:
- SoC: MT7621AT
- RAM: DDR3 128MB
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: MT7615
  - 5GHz: MT7615
- Ethernet: 5x 10/100/1000Mbps
  - Switch: SoC internal
- UART:
  - J4: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1

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

Revert to stock firmware:
1.  Perform sysupgrade with stock image.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years agoramips: DTS style improvements for mt7621_wevo_w2914ns-v2.dtsi
Adrian Schmutzler [Thu, 12 Dec 2019 18:49:55 +0000 (19:49 +0100)]
ramips: DTS style improvements for mt7621_wevo_w2914ns-v2.dtsi

This does several trivial DTS style improvements:

- Move device name compatible to DTS files (and fix compatible in
  11acnas.dts)
- Remove xhci node as status is set to okay in mt7621.dtsi already
- 0x0 instead of 0x0000
- Simplify state_default node definition

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: add support for ZIO FREEZIO
Sungbo Eo [Mon, 11 Nov 2019 16:26:44 +0000 (01:26 +0900)]
ramips: add support for ZIO FREEZIO

ZIO FREEZIO is a 2.4/5GHz band AC1200 router, based on MediaTek MT7621A.

Specifications:
- SoC: MT7621AT
- RAM: DDR3 128MB
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: MT7603EN
  - 5GHz: MT7612EN
- Ethernet: 5x 10/100/1000Mbps
  - Switch: SoC internal
- USB: 1x 3.0
- UART:
  - J4: 3.3V, RX, TX, GND (3.3V is the square pad) / 57600 8N1

Notes:
- FREEZIO has almost the same board as WeVO W2914NS v2.
- Stock firmware is based on OpenWrt BB.

MAC addresses in factory partition:
0x0004: WiFi 2.4GHz (label_mac-8)
0x002e: WAN (label_mac)
0x8004: WiFi 5GHz (label_mac-4)
0xe000: LAN (label_mac+1)

Installation via web interface:
1.  Access web admin page and turn on "OpenWrt UI mode".
2.  Flash sysupgrade image through LuCI, with the "Keep settings" option
    OFF.

Revert to stock firmware:
1.  Perform sysupgrade with stock image.
    Make sure to NOT preserve settings.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rebase, use mt7621_wevo_w2914ns-v2.dtsi]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agosunxi: add support for FriendlyARM Nano PI NEO Air dev board
Roman Bazalevsky [Thu, 5 Dec 2019 14:21:28 +0000 (17:21 +0300)]
sunxi: add support for FriendlyARM Nano PI NEO Air dev board

Hardware:

  Allwinner H3 upto 1.2GHz
  512MB DDR3 RAM
  8GB on-board eMMC - mountable, can be used as boot with custom boot.scr
  microSD-card slot
  WiFi 802.11n (AP6212A) - working
  Bluetooth (AP6212A) - not working for now
  Micro-USB OTG + 2*USB headers
  UART 3.3V - working
  GPIO/I2C/SPI 2.54mm headers

Standard sunxi SD-card installation procedure - copy image to SD card,
insert in into slot and boot. First time you will need UART adapter to
enable on-board wireless (or just build custom image with enabled WiFi).

To boot from eMMC:

  - boot from SD
  - copy SD image to emmc (dd bs=... if=.... of=/dev/mmcblk2)
  - mount eMMC boot partition and replace boot script on it
  - unmount, reboot

To use i2c, spi and more uarts - replace dtb on boot partition with
fixed one (use dtc or fdt-tools).

Signed-off-by: Roman Bazalevsky <rvb@rvb.name>
[rebase onto device name consolidation patches]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agosunxi: construct DTS name from device node name and SOC
Adrian Schmutzler [Thu, 5 Dec 2019 23:47:18 +0000 (00:47 +0100)]
sunxi: construct DTS name from device node name and SOC

The device part in the SUNXI_DTS variable always corresponds to
device node name. This is another redundancy that can be removed
by calculating the DTS name from a newly introduced SUNXI_SOC
variable and the node name.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agosunxi: use vendor_device scheme for device definitions
Adrian Schmutzler [Thu, 5 Dec 2019 23:11:56 +0000 (00:11 +0100)]
sunxi: use vendor_device scheme for device definitions

This changes device definition to resemble the vendor_device scheme
already present for the majority of device compatible strings.

By doing this, we achieve several advantages at once:
- Image names and node names are more consistent with other targets.
- SUPPORTED_DEVICES can be set automatically for all but two cases.
- Image names and node names are in line with DEVICE_TITLEs.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for TP-Link TL-WDR4300 v1 (IL)
Adrian Schmutzler [Mon, 9 Dec 2019 12:53:21 +0000 (13:53 +0100)]
ath79: add support for TP-Link TL-WDR4300 v1 (IL)

The TL-WDR4300 v1 sold in Israel has a different TPLINK_HWID.

Thanks to Josh4300 for testing on device.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: redistribute UBNT variables in Ubiquiti image Makefile
Adrian Schmutzler [Fri, 6 Dec 2019 12:56:51 +0000 (13:56 +0100)]
ath79: redistribute UBNT variables in Ubiquiti image Makefile

The variables UBNT_BOARD and UBNT_VERSION are defined in the parent
Device/ubnt definition and then overwritten for most of the derived
platform definitions (e.g. Device/ubnt-wa).

Since this mixed use of inheritance and overwriting can be misleading,
this moves the variables to the platform-based definitions.

While at it, reorder the definitions to have order consistent, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: add label MAC address for Mikrotik RBM33G
Adrian Schmutzler [Mon, 9 Dec 2019 11:56:12 +0000 (12:56 +0100)]
ramips: add label MAC address for Mikrotik RBM33G

The device label contains:
E01: B8:69:F4:xx:xx:07
E02: B8:69:F4:xx:xx:09

The first value corresponds to the address set in hard_config 0x10.

That one is taken for the label MAC address.

Thanks to Martin Schiller for retrieving the information.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: rt305x: use flash location for wan_mac in 02_network
Adrian Schmutzler [Sun, 8 Dec 2019 15:15:00 +0000 (16:15 +0100)]
ramips: rt305x: use flash location for wan_mac in 02_network

This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.

The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.

This removes the wan_mac setup for the following devices as they
do not set up a MAC address for ethernet in the first place:
- asiarf,awapn2403
- belkin,f7c027
- dlink,dir-615-d
- mofinetwork,mofi3500-3gn
- prolink,pwh2004
- ralink,v22rw-2x2
- unbranded,wr512-3gn-4m
- unbranded,wr512-3gn-8m

While at it, make some DT node labels consistent with the label
property.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: rt288x: use flash location for wan_mac in 02_network
Adrian Schmutzler [Sun, 8 Dec 2019 13:55:49 +0000 (14:55 +0100)]
ramips: rt288x: use flash location for wan_mac in 02_network

This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.

The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.

This removes the wan_mac setup for ralink,v11st-fe as this device
does not set up a MAC address for ethernet in the first place.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: mt76x8: use flash location for wan_mac in 02_network
Adrian Schmutzler [Sun, 8 Dec 2019 13:26:34 +0000 (14:26 +0100)]
ramips: mt76x8: use flash location for wan_mac in 02_network

This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.

The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.

While at it, change the partition label for zyxel,keenetic-extra-ii
to factory to be consistent with node label and all the other devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: mt7621: use flash location for wan_mac in 02_network
Adrian Schmutzler [Sun, 8 Dec 2019 12:42:39 +0000 (13:42 +0100)]
ramips: mt7621: use flash location for wan_mac in 02_network

This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.

The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: mt7620: use flash location for wan_mac in 02_network
Adrian Schmutzler [Sun, 8 Dec 2019 12:20:50 +0000 (13:20 +0100)]
ramips: mt7620: use flash location for wan_mac in 02_network

This uses the flash locations instead of eth0 MAC address to
calculate MAC address increments for WAN.

The change will make the MAC address setup of a particular device
more obvious and removes the dependency of 02_network on the eth0
initialization.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: remove wan_mac setup for evaluation boards
Adrian Schmutzler [Sun, 8 Dec 2019 12:23:56 +0000 (13:23 +0100)]
ramips: remove wan_mac setup for evaluation boards

The evaluation boards do not set up a MAC address for eth0
in the first place, so it does not make sense to calculate a WAN
address from the random MAC used there.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: create common DTSI for TP-Link Archer C20i/C20 v1/C50 v1
Adrian Schmutzler [Sun, 8 Dec 2019 11:51:20 +0000 (12:51 +0100)]
ramips: create common DTSI for TP-Link Archer C20i/C20 v1/C50 v1

The TP-Link Archer C20i/C20 v1/C50 v1 seem to be almost the same,
so creating a common DTSI will reduce duplicate code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: remove unused DTS variable from DEVICE_VARS
Adrian Schmutzler [Sat, 7 Dec 2019 22:37:40 +0000 (23:37 +0100)]
ramips: remove unused DTS variable from DEVICE_VARS

The DTS variable has been removed in 402138d12dca ("ramips: Derive
DTS name from device name in Makefile"), but the DEVICE_VARS entry
has been overlooked.

Remove it now since we are not using this variable.

This must _not_ be backported to 19.07, where the variable is still
in use.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: fix switch port numbering for RT-AC65P/RT-AC85P
Gabor Varga [Mon, 9 Dec 2019 22:03:58 +0000 (23:03 +0100)]
ramips: fix switch port numbering for RT-AC65P/RT-AC85P

The switch LAN port numbers are in reversed order with original config.
With this patch they are fixed.

Port order checked on both devices.

Signed-off-by: Gabor Varga <vargagab@gmail.com>
[merged definitions into appropriate block, extended commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: add label MAC address for TP-Link Archer C20i
Adrian Schmutzler [Sun, 8 Dec 2019 11:28:22 +0000 (12:28 +0100)]
ramips: add label MAC address for TP-Link Archer C20i

Current OpenWrt MAC setup:
eth0             &rom 0xf100    :48
eth0.2           eth0+1         :49
wlan0 (5 GHz)    &radio 0x8004  different OUI
wlan1 (2.4 GHz)  &radio 0x4     same OUI as wlan0

Label MAC address corresponds to eth0 (&ethernet).

No additional addresses found in hexdump of rom/radio.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: fix typos in DTS
DENG Qingfang [Sat, 7 Dec 2019 16:37:31 +0000 (00:37 +0800)]
ath79: fix typos in DTS

Replace "usb_ochi" with "usb_ohci", and "usb_echi" with "usb_ehci".

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years agoglibc: update to latest 2.27 commit (BZ #2503, BZ #2504)
Hans Dedecker [Wed, 11 Dec 2019 21:27:26 +0000 (22:27 +0100)]
glibc: update to latest 2.27 commit (BZ #2503, BZ #2504)

bef0b1cb31 libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]
4d5cfeb510 rtld: Check __libc_enable_secure before honoring LD_PREFER_MAP_32BIT_EXEC (CVE-2019-19126) [BZ #25204]
92f04eedb5 mips: Force RWX stack for hard-float builds that can run on pre-4.8 kernels

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agoath10k-firmware: update Candela Tech firmware images
Koen Vandeputte [Mon, 9 Dec 2019 10:47:01 +0000 (11:47 +0100)]
ath10k-firmware: update Candela Tech firmware images

The release notes since last time for wave-1:

  *  November 29, 2019:  Fix IBSS merge issue, related to TSF id leakage bug in firmware code.
                         Thanks for Ahmed Zaki @ Mage-Networks for helping to diagnose and test.

The release notes since last time for wave-2:

  *  December 6, 2019:  Fix 160Mhz problem caused by logic that did not take into account the fact that
                        160Mhz has only 1/2 of the NSS of lower bandwidths in the rate table.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: bump 4.19 to 4.19.88
Koen Vandeputte [Fri, 6 Dec 2019 15:25:06 +0000 (16:25 +0100)]
kernel: bump 4.19 to 4.19.88

Refreshed all patches.

Remove upstreamed:
- 0004-boot-sq201-from-sda1.patch
- 500-v4.20-ubifs-Fix-default-compression-selection-in-ubifs.patch
- 0003-usb-dwc2-use-a-longer-core-rest-timeout-in-dwc2_core.patch

Altered patches:
- 0011-ARM-dts-Fix-up-SQ201-flash-access.patch
- 400-mtd-add-rootfs-split-support.patch
- 0101-pci-mediatek-backport-fix-pcie.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.158
Koen Vandeputte [Fri, 6 Dec 2019 13:55:57 +0000 (14:55 +0100)]
kernel: bump 4.14 to 4.14.158

Refreshed all patches.

Altered patches:
- 400-mtd-add-rootfs-split-support.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: bump 4.9 to 4.9.206
Koen Vandeputte [Fri, 6 Dec 2019 13:06:33 +0000 (14:06 +0100)]
kernel: bump 4.9 to 4.9.206

Refreshed all patches.

Altered patches:
- 400-mtd-add-rootfs-split-support.patch

Compile-tested on: none
Runtime-tested on: none

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agomalta: remove CONFIG_LEGACY_PTY from kernel config
Daniel Golle [Mon, 9 Dec 2019 19:16:53 +0000 (20:16 +0100)]
malta: remove CONFIG_LEGACY_PTY from kernel config

Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agosunxi: remove CONFIG_LEGACY_PTY from kernel config
Daniel Golle [Mon, 9 Dec 2019 19:15:36 +0000 (20:15 +0100)]
sunxi: remove CONFIG_LEGACY_PTY from kernel config

Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agolayerscape: remove CONFIG_LEGACY_PTY from kernel config
Daniel Golle [Mon, 9 Dec 2019 19:15:02 +0000 (20:15 +0100)]
layerscape: remove CONFIG_LEGACY_PTY from kernel config

Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agokirkwood: remove CONFIG_LEGACY_PTY from kernel config
Daniel Golle [Mon, 9 Dec 2019 19:13:41 +0000 (20:13 +0100)]
kirkwood: remove CONFIG_LEGACY_PTY from kernel config

Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoat91: disable legacy PTYs and virtual terminals
Daniel Golle [Mon, 9 Dec 2019 19:12:41 +0000 (20:12 +0100)]
at91: disable legacy PTYs and virtual terminals

Enabling legacy PTYs causes problems with procd-hotplug.
And as this is a headless target, no need to have virtual terminals.
Remove corresponding kernel config options, they are disabled in
generic kernel config.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agompc85xx: remove CONFIG_LEGACY_PTY from kernel config
Daniel Golle [Mon, 9 Dec 2019 19:11:18 +0000 (20:11 +0100)]
mpc85xx: remove CONFIG_LEGACY_PTY from kernel config

Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoixp4xx: remove CONFIG_LEGACY_PTY from kernel config
Daniel Golle [Mon, 9 Dec 2019 19:10:18 +0000 (20:10 +0100)]
ixp4xx: remove CONFIG_LEGACY_PTY from kernel config

Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agouml: remove CONFIG_LEGACY_PTY from kernel config
Daniel Golle [Mon, 9 Dec 2019 19:09:13 +0000 (20:09 +0100)]
uml: remove CONFIG_LEGACY_PTY from kernel config

Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agooxnas: disable legacy PTYs and virtual terminals
Daniel Golle [Mon, 9 Dec 2019 19:07:00 +0000 (20:07 +0100)]
oxnas: disable legacy PTYs and virtual terminals

Enabling legacy PTYs causes problems with procd-hotplug.
And as this is a headless target, no need to have virtual terminals.
Remove corresponding kernel config options, they are disabled in
generic kernel config.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agomac80211: don't call md5sum on non-existing file
Daniel Golle [Thu, 5 Dec 2019 20:17:58 +0000 (21:17 +0100)]
mac80211: don't call md5sum on non-existing file

If no AP is configured, hostapd-${phy}.conf is not being created,
hence md5sum fails and causes log pollution:

netifd: radio1 (3183): md5sum: can't open '/var/run/hostapd-phy1.conf': No such file or directoy

Hence make sure the file exists when calling md5sum.

Fixes: a5bc9787d4 ("mac80211: add support for dynamically reconfiguring wifi")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agohostapd: re-introduce process tracking
Daniel Golle [Thu, 5 Dec 2019 17:35:36 +0000 (18:35 +0100)]
hostapd: re-introduce process tracking

Before commit 60fb4c92b6 ("hostapd: add ubus reload") netifd was
tracking hostapd/wpa_supplicant and restarting wifi in case of a
process crash. Restore this behaviour by tracking the PIDs of
hostapd and wpa_supplicant.
Also make sure hostapd and/or wpa_supplicant have been started before
emmitting ubus calls to them using ubus wait_for.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agomac80211: track unmanaged interfaces
Daniel Golle [Thu, 5 Dec 2019 17:22:55 +0000 (18:22 +0100)]
mac80211: track unmanaged interfaces

In addition to wpa_supplicant and hostapd managed interfaces, also
track unmanaged interfaces. This is used to make sure that running
'wifi' always returns into a clean state regardless of what the user
did before.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agohostapd: manage instances via procd instead of pidfile
Felix Fietkau [Wed, 4 Dec 2019 23:26:53 +0000 (00:26 +0100)]
hostapd: manage instances via procd instead of pidfile

Allows graceful restart of crashing hostapd/wpa_supplicant instances

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: attempt to launch only present services]

4 years agohostapd: fix crash regression triggered by mesh mode
Felix Fietkau [Wed, 4 Dec 2019 23:01:28 +0000 (00:01 +0100)]
hostapd: fix crash regression triggered by mesh mode

Fixes: 60fb4c92b6 ("hostapd: add ubus reload")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: polish commit message]

4 years agotreewide: remove dts-v1 identifier from DTSI files
Adrian Schmutzler [Sat, 23 Nov 2019 10:44:51 +0000 (11:44 +0100)]
treewide: remove dts-v1 identifier from DTSI files

The "/dts-v1/;" identifier is supposed to be put once at the beginning
of a device tree file. Thus, it makes no sense to provide it a second
time in to-be-included DTSI files.

This removes the identifier from all DTSI files in /target/linux.

Most of the DTS files in OpenWrt do contain the "/dts-v1/;". It is
missing for most of the following targets, though:
mvebu, ipq806x, mpc85xx, ipq40xx

This does not touch ipq806x for now, as the bump to 4.19 is close.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agohostapd: enable CTRL_IFACE_MIB for hostapd-full
David Bauer [Thu, 5 Dec 2019 18:29:14 +0000 (19:29 +0100)]
hostapd: enable CTRL_IFACE_MIB for hostapd-full

This enables the CTRL_IFACE_MIB symbol for wpad-full and hostapd-full.
If it is not enabled, statistic outputs such as "hostapd_cli all_sta"
are empty.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agobrcm47xx: add switch configuration for WNR3500L
Olli Asikainen [Fri, 15 Nov 2019 15:07:37 +0000 (17:07 +0200)]
brcm47xx: add switch configuration for WNR3500L

Netgear WNR3500L is an already supported device, but out of the
box, the device has no switch configuration and there is no wan.
The correct configuration for this specific model is similar to
some other models. This simple commit adds the correct switch
and the out-of-the-box experience is improved.

Experimentally determined:

Port 0 => WAN
Port 1..4 => LAN
Port 5..7 => unused
Port 8 => CPU

Signed-off-by: Olli Asikainen <olli.asikainen@gmail.com>
Tested-by: Fabian Zaremba <fabian@youremail.eu>
[added port mapping to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: convert mediatek,mtd-eeprom from decimal to hex notation
Adrian Schmutzler [Sat, 7 Dec 2019 23:09:25 +0000 (00:09 +0100)]
ramips: convert mediatek,mtd-eeprom from decimal to hex notation

A small subset of devices uses decimal notation for mediatek,mtd-eeprom
in DTS files. Convert to hexadecimal notation to be consistent with
all the rest.

Also change "0" to "0x0" in the same files for consistency.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: fix number of LAN Ports for Mikrotik RBM33G
Martin Schiller [Wed, 4 Dec 2019 09:43:02 +0000 (10:43 +0100)]
ramips: fix number of LAN Ports for Mikrotik RBM33G

The Mikrotik RBM33G has only 2 LAN ports.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
[moved node in 02_network to maintain alphabetic sorting]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoramips: fix switch port order for TP-Link Archer C20i
Walter Sonius [Wed, 4 Dec 2019 20:07:58 +0000 (21:07 +0100)]
ramips: fix switch port order for TP-Link Archer C20i

Physical port order watched from the backside of the C20i
(from left to right) is: Internet / 1 / 2 / 3 / 4

Physical Port Switch port
WAN             0
LAN 3           1
LAN 4           2
LAN 1           3
LAN 2           4
(not used)      5
CPU             6

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
[commit message/title improvements]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: fix WNDR3700/WNDR3800 wifi reg size
Christian Lamparter [Wed, 15 Aug 2018 15:53:48 +0000 (17:53 +0200)]
ath79: fix WNDR3700/WNDR3800 wifi reg size

"[...] the size component shall be zero."
(See "PCI Bus Binding to: IEEE Std 1275-1994 Rev 2.1"
section "4.1.1 Open Firmware-defined Properties for Child Nodes")

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years agoiproute2: update to 5.4.0
Hans Dedecker [Thu, 5 Dec 2019 21:46:50 +0000 (22:46 +0100)]
iproute2: update to 5.4.0

Update iproute2 to latest stable version, see https://lwn.net/Articles/805654/
for the changes in 5.4.0

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agomediatek: fix pcie bringup issue
John Crispin [Thu, 5 Dec 2019 09:22:56 +0000 (10:22 +0100)]
mediatek: fix pcie bringup issue

Signed-off-by: John Crispin <john@phrozen.org>
4 years agowireguard: bump to 0.0.20191205
Jason A. Donenfeld [Thu, 5 Dec 2019 10:59:41 +0000 (11:59 +0100)]
wireguard: bump to 0.0.20191205

* wg-quick: linux: suppress error when finding unused table

This fixes a spurious warning messages seen with recent versions of iproute2
and kernels.

* wg-quick: linux: ensure postdown hooks execute
* wg-quick: linux: have remove_iptables return true
* wg-quick: linux: iptables-* -w is not widely supported

Adding in iptables had some hiccups. For the record, I'm very unhappy about
having to put any firewalling code into wg-quick(8). We'll of course need to
support nftables too at some point if this continues. I'm investigating with
upstream the possibility of adding a sysctl to patch the issue that iptables
is handling now, so hopefully at somepoint down the line we'll be able to shed
this dependency once again.

* send: use kfree_skb_list
* device: prepare skb_list_walk_safe for upstreaming
* send: avoid touching skb->{next,prev} directly

Suggestions from LKML.

* ipc: make sure userspace communication frees wgdevice

Free things properly on error paths.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
4 years agoath79: add support for Ubiquiti LiteBeam AC Gen2
Stijn Tintel [Fri, 12 Apr 2019 17:21:58 +0000 (20:21 +0300)]
ath79: add support for Ubiquiti LiteBeam AC Gen2

Hardware:
* SoC: Atheros AR9342-BL1A
* RAM: 64MB DDR2 (Winbond W9751G6KB-25)
* Flash: 16MB SPI NOR (Macronix MX25L12835FZ2I-10G)
* Ethernet: 1x 10/100/1000 Mbps (Atheros AR8035-A) with 24V PoE support
* Wifi 2.4GHz: Atheros AR9340 v2
* WiFi 5GHz: Ubiquiti U-AME-G1-BR4A (rebranded QCA988X v2)
* LEDs: 1x Power, 1x Ethernet
* Buttons: 1x Reset
* UART: 1x TTL 115200n8, 3.3V RX TX GND, 3.3V pin closest to RJ45 port

The LEDs do not seem to be connected to any GPIO, so there is currently
no way to control them.

Installation via U-Boot, TFTP and serial console:
* Configure your TFTP server with IP 192.168.1.254
* Connect serial console and power up the device
* Hit any key to stop autoboot
* tftpboot 0x81000000 openwrt-ath79-generic-ubnt_litebeam-ac-gen2-initramfs-kernel.bin
* bootm 0x81000000
* copy openwrt-ath79-generic-ubnt_litebeam-ac-gen2-squashfs-sysupgrade.bin
  to /tmp
* sysupgrade /tmp/openwrt-ath79-generic-ubnt_litebeam-ac-gen2-squashfs-sysupgrade.bin

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Petr Štetiar <ynezz@true.cz>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: drop IMAGE/factory.bin from ubnt-wa devices
Stijn Tintel [Tue, 3 Dec 2019 11:57:20 +0000 (13:57 +0200)]
ath79: drop IMAGE/factory.bin from ubnt-wa devices

The sysupgrade image contains OpenWrt specific metadata. Having this
metadata in the factory images makes no sense. Drop IMAGE/factory.bin
from Device/ubnt-wa and use the default from Device/ubnt instead.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Petr Štetiar <ynezz@true.cz>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agokernel: act_ctinfo: fix updated backport on 4.14
Kevin Darbyshire-Bryant [Wed, 4 Dec 2019 12:06:26 +0000 (12:06 +0000)]
kernel: act_ctinfo: fix updated backport on 4.14

It turns out my 4.14 testing had a rather large flaw in it and the
'extack' mechanism isn't quite ready.  Remove the extack stuff from this
backport.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agokernel: act_ctinfo: update backport
Kevin Darbyshire-Bryant [Tue, 26 Nov 2019 08:45:38 +0000 (08:45 +0000)]
kernel: act_ctinfo: update backport

Since the original backports from kernel 5.3 a few things have been
tweaked by kernel bumps & other upstream changes.  Update the backport
to reflect upstream as closely as possible and remove the bitrot.

Functions remain the same, error reporting improved.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agoath79: fix source of label MAC address for Ubiquiti XM devices
Adrian Schmutzler [Tue, 19 Nov 2019 14:24:58 +0000 (15:24 +0100)]
ath79: fix source of label MAC address for Ubiquiti XM devices

In d421a8b94489 ("ath79: read label MAC address from flash instead
of using phy0/phy1") the source of the label MAC address was changed
for devices just reading it from phy0. To get rid of the dependency
from phy startup, addresses were read directly from the flash
locations that are used to initialize the phy MAC addresses.

Unfortunately, it turned out that Ubiquiti XM devices seem to have
different flash locations than expected, and also seem to have
specific locations for different devices (all in art/EEPROM):

0xe012 AR9280 Nanostation M2 - 0x120c
0xe035 AR9280 Nanostation M3 - 0x120c
0xe1b2 AR9280 Rocket M2 - 0x120c
0xe1c3 AR9280 Rocket M3 - 0x120c
0xe1b5 AR9280 Rocket M5 - 0x120c
0xe2d5 AR9280 Bullet M2 Titanium - 0x120c
0xe2b5 AR9280 Nanobridge M5 - 0x120c
0xe202 AR9280 Bullet M2 - 0x120c
0xe232 AR9287 Nanobridge M2 - 0x110c
0xe4a2 AR9285 AirRouter - 0xa0bf
Picostation M2 - 0x120c and 0xa0bf
Nanostation Loco M2 - not in 0x120c, other locations not checked

An additional problem of the Ubiquiti device support in OpenWrt is
that we provide images that match several subvariants of the devices,
which might have different MAC address locations.

Given that reading the address from phy0 in 02_network _is_ working
for the ath79 target in general, it does not seem reasonable to
rebuild a complex MAC address retrieval mechanism which is already
present in the ath9k driver.

So, this patch reverts the label MAC address source for Ubiquiti XM
devices (and the Unifi AP) to /sys/class/ieee80211/phy0/macaddress.

This doesn't affect XW and Unifi AC devices, where the label MAC
address source is defined via device tree.

For alfa-network,ap121f the location 0x1002 is kept, as this has
been verified during device support preparation in PR #2199.

Fixes: d421a8b94489 ("ath79: read label MAC address from flash
instead of using phy0/phy1")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agogre: add ipv6 parameter to gre interfaces
Alin Nastac [Tue, 12 Nov 2019 14:11:00 +0000 (15:11 +0100)]
gre: add ipv6 parameter to gre interfaces

IPv6 protocol is enabled on all gre interfaces, but gre(v6)tap
interfaces are usually added to a bridge interface, in which case
IPv6 should be enabled only on the bridge interface.

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
4 years agocurl: bump to 7.67.0
Hans Dedecker [Mon, 2 Dec 2019 19:42:46 +0000 (20:42 +0100)]
curl: bump to 7.67.0

For changes in 7.67.0; see https://curl.haxx.se/changes.html#7_67_0

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agoocteon: fix sysupgrade
Stijn Tintel [Sat, 30 Nov 2019 18:17:42 +0000 (20:17 +0200)]
octeon: fix sysupgrade

Sysupgrade was failing due to incorrect replacement of backticks:
/sbin/sysupgrade: /lib/upgrade/platform.sh: line 101: syntax error: missing '))'

Fixes: 0bbfc3dff719 ("octeon: replace backticks by $(...)")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
4 years agogeneric ar8xxx: increase VLAN table for AR83x7
David Bauer [Sun, 24 Nov 2019 19:53:39 +0000 (20:53 +0100)]
generic ar8xxx: increase VLAN table for AR83x7

The Atheros AR8327 and AR8337 have (according to their datasheet) a
VLAN table with a maximum of 4096 entries.

Currently, there's a hard limit of 128 VLANs, which is the same as
for most other Atheros switches. Increase this limit only for the
AR83x7 series and modify some shared functions to allow them to work
with a variable max VLAN count.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agomac80211: switch to upstream owl-loader driver
Christian Lamparter [Sat, 16 Nov 2019 16:08:07 +0000 (17:08 +0100)]
mac80211: switch to upstream owl-loader driver

The Owl Loader (named after the codename that Atheros gave
these devices back in the day) has been accepted upstream.

This patch removes the "misc" driver OpenWrt had and adds
the remaining differences against the version that ships
with 5.4-rc1 into a separate "120-owl-loader-compat.patch"
file that can be cut down once AR71XX is being dealt with.

Note: I decided to keep the existing (kmod-)owl-loader
package name around for now. The kernel module file in
the kmod package will be called ath9k_pci_owl_loader.ko
though.

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years agobusybox: add glibc dependency for vi regex option
Satadru Pramanik [Fri, 15 Nov 2019 17:42:44 +0000 (12:42 -0500)]
busybox: add glibc dependency for vi regex option

Build with musl libc fails with BUSYBOX_DEFAULT_FEATURE_VI_REGEX_SEARCH
enabled. Enabling BusyBox's vi regex search option depends upon GNU
regex.  Musl libc does not support GNU regex[1].

So this patch adds explicit dependency on GNU libc and while at it
remove the FIXME comment.

1. https://wiki.musl-libc.org/functional-differences-from-glibc.html

Ref: https://dev.archive.openwrt.org/ticket/21741.html
Ref: https://forum.openwrt.org/t/busybox-not-compiling/
Ref: https://github.com/openwrt/packages/issues/4453
Signed-off-by: Satadru Pramanik <satadru@umich.edu>
[commit subject/description tweaks, From: fix, USE_GLIBC fix, removed comments]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoglibc: backport fix for regexec buffer read overrun
Alin Nastac [Thu, 21 Nov 2019 13:06:18 +0000 (14:06 +0100)]
glibc: backport fix for regexec buffer read overrun

Problem found by AddressSanitizer[1]:

 Latest `grep` (git commit 1019e6e) compiled with asan may cause a
 heap-buffer-overflow when `-i` is specified.

     ./grep -i '\(\(\)*.\)*\(\)\(\)\1' /bin/chvt

 =================================================================
 ==16206==ERROR: AddressSanitizer: heap-buffer-overflow on address

1. https://debbugs.gnu.org/34140

Ref: https://sourceware.org/bugzilla/show_bug.cgi?id=24114
Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
[commit title and description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoRevert "mt76: probe load mt7615 driver asynchronously"
DENG Qingfang [Mon, 14 Oct 2019 07:48:32 +0000 (15:48 +0800)]
Revert "mt76: probe load mt7615 driver asynchronously"

This reverts commit 81764319637f ("mt76: probe load mt7615 driver
asynchronously").  After said commit, users report that MT7615 no longer
works on boot and they have to manually enable WiFi (via command "wifi") to
make it working again.

Fixes: FS#2546
Ref: https://forum.openwrt.org/t/xiaomi-r3p-no-wifi-on-boot/45509
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
[commit description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoipq40xx: add support for Crisis Innovation Lab MeshPoint.One
Robert Marko [Mon, 25 Nov 2019 14:25:00 +0000 (15:25 +0100)]
ipq40xx: add support for Crisis Innovation Lab MeshPoint.One

MeshPoint.One is Wi-Fi hotspot and smart IoT gateway (based upon
Jalapeno module from 8Devices).

MeshPoint.One (https://meshpointone.com) is a unique Wi-Fi hotspot and
smart city gateway that can be installed and powered from street
lighting (even solar power in the future).  MeshPoint provides up to 27
hours of interrupted Wi-Fi and IoT services from internal battery even
when external power is not available.  MeshPoint.One can be used for
disaster relief efforts in order to provide instant Wi-Fi coverage that
can be easily expanded by just adding more devices that create wide area
mesh network.  MeshPoint.One devices have standard Luci UI for
management.

Features:
- 1x 1Gpbs WAN
- 1x 1Gbps LAN
- POE input (eth0)
- POE output (eth1)
- Sensor for temperature, humidity and pressure (Bosch BME280)
- current, voltage and power measurement via TI INA230
- Hardware real time clock
- optional power via Li-Ion battery
- micro USB port with USB to serial chip for easy OpenWrt terminal
  access
- I2C header for connecting additional sensors

Installation:
-------------
Simply flash the sysupgrade image from stock firmware.

Or use the built in Web recovery into bootloader:
Hold Reset button for 5 to 20 seconds or use UART and httpd command.
Web UI will appear on 192.168.2.100 by default.
For web recovery use the factory.ubi image.

Signed-off-by: Damir Samardzic <damir.samardzic@sartura.hr>
Signed-off-by: Damir Franusic <damir.franusic@sartura.hr>
Signed-off-by: Valent Turkovic <valent@meshpoint.me>
Signed-off-by: Robert Marko <robert@meshpoint.me>
[commit description long line wrap, usb->USB]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoipq40xx: use DTSI for Jalapeno
Robert Marko [Mon, 25 Nov 2019 14:12:24 +0000 (15:12 +0100)]
ipq40xx: use DTSI for Jalapeno

Lets move common code for Jalapeno into DTSI, this way Jalapeno based
boards don't introduce duplicate code.

While at it, lets also fix some style issues and update to current DTS
style.

Signed-off-by: Robert Marko <robert@meshpoint.me>
[commit description long line wrap]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agonetifd: update to latest git HEAD
Hans Dedecker [Fri, 29 Nov 2019 20:53:21 +0000 (21:53 +0100)]
netifd: update to latest git HEAD

e45b140 interface: warn if ip6hint is truncated

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agomac80211: unify setup of iw htmode for mesh and adhoc
Santiago Piccinini [Mon, 25 Nov 2019 19:53:59 +0000 (16:53 -0300)]
mac80211: unify setup of iw htmode for mesh and adhoc

This also fixes mac80211_prepare_vif iw set channel in monitor or
mesh mode.

Signed-off-by: Santiago Piccinini <spiccinini@altermundi.net>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: fixed commit message]

4 years agokernel: bump 4.9 to 4.9.205
Koen Vandeputte [Fri, 29 Nov 2019 09:52:01 +0000 (10:52 +0100)]
kernel: bump 4.9 to 4.9.205

Refreshed all patches.

Fixes:
- CVE-2019-18660

Compile-tested on: none
Runtime-tested on: none

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years agokernel: bump 4.19 to 4.19.86
Koen Vandeputte [Mon, 25 Nov 2019 10:32:08 +0000 (11:32 +0100)]
kernel: bump 4.19 to 4.19.86

Refreshed all patches.

Altered patches:
- 950-0064-mfd-Add-Raspberry-Pi-Sense-HAT-core-driver.patch
- 0005-mtd-physmap_of-Move-custom-initialization.patch

Remove upstreamed:
- 0001-pinctrl-gemini-Mask-and-set-properly.patch
- 0002-pinctrl-gemini-Fix-up-TVC-clock-group.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.156
Koen Vandeputte [Mon, 25 Nov 2019 10:29:17 +0000 (11:29 +0100)]
kernel: bump 4.14 to 4.14.156

Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>