openwrt/target/linux
Mikhail Zhilkin 1a35edfbdb ramips: add basic support for TP-Link EC330-G5u v1
This adds basic support for TP-Link EC330-G5u Ver:1.0 router (also known
as TP-Link Archer C9ERT).

Device specification
--------------------
SoC Type: MediaTek MT7621AT
RAM: 128 MiB, Nanya NT5CC64M16GP-DI
Flash: 128 MiB NAND, ESMT F59L1G81MA-25T
Wireless 2.4 GHz (MediaTek MT7615N): b/g/n, 4x4
Wireless 5 GHz (MediaTek MT7615N): a/n/ac, 4x4
Ethernet: 5xGbE (WAN, LAN1, LAN2, LAN3, LAN4)
USB ports: 1xUSB3.0
Button: 4 (Led, WiFi On/Off, Reset, WPS)
LEDs: 7 blue LEDs, 1 orange(amber) LED, 1 white(non-gpio) LED
Power: 12 VDC, 2 A
Connector type: Barrel
Bootloader: First U-Boot (1.1.3), Main U-Boot (1.1.3). Additionally,
original TP-Link firmware contains Image U-Boot (1.1.3).

Serial console (UART)
---------------------
                            V
+-------+-------+-------+-------+
| +3.3V |  GND  |  TX   |  RX   |
+---+---+-------+-------+-------+
    |              J2
    |
    +--- Don't connect

Installation
------------
1. Rename OpenWrt initramfs image to test.bin and place it on tftp server
   with IP 192.168.0.5
2. Attach UART, switch on the router and interrupt the boot process by
   pressing 't'
3. Load and run OpenWrt initramfs image:
      tftpboot
      bootm
4. Once inside OpenWrt, switch to the first boot image:
      fw_setenv BootImage 0
5. Run 'sysupgrade -n' with the sysupgrade OpenWrt image

Back to Stock
-------------
1. Run in the OpenWrt shell:
      fw_setenv BootImage 1
      reboot

Recovery
--------
1. Press Reset button and power on the router
2. Navigate to U-Boot recovery web server (http://192.168.0.1/) and upload
   the OEM firmware

MAC addresses
-------------
+---------+-------------------+-------------------+-------------+
|         | MAC example 1     | MAC example 2     | Algorithm   |
+---------+-------------------+-------------------+-------------+
| label   | 68:ff:7b:xx:xx:f4 | 50:d4:f7:xx:xx:da | label       |
| LAN     | 68:ff:7b:xx:xx:f4 | 50:d4:f7:xx:xx:da | label       |
| WAN     | 72:ff:7b:xx:xx:f5 | 54:d4:f7:xx:xx:db | label+1 [1] |
| WLAN 2g | 68:ff:7b:xx:xx:f4 | 50:d4:f7:xx:xx:da | label       |
| WLAN 5g | 68:ff:7b:xx:xx:f6 | 50:d4:f7:xx:xx:dc | label+2     |
+---------+-------------------+-------------------+-------------+
label MAC address was found in factory at 0x165 (text format
xx:xx:xx:xx:xx:xx).

Notes
-----
[1] WAN MAC address:
   a. First octet of WAN MAC is differ than others and OUI is not related
      to TP-Link company. This probably should be fixed.
   b. Flipping bits in first octet and hex delta are different for the
      different MAC examples:
      +-----------------+----------------+----------------+
      |                 | Example 1      | Example 2      |
      +-----------------+----------------+----------------+
      | LAN             | 68 = 0110 1000 | 50 = 0101 0000 |
      | MAC (1st octet) |         ^ ^ ^  |                |
      +-----------------+----------------+----------------+
      | WAN             | 72 = 0111 0010 | 54 = 0101 0100 |
      | MAC (1st octet) |         ^ ^ ^  |            ^   |
      +-----------------+----------------+----------------+
      | HEX delta       | 0xa            | 0x4            |
      +-----------------+----------------+----------------+
      | DEC delta       | 4              | 4              |
      +-----------------+----------------+----------------+
   c. DEC delta is a constant (4). This looks like a mistake in OEM
      firmware and probably should be fixed.
   Based on the above, I decided to keep correct OUI and make WAN MAC =
   label + 1.

[2] Bootloaders
   The device contains 3 bootloaders:
   - First U-Boot: U-Boot 1.1.3 (Mar 18 2019 - 12:50:24). The First U-Boot
     located on NAND Flash to load next full-feature Uboot.
   - Main U-Boot + its backup: U-Boot 1.1.3 (Mar 18 2019 - 12:50:29). This
     bootloader includes recovery webserver. Requires special uImages to
     continue the boot process:
        0x00 (os0, os1) - firmware uImage
        0x40 (os0, os1) - standalone uImage (OpenWrt kernel is here)
   - Additionally, both slots of the original TP-Link firmware contains
     Image U-Boot: U-Boot 1.1.3 (Oct 16 2019 - 08:14:45). It checks image
     magics and CRCs. We don't use this U-Boot with OpenWrt.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-01-14 18:36:33 +01:00
..
airoha airoha: disable swconfig 2022-11-27 13:18:29 +01:00
apm821xx kernel: bump 5.10 to 5.10.161 2022-12-24 15:24:18 +01:00
archs38 archs38: enable 5.15 testing kernel 2023-01-13 21:55:58 +01:00
armvirt kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic config 2022-10-21 13:47:01 +02:00
at91 at91: sam9x,sama5: fix racy SD card image generation 2023-01-11 15:23:18 +01:00
ath25 ath25: add generic subtarget 2022-12-23 19:44:14 +01:00
ath79 kernel: bump 5.15 to 5.15.87 2023-01-13 22:04:22 +01:00
bcm27xx kernel: bump 5.15 to 5.15.87 2023-01-13 22:04:22 +01:00
bcm47xx bcm47xx: replace "Devices-database-update-patch" with upstream patches 2022-12-30 20:03:59 +01:00
bcm53xx kernel: update nvmem subsystem to the latest upstream 2023-01-06 22:08:03 +01:00
bcm63xx kernel: bump 5.15 to 5.15.86 2023-01-03 23:55:45 +01:00
bcm4908 treewide: uniform vendor name for ASUS 2022-11-16 23:30:11 +01:00
bmips kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic config 2022-10-21 13:47:01 +02:00
gemini gemini: add generic subtarget 2022-12-23 19:44:20 +01:00
generic kernel: bump 5.15 to 5.15.87 2023-01-13 22:04:22 +01:00
imx cypress-nvram: consolidate NVRAM packages 2022-11-16 20:14:13 +01:00
ipq40xx kernel: bump 5.15 to 5.15.87 2023-01-13 22:04:22 +01:00
ipq806x kernel: bump 5.15 to 5.15.87 2023-01-13 22:04:22 +01:00
kirkwood kirkwood: add generic subtarget 2022-12-23 19:44:20 +01:00
lantiq lantiq: xrx200: Fix wifi LED on o2 box 6431 2023-01-11 22:01:56 +01:00
layerscape layerscape: Add CONFIG_NVMEM_LAYERSCAPE_SFP kernel configuration option 2023-01-08 18:51:27 +01:00
malta kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic config 2022-10-21 13:47:01 +02:00
mediatek mt76: add stand-alone MT7622 firmware package 2023-01-07 17:11:00 +01:00
mpc85xx kernel: backport of changes & helpers 2023-01-07 17:45:17 +01:00
mvebu mvebu: backport upstream patch to fix COMPHY reset 2023-01-11 21:56:36 +01:00
mxs mxs: add generic subtarget 2022-12-23 19:44:20 +01:00
octeon kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic config 2022-10-21 13:47:01 +02:00
octeontx octeontx: add sqaushfs and ramdisk to features 2023-01-06 19:44:35 +01:00
omap omap: add generic subtarget 2022-12-23 19:44:22 +01:00
oxnas kernel: bump 5.15 to 5.15.86 2023-01-03 23:55:45 +01:00
pistachio pistachio: add generic subtarget 2022-12-23 19:44:22 +01:00
qoriq qoriq: drop unused kernel config 2023-01-09 21:39:45 +02:00
ramips ramips: add basic support for TP-Link EC330-G5u v1 2023-01-14 18:36:33 +01:00
realtek realtek: Follow kernel comment style recommendation 2023-01-13 22:34:16 +01:00
rockchip treewide: update NVMEM symbols 2023-01-07 01:30:31 +01:00
sunxi sunxi: switch to kernel 5.15 2023-01-09 21:39:46 +02:00
tegra tegra: add generic subtarget 2022-12-23 19:44:21 +01:00
uml uml: switch to Kernel 5.15 2022-12-12 09:06:17 +01:00
x86 x86: Add APU6 board support for startup detection 2023-01-11 15:16:53 +01:00
zynq zynq: add 5.15 testing kernel 2023-01-03 20:56:01 +01:00
Makefile build: fix issues with targets installed via feeds 2022-09-27 13:41:12 +02:00