Commit Graph

21427 Commits (v19.07.3_mercusys_ac12_duma)

Author SHA1 Message Date
Thibaut VARÈNE 85e04e9f46 generic: platform/mikrotik: fix LZOR support
31e99fe3da which introduced this code was unfortunately untested.
This commit fixes a number of issues and works around the fact that in
this particular scheme, the LZO payload may be padded at the end which
will trigger a harmless lzo decompression error.
This commit also disambiguates the debug printks.

Tested-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Fixes: 31e99fe3da ("generic: platform/mikrotik: support LZOR encoding")
(cherry picked from commit 2ea481193c)
4 years ago
Adrian Schmutzler 6ffd4d8a4d ar71xx: remove hard-coded folder name from Mikrotik RB upgrade
So far, specifying "BOARD_NAME := routerboard" is required by the
upgrade code of Mikrotik NAND devices, as "sysupgrade-routerboard"
is hardcoded in platform_do_upgrade_mikrotik_rb().

This patch replaces the latter with a grep for the name like it
is already done in nand_upgrade_tar() in /lib/upgrade/nand.sh.

This should enable upgrades from ar71xx to ath79 without setting
BOARD_NAME for the latter.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(backported from commit 281785d74f)
4 years ago
Thibaut VARÈNE 4cd44e5dc7 ar71xx: mikrotik: mach-rbspi.c remove wlan id
Following on the previous commit, this patch removes useless id argument
from rbspi_wlan_init().

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 3fecb06fb1 ar71xx: mikrotik: bypass id check in __rb_get_wlan_data()
The id parameter in __rb_get_wlan_data() was incorrectly used on the
assumption that id "0" would always be tied to ath9k with RLE encoding
and positive id (in fact, only id "1" was valid) would always be tied to
("external") ath10k with LZO encoding.

Newer hardware revisions of supported devices prove this assumption to
be invalid, with ath9k caldata being now wrapped in MAGIC_ERD and LZO
compressed, so disable this check to allow newer hardware to correctly
decode caldata for ath9k. Since ath10k caldata is no longer pulled from
this implementation, this commit also disables the publication in sysfs
to avoid wasting memory.

Note: this patch assumes that ath9k caldata is never stored with the new
"LZOR" encoding scheme found on some ath10k devices.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE b36aa168d8 ar71xx: mikrotik: ath10k: use new sysfs driver
Fetch ath10k calibration data from backported mikrotik sysfs driver
which supports the newer "LZOR" encoding.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE fa2369e59b generic: platform/mikrotik: support LZOR encoding
Some newer MikroTik RouterBOARD devices use a new encoding scheme
for their WLAN calibration data. This patch provides support for
decoding this new scheme.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 612b64e6c4 ar71xx: enable mikrotik platform driver
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 511859de9b generic: mikrotik platform build bits
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE ddae86cc69 generic: routerboot sysfs platform driver
This driver exposes the data encoded in the "hard_config" flash segment
of MikroTik RouterBOARDs devices. It presents the data in a sysfs folder
named "hard_config". The WLAN calibration data is available on demand via
the 'wlan_data' sysfs file in that folder.

This driver permanently allocates a chunk of RAM as large as the
"hard_config" MTD partition (typically 4KB), although it is technically
possible to operate entirely from the MTD device without using a local
buffer (except when requesting WLAN calibration data), at the cost of a
performance penalty.

This driver does not reuse any of the existing code previously found in
routerboot.c.

This driver has been successfully tested on BE (ath79) and LE (ipq40xx
and ramips) hardware.

Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Tested-by: Baptiste Jonglez <git@bitsofnetworks.org>
Tested-by: Tobias Schramm <t.schramm@manjaro.org>
Tested-by: Christopher Hill <ch6574@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Lech Perczak ecea10f2b9 ath79: dts: add missing 'serial0' alias for TP-Link TL-MR3040v2
Out of all devices currently supported based on AR9331 chipset,
this one had the 'serial0' alias missing. Add it to fix setting of
/dev/console and login shell on the onboard UART.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit 94f3449977)
4 years ago
Chuanhong Guo d9244a1b5b generic: ar8216: fix unknown packet flooding for ar8229/ar8236
ar8229 and ar8236 don't allow unknown unicast/multicast frames and
broadcast frames to be flooded to cpu port. This isn't desired behavior
for swconfig as we treat it as a standalone switch.
Current code doesn't enable unicast frame flooding for ar8229 and uses
wrong setup for ar8236. This commit fixes both of them by enabling port
0 flooding for all unknown frames.

Fixes: FS#2848
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit 47f17b0662)
4 years ago
Matt Merhar 0974d59b5f kernel: backport fix for non-regular inodes on f2fs
Upstream commit dda9f4b9ca ("f2fs: fix to skip verifying block address
for non-regular inode").

On 4.14, attempting to perform operations on a non-regular inode
residing on an f2fs filesystem, such rm-ing a device node, would fail
and lead to a warning / call trace in dmesg. This fix was already
applied to other kernels upstream - including 4.19, from which the patch
was taken.

More info at https://bugzilla.kernel.org/show_bug.cgi?id=202495.

Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
(cherry picked from commit ee500186a5)
4 years ago
Adrian Schmutzler f40947a8c0 ath79: indicate boot/failsafe/upgrade for NanoBeam/Nanostation AC
Like for Ubiquiti PowerBeam 5AC Gen2, the highest RSSI LED can
be exploited to indicate boot/failsafe/upgrade for the NanoBeam AC
and Nanostation AC as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 80a094aaf3)
4 years ago
Adrian Schmutzler 65cf72d5d2 ath79: add SUPPORTED_DEVICES based on ar71xx for some devices
This adds some still-missing board names for old TP-Link devices
to ath79 SUPPORTED_DEVICES.

Fixes: FS#3017

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 522f6b7eee)
4 years ago
Petr Štetiar f9ef0c5705 kernel: bump 4.14 to 4.14.178
Refreshed all patches and removed upstreamed:

 oxnas/001-irqchip-versatile-fpga-Handle-chained-IRQs-properly.patch
 oxnas/002-irqchip-versatile-fpga-Apply-clear-mask-earlier.patch

Fixes: CVE-2020-12114 and CVE-2020-11669

Runtime-tested on: qemu-x86-64
Compile-tested on: ath79/generic, x86/64, imx6

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Chuanhong Guo 5feb0df9bb ramips: remove memory node for ZBT MT7621 devices
It's known that ZBT sells 256M variants of these routers. As a result,
our images won't be able to boot on these routers.
This commit removes memory node for them. With previously backported
memory detection patch, kernel is able to detect memory size itself.

Fixes: FS#3053
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Sungbo Eo b80a98ae7f ramips: remove unnecessary DEVICE_PACKAGES for Belkin F7C027
kmod-usb-dwc2 and kmod-usb-ledtrig-usbport are not target default packages, and
Belkin F7C027 does not have a USB port anyway. Just drop it.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 1dedad2a00)
4 years ago
Sungbo Eo bfe652c5bd oxnas: move service file to correct place
This service file has been misplaced from the very beginning.

Fixes: dcc34574ef ("oxnas: bring in new oxnas target")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 01961f163d)
4 years ago
Tomasz Maciej Nowak 67ed408af2 mvebu: cortexa9: correct cpu subtype
Armada 370  processors have only 16 double-precision registers. The
change introduced by 8dcc108760 ("toolchain: ARM: Fix toolchain
compilation for gcc 8.x") switched accidentally the toolchain for mvebu
cortexa9 subtarget to cpu type with 32 double-precision registers. This
stems from gcc defaults which assume "vfpv3-d32" if only "vfpv3" as mfpu
is specified. That change resulted in unusable image, in which kernel
will kill userspace as soon as it causing "Illegal instruction".

Ref: https://forum.openwrt.org/t/gcc-was-broken-on-mvebu-armada-370-device-after-commit-on-2019-03-25/43272
Fixes: 8dcc108760 ("toolchain: ARM: Fix toolchain compilation for
gcc 8.x")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit 2d61f8821c)
4 years ago
Tomasz Maciej Nowak dee8fcfe9f tegra: correct cpu subtype
Tegra 2 processors have only 16 double-precision registers. The change
introduced by 8dcc108760 ("toolchain: ARM: Fix toolchain compilation
for gcc 8.x") switched accidentally the toolchain for tegra target to cpu
type with 32 double-precision registers. This stems from gcc defaults
which assume "vfpv3-d32" if only "vfpv3" as mfpu is specified. That
change resulted in unusable image, in which kernel will kill userspace as
soon as it causing "Illegal instruction".

Ref: https://forum.openwrt.org/t/gcc-was-broken-on-mvebu-armada-370-device-after-commit-on-2019-03-25/43272
Fixes: 8dcc108760 ("toolchain: ARM: Fix toolchain compilation for
gcc 8.x")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit 43d1d88510)
4 years ago
Joel Johnson d8e0b015e8 mvebu: backport ClearFog SPI enablement
Backport Device Tree change first added in kernel 4.19 to enable the SPI
device on ClearFog devices by default. This is tested and working in
snapshot builds with kernel 5.4+, include the change in future 19.07
patch releases.

Signed-off-by: Joel Johnson <mrjoel@lixil.net>
4 years ago
Koen Vandeputte 0232f57e1a kernel: bump 4.14 to 4.14.176
Refreshed all patches.

Remove upstreamed:
- 0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch
- 600-ipv6-addrconf-call-ipv6_mc_up-for-non-Ethernet-inter.patch
- 003-ARM-dts-oxnas-Fix-clear-mask-property.patch

Fixes:
- CVE-2020-8647
- CVE-2020-8648 (potentially)
- CVE-2020-8649

Compile-tested on: cns3xxx, octeontx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Adrian Schmutzler 286c407c3d ath79: add SUPPORTED_DEVICES for TP-Link TL-WA901ND v2
This adds the board name from ar71xx to support upgrade without
-F for the TP-Link TL-WA901ND v2.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 508462a399)
4 years ago
Adrian Schmutzler 01b624e28e Revert "ramips: disable ZyXel Keenetic by default"
This reverts commit c38074de92.

Since ZyXEL Keenetic has actually 8 MiB flash as fixed in the
previous patch, we can re-enable it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Alexey Dobrovolsky 14c8ea0245 ramips: use full 8MB flash on ZyXEL Keenetic
ZyXEL Keenetic has 8MB flash, but OpenWrt uses only 4MB.
This commit fixes the problem.

WikiDevi page [1] says that ZyXEL Keenetic has FLA1: 8 MiB, there is
an article with specs [2] (in Russian).

[1] https://wikidevi.wi-cat.ru/ZyXEL_Keenetic
[2] https://3dnews.ru/608774/page-2.html

Fixes: FS#2487
Fixes: a7cbf59e0e ("ramips: add new device ZyXEL Keenetic as kn")

Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
(cherry picked from commit fea232ae8f)
4 years ago
Dan Haab 5b9b833f8c bcm53xx: add support for Luxul FullMAC WiFi devices
This prepares support for models XAP-1610 and XWR-3150. Flashing
requires using Luxul firmware version:
1) 8.1.0 or newer for XAP-1610
2) 6.4.0 or newer for XWR-3150
and uploading firmware using "Firmware Update" web UI page.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
(cherry picked from commit c459a6bf48)
4 years ago
Rafał Miłecki ab3549a870 bcm53xx: refactor board.d code in 02_network
1. Use functions for cleaner code
2. Always execute WAN interface generic code

Before this change WAN interface code wasn't executed on all devices due
to an early "exit 0".

Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit b51ea43f90)
4 years ago
Rafał Miłecki 35413b047c bcm53xx: sysupgrade: optimize building UBI image
Use "truncate" to adjust size of existing file instead of "dd" which
required creating a copy. This saves space on tmpfs. It may be as low
as 2.1 MiB when using OpenWrt default user space and way more (20+ MiB)
when flashing vendor firmware.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 8abefc8896)
4 years ago
Rafał Miłecki a89731ad7a bcm53xx: fix ASUS firmwares to use vendor format
Image building process was missing "asus-trx" step which resulted in raw
TRX files (without ASUS footer with device id).

Fixes: 0b9de8daa7 ("bcm53xx: add profiles for all other (SoftMAC) devices")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 0493d57e04)
4 years ago
Adrian Schmutzler 470f7c046c ath79: add support for TP-Link TL-WDR4310 v1
This device seems to be identical to the TL-WDR4300, just with
different release date/region and TPLINK_HWID.

Support is added based on the ar71xx implementation.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 676ca94c3c)
4 years ago
Baptiste Jonglez f5b3cd1539 ar71xx: Fix gigabit switch support for Mikrotik RB951G-2HnD
Without this patch, when using rev 3 of the Atheros AR9344 SoC, the
gigabit switch (AR8327) does not work or works very erratically.

This is a re-spin of http://patchwork.ozlabs.org/patch/419857/ with a
different PLL value, according to the feedback from several users
(including myself) as shown here:

  https://openwrt.org/toh/mikrotik/rb2011uias#tracking_reported_experience_with_suggested_patch_for_the_5_gige_ports

Performance is acceptable: testing L3 forwarding without NAT yields a
performance of 370 Mbit/s (iperf3 TCP) and 41 Kpps (iperf3 UDP with 64
bytes payload). Both tests show that 100% of CPU time is spent on softirq.

A similar fix for a different device (RB2011) was added in e457d22261
("Make GBit switch work on RB2011").

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
(cherry picked from commit 247043c968)
4 years ago
Adrian Schmutzler bdbda30384 ath79: add support for TP-Link TL-WA860RE v1
This ports support for the TL-WA860RE v1 range extender from ar71xx
to ath79.

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

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

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Sebastian Knapp <sebastian4842@outlook.com>
(cherry picked from commit 385f4868bc)
4 years ago
Adrian Schmutzler 2e6bfab8c5 ath79: add support for TP-Link TL-WA850RE v1
This ports support for the TL-WA850RE v1 range extender from ar71xx
to ath79.

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

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

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6eaea3a8ba)
4 years ago
Jan Alexander 27e77922a1 ar71xx: use status led for GL.iNet GL-AR750S
Use power led for device status.

The status led behavior has already been fixed in af28d8a539
("ath79: add support for GL.iNet GL-AR750S") when porting the
device to ath79. This fixes it for ar71xx as well.

Signed-off-by: Jan Alexander <jan@nalx.net>
[minor commit title/message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit d394c354ee)
4 years ago
David Bauer 81264ebb51 brcm2708: fix build failure
Build of the brcm2708 subtarget currently fails with the following error
message:

 arch/arm/lib/memset_rpi.S: Assembler messages:
 arch/arm/lib/memset_rpi.S:65: Error: garbage following instruction
  -- `orr DAT0,DAT0,lsl#8'
 arch/arm/lib/memset_rpi.S:67: Error: garbage following instruction
  -- `orr DAT0,DAT0,lsl#16'
 scripts/Makefile.build:427: recipe for target 'arch/arm/lib/memset_rpi.o'
 failed

Using the assembly notation from master fixes this error.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Daniel Golle 168acbb36d oxnas: yet another irqchip related patch
This time DTS fix, again from Sungbo Eo <mans0n@gorani.run>
  ARM: dts: oxnas: Fix clear-mask property

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 9e5a25846f)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle cf4520d15e oxnas: backport another fix for irqchip
Sungbo Eo <mans0n@gorani.run> submitted another patch fixing an error
on reboot:
  irqchip/versatile-fpga: Apply clear-mask earlier

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 19af00850f)
4 years ago
Adrian Schmutzler 456e1c60d6 ath79: add support for TP-Link WDR3500 v1
Hardware:
SoC:      AR9344
CPU:      560 MHz
Flash:    8 MiB
RAM:      128 MiB
WiFi:     Atheros AR9340 2.4GHz 802.11bgn
          Atheros AR9300 5GHz 802.11an
Ethernet: AR934X built-in switch, WAN on separate physical interface
USB:      1x 2.0

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
   wdr3500v1_tp_recovery.bin
3. Start a tftp server with the image file in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[removed stray newline]
Signed-off-by: David Bauer <mail@david-bauer.net>
(backported from commit fbbb4eb8b4)
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler e7fae8fc97 ath79: add support for TP-Link Archer C60 v3
TP-Link Archer C60 v3 is a dual-band AC1350 router,
based on Qualcomm/Atheros QCA9561 + QCA9886.

It seems to be identical to the v2 revision, except that
it lacks a WPS LED and has different GPIO for amber WAN LED.

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
- 6x 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

While TFTP works for OpenWrt images, my device didn't accept the
only available official firmware "Archer C60(EU)_V3.0_190115.bin".

In contrast to earlier revisions (v2), the v3 contains the (same)
MAC address twice, once in 0x1fa08 and again in 0x1fb08.
While the partition-table on the device refers to the latter, the
firmware image contains a different partition-table for that region:

name           device            firmware
factory-boot   0x00000-0x1fb00   0x00000-0x1fa00
default-mac    0x1fb00-0x1fd00   0x1fa00-0x1fc00
pin            0x1fd00-0x1fe00   0x1fc00-0x1fd00
product-info   0x1fe00-0x1ff00   0x1fd00-0x1ff00
device-id      0x1ff00-0x20000   0x1ff00-0x20000

While the MAC address is present twice, other data like the PIN isn't,
so with the partitioning from the firmware image the PIN on the device
would actually be outside of its partition.
Consequently, the patch uses the MAC location from the device (which
is the same as for the v2).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 646d95c374)
4 years ago
Daniel Golle 2bd9d2e08b oxnas: backport patch fixing hang after reboot
Sungbo Eo <mans0n@gorani.run> posted a patch fixing the long-standing
reboot problem on the OXNAS OX820 platform:
  irqchip/versatile-fpga: Handle chained IRQs properly

It got queued for 5.7. Import it to oxnas target patches for now.

Fixes: b4917fa907 ("oxnas: fix oxnas-rps-timer dt-match")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 67b04e767a)
4 years ago
Sungbo Eo 74a8e36975 layerscape: add kmod-i2c-mux to DEVICE_PACKAGES for traverse-ls1043
kmod-i2c-mux-pca954x will not get into images unless kmod-i2c-mux is added to
DEVICE_PACKAGES as well.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit dffbe668ab)
4 years ago
Jun Su 7ae345ecb7 ath79: add support for TP-Link TL-WR740N v5
This adds support for the TP-Link TL-WR740N v5, a clone of the
v4 only with a different TPLINK_HWID. It was already supported
in ar71xx as well.

Specifications:

SOC: Atheros AR9331
CPU: 400MHz
Flash: 4 MiB
RAM: 32 MiB
WLAN: Atheros AR9330 bgn
Ethernet: 5 ports (100M)

Flashing instructions:

- Flash factory image from OEM WebUI:
  openwrt-ath79-tiny-tplink_tl-wr740n-v5-squashfs-factory.bin
- Sysupgrade from ar71xx image:
  openwrt-ath79-tiny-tplink_tl-wr740n-v5-squashfs-sysupgrade.bin

Signed-off-by: Jun Su <howard0su@gmail.com>
[commit title/message facelift, backport for 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit b9f4f1f97a)
4 years ago
Adrian Schmutzler 76c1c1daea ar71xx: fix port order on TP-Link Archer C60 v1/v2
The labels on the LAN ports of the TP-Link Archer C60 v1/v2 are
actually inverted compared to the ports of the internal switch.

Add this information to 02_network.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 14a07fa1f0)
4 years ago
Adrian Schmutzler f1a3a6b79c ath79: fix port order on TP-Link Archer C60 v1/v2
The labels on the LAN ports of the TP-Link Archer C60 v1/v2 are
actually inverted compared to the ports of the internal switch.

Add this information to 02_network.

This is the same for to-be-supported v3 of this device.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit b054729899)
4 years ago
Adrian Schmutzler e4107e30a7 ar71xx: remove wrong MAC address adjustment for Archer C60 v2
The adjustment of the MAC address for Archer C60 v2 in 10_fix_wifi_mac
is broken since a "mac" partition is not set up for this device on
ar71xx. Instead, the MAC address is already patched correctly in
11-ath10k-caldata.

Remove the useless adjustment.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit cbdc919024)
4 years ago
Adrian Schmutzler 83f1015a6c ar71xx: fix swapped LAN/WAN MAC address for Archer C60 v1/v2
The MAC addresses for lan/wan are swapped compared to the vendor
firmware. This adjusts to vendor configuration, which is:

lan   *:7b   label
wan   *:7c   label+1
2.4g  *:7b   label
5g    *:7a   label-1

Only one address is stored in <&mac 0x8>, corresponding to the label.

This has been checked on revisions v1, v2 and v3.

Since ar71xx calculates the ath10k MAC address based on the ethernet
addresses, the number there is adjusted, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 14eb54938b)
4 years ago
Adrian Schmutzler 9f024d3587 ath79: fix swapped LAN/WAN MAC address for Archer C60 v1/v2
The MAC addresses for lan/wan are swapped compared to the vendor
firmware. This adjusts to vendor configuration, which is:

lan   *:7b   label
wan   *:7c   label+1
2.4g  *:7b   label
5g    *:7a   label-1

Only one address is stored in <&mac 0x8>, corresponding to the label.

This has been checked on revisions v1, v2 and v3.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 88aead0a66)
4 years ago
Catrinel Catrinescu 68351990dc ar71xx/ath79: ew-dorin, fix the trigger level for WPS button
Because the WPS button had the wrong trigger level,
the failsafe mode was triggered quite often,
after this commit:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=27f3f493de

Signed-off-by: Catrinel Catrinescu <cc@80211.de>
(cherry picked from commit 3e03b7ac4a)
4 years ago
Rafał Miłecki 6e4453aecc kernel: backport out-of-memory fix for non-Ethernet devices
Doing up & down on non-Ethernet devices (e.g. monitor mode interface)
was consuming memory.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit ec8e8e2ef0)
4 years ago
Koen Vandeputte 06f5a8d3e9 kernel: bump 4.14 to 4.14.172
Refreshed all patches.

Compile-tested on: ar71xx, cns3xxx, imx6, x86_64
Runtime-tested on: cns3xxx

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