openwrt/tools/firmware-utils/src
Sander Vanheule a7c0c9bb7e ramips: mt7621: add TP-Link EAP235-Wall support
The TP-Link EAP235-Wall is a wall-mounted, PoE-powered AC1200 access
point with four gigabit ethernet ports.

When connecting to the device's serial port, it is strongly advised to
use an isolated UART adapter. This prevents linking different power
domains created by the PoE power supply, which may damage your devices.

The device's U-Boot supports saving modified environments with
`saveenv`. However, there is no u-boot-env partition, and saving
modifications will cause the partition table to be overwritten. This is
not an issue for running OpenWrt, but will prevent the vendor FW from
functioning properly.

Device specifications:
* SoC: MT7621DAT
* RAM: 128MiB
* Flash: 16MiB SPI-NOR
* Wireless 2.4GHz (MT7603EN): b/g/n, 2x2
* Wireless 5GHz (MT7613BEN): a/n/ac, 2x2
* Ethernet: 4× GbE
  * Back side: ETH0, PoE PD port
  * Bottom side: ETH1, ETH2, ETH3
* Single white device LED
* LED button, reset button (available for failsafe)
* PoE pass-through on port ETH3 (enabled with GPIO)

Datasheet of the flash chip specifies a maximum frequency of 33MHz, but
that didn't work. 20MHz gives no errors with reading (flash dump) or
writing (sysupgrade).

Device mac addresses:
Stock firmware uses the same MAC address for ethernet (on device label)
and 2.4GHz wireless. The 5GHz wireless address is incremented by one.
This address is stored in the 'info' ('default-mac') partition at an
offset of 8 bytes.
From OEM ifconfig:
    eth     a4:2b:b0:...:88
    ra0     a4:2b:b0:...:88
    rai0    a4:2b:b0:...:89

Flashing instructions:
* Enable SSH in the web interface, and SSH into the target device
* run `cliclientd stopcs`, this should return "success"
* upload the factory image via the web interface

Debricking:
U-boot can be interrupted during boot, serial console is 57600 baud, 8n1
This allows installing a sysupgrade image, or fixing the device in
another way.
* Access serial header from the side of the board, close to ETH3,
  pin-out is (1:TX, 2:RX, 3:GND, 4:3.3V), with pin 1 closest to ETH3.
* Interrupt bootloader by holding '4' during boot, which drops the
  bootloader into its shell
* Change default 'serverip' and 'ipaddr' variables (optional)
* Download initramfs with `tftpboot`, and boot image with `bootm`
    # tftpboot 84000000 openwrt-initramfs.bin
    # bootm

Revert to stock:
Using the tplink-safeloader utility from the firmware-utils package,
TP-Link's firmware image can be converted to an OpenWrt-compatible
sysupgrade image:
  $ ./staging_dir/host/bin/tplink-safeloader -B EAP235-WALL-V1 \
      -z EAP235-WALLv1_XXX_up_signed.bin -o eap235-sysupgrade.bin

This can then be flashed using the OpenWrt sysupgrade interface. The
image will appear to be incompatible and must be force flashed, without
keeping the current configuration.

Known issues:
- DFS support is incomplete (known issue with MT7613)
- MT7613 radio may stop responding when idling, reboot required.
  This was an issue with the ddc75ff704 version of mt76, but appears to
  have improved/disappeared with bc3963764d.
  Error notice example:
  [ 7099.554067] mt7615e 0000:02:00.0: Message 73 (seq 1) timeout

Hardware was kindly provided for porting by Stijn Segers.

Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
(cherry picked from commit 1e75909a35)
2021-02-19 20:09:28 +01:00
..
add_header.c firmware-utils: when using open with O_CREAT and O_WRONLY, also use O_TRUNC to ensure that overwritten files have the right size (fixes #3505) 2008-09-23 16:12:40 +00:00
addpattern.c tools/firmware-utils: use UTC for image timestamps 2020-08-07 09:48:33 +02:00
asustrx.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
bcm4908asus.c firmware-utils: bcm4908asus: tool inserting Asus tail into BCM4908 image 2021-01-22 20:10:38 +01:00
bcm4908img.c firmware-utils: bcm4908img: tool adding BCM4908 image tail 2021-01-18 07:39:09 +01:00
bcm4908kernel.c firmware-utils: bcm4908kernel: tool adding BCM4908 kernel header 2021-01-15 07:44:46 +01:00
bcm_tag.h firmware-utils: move bcm_tag.h here 2012-10-08 09:59:50 +00:00
bcmalgo.c tools: add Broadcom cable modem firmware image creator 2013-06-06 22:21:52 +00:00
bcmalgo.h tools: add Broadcom cable modem firmware image creator 2013-06-06 22:21:52 +00:00
buffalo-enc.c firmware-utils: improve tools for Buffalo DHP series 2017-01-31 10:55:02 +01:00
buffalo-lib.c firmware-utils/buffalo-enc: explicitly use signed char for checksum function 2015-10-12 13:11:20 +00:00
buffalo-lib.h firmware-utils: improve tools for Buffalo DHP series 2017-01-31 10:55:02 +01:00
buffalo-tag.c firmware-utils: improve tools for Buffalo DHP series 2017-01-31 10:55:02 +01:00
buffalo-tftp.c firmware-utils: fix compilation warnings. 2014-10-20 06:29:13 +00:00
csysimg.h adds support for Edimax BR-6524N 2013-01-06 11:11:30 +00:00
cyg_crc16.c firmware-utils: add new tool for the wrt400n (based on a patch by Sandeep Mistry <sandeep.mistry at gmail.com>) 2009-07-12 08:59:18 +00:00
cyg_crc32.c firmware-utils: add new tool for the wrt400n (based on a patch by Sandeep Mistry <sandeep.mistry at gmail.com>) 2009-07-12 08:59:18 +00:00
cyg_crc.h firmware-utils: add new tool for the wrt400n (based on a patch by Sandeep Mistry <sandeep.mistry at gmail.com>) 2009-07-12 08:59:18 +00:00
dgfirmware.c firmware-utils/dgfirmare: fix possible resource leak 2020-01-14 17:48:50 +01:00
dgn3500sum.c firmware-utils: fix dgn3500sum compiler warnings 2017-06-26 20:08:36 +02:00
dns313-header.c firmware-utils: fix possible memory leak and resource leak 2020-01-14 17:48:50 +01:00
edimax_fw_header.c tools: edimax_fw_header: fix suspicious memset usage 2015-01-10 18:08:16 +00:00
encode_crc.c remove 'svn:executable' property 2010-04-12 17:08:57 +00:00
fix-u-media-header.c firmware-utils: new tool for fixing U-Media firmware headers 2012-10-18 07:23:09 +00:00
fw.h firmware-utils: mkfwimage: fix memcpy and strncpy usage 2020-07-11 13:33:28 +02:00
hcsmakeimage.c firmware-utils/hcsmakeimage: fix possible memory leak and resource leaks 2020-07-08 16:07:05 +02:00
imagetag_cmdline.c brcm63xx: do not align squashfs rootfs start 2015-02-27 17:38:14 +00:00
imagetag_cmdline.h brcm63xx: do not align squashfs rootfs start 2015-02-27 17:38:14 +00:00
imagetag.c firmware-utils: honor env SOURCE_DATE_EPOCH 2017-06-19 14:34:52 +02:00
imagetag.ggo brcm63xx: do not align squashfs rootfs start 2015-02-27 17:38:14 +00:00
jcgimage.c firmware-utils: jcgimage: add support for 4MiB+ images 2019-05-31 10:30:03 +02:00
lxlfw.c firmware-utils: add lxlfw tool for generating Luxul firmwares 2020-02-07 09:31:22 +01:00
lzma2eva.c firmware-utils: fix various compiler warnings 2015-12-11 15:09:30 +00:00
makeamitbin.c Add makeamitbin to generate images for other RDC-based devices, thanks sn9 ! 2008-10-28 16:26:42 +00:00
md5.c firmware-utils: replace md5 code with Alexander Peslyak's implementation 2016-11-28 07:52:31 +01:00
md5.h firmware-utils: replace md5 code with Alexander Peslyak's implementation 2016-11-28 07:52:31 +01:00
mkbrncmdline.c Support booting the Speedport W502V using BRN-BOOT. 2012-02-14 17:48:04 +00:00
mkbrnimg.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkbuffaloimg.c ar71xx: add support for Buffalo BHR-4GRV2 2016-11-16 10:54:33 +01:00
mkcameofw.c firmware-utils/mkcameofw: allow to use combined kernel image 2013-05-08 17:11:08 +00:00
mkcasfw.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkchkimg.c mkchkimg: use higher version code 2020-06-09 16:59:33 +02:00
mkcsysimg.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkdapimg2.c tools/firmware-utils: fix sysupgrade typo in mkdapimg2 2019-01-12 19:47:25 +01:00
mkdapimg.c tools/firmware-utils: fix sysupgrade typo in mkdapimg 2019-01-12 19:44:35 +01:00
mkdhpimg.c firmware-utils: improve tools for Buffalo DHP series 2017-01-31 10:55:02 +01:00
mkdlinkfw-lib.c firmware-utils: mkdlinkfw: fix error handling 2019-01-13 18:31:10 +01:00
mkdlinkfw-lib.h firmware-utils: mkdlinkfw: cleanup code 2019-01-13 18:31:10 +01:00
mkdlinkfw.c firmware-utils: mkdlinkfw: add kernel image offset 2019-03-24 01:44:24 +01:00
mkdniimg.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkedimaximg.c firmware-utils: mkedimaximg: add "big-endianness mode" option 2018-09-10 09:29:39 +02:00
mkfwimage2.c firmware-utils/mkfwimage: fix possible memory and resource leak 2020-01-14 17:48:50 +01:00
mkfwimage.c ath79: add support for Ubiquiti airCube AC 2020-12-22 19:11:50 +01:00
mkheader_gemtek.c firmware-utils: add Gemtek header tool 2014-04-22 08:08:39 +00:00
mkhilinkfw.c firmware-utils: fix various compiler warnings 2015-12-11 15:09:30 +00:00
mkmerakifw-old.c tools/firmware-utils: fix portability issue in mkmerakifw-old 2016-09-22 13:37:23 +02:00
mkmerakifw.c firmware-utils: Fix build failure in mkmerakifw.c FS#298 2016-11-26 22:39:27 +01:00
mkmylofw.c ar71xx: Revert "added board support for compex wpj558" 2015-02-02 10:32:04 +00:00
mkplanexfw.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkporayfw.c ramips: generate factory images for Nexx devices 2014-12-07 16:53:22 +00:00
mkrasimage.c mkrasimage: fix segmentation fault 2020-03-01 21:36:00 +01:00
mkrtn56uimg.c firmware-utils: honor env SOURCE_DATE_EPOCH 2017-06-19 14:34:52 +02:00
mksenaofw.c firmware-utils/mksenaofw: fix possible memory leak 2020-01-14 17:48:50 +01:00
mksercommfw.c firmware-utils: mksercommfw: overhaul image creation 2019-01-15 19:11:54 +01:00
mktitanimg.c firmware-utils/mktitanimg: fix possible resource leak 2020-01-14 17:48:50 +01:00
mktitanimg.h add mktitanimg to create Titan (AR7-based) images (#6632) 2010-06-06 19:16:43 +00:00
mktplinkfw2.c ramips: fix/tidy up 4M tplink-v2-image flash layouts 2020-08-03 12:17:08 +02:00
mktplinkfw-lib.c firmware-utils: mktplinkfw: fix JFFS2 EOF markers 2017-12-14 09:29:30 +01:00
mktplinkfw-lib.h tools/firmware-utils: mktplinkfw move build_fw() to lib 2017-10-06 08:28:41 +02:00
mktplinkfw.c ramips: add support for TP-Link RE200 v1 2019-12-31 13:23:55 +01:00
mkwrggimg.c firmware-utils: fix compilation on MacOS X 2016-10-31 12:39:09 +01:00
mkwrgimg.c firmware-utils: rename the devname variable in mkwrgimg to avoid a clash with a BSD stdlib function 2011-07-08 05:20:24 +00:00
mkzcfw.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
mkzynfw.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
motorola-bin.c get rid of $Id$ - it has never helped us and it has broken too many patches ;) 2009-04-17 14:09:46 +00:00
myloader.h ar71xx: Revert "added board support for compex wpj558" 2015-02-02 10:32:04 +00:00
nand_ecc.c treewide: replace nbd@openwrt.org with nbd@nbd.name 2016-06-07 08:58:42 +02:00
nec-enc.c firmware-utils: fix mistake and improve logic in nec-enc 2020-11-12 18:19:44 +01:00
osbridge-crc.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
oseama.c firmware-utils: oseama: support extracting entity 2016-06-15 10:54:16 +02:00
otrx.c firmware-utils: add otrx tool for handling TRX images 2017-11-17 11:42:59 +01:00
pc1crypt.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
ptgen.c firmware-utils/ptgen: allow explicit placement of partitions 2020-07-08 23:22:30 +02:00
seama.c tools: firmware-utils: fix compiler warnings 2015-10-11 19:00:41 +00:00
seama.h tools/firmware-utils: add seama tool 2012-10-18 07:22:57 +00:00
sha1.c firmware-utils/mkplanexfw: new firmware generation tool for the Planex MZK-W04NU device 2009-02-04 21:09:06 +00:00
sha1.h firmware-utils/mkplanexfw: new firmware generation tool for the Planex MZK-W04NU device 2009-02-04 21:09:06 +00:00
sign_dlink_ru.c firmware: add tool for signing d-link ru router factory firmware images 2020-12-22 19:11:50 +01:00
spw303v.c firmware-utils: honor env SOURCE_DATE_EPOCH 2017-06-19 14:34:52 +02:00
srec2bin.c firmware-utils: fix various compiler warnings 2015-12-11 15:09:30 +00:00
tplink-safeloader.c ramips: mt7621: add TP-Link EAP235-Wall support 2021-02-19 20:09:28 +01:00
trx2edips.c firmware-utils: fix build on big endian systems 2011-06-21 21:13:58 +00:00
trx2usr.c move target/utils to tools/firmware-utils 2006-12-06 23:41:38 +00:00
trx.c firmware-utils: improve tools for Buffalo DHP series 2017-01-31 10:55:02 +01:00
uimage_padhdr.c firmware-utils: uimage_padhdr: fix Coverity issue 2019-08-04 22:09:20 +02:00
utils.h firmware-utils: mkfwimage: fix memcpy and strncpy usage 2020-07-11 13:33:28 +02:00
wrt400n.c Revert "tools: wrt400n: fix making factory images with kernel bigger than 1MB" 2017-01-20 06:43:13 +01:00
xorimage.c firmware-utils: add hex pattern mode for xorimage 2018-12-24 19:18:07 +01:00
zyimage.c firmware-utils: add tool to create zyxel images 2016-11-17 20:01:21 +01:00
zynos.h firmware-utils/mkzynfw: add support for the NBG460N board 2010-05-14 09:20:36 +00:00
zyxbcm.c firmware-utils: honor env SOURCE_DATE_EPOCH 2017-06-19 14:34:52 +02:00