Tp Link CPE220 v3 support?

Hi. Tp Link CPE220 v3 support ?

I think it would be better if you can provide more info about the device, such as internal board pics, SoC, Flash, Ram, bootlogs through serial access (if possible) etc. It helps to identify how can the device be ported/supported in OpenWrt.

No support.

1 Like

Thank you.

Thank you very much for answer.

Hi,
I've found link configuration CPE220 v3 for aredn firmware

Can somebody help me to add support for openwrt..
I Will try it to my device

Do you have serial access to device? Can you post the OEM boot log?

I don't have that device yet, but there is repost from @abdulaziz.amar on Support for Tp link CPE210 v3.0 topic
CPE220 v3 stock firmware serial dump:

Linux version 2.6.31 (root@ubunt                                                                                                                     u) (gcc version 4.3.3 (GCC) ) #1 PREEMPT Tue Jan 9 08:51:52 CST 2018
flash_size passed from bootloader = 8
CPU revision is: 00019374 (MIPS 24Kc)
ath_sys_frequency: cpu apb ddr apb cpu 650 ddr 392 ahb 216
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
User-defined physical RAM map:
 memory: 04000000 @ 00000000 (usable)
Zone PFN ranges:
  Normal   0x00000000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttyS0,115200 root=31:04 rootfstype=squashfs init=/i                                                                                                                     nit mtdparts=ath-nor0:128k(u-boot),64k(pation-table),64k(product-info),1536k(ker                                                                                                                     nel),6144k(rootfs),192k(config),64k(ART) mem=64M
PID hash table entries: 256 (order: 8, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000000
Readback ErrCtl register=00000000
Memory: 61388k/65536k available (1832k kernel code, 4076k reserved, 473k data, 1                                                                                                                     12k init, 0k highmem)
Hierarchical RCU implementation.
NR_IRQS:128
plat_time_init: plat time init done
Calibrating delay loop... 432.12 BogoMIPS (lpj=864256)
Mount-cache hash table entries: 512
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
net_link: create socket ok.
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
ATH GPIOC major 0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
NTFS driver 2.1.29 [Flags: R/O].
msgmni has been set to 120
alg: No test for lzma (lzma-generic)
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xb8020000 (irq = 19) is a 16550A
console [ttyS0] enabled
PPP generic driver version 2.4.2
NET: Registered protocol family 24
7 cmdlinepart partitions found on MTD device ath-nor0
Creating 7 MTD partitions on "ath-nor0":
0x000000000000-0x000000020000 : "u-boot"
0x000000020000-0x000000030000 : "pation-table"
0x000000030000-0x000000040000 : "product-info"
0x000000040000-0x0000001c0000 : "kernel"
0x0000001c0000-0x0000007c0000 : "rootfs"
0x0000007c0000-0x0000007f0000 : "config"
0x0000007f0000-0x000000800000 : "ART"
TCP cubic registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
athwdt_init: Registering WDT success
athwdt_timer_init: Starting WDT.
VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
Freeing unused kernel memory: 112k freed
init started:  BusyBox v1.01 (2018.01.09-00:52+0000) multi-call binary
This Board use 2.6.31
xt_time: kernel timezone is -0000
nf_conntrack version 0.5.0 (1024 buckets, 30720 max)
ip_tables: (C) 2000-2006 Netfilter Core Team
iptable_raw: version magic '2.6.31-gbb45668-dirty preempt mod_unload MIPS32_R2 3                                                                                                                     2BIT ' should be '2.6.31 preempt mod_unload MIPS32_R2 32BIT '
insmod: cannot insert `/lib/modules/2.6.31/kernel/iptable_raw.ko': Invalid modul                                                                                                                     e format (-1): Exec format error

Register vlan_manage hooks success.
PPPoL2TP kernel driver, V1.0
PPTP driver version 0.8.3
WARN: TDB not supported!
WARN: TDB not supported!

 (none) mips #1 PREEMPT Tue Jan 9 08:51:52 CST 2018 (none)
(none) login: httpMudCreate: MUD 0x6613b0 was created
[info @ initModelParameters:205] init profile...

qca95xx_GMAC: Length per segment 1536
953x_GMAC: qca953x_gmac_attach
Link Int Enabled
qca953x_set_gmac_caps  CHECK DMA STATUS
mac:0 Registering S27....
qca95xx_GMAC: RX TASKLET - Pkts per Intr:18
qca95xx_GMAC: Mac address for unit 0:bfff0000
qca95xx_GMAC: ff:ff:ff:ff:ff:ff
qca95xx_GMAC: Max segments per packet :   1
qca95xx_GMAC: Max tx descriptor count :   128
qca95xx_GMAC: Max rx descriptor count :   128
qca95xx_GMAC: Mac capability flags    :   3581
953x_GMAC: qca953x_gmac_attach
Link Int Enabled
qca953x_set_gmac_caps  CHECK DMA STATUS
mac:1 Registering S27....
qca95xx_GMAC: RX TASKLET - Pkts per Intr:18
qca95xx_GMAC: Mac address for unit 1:bfff0006
qca95xx_GMAC: ff:ff:ff:ff:ff:ff
qca95xx_GMAC: Max segments per packet :   1
qca95xx_GMAC: Max tx descriptor count :   128
qca95xx_GMAC: Max rx descriptor count :   128
qca95xx_GMAC: Mac capability flags    :   3D81
device eth0 entered promiscuous mode
device eth1 entered promiscuous mode
athr_gmac_ring_alloc Allocated 2048 at 0x83a85800
athr_gmac_ring_alloc Allocated 2048 at 0x83a85000
HONEYBEE ----> S27 PHY MDIO
Setting Drop CRC Errors, Pause Frames and Length Error frames
Setting PHY...
athr_gmac_ring_alloc Allocated 2048 at 0x83a99800
athr_gmac_ring_alloc Allocated 2048 at 0x83a99000
HONEYBEE ----> S27 PHY MDIO
ATHRS27: resetting s27
ATHRS27: s27 reset done
Setting Drop CRC Errors, Pause Frames and Length Error frames
Setting PHY...

Disable VlanManage, data.enable(0), data.vid(0)
rmmod: br_dhcp_filter.ko: No such file or directory
[dhcpcKill:643]error: dhcpc status:3
command not supported

Well it seems it may be possible to support this one. Developers here will need more info about the system than just the boot log. Info about the board, cpu, flash/ram, inner pics of the board etc. The log shows qca95xx as wireless chip so it may be supported but I cant say anything for sure. Having the device on hand is better to test it for installation and in case of debricking it.

There are data from cpe220 v3 gpl code from tp link
file readme.txt

TP-LINK Pharos 1.0 GPL code readme

1. This package contains GPL code for Pharos 1.0.
2. All components have been built successfully on Ubuntu 1210.

Build Instructions
1. All build targets are in "hipap_gpl_code/build/", you should enter this directory to build components.
2. Toolchain binary is avaliable in this package. The directory is "hipap_gpl_code/toolchain/".
3. Building steps:
 1) cd hipap_gpl_code
 2) cd build
 3) make BOARD_TYPE=db12x PID=hipap hipap
4. After building completed, The linux kernel image, rootfs filesystem will be found in directory "hipap_gpl_code/images/hipap/db12x/".

File config.hipap :

#8210 lan and wan no swapped.
export CONFIG_ATHR_PHY_SWAP=0

#8210 do not have 3G
export CONFIG_3G_TOOLS=0
export INCLUDE_3G=0

#8210 is not a pure AP
#export CONFIG_AP_TOOLS=0

#declare specific product id
export CONFIG_PID_821001=y

#declare igmp proxy support
export CONFIG_TP_IGMP_SNOOPING=y

#multiplex Reset fac and wps
#export JUMPSTART_RST_MULTIPLEXED=y

#muti-sysmode not controlled by hardware
#export SUPPORT_HARDWARE_MULTI_MODE=n
#export SYS_MODE_GPIO_1=18
#export SYS_MODE_GPIO_2=20

export NO_SIMPLE_CONFIG=1

#turn on 3/4 address auto detection
export CONFIG_WLAN_STA_ADDRTYPE=1
export ATH_SUPPORT_TxBF=1


export CONFIG_8035PHY_FORHIPAP=1
export CONFIG_ATHRS_AR8033_PHY=y
export CONFIG_8035_PHY0_ADDR=0x04
export CONFIG_GPIO_LAN1_SOFT_LED=1
export CONFIG_GPIO_LAN1_SOFT_LED_BIT=11

File config.db12x :

# Set the toolchain path
export TOOLCHAIN=gcc-4.3.3
export TOOLPREFIX=mips-linux-uclibc-
export TOOLARCH=build_mips/staging_dir/usr
export UBOOT_GCC_4_3_3_EXTRA_CFLAGS=-fPIC

export VOIPDIR=$(TOPDIR)/apps/gateway/services/phone

export KERNEL=mips-linux-2.6.31
export KERNELVER=2.6.31
export KERNELTARGET=vmlinux.bin
export COMPRESSKERNEL=y
export KERNELARCH=mips
#export TARGETFSSIZE=6488064
#export ATH_DUAL_FLASH=1
ifeq ($(BOOT_FROM_NAND),1) #{
# should be multiple of 128k
export TARGETFSSIZE=4194304
export ATH_CAL_NAND_FLASH=1
export ATH_CAL_NAND_PARTITION="caldata"
else #}{
ifeq ($(ATH_DUAL_FLASH),1) #{
export TARGETFSSIZE=5242880
export ATH_CAL_NAND_FLASH=1
export ATH_CAL_NAND_PARTITION="caldata"
else #}{
export TARGETFSSIZE=2818048
endif #}
endif #}

export CONFIG_MIPS_74K_KERNEL_OPTIMIZATION=1
#export CONFIG_EMULATION=1

ifeq ($(BUILD_CONFIG),_mi124)
export COMPRESSED_UBOOT=1
export FLASH_SIZE=4
export TARGETFSSIZE=3080192
endif

ifeq ($(BUILD_CONFIG),_ap123)
export COMPRESSED_UBOOT=1
export FLASH_SIZE=4
export TARGETFSSIZE=3080192
export BUILD_OPTIMIZED=y
endif

ifeq ($(BUILD_CONFIG),_ap123_hwaccel)
export COMPRESSED_UBOOT=1
export FLASH_SIZE=4
export TARGETFSSIZE=3080192
export BUILD_OPTIMIZED=y
endif

ifeq ($(BUILD_CONFIG),_powercloud)
export TARGETFSSIZE=3014656
endif

ifeq ($(BUILD_CONFIG),_cus227)
export FLASH_SIZE=16
endif

export BUSYBOX=busybox-1.01
export WIRELESSTOOLS=wireless_tools.29
export WIRELESSTOOLSLIB=libiw.so.29

export BUILD_WPA2=y

ifeq ($(USE_GCC_4_5_1), y)
export TOOLCHAIN=gcc-4.5.1
export ENABLE_DSP_ASE=y
endif

ifeq ($(BUILD_WLAN_PBO_DATA),y)
export GCOV_KERNEL_ENABLE=y
endif

#DEFINE AH_CAL_IN_FLASH_PCI to indicate CALDATA is read from flash thr' PCI bus.
#DEFINE AH_CAL_IN_FLASH_AHB to indicate CALDATA is read from flash thr' AHB bus
#DO NOT DEFINE AH_CAL_IN_FLASH if bus type is dual.

ifeq ($(BUILD_CONFIG),_ap123)
export BUS=AHB
export AH_CAL_IN_FLASH=1
export AH_CAL_LOCATIONS=0xbfff0000
export AH_CAL_RADIOS=1
export AP_TYPE=single
export JUMPSTART_GPIO=21
export ATH_SUPPORT_DFS=0
export AP_USB_LED_GPIO=11
export AH_SUPPORT_KITE_ANY=0
export AH_SUPPORT_KITE_10=0
export AH_SUPPORT_KITE_12=0
export AH_SUPPORT_KIWI_10=0
export AH_SUPPORT_KIWI_ANY=0
export AH_SUPPORT_KIWI_11=0
export ATH_NO_5G_SUPPORT=1
export ATH_SUPPORT_DFS=0
export ATH_GMAC_TXQUEUELEN=700
else
export AH_SUPPORT_KITE_ANY=0
export AH_SUPPORT_KITE_10=0
export AH_SUPPORT_KITE_12=0
export AH_SUPPORT_KIWI_10=0
export AH_SUPPORT_KIWI_ANY=0
export AH_SUPPORT_KIWI_11=0
export ATH_SUPPORT_DFS=1
#export BUS=dual
export BUS=AHB
#export AP_TYPE=dual
export AP_TYPE=single
#export AH_CAL_IN_FLASH_PCI=1
#export AH_CAL_RADIOS_PCI=1

ifeq ($(BOOT_FROM_NAND),1) #{
export AH_CAL_LOCATIONS_PCI=0x4000
else #}{
export AH_CAL_LOCATIONS_PCI=0xbfff4000
endif
export AH_CAL_IN_FLASH_AHB=1
export AH_CAL_RADIOS_AHB=1
ifeq ($(BOOT_FROM_NAND),1) #{
export AH_CAL_LOCATIONS_AHB=0x0
else #}{
export AH_CAL_LOCATIONS_AHB=0xbfff0000
endif
export ATH_SUPPORT_DFS=1
#export AP_USB_LED_GPIO=11
endif
export MADWIFITARGET=mipsisa32-be-elf
export FUSIONTARGET=mipsisa32-be-elf
export TARGETARCH=mipsisa32-be-elf

ifeq ($(CONFIG_I2S),1)
export ATH_WASP_I2S=1
export ATH_SUPPORT_LED=0
else
export ATH_SUPPORT_LED=0
# To differentiate Customer specific GPIO mappings.
# lmac/ath_dev/ath_led.h
export ATH_LED_CUSTOMER=CUSTOMER_ATHEROS_WASP
export WPS_LED_GPIO_PIN=15
endif

export AP_READY_LED_GPIO=14
export GPIO_PIN_FUNC_0=0
export GPIO_PIN_FUNC_1=0
export GPIO_PIN_FUNC_2=0


export BUILD_UMAC=1

# Set Phy Err Diagnostics (Radar detection) to be enabled for AP builds
export ATH_CAP_PHYERR_DIAG=1

export AR5416_G_MODE=1
export AR9100=0
#export AR7240_EMU=1
export AH_DEBUG=0

export AH_SUPPORT_AR5210=0
export AH_SUPPORT_AR5212=0
export AH_SUPPORT_5111=0
export AH_SUPPORT_5112=0
export AH_SUPPORT_2413=0
export AH_SUPPORT_5111=0
export AH_SUPPORT_5112=0
export AH_SUPPORT_2413=0
export AH_SUPPORT_5413=0
export AH_SUPPORT_2316=0
export AH_SUPPORT_2317=0
export AH_SUPPORT_2425=0
export AH_SUPPORT_SOWL=0
export AH_SUPPORT_AR5416=0
export AH_SUPPORT_AR9300=1
#export AR9300_EMULATION=1
#export AR9300_EMULATION_BB=1
export AH_SUPPORT_EEPROM_AR9287=0
export AH_SUPPORT_EEPROM_AR9330=0
export AH_SUPPORT_MERLIN_10=0
export AH_SUPPORT_MERLIN_20=0
export AH_SUPPORT_K2=0
export AH_SUPPORT_OSPREY=0
export AH_SUPPORT_HORNET=0
export AH_SUPPORT_WASP=1
export AH_SUPPORT_POSEIDON=0
export AH_SUPPORT_SCORPION=0
export ATH_SUPPORT_VLAN=1

export ATH_CHAINMASK_SELECT=0
ifeq ($(BUILD_CONFIG),_ap123)
export ATH_RXBUF=128
export ATH_TXBUF=256
else
export ATH_RXBUF=512
export ATH_TXBUF=4096
endif
export ATH_CAP_AMSDU=0
export IEEE80211_MCAST_ENHANCEMENT=1
export ATH_RB=0
export AR5416_G_MODE=1
export AH_SUPPORT_HOWL=0
export AH_SUPPORT_OWL=1
export AR5416_INT_MITIGATION=1
export ATH_SUPPORT_IQUE=1
export ATH_SUPPORT_GREEN_AP=1
export ATH_SUPPORT_DYN_TX_CHAINMASK=1
export AH_DESC_NOPACK=1
export ATH_SUPPORT_PAPRD=0
export ATH_TRAFFIC_FAST_RECOVER=1

ifeq ($(BUILD_CONFIG),_ap123)
export ATH_GPIOPIN_ANTCHAIN0=0
export ATH_GPIOPIN_ANTCHAIN1=1
export ATH_GPIOPIN_ANTCHAIN2=0

export ATH_GPIOFUNC_ANTCHAIN0=0x4b
export ATH_GPIOFUNC_ANTCHAIN1=0x4c
export ATH_GPIOFUNC_ANTCHAIN2=0
export UMAC_SUPPORT_SMARTANTENNA=1
export ATH_SMARTANTENNA_DISABLE_JTAG=1
export SA_DEFAULT_ANTENNA=1
endif

ifeq ($(BUILD_WPA2),y)
export ATH_WPS_IE=1
else
export ATH_WPS_IE=0
endif

ifeq ($(BUILD_SAMBA),y)

export SAMBA_MIPS_74K_CFLAGS=-funit-at-a-time -Os -pipe -march=74kc -mtune=74kc

#Populate the utilities to be removed

sbin_list1=sbin/802* sbin/apst* sbin/ath* sbin/ifr* sbin/iwe*
sbin_list2=sbin/iwsp* sbin/iwli* sbin/radar* sbin/iwge* sbin/pktl*
samba_list=usr/local/bin/* usr/local/sbin/nmb* usr/local/sbin/smb*nt

export INSTALL_BLACKLIST="usr/bin/gdb* $(sbin_list1) $(sbin_list2) $(samba_list)"

endif


#export ATH_SST_FLASH=y
#export EXTRAVERSION=-9.2.0.39.3
#export ATH_SINGLE_CFG=1
export ATH_EXT_AP=1

export ATH_SUPPORT_QUICK_KICKOUT=1
export ATH_SUPPORT_TxBF=0

#export ATH_LOW_POWER_ENABLE=1

#export CONFIG_I2S=1
export KBUILD_MODPOST_WARN=y

#Remove the example files in apps/wpa2 directory
export BUILD_WPA2_NO_EXAMPLES=y

export JUMPSTART_GPIO=16
export ATH_SUPPORT_DESC_CACHABLE=1
export ATH_TXQ_BH_LOCK=1
#turn on ap-only code
export UMAC_SUPPORT_APONLY=0

#WifiPositoning support
export ATH_SUPPORT_WIFIPOS=0
export ATH_VAP_PAUSE_SUPPORT=0
export UMAC_SUPPORT_WIFIPOS_LEANCC=1
export UMAC_SUPPORT_VAP_PAUSE=0 
export UMAC_SUPPORT_STA_MODE=0

#Disable increment of some node level stats in the Tx data path
#to gain a (small) improvement in CPU utilization.
export UMAC_SUPPORT_TXDATAPATH_NODESTATS=0
# For Smart Antenna enabled platforms enable debug prints
ifeq ($(BUILD_CONFIG),_ap123)
export ATH_DEBUG=1
else

export ATH_DEBUG=0
endif
export UMAC_SUPPORT_TX_FRAG=1
export ATH_TX_COMPACT=1
export ATH_INT_TX_MITIGATION=0

export UMAC_SUPPORT_ACFG=0

# Build combined wlan driver
export ATH_WLAN_COMBINE=0

# Added for separate NVRAM partition
export ATH_CONFIG_NVRAM=1

# added for hostapd size optimiziation
export CONFIG_NO_STDOUT_DEBUG=y

# Enable spectral module
export ATH_SUPPORT_SPECTRAL=1

# added for unwanted files removal
export INSTALL_BLACKLIST="etc/ath/apcfg etc/ath/apup etc/ath/apdown etc/ath/makeVAP etc/ath/activateVAP etc/ath/killVAP sbin/wpa_supplicant usr/bin/gdbserver sbin/apstart lib/libiw* lib/libthread_* sbin/athst*"

# Set for including debug tools, e.g dumpregs
export DEBUG_TOOLS=1

# export xtal clock
#export CONFIG_HORNET_XTAL=25

# export hornet 1.1 war
#export CONFIG_HORNET_1_1_WAR=1

#export antenna diversity
export ATH_SUPPORT_ANT_DIV_COMB=0

# Enable updated ddr tap calibration algorithm
#export NEW_DDR_TAP_CAL=1

# export disable configuration for watchdog reset
export AP_WATCHDOG_RESET_DISABLE=0

# TP-LINK tdma feature
# disable PAPRD and WIFIPOS because TDMA will their txqueue.
export ATH_SUPPORT_TDMA=1
export ATH_SUPPORT_PAPRD=0
export ATH_SUPPORT_WIFIPOS=0

#install stdlibc++ lib for iperf 2.5
export NEED_LIBCPP=1

If GPL code is available then it should be a matter of time that the device will be supported. If device has at least 8/64 configuration it can be supported. Some devs just need to look at the GPL code. @tmomas can you please provide some info on the next steps?

Edit: @dhmyess You should probably look at https://openwrt.org/docs/guide-developer/adding_new_device for more info. Any developer would need the above mentioned info for this router.

Thanks for your direction i will try to learn step by step

1 Like

Hi, i've success compiling and testing snapshot version of openwrt using config from aredn that i've share before, but when i try tu upgrade from factory to sysupgrade it show error The uploaded image file does not contain a supported format. i don't know why it can't be upgraded

Do you mean you tested a successful flash and successfully booted the device with OpenWrt?

Are there two firmware files for the flashing process? Factory and Sysupgrade? Are you able to flash factory version of OpenWrt successfully? Or does it not flash anyone?

Yes, i've successfully test and its booted and running

I believe this image is available also from OpenWrt downloads. So I guess the support has been added.

Potentially as far back as 2014

https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg27641.html

target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c: * TP-LINK CPE210/210 v2/220/510/520 board support

Unknown if this relates to the proper image for a CPE220 v3

I don't immediately see an ath79 port.

I believe this image is available also from OpenWrt downloads. So I guess the support has been added.

I looked for it, but could not find it ... Do you know where I have to look for it?

@dhmyess Thank you! FW worked perfectly fine on my CPE220v3. Do you plan to integrate it in one of the next OpenWRT releases?

No, I've success try the snapshot version but when i try to compile again to version 18.06.2 it fail to boot