Commit Graph

1162 Commits

Author SHA1 Message Date
Piotr Dymacz
4b35e174ca firmware-utils: mktplinkfw2: support additional hardware version
As it turned out, some of new MediaTek based TP-Link devices use value
from field at 0x3c offset in version 3 of TP-Link header to specify
"Additional Hardware Version".

Value from this field is validated during regular (GUI) firmware upgrade
on devices like TL-WR840N v4 or TL-WR841N v13. If it's zero (based on
some tests, it seems that firmware will accept anything != 0), errors
like below are printed on console and upgrade fails:

[ rsl_sys_updateFirmware ] 2137:  Firmware Additional HardwareVersion
check failed

[ rdp_updateFirmware ] 345:  perror:4506

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2017-06-29 10:37:36 +02:00
Henryk Heisig
b05c7193fd ar71xx: add support for TP-Link Archer C58 v1
TP-Link Archer C58 v1 is a dual-band AC1350 router, based on Qualcomm
QCA9561 + QCA9886. It looks like Archer C59 v1 without USB port.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- 6x LED, 3x button
- UART header on PCB, RX, TX at TP4+5 (backside)

QCA9886 wlan needs pre_cal_data file and enable ieee80211 phy hotplug to
patch macaddress.

Flash instruction:

Use "factory" image directly in vendor GUI.

Recovery method:

1. Set PC to fixed ip address 192.168.0.66/24.
2. Download "lede-ar71xx-generic-archer-c58-v1-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.

Flash instruction under U-Boot, using UART:

tftp 0x81000000 lede-ar71xx-...-sysupgrade.bin
erase 0x9f020000 +$filesize
cp.b $fileaddr 0x9f020000 $filesize
reset

This commit is based on GitHub PR#1112

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
2017-06-29 10:37:36 +02:00
Jean-Pierre St-Yves
01280bc8dc firmware-utils: tplink-safeloader: add support for Archer C5 v2 JP/US
Add support for Japan and US versions of TP-Link Archer C5 v2

Signed-off-by: Jean-Pierre St-Yves <jpstyves@gmail.com>
2017-06-29 10:37:36 +02:00
Henryk Heisig
7d21b4eed0 firmware-utils: tplink-safeloader: add support for Archer C59/C60 RU
Add support for Russian version of TP-Link Archer C59/C60 v1

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
2017-06-29 10:37:36 +02:00
Federico Cappon
9fec39a033 ar71xx: add support for TP-Link TL-WA855RE v1
TP-Link TL-WA855RE v1 is a wall-plug N300 Wi-Fi range extender,
based on Qualcomm/Atheros QCA9533 v2.

Short specification:

- 550/397/198 MHz (CPU/DDR/AHB)
- 1x 10/100 Mbps Ethernet
- 32 MB of RAM (DDR1)
- 4 MB of FLASH
- 2T2R 2.4 GHz
- 2x external antennas
- 2x LED (green and orange in the same package), 2x button
- UART: TP5(TX) and TP4(RX) test points on PCB

Flash instruction: use "factory" image directly in vendor GUI.

Warning: this device does not include any kind of recovery mechanism
in the bootloader and disassembling process is not trivial.

You can access vendor firmware over serial line using:
- login: root
- password: sohoadmin

Image was tested only in EU version of the device, but should work
also with the same device version sold in other countries.

Signed-off-by: Federico Cappon <dududede371@gmail.com>
2017-06-29 10:37:36 +02:00
Mathias Kresin
06741411e0 firmware-utils: fix dgn3500sum compiler warnings
The sum variable need to be initialised, otherwise it will points to
random stack memory and a bogus image checksum might be calculated.

While at it, fix the segfault in case the product region code isn't
specified and enable compiler warnings which had revealed all the code
issues.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-06-26 20:08:36 +02:00
Alexander Couzens
b5aaafe9a3
mtd-utils/mkfs.jffs2: honor env SOURCE_DATE_EPOCH
Use the timestamp from the enviroment SOURCE_DATE_EPOCH
if set instead of the build time.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2017-06-19 14:35:07 +02:00
Alexander Couzens
c47a1a3527 firmware-utils: honor env SOURCE_DATE_EPOCH
Use the timestamp from the enviroment SOURCE_DATE_EPOCH
if set instead of the build time.
Fixes reproducible builds for certain firmware images.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2017-06-19 14:34:52 +02:00
Ludwig Thomeczek
9cd69c45c5 firmware-utils: tplink-safeloader: add TP-Link Archer C25 v1
This adds the necessary firmware layout definitions for the Archer C25.
It has an addtional partition containing some static data ("extra-para")
without which no factory flash is possible, therefore put_data() has been
added.

Signed-off-by: Ludwig Thomeczek <ledesrc@wxorx.net>
2017-06-11 21:32:18 +02:00
Serg Studzinskii
b7cc661615 ar71xx: add support for TP-Link TL-WR942N v1
TP-Link TL-WR942N v1 is a 2.4 GHz single-band N450 router, based on
Qualcomm/Atheros QCA9561.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 5x 10/100 Mbps Ethernet
- 2x USB 2.0
- 11x LED (most are controlled by 74HC595)
- 2x button
- UART header on PCB*

* Serial console is disabled in OEM non-beta firmwares and corresponding
  GPIO pins 14 and 15 are assigned to control USB1 and USB2 LEDs by
  production (non-beta) U-Boot and firmware.

Currently not working:

1. USB1 and USB2 LEDs if UART RX and TX pins are assigned to their GPIOs
   by some U-Boot versions.

Flash instruction under vendor GUI:

1. Download "lede-ar71xx-generic-tl-wr942n-v1-squashfs-factory.bin".
2. Go to WEB interface and perform usual firmware upgrade.

FLash instruction under U-Boot recovery mode (doesn't work in beta
firmware):

1. Setup PC with static IP "192.168.0.66/24" and tftp server.
2. Change "*-factory" image filename to "WR942v1_recovery.bin" and make
   it available to download from your tftp server.
3. Press "reset" button and power up the router, wait till "WPS" LED
   turns on.

Flash instruction under U-Boot, using UART (can be done only with
preinstalled UART-enabled U-Boot version!):

1. Use "tpl" to stop autobooting and obtain U-Boot CLI access.
2. Setup ip addresses for U-Boot and your tftp server.
3. Issue below commands:
   tftp 0x81000000 lede-ar71xx-generic-tl-wr942n-v1-sysupgrade.bin
   erase 0x9f020000 +$filesize
   cp.b 0x81000000 0x9f020000 $filesize
   reset

Signed-off-by: Serg Studzinskii <serguzhg@gmail.com>
[minor code style fixes, extended commit message]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2017-06-11 21:32:17 +02:00
Jan Niehusmann
c4022243d8 firmware-utils: tplink-safeloader: support strings as soft_version
Some TP-Link routers (C25, C59, C60) contain a version string instead
of a binary structure in the soft_version partition.

Flashing LEDE from the original firmware's GUI, this version string
taken from the soft_ver partition of the firmware image is written to
the router's config partition.

When using tftp recovery to go back to the original Archer C25 firmware,
a version check compares that version to the version of the firmware to
be flashed.

Without proper contents in the config partition, reverting to the
original firmware fails.

Therefore, write the string "soft_ver:1.0.0\n" to that soft_ver
partition.

Signed-off-by: Jan Niehusmann <jan@gondor.com>
2017-06-11 19:06:49 +02:00
Daniel Golle
92c80f38cf automake: import upstream fix for perl 5.26
Build broke as distributions now include Perl 5.26 and automake
triggered an "Unescaped left brace in regex" error.
Import upstream commit 13f00eb449 to fix that.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2017-06-07 19:47:34 +02:00
Felix Fietkau
e25cedd0b5 tar: override symlink permissions
On Linux, symlink permissions cannot be altered and are always 0777.
On Mac OS X they can be 0755. Force 0777 here to keep tarballs
reproducible across systems

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-05-30 15:40:51 +02:00
Daniel Engberg
9235a29e1a tools/sparse: Update to snapshot 2017-03-31
Update sparse to snapshot 2017-03-31
Switch to HTTPS

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2017-05-29 10:00:43 +02:00
Eric Luehrsen
aeeb2faf88 flex: update to 2.6.4 (FS#809)
flex 2.6.3 has a bug which fails code generation and compile of some packages

Signed-off-by: Eric Luehrsen <ericluehrsen@hotmail.com>
2017-05-26 07:53:03 +02:00
Hannu Nyman
d7a3120cdc tools/libressl: update to 2.5.4
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-05-25 19:01:07 +02:00
Hannu Nyman
8040420b00 tools/flex: update to 2.6.3
* update flex to 2.6.3
* download .tar.gz (as upstream has dropped .xz)
* refresh patches

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-05-25 19:01:07 +02:00
Hannu Nyman
1a0d52a733 tools/cmake: update to 3.8.1
* update cmake to 3.8.1
* refresh patches

Release notes:
https://cmake.org/cmake/help/v3.8/release/3.8.html

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-05-25 19:01:07 +02:00
Syrone Wong
a0f4b4b3a2 tools/isl: update to 0.18
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2017-05-25 19:01:07 +02:00
Rosen Penev
74f9c9c159 tools: host/include/getline.h: Remove
Seems to be useful only for old and unsupported operating systems. Removed and adjusted the mtd-utils Makefile.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2017-04-26 10:29:39 +02:00
Daniel Engberg
0685f2a66c tools/upx: Remove from repo
Remove upx from repo, it hasn't been used for a very long time and serves little to no purpose.

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2017-03-20 08:26:35 +01:00
Daniel Engberg
80246ce67e tools/coreutils: Update to 8.27
Update coreutils to 8.27

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2017-03-20 08:24:34 +01:00
Daniel Engberg
e45ee66149 tools/libressl: Update to 2.5.1
Update libressl to 2.5.1

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2017-03-20 08:24:13 +01:00
Daniel Engberg
49ded28027 tools/dosfstools: Update to 4.1
Update to 4.1
Remove 0001-mkfs-Default-to-64-32-heads-sectors-for-targets-smal.patch
as it's included in upstream repo.
Refresh patch

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2017-03-20 08:24:05 +01:00
Daniel Engberg
65d2800bd6 tools/sed: Update to 4.4
Update sed to 4.4

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2017-03-20 08:15:27 +01:00
Kevin Darbyshire-Bryant
2cf00b640d ccache: update to 3.3.4
Update from 3.3.2 to 3.3.4 & refresh patches.

Remove 110-disable-assembler-support as ccache now understands the
'.incbin' directive.

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
2017-03-12 15:06:50 +01:00
Rafał Miłecki
dfac808076 firmware-utils: tplink-safeloader: add support for Archer C5 V2
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2017-03-11 12:06:58 +01:00
Etienne Haarsma
d90abebd06 tools/m4: update 1.4.18
Patch 100-fix-gets-removal.patch is removed because it's included in the new version.

Signed-off-by: Etienne Haarsma <bladeoner112@gmail.com>
2017-02-26 13:31:45 +01:00
Furong Xu
8d53e3721c tools: patch-image: fix file descriptor leak.
Maybe this is committed by mistake, fix it.

Signed-off-by: Furong Xu <xfr@outlook.com>
2017-02-15 07:45:24 +01:00
Piotr Dymacz
56561b9f51 ar71xx: add support for TP-Link TL-WA850RE v2
TP-Link TL-WA850RE v2 is a wall-plug N300 Wi-Fi range extender,
based on Qualcomm/Atheros QCA9533 v2.

Short specification:

- 550/391/195 MHz (CPU/DDR/AHB)
- 1x 10/100 Mbps Ethernet
- 32 MB of RAM (DDR1)
- 4 MB of FLASH
- 2T2R 2.4 GHz
- 2x internal antennas (embedded on PCB)
- 9x LED (all can be turned off with GPIO15), 2x button
- UART (J3) header on PCB

Flash instruction: use "factory" image directly in vendor GUI.

Warning: this device does not include any kind of recovery mechanism
in the bootloader and disassembling process is not trivial.

You can access vendor firmware over serial line using:
- login: root
- password: sohoadmin

Image was tested only in US version of the device, but should work
also with the same device version sold in other countries.

Available FLASH space, with LEDE trunk, is only 240 KB.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2017-02-14 12:25:33 +01:00
Etienne Haarsma
0928b6d2ab cmake: update to version 3.7.2
Signed-off-by: Etienne Haarsma <bladeoner112@gmail.com>
2017-02-09 14:49:25 +01:00
Daniel Engberg
34ba64fe70 tools/e2fsprogs: Update to 1.43.4
* Update to 1.43.4
* Refresh patches
* xz tarball which saves about 2M in size

Changelog: http://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.43.4

Tested by Etienne Haarsma (ar71xx), Daniel Engberg (kirkwood)

Signed-off-by: Etienne Haarsma <bladeoner112@gmail.com>
Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [use @KERNEL instead of harcoded URL]
2017-02-09 12:26:13 +01:00
Hannu Nyman
eaf3fef946 ccache, samba36: fix samba.org addresses to use https
samba.org has started to enforce https and
currently plain http downloads with curl/wget fail,
so convert samba.org download links to use https.

Modernise links at the same time.

Also convert samba.org URL fields to have https.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2017-02-02 00:14:03 +01:00
FUKAUMI Naoki
7faee1bc9f firmware-utils: improve tools for Buffalo DHP series
some of Buffalo DHP series use slightly different trx magic, buffalo-enc,
buffalo-tag, and factory image begin with 'bgn'.

this patch adds support for building those images.

Signed-off-by: FUKAUMI Naoki <naobsd@gmail.com>
2017-01-31 10:55:02 +01:00
Stijn Tintel
456e1b6481 qemu: rename internal crypto/aes symbols
Qemu's local AES code defines symbols that conflict with
LibreSSL/OpenSSL's libcrypto. Rename them to avoid build problems.

See upstream commit c8d70e59738e672021926c7747af8ef9dea15c82.

Fixes FS#444.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-01-30 18:37:51 +01:00
Henryk Heisig
e39dc8d823 ar71xx: add support to TP-Link Archer C59v1 and C60v1
TP-Link Archer C59v1 is a dual-band AC1350 router, based on Qualcomm/Atheros
QCA9561+QCA9886.

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
- 8x LED (controled by 74HC595), 3x button
- UART header on PCB

TP-Link Archer C60v1 is a dual-band AC1350 router, based on Qualcomm/Atheros
QCA9561+QCA9886.

Specification:

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

Currently not working:
- Port LAN1 on C59, LAN4 on C60
- WiFi 5GHz (missing ath10k firmware for QCA9886 chip)
- Update from oficial web interface ( tplink-saveloader not support "product-info")

Flash instruction:
1. Set PC to fixed ip address 192.168.0.66
2. Download lede-ar71xx-generic-archer-cXX-v1-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.

Flash instruction under U-Boot, using UART:

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

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
[Jo-Philipp Wich: remove duplicate ATH79_MACH_ARCHER_C59/C60_V1 entries]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-01-26 11:38:21 +01:00
Sergey Sergeev
e2b8e9e0f3 tools: update kernel2minor to 0.24 version
Signed-off-by: Sergey Sergeev <adron@yapic.net>
2017-01-25 07:54:06 +01:00
John Crispin
920ee1f707 Revert "tools: wrt400n: fix making factory images with kernel bigger than 1MB"
This reverts commit 5f9b20bc7d.

The builders were failing with a segfault when generating the image

Signed-off-by: John Crispin <john@phrozen.org>
2017-01-20 06:43:13 +01:00
Yousong Zhou
5f9b20bc7d tools: wrt400n: fix making factory images with kernel bigger than 1MB
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2017-01-20 00:44:26 +01:00
Felix Fietkau
d98bb7e6b9 build: extend CONFIG_AUTOREMOVE to tools/
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-18 23:57:09 +01:00
Felix Fietkau
131db366a3 build: remove separate /install step for host builds
Reduces the number of recursive make invocations

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-18 23:57:09 +01:00
Alexandru Ardelean
2b84dfafa4 tools/qemu: use default host configure rule ; set appropriate vars & args
Admittedly, this is my own OCD wanting to get rid of this.

Because I tried (a while back to upgrade QEMU to a newer version),
and (during that attempt) I tried to get rid of this.

Tested on Linux & Mac.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-01-18 08:54:58 +01:00
Alexandru Ardelean
968fa53197 tools/cmake: remove HOST_CONFIGURE_CMD and re-distribute the args & vars
The final semantic is the same, but this is a bit more correct.

Build tested on Windows 10 (yes, there is some
Ubuntu mode for Windows 10, and I've been also building LEDE
on it for a few weeks).

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-01-16 20:40:14 +01:00
Felix Fietkau
6f9011f089 cmake: properly pass host cflags/ldflags to the build
This should hopefully fix build issues where libraries that we ship in
tools/ were accidentally picked up from other places on the system, e.g.
/usr/local

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-13 10:23:43 +01:00
Felix Fietkau
7969770100 cmake: support verbose build that shows compiler commands
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-13 10:23:43 +01:00
Felix Fietkau
d6de31310c cmake: restore parallel build support for bootstrap
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-13 10:23:43 +01:00
Jo-Philipp Wich
43d5339940 tools: cmake: link librt if needed (FS#381)
Patch cmakes cmcurl component to unconditionally link librt when we discover
a clock_gettime() symbol in -lrt.

This is required to sucessfully link LibreSSL's libcrypto which might or
might not reqauire librt.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-01-11 03:48:30 +01:00
Jo-Philipp Wich
69be65b594 tools: mkimage: pass crypto libraries through HOST_LOADLIBES (FS#381)
Since linker argument order is significant on modern host compilers, pass
the required libcrypto libraries through the HOST_LOADLIBES variable in
order to ensure proper order of the final linker command line.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-01-11 03:48:30 +01:00
Matthias Schiffer
96a940308b
tools: libressl: always build as PIC
Fixes link errors for host packages like ruby like the following:

/usr/bin/ld: .../staging_dir/host/lib/libcrypto.a(libcrypto_la-md5_dgst.o):
relocation R_X86_64_PC32 against symbol `memcpy@@GLIBC_2.14' can not be used when making a shared object; recompile with -fPIC

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2017-01-10 22:15:37 +01:00
Felix Fietkau
828a471e8d tools: remove obsolete yaffs tool
This was added a long time ago and was apparently never used

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2017-01-09 16:40:12 +01:00