Commit Graph

965 Commits (34113999ef430ce74a627ab6e6a5370aa41c9d20)

Author SHA1 Message Date
Aubrey McIntosh, PhD 34113999ef ar71xx: Remove ath10k packages from archer-c7-v1 (fixes FS#1743)
ath10k_pci driver crashes once loaded and causes boot loops on this
device as 5GHz radio QCA9880-AR1A shipped with this router is broken.
It's not possible to fix this problem in software, miniPCIe radio has to
be replaced.

We could've probably fixed crashing of the ath10k driver by reverting
following upstream commit:

 commit 1a7fecb766c83dace747f42b25bbb544b00a0163
 Author: Michal Kazior <michal.kazior@tieto.com>
 Date:   Sat Jan 24 12:14:48 2015 +0200

    ath10k: reset chip before reading chip_id in probe

but it's not worth the effort as it wouldn't make that 5GHz radio usable
anyway. So it seems more convenient to just remove the crashing driver
and provide bootable images, as I believe, that a router that is working
but degraded is better than a router that will not work.

For details please see discussions in PR[1] and in FS#1743[2].

1. https://github.com/openwrt/openwrt/pull/1349
2. https://bugs.openwrt.org/index.php?do=details&task_id=1743

Signed-off-by: Aubrey McIntosh, PhD <aubrey.mcintosh@utexas.edu>
[subject and commit message tweaks]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Koen Vandeputte 8c9f255ce5 ar71xx: add rssileds for xw devices
Commit 7ebbbda293 ("ar71xx: ubnt-(xm,xw): fix LED RSSI indication")
adds support for using the RSSI strenght via LEDS.

The rssileds package addition got lost during altering the patch.
Add it again to fix this.

Fixes: 7ebbbda293 ("ar71xx: ubnt-(xm,xw): fix LED RSSI indication")
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Lech Perczak 7ebbbda293 ar71xx: ubnt-(xm,xw): fix LED RSSI indication
When mapping for RSSI LEDs was defined for interface wlan0 on
Ubiquiti XM and XW family, it missed connection to actual interface.
Therefore create the mapping to interface, so RSSI LEDs work without
additional configuration, after starting rssileds service.

Also add the required package for this.

While at that, remove coefficients needed for PWM LEDs, as XM and XW
boards do not support PWM LEDs.

Tested-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
[Squashed commits + remove custom device_packages + slighty rewrite the commit msg]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Mathias Kresin fd35c5b205 build: move seama commands to image-commands.mk
Move it to image-commands.mk to get rid of duplicate recipes.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin de42466528 ar71xx: sync seama image build code with ramips
Use the same syntax as used in the ramips target, to use common seama
recipes.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin ffdce856e0 build: move append-string to image-commands.mk
Move it to image-commands.mk so that it can used by other targets.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Christian Lamparter f54ac91ef5 ar71xx/ath79: switch devices to the -ct driver and firmware
Since commit 61b5b4971e ("mac80211: make ath10k-ct the default ath10k")
select ath10k-ct and the -ct firmwares by default.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Romain MARIADASSOU 02494fa35c
Add support for TL-WA801ND v4
This add support for TP-Link TL-WA801ND v4 (same as TL-WA801ND v3) :

Specification:

- System-On-Chip: Qualcomm Atheros QCA9533
- CPU/Speed: 650 MHz
- Flash-Chip: Winbond W25Q32BVSIG
- Flash size: 4096 KiB
- RAM: 32 MiB
- Wireless No1: SoC-integrated: QCA9533 2.4GHz 802.11bgn

Flash instructions:

1) To flash the image, rename the file
   openwrt-ar71xx-generic-tl-wa801nd-v4-squashfs-factory.bin
   to firmware.bin
2) Connect your device to the LAN port, then upload the firmware
   through web interface. It will try to download the image and
   flash it.

It can take up to 2-3 minutes to finish. When it reaches 100%, the
router will reboot itself.

Signed-off-by: Romain MARIADASSOU <roms2000@free.fr>
6 years ago
Daniel Halmschlager 99e212171a ar71xx: Add usb drivers in Archer C7 v4/v5 images
This commit adds the default usb packages
- kmod-usb-core
- kmod-usb2
- kmod-usb-ledtrig-usbport
for Archer C7 v4 and v5.
(The C7 v5 configuration is based on the v4, therefore the change for v4
also applies for v5.)

Signed-off-by: Daniel Halmschlager <dh@dev.halms.at>
6 years ago
INAGAKI Hiroshi 879f2ef7c0 ath79: modify mtd partitions for Buffalo BHR-4GRV2
This commit modifies mtd partitions define for Buffalo BHR-4GRV2 and
move it to generic subtarget.

In Buffalo BHR-4GRV2, "kernel" partition is located behined "rootfs"
partition in the stock firmware. This causes the size of the kernel
to be limited by the fixed value.

0x50000                       0xe80000        0xff0000
  +-------------------------------+--------------+
  |            rootfs             |    kernel    |
  |           (14528k)            |    (1472k)   |
  +-------------------------------+--------------+

After ar71xx was updated to Kernel 4.14, the kernel size of BHR-4GRV2
exceeded the limit, and it breaks builds on official buildbot.
Since this issue was also confirmed in ath79, I modified the mtd
partitions to get rid of that limitation.

0x50000                                       0xff0000
  +----------------------------------------------+
  |                   firmware                   |
  |                   (16000k)                   |
  +----------------------------------------------+

However, this commit breaks compatibility with ar71xx firmware, so I
dropped "SUPPORTED_DEVICES += bhr-4grv2".

This commit requires new flash instruction instead of the old one.

Flash instruction using initramfs image:

1. Connect the computer to the LAN port of BHR-4GRV2
2. Set the IP address of the computer to 192.168.12.10
3. Rename the OpenWrt initramfs image to
"bhr4grv2-uImage-initramfs-gzip.bin" and place it into the TFTP
directory
4. Start the tftp server on the computer
5. While holding down the "ECO" button, connect power cable to
BHR-4GRV2 and turn on it
6. Flashing (orange) diag LED and release the finger from the button,
BHR-4GRV2 downloads the intiramfs image from TFTP server and boot
with it
7. On the initramfs image, create "/etc/fw_env.config" file with
following contents
  /dev/mtd1 0x0 0x10000 0x10000
8. Execute following commands to add environment variables for
u-boot
  fw_setenv ipaddr 192.168.12.1
  fw_setenv serverip 192.168.12.10
  fw_setenv ethaddr 00:aa:bb:cc:dd:ee
  fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
9. Perform sysupgrade with squashfs-sysupgrade image
10. Wait ~150 seconds to complete flashing

And this commit includes small fix; BHR-4GRV2 has QCA9557 as a SoC,
not QCA9558.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Christoph Krapp 987b961537 ar71xx: add support for UniFi-AC-Mesh-Pro
This adds the build option for UniFi AC Mesh Pro as well as
model detection for it.
The device is a hardware clone of the AC Pro.

- SoC: QCA9563-AL3A (775Mhz)
- RAM: 128MiB
- Flash: 16MiB - dual firmware partitions!
- LAN: 2x 1000M - POE+
- Wireless:
        2.4G: QCA9563
          5G: UniFi Chip, QCA988X compatible

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
6 years ago
Pau Escrich 15f16bf05b ar71xx: add support for Gainstrong MiniBox V3.2
Adds MiniBox V3.2 ar71xx target (QCA99531 + QCA9887)
Info: http://oolite.cn/minibox-v3-2-qca9531-qca9887-module-pin-specification.html
Reference patch: http://oolite.cn/wp-content/uploads/2017/09/minibox_v3_cc15.05_20160325.patch
Installation: Upload firmware to uboot via HTTP at 192.168.1.1 (press button for 5 seconds)

Signed-off-by: Pau Escrich <p4u@dabax.net>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(daniel@makrotopia.org: rebased and fixed conflicts, fixed LED name,
                        added ath10k eeprom)
6 years ago
Koen Vandeputte 860de2e1aa ar71xx: disable some tiny targets with kernel 4.14
The bump to kernel 4.14 caused a massive increase in kernel size.

For most targets, switching them to dynamic partitioning allowed
to cope with this.

On some targets, the kernel partition is located behind the rootfs,
which disallows switching to dynamic partitioning as the boot location
would be altered, requiring a u-boot change.

Also within the tiny section, which disables kernel symbols etc
to decrease the image size,  the partition size is still too small.

