Commit Graph

22433 Commits (0a06fcf608ddf1f5db389decf266283392344784)

Author SHA1 Message Date
Eneas U de Queiroz 26681de412 ipq40xx: qce - switch to skcipher API
This backports a commit updating the API of the QCE crypto engine to
what is used in current kerenl, easing future upstream backports.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
[renumber patches, refreshed, added 5.4 patches]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Christian Lamparter ce691b2abc kernel: 4.19,5.4: disable ARM CE & NEON
This patch disables the CRYPTO KERNEL SYMBOLs that are touched
by the upcoming ipq40xx patch "ipq40xx: use neon crypto drivers"
from "Eneas U de Queiroz" and more so for his follow up patches
for the  other ARM targets in this series. This should help to
prevent at least a few potential build errors on other archs.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Steven Lin a736d912e2 ipq40xx: add support for EnGenius EAP2200
SOC:    IPQ4019 / QCA Dakota
CPU:    Quad-Core ARMv7 Processor rev 5 (v7l) Cortex-A7
DRAM:   256 MiB
FLASH:  NOR 4 MiB + NAND 128 MiB
ETH:    Qualcomm Atheros QCA8072
WLAN1:  Qualcomm Atheros QCA4019 2.4GHz 802.11bgn 2:2x2
WLAN2:  Qualcomm Atheros QCA4019 5GHz 802.11a/n/ac 2:2x2
WLAN2:  Qualcomm Atheros QCA9888 5GHz 802.11a/n/ac 2:2x2
INPUT:  WPS Button
LEDS:   Power, LAN1, LAN2, WLAN 2.4GHz, WLAN 5GHz-1, WLAN 5GHz-2, OPMODE

1. Load Ramdisk via U-Boot

To set up the flash memory environment, do the following:
a. As a preliminary step, ensure that the board console port is connected to the PC using these RS232 parameters:
   * 115200bps
   * 8N1
b. Confirm that the PC is connected to the board using one of the Ethernet ports.
c. Set a static ip 192.168.99.8 for Ethernet that connects to board.
d. The PC must have a TFTP server launched and listening on the interface to which the board is connected.
e. At this stage power up the board and, after a few seconds, press 4 and then any key during the countdown.

U-BOOT> set serverip 192.168.99.9 && tftpboot 0x84000000 192.168.99.8:openwrt.itb && bootm

Signed-off-by: Steven Lin <steven.lin@senao.com>
[copied 4.19 dts to 5.4]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Adrian Schmutzler 977c7f12de ipq807x: fix indent in image/Makefile
Convert space indent to tab like the rest of the file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Kevin Darbyshire-Bryant 0b7ad6f7f0 kernel: 5.4 fix build on darwin
Fix typedef clash on darwin.

HOSTCC  scripts/mod/file2alias.o
scripts/mod/file2alias.c:47:3: error: typedef redefinition with different types ('struct uuid_t' vs '__darwin_uuid_t' (aka 'unsigned char [16]'))
} uuid_t;
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h:31:25: note: previous definition is here
typedef __darwin_uuid_t uuid_t;
                        ^
scripts/mod/file2alias.c:1305:42: error: array initializer must be an initializer list or string literal
        DEF_FIELD(symval, tee_client_device_id, uuid);
                                                ^
2 errors generated.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
John Crispin 29c6ddd99e ipq807x: add very basic target support
This is still missing a lot of love but people want to start working on it
so lets give them a common baseline.

Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
John Crispin 272e0a702a ipq40xx: add v5.4 support
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
Mark-MC Lee (李明昌) 25d9df670b mediatek: add v5.4 support
Signed-off-by: Mark-MC Lee (李明昌) <Mark-MC.Lee@mediatek.com>
4 years ago
John Crispin 50c6938b95 bcm53xx: add v5.4 support
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
Koen Vandeputte 6d5291ff72 imx6: add support for kernel 5.4
Refreshed all patches.
Refreshed kernel config.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
David Bauer 13b1db795f mpc85xx: add support for kernel 5.4
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Hauke Mehrtens 1e95f9b3ea ath79: Make upstream ag71xx driver work
* Fix some bugs in the driver
* Add missing clock and reset references in dts
* Rename mdio-bus to mdio so the driver find it

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
David Bauer 53ab9865c2 ath79: add support for kernel 5.4
Signed-off-by: David Bauer <mail@david-bauer.net>
[refreshed]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>

* Sync the patches with the changes done for kernel 4.19
* Use KERNEL_TESTING_PATCHVER
* Refresh the configuration
* Fix multiple compile bugs in the patches
* Only add own ag71xx files for kernel 4.19 and use upstream version for
  5.4.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Christian Lamparter e1e6ff6648 apm821xx: add linux kernel 5.4 testing support
This patch adds support for the linux kernel version 5.4
as an optional testing kernel.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Hauke Mehrtens 34fcdcd7c2 kernel: Remove nvmem hack patch from 5.4
The nvmem framework is now used in net/ethernet/eth.c and the nvmem
sysfs is split into a separate Kconfig option. More work would be needed
to adapt this patch for the broader use. The current patch compiles fine
on ath79, but it breaks the x86 target.

nvmem is also compiled into the kernel for most of our targets for
example ath79 anyway, so patching the kernel to remove it is now harder
and not the case on multiple targets anyway. Instead of making this work
on kernel 5.4 just remove this hack patch.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens 21adbfd81f kernel: Make LIB_ARC4 selectable
This makes it possible to select CONFIG_CRYPTO_LIB_ARC4 directly. We
need this to be able to compile this into the kernel and make use of it
from mac80211 backports.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens 500a02bc29 x86: Update configuration
The configuration was refreshed and KERNEL_TESTING_PATCHVER was set to
make it easy to compile for kernel 5.4.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens e155fc5cb5 x86: Refresh patches on kernel 5.4
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens 5af55933e0 x86: copy kernel patches from 4.19 to 5.4
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Koen Vandeputte 4e0c54bc5b kernel: add support for kernel 5.4
The following patches were removed because they are integrated in the upstream kernel 5.4:
 * backport-5.4/047-v4.21-mtd-keep-original-flags-for-every-struct-mtd_info.patch
 * backport-5.4/048-v4.21-mtd-improve-calculating-partition-boundaries-when-ch.patch
 * backport-5.4/080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch
 * backport-5.4/080-v5.1-0002-bcma-use-dev_-printing-functions.patch
 * backport-5.4/095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch
 * backport-5.4/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch
 * backport-5.4/200-v5.2-usb-dwc2-Set-lpm-mode-parameters-depend-on-HW-configuration.patch
 * backport-5.4/210-arm64-sve-Disentangle-uapi-asm-ptrace.h-from-uapi-as.patch
 * backport-5.4/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch
 * backport-5.4/450-v5.0-mtd-spinand-winbond-Add-support-for-W25N01GV.patch
 * backport-5.4/451-v5.0-mtd-spinand-Add-initial-support-for-Toshiba-TC58CVG2.patch
 * backport-5.4/452-v5.0-mtd-spinand-add-support-for-GigaDevice-GD5FxGQ4xA.patch
 * backport-5.4/455-v5.1-mtd-spinand-Add-support-for-all-Toshiba-Memory-produ.patch
 * backport-5.4/456-v5.1-mtd-spinand-Add-support-for-GigaDevice-GD5F1GQ4UExxG.patch
 * backport-5.4/460-v5.0-mtd-spi-nor-Add-support-for-mx25u12835f.patch
 * backport-5.4/460-v5.3-mtd-spinand-Define-macros-for-page-read-ops-with-thr.patch
 * backport-5.4/461-v5.3-mtd-spinand-Add-support-for-two-byte-device-IDs.patch
 * backport-5.4/462-v5.3-mtd-spinand-Add-support-for-GigaDevice-GD5F1GQ4UFxxG.patch
 * backport-5.4/463-v5.3-mtd-spinand-Add-initial-support-for-Paragon-PN26G0xA.patch
 * backport-5.4/700-v5.1-net-phylink-only-call-mac_config-during-resolve-when.patch
 * backport-5.4/701-v5.2-net-phylink-ensure-inband-AN-works-correctly.patch
 * backport-5.4/702-v4.20-net-ethernet-Add-helper-for-MACs-which-support-asym-.patch
 * backport-5.4/703-v4.20-net-ethernet-Add-helper-for-set_pauseparam-for-Asym-.patch
 * backport-5.4/704-v4.20-net-phy-Stop-with-excessive-soft-reset.patch
 * backport-5.4/705-v5.1-net-phy-provide-full-set-of-accessor-functions-to-MM.patch
 * backport-5.4/706-v5.1-net-phy-add-register-modifying-helpers-returning-1-o.patch
 * backport-5.4/707-v5.1-net-phy-add-genphy_c45_check_and_restart_aneg.patch
 * backport-5.4/708-v5.3-net-phylink-remove-netdev-from-phylink-mii-ioctl-emu.patch
 * backport-5.4/709-v5.3-net-phylink-support-for-link-gpio-interrupt.patch
 * backport-5.4/710-v5.3-net-phy-allow-Clause-45-access-via-mii-ioctl.patch
 * backport-5.4/711-v5.3-net-sfp-add-mandatory-attach-detach-methods-for-sfp-.patch
 * backport-5.4/712-v5.3-net-sfp-remove-sfp-bus-use-of-netdevs.patch
 * backport-5.4/713-v5.2-net-phylink-avoid-reducing-support-mask.patch
 * backport-5.4/714-v5.3-net-sfp-Stop-SFP-polling-and-interrupt-handling-duri.patch
 * backport-5.4/715-v5.3-net-phylink-don-t-start-and-stop-SGMII-PHYs-in-SFP-m.patch
 * backport-5.4/740-v5.5-net-phy-avoid-matching-all-ones-clause-45-PHY-IDs.patch
 * backport-5.4/741-v5.5-net-phylink-fix-link-mode-modification-in-PHY-mode.patch
 * pending-5.4/103-MIPS-perf-ath79-Fix-perfcount-IRQ-assignment.patch
 * pending-5.4/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch
 * pending-5.4/132-spi-spi-gpio-fix-crash-when-num-chipselects-is-0.patch
 * pending-5.4/220-optimize_inlining.patch
 * pending-5.4/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch
 * pending-5.4/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch
 * pending-5.4/477-mtd-add-spi-nor-add-mx25u3235f.patch
 * pending-5.4/479-mtd-spi-nor-add-eon-en25qh64.patch

Some bigger changes were done to this feature and we did not port this patch yet:
 * hack-5.4/207-disable-modorder.patch

This depends on BOOTMEM which was removed from the kernel, this needs some bigger changes:
 * hack-5.4/930-crashlog.patch

A different version of the FPU disable patch was merged upstream, OpenWrt needs some adaptations.
 * pending-5.4/304-mips_disable_fpu.patch

- no crashlog support yet as a required file got deleted upstream
- Removed patch below, which is now seen as a recursive dependency [1]
- Removed patch below due to build error [2]
- fix still required to avoid identical function def [3]
- Fixes included from Blocktrron
- Fixes included from Chunkeey
- Fix included from nbd regarding "dst leak in Flow Offload"

[1] target/linux/generic/hack-5.4/260-crypto_test_dependencies.patch
[2] target/linux/generic/hack-5.4/207-disable-modorder.patch
[3] target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Hauke Mehrtens c16517d26d kernel: copy kernel 4.19 code to 5.4
No changes were done to the patches while coping them. Currently they do
not apply on top of kernel 5.4.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Adrian Schmutzler 0b9b0c5d15 ath79: also reduce spi-max-frequency for buffalo_wzr-hp-ag300h
In accordance to ebc090e420 ("ath79: reduce spi-max-frequency to 50 MHz")
this also reduces the spi-max-frequency to 50 MHz for the last remaining
device with higher frequency in ath79. This will save us from having a
single special case that will require adjustment when the spi driver for
this device is changed in the future.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Adrian Schmutzler 845093e8a0 kirkwood: apply minor DTS style improvements
This applies some minor DTS style improvements to the files kept
in OpenWrt at the moment:

- harmonize/improve LED/pinmux node names
- harmonize empty lines between nodes
- change "ok" to "okay"
- some other minor formatting adjustments

Since changes are only cosmetical, they are only applied to the
"newer" DTS files for kernel 4.19.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 16965a0f3f kirkwood: convert DTS patches into plain DTS files
Move DTS files newly created by patch files to files directory. This will make
these files much more maintainable.

Patching the kernel Makefile is unnecessary, as the DTS files specified in
DEVICE_DTS will be compiled by OpenWrt buildroot anyway.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler ebc090e420 ath79: reduce spi-max-frequency to 50 MHz
The introduction of ebf0d8dade ("ath79: add new ar934x spi driver")
made the SPI memory unusable on devices with very high spi-max-frequency
(104 MHz).

Here's how the actual clock is calculated: (AHB_CLK/((CLOCK_DIVIDER+1)*2))
where AHB_CLK is a fixed clock (e.g. 200MHz on AR9331) and CLOCK_DIVIDER
is the parameter we can set. Highest clock according to this formula is
AHB_CLK/2 (100MHz, but that didn't work in device tests).
The next possible value is AHB_CLK/4 (50MHz). Speeds between 50 MHz and
100 MHz will be rounded down, so using values higher than 50 MHz does
not provide any benefit.

Consequently, this patch reduces spi-max-frequency for all devices with
values higher than 50 MHz to 50 MHz (effectively, this only affects
devices with 104 MHz before this patch).

Tested on GL.inet GL-AR150:
Boot fails with 104 MHz but is successful with both 50 MHz and 80 MHz
(fast-read), where the latter two yield identical read speeds.

Fixes: ebf0d8dade ("ath79: add new ar934x spi driver")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Roger Pueyo Centelles 9de6bc872a ath79: fix spi-max-frequency for wAP G-5HacT2HnD
The introduction of ebf0d8dade (ath79: add new ar934x spi driver)
made the SPI memory unusable. Reducing the spi-max-frequency to
a smaller value makes it work again.

Tested on two MikroTik RouterBOARD wAP G-5HacT2HnD devices.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
4 years ago
Roger Pueyo Centelles 8f93c05a59 ath79: add support for MikroTik RouterBOARD 922UAGS-5HPacD
This patch ports support for the MikroTik RouterBOARD 922UAGS-5HPacD
with a built-in 802.11ac High-Power radio (31dBm), which was already
available in the ar71xx target.

See https://mikrotik.com/product/RB922UAGS-5HPacD for more info.

Specifications:
- SoC: Qualcomm Atheros QCA9558 (720 MHz)
- RAM: 128 MB
- Storage: 128 MB NAND
- Wireless: external QCA9882 802.11a/ac 2x2:2
- Ethernet: 1x 1000/100/10 Mbps, integrated, via AR8031 PHY, passive PoE-in 24V
- SFP: 1x host
- USB: 1x 2.0 type A
- PCIe: 1x Mini slot (also contains USB 2.0 for 3G/LTE modems)
- SIM slot: 1x mini-SIM

Working:
- Board/system detection
- SPI and NAND storage
- PCIe
- USB type A host
- Wireless
- Ethernet
- LEDs (user, phy0)
- Reset button
- Sysupgrade to/from ar71xx

Not supported:
- RSSI LEDs
- SFP cage

Installation methods:
- Sysupgrade from ar71xx (it is advisable to use the -n option to
wipe any previous settings), or
- Boot the initramfs image via TFTP and then flash the sysupgrade
image using "sysupgrade -n"

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
4 years ago
Kevin Darbyshire-Bryant 3660a89cb9 kernel: x86_64: drop CALGARY properly
Use correct config syntax of 'is not set' instead of just commenting the
line

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
John Crispin 083eb80bf2 mediatek: add latest fixes provided by MTK
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
Kevin Darbyshire-Bryant ffd249366f kernel: x86_64: drop CALGARY IOMMU
The calgary IOMMU was only used on high-end IBM systems in the early
x86_64 age.  This is an unlikely OpenWrt target and in fact upstream
are looking to drop the driver entirely with the bonus that we no
longer see:

[ 0.000000] Calgary: detecting Calgary via BIOS EBDA area
[ 0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing!

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Hauke Mehrtens 27358ec8fd kernel: Sort generic configuration
This was done by executing these commands:

$ ./scripts/kconfig.pl '+' target/linux/generic/config-4.19 /dev/null > target/linux/generic/config-4.19-new
$ mv target/linux/generic/config-4.14-new target/linux/generic/config-4.14

$ ./scripts/kconfig.pl '+' target/linux/generic/config-4.14 /dev/null > target/linux/generic/config-4.14-new
$ mv target/linux/generic/config-4.19-new target/linux/generic/config-4.19

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Roger Pueyo Centelles 6613a7f5cc ath79: add missing reset-gpios for NanoStation Loco M (XW)
When porting support from ar71xx to ath79, the reset-gpios option was
missed. Due to a hardware bug, this would eventually leave the devices
with RX-deaf Ethernet PHY.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
4 years ago
Koen Vandeputte 7ae2523323 kernel: bump 4.19 to 4.19.106
Refreshed all patches.

Remove upstreamed:
- 950-0786-leds-pca963x-Fix-open-drain-initialization.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Sungbo Eo fc65fae304 kirkwood: remove kmod-i2c-mv64xxx from DEVICE_PACKAGES
Commit 9a1f441ac8 ("kirkwood: enable SoC drivers in the kernel config")
enabled I2C_MV64XXX in the kernel config, and the subsequent commit 0d5ba94088
("orion: enable SoC drivers in the kernel config") removed kmod-i2c-mv64xxx
package entirely. As the feature is now kernel built-in and the package does not
exist anymore, we can safely remove kmod-i2c-mv64xxx from DEVICE_PACKAGES.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Koen Vandeputte b6c9d2bab0 kernel: bump 4.19 to 4.19.105
Refreshed all patches.

Fixes:
- CVE-2013-1798
- CVE-2019-3016

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
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
Sungbo Eo 7e9c7e7b2d kirkwood: tidy up hwmon_fancontrol
Add indent and sort board_name alphabetically.

Sourcing /lib/functions.sh is already handled by /etc/rc.common. Drop the line.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo 1013b140a6 kirkwood: add kmod-hwmon-core to DEVICE_PACKAGES
kmod-hwmon-lm* will not get into images unless kmod-hwmon-core is added to
DEVICE_PACKAGES as well.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[only address kmod-hwmon-core in this commit]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 4528128b05 kirkwood: tidy up image Makefile
- use k in SIZE variables
- break long lines

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo c24e01fccc kirkwood: fix device node name of Iomega ix2-200
The current device node name of ix2-200 is "iom_ix2_200", which results
in a SUPPORTED_DEVICES string "iom,ix2,200" that does not match the
compatible in DTS and the board name used in board.d.

Fix this by replacing the second underscore with a dash, following
vendor_model scheme.

Fixes: 27b2f0fc0f ("kirkwood: add support for Iomega Storcenter ix2-200")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[commit title/message rephrase]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 55c153538d ath79: fix TP-Link TL-WA901ND v2 PHY stuck in reset
Some newer bootloaders for the TP-Link TL-WA901ND put the ethernet PHY
in reset before loading the kernel, thus the LAN interface is not
working in OpenWrt.

Clear the reset to restore ethernet functionality.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Sungbo Eo 33c1d5eee4 x86: avoid underscore in package name
As 07e1d88d7b ("kernel: avoid underscore in *6lowpan package names") shows,
underscores might cause build failures. Replace underscore with dash.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Adrian Schmutzler 1173719817 ramips: move includes to DTSI for mt7628an_tplink_8m*
All devices inherited from mt7628an_tplink_8m.dtsi and
mt7628an_tplink_8m-split-uboot.dtsi contain the same additional
includes in the DTS files.

Move them to the DTSI files instead.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 1ae6292f75 ramips: move compatible for Ubiquiti Edgerouter X to DTS file
So far, the compatible for the Ubiquiti Edgerouter X has been
defined in the DTSI file and inherited for the edgerouterx.dts,
but overwritten for the edgerouterx-sfp.dts. In contrast, the
model was stored in the DTS file in both cases.

To resolve this somewhat confusing situation, move the compatible
with the device name for edgerouterx to the DTS file as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 963f572ead ramips: remove redundant includes in DTS files
Many DTS files contain the same includes again that are already
present in the DTSI files they are derived from.

Remove those redundant includes in the DTS files. For vocore, the
include is moved to the parent DTSI file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler a967ae9d14 ath79: remove redundant includes in DTS files
Many DTS files contain the same includes again that are already
present in the DTSI files they are derived from.

Remove those redundant includes in the DTS files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Martin Schiller 54e39ddc2e kernel: fix xt_connmark.h
Commit a1cfe0dcbb (kernel: connmark set-dscpmark follow upstreamimg
attempt") broke the usage of xt_connmark.h in user-space (e.g.
strongswan), because the BIT() macro is unknown there.

Fixes: a1cfe0dcbb (kernel: connmark set-dscpmark follow upstreamimg attempt")
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
4 years ago
Aleksander Jan Bajkowski c6e33b7cb4 generic: refresh patches
just run: make target/linux/refresh V=s

Fixes: 6e315de0f4

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years ago
Aleksander Jan Bajkowski 84845123fe kernel: remove non-existant symbols from 4.19 config
These symbols only exist in kernel version <= 4.15

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
4 years ago
Hauke Mehrtens b951f53fba build: Add additional kernel debug options
Make it possible to activate some additional kernel debug options.
This can be used to debug some problems in kernel drivers.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
4 years ago
Hauke Mehrtens 431594a978 build: Add option KERNEL_KASAN
The kernel kernel address sanitizer is able to detect some memory
bugs in the kernel like out of range array accesses.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
4 years ago
Hauke Mehrtens d9b043c03c build: Add option KERNEL_UBSAN
The kernel Undefined Behavior Sanitizer is able to detect some memory
bugs in the kernel like out of range array accesses.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
4 years ago
Hauke Mehrtens cbb6929789 x86: Add missing kernel option CONFIG_X86_DECODER_SELFTEST
This option has now a different dependency and can be activated, set a
default value.

Fixes: 20b5a4ca01 ("kernel: bump 4.19 to 4.19.101")
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
Tested-by: Alexandru Ardelean <ardeleanalex@gmail.com>
4 years ago
Adrian Schmutzler aa9c2149a7 kirkwood: do not expose status LED to user config by default
So far, the state of status LEDs is set up in 01_leds for many devices
in kirkwood target. As those LEDs are also controlled by diag.sh,
exposing them to the user via uci config by default seems not helpful
and might even have confusing results for the user.

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 6bbca3a09a kirkwood: set default state for status LEDs in device tree
This adds the default-state = "on"; statement for the power or
primary status LED in DTS on kirkwood. This will ensure that this
LED will be lit up very early in the boot process (i.e. before
diag.sh is executed) and thus will provide an additional hint to the
user when problems arise during early boot process.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler b6db230183 kirkwood: add diag LEDs for ZyXEL NSA325
This device has had no diag LEDs set up so far, so let's just
add them.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Pawel Dembicki ae67f5ffae kirkwood: use generic diag.sh
This commit removes the target-specific diag.sh script. This way, the
generic one is used for the target, which uses DT-aliases to specify the
LEDs used.

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

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

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[remove unrelated cosmetic changes, rename some labels, add pogo_e02]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Daniel Golle d1130ad265 ath79: add support for Teltonika RUT955
Specification:

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

Serial console (/dev/ttyS0) pinout:

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

Flash instruction:

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

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle e5e461b621 serial: ar933x_uart: add rs485 support
Add support for RS485 tranceiver with transmit/receive switch hooked
to a RTS GPIO pin.
Use the 'rts-gpios' and 'rs485-rts-active-low' properties as described
in devicetree/bindings/serial/rs485.yaml.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Adrian Schmutzler 2f1cc5c3d5 ath79: add support for TP-Link TL-WA701ND/730RE/801ND/901ND v1
This adds support for the various clones of the TL-WA830RE recently
supported in fb99ac6807 ("ath79: add support for TP-Link TL-WA830RE v1"):

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

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

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

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
DENG Qingfang 1df4f5cf96 ramips: fix HiWiFi HC5761A USB port
Export GPIO 41 to power USB port

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Petr Štetiar c8f8e59816 ramips: gsw_mt7621: disable PORT 5 MAC RX/TX flow control by default
Looking at the current upstream driver implementation, it seems like the
TX/RX flow control is enabled only if the flow control pause option is
resolved from the device/link partner advertisements (or otherwise set).

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

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

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

Ref: https://lists.openwrt.org/pipermail/openwrt-devel/2017-November/009882.html
Ref: https://forum.openwrt.org/t/mtk-soc-eth-watchdog-timeout-after-r11573/50000/12
Suggested-by: Felix Fietkau <nbd@nbd.name>
Reported-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
David Bauer 0709943182 ath79: correct Siemens WS-AP3610 blocksize
With the wrong blocksize, the rootfs was not positioned on the boundary
of a block, thus breaking the mtdsplit driver.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 060b58fd6e ath79: add label MAC address for Ubiquiti Picostation M (XM)
This adds the label MAC address for the Ubiquiti Picostation M (XM).
This was overlooked when adding support in the previous patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 6fdaf16dd0 ath79: add support for Ubiquiti Picostation M (XM)
This adds support for the Ubiquiti Picostation M (XM), which has the
same board/LEDs as the Bullet M XM, but different case and antennas.

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

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

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

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

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

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sven Roederer b56bcfe3be ath79: add support for Ubiquiti Nanostation Loco M (XM)
This adds support for the Ubiquiti Nanostation Loco M (XM), which
has the same board/LEDs as the Bullet M XM, but different case and
antennas.

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

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

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

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

Tested on NanoStation Loco M2.

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
Co-developed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 98fbf2edc0 ath79: move TPLINK_HWID/_HWREV to parent for tplink-safeloader
Several devices with tplink-safeloader contain default values (0x0)
for TPLINK_HWID and TPLINK_HWREV in their device definitions.
Move those to common tplink-safeloader definition so they do not
have to be repeated each time.

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 18c95c9d6e ath79: add gpio4 pinmux on TL-WR841N/ND v8, WR842N v2, MR3420 v2
This adds a pinmux to the shared DTSI for TP-Link TL-WR841N/ND v8,
TL-WR842N v2 and TL-MR3420 v2. It is supposed to be the equivalent
of:

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

This allows to enable USB power on these devices.

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

Tested on TP-Link TL-WR842N v2.

Fixes: FS#2753

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Armin Fuerst <armin@fuerst.priv.at>
4 years ago
Adrian Schmutzler dc145de4be ath79: move mikrotik-caldata.sh to target base-files
Mikrotik devices will be found in both generic and nand subtargets.

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

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer d2b8ccb1c0 ath79: add support for Siemens WS-AP3610
Hardware
--------
SoC:  Atheros AR7161
RAM:  Samsung K4H511638D-UCCC
      2x 64M DDR1
SPI:  Micron M25P128 (16M)
WiFi: Atheros AR9160 bgn
      Atheros AR9160 an
ETH:  Broadcom BCM5481
LED:  Power (Green/Red)
      ETH (Green / Blue / Yellow)
          (PHY-controlled)
      WiFi 5 (Green / Blue)
      WiFi 2 (Green / Blue)
BTN:  Reset

Serial: Cisco-Style RJ45 - 115200 8N1

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

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

2. Connect the TFTP server to the access point.

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

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

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

5. Load OpenWrt into memory:

   $ run ramboot_openwrt

   Wait for the image to boot.

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

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

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer ae35ff5767 ath79: backport phy reset-controller patches
The Siemens WS-AP3610 asserts reset to the ethernet PHY with the
reset-register. Backport the necessary patches to de-assert reset
when probing the PHY.

These patches can be dropped when using kernel 5.4.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 7d7aa2fd92 brcm2708: rename target to bcm27xx
This change makes the names of Broadcom targets consistent by using
the common notation based on SoC/CPU ID (which is used internally
anyway), bcmXXXX instead of brcmXXXX.
This is even used for target TITLE in make menuconfig already,
only the short target name used brcm so far.

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

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Adrian Schmutzler e7bfda2c24 brcm63xx: rename target to bcm63xx
This change makes the names of Broadcom targets consistent by using
the common notation based on SoC/CPU ID (which is used internally
anyway), bcmXXXX instead of brcmXXXX.
This is even used for target TITLE in make menuconfig already,
only the short target name used brcm so far.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 8fe5ad5d33 brcm47xx: rename target to bcm47xx
This change makes the names of Broadcom targets consistent by using
the common notation based on SoC/CPU ID (which is used internally
anyway), bcmXXXX instead of brcmXXXX.
This is even used for target TITLE in make menuconfig already,
only the short target name used brcm so far.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
DENG Qingfang 8590e70fab ramips: fix HiWiFi HC5761A switch settings
HC5761A has only 2 LAN ports

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Aleksander Jan Bajkowski 5499b24dc0 sunxi: backport increased SATA/AHCI DMA TX/RX FIFOs
This backports SATA performance boost from 5.3 kernel:

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

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

Ref: https://forum.openwrt.org/t/sunxi-sata-write-speed-patch/54555/5
Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
[commit subject & description tweaks]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Adrian Schmutzler fbd00bb8d4 ath79: add support for TP-Link TL-WR940N v6
The TL-WR940N v6 is similar to v3/v4, it just has different
LEDs and MAC address assignment.

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

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

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

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

Thanks to Manuel Kock for reviewing and testing this patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Manuel Kock <github.web@manu.li>
4 years ago
Adrian Schmutzler 49ff00db34 ath79: enable forceless sysupgrade from ar71xx on fritz300e
This adds the ar71xx board name to the SUPPORTED_DEVICES on ath79,
so forceless sysupgrade on this device becomes possible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Mathias Kresin 35ab804ea7 kernel: swconfig: make compatible with kernel 5.2
Since kernel 5.2 within netlink messages the NLA_F_NESTED nested flag is
validated. But swconfig/swlib doesn't set the flag for
SWITCH_ATTR_OP_VALUE_PORTS related netlink messages and assigning ports
to vlans via

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

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

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

Signed-off-by: Mathias Kresin <dev@kresin.me>
Tested-by: Rafał Miłecki <rafal@milecki.pl>
4 years ago
Rafał Miłecki 15a0701cdd kernel: rewrite run_parsers_by_type() to use add_mtd_partitions()
Make run_parsers_by_type() more similar to the parse_mtd_partitions():
1. Use struct mtd_partitions
2. Use add_mtd_partitions()

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

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

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

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

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years ago
Sungbo Eo be3e98ce26 ramips: append tail to WF2881 initramfs image
Stock firmware has a vendor-defined tail at the end of uImage for image
validation. This patch enables OpenWrt installation from stock firmware
without having to access the UART console.

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

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Christian Buschau fb99ac6807 ath79: add support for TP-Link TL-WA830RE v1
This ports support for the TL-WA830RE v1 range extender from ar71xx to
ath79.

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

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

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

Signed-off-by: Christian Buschau <christian.buschau@mailbox.org>
[make use of ar7240_tplink.dtsi, add note about clones]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 273e00c4a5 ath79: reorganize DTSI for ar7240 TP-Link devices
The current set of TP-Link devices with ar7240 SoC all share
the same DTSI file. As the latter is very similar to the
definition required for the to-be-supported TP-Link TL-WA devices
with ar7240, this patch splits the definitions into a shared part
for all TP-Link devices (ar7240_tplink.dtsi) and a file containing
the specific setup for the present TL-WR devices
(ar7240_tplink_tl-wr.dtsi), equivalent to the former
ar7240_tplink_tl-wr74xn-v1.dtsi.

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Chuanhong Guo 9c19c35d1e ath79: restore pin state on probe for ar934x-spi
If bootloader doesn't terminate its last spi operation properly
before starting kernel, our first transfer in kernel becomes a
continuous transfer to that request instead of a new one.
Fix this flaw by restoring IOC register, which restored all pin
state to default.

Fixes: ebf0d8dade ("ath79: add new ar934x spi driver")
Reported-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Adrian Schmutzler ceed4638f6 brcm63xx: apply updated compatibles for selecting board_info
When changing compatibles in e4ba8c8294 ("brcm63xx: use more systematic
names for image and DTS files"), I forgot to update them in kernel
patches as well. So, do it now.

Fixes: e4ba8c8294 ("brcm63xx: use more systematic names for image and DTS files")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 7f1ec1cc79 brcm63xx: be more specific about SOC names
This uses the specific SOC names for several devices where the
Chip ID was used incorrectly before.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler d0e8e6db6b brcm63xx: align DTS model with Makefile and compatible
Since the model string in DTS is not required to derive board name
anymore, we can now align it with the model name in Makefile and
the compatible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 0a3350d908 brcm63xx: use compatible instead of manually setting board name
This patch removes the translation of device model name into a
board name in lib/brcm63xx.sh. The latter has been actually totally
useless as we have the compatible which can be used instead of
the board name (and actually is at other targets like ath79 or ramips).

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

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

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

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 78b422ad79 brcm63xx: remove unneeded line break for DEVICE_PACKAGES
In brcm63xx image Makefile DEVICE_PACKAGE definitions are split
into multiple lines with no apparent need.

Merge them into one line to increase readability and maintainability.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler e4ba8c8294 brcm63xx: use more systematic names for image and DTS files
This changes brcm63xx target to achieve consistency between image
names, device nodes names, compatible, DTS name and device name
as much as possible. As with other targets, having consistent
names is supposed to make life easier for developers and reduces
the number of "variables" in the system. In particular, applying
the DTS scheme will make it easier to find the correct file and
architecture.

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

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 9d03eede18 kernel: fix typos in KernelPackage description
Fixes: ed2839ac41 ("kernel/modules: add kmod-pmbus-zl6100 module")
Fixes: bbcb9de935 ("Add package for gpio rotary encoder")
Fixes: 7685458982 ("package/kernel: package kmod-input-matrixkmap")
Fixes: 8bfef35385 ("kernel: rename kmod-switch-rtl8366_smi to
       kmod-switch-rtl8366-smi to avoid underscores in package names")
Fixes: f03bf608b1 ("kernel: Add dummy sound driver")
Fixes: dda5d9b786 ("ramips: rename pwm kernel module")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo cc89c5fe27 ramips: fix device name of netis WF-2881 to WF2881
The correct model name of WF-2881 is WF2881 without hyphen. The former used
boardnames are not added to SUPPORTED_DEVICES, to make it explicit that the
sysupgrade-tar image, which is newly added in the previous commit, should
not be used to upgrade from older version.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[adjust commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo e030d162f7 ramips: use nand_do_upgrade for netis WF-2881
WF-2881 sysupgrade image uses UBI rootfs, but still relies on
default_do_upgrade. Because of this, config backup is not restored after
sysupgrade. It can be fixed by switching to nand_do_upgrade and
sysupgrade-tar image. default_do_upgrade does not handle sysupgrade-tar
properly, so one should use factory image to upgrade from older version.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Lech Perczak 52a0bd3334 ath79: add LED trigger for TL-WR902AC v1 WAN LED
Inspired by commit c48b571ad7, add an LED trigger for the WAN LED on top of
the TP-Link TL-WR902AC v1. Currently, only the LED on the port itself shows the
link state, while the LED on top of the device stays dark.

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

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 years ago
Daniel Golle 16031ebaf8 ath79: add support for Atheros AR934x HS UART
AR934x chips also got the 'old' qca,ar9330-uart in addition to the
'new' ns16550a compatible one. Add support for UART1 clock selector as
well as device-tree bindings in ar934x.dtsi to make use of that uart.

Reported-by: Piotr Dymacz <pepe2k@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle b439d3bfb5 ath79: ar933x_uart: set UART_CS_{RX,TX}_READY_ORIDE
On AR934x this UART is usually not initialized by the bootloader
as it is only used as a secondary serial port while the primary
UART is a newly introduced NS16550-compatible.
In order to make use of the ar933x-uart on AR934x without RTS/CTS
hardware flow control, one needs to set the
UART_CS_{RX,TX}_READY_ORIDE bits as other than on AR933x where this
UART is used as primary/console, the bootloader on AR934x typically
doesn't set those bits.
Setting them explicitely on AR933x does not do any harm, so just set
them unconditionally.

Tested-by: Chuanhong Guo <gch981213@gmail.com
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Dan Haab 1d47f81581 bcm53xx: build images for Luxul ABR-4500 and XBR-4500 routers
Luxul ABR-4500 and XBR-4500 devices are wired routers with 5 Ethernet
ports and 1 USB 3.0 port. Flashing requires using Luxul firmware 6.4.0
or newer and uploading firmware using "Firmware Update" web UI page.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
4 years ago
Chuanhong Guo dd280444b3 ath79: ag71xx: use netif_receive_skb_list on 4.19
This new function make batch processing of network packets possible,
which slightly improves performance.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Tested-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Daniel Golle 6f10aa737e kernel: remove duplicate flash chip definition
XTX XT25F128A shares it's chip ID with XM25QH128A which got identical
features. Hence there it makes no sense to add it to the driver.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Chuanhong Guo 0046aef672 ath79: use ar934x-spi for ar933x as well
ar933x appears to have the same spi controller as ar934x but it's
not mentioned in datasheet at all. Use new spi driver instead to
gain more flash operating performance.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Chuanhong Guo ebf0d8dade ath79: add new ar934x spi driver
A new shift mode was introduced since ar934x which has a way better
performance than current bitbang driver and can handle higher spi
clock properly. This commit adds a new driver to make use of this
new feature.
This new driver has chipselect properly configured and we don't need
cs-gpios hack in dts anymore. Remove them.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
INAGAKI Hiroshi 867db0a283 ramips: add support for I-O DATA WN-AX1167GR2
I-O DATA WN-AX1167GR2 is a 2.4/5 GHz band 11ac router, based on MediaTek
MT7621A.

Specification:

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

Flash instruction using initramfs image:

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

Notes:

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

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
INAGAKI Hiroshi 3c0e2aa63e ramips: add support for I-O DATA WN-DX1167R
I-O DATA WN-DX1167R is a 2.4/5 GHz band 11ac rotuer, based on MediaTek
MT7621A.

Specification:

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

Flash instruction using initramfs image:

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

Notes:

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

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
INAGAKI Hiroshi be4d53bf69 ramips: extend and rename wr1201-factory-header
This commit adds the ability to set custom uImage magic to
Build/wr1201-factory-header and renames it to
"Build/custom-initramfs-uimage".

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

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

While at it, fix typo in comment.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
[shorten commit title, minor commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Álvaro Fernández Rojas 84d555aa74 brcm2708: update to latest patches from RPi foundation
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Koen Vandeputte 6e315de0f4 kernel: add support for GD25D05 SPI NOR
This chip is used on newer RB912UAG-5HPnD r2 boards:

Before:

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

After:

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte 20b5a4ca01 kernel: bump 4.19 to 4.19.101
Refreshed all patches.

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

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

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

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

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

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

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Sungbo Eo 536adedcd3 ramips: remove unnecessary execute permission bit
dts file does not need to be executable. 644 is enough.

Fixes: f098c612b6 ("ramips: create shared DTSI for Netgear EX2700 and WN3000RP v3")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo 64648e29fc mediatek: remove unnecessary execute permission bit
kernel config and patch files do not need to be executable. 644 is enough.

Fixes: 01c8f2e97c ("mediatek: bump to v4.19")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Michal Cieslakiewicz 6227c8d1bf ath79: WNDR3700 v1/v2: make u-boot env partition writable
Remove read-only flag from U-boot environment partition for Netgear
WNDR3700 v1 and v2 so u-boot-envtools can modify data there.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years ago
Adrian Schmutzler 997d89cdf5 mediatek: remove KERNEL_PATCHVER overwrite for mt7629
Since whole target has been bumped to kernel 4.19 in 01c8f2e97c
("mediatek: bump to v4.19") we do not need the overwrite in mt7629
subtarget anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
John Crispin 01c8f2e97c mediatek: bump to v4.19
Signed-off-by: John Crispin <john@phrozen.org>
4 years ago
August Huber ae61d21ca3 ath79: add support for COMFAST CF-E560AC
This commit adds support for the COMFAST CF-E560AC, an ap143 based
in-wall access point.

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

MAC addressing:

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

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

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

Recovery instructions:

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

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

Signed-off-by: August Huber <auh@google.com>
[move jtag_disable_pins, remove unnecessary statuses in DTS, remove
duplicate entry in 11-ath10k-caldata, remove hub_port0 label in DTS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Michal Cieslakiewicz 3b99d67639 ath79: WNDR3700 v2: add dash before version in device name
Adapt Netgear WNDR3700v2 device identification string to ath79 naming
scheme by changing from 'wndr3700v2' to 'wndr3700-v2' (affects config,
makefile, init scripts and device tree definition).

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years ago
John Crispin a067862518 mediatek: add wmac devicetree node for MT7622
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
Adrian Schmutzler 4897bf0ca5 ath79: add common definition for Device/tplink-v2
This adds a shared definition Device/tplink-v2 to common-tp-link.mk.
Though currently only one device in ath79 uses it, putting it in
the common file seems more organized. The definitions are based
on the implementation in ramips target, where a lot of devices
is using tplink-v2-* commands already.

The '-V "ver. 2.0"' suffix for Archer D50 v1 can be removed because
it's default in Build/tplink-v2-image anyway.

While at it, add TPLINK_HWREVADD and TPLINK_HVERSION to DEVICE_VARS,
which seems to have been overlooked when adding Archer D50 v1.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 8a6994eb03 ath79: rename tplink-loader-okli to tplink-safeloader-okli
This renames Device/tplink-loader-okli to Device/tplink-safeloader-okli
since the latter more accurately describes the combination of
tplink-safeloader and loader-okli use there. The old version might
be confused with other uses of the okli loader.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 9c37c5ef2f ath79: rename Device/tplink to Device/tplink-v1
As we have tplink-v2-header and tplink-v2-image recipes as well,
this patch renames the Device/tplink definition to Device/tplink-v1,
as it's using the tplink-v1-* commands. This should provide easier
distinction in the future.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Tomasz Maciej Nowak 87b14bc6c2 mvebu: image: align subtargets makefile names
Align subtargets makefiles names to actual subtargets.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Tomasz Maciej Nowak 67ac189e4b mvebu: image: sort devices alphabetically
This sorts the devices in image Makefiles alphabetically.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[fixed sorting in one case, add commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Andreas Böhler 6d6f36ae78 ramips: add support for TP-Link RE200 v2
TP-Link RE200 v2 is a wireless range extender with Ethernet and 2.4G and 5G
WiFi with internal antennas. It's based on MediaTek MT7628AN+MT7610EN.

Specifications
--------------

- MediaTek MT7628AN (580 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz and 1T1R 5 GHz
- 1x 10/100 Mbps Ethernet
- UART header on PCB (57600 8n1)
- 8x LED (GPIO-controlled), 2x button

There are 2.4G and 5G LEDs in red and green which are controlled
separately.

MAC addresses
-------------

The MAC address assignment matches stock firmware, i.e.:
LAN : *:0D
2.4G: *:0E
5G  : *:0F

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

Web Interface
-------------

It is possible to upgrade to OpenWrt via the web interface. Simply flash
the -factory.bin from OEM. In contrast to a stock firmware, this will not
overwrite U-Boot.

Serial console
--------------

Opening the case is quite hard, since it is welded together. Rename the
OpenWrt factory image to "test.bin", then plug in the device and quickly
press "2" to enter flash mode (no line feed). Follow the prompts until
OpenWrt is installed.

Unfortunately, this devices does not offer a recovery mode or a tftp
installation method. If the web interface upgrade fails, you have to open
your device and attach serial console.

Additonal notes
---------------

It is possible to flash back to stock by using tplink-safeloader to create
a sysupgrade image based on a stock update. After the first boot, it is
necessary upgrade to another stock image, otherwise subsequent boots
fail with LZMA ERROR 1 and you have to attach serial to recover the device.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
[remove DEVICE_VARS change]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 3227afbbab ramips: collect and harmonize TP-Link image variants in common file
This moves the various variants of common device definitions for
TP-Link devices to a common Makefile common-tp-link.mk. This
provides the opportunity to reorganize and move parameters between
individual device definitions and the common ones.

While at it, also use the common definitions for previously
independent definitions where appropriate.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Kevin Darbyshire-Bryant a1cfe0dcbb kernel: connmark set-dscpmark follow upstreamimg attempt
I'm having another attempt at trying to getting the 'store dscp into
conntrack connmark' functionality into upstream kernel, since the
restore function (act_ctinfo) has been accepted.

The syntax has changed from 'savedscp' to 'set-dscpmark' since that
conforms more closely with existing functionality.

4.14 backport is more of a hack since the structure versioning
mechanism isn't in place.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Roger Pueyo Centelles 633c4304ad ath79: add support for Ubiquiti NanoStation Loco M (XW)
This commit adds support for the NanoStation Loco M2/M5 XW devices
on the ath79 target (support was long ago available on ar71xx).

Specifications:

 - AR9342 SoC @ 535 MHz
 - 64 MB RAM
 - 8 MB SPI flash
 - 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
 - AR8032 switch
 - 2T2R 5 GHz radio, 22 dBm
 - 13 dBi built-in antenna
 - POWER/LAN green LEDs
 - 4x RSSI LEDs (red, orange, green, green)
 - UART (115200 8N1) on PCB

Flashing via TFTP:

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

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
4 years ago
Adrian Schmutzler 6c407fb5db ath79: do not set inherited phy-mode/status properties again
There are several cases where phy-mode and status properties are
set again in DTS(I) files although those were set to the same values
in parent DTSI files already. Remove those cases (and thus also stop
their proliferation by copy/paste).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler c8190713cb ath79: harmonize ethernet-phy naming scheme
A minority of ethernet-phy definitions seems to use numbers in label,
name and reg property relatively random. This patch aligns their
use to have the same numeric value for all of them.

While at it, improve order of properties/add newlines for the ethX
nodes where necessary.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 1ab81bf02d mediatek: mt7623: remove left-over fragments of mt7623a-rfb-emmc
The image creation for the mt7623a-rfb-emmc has been removed during
a patch refresh without specific comment. The corresponding base-files
entries and DTS patches for 4.14 are still there.

Since mt7623 is pretty dead and nobody has missed this device, let's
just remove the rest.

Fixes: 050da2107a ("mediatek: backport upstream mediatek patches")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: John Crispin <john@phrozen.org>
4 years ago
Jan Alexander 20eb45da4f ramips: use tpt DTS trigger for TP-Link TL-MR3020 v3 and TL-WA801ND v5
This converts the TP-Link TL-MR3020v3 board to use the WLAN throughput
LED trigger in order to react to all VAPs.

It also moves the WLAN trigger config of the TP-Link TL-WA801NDv5 to the
DTS and merges the now identical LAN LED configs.

Verified these changes on a TL-MR3020v3.

Signed-off-by: Jan Alexander <jan@nalx.net>
[changed commit title and extended commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 0cf889db00 Revert "ramips: fix NETGEAR R6260 EEPROM offset"
This reverts commit 4716c843d6.

Netgear seems to use different partition layouts on the R6260, which
would require us to dynamically detect the position of (at least) the
factory partition.

Revert this fix to avoid breaking existing installations until a better
solution has been worked out.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Daniel Golle 6015659e2b kernel: add support for XTX xt25f128 SPI-NOR flash chips
This fixes support for Teltonika RUT9xx which in recent versions of
the device uses xt25f128b flash.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Adrian Schmutzler 4ecd6510bf ramips: remove duplicate DEVICE_PACKAGES for TP-Link Archer C20i
DEVICE_PACKAGES is specified twice for the same device. Remove the
first (=older) assignment.

Fixes: 40692f0fb5 ("ramips: mt7620: select only the matching mt76 driver")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler b4d3110ac1 ath79: add support for GL.iNet 6408/6416 (GL.iNet V1)
This ports the GL.iNet 6408/6416 from ar71xx.

The GL-Connect GL.iNet v1 routers are basically a TP-Link TL-WR710N with
more DRAM/Flash and console/GPIO header in the same small form-factor.

Specifications:
 - SoC: Atheros AR9331
 - CPU: 400 MHz
 - Flash: 8/16 MiB
 - RAM: 64 MiB
 - WiFi: 2.4 GHz b/g/n (SoC)
 - Ethernet: 2x 100M ports (LAN/WAN)
 - USB: 1x 2.0

The difference between 6408 and 6416 is just the flash size. It looks like
only the 16 MiB version has been advertised, while the 6408 is a modified
version. There are also 1-port versions sold by third parties.

Installation:
Install the sysupgrade image via stock firmware GUI or upload it via uboot
(web-based). The device will be available at 192.168.1.1.

Attention: In ar71xx, the same board name is used for both flash versions.
So, please make sure you flash the correct ath79 image when upgrading.

This has been device-tested on a GL.iNet 6416.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 4716c843d6 ramips: fix NETGEAR R6260 EEPROM offset
The EEPROM offset for the NETGEAR R6260 is incorrect, thus no valid
calibration data is used.

Fix this only for the NETGEAR R6260, as it's currently unknown whether
or not other boards are affected.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer b30f2281cc ramips: add support for GL.iNet microuter-N300
The GL.iNet microuter-N300 (internally referred as MT300N-v4) is a
pocket-size travel router. It is essentially identical to the VIXMINI
(internally referred as MT300N-v3) but with double the RAM and
SPI-flash.

Additionally, set the label-mac for both the VIXMINI as well as the
microuter-N300.

Hardware
--------
SoC:   MediaTek MT7628NN
RAM:   128M DDR2
FLASH: 16M
LED:   Power - WLAN
BTN:   Reset
UART:  115200 8N1
       TX and RX are labled on the board as pads next to the SoC

Installation via web-interface
------------------------------
1. Visit the web-interface at 192.168.8.1
   Note: The ethernet port is by default WAN. So you need to connect to
   the router via WiFi

2. Navigate to the Update tab on the left side.

3. Select "Local Update"

4. Upload the OpenWrt sysupgrade image.
   Note: Make sure you select not to preserve the configuration.

Installation via U-Boot
-----------------------
1. Hold down the reset button while powering on the device.
   Wait for the LED to flash 5 times.

2. Assign yourself a static IPv4 in 192.168.1.0/24

3. Upload the OpenWrt sysupgrade image at 192.168.1.1.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 1e3bfbafd3 octeon: apply vendor_model scheme to device definition/image name
This updates the device definition name for octeon target to provide
more useful names for the images and be consistent with the increasing
number of targets following that scheme.

Since the target is not using device tree yet, this does not touch
board_name and thus sets BOARD_NAME in image Makefile to ensure
sysupgrade is still working.

While at it, move Build block before Device blocks and remove trailing
whitespace for CMDLINE.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 49d66e0468 mediatek: use consistent naming scheme for device nodes
This harmonizes the device node names (and thus the image names, too)
between subtargets of the mediatek target. So far, each subtarget
has somewhat used its own naming scheme. Now, we use the vendor_device
syntax there, too.

Since DTS names have different patterns and the target only contains
a few devices, this does not replace DEVICE_DTS by a calculated
default value (like for other targets).

SUPPORTED_DEVICES is adjusted based on the node rename where necessary,
though it looks like for several older devices it was not set up
correctly so far.

While at it, this also changes the DTS name for u7623-02-emmc-512m
to all-lower-case.

Cc: John Crispin <john@phrozen.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sven Roederer a20069e1af mvebu: remove bashism
"[[" is a bash extension for test. As the ash-implementation is not
fully compatible we drop its usage.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
[split patch, remove shebang, adjust commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Scott Roberts a461f984c4 kernel: sfp: add Nokia SFP fix from net-next
Add Nokia GPON ONT SFP fix for tx_fault in net-next.

Signed-off-by: Scott Roberts <ttocsr@gmail.com>
4 years ago
Christian Lamparter 016339ba42 ipq40xx: fix misplaced cells-sizes in WPJ419's dts
This patch fixes the occurences of the following warning
message from the dtc:

Warning (reg_format): /soc/spi@78b5000/flash0@0/partitions/partition@0:reg:
property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Yen-Ting-Shen 51f3035978 ipq40xx: add support for EnGenius EMD1
SOC:     IPQ4018 / QCA Dakota
CPU:     Quad-Core ARMv7 Processor rev 5 (v7l) Cortex-A7
DRAM:    256 MiB
NOR:     32 MiB
ETH:     Qualcomm Atheros QCA8072 (1 port)
WLAN1:   Qualcomm Atheros QCA4018 2.4GHz 802.11bgn 2:2x2
WLAN2:   Qualcomm Atheros QCA4018 5GHz 802.11a/n/ac 2:2x2
INPUT:   RESET Button
LEDS:    White, Blue, Red, Orange

Flash instruction:

From EnGenius firmware to OpenWrt firmware:

In Firmware Upgrade page, upgrade your openwrt-ipq40xx-generic-engenius_emd1-squashfs-factory.bin directly.

From OpenWrt firmware to EnGenius firmware:

1. Setup a TFTP server on your computer and configure static IP to 192.168.99.8
   Put the EnGenius firmware in the TFTP server directory on your computer.
2. Power up EMD1. Press 4 and then press any key to enter u-boot.
3. Download EnGenius firmware
   (IPQ40xx) # tftpboot 0x84000000 openwrt-ipq40xx-emd1-nor-fw-s.img
4. Flash the firmware
   (IPQ40xx) # imgaddr=0x84000000 && source 0x84000000:script
5. Reboot
   (IPQ40xx) # reset

Signed-off-by: Yen-Ting-Shen <frank.shen@senao.com>
[removed BOARD_NAME]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Fredrik Olofsson 52b8c7a892 ipq40xx: Add support for D-Link DAP-2610
Specifications
==============
- SOC: IPQ4018
- RAM: DDR3 256MB
- Flash: SPI NOR 16MB
- WiFi:
    - 2.4GHz: IPQ4018, 2x2, front end SKY85303-11
    - 5GHz: IPQ4018, 2x2, front end SKY85717-21
- Ethernet: 1x 10/100/1000Mbps, POE 802.3af
- PHY: QCA8072
- UART: GND, blocked, 3.3V, RX, TX / 115200 8N1
- LED: 1x red / green
- Button: 1x reset / factory default
- U-Boot bootloader with tftp and "emergency web server" accessible
  using serial port.

Installation
============
Flash factory image from D-Link web UI. Constraints in the D-Link web UI
makes the factory image unnecessarily large. Flash again using
sysupgrade from inside OpenWrt to reclaim some flash space.

Return to stock D-Link firmware
===============================
Partition layout is preserved, and it is possible to return to the stock
firmware simply by downloading it from D-Link and writing it to the
firmware partition.

    # mtd -r write dap2610-firmware.bin firmware

Quirks
======
To be flashable from the D-Link http server, the firmware must be larger
then 6MB, and the size in the firmware header must match the actual file
size. Also, the boot loader verifies the checksum of the firmware before
each boot, thus the jffs2 must be after the checksum covered part. This
is solved in the factory image by having the rootfs at the very end of
the image (without pad-rootfs).

The sysupgrade image which does not have to be flashable from the D-Link
web UI may be smaller, and the checksum in the firmware header only
covers the kernel part of the image.

Signed-off-by: Fredrik Olofsson <fredrik.olofsson@anyfinetworks.com>
[added WRGG Variables to DEVICE_VARS, squashed spi pinconf/mux,
added emd1's gmac0 config,fix dtc warnings]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Adrian Schmutzler 2dc0a8c180 lantiq: tidy up image/Makefile
This harmonizes indent for Build blocks and removes multiple empty
lines.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 719e106855 lantiq: fix setting SOC to DEFAULT_SOC
This adds the missing assignment of DEFAULT_SOC to the SOC variable
by default.

Fixes: 09ee51c614 ("lantiq: define SOC only once for uniform targets")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 09ee51c614 lantiq: define SOC only once for uniform targets
In lantiq there are several subtarget where all devices have the
same value set to the SOC variable for each device individually.

This patch introduces a non-device-dependent variable DEFAULT_SOC,
which is used if no specific SOC is set for a device, and thus reduces
the number of redundant definitions drastically.

This is applied to all subtargets except xway, as only the latter has
two different SOCs.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler d9a0794f8d lantiq: move DTS_DIR variable out of Device definition
The DTS_DIR variable is not a device variable, thus it should not
be set inside Device/Default but globally.

Fixes: c640370939 ("lantiq: use soc_vendor_device scheme on DTS file")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 44cb4fd5e6 lantiq: fix model name for BT Home Hub 3 Type A
The number 3 was accidentally removed from the name during split
of DEVICE_TITLE.

Fixes: fd66687058 ("lantiq: split up DEVICE_TITLE")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler dc862be301 ramips: define SOC only once for uniform targets
In ramips, all devices in mt7621, mt76x8 and rt288x subtarget have
the same value set to the SOC variable for each device individually.

This patch introduces a non-device-dependent variable DEFAULT_SOC,
which is used if no specific SOC is set for a device, and thus reduces
the number of redundant definitions drastically.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Kevin Darbyshire-Bryant daa218a288 kernel: act_ctinfo: really fix backport this time
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Kevin Darbyshire-Bryant 943cc81b0f kernel: act_ctinfo: fixup build error on 4.14
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Koen Vandeputte 40842167d2 kernel: bump 4.19 to 4.19.98
Refreshed all patches.

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
Kevin Darbyshire-Bryant 7a57e82f28 kernel: act_ctinfo: backport memory leak fix
[ Upstream commit 09d4f10a5e78d76a53e3e584f1e6a701b6d24108 ]

Implement a cleanup method to properly free ci->params

BUG: memory leak
unreferenced object 0xffff88811746e2c0 (size 64):
 comm "syz-executor617", pid 7106, jiffies 4294943055 (age 14.250s)
 hex dump (first 32 bytes):
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
   c0 34 60 84 ff ff ff ff 00 00 00 00 00 00 00 00  .4`.............
 backtrace:
   [<0000000015aa236f>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
   [<0000000015aa236f>] slab_post_alloc_hook mm/slab.h:586 [inline]
   [<0000000015aa236f>] slab_alloc mm/slab.c:3320 [inline]
   [<0000000015aa236f>] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3549
   [<000000002c946bd1>] kmalloc include/linux/slab.h:556 [inline]
   [<000000002c946bd1>] kzalloc include/linux/slab.h:670 [inline]
   [<000000002c946bd1>] tcf_ctinfo_init+0x21a/0x530 net/sched/act_ctinfo.c:236
   [<0000000086952cca>] tcf_action_init_1+0x400/0x5b0 net/sched/act_api.c:944
   [<000000005ab29bf8>] tcf_action_init+0x135/0x1c0 net/sched/act_api.c:1000
   [<00000000392f56f9>] tcf_action_add+0x9a/0x200 net/sched/act_api.c:1410
   [<0000000088f3c5dd>] tc_ctl_action+0x14d/0x1bb net/sched/act_api.c:1465
   [<000000006b39d986>] rtnetlink_rcv_msg+0x178/0x4b0 net/core/rtnetlink.c:5424
   [<00000000fd6ecace>] netlink_rcv_skb+0x61/0x170 net/netlink/af_netlink.c:2477
   [<0000000047493d02>] rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5442
   [<00000000bdcf8286>] netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
   [<00000000bdcf8286>] netlink_unicast+0x223/0x310 net/netlink/af_netlink.c:1328
   [<00000000fc5b92d9>] netlink_sendmsg+0x2c0/0x570 net/netlink/af_netlink.c:1917
   [<00000000da84d076>] sock_sendmsg_nosec net/socket.c:639 [inline]
   [<00000000da84d076>] sock_sendmsg+0x54/0x70 net/socket.c:659
   [<0000000042fb2eee>] ____sys_sendmsg+0x2d0/0x300 net/socket.c:2330
   [<000000008f23f67e>] ___sys_sendmsg+0x8a/0xd0 net/socket.c:2384
   [<00000000d838e4f6>] __sys_sendmsg+0x80/0xf0 net/socket.c:2417
   [<00000000289a9cb1>] __do_sys_sendmsg net/socket.c:2426 [inline]
   [<00000000289a9cb1>] __se_sys_sendmsg net/socket.c:2424 [inline]
   [<00000000289a9cb1>] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2424

Fixes: 24ec483cec98 ("net: sched: Introduce act_ctinfo action")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Felix Fietkau c6c4701def kernel: fix dst reference leak in flow offload
Fixes a significant amount of leaked memory with lots of connections

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
Adrian Schmutzler 07ce940b77 ath79: fix SUPPORTED_DEVICES not matching ar71xx board names
Based on a script for comparison, this fixes (hopefully) all errors
in SUPPORTED_DEVICES for ar71xx->ath79 upgrade.

Devices where old string is removed as the device does not exist
in ar71xx:
- dlink_dir-859-a1
- tplink_archer-a7-v5
- tplink_cpe510-v3

Devices where string is changed because it did not match the board
name in ar71xx:
- tplink_tl-mr3220-v1
- tplink_tl-mr3420-v1
- tplink_tl-wr2543-v1
- tplink_tl-wr741nd-v4
- tplink_tl-wr841-v7
- ubnt_unifiac-mesh
- ubnt_unifiac-mesh-pro
- ubnt_unifiac-pro

For this device, the correct string could not be found, but we could
not determine the correct one. Thus, the string is removed for now:
- tplink_tl-wr740n-v4

The script for checking this is quite simple (note that newer
entries, i.e. ath79->ath79 upgrade, are displayed as missing):

  newpath=target/linux/ath79/image/
  oldpath=target/linux/ar71xx/base-files/lib/ar71xx.sh

  for s in $(grep -roh "SUPPORTED_DEVICES.*" $newpath | sed 's/SUPPORTED_DEVICES *.= *//'); do
    found="Missing"
    grep -q -r "\"$s\"" $oldpath && found="Found"
    echo "$s: $found."
  done

The errors might be filtered by appending 'grep "Missing"' to the script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 071a637276 ath79: move lzma-loader to the end of available RAM
In certain cases, the uncompressed initramfs image will overwrite
the lzma-loader, which is currently only 10 MB away from kernel image
start. To prevent this, change LZMA_TEXT_START to 24 MB, so loader
and compressed image have 8 MB at the end of RAM and uncompressed
image has 24 MB available.

This is only enabled for ath79 at the moment, as there we can be sure
that all devices have 32+ MB RAM and TARGET_INITRAMFS_COMPRESSION_LZMA
is not enabled there.

Despite, since lzma-loader is currently build specifically for ath79
anyway, there is no need to re-specify LOADADDR and LZMA_TEXT_START
in image/Makefile, so the values are set directly in
image/lzma-loader/Makefile and the overwrite in image/Makefile is
removed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Roger Pueyo Centelles 6aaa5ce2c5 ath79: add support for MikroTik RouterBOARD wAP G-5HacT2HnD
This commit adds support for the MikroTik RouterBOARD wAP G-5HacT2HnD
(wAP AC), a small weatherproof dual band, dual-radio 802.11ac
wireless AP with integrated omnidirectional anntennae and one
10/100/1000 Mbps Ethernet port.

See https://mikrotik.com/product/RBwAPG-5HacT2HnD for more info.

Specifications:
 - SoC: Qualcomm Atheros QCA9556
 - RAM: 64 MB
 - Storage: 16 MB NOR
 - Wireless:
   · Atheros AR9550 (SoC) 802.11b/g/n 2x2:2, 2 dBi antennae
   · Qualcomm QCA9880 802.11a/n/ac 3x3:3, 2 dBi antennae
 - Ethernet: Atheros AG71xx (SoC, AR8033), 1x 1000/100/10 port,
   passive PoE in

Working:
 - Board/system detection
 - Sysupgrade
 - Serial console
 - Ethernet
 - 2.4 GHz radio
 - 5 GHz radio and LED
 - Reset button

Not working/Unsupported:
 - 2.4 GHz LED
 - AP/CAP LED
 - ZT2046Q SPI temperature and voltage sensor

This adds the basic features for supporting MikroTik devices:
 - a common recipe for mikrotik images in common-mikrotik.mk
 - support for minor (MikroTik NOR) split firmware (only for
   generic subtarget so far)

Acknowledgments: Robert Marko <robimarko@gmail.com>
                 Andrew Cameron <apcameron@softhome.net>
                 Koen Vandeputte <koen.vandeputte@ncentric.com>
                 Chuanhong Guo <gch981213@gmail.com>

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Co-developed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
David Bauer 26c2556775 ath79: allow to override AR8033 SGMII aneg status
In order to make the QCA955x SGMII workaround work, the unsuccessful
SGMII autonegotiation on the AR8033 should not block the PHY
state-machine.

Otherwise, the ag71xx driver never becomes aware of the copper-side
link-establishment and the workaround is never executed.

Signed-off-by: David Bauer <mail@david-bauer.net>
[remove one trailing whitespace per file]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
David Bauer 0d416a8d3b ath79: add QCA955x SGMII link loss workaround
This commit adds a workaround for the loss of the SGMII link observed on
the QCA955x generation of SoCs. The workaround originates part from the
U-Boot source code, part from the implementation from AVM found in the
GPL tarball for the AVM FRITZ!WLAN Repeater 450E.

The bug results in a stuck SGMII link between the PHY device and the SoC
side. This has only been observed with the Atheros AR8033 PHY and most
likely all devices using such combination are affected.

It is worked around by reading a hidden SGMII status register and
issuing a SGMII PHY reset until the link becomes useable again.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 6fe31abc5a kirkwood: exploit BOARD_NAME to set DEVICE_DTS and SUPPORTED_DEVICES
Due to the history of the target, all devices added before a certain
point have the same device string in BOARD_NAME, DEVICE_DTS and added
to SUPPORTED_DEVICES.

Thus, we can set this one automatically for all devices where
BOARD_NAME is specified, removing the explicit DEVICE_DTS and
SUPPORTED_DEVICES addition there.

For new devices, nothing has changed, and just DEVICE_DTS has to
be set manually.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler d0d8584b41 sunxi: tidy up and sort alphabetically in image Makefiles
This tidies up the image Makefiles for the sunxi target by:
- Move the if-condition for the subtarget to the parent Makefile
- Remove lots of unnecessary empty lines
- Sort device definitions alphabetically
- Harmonize line wrapping for DEVICE_PACKAGES

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
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 a66a1eb9c5 ath79: add support for TP-Link TL-WA850RE v2
TP-Link TL-WA850RE v2 is a wall-plug N300 Wi-Fi range extender,
based on Qualcomm/Atheros QCA9533 v2.

Short specification:

- 550/391/195 MHz (CPU/DDR/AHB)
- 1x 10/100 Mbps Ethernet
- 32 MB of RAM (DDR1)
- 4 MB of FLASH
- 2T2R 2.4 GHz
- 2x internal antennas (embedded on PCB)
- 9x LED (all can be turned off with GPIO15), 2x button
- UART (J3) header on PCB

Flash instruction: use "factory" image directly in vendor GUI.

Warning: this device does not include any kind of recovery mechanism
in the bootloader and disassembling process is not trivial.

You can access vendor firmware over serial line using:
- login: root
- password: sohoadmin

Stock firmware uses label MAC address for WiFi and same with local
bit set for ethernet. Since this is difficult to reproduce with
the toolset of OpenWrt, we just keep both ethernet and WiFi to
the same address here.

This is the first tiny device with tplink-safeloader in ath79.
Firmware partition is only 3648k and thus even smaller than for
the tplink-4m(lzma) devices.

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
David Bauer 5f4f269ce1 generic at803x: remove unneeded patches
- Remove the "RGMII TX delay fixup" hack and the associated
   DT-property. It was never used in a DT-based platform and
   solved a problem which can be mitigated by using correct
   delays on the MAC side.

 - Remove the patch to enable platform-data support for the
   at803x driver. It was only used by ar71xx which does not
   (and never will) support kernel 4.19 or later.

 - Remove the SmartEEE DT-configuration patch. As explained
   previously, this patch never disabled the Atheros SmartEEE
   implementation, but rather "standard" EEE. This can be done
   on device-tree compatible platforms by adding the
   "eee-broken-1000t" or "eee-broken-100tx" properties to the PHY
   node. As all usages of the old properties are migrated, this
   patch can be removed.

Signed-off-by: David Bauer <mail@david-bauer.net>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
David Bauer a8898f1a11 ath79: use upstream properties to disable EEE
The hack-patch which introduced the "at803x-disable-smarteee" for
disabling SmartEEE did in fact not disable SmartEEE but rather disabled
802.3az "standard" EEE.

This can be done by using the upstream properties "eee-broken-100tx" and
"eee-broken-1000t". EEE is then disabled by the PHY subsystem.

Tested on devolo WiFi pro 1200e.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 6eaea3a8ba 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>
4 years ago
Jonas Gorski 947163b9d2 kernel: sfp: re-attempt probing for phy
Add patches retrying to probe the PHY to restore support for PHYs taking
longer to initialize without breaking modules without PHYs.

Patches taken from http://git.armlinux.org.uk/cgit/linux-arm.git/log/?h=phy

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Jonas Gorski 10b12b5d68 kernel: sfp: add two fixes submitted to upstream
Add two small fixes for SFP that were submitted upstream.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Russell King 46678fbdca mvebu: add uDPU update patches
Update the uDPU kernel support, fixing a number of issues:
* make ethernet work again by adding comphy definitions
* slow the I2C bus to give it more chance of actually working
* the SFP cages are designed to support up to 3W modules, which
  would be prevented from initialising without this patch.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: rename to mvebu, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Russell King a1358fc7ae kernel: add SFP support for Methode DM7052 NBASE-T module
Add support for Methode DM7052 NBASE-T module to OpenWRT. These
patches are taken from my "phy" branch, and will be sent for the
next kernel merge window.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: move patches to pending, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Russell King 1c16b574c4 kernel: add backported phy/phylink/sfp patches
Backport the phy/phylink/sfp patches currently queued in netdev or in
mainline necessary to support GPON popular modules, specifically to
support Huawei and Nokia GPON modules.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: include kernel version in file names, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Russell King a07638eb24 kernel: move phylink patches from mvebu to generic
Move two phylink patches from mvebu to generic, so that everyone can
benefit from them.

Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: add kernel version to file names]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
4 years ago
Russell King e81a5b0556 kernel: remove obsolete phylink/SFP patches
Remove the old phylink/SFP patches from the OpenWRT build; these will
be updated with a new set in subsequent.

450-reprobe_sfp_phy is also removed for several reasons:
1) it is not in mainline.
2) it breaks copper modules that do not have a PHY.
3) it makes backporting the current patch set harder.

Discussion is ongoing with the patch author for a mainline Linux kernel
patch for this.

Signed-off-by: Russell King <linux@armlinux.org.uk>
4 years ago
Adrian Schmutzler 111a7a3d01 ath79: remove usused TPLINK_BOARD_NAME variable for DEVICE_VARS
TPLINK_BOARD_NAME has been renamed to TPLINK_BOARD_ID a long time
ago (7d6c63d87542: "build: rename TPLINK_BOARD_NAME to
TPLINK_BOARD_ID" for ar71xx), and before introducing ath79 target
at all.

TPLINK_BOARD_NAME seems to have been introduced into ath79 target
only by mistake. It has never been used. Remove it.

Fixes: 53c474abbd ("ath79: add new OF only target for QCA MIPS silicon")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Petr Štetiar 0c707d37b7 Revert "kernel: mtd: Make subpartitions inherit parent's access mode"
This reverts commit de80424f70 which needs
more work and testing as it broke at least jffs2 overlays at least on
ath79 platform, marking them as read-only, thus unusable:

 jffs2_build_filesystem(): erasing all blocks after the end marker...
 jffs2: Erase at 0x009e0000 failed immediately: -EROFS. Is the sector locked?

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2020-January/021344.html
Reported-by: Steve Brown <sbrown@ewol.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Adrian Schmutzler 2cb413de1c zynq: derive DEVICE_DTS from device definition name
In zynq target, the DEVICE_DTS variable is always set consistent
with the model part of the device definition name.

This patch replaces the redundant definitions for the individual
devices with a common recipe.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 1fa04b5d9f mvebu: split base-files across subtargets
For the mvebu target in particular, there is a lot of files in
base-files that are only relevant for one subtarget. Improve
overview and reduce size per subtarget by moving/splitting
base-files depending on the subtarget they belong to.

While at it, consolidate 01_leds by using the model part of
the board name as variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Adrian Schmutzler e93626f1f4 mvebu: use SOC to derive DEVICE_DTS
This introduces the SOC variable to mvebu target to derive some of
the DEVICE_DTS variables based on the SOC prefix and the device
definition name.

Since DTS names and compatible are inconsistent also in the kernel
for this target, the scheme cannot be applied to all devices, though.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Adrian Schmutzler 0a388b5bf7 mvebu: move subtarget image Makefile switch to parent Makefile
This moves the if conditions for choosing which image Makefiles
are used to the parent image/Makefile. It seems more convenient
to have "codeflow" in the parent while the subtarget-specific
files only contain the definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Acked-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Enrico Mioso b99b60b2f1 ath79: add support for TP-Link TL-MR6400
This device is an LTE router supported in ar71xx so far.
As per original commit, hardware specifications (v1.0 EU):
- SoC: QCA9531
- Flash: Winbond W25Q64FV (8MiB)
- RAM: EtronTech EM6AB160TSE-5G (64MiB)
- Wireless: SoC platform only (2.4GHz b/g/n, 2x internal antenna)
- Ethernet: 2NIC (3x100M + 1x100M)
- WWAN: TP-LINK LTE MODULE (2x external detachable antenna)
- Power: DC 12V 1A

Flashing instructions:
You can flash via tftp recovery (serve factory image as /mr6400_tp_recovery.bin
on 192.168.0.66/24, connect to any ethernet port and power on device while
holding the reset button). Flashing via OEM web interface does not work.

Known issues:
- LTE module does not always come up during boot (showing USB enumeration errors). Similar behavior has been reported at least from one user for ar71xx, too. Turning USB off and on again will serve as a workaround.
- eth0 (LAN) always shows carrier as 1 even if no cable is plugged in (this works "correctly" on ar71xx)

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
[several adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Filip Moc <lede@moc6.cz>
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
Michal Cieslakiewicz 0d28e5d644 ath79: fix SUPPORTED_DEVICES for WNDR4300 and WNDR3700v4
Kernel partition increase to 4 MiBs for Netgear WNDR3700v4 and WNDR4300
routers breaks sysupgrade image compatibility with ar71xx builds.
Therefore, SUPPORTED_DEVICES variable has to be removed for both devices
from target makefile.

Reported-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
4 years ago
Bruno Pena de80424f70 kernel: mtd: Make subpartitions inherit parent's access mode
Currently it's not possible to effectively mark a "firmware" partition
as read-only. The sub-partitions "kernel", "rootfs" and "rootfs_data"
are always created as read-write (ignoring the parent access mode).

This patch enforces the access mode of sub-partitions to match the
parent partition, which is useful for recovery images that are meant
to be fully read-only to avoid accidental damage from end-user.

An example of such implementation (read-only firmware image) is the
recovery image used on the Zsun-SD100 [1].

Please note the related patch for fstools [2] to enable this read-only
concept.

[1] https://github.com/brunompena/zsun-resources
[2] http://lists.infradead.org/pipermail/openwrt-devel/2020-January/021043.html

Signed-off-by: Bruno Pena <brunompena@gmail.com>
[removed already obsolete 4.9 kernel patch]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Koen Vandeputte 7adb0f9810 kernel: bump 4.19 to 4.19.97
Refreshed all patches.

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

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

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte 6cc7498daa kernel: bump 4.19 to 4.19.96
Refreshed all patches.

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

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

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Koen Vandeputte 692b91f56b kernel: bump 4.19 to 4.19.95
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.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
Walter Sonius 098cbc68ee brcm47xx: fix switch port order for Netgear WN2500RP V1
The Netgear WN2500RP V1 switch0 already works for LAN
however the port order for the LAN ports is inverted. Correct
physical port order watched from the back of the device is:
4 / 3 / 2 / 1
WAN port is absent on this device and therefore removed
from switch config.

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
[move block to maintain alphabetic sorting]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Maximilian Pachl 9e799f3eee ramips: apply LED_POLARITY rt3050-esw on MT7628AN/MT7688
The device tree property "mediatek,led_polarity" is ignored for
MT7628AN and MT7688. According to the datasheet both SoCs have
the matching register. Therefore the property should be applied
on these two devices as well.

Signed-off-by: Maximilian Pachl <m@ximilian.info>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
Tested-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Stephan Knauss fbf297be38 kirkwood: fix HDD LED labels for Zyxel NSA325 in 01_leds
Change the LED labels for hdd1/hdd2 in 01_leds to match their
counterpart in DTS.

Signed-off-by: Stephan Knauss <openwrt@stephans-server.de>
[improve commit title and message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Walter Sonius cf2f1fc687 brcm47xx: fix switch port order for Netgear WNR3500 V2
The Netgear WNR3500 V2 switch0 already works for WAN/LAN
however the port order for the LAN ports is inverted. Correct
physical port order watched from the back of the device is:
Internet / 4 / 3 / 2 / 1 this resembles the Linksys E3000 V1.

Verfied with imagebuilder edit FILES=/etc/board.d/01_network

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
4 years ago
Steffen Förster 93a4c8afbf ramips: add support for TP-Link RE305 v1
Specification:

SoC: MediaTek MT7628AN
RAM: 64MiB
Flash: 8MiB
Wifi:
  - 2.4GHz: MT7628AN
  - 5GHz: MT7612EN
LAN: 1x 10/100 Mbps

Flash instructions:
Flash factory image through stock firmware WEB UI.
Back to stock is possible by using TFTP and stripping down the Firmware
provided by TP-Link to a initramfs.

The flash space between 0x650000 and 0x7f0000
is blank in the stock firmware so I left it out as well.

Signed-off-by: Steffen Förster <nemesis@chemnitz.freifunk.net>
4 years ago
Sungbo Eo c26b687e31 kernel: remove further obsolete kernel version switches
Most of the kernel version switches below 4.14 were removed in commit
97940f8766 ("kernel: remove obsolete kernel version switches"),
but some of them still remained. Remove them now.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Adrian Schmutzler 8d78354d24 ath79: add led_ prefix for Phicomm K2T LED label
Using the led_ prefix for the node label is now common in ath79,
so also apply it here.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 9573176300 ath79: use rssihigh LED instead of WAN LED for status indication
Using the LED of network interfaces for status (boot/failsafe/...)
indication is somewhat misleading, as the blinking might be
mistaken for network activity. This uses rssi LEDs instead, which
do not blink normally and thus are less ambiguous.

The rssihigh LED has also been used consistently for the TP-Link CPE
devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler ca63d17531 octeon: remove redundant network setup
No need to have specific setup when default case does the same.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo f87281b295 ramips: rt305x: remove unnecessary mediatek,portmap
"#mediatek,portmap" is not a valid property name.

If mediatek,portmap equals 0x0, then the esw driver ditches it and uses
the default value, 0x3f.

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