<feed xmlns='http://www.w3.org/2005/Atom'>
<title>staging/pepe2k/tools/firmware-utils, branch v21.02.1</title>
<subtitle>Staging tree of Piotr Dymacz</subtitle>
<id>https://git.openwrt.org/openwrt/staging/pepe2k/atom?h=v21.02.1</id>
<link rel='self' href='https://git.openwrt.org/openwrt/staging/pepe2k/atom?h=v21.02.1'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/'/>
<updated>2021-06-18T06:39:14Z</updated>
<entry>
<title>ath79: use dynamic partitioning for TP-Link CPE series</title>
<updated>2021-06-18T06:39:14Z</updated>
<author>
<name>Michael Pratt</name>
</author>
<published>2021-05-05T03:32:00Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=7a4bd9cc518933d61099f109ce050c03afdc1c83'/>
<id>urn:sha1:7a4bd9cc518933d61099f109ce050c03afdc1c83</id>
<content type='text'>
CPExxx and WBSxxx boards with AR9344 SOC
use the OKLI lzma kernel loader
with the offset of 3 blocks of length 4k (0x3000)
in order to have a fake "kernel" that cannot grow larger
than how it is defined in the now static OEM partition table.

Before recent changes to the mtdsplit driver,
the uImage parser for OKLI only supported images
that started exactly on an eraseblock boundary.

The mtdsplit parser for uImage now supports identifying images
with any magic number value
and at any offset from the eraseblock boundary
using DTS properties to define those values.

So, it is no longer necessary to use fixed sizes
for kernel and rootfs

Tested-by: Andrew Cameron &lt;apcameron@softhome.net&gt;  [CPE510 v2]
Tested-by: Bernhard Geier &lt;freifunk@geierb.de&gt;      [WBS210 v2]
Tested-by: Petrov &lt;d7c48mWsPKx67w2@gmail.com&gt;       [CPE210 v1]
Signed-off-by: Michael Pratt &lt;mcpratt@pm.me&gt;
(cherry picked from commit 7b9a0c264cb9dc2c5a946a0aa9a290427a5e559c)
</content>
</entry>
<entry>
<title>ramips: add support for TP-Link Archer C6U v1 (EU)</title>
<updated>2021-06-10T15:09:35Z</updated>
<author>
<name>Georgi Vlaev</name>
</author>
<published>2020-07-31T11:02:21Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=31be36126929751ac90ad6ff74a1df32feeb8e21'/>
<id>urn:sha1:31be36126929751ac90ad6ff74a1df32feeb8e21</id>
<content type='text'>
This patch adds support for TP-Link Archer C6U v1 (EU).
The device is also known in some market as Archer C6 v3.
This patch supports only Archer C6U v1 (EU).

Specifications:
--------------

* SoC: Mediatek MT7621AT 2C2T, 880MHz
* RAM: 128MB DDR3
* Flash: 16MB SPI NOR flash (Winbond 25Q128)
* WiFi 5GHz: Mediatek MT7613BEN (2x2:2)
* WiFi 2.4GHz: Mediatek MT7603EN (2x2:2)
* Ethernet: MT7630, 5x 1000Base-T.
* LED: Power, WAN, LAN, WiFi 2GHz and 5GHz, USB
* Buttons: Reset, WPS.
* UART: Serial console (115200 8n1), J1(GND:3)
* USB: One USB2 port.

Installation:
------------

Install the OpenWrt factory image for C6U is from the
TP-Link web interface.

1) Go to "Advanced/System Tools/Firmware Update".
2) Click "Browse" and upload the OpenWrt factory image:
openwrt-ramips-mt7621-tplink_archer-c6u-v1-squashfs-factory.bin.
3) Click the "Upgrade" button, and select "Yes" when prompted.

Recovery to stock firmware:
--------------------------

The C6U bootloader has a failsafe mode that provides a web
interface (running at 192.168.0.1) for reverting back to the
stock TP-Link firmware. The failsafe interface is triggered
from the serial console or on failed kernel boot. Unfortunately,
there's no key combination that enables the failsafe mode. This
gives us two options for recovery:

1) Recover using the serial console (J1 header).
The recovery interface can be selected by hitting 'x' when
prompted on boot.

2) Trigger the bootloader failsafe mode.
A more dangerous option is force the bootloader into
recovery mode by erasing the OpenWrt partition from the
OpenWrt's shell - e.g "mtd erase firmware". Please be
careful, since erasing the wrong partition can brick
your device.

MAC addresses:
-------------

OEM firmware configuration:
D8:07:B6:xx:xx:83 : 5G
D8:07:B6:xx:xx:84 : LAN (label)
D8:07:B6:xx:xx:84 : 2.4G
D8:07:B6:xx:xx:85 : WAN

Signed-off-by: Georgi Vlaev &lt;georgi.vlaev@konsulko.com&gt;
(cherry picked from commit a46ad596a3e076599f38a4132b5d6dfee8a3102a)
</content>
</entry>
<entry>
<title>ramips: add support for TP-Link Archer A6 v3</title>
<updated>2021-06-10T15:09:35Z</updated>
<author>
<name>Vinay Patil</name>
</author>
<published>2021-04-19T01:22:51Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=30915e5a70ccb3b1f5f562a0f45ef49edf81194d'/>
<id>urn:sha1:30915e5a70ccb3b1f5f562a0f45ef49edf81194d</id>
<content type='text'>
The patch adds support for the TP-Link Archer A6 v3
The router is sold in US and India with FCC ID TE7A6V3

Specification
-------------
MediaTek MT7621 SOC
RAM:         128MB DDR3
SPI Flash:   W25Q128 (16MB)
Ethernet:    MT7530 5x 1000Base-T
WiFi 5GHz:   Mediatek MT7613BE
WiFi 2.4GHz: Mediatek MT7603E
UART/Serial: 115200 8n1

Device Configuration &amp; Serial Port Pins
---------------------------------------
ETH Ports:    LAN4 LAN3 LAN2 LAN1 WAN
             _______________________
             |                     |
Serial Pins: |   VCC GND TXD RXD   |
             |_____________________|

LEDs:         Power Wifi2G Wifi5G LAN WAN

Build Output
------------
The build will generate following set of files
[1] openwrt-ramips-mt7621-tplink_archer-a6-v3-initramfs-kernel.bin
[2] openwrt-ramips-mt7621-tplink_archer-a6-v3-squashfs-factory.bin
[3] openwrt-ramips-mt7621-tplink_archer-a6-v3-squashfs-sysupgrade.bin

How to Use - Flashing from TP-Link Web Interface
------------------------------------------------
* Go to "Advanced/System Tools/Firmware Update".
* Click "Browse" and upload the OpenWrt factory image: factory.bin[2]
* Click the "Upgrade" button, and select "Yes" when prompted.

TFTP Booting
------------
Setup a TFTP boot server with address 192.168.0.5.
While starting U-boot press '4' key to stop autoboot.
Copy the initramfs-kernel.bin[1] to TFTP server folder, rename as test.bin
From u-boot command prompt run tftpboot followed by bootm.

Recovery
--------
Archer A6 V3 has recovery page activated if SPI booting from flash fails.
Recovery page can be activated from serial console only.
Press 'x' while u-boot is starting
Note: TFTP boot can be activated only from u-boot serial console.
Device recovery address: 192.168.0.1

Thanks to: Frankis for Randmon MAC address fix.

Signed-off-by: Vinay Patil &lt;post2vinay@gmail.com&gt;
[remove superfluous factory image definition, whitespacing]
Signed-off-by: David Bauer &lt;mail@david-bauer.net&gt;

(cherry picked from commit f8f8935adb2be1ebce46a8d7058c76a8d3a9bd89)
</content>
</entry>
<entry>
<title>firmware-utils: fix coverity zytrx.c resource leak</title>
<updated>2021-06-10T15:09:35Z</updated>
<author>
<name>Kevin Darbyshire-Bryant</name>
</author>
<published>2021-05-16T10:46:32Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=27f4559281fb9f6a4d8ec5e054cea7f4c6b77820'/>
<id>urn:sha1:27f4559281fb9f6a4d8ec5e054cea7f4c6b77820</id>
<content type='text'>
fix coverity resource leak warning:

    	*len = stat.st_size;
    	mapped = mmap(NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0);
    	if (close(fd) &lt; 0)
CID 1484880:  Resource leaks  (RESOURCE_LEAK)
Variable "mapped" going out of scope leaks the storage it points to.
    		return NULL;
    	return mapped;
    }

Signed-off-by: Kevin Darbyshire-Bryant &lt;ldir@darbyshire-bryant.me.uk&gt;
(cherry picked from commit baf2a50ef3cf34574e12d2ab1b23578310f0d527)
</content>
</entry>
<entry>
<title>firmware-utils: zytrx: Add util for ZyXEL specific header</title>
<updated>2021-06-10T15:09:35Z</updated>
<author>
<name>Bjørn Mork</name>
</author>
<published>2021-04-19T11:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=dd6f02a3f4b70c82b45e1156cbe1edc833f683b4'/>
<id>urn:sha1:dd6f02a3f4b70c82b45e1156cbe1edc833f683b4</id>
<content type='text'>
The ZyXEL NR7101 prepend an additional header to U-Boot images. This
header use the TRX magic 0x30524448 (HDR0), but is incompatible with
TRX images.

This code is reverse-engineered based on matching 32 bit numbers
found in the header with lengths and different checksum
calculations of the vendor images found on the device.  The result
was matched against the validation output produced by the
bootloader to name the associated header fields.

Example bootloader validation output:

 Zyxel TRX Image 1 --&gt; Found!  Header Checksum OK
 ============ZyXEL header information==================
         chipId             : MT7621A
         boardId            : NR7101
         modelId            : 07 01 00 01
         kernel_len         : (14177560)
         kernelChksum       : (0x8DD31F69)
         swVersionInt       : 1.00(ABUV.0)D1
         swVersionExt       : 1.00(ABUV.0)D1

 Zyxel TRX Image 2 --&gt; Found!  Header Checksum OK
 ============ZyXEL header information==================
         chipId             : MT7621A
         boardId            : NR7101
         modelId            : 07 01 00 01
         kernel_len         : (14176660)
         kernelChksum       : (0x951A7637)
         swVersionInt       : 1.00(ABUV.0)D0
         swVersionExt       : 1.00(ABUV.0)D0

 =================================================
 Check image validation:
 Image1 Header Magic Number --&gt; OK
 Image2 Header Magic Number --&gt; OK
 Image1 Header Checksum --&gt; OK
 Image2 Header Checksum --&gt; OK
 Image1 Data Checksum --&gt; OK
 Image2 Data Checksum --&gt; OK
 Image1 Stable Flag --&gt; Stable
 Image1 Try Counter --&gt; 0
 Image1: OK
 Image2: OK

The coverage and algorithm for the kernelChksum field is unknown.
This field is not validated by the bootloader or the OEM firmware
upgrade tool. It is therefore set to a static value for now.

The swVersion fields contain free form string values.  The OEM firmware
use ZyXEL structured version numbers as shown above.  The strings are
not interpreted or validated on boot, so they can be repurposed for
anything we want the bootloader to display to the user.  But the OEM
web GUI fails to flash images with freeform strings.

The purpose of the other strings in the header is not known.  The
values appear to be static.  We assume they are fixed for now, until
we have other examples.  One of these strings is the platform name,
which is taken as an input parameter for support other members of
the device family.

Signed-off-by: Bjørn Mork &lt;bjorn@mork.no&gt;
Tested-by: Bjørn Mork &lt;bjorn@mork.no&gt;
(cherry picked from commit 48cad07a55246317d66fee4ced25cb62a2bae3d3)
</content>
</entry>
<entry>
<title>tplink-safeloader: fix product_name of TP-Link AD7200</title>
<updated>2021-05-06T07:53:44Z</updated>
<author>
<name>Alex Henrie</name>
</author>
<published>2021-05-04T03:07:17Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=10a535a90c97c687c15993c8c7464c106d1be9d0'/>
<id>urn:sha1:10a535a90c97c687c15993c8c7464c106d1be9d0</id>
<content type='text'>
The stock firmware does not accept firmware with "Talon" in the name.

Tested on firmware version 1.0.10 Build 20160902 rel. 57400 which came
preinstalled, as well as latest firmware version 2.0.1 Build 20170103
rel.71053 flashed from
AD7200v1-up-ver2-0-1-P1[20170103-rel71053]_2017-01-04_10.08.28.bin.

Fixes: 1a775a4fd033 ("ipq806x: add support for TP-Link Talon AD7200")
Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
[added details about vendor firmware]
Signed-off-by: Petr Štetiar &lt;ynezz@true.cz&gt;
(cherry picked from commit dfef88b6cacceec151ca4ce4bb3dc50c1c5cf1d2)
</content>
</entry>
<entry>
<title>tplink-safeloader: fix C7v5 factory flashing from vendor fw &gt; v1.1.x</title>
<updated>2021-04-13T08:36:47Z</updated>
<author>
<name>Petr Štetiar</name>
</author>
<published>2021-04-09T12:52:05Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=6fd65c657351908302b37447675ee352ec927d93'/>
<id>urn:sha1:6fd65c657351908302b37447675ee352ec927d93</id>
<content type='text'>
Currently it's not possible to flash factory images on devices shipped
with vendor firmware versions 1.1.0 Build 20201120 rel. 50406 (published
2020-12-22):

 (curFw_ver, newFw_ver) == (1.1, 1.0) [NM_Error](nm_checkSoftVer) 00848: Firmwave not supports, check failed.
 [NM_Error](nm_checkUpdateContent) 01084: software version dismatched
 [NM_Error](nm_buildUpgradeStruct) 01188: checkUpdateContent failed.

They've even following note in release notes:

 Note: You will be unable to downgrade to the previous firmware version
       after updating this firmware.

This version check in vendor firmware is implemented in
/usr/bin/nvrammanager binary likely as following C code[1]:

 sscanf(buf, "%d.%d.%*s",&amp;upd_fw_major, &amp;upd_fw_minor);
 ...
 if (((int)upd_fw_major &lt; (int)cur_fw_major) ||
     ((ret = 1, cur_fw_major == upd_fw_major &amp;&amp; (upd_fw_minor &lt; (int)cur_fw_minor)))) {
       ret = 0;
       printf("[NM_Error](%s) %05d: Firmwave not supports, check failed.\r\n\r\n","nm_checkSoftVer" ,0x350);
 }
 ...
 return ret;

So in order to fix this and make it future proof it should be enough to
ship our factory firmware images with major version 7 (lucky number).

Tested on latest firmware version 1.1.2 Build 20210125 rel.37999:

 Firmwave supports, check OK.
  (curFw_ver, newFw_ver) == (1.1, 7.0) check firmware ok!

Flashing back to vendor firmware
c7v5_us-up-ver1-1-2-P1[20210125-rel37999]_2021-01-25_10.33.55.bin works
as well:

 U-Boot 1.1.4-gbec22107-dirty (Nov 18 2020 - 18:19:12)
 ...
 Firmware downloaded... filesize = 0xeeae77 fileaddr = 0x80060000.
 Firmware Recovery file length : 15642231
 Firmware process id 2.
 handle_fw_cloud 146
 Image verify OK!
 Firmware file Verify ok!
 product-info:product_name:Archer C7
 product_ver:5.0.0
 special_id:55530000
 [Error]sysmgr_cfg_checkSupportList(): 1023 @ specialId 45550000 NOT Match.
 Firmware supports, check OK.
 Firmware Recovery check ok!

1. https://gist.github.com/ynezz/2e0583647d863386a66c3d231541b6d1

Signed-off-by: Petr Štetiar &lt;ynezz@true.cz&gt;
(cherry picked from commit e6d66375cbbb54e0e82a67030e385a5486273766)
</content>
</entry>
<entry>
<title>firmware-utils: bcm4908img: convert into a package</title>
<updated>2021-04-08T11:16:13Z</updated>
<author>
<name>Rafał Miłecki</name>
</author>
<published>2021-04-01T15:06:47Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=91e0865ff576cad261a9cabc6b0e7dc2c7ce7508'/>
<id>urn:sha1:91e0865ff576cad261a9cabc6b0e7dc2c7ce7508</id>
<content type='text'>
bcm4908img is a tool managing BCM4908 platform images. It's used for
creating them as well as checking, modifying and extracting data from.

It's required by both: host (for building firmware images) and target
(for sysupgrade purposes). Make it a host/target package.

Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
(cherry picked from commit 9b4fc4cae9fa0cd0cd9060e1c9d33320c3249ced)
</content>
</entry>
<entry>
<title>firmware-utils: bcm4908img: fix uninitialized var usage</title>
<updated>2021-04-08T11:16:13Z</updated>
<author>
<name>Rafał Miłecki</name>
</author>
<published>2021-04-08T07:10:20Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=7b3bde801ba34c945465d6fbcebd56f14616ce0d'/>
<id>urn:sha1:7b3bde801ba34c945465d6fbcebd56f14616ce0d</id>
<content type='text'>
Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
(cherry picked from commit 5a2086d230063b2f83a436ed37b0f6a92706bcb9)
</content>
</entry>
<entry>
<title>firmware-utils: bcm4908img: extract bootfs without padding</title>
<updated>2021-04-08T11:16:13Z</updated>
<author>
<name>Rafał Miłecki</name>
</author>
<published>2021-04-07T05:59:57Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/pepe2k/commit/?id=2e2b5833931895f5cb6138b8563aa5ff1010a0ff'/>
<id>urn:sha1:2e2b5833931895f5cb6138b8563aa5ff1010a0ff</id>
<content type='text'>
JFFS2 bootfs partition in a BCM4908 image usually includes some padding.
For flashing it individually (writing to designed MTD partition) we want
just JFFS2 data.

Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
(cherry picked from commit ed7edf88e20c9dd0026e5c5629d8a6500d3e3f80)
</content>
</entry>
</feed>
