Commit Graph

472 Commits (4e93d17f2a8d701349c1dabaab38c869a968e93c)

Author SHA1 Message Date
Tomasz Maciej Nowak 4e93d17f2a ath79: image: append metadata to routerstations and ja76pf2 images
This target enforces metadata check so add the necessary information. It
was previously removed because md5 sum check. When using these sysupgrade
images on ar71xx target the check would complain about them not matching.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit 077d06a1a5)
5 years ago
Tomasz Maciej Nowak b5a70a3fcd ath79: dts: fix ja76pf2 spi frequency
The frequency was filled acording the information from datasheet for
particular chip (Winbond 25Q128BVFG). Unfortunately this led to
coruption and introduced bad blocks on the chip. Reducing the frequency
to commonly used in ath79, made the board more stable and no new bad
blocks were spoted.

Fixes: b3a0c97 ("ath79: add support for jjPlus JA76PF2")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit c1db564cbc)
5 years ago
Jeff Kletsky 5a0a969e41 ath79: Restore GL.iNet GL-AR300M-Lite first-boot connectivity
The relationship between GMAC0 and GMAC1 and the kernel devices
eth0 and eth1 was reversed for many ath79 devices by commit 8dde11d521
ath79: dts: drop "simple-mfd" for gmacs in SoC dtsi

The GL-AR300M-Lite is a single-port device, with the "LAN" port of the
GL-AR300M board unpopulated and its sole port now referenced as eth1,
as a result of commit 8dde11d521. The device was unreachable on
first boot or fresh config.

By changing &eth1 (GMAC1) to an MFD, GMAC0 is able to associate with
the phy and is known by the kernel as "eth0".

Thanks to Chuanhong Guo for the suggestion of "simple-mfd"

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
(cherry picked from commit b90ea19860853dd538e704e3e4402686c316e43c)
5 years ago
Jeff Kletsky fb5a6d4926 ath79: Correct glinet, gl-ar300m-lite in 02_network
Previously, the board name for the GL-AR300M-Lite was incorrect
in 02_network, resulting in an unintended, fall-through condition
when initializing the network configuration.

While builds prior to commit 8dde11d521 (merged June 5, 2019)
    ath79: dts: drop "simple-mfd" for gmacs in SoC dtsi
functioned properly, the error was noted in resolving first-boot
connectivity issues related to the single-phy nature of the device
and the "swap" of eth0 and eth1 related to that commit.

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
(cherry picked from commit 549ea4dc1878d95ee2b752b8840d75a64a67b679)
5 years ago
Adrian Schmutzler 0b9f3c28ef ath79: remove invalid uses of ath9k_patch_fw_mac_crc
Some ar9344-based devices are using ath9k_patch_fw_mac_crc, which
is meant to generate a checksum, for fixing their ath9k MAC
addresses.
However, those do not have a checksum field, and the calculated
checksum offset would be negative.

This patch will use ath9k_patch_fw_mac function for those devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit f8d8b3f85d)
5 years ago
Rafał Miłecki c53a0ed5e3 treewide: sysupgrade: use $UPGRADE_BACKUP to check for backup
Now that $UPGRADE_BACKUP is set conditionally there is no need to check
the $UPGRADE_OPT_SAVE_CONFIG anymore. All conditions can be simplified.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a858db3136)
5 years ago
David Bauer 0e0f9ff93c ath79: fix UniFi AC LED mapping
The UniFi AC LED mapping is currently off. The blue/white LED are used
as WiFi indicators, while the vendor firmware does not feature WiFI
LEDs.

Instead, the LEDs are used to indicate the devices status. Align the LED
mapping to match the vendor firmware as good as possible.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 18fa749df8)
5 years ago
Rafał Miłecki a717428828 treewide: use new procd sysupgrade $UPGRADE_BACKUP variable
It's a variable set by procd that should replace hardcoded
/tmp/sysupgrade.tgz.

This change requires the most recent procd with the commit 0f3c136
("sysupgrade: set UPGRADE_BACKUP env variable").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 641f6b6c26)
5 years ago
Rafał Miłecki 5ae87c76b7 treewide: sysupgrade: don't use $ARGV in platform_do_upgrade()
stage2 passes image path to platform_do_upgrade() as an argument so it
can be simply accessed using $1

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 8b4bc7abe0)
[rmilecki: dropping ARGV without this change broke sysupgrade]
Fixes: 6ac62c4b6c ("base-files: don't set ARGV and ARGC")
5 years ago
David Bauer db7a1e7c04 ath79: correct OCEDO Ursus phy-mode property
This fixes the previously incorrect phy-mode for the OCEDO Ursus GMAC0.

See 62abbd587d ("ath79: correct various phy-mode properties")
for more details.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 7b137e9df9)
5 years ago
Rafał Miłecki afce041e2b treewide: fix invalid UPGRADE_OPT_SAVE_CONFIG spellings
That was a result of accidentally running "sed" twice on some files.

Fixes: 9b9412d55c ("treewide: replace remaining (not working now) $SAVE_CONFIG uses")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 1078de96e3)
5 years ago
Rafał Miłecki 9b9412d55c treewide: replace remaining (not working now) $SAVE_CONFIG uses
This var has been replaced by the $UPGRADE_OPT_UPGRADE_OPT_SAVE_CONFIG

Fixes: f25d164aca ("base-files: pass "save_config" option to the "sysupgrade" method")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 5797fe84a3)
5 years ago
Adrian Schmutzler f44725ce92 ath79: Merge cases in 11-ath10k-caldata
Cosmetical patch that just merges two cases.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 28baaaae82)
5 years ago
Karl Pálsson a5762b45c2 ath79: etactica-eg200: fix restore button
The button is labelled reboot/restore in documentation, and has always
been used for that.  Naming it WPS has always been wrong.

Signed-off-by: Karl Pálsson <karlp@etactica.com>
[matched author with SoB]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Koen Vandeputte 0a59e91973 ar71xx/ath79: ag71xx: dont fetch the same var again
tx_size was just declared above and set to BIT(tx->order)
Use the declaration instead, which could avoid a pointer deref

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 6852eab58236e3991f5d73f211018dfef01f2a64)
5 years ago
Koen Vandeputte 42b42d2c9b ar71xx/ath79: ag71xx: get ring_mask consistent
All other instances of this identical declaration fetch the
value directly from the ring_order.

Also do it here.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Adrian Schmutzler 10671619dc ath79: Fix whitespace errors in 11-ath10k-caldata
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 1174b94bc9)
5 years ago
Jo-Philipp Wich ce41f468e1 Revert "ath79: make target source-only"
This reverts commit 2b074654b0.

Due to popular demand, I've decided to revert this commit after
deliberating with Petr. This means that 19.07 will ship ath79 binary
images after all.

We do however consider the ath79 target on Kernel 4.14 in the 19.07
branch to be beta quality at best.

Acked-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Koen Vandeputte c8a6ce71e4 ar71xx/ath79: ag71xx: init rings with GFP_KERNEL
Upstream commit	246902bdf562d45ea3475fac64c93048a7a39f01

Which contains following explanation:

--
There is no need to use GFP_ATOMIC here, GFP_KERNEL should be enough.
The 'kcalloc()' just a few lines above, already uses GFP_KERNEL.
--

Looking at the code, all other descriptors also use plain GFP_KERNEL

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte dda342abba ar71xx/ath79: ag71xx: fix sleep in atomic
When enabling atomic-sleep-debugging options in the kernel,
following splat is seen when disabling the interface (which happens on boot):

[   10.892878] eth0: link down
[   10.896788] BUG: sleeping function called from invalid context at net/core/dev.c:5563
[   10.904730] in_atomic(): 1, irqs_disabled(): 1, pid: 425, name: ip
[   10.911004] 2 locks held by ip/425:
[   10.914539]  #0:  (rtnl_mutex){....}, at: [<80377474>] rtnetlink_rcv_msg+0x2d8/0x380
[   10.922441]  #1:  (&(&ag->lock)->rlock){....}, at: [<80330158>] ag71xx_hw_disable+0x24/0x94
[   10.930976] CPU: 0 PID: 425 Comm: ip Not tainted 4.14.136 #0
[   10.936716] Stack : 805e0000 80589228 80557404 876998ec 80610000 80610000 87cdcafc 805b5327
[   10.945233]         80551534 000001a9 8061386c 87699ccc 87cfb180 00000001 876998a0 84f70903
[   10.953751]         00000000 00000000 80b00000 8769979c 6a7407fa 00000000 00000007 00000000
[   10.962270]         000000b7 16d0954a 000000b6 00000000 80000000 87cb658c 87cb65b0 00000001
[   10.970787]         8046f97c 87699ccc 87cfb180 87ff2810 00000003 802ce724 0806e098 80610000
[   10.979306]         ...
[   10.981797] Call Trace:
[   10.984287] [<8006cb0c>] show_stack+0x58/0x100
[   10.988814] [<800aab34>] ___might_sleep+0x100/0x120
[   10.993774] [<8035c434>] napi_disable+0x30/0xd8
[   10.998377] [<80330198>] ag71xx_hw_disable+0x64/0x94
[   11.003418] [<8033069c>] ag71xx_stop+0x24/0x38
[   11.007959] [<80359e30>] __dev_close_many+0xcc/0x104
[   11.013009] [<80362eac>] __dev_change_flags+0xc8/0x1ac
[   11.018227] [<80362fb8>] dev_change_flags+0x28/0x70
[   11.023182] [<80376890>] do_setlink+0x31c/0x91c
[   11.027786] [<80379360>] rtnl_newlink+0x3ec/0x7f8
[   11.032563] [<80377498>] rtnetlink_rcv_msg+0x2fc/0x380
[   11.037799] [<8039a734>] netlink_rcv_skb+0xd4/0x178
[   11.042754] [<80399d10>] netlink_unicast+0x168/0x250
[   11.047796] [<8039a2d4>] netlink_sendmsg+0x3d8/0x434
[   11.052841] [<8033f0e4>] ___sys_sendmsg+0x1dc/0x290
[   11.057794] [<80340140>] __sys_sendmsg+0x54/0x84
[   11.062495] [<8007212c>] syscall_common+0x34/0x58

This is caused by calling napi_disable() while holding the spinlock.

Fix it by omitting the spinlock, which is not required here
Extensively tested on GL-MiFi, RB-912 and RB-922 hardware

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Petr Štetiar 2b074654b0 ath79: make target source-only
In order to prevent build of images for this release as ath79 is going
to deprecate ar71xx in the next release.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
David Bauer 5cd9b50d69 ath79: add support for devolo WiFi pro 1750x
Hardware
--------
CPU:   Qualcomm Atheros QCA9558
RAM:   128M DDR2
FLASH: 16MiB
ETH:   1x Atheros AR8035 (PoE in)
WiFi2: QCA9558 3T3R
WiFi5: QCA9880 3T3R
BTN:   1x Reset
LED:   1x LED Power (non-controllable)
       1x LED Status (internal)
       1x LED LAN (controlled by PHY)
       1x LED WLAN
BEEP:  1x GPIO attached piezo beeper
UART:  3.3V GND TX RX (115200-N-8) (3.3V is square pad)
       Header is located next to external-LED header.

Installation
------------
Make sure you set a password for the root user as prompted on first
setup!

1. Upload OpenWRT sysupgrade image via SSH to the device.
Use /tmp as the destination folder on the device.
User is root, password the one set in the web interface.

2. Install OpenWRT with

> sysupgrade -n -F /tmp/<openwrt-image-name>

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit cb3cd52694)
5 years ago
Adrian Schmutzler 96cc390d88 ath79: Use -v1 suffix for TP-Link WDR3600/4300
In ath79, identifiers tplink_tl-wdr3600 and tplink_tl-wdr4300 have
been used while most other TP-Link devices include the revision.

Although there actually is only one major revision of these
devices, they bear the revision on their bottom (v1.x). TP-Link
also refers to the devices as V1 on its web page.

This patch thus adds -v1 to both so it is more consistent
with other devices and with what you would expect from reading
the on-device sticker and the support pages.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Petr Štetiar 0254087e92 ath79: ar9330: add missing watchdog node
It was reported in FS#2385, that Carambola2 doesn't currently have
working watchdog so fix it by adding watchdog node.

Ref: FS#2385
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 0893f28e19)
5 years ago
Adrian Schmutzler 136c8a889f ath79: Add SUPPORTED_DEVICES for Archer C7 v1/v2
The identifier for both devices is "archer-c7" on ar71xx, set here:
https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L348
https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L511

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Koen Vandeputte 17fc5375f0 kernel: bump 4.14 to 4.14.127
Refreshed all patches.

Fixes:

- CVE-2019-11479
- CVE-2019-11478
- CVE-2019-11477

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 4089df4f4b kernel: bump 4.14 to 4.14.125 (FS#2305 FS#2297)
Refreshed all patches.

This bump contains upstream commits which seem to avoid (not properly fix)
the errors as seen in FS#2305 and FS#2297

Altered patches:
- 403-net-mvneta-convert-to-phylink.patch
- 410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Daniel Golle 000d400baa kernel: drop everything not on kernel version 4.14
* Remove testing patches for kernel version 4.19
 * remove targets ar7, ixp4xx, orion
Those targets are still on kernel 4.9, patches for 4.14 were not ready
in time. They may be readded once people prepare and test patches for
kernel 4.14.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Adrian Schmutzler fde0abf267 ath79: Add support for TP-Link Archer C25 v1
The TP-Link Archer C25 is a low-cost dual-band router.

Specification:

- CPU: Atheros QCA9561 775 MHz
- RAM: 64 MB
- Flash: 8 MB
- Wifi: 3x3 2.4 GHz (integrated), 1x1 5 GHz QCA9887
- NET: 5x 10/100 Mbps Ethernet

Some LEDs are controlled by an additional 74HC595 chip, but not
all of them as e.g. for the C59.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 409940cef4 ath79: Reorder some TP-Link Archer devices in 01_leds
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
David Santamaría Rogado e19506f206 ath79: migrate Archer C7 5GHz radio device paths
When upgrading a TP-Link Archer C7 v2 from ar71xx to ath79,
the 5ghz radio stops working because the device path changed.

Some people subtitute the unsupported QCA9880v1 in the Archer v1
with supported QCA9880v2 radio. Since the stock radio doesn't
work, so it's safe to apply the change also for the Archer v1
images as well.

Also this patch renames the migration file and variables from
wmac to wifi.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[removed comment, added return 0 (not that it matters since uci is
clever, see 00-wmac-migration thread), reworded commit message]
5 years ago
Adrian Schmutzler fcb920ffe7 ath79: Consistently label art partition with lower case
This patch harmonizes the label and alias for art partitions
across ath79. Since lower case seems to be more frequent, use that
consistently.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 4d807ad2d9 ath79: Read MAC addresses from flash in 11-ath10k-caldata
In commit c3a8518 eth0 and eth1 have been swapped for some devices,
but 11-ath10k-caldata has not been updated.
Instead of fixing this by swapping eth0/eth1, this patch will read
addresses from flash (as done for several devices already) so
adjustments due to eth order become obsolete.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 3d153323ab ath79: Consistently label info partition
The info/product-info partition, which frequently contains MAC
adresses, is typically assigned the 'info' alias in DTS, but
then labelled with 'info', 'product-info' or 'config'.

This leads to different aliases if used for setting MAC adresses
in DTS compared to when using e.g. mtd_get_mac_binary. Occationally,
also multiple switch-case entries are used just because of different
labelling.

This patch relabels those partitions in ath79 to consistently use
'info'.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Rytis Zigmantavičius 64493d42b4 ath79: add support for 8devices Carambola2 development board
Specifications:
- Atheros AR9331 (400 MHz)
- 64 MB of RAM (DDR2)
- 16 MB of Flash (SPI)
- 1T1R 2.4 Wlan (AR9331)
- 2x 10/100 Mbps Ethernet
- 3x LEDs, 1x gpio button
- 1x USB 2.0, 5V
- UART over usb, 115200n8

Upgrading from ar71xx target:
- Put image into board:
    scp openwrt-ath79-generic-8dev_carambola2-squashfs-sysupgrade.bin \
        root@192.168.1.1/tmp/
- Run sysupgrade
    sysupgrade /tmp/sysupgrade.bin

Upgrading from u-boot:
- Set up tftp server with sysupgrade.bin image
- Go to u-boot (reboot and press ESC when prompted)
- Set TFTP server IP
    setenv serverip 192.168.1.254
- Set device ip from same subnet
    setenv ipaddr 192.168.1.1
- Copy new firmware to board
    tftpboot 0x81000000 sysupgrade.bin
- erase flash
    erase 0x9f050000 +${filesize}
- flash firmware
    cp.b 0x81000000 0x9f050000 ${filesize}
- Reset board
    reset

Signed-off-by: Rytis Zigmantavičius <rytis.z@8devices.com>
[wrapped long line in commit description, whitespace and art address
 fix in DTS, keep default lan/wan setup, removed -n in sysupgrade]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Kristian Evensen 046263095e ath79: Add support for ZBT-WD323
ZBT-WD323 is a dual-LTE router based on AR9344. The detailed
specifications are:

* AR9344 560MHz/450MHz/225MHz (CPU/DDR/AHN).
* 128 MB RAM
* 16MB of flash(SPI-NOR, 22MHz)
* 1x 2.4GHz wifi (Atheros AR9340)
* 3x 10/100Mbos Ethernet (AR8229)
* 1x USB2.0 port
* 2x miniPCIe-slots (USB2.0 only)
* 2x SIM slots (standard size)
* 4x LEDs (1 gpio controlled)
* 1x reset button
* 1x 10 pin terminal block (RS232, RS485, 4x GPIO)
* 2x CP210x UART bridge controllers (used for RS232 and RS485)
* 1x 2 pin 5mm industrial interface (input voltage 12V~36V)
* 1x DC jack
* 1x RTC (PCF8563)

Tested:
- Ethernet switch
- Wifi
- USB port
- MiniPCIe-slots (+ SIM slots)
- Sysupgrade
- Reset button
- RS232

Intallation and recovery:

The board ships with OpenWRT, but sysupgrade does not work as a
different firmware format than what is expected is generated.  The
easiest way to install (and recover) the router, is to use the
web-interface provided by the bootloader (Breed).

While the interface is in Chinese, it is easy to use. First, in order to
access the interface, you need to hold down the reset button for around
five seconds. Then, go to 192.168.1.1 in your browser. Click on the
second item in the list on the left to access the recovery page. The
second item on the next page is where you select the firmware.  Select
the menu item containing "Atheros SDK" and "16MB" in the dropdown close
to the buttom, and click on the button at the bottom to start
installation/recovery.

Notes:
* RS232 is available on /dev/ttyUSB0 and RS485 on /dev/ttyUSB1

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
[removed unused poll-interval from gpio-keys, i2c-gpio 4.19 compat]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Chuanhong Guo c3a8518918 ath79: fix default config for devices with eth0/eth1 swapped
also fix the following problems in this commit:
glinet,gl-ar150: This router uses an uncommon order of setting up gmacs
                 in ar71xx. gmac0 is preferred to be wan port because of
                 the additional link status info available. So this
                 router will have eth0/eth1 swapped comparing to ar71xx.
tplink,tl-wr710n-v1: same as gl-ar150
embeddedwireless,dorin: eth0 is used as switch port, which was incorrect.
                        It's correct now, so keep this one untouched.
tplink,tl-wr842n-v1: we don't swap PHYs on ar7241 so the original port order
                     is incorrect.
reorder archer-a7-v5 entry.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Chuanhong Guo 8dde11d521 ath79: dts: drop "simple-mfd" for gmacs in SoC dtsi
With a proper probe deferring for ag71xx we don't need to explicitly
probe mdio1 before gmac0.
Drop all "simple-mfd" in SoC dtsi so that gmac orders can be the same
as ar71xx.
This makes eth0/eth1 order the same as those in ar71xx, which means
we don't need a migration script for this anymore and we can merge
incorrectly split gmac/mdio driver back together.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Chuanhong Guo 32817580e7 ath79: ag71xx: defer probe if of_phy_connect failed
gmac0 may need a phy on builtin switch, which can be unavailable
if gmac0 is probed before builtin switch.
Return -EPROBE_DEFER in this case so that gmac0 can be probed
later.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Chuanhong Guo f84715d463 ath79: rework LED configurations for tplink,archer-d50-v1
The original one has the following problem:
1. Port mask of lan led includes wan port.
2. By using netdev trigger with vlan port, the link led
   is always on.

This commits fixes the above problems by correcting port
mask for lan led and use swconfig trigger for wan leds.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Petr Štetiar 206af613b2 ath79: ag71xx: update ethtool support
ethtool doesn't work currently as phy_ethtool_ioctl expects user space
pointer, but it's being passed kernel one. Fixing it doesn't make sense
as {s,g}et_settings were deprecated anyway.  So let's rather remove
phy_ethtool_ioctl and use new {s,g}et_link_ksettings instead. While at
it, update nway_reset as well.

Cc: John Crispin <john@phrozen.org>
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1982
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar 5fee0a0923 ath79: ag71xx: remove unused SIOCETHTOOL ioctl handling
This ioctl is currently routed through generic interface code:

 dev_ioctl
   dev_ethtool
     __ethtool_get_link_ksettings
       phy_ethtool_ioctl

Cc: John Crispin <john@phrozen.org>
Cc: Chuanhong Guo <gch981213@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
David Bauer b8236e102c ath79: fix QCA955x GMAC register size
The register size of the QCA955x currently matches the size stated in
the datasheet. However, there are more hidden GMAC registers which are
needed for the SGMII workaround to work.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Santamaría Rogado 4d6da05683 ath79: add leds migrations for archer-c7-v2 and v4
In ar71xx v2 has blue color defined because the same mach-*.c is also used
for TL-WDR4900 model with blue leds. ath79 v2 dts defines them as green.

For v4 the situation is the same as v5 so the conversion is identical only
v4 instead v5.

So now upgrading from ar71xx to ath79 should be also smoother for v2 and v4.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
5 years ago
Petr Štetiar 99c52251cc ath79: ecb1750: additional dts fixes
This patch fixes following missing bits:

 - add missing 'compatible' property on firmware partition
 - set vendor partition 'userconfig' read-only

Fixes: 30dcbc741d ("ath79: add support for EnGenius ECB1750")
Signed-off-by: Sven Friedmann <sf.openwrt@okay.ms>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Ryan Mounce 6d6985ff0e ath79: add support for WD My Net N750
SoC: AR9344
RAM: 128MB
Flash: 16MiB Winbond 25Q128BVFG SPI NOR
5GHz WiFi: AR9380 PCIe 3x3:3 802.11n
2.4GHz WiFi: AR9344 (SoC) AHB 2x2:2 802.11n

5x Gigabit ethernet via AR8327N switch (green + amber LEDs)
2x USB 2.0 via GL850G hub
4x front LEDs from SoC GPIO
1x front WPS button from SoC GPIO
1x bottom reset button from SoC GPIO

Known issues:
AR8327N LEDs only have default functionality, not presented in sysfs.
This is a regression from ar71xx.

UART header JP1, 115200 no parity 1 stop
TX
GND
VCC
(N/P)
RX

See https://openwrt.org/toh/wd/n750 for flashing detail.
Procedures unchanged from ar71xx.

Tested sysupgrade + factory flash from WD Emergency Recovery

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
5 years ago
Koen Vandeputte 8eb7cf0cd7 kernel: bump 4.19 to 4.19.44
Refreshed all patches.

Remove upstreamed:
- 103-MIPS-perf-ath79-Fix-perfcount-IRQ-assignment.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Alexander Wördekemper 0f6b944c92 ath79: glinet_gl-ar750s: Add USB power & microSD
The GL.iNet AR750S USB and microSD port is currently not working out of
the box.  GPIO 7 is used to control the power of the USB port. Add GPIO
7 as a fixed-regulator for the port.  Also add &usb1 to DTS to get the
microSD port to work.

Signed-off-by: Alexander Wördekemper <alexwoerde@web.de>
5 years ago
Petr Štetiar 4318bba0e9 ath79: add leds migrations for archer-c7-v5
ar71xx uses `archer-c7-v5` for led prefix, but ath79 sticks to more
generic `tplink` as the DTS is reused by more boards, so we need to
perform migrations of the LED names during upgrade.

Cc: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar 6648e9458f ath79: set mib-poll-interval on mdio0 attached ar83xx switch
Commit "generic: ar8216: add mib_poll_interval switch attribute" sets
mib-poll-interval as disabled by default (was set to 2s), so it makes
switch LEDs trigger disfunctional on devices which don't have
mib-poll-interval set.

So this patch sets mib-poll-interval to 500ms on devices which have
ar83xx switch connected to mdio0 bus, as the same value was set for
built in switches in 443fc9ac35 ("ath79: use ar8216 for builtin
switch").

Some measurements performed on TP-Link Archer C7-v5:

 mib-type=0, mib-poll-interval=500ms (10s pidstat)

  Average:  %usr %system  %guest   %wait    %CPU   CPU  Command
  Average:  0.00    1.93    0.00    0.00    1.93     -  kworker/0:2

  iperf3 (30s): 334 Mbits/sec

 mib-type=0, mib-poll-interval=2s (10s pidstat)

  Average:  %usr %system  %guest   %wait    %CPU   CPU  Command
  Average:  0.00    1.14    0.00    0.00    1.14     -  kworker/0:2

  iperf3 (30s): 334 Mbits/sec

So it seems like we get 4x faster LED refresh rate for additional 0.8%
CPU load.

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