openwrt/target/linux
Maxim Anisimov 86e7353bff ramips: add support for TP-Link Archer C20 v5
TP-Link Archer C20 v5 is a router with 5-port FE switch and
non-detachable antennas. It's based on MediaTek MT7628N+MT7610EN.

Specification:
- MediaTek MT7628N/N (580 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz and 1T1R 5 GHz
- 5x 10/100 Mbps Ethernet
- 3x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- 7x LED (GPIO-controlled*), 2x button, power input switch

* WAN LED in this devices is a dual-color, dual-leads type which isn't
  (fully) supported by gpio-leds driver. This type of LED requires both
  GPIOs state change at the same time to select color or turn it off.
  For now, we support/use only the green part of the LED.

Create Factory image
--------------------
As all installation methods require a U-Boot to be integrated into the
Image (and we do not ship one with the image) we are not able to create
an image in the OpenWRT build-process.

Download a TP-Link image from their Website and a OpenWRT sysupgrade
image for the device and build yourself a factory image like following:

TP-Link image:             tpl.bin
OpenWRT sysupgrade image:  owrt.bin

 > dd if=tpl.bin of=boot.bin bs=131584 count=1
 > cat owrt.bin >> boot.bin

Installing via Web-UI
---------------------
Upload the boot.bin via TP-Links firmware upgrade tool in the
web-interface.

Installing via Recovery
-----------------------
Activate Web-Recovery by beginning the upgrade Process with a
Firmware-Image from TP-Link. After starting the Firmware Upgrade,
wait ~3 seconds (When update status is switching to 0%), then
disconnect the power supply from the device. Upgrade flag (which
activates Web-Recovery) is written before the OS-image is touched and
removed after write is succesfull, so this procedure should be safe.

Plug the power back in. It will come up in Recovery-Mode on 192.168.0.1.
When active, all LEDs but the WPS LED are off.
Remeber to assign yourself a static IP-address as DHCP is not active in
this mode.

The boot.bin can now be uploaded and flashed using the web-recovery.

Installing via TFTP
-------------------
Prepare an image like following (Filenames from factory image steps
apply here)

 > dd if=/dev/zero of=tp_recovery.bin bs=196608 count=1
 > dd if=tpl.bin of=tmp.bin bs=131584 count=1
 > dd if=tmp.bin of=boot.bin bs=512 skip=1
 > cat boot.bin >> tp_recovery.bin
 > cat owrt.bin >> tp_recovery.bin

Place tp_recovery.bin in root directory of TFTP server and listen on
192.168.0.66/24.

Connect router LAN ports with your computer and power up the router
while pressing the reset button. The router will download the image via
tftp and after ~1 Minute reboot into OpenWRT.

U-Boot CLI
----------
U-Boot CLI can be activated by holding down '4' on bootup.

Dual U-Boot
-----------
This is TP-Link MediaTek device with a split-uboot feature design like
a TP-Link Archer C50 v4. The first (factory-uboot) provides recovery via
TFTP and HTTP, jumping straight into the second (firmware-uboot) if no
recovery needs to be performed. The firmware-uboot unpacks and executed
the kernel.

Web-Recovery
------------
TP-Link integrated a new Web-Recovery like the one on the Archer C7v4 /
TL-WR1043v5 / Archer C50v4. Stock-firmware sets a flag in the "romfile"
partition before beginning to write and removes it afterwards. If the
router boots with this flag set, bootloader will automatically start
Web-recovery and listens on 192.168.0.1. This way, the vendor-firmware
or an OpenWRT factory image can be written.

By doing the same while performing sysupgrade, we can take advantage of
the Web-recovery in OpenWRT.

It is important to note that Web-Recovery is only based on this flag. It
can't detect e.g. a crashing kernel or other means. Once activated it
won't boot the OS before a recovery action (either via TFTP or HTTP) is
performed. This recovery-mode is indicated by an illuminated WPS-LED on
boot.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
[adjust some node names for LEDs in DTS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-01-09 17:33:57 +01:00
..
apm821xx apm821xx: mbl_gen_hdd_img.sh: switch to /bin/sh 2019-12-31 01:28:08 +01:00
ar71xx ar71xx: Remove mtd cfi_cmdset_0002 status check patch 2020-01-05 19:36:45 +01:00
arc770 arc770: gen_axs10x_sdcard_img.sh: switch to /bin/sh 2019-12-31 01:27:32 +01:00
archs38 archs38: gen_axs10x_sdcard_img.sh: switch to /bin/sh 2019-12-31 01:26:35 +01:00
armvirt treewide: Remove self from MAINTAINER entries 2019-12-23 13:18:04 -08:00
at91 at91: gen_at91_sdcard_img.sh: switch to /bin/sh 2019-12-31 01:25:44 +01:00
ath25 ath25: split up DEVICE_TITLE 2019-10-19 13:16:57 +02:00
ath79 ath79: remove unused Build/mktplinkfw-combined 2020-01-08 16:17:58 +01:00
bcm53xx bcm53xx: sysupgrade: support Luxul NAND devices 2019-10-15 20:23:04 +02:00
brcm47xx brcm47xx: add switch configuration for WNR3500L 2019-12-08 00:21:36 +01:00
brcm63xx kernel: bump 4.19 to 4.19.85 2019-11-22 16:56:46 +01:00
brcm2708 kernel: bump 4.19 to 4.19.93 2020-01-05 00:43:36 +01:00
cns3xxx kernel: bump 4.19 to 4.19.86 2019-11-29 09:59:49 +01:00
gemini gemini: dns313_gen_hdd_img.sh: switch to /bin/sh 2019-12-31 01:23:24 +01:00
generic kernel: remove support for kernel 4.9 2020-01-08 16:45:08 +01:00
imx6 kernel: Deactivate CONFIG_SFP in generic config 2019-12-23 15:25:36 +01:00
ipq40xx ipq40xx: build DEVICE_DTS based on SOC and device name 2019-12-27 18:00:15 +01:00
ipq806x ipq806x: refresh kernel patches 2020-01-08 14:33:03 +01:00
kirkwood kirkwood: remove CONFIG_LEGACY_PTY from kernel config 2019-12-09 20:14:20 +01:00
lantiq lantiq: use shared code for LED migration 2020-01-03 00:07:00 +01:00
layerscape kernel: bump 4.14 to 4.14.162 2020-01-05 00:43:33 +01:00
malta treewide: Remove self from MAINTAINER entries 2019-12-23 13:18:04 -08:00
mediatek kernel: bump 4.14 to 4.14.161 2020-01-04 00:45:58 +01:00
mpc85xx treewide: move mktplinkfw to tplink-v1-image in image-commands.mk 2020-01-08 16:15:29 +01:00
mvebu mvebu: split interface configuration for clearfog pro and base 2019-12-31 02:30:08 +01:00
mxs mxs: gen_sdcard_ext4_ext4.sh: use /bin/sh 2019-12-31 01:19:48 +01:00
octeon octeon: fix sysupgrade 2019-11-30 20:19:12 +02:00
octeontx kernel: bump 4.14 to 4.14.160 2019-12-24 17:45:54 +01:00
omap omap: gen_omap_sdcard_img.sh: use /bin/sh 2019-12-31 01:17:09 +01:00
oxnas kernel: bump 4.14 to 4.14.158 2019-12-10 09:50:42 +01:00
pistachio pistachio: split up DEVICE_TITLE 2019-10-12 23:37:00 +02:00
ramips ramips: add support for TP-Link Archer C20 v5 2020-01-09 17:33:57 +01:00
rb532 rb532: gen_image.sh: use /bin/sh 2019-12-31 01:16:17 +01:00
samsung samsung: add subtarget condition for device 2020-01-03 00:04:22 +01:00
sunxi sunxi: Turn on CONFIG_PINCTRL_SUN4I_A10 for A20 2020-01-03 15:05:36 -08:00
tegra x86,tegra,mvebu: image: use common reproducible IMG_PART_SIGNATURE 2019-11-11 16:37:13 +01:00
uml treewide: Remove self from MAINTAINER entries 2019-12-23 13:18:04 -08:00
x86 kernel: bump 4.19 to 4.19.90 2019-12-24 15:34:43 +01:00
zynq zynq: gen_zynq_sdcard_img.sh: switch to /bin/sh 2019-12-31 01:14:48 +01:00
Makefile