Commit Graph

3822 Commits (fbd4214bb0727268aa535af5b600d38939ec8dbc)

Author SHA1 Message Date
Felix Fietkau b0f7ea2853 kernel: unify CONFIG_GPIO_SYSFS in kernel configs
Enable it for all platforms

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
Sungbo Eo c90db26e05 ar71xx: restore support for boot console with arbitrary baud rates
Commit 1bfbf2de6d ("ar71xx: serial: core: add support for boot console
with arbitrary baud rates") added support for arbitrary baud rates which
enabled 250000 baud rate for Yun. But the patch was not ported to kernel
4.9, and since then the kernel set its baud rate to 9600. This commit ports
the patch to kernel 4.14, thereby restoring the serial console of Yun.

Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo a5e404d192 ar71xx: enable ethernet LED of Arduino Yun
Commit 05d73a2a73 enabled GPIO on ethernet LED, but proper LED setup was
not added then. This commit fixes it by reverting the change on the LED.

Fixes: 05d73a2a73 ("ar71xx: Arduino Yun board 'WLAN RST' button support")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo 58dc1d0637 ar71xx: fix sysupgrade for Arduino Yun
Commit bb46b635df changed its partition scheme, but sysupgrade image
validation still uses the old format. This commit fixes it so that
force flag is not needed for sysupgrade.

Fixes: bb46b635df ("ar71xx: move Arduino Yun to generic building code")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo 43896dc0b0 Revert "ar71xx: fix Arduino Yun enabling of level shifters outputs"
This reverts commit 077253dd66.

The output enable pins should be disabled by default, and only enabled when
used. Otherwise unwanted conflicts might occur between MCU and SoC pins.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Hauke Mehrtens 66e04abbb6 ar71xx: Fix mikrotik NAND compile problem
This Fixes the folowing compile error:
drivers/mtd/nand/rb91x_nand.c: In function 'rb91x_nand_remove':
drivers/mtd/nand/rb91x_nand.c:445:16: error: 'rbni' undeclared (first use in this function)
  nand_release(&rbni->chip);

Fixes: ce958dd88a ("kernel: Update kernel 4.14 to version 4.14.187")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens 014d3f593a ar71xx: Fix mikrotik NAND compile problem
There is one closing bracket too much.

Fixes: ce958dd88a ("kernel: Update kernel 4.14 to version 4.14.187")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens ce958dd88a kernel: Update kernel 4.14 to version 4.14.187
Fixes:
- CVE-2020-10757

The "mtd: rawnand: Pass a nand_chip object to nand_release()" commit was
backported which needed some adaptations to other code.

Build tested: ramips

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
David Bauer b017a016cc ar71xx: correct button type for TL-MR3020 mode slider
The TP-Link TL-MR3020 has a three-state mode slider which was previously
integrated as a button (EV_KEY). This led to spurious activations of
failsafe mode.

Set the type for the button to switch (EV_SW), to avoid unintended
activations of failsafe mode.

Related: commit 27f3f493de ("gpio-button-hotplug: unify polled and
interrupt code")

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Lech Perczak f841e70640 ar71xx: fix reset key for TP-Link TL-WR802N V1/V2
During porting support for this router to ath79 target
it was discovered that GPIO mapping was incorrect (GPIO11 active high).
Correct mapping for both V1 and V2 is GPIO12 active low.

Default configuration from GPL source for V2 explicitly states this, and
this was confirmed experimentally on ath79 by looking on
/sys/kernel/debug/gpio. Correctness of this was also validated for V1 by
cross-flashing vendor firmware for V1 on V2 hardware, in which reset
button also worked.

Fix it.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
[slightly adjust commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler a7b07f8ba8 ar71xx: fix splitting firmware partition for TL-WR902AC v1
The -O option for the tplink-v1-header was missing for the TP-Link
TL-WR902AC v1, while safeloader and MTDPARTS where set up with a
single firmware partition.

This led to bootloops after using sysupgrade.

Fixes: FS#3118

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Thibaut VARÈNE f10da7cb4d packages/boot: remove rbcfg
The new sysfs soft_config driver makes buggy rbcfg obsolete and
entirely replaces it.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 96414047c9 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 1c6990fe6d 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
Koen Vandeputte ef2d5a2ab4 kernel: bump 4.14 to 4.14.180
Refreshed all patches.

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

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Thibaut VARÈNE e995577e70 ar71xx/mikrotik: ath10k: use new sysfs driver
Fetch ath10k calibration data from new mikrotik sysfs driver

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 00d2ab7602 ar71xx/mikrotik: enable mikrotik platform driver
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Koen Vandeputte e31d158c4d 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
- 184-USB-serial-option-add-Wistron-Neweb-D19Q1.patch

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

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Baptiste Jonglez 247043c968 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>
4 years ago
Jan Alexander d394c354ee 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>
4 years ago
Adrian Schmutzler 281785d74f 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>
4 years ago
Sungbo Eo 90daff4cf8 build: image: move IMAGE_SIZE to image.mk
IMAGE_SIZE is widely used in many targets. Declare it in the default template to
clean up redundant code. This also prevents deriving IMAGE_SIZE unintentionally
from the previously defined device.

While at it, remove duplicate KERNEL_SIZE declaration.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Adrian Schmutzler 14a07fa1f0 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>
4 years ago
Adrian Schmutzler cbdc919024 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>
4 years ago
Adrian Schmutzler 14eb54938b 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>
4 years ago
Catrinel Catrinescu 3e03b7ac4a 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>
4 years ago
David Bauer 4349d4c682 ar71xx: add missing LED migration for Archer C7
When changing the LED names for the Archer C7 to represent the correct
color, a migration for existing UCI entries was not created.

Add a migration to keep existing LED configurations working.

Fixes commit c79c001b59 ("ar71xx: Archer C7 v1 LED names and RFKILL
fixes")

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer 1d4f2ca610 ar71xx: correct AVM FRITZ Repeater 450E WPS button flag
The AVM FRITZ!WLAN Repeater 450E's WPS button is not active low.

Correct the active low flag to avoid unintenional activation of
failsafe mode on boot.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Koen Vandeputte f4bea1b6a3 kernel: bump 4.14 to 4.14.171
Refreshed all patches.

Fixes:
- CVE-2013-1798

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte 76254cb75e kernel: bump 4.14 to 4.14.167
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Kimmo Vuorinen 2c1cfacdde ar71xx: change u-boot-env to read-write for gl-ar150/-domino/mifi
Change u-boot-env partitions to be mounted as read-write for gl-ar150,
gl-domino and gl-mifi so uboot-envtools support is possible.

Signed-off-by: Kimmo Vuorinen <kimmo.vuorinen@gmail.com>
[commit title/message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler b2102be8a5 ar71xx: use dynamic partitioning for TP-Link TL-WA850RE v2
This moves the TP-Link TL-WA850RE v2 to dynamic partitioning and
will allow to use this for ath79 as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Lech Perczak 83708f233d ar71xx: ubnt-rocket-m-ti: fix RSSI LED definitions
When mapping for RSSI LEDs was defined for interface wlan0 on
Ubiquiti Rocket M Titanium, it missed connection to actual interface.
Therefore create the mapping to interface, so RSSI LEDs work without
additional configuration, after starting rssileds service.

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

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

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 years ago
Koen Vandeputte b5480de4d1 kernel: bump 4.14 to 4.14.164
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Thomas Nixon 788c8485eb ar71xx/mikrotik: use ath10k-ct-smallbuffers for 64 MiB devices
This image is only needed on one device (wAP AC); since this target is
going to be removed anyway it doesn't make sense to add an extra "low
RAM" image.

Fixes OOM issues on RouterBoard wAP AC.

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
4 years ago
Tokunori Ikegami dd15ffbf6b ar71xx: Remove mtd cfi_cmdset_0002 status check patch
Currently the patch only changes break to use goto statement instead.
But not necessary acutually since the ret value checked after the for loop.
So it is okay for the break case before changed by the patch also.

This patch only reverts the following commit partially.
  ddc11c3932
    Note: The changes are mainly applied into the linux kernel upstream.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Cc: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Hauke Mehrtens 1bb90a28e4 kernel: bump 4.14 to 4.14.162
Refreshed all patches.

Compile-tested on: ramips
Runtime-tested on: ramips

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Koen Vandeputte 7604e53d5f 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>
4 years ago
Sungbo Eo 9b02d32e34 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>
4 years ago
David Bauer 9e1e432469 ar71xx: indicate upgrade using system LED
This enables the system LED to indicate a running firmware upgrade. This
pattern is used on most platforms provided by the generic base-files
package. ar71xx uses it's own implementation for the system-LED, where
the upgrade case is not yet implemented.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Koen Vandeputte d395583d69 kernel: bump 4.14 to 4.14.158
Refreshed all patches.

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

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Lech Perczak 08d9c95417 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>
5 years ago
Adrian Schmutzler 25127f58b4 ar71xx: fix buttons for TP-Link TL-WDR4900 v2
TP-Link TL-WDR4900 v2 only has one combined WPS/Reset button, so
don't set up an RFKILL for this device.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 93f2bcc35e ar71xx: fix LED setup for TL-WDR4900 v2
In ar71xx there is only one combined mach file for Archer C5/C7 and
TL-WDR4900 v2. This one uses the same LED struct for all devices,
defining "green" LEDs for them. However, WDR4900 uses blue front
LEDs, while only C5/C7 uses green ones. Despite, in base-files
WDR4900 is actually set up with "blue" for the mentioned LEDs.

Thus, this patch creates a separate LED struct for WDR4900, so the
LEDs can be set up correctly. Despite, the wlan5g LED is removed as
it is controlled by ath9k chip for WDR4900 (in contrast to C5/C7).

Note: While front LEDs are blue, USB LEDs (on the back) are green,
so colors are mixed intentionally for the WDR4900 v2.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler a9d3084b83 ar71xx: fix MAC address setup for TL-WDR4900 v2
The MAC address setup of the TL-WDR4900 v2 is different from the
C5/C7. This aligns ar71xx with the setup in ath79:

wlan0 (5GHz) : -2
wlan1 (2.4GHz) : -1
eth1 (LAN) : 0
eth0 (WAN) : 1

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler a021268032 ar71xx: fix MAC addresses for Archer C5 v1, C7 v1/v2, WDR4900 v2
As discussed in 1d18a14a90 ("ath79: really fix TP-Link Archer C7
v2 MAC address"), stock firmware MAC address assignment is
actually as follows:

wlan0 (5GHz) : -1
wlan1 (2.4GHz) : 0
eth1 (LAN) : 0
eth0 (WAN) : 1

This has never been fixed for ar71xx, so let's do it now.
Note that with WDR4900 v2 even both wlan0 and wlan1 where assigned
to basemac-1 before ...

Fixes: FS#408

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
南浦月 0ff2385a92 ar71xx: fix tl-wdr3320-v2 upgrade
Fix the error that tl-wdr3320-v2 can't upgrade firmware via web
interface by using magic_ver="0200" for this device.

Signed-off-by: 南浦月 <nanpuyue@gmail.com>
[commit message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
André Valentin 353ecbbf64 ar71xx: fix bug in NBG6716 kernelpacking, add firmware partition
-Fix the kernel image generation (more robust)
-Add a firmware partition table allowing easy upgrade to ath79

Signed-off-by: André Valentin <avalentin@marcant.net>
5 years ago
Andreas Ziegler 2bc7c519dc ar71xx: add model detection for UniFi AC-LR
This commit adds correct model detection for UniFi
AC-LR. Previously, said device was incorrectly detected
as UniFi-AC-LITE/MESH.

The Information about the device is stored at 0xC in the EEPROM
partition. It corresponds to the sysid in /etc/board.info of the
Ubiquiti stock firmware.

Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de>
[adjust naming style of target to existing ones]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler c79b796280 ar71xx: improve support for TP-Link CPE510 v2
This fixes commit bae927c551 ("ar71xx: add support for TP-LINK CPE510
V2.0") where the support for this device wasn't optimal.

Device support for the CPE510v2 so far has been a hack to enable
flashing with CPE510v1 images. Those even have different hardware (e.g.
additional ethernet port).

With this patch, we provide proper support for this device in ar71xx.

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 address: 192.168.0.254

Fixes: bae927c551 ("ar71xx: add support for TP-LINK CPE510 V2.0")
Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[Rebased onto revert commit, changed comments in mach-cpe510.c,
changed commit title and description, fixed eth0 MAC address,
removed eth1 initialization]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[squashed revert, added fixes tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago