Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2018.1.x: mac80211/ath10k-ct: reduce memory consumption of ath10k #1440

Closed

Conversation

ecsv
Copy link
Contributor

@ecsv ecsv commented Jun 18, 2018

ath10k uses a rather high number of buffers to communicate with the QCA firmware. Especially the HTC (host-target-communication) and HTT (host-target-transport) can take up a lot of memory when data is
transferred over a ath10k wifi link.

Even a 256MB device with three radios can go OOM (while sending to threedevices using UDP unicast/multicast packets) with the default buffer limits. Unfortunately, this also reduced the maximum 5GHz throughput on an IPQ40xx device without RPS/XPS optimizations from 494/432 Mbit/s for TCP transfers (download/upload) to 438/343 Mbit/s. These throughput values should still be good enough for a Freifunk installation.


This is a partial backport from OpenWrt https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=cc189c0b7fa015978b04bb663a75b1da726376b5

@ecsv
Copy link
Contributor Author

ecsv commented Jun 18, 2018

A different thing which could be tested to work around OOMs while doing transfers over wifi is to disable the new AQM implementation. This should be doable by setting wake_tx_queue in ieee80211_ops to NULL. This would be in net/wireless/ath/ath10k/mac.c ath10k_ops for ath10k. But this is more an theoretical idea and not tested yet.

Ath9k requires more changes because it previously implemented its own queues - which was dropped in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=50f08edf98096a68f01ff4566b605a25bf8e42ce

@ecsv ecsv changed the title mac80211: reduce memory consumption by ath10k mac80211: reduce memory consumption of ath10k Jun 18, 2018
@ecsv ecsv force-pushed the ath10k/low_memory branch 2 times, most recently from 3395f55 to 08e0ff2 Compare June 18, 2018 19:06
@ecsv ecsv changed the title mac80211: reduce memory consumption of ath10k mac80211/ath10k-ct: reduce memory consumption of ath10k Jun 18, 2018
@ecsv
Copy link
Contributor Author

ecsv commented Jun 19, 2018

The change for ath10k-ct was also prepared for OpenWrt in PR openwrt/openwrt#1077 (btw. different paths have to be patched in gluon 2017.1.x and OpenWrt 18.06)

ath10k uses a rather high number of buffers to communicate with the QCA
firmware. Especially the HTC (host-target-communication) and HTT
(host-target-transport) can take up a lot of memory when data is
transferred over a ath10k wifi link.

Even a 256MB device with three radios can go OOM (while sending to three
devices using UDP unicast/multicast packets) with the default buffer
limits. Unfortunately, this also reduced the maximum 5GHz throughput on an
IPQ40xx device from 494/432 Mbit/s for TCP transfers (download/upload) to
438/343 Mbit/s. These throughput values should still be good enough for a
Freifunk installation.
@rotanid rotanid added the 0. type: enhancement The changeset is an enhancement label Jun 19, 2018
@greearb
Copy link

greearb commented Jun 21, 2018

I would not commit something that makes performance worse for everyone. Instead, use something like my fwcfg feature in the ath10k-ct driver to allow users to configure those sorts of things to the value they prefer.

@rotanid
Copy link
Member

rotanid commented Jun 21, 2018

@greearb in the case of Gluon and Freifunk, this speed reduction doesn't bother anyone.
but of course we follow upstream OpenWrt, so the decision has to be made there.

@christf
Copy link
Member

christf commented Jun 29, 2018

When given the choice of speed vs stability the right choice is stability.

@rotanid
Copy link
Member

rotanid commented Jun 30, 2018

@christf the thing is that upstream likely rejects this patch - and we don't want to use patches (most of the time) which are not upstreamable...

@Adorfer
Copy link
Contributor

Adorfer commented Jul 6, 2018

So make it in some way configurable, either in config or if inpossible during compile.
(otherwise communities will have to do this patch locally on a large scale. And then nobody will like bugreports out of those communities "due to one of 12 different patches for the basically same subject, probable not reproducable in plain vanilla gluon".)

@rotanid
Copy link
Member

rotanid commented Jul 6, 2018

as ibss (-> ath10k-ct) is deprecated anyways and ath10k devices with only 64M memory are BROKEN, i don't think it's worth another non-upstream patch.
but ultimately it's someone else's decision to make.

@ecsv
Copy link
Contributor Author

ecsv commented Jul 7, 2018

as ibss (-> ath10k-ct) is deprecated anyways

Doesn't look this way. There are a couple of targets which select it unconditionally:

  • targets/ar71xx-generic
  • targets/ipq806x
  • targets/x86.inc

and ath10k devices with only 64M memory are BROKEN

The problem also affects ath10k-only dual or tri-radio devices with only 128/256 MB. You can find such devices for example in OpenWrt's ipq40xx target

In general: I will not invest any time in implementing a special ath10k-ct-only feature. Especially not when it depends on a ath10k-ct feature which the ath10k-ct author is not upstreaming to ath10k. And also not because HTT_RX_RING_SIZE_MAX is a preprocessor variable which is then (indirectly) used to fill a const struct. The latter is also true for the PCI buffer size change.

@greearb
Copy link

greearb commented Jul 7, 2018 via email

@rotanid
Copy link
Member

rotanid commented Jul 31, 2018

@ecsv maybe related? #1495

@ecsv
Copy link
Contributor Author

ecsv commented Jul 31, 2018

@ecsv maybe related? #1495

When #1495 (comment) is master then it could be related. At least I am not aware that the buffer size changes in ath10k were backported to LEDE (this is why I've created #1440 with the changes for ath10k and ath10k-ct)

@blocktrron @mweinelt

@mweinelt
Copy link
Contributor

Yes, they are gluon master /openwrt 18.06.

@ecsv ecsv changed the base branch from master to v2018.1.x July 31, 2018 14:17
@ecsv ecsv changed the title mac80211/ath10k-ct: reduce memory consumption of ath10k 2018.1.x: mac80211/ath10k-ct: reduce memory consumption of ath10k Jul 31, 2018
@Adorfer
Copy link
Contributor

Adorfer commented Aug 1, 2018

is possible to Backport to 2018.1.x or would this be considered as "new function"?

@greearb
Copy link

greearb commented Aug 1, 2018

If you want to discuss 802.11ax or anything else that is not related to memory usage, then please start a new topic.

@Adorfer
Copy link
Contributor

Adorfer commented Aug 1, 2018

no need for a new topic, since that is not my intention to discuss.

@rotanid
Copy link
Member

rotanid commented Sep 23, 2018

we discussed this patch on IRC today with @blocktrron and @christf
we tend to reject this patch, as should be there with master branch and therefore v2018.2 release anyway.
also, we don't see a big problem in v2018.1.x branch with supported ath10k devices which would justify adding another patch.
what do you think about this @ecsv ?

@ecsv
Copy link
Contributor Author

ecsv commented Sep 23, 2018

Fine with me. Communities can just apply the patches manually when they have ath10k devices which have this kind of problem with low memory ath10k devices. The biggest problem I've seen were with ath10k dual/triband devices (ipq40xx) and these are not yet supported by 2018.1.x.

Just as reminder: It is not there in the master branch for ath10k-ct (GLUON_WLAN_MESH = 'ibss'; or ipq806x and x86)

@blocktrron
Copy link
Member

Good point on IBSS. If we consider IBSS as legacy i would view this as a non issue, but if this is not the case we should apply this patch to master.

@ecsv
Copy link
Contributor Author

ecsv commented Sep 23, 2018

Good point on IBSS. If we consider IBSS as legacy i would view this as a non issue, but if this is not the case we should apply this patch to master.

Small remark: The master branch (openwrt 18.06) would need a slightly different patch (the ath10k-ct package is a little bit special and you need to patch the correct subdirectory in owrt 18.06): openwrt/openwrt#1077

@rotanid
Copy link
Member

rotanid commented Sep 23, 2018

ok, so we'll close this PR and if someone wants to adjust the patch for 18.06 with ath10k-ct, we can consider a new PR