Disable these targets for now, fixing image generation:

- Buffalo BHR-4GRV2
- Zbtlink ZBT-WE1526

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte 162e016fed ar71xx: expand kernel size for ubnt targets
Kernel 4.14 is pretty large causing a build error as the partition is too small.
Expand the kernel partition a bit to make it fit.

* ubnt-uap-pro
* ubnt-unifi-outdoor-plus

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte d6b63f1698 ar71xx: disable ap91-5g due to kernel size
This target causes a build failure as the kernel image does not fit
into the kernel partition.

As the kernel is located behind the rootfs, it cannot be enlarged
as the boot entry location would get altered.

Disable this target for now.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte 7c78be1b74 ar71xx: switch more targets to dynamic partitioning
Targets:
- TP-LINK ER355
- TP-LINK C25 V1
- TP-LINK C59 V1
- TP-LINK C7 V4
- TP-LINK C7 V5

Fixes build issues seen due to the kernel being too big

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Radek Dostál 9d35b68776 ar71xx: switch TP-Link RE450 v1 to dynamic partitioning
As mentioned in commit 5f24933 recent changes on ar71xx (switch to 4.14,
memory compaction, ...) cause an increase in kernel size, making it too
big for RE450.

RE450 images were not build due to the following error message:
os-image partition too big (more than 1572864 bytes): Success

Tested on RE450, device boots and was used to send this patch.

Reported-by: Enrico Mioso <mrkiko.rs@gmail.com>
Suggested-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Radek Dostál <rd@radekdostal.com>
[rewrote commit msg keeping it tight + fixed SoB lines]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
David Bauer f89fc43a50 ar71xx: move OCEDO Koala to generic and use dynamic partitioning
This changes the OCEDO Koala flash-layout to a unified firmware
partition, thus making the ar71xx-generic kernel fit in flash.

Compile and runtested on OCEDO Koala.

Signed-off-by: David Bauer <mail@david-bauer.net>
[small title reword]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte 5f24933309 ar71xx: Move some targets to tiny
Recent changes on ar71xx (switch to 4.14, memory compaction, ...) cause
an increase in kernel size, making it too big for some devices.

Move these devices to the tiny target, where kernel symbols and
optimization for speed are disabled, reducing the kernel size.

Devices:
- EnGenius ENS202EXT
- OCEDO Koala

Compile-tested targets:

- ar71xx->generic->default
- ar71xx->smallFlash->Default

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Mathias Kresin 80c61c161a treewide: use wpad-basic for not small flash targets
Add out of the box support for 802.11r and 802.11w to all targets not
suffering from small flash.

Signed-off-by: Mathias Kresin <dev@kresin.me>

Mathias did all the heavy lifting on this, but I'm the one who should
get shouted at for committing.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
John Crispin 61b5b4971e mac80211: make ath10k-ct the default ath10k
We select ath10k-ct by default, but it is still possible to build
the upstream version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John Crispin <john@phrozen.org>
6 years ago
David Bauer 8e9a59a6b9 build: add mkrasimage
The current make-ras.sh image generation script for the ZyXEL NBG6617
has portability issues with bash. Because of this, factory images are
currently not built correctly by the OpenWRT buildbots.

This commit replaces the make-ras.sh by C-written mkrasimage.

The new mkrasimage is also compatible with other ZyXEL devices using
the ras image-format.
This is not tested with the NBG6616 but it correctly builds the
header for ZyXEL factory image.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
INAGAKI Hiroshi 23519edbca ath79: add support for Buffalo BHR-4GRV2
Buffalo BHR-4GRV2 is a wired router, based on Qualcomm Atheros
QCA9558.
Ported from ar71xx target.

Specification:

- Qualcomm Atheros QCA9558
- 64 MB of RAM
- 16 MB of Flash
- 5x 10/100/1000 Ethernet
  - QCA8337N
- 4x LEDs, 2x keys
- UART header on PCB
  - Vcc, TX, RX, GND from LED side
  - 115200n8

Flash instruction using factory image:

1. Connect the computer to the LAN port of BHR-4GRV2
2. Connect power cable to BHR-4GRV2 and turn on it
3. Access to "http://192.168.12.1/" and open firmware update
page ("ファームウェア更新")
4. Select the OpenWrt factory image and click update ("更新実行")
button
5. Wait ~120 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Daniel F. Dickinson e38520cd50 ar71xx: cr3000: Drop support for defunct cloud
The CR3000 stock firmware is now irrelevant as it required a now defunct
cloud service.  Therefore only build images that use the entire flash
(overwriting stock firwmare-specific partitions that no longer matter),
previously called 'nocloud' images.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
6 years ago
Keith Maika 4caab80830 ar71xx: add support for TP-Link Archer C59 v2
TP-Link Archer C59v2 is a dual-band AC1350 router based on
Qualcomm/Atheros QCA9561+QCA9886 chips.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- USB 2.0 port
- UART header on PCB

Flash instruction:
  - via web UI:
    1. Download openwrt-ar71xx-generic-archer-c59-v2-squashfs-factory.bin
    2. Login to router and open the Advanced tab
    3. Navigate to System Tools -> Firmware Upgrade
    4. Upload firmware using the Manual Upgrade form
  - via TFTP:
    1. Set PC to fixed ip address 192.168.0.66
    2. Download openwrt-ar71xx-generic-archer-c59-v2-squashfs-factory.bin
       and rename it to 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.

Signed-off-by: Keith Maika <keithm@aoeex.com>
6 years ago
张鹏 53a4502013 ar71xx:add support for E750G v8
Qxwlan E750G v8 is based on Qualcomm QCA9344.

Specification:

 - 560/450/225 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4G GHz (AR9344)
 - 2x 10/100 Mbps Ethernet (PoE support)
 - 2x 10/100/1000 Mbps Ethernet
 - 7x LED (6 driven by GPIO)
 - 1x button (reset)
 - 1x DC jack for main power input (9-48 V)
 - UART (J23) and LEDs (J2) headers on PCB

Flash instruction (using U-Boot CLI and tftp server):

 - Configure PC with static IP 192.168.1.10 and tftp server.
 - Rename "sysupgrade" filename to "firmware.bin" and place it in tftp
   server directory.
 - Connect PC with one of RJ45 ports, power up the board and press
   "enter" key to access U-Boot CLI.
 - Use the following command to update the device to OpenWrt: "run lfw".

Flash instruction (using U-Boot web-based recovery):

 - Configure PC with static IP 192.168.1.xxx(2-254)/24.
 - Connect PC with one of RJ45 ports, press the reset button, power up
   the board and keep button pressed for around 6-7 seconds, until LEDs
   start flashing.
 - Open your browser and enter 192.168.1.1, select "sysupgrade" image
   and click the upgrade button.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
6 years ago
张鹏 ac03d51a3f ar71xx:add support for E750A v4
Qxwlan E750A v4 is based on Qualcomm QCA9344.

Specification:

 - 560/450/225 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 5G GHz (AR9344)
 - 2x 10/100 Mbps Ethernet (one port with PoE support)
 - 1x miniPCIe slot (USB 2.0 bus only)
 - 7x LED (6 driven by GPIO)
 - 1x button (reset)
 - 1x DC jack for main power input (9-48 V)
 - UART (J23) and LEDs (J2) headers on PCB

Flash instruction (using U-Boot CLI and tftp server):

 - Configure PC with static IP 192.168.1.10 and tftp server.
 - Rename "sysupgrade" filename to "firmware.bin" and place it in tftp
   server directory.
 - Connect PC with one of RJ45 ports, power up the board and press
   "enter" key to access U-Boot CLI.
 - Use the following command to update the device to OpenWrt: "run lfw".

Flash instruction (using U-Boot web-based recovery):

 - Configure PC with static IP 192.168.1.xxx(2-254)/24.
 - Connect PC with one of RJ45 ports, press the reset button, power up
   the board and keep button pressed for around 6-7 seconds, until LEDs
   start flashing.
 - Open your browser and enter 192.168.1.1, select "sysupgrade" image
   and click the upgrade button.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
6 years ago
张鹏 b74f63f81d ar71xx:add support for E558 v2
Qxwlan E558 v2 is based on Qualcomm QCA9558 + AR8327.

Specification:

 - 720/600/200 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4 GHz (QCA9558)
 - 3x 10/100/1000 Mbps Ethernet (one port with PoE support)
 - 4x miniPCIe slot (USB 2.0 bus only)
 - 1x microSIM slot
 - 5x LED (4 driven by GPIO)
 - 1x button (reset)
 - 1x 3-pos switch
 - 1x DC jack for main power input (9-48 V)
 - UART (JP5) and LEDs (J8) headers on PCB

Flash instruction (using U-Boot CLI and tftp server):

 - Configure PC with static IP 192.168.1.10 and tftp server.
 - Rename "sysupgrade" filename to "firmware.bin" and place it in tftp
   server directory.
 - Connect PC with one of RJ45 ports, power up the board and press
   "enter" key to access U-Boot CLI.
 - Use the following command to update the device to OpenWrt: "run lfw".

Flash instruction (using U-Boot web-based recovery):

 - Configure PC with static IP 192.168.1.xxx(2-254)/24.
 - Connect PC with one of RJ45 ports, press the reset button, power up
   the board and keep button pressed for around 6-7 seconds, until LEDs
   start flashing.
 - Open your browser and enter 192.168.1.1, select "sysupgrade" image
   and click the upgrade button.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
6 years ago
Daniel F. Dickinson 098267db4c ar71xx: cap324: Drop support for defunct cloud
Only build images for straight OpenWrt (using all flash; wipes out
partitions that contain information only important for accessing a
now defunct cloud service with the stock firmware) since the stock
firmware is now irrelevant.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
6 years ago
Daniel F. Dickinson 37ab944ac5 ar71xx: cap324: Use correct company name
It's 'PowerCloud Systems' not just 'PowerCloud'

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
6 years ago
Daniel F. Dickinson 50caf9d452 ar71xx: cr5000: Drop support for defunct cloud
The Skydog cloud service no longer exists hence supporting going back
to stock firmware with cloud support is no longer applicable.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
6 years ago
Kin Chan 18b87b10a9 ar71xx: Move F9K1115v2 under ar71xx tiny target
F9K1115v2 has a kernel partition size of 1408 kB.

Since kernel 4.9.x+ the kernel image for this device compiled had exceeded
the kernel partition size limit and thus failing size check.

The kernel image generated for this device
under ar71xx tiny target is 1329.67 kB < 1408 kB.

Signed-off-by: Kin Chan <kcchan1@outlook.com>
6 years ago
Thibaut VARÈNE c2d2647c09 ar71xx: add support for MikroTik RB931-2nD
This patch adds support for the MikroTik RB931-2nD (hAP mini):
https://mikrotik.com/product/RB931-2nD

Specifications:
  * SoC: Qualcomm QCA9533 (650MHz)
  * RAM: 32MiB
  * Storage: 16MiB SPI NOR flash
  * Ethernet: 3x100M
  * Wireless: QCA9533 built-in, dual-chain 802.11b/g/n

Installation:

1. Setup a DHCP/BOOTP Server with the following parameters:
   * 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. The usable intramfs files are:
       - openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf
       - openwrt-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf
       - openwrt-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin

2. Press the reset button on the board and keep that pressed.

3. Connect the board to your local network via its Internet port.

4. Release the button after the LEDs on the board are turned off.
   Now the board should load and start the initramfs image from
   the TFTP server.

5. Now connect the board via either of its LAN ports (2 or 3).

6. Upload the sysupgrade image to the board with scp:
     $ scp openwrt-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/fw.bin

7. Log in to the running system listening on 192.168.1.1 via ssh
   as root (without password):
     $ ssh root@192.168.1.1

8. Flash the uploaded firmware file from the ssh session via the
   sysupgrade command:
     root@OpenWrt:~# sysupgrade /tmp/fw.bin

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
6 years ago
Mathias Kresin 621fa91a82 ar71xx: move boards to tiny subtarget
Move boards to the tiny subtarget which break the build if the kernel is
set to "Optimize for performance".

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin a28d686fb6 ar71xx: factor out safe loader image build code
Add a template for safeloader images and include it instead of
overwriting variables defined in the common tp-link build commands.

Split the existing tp-link templates to proper implement the safeloader
template.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin b908c82f49 ar71xx: drop unnecessary LOADER_TYPE variables
Drop the LOADER_TYPE variables in case no loader is used at all or move
the variable to devices which are using a loader.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin a0ec632f8d ar71xx: get rid of copy-file
Use the provided image build variables to point the kernel-bin build
command to the kernel we are interested in.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 5260c1003c ar71xx: mikrotik: cleanup nand image build code
Use the LOADER_TYPE variable to specify that we need the elf preloader
and append the loader via the corresponding build recipe. It allows to
enable initramfs images again for mikrotik NAND images, which caused a
build error before.

Add the minor header only to the kernel of the sysupgrade images, as it
is only required for the bootloader to find the kernel on flash.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Lucian Cristian 4ec9763ee9 firmware-utils: tplink-safeloader: switch tl-wr1043nd-v4 to dynamic partitions
Use the new dynamic partition split in tplink-safeloader so we no longer
have to worry about kernel size increases.

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
6 years ago
Adrian Schmutzler 5c5bf8b865
ar71xx: Add support for TP-Link CPE210 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

Notes:
TP-Link does not use bootstrap registers so without this patch reference
clock detects as 40MHz while it is actually 25MHz.
This is due to messed up bootstrap resistor configuration on the PCB.
Provided GPL code just forces 25MHz reference clock.
That causes booting with completely wrong clocks, for example, CPU tries
to boot at 1040MHz while the stock is 650MHz.
So this PR depends on PR #672 to remove 40MHz reference clock.
Thanks to Sven Eckelmann <sven@narfation.org> for properly patching that.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
6 years ago
Arvid E. Picciani bf39d5594b ar71xx: add support for TP-LINK Archer C7 v5
TP-Link Archer C7 v5 is a dual-band AC1750 router, based on Qualcomm/Atheros
QCA9563+QCA9880.

Specification:

- 750/400/250 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
- 10x LED, 2x button
- UART header on PCB

Flash instruction:
1. Upload lede-ar71xx-generic-archer-c7-v5-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-v5-squashfs-factory.bin
and rename it to ArcherC7v5_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.

Signed-off-by: Arvid E. Picciani <aep@exys.org>
6 years ago
David Ehrmann 81d446b045 ar71x: add support for Mikrotik Routerboard wAP R
This commit adds support for the Mikrotik wAP R (RBwAPR-2nD). The change
is based on 3b15eb0 which added support for the wAP 2nD. This change lacks
LED support.

Specifications:

- SoC: Qualcomm QCA9531 (650 MHz)
- RAM: 64 MB
- Storage: 16 MB NOR SPI flash
- Wireless: built-in QCA9531, 802.11b/g/n 2x2:2
- Ethernet: 1x100Mbps
- Power: 9-30V Passive PoE, 9-30V DC jack, 9-30V automotive jack
- SIM card slot
- Mini-PCIe slot

Installation:

1. Login to the Mikrotik WebUI to backup your licence key
2. Change the following settings in System->Routerboard->Settings:
  - Boot device: try ethernet once then NAND
  - Boot protocol: DHCP
  - Force Backup Booter: checked
3. 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, e.g.
    openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf
4. Power off the device
5. If this is the second attempt to boot OpenWRT or the boot device isn't
   "try ethernet once then NAND," press and hold the reset button while
   powered off. If this is the first attempt, this step isn't necessary.
6. Power on the device, holding the reset button for 15-20s if already
   pressed from the previous step.

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

Revert to RouterOS

Use the "rbcfg" package on in OpenWRT:
- 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: David Ehrmann <ehrmann@gmail.com>
6 years ago
David Bauer b4bf43c667 ar71xx: add support for Fritz!WLAN Repeater 450E
This commit adds support for the AVM Fritz!WLAN Repeater 450E

SOC:    Qualcomm QCA9556 (Scorpion) 560MHz MIPS74Kc
RAM:    64MB Zentel A3R12E40CBF DDR2
FLASH:  16MiB Winbond W25Q128 SPI NOR
WLAN1:  QCA9556 2.4 GHz 802.11b/g/n 3x3
INPUT:  WPS button
LED:    Power, WiFi, LAN, RSSI indicator
Serial: Header Next to Black metal shield
        Pinout is 3.3V - RX - TX - GND (Square Pad is 3.3V)
        The Serial setting is 115200-8-N-1.

Tested and working:
 - Ethernet
 - 2.4GHz WiFi (correct MAC)
 - Installation via EVA bootloader
 - OpenWRT sysupgrade
 - Buttons
 - Most LEDs

Not working:
 - 2 RSSI LEDs
   AVM used for RSSI{0,1} two of the Ethernet PHYs LEDs which they
   control over MDIO. Our driver doesn't expose these LEDs as GPIOs.
   While it is possible to implement this feature, it would require an
   additional kernel patch for a minor functionality.

Installation via EVA:
In the first seconds after Power is connected, the bootloader will
listen for FTP connections on 192.168.178.1. Firmware can be uploaded
like following:

  ftp> quote USER adam2
  ftp> quote PASS adam2
  ftp> binary
  ftp> debug
  ftp> passive
  ftp> quote MEDIA FLSH
  ftp> put openwrt-sysupgrade.bin mtd1

Note that this procedure might take up to two minutes.
You need to powercycle the Device afterwards to boot OpenWRT.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Thomas Nixon bb71a3f27e ar71xx: add kmod-usb-ehci to fix USB on RB hAP AC
Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
6 years ago
David Bauer 9ec117c5be ar71xx: fix AVM package selection
The AVM package selection partially broke with the addition of the
FRITZ!Box 4020. This commit restores the intended behavior.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
David Bauer e36f8b3f39 ar71xx: add support for OCEDO Koala
This commit adds support for the OCEDO Koala

SOC:	Qualcomm QCA9558 (Scorpion)
RAM:    128MB
FLASH:  16MiB
WLAN1:  QCA9558 2.4 GHz 802.11bgn 3x3
WLAN2:  QCA9880 5 GHz 802.11nac 3x3
INPUT:  RESET button
LED:    Power, LAN, WiFi 2.4, WiFi 5, SYS
Serial: Header Next to Black metal shield
        Pinout is 3.3V - GND - TX - RX (Arrow Pad is 3.3V)
        The Serial setting is 115200-8-N-1.

Tested and working:
 - Ethernet
 - 2.4 GHz WiFi
 - 5 GHz WiFi
 - TFTP boot from ramdisk image
 - Installation via ramdisk image
 - OpenWRT sysupgrade
 - Buttons
 - LEDs

Installation seems to be possible only through booting an OpenWRT
ramdisk image.

Hold down the reset button while powering on the device. It will load a
ramdisk image named 'koala-uImage-initramfs-lzma.bin' from 192.168.100.8.

Note: depending on the present software, the device might also try to
pull a file called 'koala-uimage-factory'. Only the name differs, it
is still used as a ramdisk image.

Wait for the ramdisk image to boot. OpenWRT can be written to the flash
via sysupgrade or mtd.

Due to the flip-flop bootloader which we not (yet) support, you need to
set the partition the bootloader is selecting. It is possible from the
initramfs image with

 > fw_setenv bootcmd run bootcmd_1

Afterwards you can reboot the device.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Matthias Schiffer 0c0bb62999
ar71xx: switch CPE/WBS 210/510 to okli-loader
We recently increased the kernel partition size of the CPE/WBS 210/510.
This works fine for new installations of the factory image, but on
sysupgrades, the partition table read by the bootloader is not adjusted.
This limits the maximum size of the kernel loaded by the bootloader to the
old partition size.

While adjusting the partition table would be a cleanest solution, such a
migration would have to happen before an upgrade to a new version with a
newer kernel. This is error-prone and would require a two-step upgrade, as
we mark the partition table partition read-only.

Instead, switch from the lzma-loader with embedded kernel to the
okli-loader, so only the tiny lzma-loader is loaded by the bootloader as
"kernel", and the lzma-loader will then load the rest of the kernel by
itself.

Fixes: e39847ea2f ("ar71xx: increase kernel partition size for CPE/WBS 210/510")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer 108a6f6792
ar71xx: make loader-okli build step more generic
Add support for different loader types.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer 9968dcedb4
ar71xx: lzma-loader: constify kernel argv array
By making the kernel argv array const, the .data section can always be
omitted from the laoder binary.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer 8d851a95b7
ar71xx: lzma-loader: set page size to 4KB
The text section in the ELF loader is aligned to the maximum page size,
which defaults to 64KB. Reduce it to the actual page size to avoid wasting
flash space for this alignment.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago