Commit Graph

3387 Commits (8d9ff6b6f7b2ba0c3dcba926099f819af871e0a8)

Author SHA1 Message Date
Julien Dusser 8d9ff6b6f7 ar71xx: lzma loader use LTO
Change the Makefile to use LTO for better code optimisations. Gains are
very low, only 270 bytes saved, but it's only Makefile changes.

Signed-off-by: Julien Dusser <julien.dusser@free.fr>
7 years ago
Julien Dusser 8c5702f2a0 ar71xx: fix lzma loader performance issues
Some bootloaders set a cache cohenrency to a very slow mode. Use code from
Linux kernel to set it to "Cacheable, noncoherent, write-back, write
allocate".

Perfomance impact is significant on TP-Link EAP245 board, kernel
decompression time fall from 33 seconds to less than 1.

Signed-off-by: Julien Dusser <julien.dusser@free.fr>
7 years ago
Hauke Mehrtens f7a6fd3153 ar71xx: deactivate some boards with too small kernel partitions
This affects the following boards:
 * dr344
 * archer-c58-v1
 * archer-c60-v1
 * tl-wr902ac-v1
 * tl-wr942n-v1
 * ubnt-uap-pro
 * ubnt-unifi-outdoor-plus

The build fails for any of these boards because the resulting kernel
image will not fit into the kernel partition.

When CONFIG_KERNEL_KALLSYMS  is not set it could be that the kernel will
fit onto the board again, this is the case for release images.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens c84b7eaedd ar71xx: use kernel 4.9 by default
Kernel 4.9 support was added about 2 weeks ago and we haven't seen any
major regression so far. This patch was not ported to kernel 4.9, this
needs some additional work:
821-serial-core-add-support-for-boot-console-with-arbitr.patch

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Felix Fietkau 9887afb1af ar71xx: add support for TP-LINK Archer C7 v4
TP-Link Archer C7 v4 is a dual-band AC1750 router, based on Qualcomm/Atheros
QCA9561+QCA9888.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 3T3R 5 GHz
- 5x 10/100/1000 Mbps Ethernet
- 7x LED, 2x button
- UART header on PCB

Flash instruction:
1. Upload lede-ar71xx-generic-archer-c7-v4-squashfs-factory.bin via Web interface

Flash instruction using TFTP recovery:
1. Set PC to fixed ip address 192.168.0.66
2. Download lede-ar71xx-generic-archer-c7-v4-squashfs-factory.bin
and rename it to ArcherC7v4_tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin 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.

Flash instruction under U-Boot, using UART:

1. tftp 0x81000000 lede-ar71xx-...-sysupgrade.bin
2. erase 0x9f040000 +$filesize
3. cp.b $fileaddr 0x9f040000 $filesize
4. reset

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 2c9aff289e ar71xx: add support for Nokia WI2A-AC200i
Specifications:
 - SoC: Qualcomm QCA9558 (720 MHz)
 - RAM: 256MB
 - Storage: 1MB NOR, 128 MB NAND flash
 - Ethernet: 1x1000M

Installation:
 1. Connect to serial console on the board
 2. Boot initramfs image over u-boot
 3. Copy image to the device and run sysupgrade

Installation without serial console is not supported at this time

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 3db529d5cc Revert "ar71xx: Add GRO support to ag71xx"
This reverts commit 13e5e47369.
This commit causes a severe regression in LAN->WAN routing performance
for several devices. This appears to be caused by the extra requirement
to validate the SKB checksum early in the rx path, which the ethernet
hardware does not do

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Robert Marko 443abb8ccd ar71xx: add support for Mikrotik RB750P-PBr2
Specifications:
- SoC: Qualcomm QCA9531 (650MHz)
- RAM: 64MB
- Storage: 16MB NOR SPI flash
- Ethernet: 5x100M (1 PoE in, 4 PoE out)
- Outdoor use ready

This ethernet router is based on the same platform as the hEX PoE lite.

Installation

1. login to the Mikrotik WebUI to backup your licence keys
2. setup a DHCP/BOOTP Server with:
     * DHCP-Option 66 (TFTP server name) pointing to a local TFTP
       Server within the same subnet of the DHCP range
     * DHCP-Option 67 (Bootfile-Name) matching the initramfs filename
       of the to be booted image
3. connect the port labled internet to your local network
4. keep the reset button pushed down and power on the board

The board should load and start the initramfs image from the TFTP
Server. Login as root/without password to the started LEDE via ssh
listing on IPv4 address 192.168.1.1. Use sysupgrade to install LEDE.

Revert to RouterOS

Use the "rbcfg" package on in LEDE:
  * rbcfg set boot_protocol bootp
  * rbcfg set boot_device ethnand
  * rbcfg apply

Open Netinstall and reboot routerboard. Now netinstall sees routerboard
and you can install RouterOS. If NetInstall gets stuck on Sending offer
just wait for it to timeout and then close and open Netinstall again.

Click on install again.

In order for RouterOS to function properly, you need to restore license
for the device. You can do that by including license in NetInstall

Signed-off-by: Robert Marko <robimarko@gmail.com>
7 years ago
Hauke Mehrtens 27f23bac8f ar71xx: fix section mismatches
Fix some section mismatches found with kernel 4.9.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Hauke Mehrtens 7bbf4117c6 ar71xx: Add kernel 4.9 support
This add support for kernel 4.9 to the ar71xx target.
It was compile tested with the generic, NAND and mikrotik subtarget.
Multiple members of the community tested it on their boards and did not
report any major problem so far.

Especially the NAND part received some changes to adapt to the new
kernel APIs. The serial driver hack used for the Arduino Yun was not
ported because the kernel changed there a lot.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Kevin Darbyshire-Bryant e77fa68f1f kernel: bump 4.4 to 4.4.91
Refresh patches.

Compile-tested for: ar71xx Archer C7 v2
Run-tested on: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
Andrey Jr. Melnikov 2cb8f0a4cf ar71xx: Fix NULL pointer dereferece in at803x_link_change_notify()
Check pdata pointer before use to avoid OOPS if dev_get_platdata() return
NULL.

Signed-off-by: Andrey Jr. Melnikov <temnota.am@gmail.com>
7 years ago
Mathias Kresin 1c4a116a30 ar71xx: add rssileds to WA850RE v1 image
A default rssileds config exists for the TP-Link WA850RE v1 but the
rssiled package is not included by default.

The compressed 17.01.3 image size increases by 3302 bytes which should
be tolerable even for a 4MB flash board.

Fixes: FS#1043

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Catrinel Catrinescu b9c31c44d7 ar71xx: update LED definitions for embedded wireless dorin
Evaluation board 2.2 uses a different status LED pin
The other removed LEDs were never present

Signed-off-by: Catrinel Catrinescu <cc@80211.de>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Catrinel Catrinescu cd4b60c329 ar71xx: ew-dorin target moved from legacy to generic
Embedded Wireless Dorin platform moved from legacy to generic

Signed-off-by: Catrinel Catrinescu <cc@80211.de>
7 years ago
Felix Fietkau 00ea16557d ar71xx: rework chipidea usb controller patch
Handle AR9344 as well. Disable the EHCI platform device when device mode
is active, to avoid resource conflicts.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
7 years ago
Felix Fietkau f4a6daa5da ar71xx: unify CONFIG_CMDLINE
Booting from jffs2 directly is no longer supported, use
rootfstype=squashfs consistently for all subtargets

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Matthias Schiffer 53839da46e
ar71xx: fix MAC addresses on TP-Link TL-WR1043ND v4
The addresses were read from the 'config' partition, which would not always
contain the addresses at the same offsets, depending on the stock firmware
version used before flashing LEDE. Change this to get the addresses from
the 'product-info' partition, which is read-only.

Reported-and-tested-by: Andreas Ziegler <ml@andreas-ziegler.de>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Rosen Penev 13e5e47369 ar71xx: Add GRO support to ag71xx
On a TL-WN710N, this patch increases iperf performance from ~92.5 to ~93.5 mbps. Keep in mind the WN710N is a 100mbps device. I expect greater numbers from gigabit devices.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
7 years ago
Enrique Giraldo b8b410fba3 ar71xx: add metadata to wpj344 and wpj558 images
This adds metadata to wpj344 and wpj558 images to prevent loading
firmware of wpj344 into wpj558 and vice versa. This until now was
possible and break the units and had to be recovered from the uboot.

Signed-off-by: Enrique Giraldo <enrique.giraldo@galgus.net>
7 years ago
Enrique Giraldo 71067e3b79 ar71xx: wpj558: remove unused eth1 device and fix MAC address
Signed-off-by: Enrique Giraldo <enrique.giraldo@galgus.net>
7 years ago
Enrique Giraldo fefdb1e0b9 ar71xx: add support for COMFAST CF-E355AC
COMFAST CF-E355AC is a ceiling mount AP with PoE support, based on
Qualcomm/Atheros QCA9531 + QCA9882.

Short specification:

- 2x 10/100 Mbps Ethernet, with PoE support
- 64MB of RAM (DDR2)
- 16 MB of FLASH
- 2T2R 2.4 GHz, 802.11b/g/n
- 2T2R 5 GHz, 802.11ac/n/a
- built-in 4x 3 dBi antennas
- output power (max): 500 mW (27 dBm)
- 1x RGB LED, 1x button
- built-in watchdog chipset

Flash instruction:

Original firmware is based on OpenWrt.
Use sysupgrade image directly in vendor GUI.

Signed-off-by: Enrique Giraldo <enrique.giraldo@galgus.net>
[whitespace fixes, ac radio caldata offset fix]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 90d8c0f0a2 ar71xx: add support for GL.iNet GL-USB150
GL.iNet GL-USB150 is an USB dongle WiFi router, based on Atheros AR9331.

Specification:

- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- Realtek RTL8152B USB to Ethernet bridge (connected with AR9331 PHY4)
- 1T1R 2.4 GHz
- 2x LED, 1x button
- UART header on PCB

Flash instruction:

Vendor firmware is based on OpenWrt CC. GUI or sysupgrade can be used
to flash LEDE firmware.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Daniel Gonzalez Cabanelas 3c97bad0c2 ar71xx: WNDR4300: use the switch LED trigger on the WAN port
The WAN port on the Netgear WNDR4300 router has two LEDs,
amber and green. Use the switch LED trigger to behave as the
rest of the LAN HW controlled LEDs
- Green: 1 Gbps
- Amber: 100/10 Mbps

Signed-off-by: Daniel Gonzalez Cabanelas <dgcbueu@gmail.com>
7 years ago
Kuang Rufan 69323a0c07 ar71xx: add support for TL-WR1041N(v2) LAN/WAN LEDs.
1. Add support to LAN/WAN LEDs attached to ar8327.
2. Fix the problem that LAN/WAN LEDs does not blink in hardware (auto)
   mode when connected to 10M/100M ethernet.

Signed-off-by: Kuang Rufan <master@a1983.com.cn>
7 years ago
Kevin Darbyshire-Bryant 3435de8c16 kernel: update 4.4 to 4.4.85
Refresh patches

Compile & run tested: ar71xx - Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
7 years ago
João Chaínho 61027e3430 ar71xx: fix switch port numbering on RB750r2 and RB750UPr2
This patch fixes the switch port numbering on Mikrotik RB750r2 (hEX lite) and RB750UPr2 (hEX PoE lite).
Tested on a RB750UPr2. Maybe this patch is applicable to other devices (e.g. RB951Ui-2nD, RB952Ui-5ac2nD) but I have no way to test them.

Signed-off-by: João Chaínho <joaochainho@gmail.com>
7 years ago
Hauke Mehrtens 39e8ab17d5 kernel: update kernel 4.4 to version 4.4.79
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Piotr Dymacz 2ad2946777 ar71xx: image: use tplink-v1-header in place of mktplinkfw-kernel
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz f08f754993 build: move mktplinkfw-combined command to image-commands.mk
We will need "mktplinkfw-combined" command also in the "ramips" target
for new MediaTek based TP-Link devices, with "safeloader" image type.

Also, rename the command to "tplink-v1-header", use "VERSION_DIST"
variable instead of "OpenWrt" and allow passing additional parameters.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz b3cb0e7588 firmware-utils: mktplinkfw: rework combined image option
We use combined option in "mktplinkfw" tool for generating initramfs
kernel images and header for kernel inside "safeloader" image type (in
fact, only for TL-WR1043ND v4 at this moment).

There is also "mktplinkfw-kernel" tool, a stripped-down version, used
only for generating "simple" header, for safeloader image types.

This changes how "mktplinkfw" handles combined images (which then will
allow us to drop the stripped-down version of the tool):

- drop "ignore size" command line option (it was used only for combined
  images anyway)
- don't require "flash layout id" for combined images (we don't need and
  shouldn't limit size of the initramfs kernel and for kernels inside
  safeloader images, the "tplink-safeloader" tool does the size check)
- require kernel address and entry point in command line parameters for
  combined images (consequence of previous point)
- don't include md5 sum and firmware length values in header (they are
  needed only for update from vendor GUI and are ingored in case of
  initramfs and "tplink-safeloader" images)
- drop "fake" flash layout for TL-WR1043ND v4 as it's no longer needed

Also, adjust "mktplinkfw-combined" command in ar71xx/image/tp-link.mk to
match introduced changes in "mktplinkfw" tool.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 0c6165d21a ar71xx: add support for ALFA Network AP121F
ALFA Network AP121F is a pocket-size router dedicated for VPN/TOR users.
Device is based on Atheros AR9331 WiSoC and is running a custom version
(updated from OpenWrt CC to LEDE 17.01 release) of NetAidKit firmware.

Specification:

- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR1)
- 16 MB of FLASH (SPI NOR)
- 1x 10/100 Mbps Ethernet
- 1T1R 2.4 GHz
- 1x microSD (optional, on separate PCB)
- 3x LED, 1x button, 1x switch
- UART header on PCB

Flash instruction (under U-Boot web recovery mode):

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with RJ45 port, press the reset button, power up device,
   wait for first blink of all LEDs (indicates network setup), then keep
   button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Milan Krstić 4c1ce83548 ag71xx: add support for port mirroring
This exposes hardware port mirroring in ag71xx driver (e.g. TL-WR841ND) via
swconfig API.

Signed-off-by: Milan Krstić <milan.krstic@gmail.com>
7 years ago
Sergey Ryazanov bf5d86543a ar71xx: use the RB912UAG-{2, 5}HPnD Power LED for diag
The Power LED of RB912UAG-{2,5}HPnD boards can be controlled by sofware,
so use it for diag purposes and make the User LED free for other tasks.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
7 years ago
Sergey Ryazanov 6cad8ee0bd ar71xx: keep the RouterBOARD Power LED in On state
It is quite unexpected behaviour when the Power LED switches off as soon
as the kernel starts booting. So set the default state to 'Keep' for
the Power LEDs of all RouterBOARDs (e.g. RB91x, SXT Lite series, etc.).

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
[switch the default state to keep instead of on]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin e4e984f2a0 treewide: use only board_name function to get name
Do not parse /tmp/sysinfo/board_name, /proc/cpuinfo or the device tree
compatible string directly. Always use the board_name function to get
the board name.

The admswconfig package still reads /proc/cpuinfo directly. The code
looks somehow broken and the whole adm5120 which uses this package
looks unmaintained. Leave it as it is for now.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin e0b9ec8e96 treewide: drop target board_name functions
They are not used any longer.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin f12a32630f treewide: use the generic board_name function
Use the generic function instead ot the target specific ones.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin ac3e05c5d7 treewide: populate boardname and model earlier
For targets using the generic board detection and board specific
settings in diag.sh, the board name is still unset at the time the
set_state() provided by diag.sh is called by 10_indicate_preinit.

Change the execution order to ensure the boardname is populated before
required the first time. Do the target specific board detection as
early as possible, directly followed by the generic one to allow a
seamless switch to the generic function for populating /tmp/sysinfo/.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Alexander Couzens 8c96eb2fdb
ar71xx/image: change unifi UBNT_CHIP to ar7240
Verified by OEM firmware images which contains the same
chip.

Tested-by: Andreas Bräu <ab@andi95.de>
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
7 years ago
Matthias Schiffer 16222a1010
ar71xx: set US region code for TP-Link TL-WR710N v1 image
Non-US versions of the TP-Link TL-WR710N v1 don't have a region code so
far, so we can just set US unconditionally.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 438dcbfe74
base-files: automatically handle paths and symlinks for RAMFS_COPY_BIN
Depending on busybox applet selection, paths of basic utiilties may differ,
and may not work as symlinks to busybox. Simply using whatever binary is
found in PATH and detecting symlinks automatically is more robust and
easier to maintain.

The list of binaries is also slightly cleaned up and duplicates are
removed.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Piotr Dymacz 9d07d2dc56 ar71xx: image: simplify Meraki MR16 device definition
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Enrique Giraldo afcf5f69be ar71xx: fix upgrade platform check for Compex WPJ558
The magic number was wrong and always marked the images as invalid.

Signed-off-by: Enrique Giraldo <enrique.giraldo@galgus.net>
7 years ago
Piotr Dymacz befc763ed1 ar71xx: support LED in TP-Link TL-WR902AC RJ45 socket
TP-Link TL-WR902AC has another one, tiny LED inside RJ45 socket which is
attached to GPIO15. Add support for it, use it as a "lan" LED and rename
old one to "internet". Also, fix uci option name for "lan" LED in system
configuration ("wan" -> "lan").

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Piotr Dymacz 42c8bbb69b ar71xx: verify TP-Link TL-WR902AC sysupgrade image
Until we enable requirement for metadata in sysupgrade images under
ar71xx target, this prevents users from using wrong image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Henryk Heisig 096a604df0 ar71xx: add metadata to some TP-Link images
This commit adds metadata to TP-Link sysupgrade images
created by tplink-safeloader with uImage kernel header.

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
7 years ago
Piotr Dymacz cf23547e57 ar71xx: fix TPLINK_BOARD_ID for Archer C58 and TL-WA855RE
Rename TPLINK_BOARD_NAME to TPLINK_BOARD_ID for two ommited devices.

Fixes: 7d6c63d ("build: rename TPLINK_BOARD_NAME to TPLINK_BOARD_ID")
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago
Qian Zheng a08ec9a54d ar71xx: fix Netgear WNDR3700 v4 switch port mapping
Signed-off-by: Qian Zheng <sotux82@gmail.com>
7 years ago
Piotr Dymacz 6165e4aab0 ar71xx: add support for TP-Link TL-WR902AC v1
TP-Link TL-WR902AC v1 is a pocket-size, dual-band (AC750), successor of
TL-MR3020 (both devices use very similar enclosure, in same size). New
device is based on Qualcomm QCA9531 v2 + QCA9887. FCC ID: TE7WR902AC.

Specification:

- 650/391/216 MHz (CPU/DDR/AHB)
- 1x 10/100 Mbps Ethernet
- 1x USB 2.0 (GPIO-controlled power)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH
- 2T2R 2.4 GHz (QCA9531)
- 1T1R 5 GHz (QCA9887)
- 5x LED (GPIO-controlled), 2x button, 1x 3-pos switch
- UART pads on PCB (TP1 -> TX, TP2 -> RX, TP3 -> GND, TP4 -> 3V3, jumper
  resitors are missing on TX/RX lines)
- 1x micro USB (for power only)

Flash instructions:

Use "factory" image under vendor GUI.

Recovery instructions:

This device contains tftp recovery mode inside U-Boot. You can use it to
flash LEDE (use "factory" image) or vendor firmware.

1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "lede-ar71xx-generic-tl-wr902ac-v1-squashfs-factory.bin"
   to "wr902acv1_un_tp_recovery.bin" and place it in tftp server dir.
3. Connect PC with LAN port, press the reset button, power up the router
   and keep button pressed until WPS LED lights up.
4. Router will download file from server, write it to flash and reboot.

Root access over serial line in vendor firmware: root/sohoadmin.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
7 years ago