@rotanid rotanid closed this Sep 23, 2018
@ecsv
Copy link
Contributor Author

ecsv commented Sep 23, 2018

ok, so we'll close this PR and if someone wants to adjust the patch for 18.06 with ath10k-ct, we can consider a new PR

Ok, will do that. Will take a while until the build is finished.

@rotanid
Copy link
Member

rotanid commented Sep 23, 2018

Ok, will do that. Will take a while until the build is finished.

ok, thought you don't want to, after reading your comment in openwrt/openwrt#1077

@ecsv
Copy link
Contributor Author

ecsv commented Sep 23, 2018

Ok, will do that. Will take a while until the build is finished.

ok, thought you don't want to, after reading your comment in openwrt/openwrt#1077

I didn't want to implement any ath10k-ct only feature to enable/disable it at runtime. It was not about adjusting the minimal ath10k patch for the ath10k-ct in OpenWrt 18.06 (which I basically did already).

@ecsv ecsv deleted the ath10k/low_memory branch September 23, 2018 13:32
jow- pushed a commit to openwrt/openwrt that referenced this pull request Dec 24, 2019
According to many bugreports [0][1][2] the default ath10k-ct kernel
module is unusable on devices with just 64 MiB RAM or with 128 MiB and
dual ath10k cards. The target boards boot but eventually oom-killer
starts to interfere with normal operation, so the current state is
effectively broken.

Since the two patches in question have a performance impact (and
possibly some other unexpected side-effects) a dedicated build variant
is added so that users of the low RAM devices can still benefit from all
the ath10k-ct advantages.

According to testing [3] results, the issue can be experienced even with
"a 256MB device with three radios". Measured performance impact of
implementing small buffers was lowering "the maximum 5 GHz throughput on
an IPQ40xx device without RPS/XPS optimizations from 494/432 Mbit/s for
TCP transfers (download/upload) to 438/343 Mbit/s"

The patches were apparently inspired by QSDK tweaks used by ODMs for the
affected devices.

[0] http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020573.html
[1] #1077
[2] https://bugs.openwrt.org/index.php?do=details&task_id=2664
[3] freifunk-gluon/gluon#1440 (comment)

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
[Remove double CONFIG_ATH10K-CT_LEDS entry]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
jow- pushed a commit to openwrt/openwrt that referenced this pull request Dec 24, 2019
According to many bugreports [0][1][2] the default ath10k-ct kernel
module is unusable on devices with just 64 MiB RAM or with 128 MiB and
dual ath10k cards. The target boards boot but eventually oom-killer
starts to interfere with normal operation, so the current state is
effectively broken.

Since the two patches in question have a performance impact (and
possibly some other unexpected side-effects) a dedicated build variant
is added so that users of the low RAM devices can still benefit from all
the ath10k-ct advantages.

According to testing [3] results, the issue can be experienced even with
"a 256MB device with three radios". Measured performance impact of
implementing small buffers was lowering "the maximum 5 GHz throughput on
an IPQ40xx device without RPS/XPS optimizations from 494/432 Mbit/s for
TCP transfers (download/upload) to 438/343 Mbit/s"

The patches were apparently inspired by QSDK tweaks used by ODMs for the
affected devices.

[0] http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020573.html
[1] #1077
[2] https://bugs.openwrt.org/index.php?do=details&task_id=2664
[3] freifunk-gluon/gluon#1440 (comment)

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
[Remove double CONFIG_ATH10K-CT_LEDS entry]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 1ac6270)
jollaman999 pushed a commit to jollaman999/openwrt that referenced this pull request Dec 28, 2019
According to many bugreports [0][1][2] the default ath10k-ct kernel
module is unusable on devices with just 64 MiB RAM or with 128 MiB and
dual ath10k cards. The target boards boot but eventually oom-killer
starts to interfere with normal operation, so the current state is
effectively broken.

Since the two patches in question have a performance impact (and
possibly some other unexpected side-effects) a dedicated build variant
is added so that users of the low RAM devices can still benefit from all
the ath10k-ct advantages.

According to testing [3] results, the issue can be experienced even with
"a 256MB device with three radios". Measured performance impact of
implementing small buffers was lowering "the maximum 5 GHz throughput on
an IPQ40xx device without RPS/XPS optimizations from 494/432 Mbit/s for
TCP transfers (download/upload) to 438/343 Mbit/s"

The patches were apparently inspired by QSDK tweaks used by ODMs for the
affected devices.

[0] http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020573.html
[1] openwrt/openwrt#1077
[2] https://bugs.openwrt.org/index.php?do=details&task_id=2664
[3] freifunk-gluon/gluon#1440 (comment)

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
[Remove double CONFIG_ATH10K-CT_LEDS entry]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
chunkeey referenced this pull request in openwrt/openwrt Jan 5, 2020
These two hacks are no longer necessary as they've
been moved to a special variant of kmod-ath10k-ct.

So, if you have a device suffering from low-memory
situation and getting applications crashes due to
the OOM reaper or kernel panics with ath10k, please
use the "kmod-ath10k-ct-smallbuffers" package from
now on.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
vov4ik-il added a commit to vov4ik-il/openwrt that referenced this pull request Apr 6, 2020
* ramips: add support for ALFA Network Quad-E4G

ALFA Network Quad-E4G is a universal Wi-Fi/4G platform, which offers
three miniPCIe (PCIe, USB 2.0, SIM) and a single M.2 B-key (dual-SIM,
USB 3.0) slots, RTC and five Gigabit Ethernet ports with PoE support.

Specification:

- MT7621A (880 MHz)
- 256/512 MB of RAM (DDR3)
- 16/32+ MB of FLASH (SPI NOR)
- optional second SPI flash (8-pin WSON/SOIC)
- 1x microSD (SDXC) flash card reader
- 5x 10/100/1000 Mbps Ethernet, with passive PoE support (24 V) in LAN1
- optional 802.3at/af PoE module for WAN
- 3x miniPCIe slot (with PCIe and USB 2.0 buses, micro SIM and 5 V)
- 1x M.2/NGFF B-key 3042 (USB 3.0/2.0, mini + micro SIM)
- RTC (TI BQ32002, I2C bus) with backup battery (CR2032)
- external hardware watchdog (EM Microelectronic EM6324)
- 1x USB 2.0 Type-A
- 1x micro USB Type-B for system serial console (Holtek HT42B534)
- 11x LED (5 for Ethernet, 5 driven by GPIO, 1x power indicator)
- 3x button (reset, user1, user2)
- 1x I2C (4-pin, 2.54 mm pitch) header on PCB
- 4x SIM (6-pin, 2.00 mm pitch) headers on PCB
- 2x UART2/3 (4-pin, 2.54 mm pitch) headers on PCB
- 1x mechanical power switch
- 1x DC jack with lock (24 V)

Other:

- U-Boot selects default SIM slot, based on value of 'default_sim' env
  variable: '1' or unset -> SIM1 (mini), '2' -> SIM2 (micro). This board
  has additional logic circuit for M.2 SIM switching. The 'sim-select'
  will work only if both SIM slots are occupied. Otherwise, always slot
  with SIM inside is selected, no matter 'sim-select' value.
- U-Boot enables power in all three miniPCIe and M.2 slots before
  loading the kernel
- this board supports 'dual image' feature (controlled by 'dual_image'
  U-Boot environment variable)
- all three miniPCIe slots have additional 5 V supply on pins 47 and 49
- the board allows to install up to two oversized miniPCIe cards (vendor
  has dedicated MediaTek MT7615N/D cards for this board)
- this board has additional logic circuit controlling PERSTn pins inside
  miniPCIe slots. By default, PERSTn (GPIO19) is routed to all miniPCIe
  slots but setting GPIO22 to high allows PERSTn control per slot, using
  GPIO23-25 (value is inverted)

Flash instructions:

You can use the 'sysupgrade' image directly in vendor firmware which is
based on OpenWrt (make sure to not preserve settings - use 'sysupgrade
-n -F ...' command). Alternatively, use web recovery mode in U-Boot:

1. Power the device with reset button pressed, the modem LED will start
   blinking slowly and after ~3 seconds, when it starts blinking faster,
   you can release the button.
2. Setup static IP 192.168.1.2/24 on your PC.
3. Go to 192.168.1.1 in browser and upload 'sysupgrade' image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(backported from commit e68539aca43a560077364de27eb220f1d85ca3ef)

* uboot-envtools: ramips: add support for ALFA Network Quad-E4G

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit 10bcf1eb40b728b3583c1a7693111f27a9801dc5)

* ath79: add PoE passthrough switch for Ubiquiti Nanostation (XM/XW)

This adds the gpio switch to enable PoE passthrough on Ubiquiti
Nanostation (XM/XW).

Values are copied from the implementation in ar71xx.

GPIO values checked on:
- NanoStation M5 XW
- NanoStation M2 XM

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 317e98a5a2c6f1e2ac599ec530478669b965602c)

* ar71xx: ubnt-(xm,xw): add rssileds package

In order to make RSSI indicator on the device work out of box,
include "rssileds" package in per-device rootfs image by default
for Ubiquiti XM and XW devices, namely:
- Bullet M (XM/XW)
- Rocket M (XM/XW)
- Nanostation M (XM/XW)
- Nanostation Loco-M (XW)

This moves the package addition to the individual devices in order
to prevent accidental inclusions of the package when not looking
at the parent node carefully enough.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
[add bullet-m-xw, remove rocket-m-ti, extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 08d9c95417399ac8615df210f4381cca68a4b25c)

* base-files: config_generate: split macaddr with multiple ifaces

netifd does not handle network.@device[x].name properly if it
contains multiple ifaces separated by spaces. Due to this, board.d
lan_mac setup does not work if multiple ifaces are set to LAN by
ucidef_set_interface_lan.

To fix this, create a device node for each member iface when
running config_generate instead. Those are named based on the
member ifname:

  ucidef_set_interface_lan "eth0 eth1.1"
  ucidef_set_interface_macaddr "lan" "yy:yy:yy:yy:yy:01"

will return

  config device 'lan_eth0_dev'
        option name 'eth0'
        option macaddr 'yy:yy:yy:yy:yy:01'

  config device 'lan_eth1_1_dev'
        option name 'eth1.1'
        option macaddr 'yy:yy:yy:yy:yy:01'

ref: https://github.com/openwrt/openwrt/pull/2542

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[always use new scheme, extend description, change commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 298814e6be7640d89328de9e7c90d4349e30683f)

* ath79: Add support for TP-Link Archer C60 v1

TP-Link Archer C60v1 is a dual-band AC1350 router,
based on Qualcomm/Atheros QCA9561+QCA9886.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- 7x LED, 2x button
- UART header on PCB

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 tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin 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.

Flash instruction under U-Boot, using UART:
1. tftp 0x81000000 ...-sysupgrade.bin
2. erase 0x9f020000 +$filesize
3. cp.b $fileaddr 0x9f020000 $filesize
4. reset

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6d313da6dc5f655d92aa86e2ec42ecfcf763df3d)

* ath79: Add support for TP-Link Archer C60 v2

TP-Link Archer C60 v2 is a dual-band AC1350 router,
based on Qualcomm/Atheros QCA9561 + QCA9886.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- 7x LED, 2x button
- UART header on PCB

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 tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin 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

Flash instruction (under U-Boot, using UART):
tftp 0x81000000 ...-sysupgrade.bin
erase 0x9f030000 +$filesize
cp.b $fileaddr 0x9f030000 $filesize
reset

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 974d6958a7c6332438ab4cda98e72156c8d944ed)

* ath79: add support for YunCore TFTP image generation

YunCore QCA9k based devices released in 2019 require a custom TFTP image
for U-Boot built-in recovery mode (triggered with reset button). Image
has to be prepended with 'YUNCORE' keyword followed by U-Boot CLI
commands which will be executed later. Images without the custom header
will be ignored by U-Boot.

To be able to support both the vendor firmware (QSDK) and OpenWrt flash
layouts, used here commands change the 'bootcmd' before flashing image.

This commit adds generic helper script for YunCore devices with 16 MB of
flash and enables TFTP image generation for A770 model.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
[pepe2k@gmail.com: commit description reworded, recipe renamed]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit 8016f648640e8f73f0dc4fc307fb6bebd12afb88)

* ath79: add support for YunCore XD4200 and A782

YunCore XD4200 ('XD4200_W6.0' marking on PCB) is Qualcomm/Atheros based
(QCA9563, QCA9886, QCA8334) dual-band, Wave-2 AC1200 ceiling AP with PoE
(802.3at) support. A782 model ('T750_V5.1' marking on PCB) is a smaller
version of the XD4200, with similar specification but lower TX power.

Specification:

- QCA9563 (775 MHz)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 2x 10/100/1000 Mbps Ethernet (QCA8334), with 802.3at PoE support (WAN)
- Wi-Fi 2.4 GHz:
  - XD4200: 2T2R (QCA9563), with ext. PA (SKY65174-21) and LNA
  - A782: 2T2R (QCA9563), with ext. FEM (SKY85329-11)
- Wi-Fi 5 GHz:
  - XD4200: 2T2R (QCA9886), with ext. FEM (SKY85728-11)
  - A782: 2T2R (QCA9886), with ext. FEM (SKY85735-11)
- LEDs:
  - XD4200: 5x (2x driven by SOC, 1x driven by AC radio, 2x Ethernet)
  - A782: 3x (1x RGB, driven by SOC and radio, 2x Ethernet)
- 1x button (reset)
- 1x UART (4-pin, 2.54 mm pitch) header on PCB
- 1x DC jack (12 V)

Flash instructions:

If your device comes with generic QSDK based firmware, you can login
over telnet (login: root, empty password, default IP: 192.168.188.253),
issue first (important!) 'fw_setenv' command and then perform regular
upgrade, using 'sysupgrade -n -F ...' (you can use 'wget' to download
image to the device, SSH server is not available):

  fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
  sysupgrade -n -F openwrt-...-yuncore_...-squashfs-sysupgrade.bin

In case your device runs firmware with YunCore custom GUI, you can use
U-Boot recovery mode:

1. Set a static IP 192.168.0.141/24 on PC and start TFTP server with
   'tftp' image renamed to 'upgrade.bin'
2. Power the device with reset button pressed and release it after 5-7
   seconds, recovery mode should start downloading image from server
   (unfortunately, there is no visible indication that recovery got
   enabled - in case of problems check TFTP server logs)

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(backported from commit e5d4c0966736287c7ade29c5ccaf6f1ad841b7db)

* uboot-envtools: ath79: add support for YunCore XD4200 and A782

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit 5d2a900163d0a161e6fa5e63436b57deea31287e)

* config: kernel: fix typo in HFSPLUG_FS_POSIX_ACL

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit 5f6833395293548f9fdf4897d9766417f2990bac)

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

* ramips: disable ASUS RT-N10+ B1 by default

Disable the ASUS RT-N10+ B1 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/1
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ar71xx: disable Netgear WNR612 v2 by default

Disable the Netgear WNR612 v2 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/4
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ar71xx: disable TP-Link TL-WA850RE v2 by default

Disable the TP-Link TL-WA850RE v2 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/9
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ar71xx: disable On Networks N150R by default

Disable the On Networks N150R image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/10
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ar71xx: disable Netgear WNR2000v4 by default

Disable the Netgear WNR2000v4 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/11
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ramips: disable D-Link DIR-300 B5/B6/B7 by default

Disable the D-Link DIR-300 B5/B6/B7 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/18
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ramips: disable D-Link DIR-645 by default

Disable the D-Link DIR-645 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/23
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ramips: disable Sitecom WL-351 by default

Disable the Sitecom WL-351 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/24
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ramips: disable TP-Link TL-WR840N v5 by default

Disable the TP-Link TL-WR840N v5 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/29
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ar71xx: disable TP-Link TL-WA850RE by default

Disable the TP-Link TL-WA850RE image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/30
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ramips: disable TP-Link TL-WA750RE by default

Disable the TP-Link TL-WA750RE image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/30
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* brcm47xx: disable Linksys E1000 v1 by default

Disable the Linksys E1000 v1 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/72
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ar71xx: disable TP-Link TL-WA855RE by default

Disable the TP-Link TL-WA855RE image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/72
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ramips: disable A5-V11 by default

Disable the A5-V11 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/72
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ramips: disable WR512-3GN 4MB variant by default

Disable the WR512-3GN 4MB image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/72
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* ramips: disable ZyXel Keenetic by default

Disable the ZyXel Keenetic images by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/72
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

* mtd: Activate LTO compile option

This decreases the size of the mtd application by 25% on MIPS BE.

old:
20,597 /sbin/mtd

new:
16,421 /sbin/mtd

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 1eb34b7287ed97ad1e2ae60a436babbb5c68076f)

* swconfig: Activate LTO compile option

This decreases the size of the swconfig application by 25% on MIPS BE.

old:
16,916 /sbin/swconfig

new:
12,565 /sbin/swconfig

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit e926681387891fe9af89d884ebc3dce4c8c7f450)

* usign: Activate LTO compile option

This decreases the size of the usign application by 16% on MIPS BE.

old:
24,597 /usr/bin/usign

new:
20,501 /usr/bin/usign

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 6ffd8a8f92ab5337ab967ab2922d7de7f0480bc9)

* 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>
(cherry picked from commit f1410902e6c089a53935ab44e83207e877445bc5)

* 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>
(cherry picked from commit 3f79aaa2979793c054eae2c8b4058c8c7fccdbe7)

* OpenWrt v19.07.0-rc2: adjust config defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* OpenWrt v19.07.0-rc2: revert to branch defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* 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]
(cherry picked from commit c7fb12beb1d347f1cedc7890dbe2d441f70ccf62)

* ucert: update to latest git HEAD

e4bd927 cast ucert_argv to proper type when passing to execv

Fixes warnings:

warning: passing argument 2 of 'execv' from incompatible pointer type
[-Wincompatible-pointer-types]
  254 |       execv(usign_argv[0], usign_argv)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 9c272dd3e42a51c1343ed4fad54ac38bb97349dd)

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

* 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>
(cherry picked from commit 30109782df3c74becd60dd13216346e1ea2fcc96)

* 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; backport to 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a065cd29bf2dfd1ce1f07becd65aef96cec658e7)

* 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; backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 3a55c7935d4efdc86575601cb4aa7bc94e3c5e44)

* 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>
(cherry picked from commit deb835849aeb713968aaa48bf046101140ab4825)

* 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.

This is backported to 19.07 for convenience, as other developers
backporting device support might not be aware that JCG_MAXSIZE in
kilobytes would not work there.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 0bf4d681d4f2e4bd3c3a61e7fe5dca2a40b1902f)

* 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>
(cherry picked from commit c642a97aa6b51352a718449cd715b92f94af4a5d)

* glibc: update to latest 2.27 commit (BZ #24228, BZ #24744, BZ #24699)

5f0d2e0491 [AArch64] Add ifunc support for Ares
e6b7252040 aarch64,falkor: Use vector registers for memcpy
c74b884f70 aarch64,falkor: Ignore prefetcher tagging for smaller copies
0fc5934ebd aarch64/strncmp: Use lsr instead of mov+lsr
e0a0bd3acc aarch64/strncmp: Unbreak builds with old binutils
638caf3000 aarch64: Improve strncmp for mutually misaligned inputs
d5f45a29ff aarch64/strcmp: fix misaligned loop jump target
7f690fafad aarch64: Improve strcmp unaligned performance
40df047b3b aarch64: Fix branch target to loop16
062139f233 aarch64: Optimized memcmp for medium to large sizes
f3e2add213 aarch64: Use the L() macro for labels in memcmp
22bd3ab40e posix: Fix large mmap64 offset for mips64n32 (BZ#24699)
bdd16894aa aarch64: handle STO_AARCH64_VARIANT_PCS
0b48caab9a aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS
949da7f2fd io: Remove copy_file_range emulation [BZ #24744]
f056ac8363 libio: do not attempt to free wide buffers of legacy streams [BZ #24228]
5f90e009b1 NEWS: add entries for bugs 22964, 24180, and 24531

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>

* glibc: update to latest 2.27 commit (BZ#23637)

5b4f7382af Add undef to fix test failure.
9456483fb2 Improve performance of memmem
373f8b06a3 Improve performance of strstr
4ec1b9e913 Fix strstr bug with huge needles (bug 23637)
ecd6271ed8 Speedup first memmem match
bba6b9288f Simplify and speedup strstr/strcasestr first match
7a4da6ef7a Improve strstr performance

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>

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

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

* lantiq: remove redundant WiFi LED on FRITZ!Box 7320

The led wireless trigger is already set correctly to phy0tpt through the
alias in the device tree.

Signed-off-by: Manuel Kock <github.web@manu.li>
[rephrased commit title]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 509894cffb7ec24ac21a381bed3c035efce42aeb)

* 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>
(cherry picked from commit 16b01fb1b9c99513c318109bef96a1a3545c57a0)

* odhcpd: optimize syslog priority values

e53fec8 treewide: optimize syslog priority values

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>

* 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>
(cherry picked from commit c881769a558b38ddd5977a50b67cd32c6d3f7d5e)

* 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>
(cherry picked from commit dcf48fda054c4bbc52f6106250a7e06ab8f5cbdd)

* 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>
(cherry picked from commit d0d7f5d9e49b8632f372c92e0339895fa10904f9)

* 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>
(cherry picked from commit c1db4d9c5655e3c74ffdbb6a6a3367269f65c55f)

* 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>
(cherry picked from commit 411e824ec371a322b975e90af5a1f32760a61720)

* 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>
(cherry picked from commit 414d027ae8ac05ec9aa06bc50afd5458c2da02fc)

* 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>
(cherry picked from commit 2105354968ed9698709d220ec446b6d9c27da3a5)

* 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>
(cherry picked from commit e964338110526b3692847769343816cd2f853d18)

* 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>
(cherry picked from commit 01d39cd18c4035e362f179548cd2c051aac03042)

* 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>
(cherry picked from commit c3aa33bf705027751b344bc668541e5d08ed9495)

* mac80211: brcm: add support for BCM4359 SDIO chipset

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 17e2246eca901fec79fbac5b7a90f68f60785c4e)

* ramips: fix USB LED for Belkin F9K1109v1

Device support for Belkin F9K1109v1 was added using set_usb_led()
although this was removed in 772b27c20736 ("ramips: set F5D8235 v1
usb led trigger via devicetree").

Use ucidef_set_led_usbport() instead.

Fixes: f2c83532f92c ("ramips: add support for Belkin F9K1109v1")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rephrase commit title and message, backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 1f455418ef1ea67fda710e1b86a9e021bb4a2413)

* ath79: fix MAC address setup for TP-Link TL-WDR3600/TL-WDR4300

The current ethernet MAC address setup of TL-WDR4300 board is different
from the setup of stock firmware:

OpenWrt: lan = label_mac -2, wan = label_mac -2
  stock: lan = label_mac,    wan = label_mac +1

The full address assignment is as follows:
LAN  label
WAN  label + 1
5G   label
2G   label - 1

This patch changes all devices using TL-WDR4300 board:
TL-WDR3600 v1 (checked on device)
TL-WDR4300 v1 (checked on device)
TL-WDR4300 v1 (IL)

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rephrase/extend commit title/message, backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a4260eaab7744c8e3f1f7a62a61aab5e3b562342)

* ar71xx: fix MAC address setup for TL-WDR4300 board

The current ethernet MAC address setup of TL-WDR4300 board is different
from the setup of stock firmware:

OpenWrt: lan = label_mac -2, wan = label_mac -2
  stock: lan = label_mac,    wan = label_mac +1

This patch applies to all devices using TL-WDR4300 board:
TL-WDR3600 v1
TL-WDR4300 v1
TL-WDR4300 v1 (IL)
TL-WDR4310 v1
Mercury MW4530R v1

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 9b02d32e34df2bb8821ec6f08f525bee22d0d1ba)

* uhttpd: update to latest Git HEAD

5f9ae57 client: fix invalid data access through invalid content-length values

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f34f9a414dd32311bda950776eb77e63c0c772cb)

* uhttpd: reset PKG_RELEASE

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 97af1fc979d0683649c6bea8a9245a6a9fa5413a)

* lantiq: fix phys led

led2l and led2h value is incorrectly set by led3l and led3h.
Bug was introduced in commit: 863e79f8d5544a8a884375d7e867f350fddca9b9

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
Fixes: 863e79f8d554 ("lantiq: add support for kernel 4.9")
(cherry picked from commit 692390225d76de8f2daf582454e74942b82d090a)

* toolchain/gcc: correct the check expr for newer clang

This fixes gcc build error within clang 11.0, it tweaks the version
string from LLVM to clang.

Signed-off-by: Yorkie Liu <yorkiefixer@gmail.com>
(cherry picked from commit 65a561fd0919eafff2363ae8324db64be2a57f77)

* toolchain/gcc: Backport patch to fix unconditional MULTIARCH_DIRNAME

This backports the patch for GCC PR target/89587 (gcc's rs6000
configuration unconditionally sets MULTIARCH_DIRNAME, even when
multiarch is disabled).

This currently affects apm821xx and may cause issues when
cross-compiling packages, e.g. Python 3[1].

This includes patches for GCC 8 (with the changelog diff removed);
this change is already included in GCC 9.2 and 7.5.

[1]: https://github.com/openwrt/packages/issues/10552

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
[Removed patch for GCC 7.4.0, GCC 7.5.0 already contains this]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c102f702e7dc976c2ad2c04c0ce4462373e62365)

* adb: fix for SuperSpeed devices

The USB descriptor parsing in adb fails to detect SuperSpeed devices
because of the SuperSpeed Endpoint Companion Descriptor.  This
cherry-picks the upstream fix for the problem.

Unfortunately there never were a release with this fix before the
conversion to C++, so upgrading to a newer version isn't an option.

This makes adb work with SuperSpeed devices like the Sierra Wireless
EM7565.  Tested and verified.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit d034a1f4577108a465e8347d11a51dc0e5a29298)

* cmake: Install host packages to lib instead of lib64

Several CMake packages such as log4cplus and protobuf(-c) install to
lib64 instead of lib on some hosts. This completely breaks rpath linking.
Override it globally to avoid fixing each package individually.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Tested-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry picked from commit 383abffb1179a142b4c8f86559baad5b24d391c3)

* kernel: fix *-gpio-custom module unloading

Unloading and reloading the modules fails, as platform_device_put() does not
release resources fully.

root@OpenWrt:/# insmod i2c-gpio-custom bus0=0,18,0,5
[  196.860620] Custom GPIO-based I2C driver version 0.1.1
[  196.871162] ------------[ cut here ]------------
[  196.880517] WARNING: CPU: 0 PID: 1365 at fs/sysfs/dir.c:31 0x80112158
[  196.893431] sysfs: cannot create duplicate filename '/devices/platform/i2c-gpio.0'
...
[  197.513200] kobject_add_internal failed for i2c-gpio.0 with -EEXIST, don't try to register things with the same name in the same directory.

This patch fixes it by replacing platform_device_put() to
platform_device_unregister().

Fixes: da7740853715 ("i2c-gpio-custom: minor bugfix")
Fixes: 3bc81edc70e8 ("package: fix w1-gpio-custom package (closes #6770)")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit a22b7a60d98836343c4f7b9ec0fcae68d9131522)

* scripts/dowload.pl: add archive.apache.org to apache mirror list

apache mirrors holds only latest releases, to download
older releases, one must use archive.apache.org to get
them.

Signed-off-by: Jiri Kastner <cz172638@gmail.com>
(cherry picked from commit dc34c695c4faa46efc6e2367a2ba06a47caa4840)

* kernel: remove LINUX_4_9 dependency of kmod-dax

This patch resolves recursive dependency warning on a feed package:

$ make defconfig
Collecting package info: done
tmp/.config-package.in:104721:error: recursive dependency detected!
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
tmp/.config-package.in:104721:symbol PACKAGE_nfs-kernel-server depends on NFS_KERNEL_SERVER_V4
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
feeds/packages/net/nfs-kernel-server/Config.in:4:symbol NFS_KERNEL_SERVER_V4 depends on PACKAGE_nfs-kernel-server
#
# configuration written to .config
#

19.07 branch uses kernel 4.14 only, so CONFIG_LINUX_4_9 symbol is not
needed anyway.

Ref: https://github.com/openwrt/packages/issues/10490

Signed-off-by: Sungbo Eo <mans0n@gorani.run>

* libubox: update to latest git HEAD

eb30a03 libubox, jshn: add option to write output to a file

Signed-off-by: Roman Yeryomin <roman@advem.lv>
(cherry picked from commit c0e7ec91a0927002942631bbc995b90f5f7dd7ed)

* libubox: bump to version 2019-10-29

It contains a single change to vlist.h header file: "vlist: add more
macros for loop iteration".  This is needed for newer version of fstools

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit 51e76247762d265d4a4aac33456876b83b0cca25)

* fstools: update to latest Git HEAD

4327ed4 mkdev: Avoid out of bounds read
9b3eb63 libblkid-tiny: use blkid_probe_set_utf8label for label set
c9d0462 libblkid-tiny: adds blkid_probe_set_utf8label support

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 541a3210707d1fc4b439ac61dc06816dcec2ab10)

* fstools: bump to version 2019-11-03

2f2a09a block: mount_device: err log only when mp deviates from spec
da4edc1 block: mount_device: skip extroot earlier
32c3126 block: mount_action: handle mount/umount deps
fb0700f block: support hierarchical mount/umount
1212b5b block: umount: skip / unless -a is given
eda8b3f block: use fsck.fat instead of dosfsck
d05276d libblkid-tiny: ntfs: fix use-after-free

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit e4af39d56395738d86daa4babb379ab605b4d277)

* fstools: update to latest git HEAD

111a43f libblkid-tiny: vfat: Change parsing label in special cases
f43a1aa libblkid-tiny: vfat: Fix reading labels which starts with byte 0x05
157924d libblkid-tiny: add blkid_probe_set_id_label() stub
0c5761f libblkid-tiny: use separated buffer for each block device read
b82c5c1 libblkid-tiny: add functions for allocating & freeing probe struct
12851d6 blockd: don't flush devices list on "hotplug" call
5ea47fe blockd: fix vlist memory corruption

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 4ebc9dc9c4faf8d9abc4197a74b892a66d9c1bcb)

* fstools: update to latest git HEAD

b4e25d5 libblkid-tiny: fix symbol collision with full libblkid

Fixes: FS#2691, FS#2692
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 5f4244150f99d7bf72a96ec4d9c1055386e66b53)

* kernel: ath10k-ct: provide a build variant for small RAM devices

According to many bugreports [0][1][2] the default ath10k-ct kernel
module is unusable on devices with just 64 MiB RAM or with 128 MiB and
dual ath10k cards. The target boards boot but eventually oom-killer
starts to interfere with normal operation, so the current state is
effectively broken.

Since the two patches in question have a performance impact (and
possibly some other unexpected side-effects) a dedicated build variant
is added so that users of the low RAM devices can still benefit from all
the ath10k-ct advantages.

According to testing [3] results, the issue can be experienced even with
"a 256MB device with three radios". Measured performance impact of
implementing small buffers was lowering "the maximum 5 GHz throughput on
an IPQ40xx device without RPS/XPS optimizations from 494/432 Mbit/s for
TCP transfers (download/upload) to 438/343 Mbit/s"

The patches were apparently inspired by QSDK tweaks used by ODMs for the
affected devices.

[0] http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020573.html
[1] https://github.com/openwrt/openwrt/pull/1077
[2] https://bugs.openwrt.org/index.php?do=details&task_id=2664
[3] https://github.com/freifunk-gluon/gluon/pull/1440#issue-195607701

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
[Remove double CONFIG_ATH10K-CT_LEDS entry]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 1ac627024de916eb157659caf49f93fa89d3b19a)

* ath10k-firmware: Add kmod-ath10k-ct-smallbuffers to depends

Only select ath10k-ct-regular when smallbuffers version was not
selected.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 80f06cb601160534f20e61d476dcedba77d5a47d)

* kernel: bump 4.14 to 4.14.159

Refreshed all patches.

Remove upstreamed:
- 302-0002-dmaengine-dw-implement-per-channel-protection-contro.patch

Fixes:
- CVE-2019-19332

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

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

* ath79: use ath10k-ct-smallbuffers for 64 MiB devices

Signed-off-by: Paul Fertser <fercerpav@gmail.com>

* kernel: bump 4.14 to 4.14.160

Refreshed all patches.

Compile-tested on: ipq40xx, ath79
Runtime-tested on: ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* ipq40xx: use ath10k-ct-smallbuffers for 128 MiB devices

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
(cherry picked from commit 0b7d779dcfc57507ab1d06ce6f1052d25e9de017)

* ramips: remove bogus ralink,mtd-eeprom with offset 0x4

Several devices in mt76x8 subtarget use the following line to set
up wmac in their DTS(I) files:

ralink,mtd-eeprom = <&factory 0x4>

This is strange for several reasons:
- They should use mediatek,mtd-eeprom on this SOC
- The caldata is supposed to start at 0x0
- The parent DTSI mt7628an.dtsi specifies mediatek,mtd-eeprom anyway,
  starting from 0x0
- The offset coincides with the default location of the MAC address
  in caldata

Based on the comment in b28e94d4bfa1 ("ramips: MiWiFi Nano fixes"),
it looks like the author for this device wanted to actually use
mtd-mac-address instead of ralink,mtd-eeprom. A check on the same
device revealed that actually the MAC address start at offset 4 there,
so the correct caldata offset is 0x0.

Based on these findings, and the fact that the expected location on
this SOC is 0x0, we remove the "ralink,mtd-eeprom = <&factory 0x4>"
statement from all devices in ramips (being only mt7628an anyway).

Thanks to Sungbo Eo for finding and researching this.

Reported-by: Sungbo Eo <mans0n@gorani.run>
Fixes: b28e94d4bfa1 ("ramips: MiWiFi Nano fixes")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 09d38a3bc328d122b0d84fcf6bb53d2bce7373b6)

* mac80211: add pcie apsm backport changes

Required for newer versions of mt76

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit d64daf7026ce47788f12130462a3107bdab8718f)

* mac80211: add patch to include local BSS rx time in survey information

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 6a3739dc42c1d9626e5784d9316c56962bd8f016)

* mac80211: fix build without CONFIG_PCI

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit fa37dbbc43db23a0ce7256f47943f38a1dcc9027)

* rt2x00: add throughput LED trigger

This adds a (currently missing) throughput LED trigger for the rt2x00
driver. Previously, LED triggers had to be assigned to the netdev, which
was limited to a single VAP.

Signed-off-by: David Bauer <mail@david-bauer.net>
Tested-by: Christoph Krapp <achterin@googlemail.com>
(cherry picked from commit 985ec835aea100e9245baaef8ebb15628601fe5e)

* ramips: add LED trigger for TL-WR902AC v3 WAN LED

This adds an LED trigger for the WAN LED on top of the TP-Link
TL-WR902AC v3. 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 labled LAN.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit c48b571ad708b9f66efb0c2942291c2d8f1d7780)

* ramips: fix inverted reset button for Ravpower WD03

The button events "pressed" and "released" were switched. Tested with v18.06.4.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
(cherry picked from commit 3e1325b219fced91f01d5594503f61d326a93b90)

* ramips: convert TP-Link MT7620 boards to tpt trigger

This converts all MediaTek MT7620 boards from TP-Link to use the now
supported WiFi throughput LED trigger. This way, the LED state now
covers all VAPs regardless of their name.

Also align all single-WiFi LEDs to represent the state of the 2.4GHz
radio. This was not always the case previously, as later-added support
for the MT7610 altered the phy probing order.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 1e7c6381f0058e49caab8de54eaad4862732f95d)

* mt76: update to the latest openwrt-19.07 version

330e832 mt76: mt76x0: fix default mac address overwrite
f97c33e mt76: mt7603: fix input validation issues for powersave-filtered frames
875f6d7 mt76: mt7615: increase MCU command timeout
abd7d86 mt76: clear skb pointers from rx aggregation reorder buffer during cleanup
96c7b07 mt76: eeprom: add support for big endian eeprom partition
19c8e20 mt76: fix possible undetected invalid MAC address
df64c56 mt76: Off by one in mt76_calc_rx_airtime()
1702b24 mt76: mt7603: reset STA_CCA counter setting the channel
383a631 mt76: mt76x0u: do not reset radio on resume
2dcfbdd mt76: disable bh in mt76_dma_rx_poll
947d20d mt76: fix rx dma ring descriptor state on reset
f3348f5 mt7615: replace sta_state callback with sta_add/sta_remove
faf5e6f mt76: mt7615: read {tx,rx} mask from eeprom
db78ee0 mt76: move mt76_get_antenna in mt76_core module
7121e16 mt76: fix possible out-of-bound access in mt7615_fill_txs/mt7603_fill_txs
5dfb0ec mt76: mt7615: disable radar pattern detector during scanning
e2f90ad mt76: move interface_modes definition in mt76_core module
cfdb751 mt76: mt7615: add ibss support
e0731a8 mt76: move SUPPORTS_REORDERING_BUFFER hw property in mt76_register_device
a85c06c mt76: use mt76_dev in mt76_is_{mmio,usb}
ea19cd7 mt76: Remove set but not used variable 'idx'
3cbaf81 mt76: mt76u: rely on a dedicated stats workqueue
20f0589 mt76: mt76u: rely on usb_interface instead of usb_dev
f2be00b mt76: dma: fix buffer unmap with non-linear skbs
c14d656 mt76: mt76x2e: disable pcie_aspm by default
58e1e96 mt76: mt7615: remove unneeded semicolon
c93a2d1 mt76: mt76x02u: update ewma pkt len in mt76x02u_tx_prepare_skb
1987b74 mt76: mt76x0: remove 350ms delay in mt76x0_phy_calibrate
50b1e9b mt76: refactor cc_lock locking scheme
d868638 mt76: remove obsolete .add_buf() from struct mt76_queue_ops
dc14ac6 mt7615: remove vif sta from poll list on interface remove
2a0a191 mt7603: remove vif sta from poll list on interface remove
d3a5895 mt76: fix a-mpdu boundary detection issue for airtime reporting
391e148 mt76: add sanity check for a-mpdu rx wcid index
01642d8 mt76: mt76x02: fix use-after-free in tx status code handling airtime
c11a4ad mt76: mt76x0: eeprom: add support for MAC address from OF
d94cc81 mt76: drop rcu read lock in mt76_rx_aggr_stop
7d8764d mt76: avoid enabling interrupt if NAPI poll is still pending
5b02a07 mt76: add missing locking around ampdu action
71c2ef0 mt76: fix aggregation stop issue
6f7d0f5 mt76: fix use-after-free bug in airtime fairness code
8f22de0 mt76: do not use devm API for led classdev
e7199f9 mt76: enable airtime fairness
81f2be0 mt76: mt7615: track tx/rx airtime for airtime fairness
2579122 mt76: mt7615: introduce mt7615_mac_wtbl_update routine
d91f7c1 mt76: mt7615: fix survey channel busy time
028071d mt76: mt7615: report tx_time, bss_rx and busy time to mac80211
0e5050e mt76: mt76x02: track approximate tx airtime for airtime fairness and survey
3429cc7 mt76: mt76x02: move MT_CH_TIME_CFG init to mt76x02_mac_cc_reset
de118bb mt76: unify channel survey update code
fdf0163 mt76: mt7603: switch to a different counter for survey busy time
ee31030 mt76: mt7603: track tx airtime for airtime fairness and survey
f34b1ae mt76: track rx airtime for airtime fairness and survey
a1d6891 mt76: store current channel survey_state in struct mt76_dev
b042987 mt76: rename mt76_driver_ops txwi_flags to drv_flags and include tx aligned4
2027763 mt76: report rx a-mpdu subframe status
1ddcadb mt76: mt7603: remove q_rx field from struct mt7603_dev
ea3ab68 mt76: mt7615: fix mt7615 firmware path definitions
081926a mt76: mt7603: collect aggregation stats
696c0fc mt76: mt7615: collect aggregation stats
23e8aed mt76: move aggr_stats array in mt76_dev
1118b5e mt76: mt7615: add queue entry in debugfs
fbc59e6 mt76: move queue debugfs entry to driver specific code
0b01ace mt76: mt76x02u: move mt76x02u_mac_start in mt76x02-usb module
c394887 mt76: mt76x0u: reset counter starting the device
0355b7a mt76: mt76x2: move mt76x02_mac_reset_counters in mt76x02_mac_start
f3792b5 mt76: mt76x02: move mac_reset_counter in mt76x02_lib module
63e8152 mt76: mt7615: enable SCS by default
b140512 mt76: mt76x0e: make array mt76x0_chan_map static const, makes object smaller
a20c20b mt76: usb: add lockdep_assert_held in __mt76u_vendor_request
0308d75 mt76: remove empty flag in mt76_txq_schedule_list
0efbc5d mt76: use cancel_delayed_work_sync in mt76_rx_aggr_shutdown
9c5df3c mt76: remove aggr_work field from struct mt76_wcid
8739f87 mt76: mt7615: fix control frame rx in monitor mode
e07407a mt7603: fix build with CONFIG_KERNEL_DYNAMIC_DEBUG=y
c7f8214 mt76: mt7615: add support to read temperature from mcu
6797378 mt76: mt7615: introduce mt7615_txwi_to_txp utility routine
496c78e mt76: mt76x0: remove unneeded return value on set channel
1d2acd5 mt76: mt76x0: remove redundant chandef copy
0167bfa mt76: make mt76_rx_convert static

Signed-off-by: David Bauer <mail@david-bauer.net>

* ramips: add system LED indicators for TP-Link C20i

Use the WPS LED to indicate system status like it is done for the
TP-Link Archer C2 v1 and many other boards.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit a272fafc9c507820cc62aa12464588bac45f250a)

* ramips: fix Archer C2 v1 5GHz MAC address

The TP-Link Archer C2 v1 previously had a generic Ralink MAC address set
for the 5GHz radio (MT7610), as the caldata does only contain a generic
MAC address.

Set the MAC address from the vendor firmware for the 5GHz radio to
assign unique MAC addresses to every device.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit dcc923a4c45b48fcbef4f3964f74fbcaabad335e)

* ramips: fix Archer C20i wireless MAC address

The TP-Link Archer C20i previously had a generic Ralink MAC address set
for both radios, as the caldata does only contain a generic MAC address.

Set the MAC address from the vendor firmware for both radios to assign
unique MAC addresses to every device.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 3b013dcdf8d8aa0e3601e3aac30342318025e32a)

* mt76: fix incorrect firmware path

The mt76 driver does load the firmware for the MT7615 chip from
/lib/firmware/mediatek instead of /lib/firmware. The driver loads the
firmware from this path since mt76 commit
ea3ab68c7589 ("mt76: mt7615: fix mt7615 firmware path definitions").

Fixes: a2e2c40b5ebd ("mt76: update to the latest openwrt-19.07 version")

Reported-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: David Bauer <mail@david-bauer.net>
Tested-by: Stijn Segers <foss@volatilesystems.org>

* mt76: update to the latest openwrt-19.07 version

8a78567 mt76: fix compilation warning in mt76_eeprom_override()

Signed-off-by: David Bauer <mail@david-bauer.net>

* wolfssl: bump to 4.3.0-stable

This update fixes many bugs, and six security vulnerabilities, including
CVE-2019-18840.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit d5ede68f8b67f8fa2b4102b90e5dd3722172299a)

* kernel: bump 4.14 to 4.14.161

Refreshed all patches.

Compile-tested on: ipq40xx, ramips
Runtime-tested on: ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* kernel: bump 4.14 to 4.14.162

Refreshed all patches.

Compile-tested on: ipq40xx, ramips
Runtime-tested on: ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* sunxi: Turn on CONFIG_PINCTRL_SUN4I_A10 for A20

CONFIG_PINCTRL_SUN4I_A10 controls both the A10 and the A20 enablong of
the pinctrl driver, this is necessary since upstream commit
5d8d349618a9464714c07414c5888bfd9416638f ("pinctrl: sunxi: add A20
support to A10 driver") which has been included in v4.13 and onwards.

Fixes: ad2b3bf310f7 ("sunxi: Add support for kernel 4.14")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
(cherry picked from commit 32e4eaef1b4c2a7fa44787813fdf715b2ba500d9)

* base-files: upgrade: add case to export_bootdevice

The factory uboot of the Turris Omnia boots with "root=b301", and we
instruct new users to sysupgrade from there (e.g. method 1, step 7).
Currently, this will fail with "Unable to determine upgrade device".
Add a new case to export_bootdevice, which parses the hex argument.

Ref: https://github.com/openwrt/openwrt/pull/2340#issuecomment-561317688
Fixes: 2e5a0b81ec29 ("mvebu: sysupgrade: sdcard: keep user added partitons")
Reviewed-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 3a4f587c465a0531b820ca1a3e90eb05c4927b68)

* ubus: update to version 2019-12-27

Contains following changes:

 041c9d1c052b ubusd/libubus-io: fix socket descriptor passing
 8f2292478c57 ci: enable unit testing
 a1523d76b016 fix blob parsing vulnerability by using blob_parse_untrusted
 c60583743ccf ubus_monitor: workaround possibly false positive uses of memory after it is freed
 dac6c7c575ac ubusd_monitor: fix possible null pointer dereference
 060dfbb26da3 ubus_common: remove duplicate ARRAY_SIZE and add missing include
 c5f2053dfcfd workaround possibly false positive uses of memory after it is freed
 72be8e93f07d lua: ubus_lua_do_subscribe: fix copy&paste error
 a995b1e68129 lua: workaround false positive dereference of null pointer
 08f17c87a000 add fuzzer and cram based unit tests
 c413be9b376c refactor ubusd.c into reusable ubusd_library
 afd47189e864 examples: remove dead increments
 b2e544238672 add initial GitLab CI support
 058f4e9526ed libubus: fix incompatible pointer types assigment
 d2e026a33df8 iron out all extra compiler warnings
 5d7ca8309d0a ubusd/libubus-io: fix variable sized struct position warning
 d61282db5640 ubusd: fix comparison of integers of different signs
 90fb16234c22 cmake: enable extra compiler checks
 2e051f628996 ubus: Support static builds
 588baa3cd784 ubusd: retry sending messages on EINTR
 76ea27a62774 libubus: attempt to receive data before calling poll
 4daab27d004f libubus: do not abort recv_retry before completing a message

and bumps ABI_VERSION to 20191227.

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>

* libubox: update to version 2019-12-28

Contains following changes:

 cd75136b1342 blobmsg: fix wrong payload len passed from blobmsg_check_array
 eb7eb6393d47 blobmsg: fix array out of bounds GCC 10 warning
 86f6a5b8d1f1 blobmsg: reuse blobmsg_namelen in blobmsg_data
 586ce031eaa0 tests: fuzz: fuzz _len variants of checking methods
 b0e21553ae8c blobmsg: add _len variants for all attribute checking methods
 cd3059796a57 Replace use of blobmsg_check_attr by blobmsg_check_attr_len
 143303149c8b Ensure blob_attr length check does not perform out of bounds reads
 f2b2ee441adb blobmsg: fix heap buffer overflow in blobmsg_parse
 4dfd24ed88c4 blobmsg: make blobmsg_len and blobmsg_data_len return unsigned value
 2df6d35e3299 tests: add test cases for blobmsg parsing
 8a34788b46c4 test: fuzz: add blobmsg_check_attr crashes
 478597b9f9ae blob: fix OOB access in blob_check_type
 325418a7a3c0 tests: use blob_parse_untrusted variant
 0b24e24b93e1 blob: introduce blob_parse_untrusted
 6d27336e4a8b blob: refactor attr parsing into separate function
 833d25797b16 test: fuzz: add blob_parse crashes
 09ee90f8d6ed tests: add test cases for blob parsing
 436d6363a10b tests: add libFuzzer based tests
 bf680707acfd tests: add unit tests covered with Clang sanitizers
 f804578847de cmake: add more hardening compiler flags
 46f8268b4b5b blobmsg/ulog: fix format string compiler warnings
 eb216a952407 cmake: use extra compiler warnings only on gcc6+
 07413cce72e1 tests: jshn: add more test cases
 26586dae43a8 jshn: fix missing usage for -p and -o arguments
 8e832a771d3a jshn: fix off by one in jshn_parse_file
 cb698e35409b jshn: jshn_parse: fix leaks of memory pointed to by 'obj'
 c42f11cc7c0f jshn: main: fix leak of memory pointed to by 'vars'
 93848ec96dc5 jshn: refactor main into smaller pieces
 9b6ede0e5312 avl: guard against theoretical null pointer dereference
 c008294a8323 blobmsg_json: fix possible uninitialized struct member
 0003ea9c45cc base64: fix possible null pointer dereference
 8baeeea1f52d add assert.h component
 b0a5cd8a28bf add cram based unit tests
 1fefb7c4d7f9 add initial GitLab CI support
 c955464d7a9b enable extra compiler checks
 6228df9de91d iron out all extra compiler warnings

and bumps ABI_VERSION to 20191228.

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>

* base-files: sysupgrade: exit if the firmware download failed

Sysupgrade process shouldn't continue if the firmware image couldn't be
downloaded.

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020940.html
Reported-by: Petr Novák <petrn@me.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit cf3da66d2ce11a30ae2993b56276ade10c9bddb9)

* procd: update to version 2020-01-04

Contains following changes:

 a5af33ce9a16 instance: strdup string attributes
 d2e8bf6ef7cf system: watchdog_set: fix misleading indentation
 9814807bd71c system: sysupgrade: fix possibly misleading error
 c7a2db3c1eb6 system: sysupgrade: rework firmware validation
 ea45c4a0f07c system: fix failing image validation due to EINTR
 4fde95506243 cmake: fix lookup of external libraries
 5ed190aae1b3 jail: remove accidentally added lines
 52c5c1980ba3 jail: set user and group inside jail
 3aa051b44177 system: sysupgrade: close input side of pipe before reading
 f47622e89c4d instance: Warn about unexpected number of parameters
 564ecdfd9cc4 instance: ujail: Fix allocated size for no_new_privs parameter
 7fb2e1dfa221 procd: simplify code in procd_inittab_run
 4a127c3c60af procd: replace exit(-1) with exit(EXIT_FAILURE)
 bc0a73eaad58 procd: add upgraded binary to .gitignore
 ba4c4dbbbd65 procd: add start-console support
 3e39fe539490 procd: shift arguments for askfirst only once
 5d6282906baf procd: skip respawn in case device disappeared
 d27949f12fd7 procd: guard fork_worker calls
 258aa04328a2 procd: Add cached and available to memory table
 8e9fb51fa66e procd: Switch to nanosleep
 c844ace9729a system: Fix possible integer overflows

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>

* fstools: update to latest Git HEAD

823faa0 block: re-discover mtd devices on extroot mount retry

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 22a178e89282c7bd5bb181fc5c2c5cb6ff2403c8)

* package: remove accidentally added symlink

In the commit f3439c401900 ("procd: update to version 2020-01-04") I've
somehow managed to add local testing symlink to the uledd package, so
removing it now.

Signed-off-by: Petr Štetiar <ynezz@true.cz>

* ramips: remove duplicate dts nodes of MediaTek LinkIt Smart 7688

There are two identical wmac nodes in the dts file of MediaTek
LinkIt Smart 7688, so delete one of them.

Signed-off-by: Jack Chen <redchenjs@live.com>
(cherry picked from commit 4be271a4867dcf57a122eeb7b42407e7a506915e)

* ca-certificates: provide ca-certs by both ca-certificates and ca-bundle

- both packages provide ca-certs
- make ca-bundle the default provider

This should allow easy transition between these two forms of CA certificates storage

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
(cherry picked from commit dd299805ad18472a8245b4524a25e4381e166057)

* ramips: Fix sysupgrade for Xiaomi mir3g

Without this change sysupgrade from 18.06 to 19.07 is only possible with
the -F option.
In OpenWrt 18.06 the nand_do_platform_check() function is called with
the board name mir3g only, if the tar does not use mir3g it will fail.
OpenWrt 19.07 and later support the metadata with the supported_devices
attribute to allow renaming. Do the renaming of the target between 19.07
and master like it is done for some other boards.

I tested the following sysupgrades successfully without -F
18.06 -> 19.07
19.07 -> master
master -> 19.07

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* x86: fix missing led variable warning during boot

Fixes following warning during the boot:

 WARNING: Variable 'led' does not exist or is not an array/object

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 5816caad26ae294f0adb4ed07ed53dcba7277c33)

* dnsmasq: Fix potential dnsmasq crash with TCP

This is a backport from the dnsmasq master which should fix a bug which
could cause a crash in dnsmasq.

I saw the following crashes in my log:
[522413.117215] do_page_fault(): sending SIGSEGV to dnsmasq for invalid read access from 2a001450
[522413.124464] epc = 004197f1 in dnsmasq[400000+23000]
[522413.129459] ra  = 004197ef in dnsmasq[400000+23000]
This is happening in blockdata_write() when block->next is
dereferenced, but I am not sure if this is related to this problem or if
this is a different problem. I am unable to reproduce this problem.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 414d0541381d432e69190f394dfe2a6e8122d6bb)

* ramips: Fix sysupgrade for Xiaomi mir3g

This mostly reverts the original commit e9929ebeeaef ("ramips: Fix
sysupgrade for Xiaomi mir3g") and replaces it with setting the
BOARD_NAME to the old value.

This way the folder in the tar will be named sysupgrade-mir3g and not
sysupgrade-xiaomi_mir3g and the sysupgrade in OpenWrt 18.06 can find it.

Without this change sysupgrade from 18.06 to 19.07 is only possible with
the -F option.

I tested the following sysupgrades successfully without -F
18.06 -> 19.07
19.07 -> master
master -> 19.07

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* OpenWrt v19.07.0: adjust config defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* OpenWrt v19.07.0: revert to branch defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

* ethtool: fix PKG_CONFIG_DEPENDS

Add missing CONFIG_ prefix.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 41c19dd542973dbc1336ecceaa32777506933cdf)

* ath79: add support for the TP-LINK CPE220 V3

This adds support for a popular low-cost 2.4GHz N based AP

Specifications:
SoC: Qualcomm Atheros QCA9533 (650MHz)
RAM: 64MB
Storage: 8 MB SPI NOR
Wireless: 2.4GHz N based built into SoC 2x2
Ethernet: 2x 100/10 Mbps, integrated into SoC

Installation:
Flash factory image through stock firmware WEB UI
or through TFTP
To get to TFTP recovery just hold reset button while powering on for
around 4-5 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP adress:192.168.0.254

This also applies some minor changes to the …
@Djfe Djfe mentioned this pull request Jan 28, 2023
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: enhancement The changeset is an enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants