Commit Graph

22150 Commits (32726846c85985fbc320d123a7b26b32124cd47a)

Author SHA1 Message Date
Ansuel Smith efc5be2ecf ipq806x: fix tsens driver
Rework tsens driver.
Since in the new kernel 5.4 init common do more than it
should, inizialize the kernel memory directly in the driver and
drop use of this function. Rework all the patch with the new
variable names.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith c692d896eb ipq806x: rework L2 cache patch
Rework l2 scaling patch to fix some compile warning
and to imporve the caling timings by removing call to unnecessary
function.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 583111c124 ipq806x: update nvmem cpufreq driver
Rework the nvmem cpufreq driver to reflect changed in
kernel 5.4

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith eaceb85ebc ipq806x: drop upstream patch
This patchset has been merged upstream.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 71eb7b057b ipq806x: refresh patches for kernel 5.4
Refresh patches and minor changes for new kernel support

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 68b526e0a4 ipq806x: correct wrong node in r7800 dts
A mux node was missing in the gpio node of the r7800 dts.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith d4c95b5d5c ipq806x: use correct definition for nand-controller node
From kernel Documentation this should be called nand-controller

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 851862cf80 ipq806x: include ipq806x-v1.0 dtsi
Since this dtsi now have wrong definition in the upstream version,
include it to overwrite and remove any problem.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 57ea767a53 ipq806x: remove skeleton definition
This was already deprecated. With kernel 5.4 it has been removed.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Ansuel Smith 9a1ec4d3f4 ipq806x: copy files to kernel 5.4
Copy files to kernel 5.4 to start porting.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years ago
Pawel Dembicki 8438ad26d9 kirkwood: switch kernel version to 5.4
5.4 support is ready and tested.

Compile tested: all target devices
Run tested: pogoplug v4, nsa310b and two unofficial supported devices

Tested-by: Sungbo Eo <mans0n@gorani.run>
Tested-by: Alberto Bursi <alberto.bursi@outlook.it> [pogoplug v4 and nsa310b]
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[fixed the switch, removed maintainer variable]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Pawel Dembicki 61b4018763 kirkwood: fix switch dts node in EA4500 and EA3500
Changes made in switch nodes in d42c9ce commit causes problem with
correct mvsw61xx detection. This commit undo that changes.

mvsw61xx is platform driver, so it need to be in main root of dts.

Fixes: d42c9ce326 ("kirkwood: add kernel 4.19 support")

Tested-by: Marcin Fedan <mfedan@gmail.com> [EA4500]
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years ago
Pawel Dembicki 45e47a9cd7 kirkwood: initial refresh of 5.4 patches
Refreshed all patches.
Changed:
105-ea4500.patch-> Upstream DSA driver was updated. Patch was fixed
202-linksys-find-active-root.patch -> Upstream driver was moved. Patch
was fixed

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years ago
Pawel Dembicki 43a1767afb kirkwood: initial refresh 5.4 config
Refreshed kernel config with updated NAND config.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years ago
Pawel Dembicki 7a3a99c8a6 kirkwood: copy files and config from 4.19 to 5.4
This commit is simple copy config, files and patches from 4.19 to 5.4
kernel. No changes was done.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years ago
Alan Swanson 401023ae51 mediatek: update uci-defaults for renamed smp packet steering option
Leave as enabled by default for mediatek. Also remove obsolete
settings from when packet steering was moved from netifd to a
simplified hotplug script.

Signed-off-by: Alan Swanson <reiver@improbability.net>
4 years ago
Yousong Zhou d83150e3fb ramips: mt7530: more detailed output for unexpected etag_ctrl
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years ago
Yousong Zhou 2408f2f08f ramips: mt7530: remove redundant global attrs for port mirroring
Global attributes enable_mirror_tx/enable_mirror_rx depend on runtime
value of another global attribute mirror_source_port which just resides
in the memory

The same functionality can be achieved by directly setting port
attribute of the same names.  E.g. the following two groups of commands
achieve the same thing

	swconfig dev switch0 set mirror_source_port 3
	swconfig dev switch0 set enable_mirror_tx 1
	swconfig dev switch0 set mirror_source_port 4
	swconfig dev switch0 set enable_mirror_tx 1

	swconfig dev switch0 port 3 set enable_mirror_tx 1
	swconfig dev switch0 port 4 set enable_mirror_tx 1

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years ago
Rafał Miłecki 0493d57e04 bcm53xx: fix ASUS firmwares to use vendor format
Image building process was missing "asus-trx" step which resulted in raw
TRX files (without ASUS footer with device id).

Fixes: 0b9de8daa7 ("bcm53xx: add profiles for all other (SoftMAC) devices")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years ago
Kevin Darbyshire-Bryant 364739a491 kernel: x86_64: drop CALGARY IOMMU on 5.4
It's snuck back in on kernel 5.4 configs, so drop it there too.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years ago
Petr Štetiar ef3c71464a ramips: mt7620: disable images for Netgear 2700
Because openwrt-ramips-mt7620-netgear_ex2700-squashfs-factory.bin is too big.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
David Bauer 4349d4c682 ar71xx: add missing LED migration for Archer C7
When changing the LED names for the Archer C7 to represent the correct
color, a migration for existing UCI entries was not created.

Add a migration to keep existing LED configurations working.

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

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Tomasz Maciej Nowak b9c1cf1657 x86: add preinit hook for bootloader upgrade
This commit fills the void for current OpenWrt installations which will
be still on old bootloader version even after "x86: add bootloader
upgrade on sysupgrade", since it performs bootloader upgrade only on
sysupgrade. To keep all OpenWrt deploynents on the same GRUB version,
add preinit hook, which will perform upgrade of the bootloader on first
boot after sysupgrade.

It's temporary solution and should be deleted, when the first release
including this hook will no longer be supported by OpenWrt team.
We can assume that all installations should be on current bootolader
version and from there sysupgrade routine will be sufficient.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Tomasz Maciej Nowak b322243d2f x86: add bootloader upgrade on sysupgrade
Currently bootloader always stays on the same version as when first
written to boot medium (not true if partition layout changed, which will
trigger sysupgrade process to write full disk image). That creates
inconveniences as it always stays with same features or/and bugs. Users
wishing to add support to additional modules or new version, would need
to write the whole image, potentially destroying previous system
configuration. To fix these, this commit adds additional routine to
sysupgrade which upgrades unconditionally the bootloader to the latest
state provided by OpenWrt.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Tomasz Maciej Nowak 48873ace4e x86: image: cleanup before creating image
There can be some leftovers from other image recipes, if the same
directory names are used and multiply image types are selected.
Therefore remove directories used in the recipe, before contents for the
image are prepared.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Tim Harvey b246a0f2ff imx6: 5.4: dts: backport lsm9ds1 imu support for GW553x
Add one node for the accel/gyro i2c device and another for the separate
magnetometer device in the lsm9ds1.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
[commit subject/description tweaks, kernel version in patch filename]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Tim Harvey 4c3c1f2dc7 kernel: 5.4: backport fxos8700 accel support from 5.5
Backport kernel module from 5.5 for FXOS8700CQ, which is a small,
low-power, 3-axis linear accelerometer and 3-axis magnetometer combined
into a single package. The device features a selectable I2C or
point-to-point SPI serial interface with 14-bit accelerometer and 16-bit
magnetometer ADC resolution along with smart-embedded functions.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
[added commit description]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Tomasz Maciej Nowak 66f80020f9 mvebu: uDPU: drop patch compiling dtb
If device recipe has specified DEVICE_DTS variable, the dtb is built
anyway by OpenWrt buildroot image rules. Drop the patch and adjust the
location of compiled dtb.

Cc: Scott Roberts <ttocsr@gmail.com>
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Tomasz Maciej Nowak a51b4ec94d mvebu: image: rework uDPU-firmware recipe
Tar has ability to change current dir, so use that instead additional
command invocation. Also being here, change tar arguments to make final
archive reproducible.

Cc: Scott Roberts <ttocsr@gmail.com>
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Tomasz Maciej Nowak 39d22554f3 mvebu: uDPU: clean package selection
This device receipe selects bunch of packages which some are re-defined,
unnecessary or irrelevant. Clean them up, so only basic functionality
persist.

Cc: Scott Roberts <ttocsr@gmail.com>
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
Tomasz Maciej Nowak 97491078f4 mvebu: image: keep global DTS_DIR intact
Don't rewrite global DTS_DIR, instead, use proper variable for
specifying devices dts directory. For consistency, also specify the
variable in default profile, as suggested by Adrian Schmutzler.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
4 years ago
David Bauer 1d4f2ca610 ar71xx: correct AVM FRITZ Repeater 450E WPS button flag
The AVM FRITZ!WLAN Repeater 450E's WPS button is not active low.

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

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Álvaro Fernández Rojas 854114800c linux-5.4: backport ARM symbol export fix
Fixes the following warning for ARM targets:
  WARNING: "return_address" [vmlinux] is a static EXPORT_SYMBOL_GPL

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 6f9bc70dd5 linux-5.4: backport modpost upstream patches
Fixes modpost Segmentation Fault with bcm2708 and bcm2709:
  MODPOST vmlinux.o
  Segmentation fault
  make[6]: *** [scripts/Makefile.modpost:66: __modpost] Error 139

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas 4bde37a2dd bcm27xx: bcm2708: refresh linux 5.4 config
I missed this when adding linux 5.4 support

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
David Bauer ab27c72deb mpc85xx: disable kernel uImage generation
The previous workaround for the unsupported mkimage xz compression
leads to the TP-Link TL-WDR4900s simpleImage bootwrapper being gzip
compressed, which does not fit the kernel partition.

Removing the uImage gerneration works around this problem.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer 0d727f231f treewide: move commonly disabled symbols to generic config
Move new commonly disabled kernel 5.4 symbols to the generic kernel
configuration.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer 085b445b42 mpc85xx: add missing kernel symbols
These symbols were previously not set. Define their state to avoid
potentially breaking builds.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Christian Lamparter 1c880f2324 apm821xx: remove gpio-interrupt cruft
This hunk became obsolete the moment when our
gpio-button-hotplug learned how to deal with
interrupt-supported gpio buttons. The gpio driver
never supported interrupt handling, so these
properties never served any use (outside of a
enhanced ppc4xx-gpio driver that was dropped).

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Álvaro Fernández Rojas a1383655cf bcm27xx: add linux 5.4 support
Tested on bcm2710 (Raspberry Pi 3B).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas a8aa974a9d bcm27xx: update kernel configs
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
Álvaro Fernández Rojas c56ae22db0 bcm27xx: update to latest patches from RPi foundation
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 years ago
David Bauer 71f3179fc8 spi: ath79: remove spi-master setup and cleanup assignment
This removes the assignment of setup and cleanup functions for the ath79
target. Assigning the setup-method will lead to 'setup_transfer' not
being assigned in spi_bitbang_init.

Also drop the redundant cleanup assignment, as this also happens in
spi_bitbang_init.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer fc161063f5 mpc85xx: move NAND symbol to target config
All mpc85xx subtargets utilize NAND, thus enable NAND support
target-wide.

Fixes: 1287bb48dc ("mpc85xx: fix build with kernel 5.4")

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
David Bauer 1287bb48dc mpc85xx: fix build with kernel 5.4
This fixes some outstanding issues with the Kernel 5.4 build:

 * Adds missing support patch for the Enterasys WS-AP3710i
 * Fixes incorrect NAND symbols
 * Adds patch for broken image wrapping

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Christian Lamparter a2ae9a07d2 apm821xx: 5.4: add important NAND symbols
This patch adds important NAND config symbols.
These are necessary as otherwise the devices
won't find the rootfs on the NAND chips.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Christian Lamparter 91a7c9c27d ipq40xx: 5.4: refresh patches and config
This patch just refreshes the 5.4 patches. It seems as if
070-v4.20-soc-qcom-spm-add-SCM-probe-dependency.patch is
already applied, so drop it. It also does a quick
make kernel_oldconfig to get rid of unneeded symbols.

[Looks like USB and Ethernet need some more work].

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Christian Lamparter e48465bdd8 kernel: 5.4: add unconfigured symbols
This patch adds a few more symbols that I found that
need disabling in order to not break the automatic build.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Eneas U de Queiroz 13b8404b1e ipq40xx: qce - add fixes for AES ciphers
This backports commits from master that fix AES ciphers when using the
qce driver:

 - A couple of simple fixes for CTR and XTS modes used with AES:
   * 041-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch
   * 042-crypto-qce-fix-xts-aes-qce-key-sizes.patch

 - A fix for a bug that affected cases when there were more entries in
   the input sg list than necessary to actually encrypt, resulting in
   failure in gcm, where the authentication tag is present after the
   encryption data:
   * 043-crypto-qce-save-a-sg-table-slot-for-result-buf.patch

 - A fix to update the IV buffer passed to the driver from the kernel:
   * 044-crypto-qce-update-the-skcipher-IV.patch

 - A patch that reduces memory footprint and driver initialization by
   only initializing the fallback mechanism where it is actually used:
   * 046-crypto-qce-initialize-fallback-only-for-AES.patch

 - Three patches that make gcm and xts modes work with the qce driver,
   and improve performance with small blocks:
   * 047-crypto-qce-use-cryptlen-when-adding-extra-sgl.patch
   * 048-crypto-qce-use-AES-fallback-for-small-requests.patch
   * 049-crypto-qce-handle-AES-XTS-cases-that-qce-fails.patch

 - A patch that allows the hashes/ciphers to be built individually.
   * 051-crypto-qce-allow-building-only-hashes-ciphers.patch

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
[renumbered patches, added patches from dropped commit, refreshed, 5.4]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
Eneas U de Queiroz ee4a0afdcd ipq40xx: use neon crypto drivers
This adds the neon based implementations of AES & SHA256.

For AES, according to the kernel config help:

Use a faster and more secure NEON based implementation of AES in CBC,
CTR and XTS modes.
Bit sliced AES gives around 45% speedup on Cortex-A15 for CTR mode
and for XTS mode encryption, CBC and XTS mode decryption speedup is
around 25%. (CBC encryption speed is not affected by this driver.)
This implementation does not rely on any lookup tables so it is
believed to be invulnerable to cache timing attacks.
...
The observed speedups on ipq40xx are more modest: speedup is around 20%
for CTR mode and for XTS mode encryption, CBC and XTS mode decryption
speedup is around 10%. Measurements were made using tcrypt, with
1024-bytes blocks for CTR & CBC, and 4096-bytes for XTS.
The aes-neon-bs driver uses a fallback for CBC encryption; that fallback
could be either the generic driver written in C, or the scalar arm-asm
one.  Even though aes-arm is 1.9% slower, it is more resilient to timing
attacks (the reason for being slower), so it is being included here.

The neon sha256 module increases performance over the generic module by
33%.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
[Enable only ciphers for now, reorder patch in series to help bisect
as new symbols could lead to build failures, 5.4]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
4 years ago
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