aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware-utils
Commit message (Collapse)AuthorAgeFilesLines
* tools/tplink-safeloader: use soft_ver 1.9.1 for archer c6 v2Alexander Couzens2020-08-241-1/+1
| | | | | | | | | | | | TP-LINK published a firmware update for the archer c6 v2. This updates also reached the factory devices. Newer software version rejects downgrading to 1.2.x. Use 1.9.x to allow installing the factory images and have a little bit time to change it again. Tested on archer c6 v2 with firmware 1.3.1 Signed-off-by: Alexander Couzens <lynxis@fe80.eu> (cherry picked from commit 6d5d815e3f6850a0dc754bf16053fa34490766f7)
* tplink-safeloader: update soft_ver for TP-Link Archer C6 v2 (EU)Georgi Vlaev2020-08-241-1/+1
| | | | | | | | | | | | | The last couple of TP-Link firmware releases for Archer C6 v2 (EU) have switched to version 1.2.x. Bump the soft_ver to "1.2.1" to allow firmware updates from the vendor web interface. TP-Link vendor firmware releases supported by this change: * Archer C6(EU)_V2_200110: soft_ver:1.2.1 Build 20200110 rel.60119 * Archer C6(EU)_V2_191014: soft_ver:1.2.0 Build 20191014 rel.33289 Signed-off-by: Georgi Vlaev <georgi.vlaev@gmail.com> (cherry picked from commit ff75bbc423eddc09f5349b63c34773b04822f171)
* tplink-safeloader: expand support list for TP-Link CPE210 v3Adrian Schmutzler2020-07-231-1/+8
| | | | | | | | | | | | | | | This adds new strings to the support list for the TP-Link CPE210 v3 that are supposed to work with the existing setup. Without it, the factory image won't be accepted by the vendor UI on these newer revisions. Tested on a CPE210 v3.20 (EU). Ref: https://forum.openwrt.org/t/build-for-cpe210-v3-20/68000 Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> (cherry picked from commit 4a2380a1e778a8f8e0bfb0a00f2996ed0aab58d8)
* mkrasimage: fix segmentation faultMichael T Farnworth2020-03-291-9/+10
| | | | | | | | | | | | | | Code was attempting to determine the size of the file before it was actually known and allocating insufficient memory space. Images above a certain size caused a segmentation fault. Moving the calloc() ensured ensured that large images didn't result in a buffer overflow on memcpy(). Signed-off-by: Michael T Farnworth <michael@turf.org> [fixed name in From to match one in SoB] Signed-off-by: Petr Štetiar <ynezz@true.cz> (cherry picked from commit b468353a373d181c4362ff690d7b22a08f5f6949)
* ath79: add support for TP-Link Archer C60 v3Adrian Schmutzler2020-03-201-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TP-Link Archer C60 v3 is a dual-band AC1350 router, based on Qualcomm/Atheros QCA9561 + QCA9886. It seems to be identical to the v2 revision, except that it lacks a WPS LED and has different GPIO for amber WAN LED. 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, 2x button - UART header on PCB Flash instruction (WebUI): Download *-factory.bin image and upload it via the firmwary upgrade function of the stock firmware WebUI. Flash instruction (TFTP): 1. Set PC to fixed IP address 192.168.0.66 2. Download *-factory.bin image 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 While TFTP works for OpenWrt images, my device didn't accept the only available official firmware "Archer C60(EU)_V3.0_190115.bin". In contrast to earlier revisions (v2), the v3 contains the (same) MAC address twice, once in 0x1fa08 and again in 0x1fb08. While the partition-table on the device refers to the latter, the firmware image contains a different partition-table for that region: name device firmware factory-boot 0x00000-0x1fb00 0x00000-0x1fa00 default-mac 0x1fb00-0x1fd00 0x1fa00-0x1fc00 pin 0x1fd00-0x1fe00 0x1fc00-0x1fd00 product-info 0x1fe00-0x1ff00 0x1fd00-0x1ff00 device-id 0x1ff00-0x20000 0x1ff00-0x20000 While the MAC address is present twice, other data like the PIN isn't, so with the partitioning from the firmware image the PIN on the device would actually be outside of its partition. Consequently, the patch uses the MAC location from the device (which is the same as for the v2). Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> (cherry picked from commit 646d95c374072598fab9e949ef4425177c5c7960)
* firmware-utils: add lxlfw tool for generating Luxul firmwaresDan Haab2020-02-072-0/+283
| | | | | | | It's a simple tool prepending image with a Luxul header. Signed-off-by: Dan Haab <dan.haab@legrand.com> (cherry picked from commit 9aa6569aa669767ec9febf1de01a3983a1cb9482)
* tools: tplink-safeloader: update soft_ver for TP-Link Archer C6 v2 (EU)Anderson Vulczak2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | This patch updates "soft_ver" for TP-Link Archer C6 v2 (EU). It makes possible to upload OpenWrt on lastest vendor's firmware as the web-based updater checks for major.minor version during upload. Due to that on next major/minor version update TP-Link will stop us from using the web-based firmware update tool, so it will require a new patch on soft_ver to match major and minor version. Up to today's latest stock firmware the patch (major.minor.patch) version does not matters, that allows downgrade from 1.1.4 to 1.1.1 but do not allow downgrade from 1.1.X to 1.0.X. Signed-off-by: Anderson Vulczak <andi@andi.com.br> (cherry picked from commit 7a8bfbf0ffaea14e15ae2016a54adf48337c6251) (cherry picked from commit eeb93e5c2b23518e372737ecf8fdde4b9f139a49)
* ath79: add support for the TP-LINK CPE220 V3Andrew Cameron2020-01-081-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This 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: 2x 100/10 Mbps, integrated into SoC 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 This also applies some minor changes to the common DTSI: - use &wmac for label-mac-device, as this one is actually set up in common DTSI - move &eth0 to parent DTSI - fix several leading spaces, added/removed newlines Signed-off-by: Andrew Cameron <apcameron@softhome.net> [DTS style fixes/improvements, updated commit message/title, backport to 19.07] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ar71xx: improve support for TP-Link CPE510 v2Adrian Schmutzler2019-11-061-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes commit bae927c551fd ("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: bae927c551fd ("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> (cherry picked from commit c79b796280fa5cd64bac663f9d5e5d9a737c30d6) [added CPE510V2 entry to tplink-safeloader.c] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* tplink-safeloader: fix compilation warningsIlya Gordeev2019-10-191-12/+13
| | | | | Signed-off-by: Ilya Gordeev <Mirraz@users.noreply.github.com> (cherry picked from commit 5daf09435311922cad32b66b75d13b9367db62f7)
* firmware-utils: jcgimage: add support for 4MiB+ imagesDavide Fioravanti2019-05-311-5/+19
| | | | | | | | | | | | | The first version of this script allowed just 4Mb factory images. With this patch is possible to set the maximum size of the payload. For an 8Mb flash, the corresponding maxsize is: 8 * 1024 * 1024 - 5 * 64 * 1024 = 8388608 - 327680 = 8060928 If the -m argument is not set, the default maximum size will be used for backward compatibility. Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
* firmware-utils: jcgimage: fix style and compiler warningsDavide Fioravanti2019-05-311-48/+46
| | | | | | Fixed some compilation warnings. Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
* tools/firmware-utils: mktplinkfw2: add Qualcomm layoutsDavide Fioravanti2019-05-181-0/+12
| | | | | | | This commit adds the partition layout used by the TP-Link Archer D50 and probably by the TP-Link Archer D7 to mktplinkfw2. Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
* ipq40xx: add factory image for EnGenius ENS620EXTSteve Glennon2019-05-112-28/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extended mksenaofw to support new "capwap" header structure. This supports flashing from factory 3.0.0, 3.0.1, 3.1.0 and 3.5.5 firmware. Note that the factory image format changes for 3.1 and later firmware, and that the 3.1.0 and 3.5.5 Engenius firmware will refuse the factory_30.bin file. Similarly, the 3.0.0 and 3.0.1 Engenius firmware will refuse the factory_35.bin file. Flashing from the Engenius 3.1.0 firmware with the factory_35.bin firmware has not been tested, as 3.1.0 firmware (Engenius "middleFW") is only intended as part of the upgrade path to 3.5.5 firmware. Modified ipq40xx image Makefile to appropriately invoke mksenaofw with new parameters to configure the capwap header. Note that there is currently no method to return to factory firmware, so this is a one-way street. Path from factory 3.0.0 and 3.0.1 (EnGenius) software to OpenWrt is to navigate to 192.168.1.1 on the stock firmware and navigate to the firmware menu. Then copy the URL you have for that page, something like http://192.168.1.1/cgi-bin/luci/;stok=12345abcdef/admin/system/flashops and replace the trailing /admin/system/flashops with just /easyflashops You should then be presented with a simple "Firmware Upgrade" page. On that page, BE SURE TO CLEAR the "Keep Settings:" checkbox. Choose the openwrt-ipq40xx-engenius_ens620ext-squashfs-factory_30.bin, click "Upgrade" and on the following page select "Proceed". Path from factory 3.5.5 (EnGenius) software to OpenWrt is simply to use the stock firmware update menu. Choose the openwrt-ipq40xx-engenius_ens620ext-squashfs-factory_35.bin and click "Upload" and "Proceed". The device should then flash the OpenWrt firmware and reboot. Note that this resets the device to a default configuration with Wi-Fi disabled, LAN1/PoE acting as a WAN port (running DHCP client) and LAN2 acting as a LAN port with a DHCP server on 192.168.1.x (AP is at 192.168.1.1) Signed-off-by: Steve Glennon <s.glennon@cablelabs.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [sorry, for unfixing the 80-lines eyesores.]
* firmware-utils: fix nec-enc build on older architecturesChristian Lamparter2019-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | This patch enable gnu99 mode for the nec-enc utility which fixes the following build-breaking errors on some older architectures. nec-enc.c: In function ‘xor_data’: nec-enc.c:34:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < len; i++) { ^~~ nec-enc.c:34:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code nec-enc.c: In function ‘main’: nec-enc.c:101:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < n; i++) { ^~~ Spotted-By: Buildbot Fixes: fac27643f057 ("firmware-utils: add nec-enc") Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* firmware-utils: add nec-encINAGAKI Hiroshi2019-04-062-0/+130
| | | | | | | | | | | | | | | | | | | | nec-enc provides firmware encoding/decoding with model specific key for NEC devices. known devices: - Aterm WF1200CR - Aterm WG1200CR - Aterm WG2600HS usage: nec-enc -i infile -o outfile -k key Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [checkpatch fixes, marked usage as noreturn, added static function, moved buf* from stack to the global data segment]
* tools: tplink-safeloader: add C7v5 KR SupportMichael Gray2019-04-061-1/+2
| | | | | | The added entry originates from TP-Links latest Archer C7 v5 KR firmware. Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
* ath79: Add support for TP-Link CPE210 v3Mario Schroen2019-04-021-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 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 Thanks to robimarko for the work inside the ar71xx tree. Thanks to adrianschmutzler for deep discussion and fixes. Signed-off-by: Mario Schroen <m.schroen@web.de> [Split into DTS/DTSI, read-only config partition in DTSI] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> [renamed dtsi filename, light subject touches] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* ar71xx: Use dynamic partitions for TP-Link CPE210 v2Adrian Schmutzler2019-04-021-2/+1
| | | | | | | This is also helpful to add support in ath79. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* firmware-utils: mkdlinkfw: add kernel image offsetPawel Dembicki2019-03-241-4/+9
| | | | | | | | Some boards with JBOOT have partiton between bootloader and kernel image. This patch add possibility to change kernel partition start address. Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
* ath79: add support for TP-Link RE350K v1Piotr Dymacz2019-03-111-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TP-Link RE350K v1 (FCC ID: TE7RE350K) is a wall-plug AC1200 Wi-Fi range extender with 'Kasa Smart' support. Device is based on Qualcomm/Atheros QCA9558 + QCA9882 + AR8035 platform and is available only on US market. Specification: - 720/600/200 MHz (CPU/DDR/AHB) - 128 MB of RAM (DDR2) - 16 MB of flash (SPI NOR) - 1x 1 Gbps Ethernet (AR8035) - 2T2R 2.4 GHz (QCA9558), with ext. PA (SE2565T) and LNA (SKY65971-11) - 2T2R 5 GHz (QCA9882), with ext. PA (SE5003L1-R) and LNA (SKY65981-11) - 2x U.FL connector on PCB - 2x dual-band PCB antennas - 1x LED, 2x dual-color LED (all driven by GPIO) - 3x button (app config, led, reset) - 1x mechanical on/off slide switch - 1x UART (4-pin, 2.54 mm pitch) header on PCB - 1x JTAG (8-pin, 1.27 mm pitch) header on PCB Flash instruction: Use 'factory' image directly in vendor GUI (default IP: 192.168.0.254, default credentials: admin/admin). Warning: This device does not include any kind of recovery mechanism in U-Boot. Vendor firmware access: You can access vendor firmware over serial (RX line requires jumper resistor in R306 place, near XTAL) with: root/sohoadmin credentials. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
* firmware-tools/ptgen: Allow generation 0 size partitionsLinus Walleij2019-02-201-2/+9
| | | | | | | | | | | | The firmware on the D-Link DNS-313 NAS require two blank partitions before the boot partition. Support this if explicitly requested with a "-n" flag. Tested on the D-Link DNS-313. Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [Broken out from original patch] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* ath79: add support for TP-Link Archer C2 V3 (AC900)Skirmantas Lauzikas2019-01-271-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for the TP-link Archer C2 V3 (AC900). Specifications: - CPU: QCA9563 750Mhz - Ram: 64MB (DDR2) - Flash: 8MB (SPI NOR) - Ethernet: 5x 10/100/1000 - Wifi: QCA9563 bgn + QCA9887 an+ac - 9x Leds, 2x buttons Flash instructions: Upload openwrt-ath79-generic-tplink_archer-c2-v3-squashfs-factory.bin via the router Web interface and flash as normal firmware update. Signed-off-by: Skirmantas Lauzikas <skirmantas.lauzikas@blackraven.lt> [reorder entries, fix trailing whitespace in dts, add firmware partition compatible string, remove led default off states, use default on state for system led, reuse tplink-safeloader-uimage image build recipe, squash with dynamic partitioning commit, reword commit message, add installation instructions] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* firmware-utils: tplink-safeloader: Fix for Archer C2 V3 image generationSkirmantas Lauzikas2019-01-271-1/+2
| | | | | | | | | | | Fix for factory image generation, so that stock firmware will accept the openwrt image. Ref: https://forum.openwrt.org/t/support-for-tp-link-archer-c2-v3/15617/17 Signed-off-by: Skirmantas Lauzikas <skirmantas.lauzikas@blackraven.lt> [reword commit message, use correct order for conditions, trim trailing whitespace] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* tools: tplink-safeloader: add C7v5 RU SupportMichael Gray2019-01-271-1/+2
| | | | | | The added entry originates from TP-Links latest Archer C7 v5 RU firmware. Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
* tools: mktplinkfw2: add split-uboot layoutDavid Bauer2019-01-261-0/+6
| | | | | | | This commit adds the split-uboot partition layout used by the Archer C50 v4 to mktplinkfw2. Signed-off-by: David Bauer <mail@david-bauer.net>
* firmware-utils: mksercommfw: overhaul image creationMathias Kresin2019-01-152-272/+111
| | | | | | | | | | | | | | | | | | | | Move the zip compression into a build recipe. Pad the image using the existing build recipes as well to remove duplicate functionality Change the code to append header and footer in two steps. Allow to use a fixed filename as the netgear update image does. Use a fixed timestamp within the zip archive to make the images reproducible. Due to the changes we are now compatible to the gnu89 c standard used by default on the buildbots and we don't need to force a more recent standard anymore. Beside all changes, the footer still looks wrong in compare to the netgear update image. Signed-off-by: Mathias Kresin <dev@kresin.me>
* firmware-utils: mkdlinkfw: fix buildMathias Kresin2019-01-131-1/+1
| | | | | | | | | | | | | While we don't need the gnu99 option anymore, we still need to force the c99 standard to fix the following build error on the build bots: src/mkdlinkfw.c: In function 'find_auh_headers': src/mkdlinkfw.c:267:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < header_counter; i++) { ^ src/mkdlinkfw.c:267:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code Signed-off-by: Mathias Kresin <dev@kresin.me>
* firmware-utils: mkdlinkfw: fix error handlingMathias Kresin2019-01-131-3/+3
| | | | | | | fread() doesn't set errno, ferror need to be used to check for errors. While at it, check if we read the expect number of elements. Signed-off-by: Mathias Kresin <dev@kresin.me>
* firmware-utils: mkdlinkfw: create reproducible headerMathias Kresin2019-01-131-3/+18
| | | | | | | | Use the SOURCE_DATE_EPOCH environment variable if set instead of the current time. The used timestamp matches the timestamp of the latest commit this way and make the images reproducible. Signed-off-by: Mathias Kresin <dev@kresin.me>
* firmware-utils: mkdlinkfw: cleanup codeMathias Kresin2019-01-134-42/+5
| | | | | | | Drop unused function and macros. With the cleanup the gnu extension typeof isn't used any longer and the gnu99 compile flag can be dropped. Signed-off-by: Mathias Kresin <dev@kresin.me>
* tools/firmware-utils: fix sysupgrade typo in mkdapimg2Hans Dedecker2019-01-121-1/+1
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* tools/firmware-utils: fix sysupgrade typo in mkdapimgHans Dedecker2019-01-121-1/+1
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* ath79: add support for TP-Link Archer C6 v2Georgi Vlaev2018-12-311-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for TP-Link Archer C6 v2 (EU) Hardware specification: - SOC: Qualcomm QCA9563 @ 775MHz - Flash: GigaDevice GD25Q64CSIG (8MiB) - RAM: Zentel A3R1GE40JBF (128 MiB DDR2) - Ethernet: Qualcomm QCA8337N: 4x 1Gbps LAN + 1x 1Gbps WAN - Wireless: - 2.4GHz (bgn) QCA9563 integrated (3x3) - 5GHz (ac) Qualcomm QCA9886 (2x2) - Button: 1x power, 1x reset, 1x wps - LED: 6x LEDs: power, wlan2g, wlan5g, lan, wan, wps - UART: There's no UART header on the board Flash instructions: Upload openwrt-ath79-generic-tplink_archer-c6-v2-squashfs-factory.bin via the router Web interface. Flash instruction using tftp recovery: 1. Connect the computer to one of the LAN ports of the router 2. Set the computer IP to 192.168.0.66 3. Start a tftp server with the OpenWrt factory image in the tftp root directory renamed to ArcherC6v2_tp_recovery.bin. 4. Connect power cable to router, press and hold the reset button and turn the router on 5. Keep the reset button pressed until the WPS LED lights up 6. Wait ~150 seconds to complete flashing According to the GPL source the non-EU variant has different GPIOs assigned to some of the LEDs and buttons. The flash layout might be different as well. The wikidevi entry for Archer A6/C6 assumes they are identical. Signed-off-by: Georgi Vlaev <georgi.vlaev@gmail.com>
* firmware-utils: add hex pattern mode for xorimageINAGAKI Hiroshi2018-12-241-3/+36
| | | | | | | | | | | | This commit adds "hex pattern mode" to xorimage. This mode allows xor with a hexadecimal pattern that cannot be expressed with ASCII charactors. usage (example): xorimage -i firmware.bin -o firmware.bin.new -p 6A57190601121E4C -x Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> (fix checkpatch)
* ath79: add support for TP-Link Archer A7Karl-Felix Glatzer2018-12-171-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for TP-Link Archer A7 Specification: - SOC: QCA9563 - Flash: 16 MiB (SPI) - RAM: 128 MiB (DDR2) - Ethernet: 4x 1Gbps LAN + 1x 1Gbps WAN - Wireless: - 2.4GHz (bgn) SoC internal - 5GHz (ac) QCA988x - USB: 1x USB 2.0 port - Button: 1x power, 1x reset, 1x wps - LED: 10x LEDs - UART: holes in PCB - Vcc, GND, RX, TX from ethernet port side - 115200n8 Flash instructions: Upload openwrt-ath79-generic-tplink_archer-a7-v5-squashfs-factory.bin via the Webinterface. Flash instruction using tftp recovery: 1. Connect the computer to one of the LAN ports of the Archer A7 2. Set the computer IP to 192.168.0.66 3. Start a tftp server with the OpenWrt factory image in the tftp root directory renamed to ArcherC7v5_tp_recovery.bin 2. Connect power cable to Archer A7, press and hold the reset button and turn the router on 3. Keep the reset button pressed for ~5 seconds 4. Wait ~150 seconds to complete flashing Changes since first revision: - Flash instructions using stock image webinterface - Changed "Version 5" in model string to "v5" - Split DTS file in qca9563_tplink_archer-x7-v5.dtsi and qca9563_tplink_archer-a7-v5.dts - Firmware image is now build with dynamic partitioning - Default to ath10k-ct Changes since second revision: - Changed uboot@0 to uboot@20000 in DTS file - Fixed ordering issue in board led script - Specify firmware partition format in DTS file - Rebased Makefile device definition on common Device/tplink-safeloader-uimage definition - Merged switch section in network script (same configuration as tplink,tl-wdr3600 and tplink,tl-wdr4300) Signed-off-by: Karl-Felix Glatzer <karl.glatzer@gmx.de>
* ramips: use new image build code for D-Link DCS-930 familyMathias Kresin2018-12-122-40/+0
| | | | | | | | | | | | Drop the factory images and the firmware tool to create them. They don't work any more, since the factory image has an uImage header covering the whole kernel + rootfs. This way the uImage splitter will not be able to find the rootfs and the kernel will panic later on. The factory images were most likely added at a time the board had distinct partitions for kernel and rootfs. Signed-off-by: Mathias Kresin <dev@kresin.me>
* tools: tplink-safeloader: add C7v5 EU SupportListDavid Bauer2018-11-231-1/+5
| | | | | | | | | | Currently flash from WebIF is broken for Archer C7 v5 EU models as their SupportList entries are missing. The added entries originate from TP-Links latest Archer C7 v5 EU firmware. Signed-off-by: David Bauer <mail@david-bauer.net>
* tools: firmware-utils: mksercommfw build on DarwinKevin Darbyshire-Bryant2018-11-091-2/+21
| | | | | | | | | asm/byteorder.h & hence __cpu_to_be32() doesn't exist on Darwin Shamelessly copy some byte swap functions from oseama.c Acked-by: Koen Vandeputte <koen.vandeputte@ncentric.com> Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
* ramips: fix netgear r6120 factory image generationKoen Vandeputte2018-11-081-169/+317
| | | | | | | | | | | | | | | | | | | | | | | as indicated in commit c5bf408ed6bd "(ramips: fix image generation for mt76x8") more rework was needed to fix the other issues. Building on another machine, but using the same arch, showed the application failing again for different reasons. Fix this by completely rewriting the application, fixing following found issues: - buffer overflows, resulting in stack corruption - flaws in memory requirement calculations (too small, too large) - memory leaks - missing bounds checking on string handling - non-reproducable images, by using unitilized memory in checksum calculation - missing error handling, resulting in succes on specific image errors - endianness errors when building on BE machines - various minor build warnings - documentation did not match the code actions (header item locations) - allowing input to be decimal, hex or octal now Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
* ramips: fix image generation for mt76x8Koen Vandeputte2018-11-061-1/+1
| | | | | | | | | | | | | | | | | | | | | Buildbot fails to generate images for targets also generating a Sercomm binary with following error: Opening file: /mnt/ramdisk/koen/firmware/builds/owrt_mt76x8/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/tmp/openwrt-ramips-mt76x8-netgear_r6120-squashfs-factory.img.rootfs.zip Filesize: 3648606 . mksercommfw: malloc.c:2427: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. Makefile:287: recipe for target '/mnt/ramdisk/koen/firmware/builds/owrt_mt76x8/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/tmp/openwrt-ramips-mt76x8-netgear_r6120-squashfs-factory.img' failed Debugging using valgrind shows stack corruption due to a buffer overflow. The author of the generator assumes the filename ends with "root", while it should be "rootfs". Fix this by accounting for the 2 missing characters which solves the build issues. More work is required to cleanup this source, which will be done later on. Reported-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
* ar71xx: fix sysupgrade generation for some targetsKoen Vandeputte2018-10-291-12/+6
| | | | | | | | | | | | | | | | | These targets are already defined as having a dynamic partition but the safeloader was not adapted for them. This causes a build warning for the sysupgrade image being too big. Targets: - c58-v1 - c60-v1 - c60-v2 - TL-WR1043 v5 - TL-WR902AC v1 - TL-WR942N V1 Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
* ar71xx: switch more targets to dynamic partitioningKoen Vandeputte2018-10-291-30/+13
| | | | | | | | | | | | | 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>
* ar71xx: switch TP-Link RE450 v1 to dynamic partitioningRadek Dostál2018-10-291-7/+2
| | | | | | | | | | | | | | | | | 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>
* mkfwimage: Add image type definition for WA imagesTobias Schramm2018-10-072-47/+129
| | | | | | | | | | | | | This patch adds a new type of ubiquiti image, the WA image. First seen on the NanoStation AC loco the generic name implies that we will see this type of image on more ubiquiti devices thus it makes sense to implement it in mkfwimage. The main difference is that WA images are signed. The "END" header has been replaced by a "ENDS" header followed by a 2048 bit RSA signature. This signature is not being generated by mkfwimage and filled with 0x00. Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
* firmware-utils: mkedimaximg: add "big-endianness mode" optionINAGAKI Hiroshi2018-09-101-8/+35
| | | | | | | | | In addition to the default little-endianness format, I added a mode so that we can generate firmware with big-endianness format. example: ELECOM WRC-300GHBK2-I (QCA9563) Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* build: add mkrasimageDavid Bauer2018-08-282-0/+460
| | | | | | | | | | | | | | | 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>
* firmware-utils/mksercommfw: fix build with clang/macOSRyan Mounce2018-08-141-1/+1
| | | | | | | | fixes error: non-void function 'main' should return a value Fixes: FS#1770 Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
* firmware-utils/mksercommfw: fix musl buildAndy Walsh2018-08-131-0/+1
| | | | | | * add missing <sys/types.h> for musl Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
* firmware-utils: add sercomm/netgear toolLudwig Thomeczek2018-08-132-0/+255
| | | | | | | | | | | This adds a tool to generate a firmware file accepted by Netgear or sercomm devices. They use a zip-packed rootfs with header and a custom checksum. The generated Image can be flashed via the nmrpflash tool or the webinterface of the router. Signed-off-by: Ludwig Thomeczek <ledesrc@wxorx.net>