First try to support CPE210 v2 - will not boot

@robimarko haven't looked into your branch, but the tplink detection is working in my branch. The 9531 has dedicated pins for external lna if you look into the datasheet. e.g. https://github.com/Deoptim/atheros/blob/master/QCA9531_V2.0_nowatermark.pdf

Its stuff previously made that wasn't working due to clocks so I included your patches for pharos board detect and clocks.
Board detect is also working in mine branch.
Thanks for your patches.

Since LNA pins are dedicated I think that driver should take care of driving LNA-s.

So, i got this device again.
Boot from initramfs works fine!

Again i have a stupid question about flash sysupgrade to 'firmware' partition: how it does work? SPI Flash programmer still one working path? TFTP-way available?

If its need to update u-boot, how can I do this?

You can flash using web UI in stock firmware or use TFTP and flash factory image that way.
No changing bootloaders are needed.
You can find working images in my previous replies.

web UI says:

The hardware version is not supported.

It's factory image from your share.

I flashed the factory image some days ago and it worked out of the Box. By the Way, AP mode seems to be stable too.

Hm,it looks like then you have a version of CPE210 that has version string which I did not found out.
Can you connect to the serial port and then try over web ui.
You will be able to see which version string you use in error message that it has not been found.
So I can add it and after rebuilding images it will work

Ok, i booted from initramfs image and attempt to flash sysupgrade from sysupgrade util:

root@LEDE:/# ls -la /tmp/lede-ar71xx-generic-cpe210v2-squashfs-*
-rw-r--r-- 1 root root 3360719 Oct 15 15:30 /tmp/lede-ar71xx-generic-cpe210v2-squashfs-factory.bin
-rw-r--r-- 1 root root 3604484 Oct 15 15:30 /tmp/lede-ar71xx-generic-cpe210v2-squashfs-sysupgrade.bin
root@LEDE:/# md5sum /tmp/lede-ar71xx-generic-cpe210v2-squashfs-*
9bc0813caf86af68501a4c9d155dca63 /tmp/lede-ar71xx-generic-cpe210v2-squashfs-factory.bin
04cf2dc0a7bf4a3812122af23c83d0ec /tmp/lede-ar71xx-generic-cpe210v2-squashfs-sysupgrade.bin
root@LEDE:/# sysupgrade -v -n /tmp/lede-ar71xx-generic-cpe210v2-squashfs-sysupgr
ade.bin
Image metadata not found
Unsupported image (model not in support-list)
Image check 'platform_check_image' failed.
root@LEDE:/#
root@LEDE:/#
root@LEDE:/# sysupgrade -v -n /tmp/lede-ar71xx-generic-cpe210v2-squashfs-factory
.bin
Image metadata not found
Invalid image magic '003347cf'. Expected '01000000'.
Image check 'platform_check_image' failed.

Well you cant do that.

If you want to flash over TFTP then just simply hold reset button while booting and let it pull factory image.
That will flash

I hold reset while booting and see to the boot log:

Setting 0x181162c0 to 0x4081a100
is button pressed? 1
eth1 link down
enet0 port4 up
dup 1 speed 100
Using eth0 device
TFTP from server 192.168.0.100; our IP address is 192.168.0.254
Filename 'recovery.bin'.
Load address: 0x80060000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#######
done
Bytes transferred = 3360719 (3347cf hex)
Firmware recovery: FLASH_SIZE = 8 filesize = 0x3347cf.
Reading Partition Table from NVRAM ... OK
Parsing Partition Table ... OK
File Length:3360719
fw type name : .
Firmware process common.
Image verify OK!
Firmware file Verify ok!
[Error]sysmgr_cfg_checkSupportList(): 1063 @ productInfo CPE210(TP-LINK|EU|N300-2|00000000):2.0 NOT Match.
[Error]sysmgr_cfg_checkSupportList(): 1063 @ productInfo CPE210(TP-LINK|EU|N300-2|45550000):2.0 NOT Match.
[Error]sysmgr_cfg_checkSupportList(): 1063 @ productInfo CPE210(TP-LINK|EU|N300-2|55530000):2.0 NOT Match.
[Error]sysmgr_cfg_checkSupportList(): 1063 @ productInfo CPE210(TP-LINK|UN|N300-2):2.0 NOT Match.
[Error]sysmgr_cfg_checkSupportList(): 1063 @ productInfo CPE210(TP-LINK|EU|N300-2):2.0 NOT Match.
[Error]sysmgr_cfg_checkSupportList(): 1063 @ productInfo CPE210(TP-LINK|US|N300-2):2.0 NOT Match.
[Error]sysmgr_cfg_checkSupportList(): 868 @ should be 2 args (1).
Firmwave not supports, check failed.
NM_Error 01155: the firmware is not for this model
NM_Error 01255: checkUpdateContent failed.

Firmware Invalid!

recovery.bin is renamed squashfs factory image.

Like I thought you version is not on support list because I did not knwo it existed.
Can you install stock firmware and then try flashing over web ui and send me you string so I can add it to supported

I hope you talk about firmware version: 2.0.0 Build 20170718 Rel. 40903

No,
you have to have serial connection and then you try to flash factory image over web ui.
In your case you should see in serial terminal your string along with errors that multiple strings do not match yours.
Example of string is:CPE210(TP-LINK|EU|N300-2|00000000):2.0

Wow

Firmwave not supports CPE210(TP-LINK|UN|N300-2|00000000):2.0, check failed..
NM_Error 00804: hardware version not support
NM_Error 00908: checkUpdateContent failed.

Added,will rebuild.
I have to warn you now,I reworked part of mach file since last images I published and havent had time to test them,so if it does not work just PM me or reply here and I will revert those changes.

Just report

I use branch CPE210-v2-new from your repo, build and flash to device.
STA/AP mode works fine.

Troubles begin when I setting wlan0 interface as MESH POINT (802.11s), dmesg show me debug info:

[   60.162361] ------------[ cut here ]------------
[   60.167272] WARNING: CPU: 0 PID: 1130 at backports-2017-10-06/net/mac80211/rx.c:629 ieee80211_rx_napi+0x234/0x93c [mac80211]()
[   60.179055] Modules linked in: ath9k ath9k_common pppoe ppp_async ath9k_hw ath pppox ppp_generic nf_conntrack_ipv6 mac80211 iptable_nat ipt_REJECT ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG slhc nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_rtcache nf_conntrack iptable_mangle iptable_filter ip_tables crc_ccitt compat ledtrig_usbport ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables ip6_tunnel tunnel6 tun ohci_platform ohci_hcd ehci_platform ehci_hcd gpio_button_hotplug usbcore nls_base usb_common
[   60.248366] CPU: 0 PID: 1130 Comm: iw Tainted: G        W       4.4.93 #0
[   60.255380] Stack : 803cb724 00000000 00000001 80420000 82e5878c 80412d43 803acb08 0000046a
[   60.255380] 	  8048378c 00000000 00000004 82cfd858 00000000 800a77f8 803b242c 80410000
[   60.255380] 	  00000003 00000000 803b0830 82e5d704 00000000 800a5774 00000000 00000000
[   60.255380] 	  80411e70 801f8900 00000000 00000000 00000000 00000000 00000000 00000000
[   60.255380] 	  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   60.255380] 	  ...
[   60.292404] Call Trace:
[   60.294942] [<80071e98>] show_stack+0x54/0x88
[   60.299451] [<80081c98>] warn_slowpath_common+0xa0/0xd0
[   60.304862] [<80081d50>] warn_slowpath_null+0x18/0x24
[   60.310184] [<83225b00>] ieee80211_rx_napi+0x234/0x93c [mac80211]
[   60.316578] [<832e7874>] ath_rx_tasklet+0xdd8/0xe3c [ath9k]
[   60.322365] [<832e7950>] ath_stoprecv+0x78/0xfec [ath9k]
[   60.327868] [<832e3398>] ath9k_deinit_device+0x6ac/0x948 [ath9k]
[   60.334103] [<832e521c>] ath9k_calculate_summary_state+0x510/0x610 [ath9k]
[   60.341238] 
[   60.342779] ---[ end trace f91402ea9e3da92a ]---

interface is die after rx packet

That looks related to driver.
I cant help you with that.

I will test with kernel 4.9 on mine and see if I can reproduce the error.

I am trying to figure out a way to bypass reference clock detection for CPE210 v2 only in a way that would enable getting CPE210 v2 support in LEDE.
Current patch just forces 25MHz as reference clock for all devices which is not acceptable.

TP-Link just commented 40MHz out and forced 25MHz as ref clock
//if ((ath_reg_rd(ATH_BOOTSTRAP_REG) & ATH_REF_CLK_40)) {
// ref = (40 * 1000000);
//} else {
ref = (25 * 1000000);
//}

Hello friends, I just got this router myself, well this CPE I mean.

Where can I get the image you're working on and how can I help in making it fully functional, I have two devices.

And managed to make a patch that checks for CPE210v2 and returns reference clock of 25 MHz
This way CPE210 v2 can be officially supported and other devices are not affected by this patch.
Source:
https://github.com/robimarko/source/tree/CPE210-v2-clock

Bootlog: