Commit Graph

925 Commits (1634461bd208f4bd108ea5c3d3f1cf9eb56d4a7e)

Author SHA1 Message Date
Sungbo Eo 58dc1d0637 ar71xx: fix sysupgrade for Arduino Yun
Commit bb46b635df changed its partition scheme, but sysupgrade image
validation still uses the old format. This commit fixes it so that
force flag is not needed for sysupgrade.

Fixes: bb46b635df ("ar71xx: move Arduino Yun to generic building code")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Thibaut VARÈNE e995577e70 ar71xx/mikrotik: ath10k: use new sysfs driver
Fetch ath10k calibration data from new mikrotik sysfs driver

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Jan Alexander d394c354ee ar71xx: use status led for GL.iNet GL-AR750S
Use power led for device status.

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

Signed-off-by: Jan Alexander <jan@nalx.net>
[minor commit title/message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 281785d74f ar71xx: remove hard-coded folder name from Mikrotik RB upgrade
So far, specifying "BOARD_NAME := routerboard" is required by the
upgrade code of Mikrotik NAND devices, as "sysupgrade-routerboard"
is hardcoded in platform_do_upgrade_mikrotik_rb().

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

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

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

Add this information to 02_network.

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

Remove the useless adjustment.

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

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

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

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

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

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

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

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

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 years ago
Sungbo Eo 9b02d32e34 ar71xx: fix MAC address setup for TL-WDR4300 board
The current ethernet MAC address setup of TL-WDR4300 board is different
from the setup of stock firmware:

OpenWrt: lan = label_mac -2, wan = label_mac -2
  stock: lan = label_mac,    wan = label_mac +1

This patch applies to all devices using TL-WDR4300 board:
TL-WDR3600 v1
TL-WDR4300 v1
TL-WDR4300 v1 (IL)
TL-WDR4310 v1
Mercury MW4530R v1

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
5 years ago
David Bauer 9e1e432469 ar71xx: indicate upgrade using system LED
This enables the system LED to indicate a running firmware upgrade. This
pattern is used on most platforms provided by the generic base-files
package. ar71xx uses it's own implementation for the system-LED, where
the upgrade case is not yet implemented.

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

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

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

Fixes: FS#408

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

Signed-off-by: 南浦月 <nanpuyue@gmail.com>
[commit message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Andreas Ziegler 2bc7c519dc ar71xx: add model detection for UniFi AC-LR
This commit adds correct model detection for UniFi
AC-LR. Previously, said device was incorrectly detected
as UniFi-AC-LITE/MESH.

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

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

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

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

Installation:
- Flash factory image through stock firmware WEB UI or through TFTP
- To get to TFTP recovery just hold reset button while powering on
  for around 4-5 seconds and release.
- Rename factory image to recovery.bin
- Stock TFTP server IP: 192.168.0.100
- Stock device TFTP address: 192.168.0.254

Fixes: bae927c551 ("ar71xx: add support for TP-LINK CPE510 V2.0")
Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[Rebased onto revert commit, changed comments in mach-cpe510.c,
changed commit title and description, fixed eth0 MAC address,
removed eth1 initialization]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[squashed revert, added fixes tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Michal Cieslakiewicz 380cf82f99 ar71xx: WNDR4300: fix WAN LED behaviour
Change WAN LED behaviour to be consistent with other Netgear
routers running OpenWrt. Instead of link speed, use amber colour
to indicate link status. Green LED should be used when Internet
connection is up and running.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Rafał Miłecki 63d611390c ar71xx: fix typo in platform_do_upgrade_compex()
Fixes: 641f6b6c26 ("treewide: use new procd sysupgrade $UPGRADE_BACKUP variable")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki a858db3136 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>
5 years ago
Rafał Miłecki 641f6b6c26 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>
5 years ago
Rafał Miłecki 1078de96e3 treewide: fix invalid UPGRADE_OPT_SAVE_CONFIG spellings
That was a result of accidentally running "sed" twice on some files.

Fixes: 5797fe84a3 ("treewide: replace remaining (not working now) $SAVE_CONFIG uses")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki 5797fe84a3 treewide: replace remaining (not working now) $SAVE_CONFIG uses
This var has been replaced by the $UPGRADE_OPT_UPGRADE_OPT_SAVE_CONFIG

Fixes: b534ba9611 ("base-files: pass "save_config" option to the "sysupgrade" method")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Tomasz Maciej Nowak 8b4109c2b4 ar71xx: sysupgrade: accept ath79 combined-image
There is md5 sum of whole image embedded in combined-image header which
is checked on sysupgrade. The check will fail for ath79 images which
may have embedded metadata. This is because metadata are appended after
the combined image is created. To allow smooth transition from ar71xx to
ath79, strip metadata before calculating md5 sum for whole image.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Adrian Schmutzler b133e466b0
treewide: convert WiFi caldata size and offset to hexadecimal
This changes size and offset set for WiFi caldata extraction and
MAC address adjustment to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-cal-data in DTS files.

Since dd cannot deal with hexadecimal notation, one has to convert
back to decimal by simple $(($hexnum)).

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 75bfc393ba treewide: convert MAC address location offsets to hexadecimal
This changes the offsets for the MAC address location in
mtd_get_mac_binary* and mtd_get_mac_text to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-mac-address in DTS files.

(e.g. 0x1006 and 0x5006 are much more useful than 4102 and 20486)

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Koen Vandeputte 845b2a1cfe ar71xx: really fix Mikrotik board detection
commit e09da0169a ("ar71xx: fix Mikrotik board detection")
was generated based on testing a rb-912 board, on which detection failed.

Testing on more hardware shows something fun:

machine	: MikroTik RouterBOARD 922UAGS-5HPacD
machine	: Mikrotik RouterBOARD 912UAG-5HPnD

Both lowercase and uppercase are used.
So ensure we support both now ..

Fixes: e09da0169a ("ar71xx: fix Mikrotik board detection")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte e09da0169a ar71xx: fix Mikrotik board detection
Fix a typo in the machine type being extracted from /proc/cpuinfo
which causes all Mikrotik board to be undetected properly.

This lead to sysupgrade issues and probably some others too.

Fixes: acf2b6c888 ("ar71xx: base-files: fix board detect on new MikroTik devices")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Tomislav Požega 65762cdd22 ar71xx: fix WLAN LED names for Archer C7
Update WLAN LED colour identifier for both interfaces on Archer C7

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
5 years ago
Tomislav Požega a73934fc9a ar71xx: fix system LED names on Archer C5/C7
Move system LED board definitions of Archer C5/C7 to reflect
actual system LED colour used

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
5 years ago
Rafał Miłecki 1cbe0d659c treewide: sysupgrade: get rid of platform_nand_pre_upgrade()
1) nand_do_upgrade() is always called by a target code
2) nand_do_upgrade() starts with calling platform_nand_pre_upgrade()

It means there is no need for the platform_nand_pre_upgrade() callback
at all. All code that was present there could bo moved & simplly called
by a target right before the nand_do_upgrade().

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Rafał Miłecki 8b4bc7abe0 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>
5 years ago
Rafał Miłecki 20452a8db9 ar71xx: get rid of platform_pre_upgrade()
The only step between platform_pre_upgrade() and platform_do_upgrade()
is switching to ramdisk. It should be fine to "mtd erase firmware" from
the later callback and get rid of the first one.

This change wasn't tested on affected target but identical code logic
was verified to work as expected on brcm47xx with initramfs firmware.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Henryk Heisig acf2b6c888 ar71xx: base-files: fix board detect on new MikroTik devices
Move all MikroTik devices to new function to increase script execution
speed.

Machine name in new version of MikroTik RouterBOARD devices add "RB"
before model name:

 Old machine name: MikroTik RouterBOARD 951Ui-2nD
 New:              MikroTik RouterBOARD RB951Ui-2nD

So this patch should fix it for all currently supported MikroTik boards.

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
[rebased,commit message facelift,script fixes]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[spotted missing 922UAGS-5HPacD]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Petr Štetiar 73b21559ce ar71xx: set mib-poll-interval on devices with ar8xxx 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 are using
ar8xxx switch LEDs trigger, as the same value was set for built in
switches in 443fc9ac35 ("ath79: use ar8216 for builtin switch").

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Adrian Schmutzler f32e05c541 ar71xx: Fix network setup for TP-Link Archer C25 v1
Network for the Archer C25 v1 is set up without switch for no
obvious reason. The LED setup is even done switch-based.

This patch changes network setup so a switch is created.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Joachim Fünfer edf1d6264b ar71xx: fix failsafe interface for TL-WR940nv6
Switches failsafe mode interface from WAN to LAN ports.

Tested on TL-WR940Nv6.0 and TL-WR940Nv6.1

Signed-off-by: Joachim Fünfer <joachim.fuenfer@stusta.net>
5 years ago
Rosy Song 3b4c44aa8b ar71xx: mute script error in ar922x-led-fix script
This commit fixes following script error in syslog:

 cat: can't open '/sys/devices/platform/ehci-platform/usb1/1-1/1-1.2/1-1.2:1.4/ieee80211/phy*/name': No such file or directory
 sh: add: unknown operand
 sh: add: unknown operand

Signed-off-by: Rosy Song <rosysong@rosinson.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[commit subject and message tweaks]
5 years ago
Koen Vandeputte e40050d104 ar71xx: add support for Mikrotik RouterBOARD 2011UiAS-2HnD r2
This board got a new hardware revision, without any change in functionality.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Adrian Schmutzler 93d23aced2 ar71xx: Correct MAC address for WAN interface of Archer C7 v5
This device shares the network config with v4, thus the WAN MAC
also needs to be fixed the same way. However, the partition
where the MAC address resides has been changed.

Based on: https://github.com/openwrt/openwrt/pull/1726

Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Petr Štetiar 0f8cdc28af ar71xx: Add support for Ubiquity Bullet M (XW)
CPU: AR9342 SoC
RAM:     64 MB DDR2
Flash:    8 MB NOR SPI
Ports:  100 MBit (24V PoE in)
WLAN: 2.4/5 GHz
UART:     1 UART on PCB marked as J1 with 115200 8N1 config
LEDs:       Power, Ethernet, 4x RSSI LEDs (orange, red, 2x green)
Buttons:    Reset

UART connection details

  .---------------------------------.
  |                                 |
[ETH]          J1                 [ANT]
  |    o VCC o RX o TX o GND        |
  `---------------------------------'

Flashing instructions using recovery method over TFTP

 1. Unplug the ethernet cable from the router.
 2. Using paper clip press and hold the router's reset button. Make sure
    you can feel it depressed by the paper clip. Do not release the button
    until step 4.
 3. While keeping the reset button pressed in, plug the ethernet cable
    back into the AP. Keep the reset button depressed until you see the
    device's LEDs flashing in upgrade mode (alternating LED1/LED3 and
    LED2/LED4), this may take up to 25 seconds.
 4. You may release the reset button, now the device should be in TFTP
    transfer mode.
 5. Set a static IP on your Computer's NIC. A static IP of 192.168.1.25/24
    should work.
 6. Plug the PoE injector's LAN cable directly to your computer.
 7. Start tftp client and issue following commands:
     tftp> binary
     tftp> connect 192.168.1.20
     tftp> put openwrt-ar71xx-generic-ubnt-bullet-m-xw-squashfs-factory.bin

Tested only on Bullet M2HP.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Robert Marko 99f6f2c0b8 ar71xx: Add support for TP-Link CPE210 v3
Looks identical to the v2.

This PR adds support for a popular low-cost 2.4GHz N based AP

Specifications:
 - SoC: Qualcomm Atheros QCA9533 (650MHz)
 - RAM: 64MB
 - Storage: 8 MB SPI NOR
 - Wireless: 2.4GHz N based built into SoC 2x2
 - Ethernet: 1x 100/10 Mbps, integrated into SoC, 24V POE IN

Installation:
Flash factory image through stock firmware WEB UI
or through TFTP
To get to TFTP recovery just hold reset button while powering on for
around 4-5 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP adress:192.168.0.254

Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Robert Marko <robimarko@gmail.com>
[Rebased, adjusted for separate tplink-safeloader entry, dynamic partitioning]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Petr Štetiar 0a67e84bae ar71xx: ens202ext: Fix whitespace issues
I've missed leading whitespace issues in the original patch, so fixing
it in this commit. Thanks to pepe2k for letting me know.

Fixes: d260813d ("ar71xx: ens202ext: Fix VLAN switch")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Michael Pratt d260813d09 ar71xx: ens202ext: Fix VLAN switch
The target ENS202EXT was just recently added right before the stable
release of Openwrt 18.

It flashes fine, but the physical switch is almost impossible to use
until you have a VLAN set up. Tested on two devices.

The actual problem is that eth0 represents nothing for whatever reason.
In other words, both WAN and LAN are running from eth1. There may be an
underlying problem in the build, but for now, I assume that this is
correct and that a VLAN switch is an appropriate fix.

Also, it's virtually impossible to get the switch running right through
LuCI. It is one thing to get a switch to appear, but attempting to
configure it breaks the whole thing. The VLAN has to be set up
perfectly, otherwise, interfaces will not start up, and one is forced to
reset settings, OR, the new LuCI feature kicks in and reverses any
steps. It is extremely difficult to determine which virtual ports
correspond to which physical ethernet ports without being able to set up
the switch in LuCI.

Temporary Workaround: followed directions here
[openwrt/luci#867](https://github.com/openwrt/luci/issues/867)

Reviewed-by: Marty Plummer <hanetzer@startmail.com>
Signed-off-by: Michael Pratt <mpratt51@gmail.com>
[commit author fix, subject fix, message text wrap]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Koen Vandeputte e1444ab59c ar71xx: add support for MikroTik RouterBOARD 922UAGS-5HPacD
This patch adds support for the MikroTik RouterBOARD 922UAGS-5HPacD
with a built-in 802.11ac High-Power radio (31dBm).

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

Specifications:
- SoC: Qualcomm Atheros QCA9557 (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
- NAND storage detection
- PCIe
- USB: Type A & mini PCIe
- Wireless
- Ethernet
- LED's (excl. SFP and RSSI levels)
- Reset button
- Sysupgrade

Not working:
- SFP cage

Installation:

- Boot vmlinux-initramfs image via BOOTP/TFTP and then flash sysupgrade
image using "sysupgrade -n"

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
5 years ago
Xavier Douville 5ac974f214 ar71xx: Add support for Mikrotik RB SXT 2nD r3
The Mikrotik RouterBOARD SXT 2nD r3 is an outdoor WiFi AP / CPE
with a single 2.4 GHz radio and a 100 Mbps Ethernet port.
The device similar to the SXT 2nD r2, but it has SPI NOR flash instead
of NAND flash.

Hardware
--------
CPU:   Atheros AR9344 (600 MHz)
RAM:   64 MiB
FLASH: 16 MiB SPI NOR W25Q128
ETH:   1x 100 Mbps Atheros AG71xx
WiFi: 2T2R 802.11b/g/n (ath9k)
Power: Passive PoE 8-30 V

Installation instructions:

1. Boot openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf using a
   DHCP+TFTP server.
2. Erase the "firmware" partition using the mtd command. This should
   no longer be required once this patch is merged.
3. Use sysupgrade to install to flash. The file
   openwrt-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin
   should be used.

Signed-off-by: Xavier Douville <github@douville.org>
5 years ago
Adrian Schmutzler 26f7cf8ac3 ar71xx: Speed up mtd extraction in ar71xx.sh
Although the amount of data read here is smaller than for the
caldata, there still might be some speed gain compared to reading
bytewise. And there is no harm ...

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 51fb186cb3 ar71xx: Speed up caldata/eeprom handling
Reading and writing to and from flash storage is slowed down
enormously by some functions which use a block size of 1.

This patch reworks the extraction scripts to be much faster and
efficient by reading and writing in possibly one big block.

This is based on the initial commit a69e101 for ipq40xx by
Christian Lamparter <chunkeey@gmail.com>.

Speed comparison @ TP-Link TL-WDR4300 (just manually) results
in a time reduction by three orders of magnitude (99.9 %).

> time dd if=/dev/mtd3 of=/lib/firmware/test-slow bs=1 count=4096 skip=4096
4096+0 records in
4096+0 records out
real    0m 15.85s
user    0m 0.06s
sys     0m 13.28s

> time dd if=/dev/mtd3 of=/lib/firmware/test-fast bs=4096 count=1 skip=4096 iflag=skip_bytes
1+0 records in
1+0 records out
real    0m 0.02s
user    0m 0.00s
sys     0m 0.02s

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
David Santamaría Rogado e65f935de9 ar71xx: Change led trigger from usbdev to usbport
This patch changes all the legacy usbdev leds triggers
to the use usbport. The problem is that the usbdev triggers
get applied as usbport in sysfs but LuCI gets confused and
is not able to show the configuration with usbdev. More
information can be found in the PR:
<https://github.com/openwrt/openwrt/pull/1819>

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[extended commit message]
5 years ago
Andreas Ziegler 53c46b504c ar71xx: GL.iNet AR300M family: correct LED definitions
remove USB as this is no LED but power control
rename WiFi LED with correct color red (like in stock firmware)
set middle LED to be used for LAN link/activity

Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de>
5 years ago
Adrian Schmutzler 319c5d7c49 ar71xx: Fix 5 GHz MAC address for Archer C60 v2
Looks like C60 v2 needs the MAC address to be calculated
manually, while the C60 v1 gets it correctly without manual
interference.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Paul Wassi 78277ec162 ar71xx: fix TL-MR3220-v2 switch port order
Fix the switch port order for proper display on high
level interfaces.

Signed-off-by: Paul Wassi <p.wassi@gmx.at>
5 years ago