Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFT] ath79: add support for TP-Link TL-WA850RE v1 and TL-WA860RE v1 #2603

Closed
wants to merge 2 commits into from

Conversation

adschm
Copy link
Member

@adschm adschm commented Dec 9, 2019

This ports device support for the old v1 versions of TL-WA850RE and TL-WA860RE from ar71xx.

This is done based on code only, I do not own the devices. Please test, but be aware of the risks explained below.

Based on the reports by @Gingernut1978 and on the dmesg, it seems that eth0 is not coming up properly.

WA850RE has been merged, and network setup for WA860RE is the same. So, risk for bricking should be lower now.

Nevertheless, make sure you have WiFi enabled by default for testing, or you risk locking you out of the device. Any hints welcome on what's wrong with the network setup.

Current development state is available at: https://git.openwrt.org/?p=openwrt/staging/adrian.git;a=shortlog;h=refs/heads/rft-devices-ath79

Those devices are ugly for several reasons:

  • 4/32
  • integrated power supply
  • hard to open
  • no "easy" TFTP

So, bricking the device will cause more pain than usual on these devices.

I will keep this open for about a month in case someone is interested.

@adschm adschm added target/ath79 pull request/issue for ath79 target RFT pull request ready for testing labels Dec 9, 2019
@adschm adschm self-assigned this Dec 9, 2019
@Gingernut1978
Copy link
Contributor

I have a TL-WA850RE v1 and will be testing this asap, will comment the results.

@adschm
Copy link
Member Author

adschm commented Dec 10, 2019

@Gingernut1978 Thanks, but be aware that there is a chance that you will brick your device.
An easy precaution could be to enable WiFi by default for testing.

@Gingernut1978
Copy link
Contributor

Gingernut1978 commented Dec 10, 2019

@adrianschmutzler Just updated from ar71xx to ath79 after applying your PR and keeping current configuration. Seems to be working very nicely.

Thx

[ 0.000000] Linux version 4.19.88 (gingernut@gingernut-VirtualBox) (gcc version 8.3.0 (OpenWrt GCC 8.3.0 r11358-f526e85426)) #0 Tue Dec 10 11:17:24 2019
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[ 0.000000] MIPS: machine is TP-Link TL-WA850RE v1
[ 0.000000] SoC: Atheros AR9341 rev 3
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x0000000001ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000001ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff]
[ 0.000000] On node 0 totalpages: 8192
[ 0.000000] Normal zone: 64 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 8192 pages, LIFO batch:0
[ 0.000000] random: get_random_bytes called from 0x804716c4 with crng_init=0
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=132768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Writing ErrCtl register=00000000
[ 0.000000] Readback ErrCtl register=00000000
[ 0.000000] Memory: 26464K/32768K available (3551K kernel code, 137K rwdata, 468K rodata, 1212K init, 195K bss, 6304K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 51
[ 0.000000] CPU clock: 535.000 MHz
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7144898866 ns
[ 0.000011] sched_clock: 32 bits at 267MHz, resolution 3ns, wraps every 8027976190ns
[ 0.008259] Calibrating delay loop... 266.64 BogoMIPS (lpj=1333248)
[ 0.094823] pid_max: default: 32768 minimum: 301
[ 0.099955] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.106948] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.119473] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.129897] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.136439] pinctrl core: initialized pinctrl subsystem
[ 0.143178] NET: Registered protocol family 16
[ 0.175065] clocksource: Switched to clocksource MIPS
[ 0.181801] NET: Registered protocol family 2
[ 0.187440] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[ 0.195609] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.202967] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.209701] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.216581] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.222759] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.229781] NET: Registered protocol family 1
[ 0.234409] PCI: CLS 0 bytes, default 32
[ 0.241693] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[ 0.255427] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.261582] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.284667] io scheduler noop registered
[ 0.288873] io scheduler deadline registered (default)
[ 0.297091] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[ 0.304401] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 0.312122] console [ttyS0] disabled
[ 0.316002] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[ 0.325134] console [ttyS0] enabled
[ 0.332683] bootconsole [early0] disabled
[ 0.349565] m25p80 spi0.0: s25sl032p (4096 Kbytes)
[ 0.354572] 3 fixed-partitions partitions found on MTD device spi0.0
[ 0.361210] Creating 3 MTD partitions on "spi0.0":
[ 0.366193] 0x000000000000-0x000000020000 : "u-boot"
[ 0.372353] 0x000000020000-0x0000003f0000 : "firmware"
[ 0.381927] 2 tplink-fw partitions found on MTD device firmware
[ 0.388125] Creating 2 MTD partitions on "firmware":
[ 0.393269] 0x000000000000-0x000000158a34 : "kernel"
[ 0.399482] 0x000000158a34-0x0000003d0000 : "rootfs"
[ 0.405609] mtd: device 3 (rootfs) set to be root filesystem
[ 0.413291] 1 squashfs-split partitions found on MTD device rootfs
[ 0.419769] 0x000000380000-0x0000003d0000 : "rootfs_data"
[ 0.426408] 0x0000003f0000-0x000000400000 : "art"
[ 0.433099] libphy: Fixed MDIO Bus: probed
[ 0.775544] libphy: ag71xx_mdio: probed
[ 0.780778] libphy: ar8xxx-mdio: probed
[ 0.792008] switch0: Atheros AR8229 rev. 1 switch registered on mdio-bus.0
[ 1.177086] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:1f:00 [uid=004dd042, driver=Generic PHY]
[ 1.187793] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[ 1.197735] NET: Registered protocol family 10
[ 1.208777] Segment Routing with IPv6
[ 1.212723] NET: Registered protocol family 17
[ 1.217727] 8021q: 802.1Q VLAN Support v1.8
[ 1.235301] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[ 1.250370] Freeing unused kernel memory: 1212K
[ 1.255088] This architecture does not have kernel memory protection.
[ 1.261737] Run /sbin/init as init process
[ 2.545080] random: fast init done
[ 4.510060] init: Console is alive
[ 4.513892] init: - watchdog -
[ 5.367242] kmodloader: loading kernel modules from /etc/modules-boot.d/

[ 5.629710] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[ 5.647787] init: - preinit -
[ 8.096074] random: jshn: uninitialized urandom read (4 bytes read)
[ 8.180855] random: jshn: uninitialized urandom read (4 bytes read)
[ 8.317487] random: jshn: uninitialized urandom read (4 bytes read)
[ 8.635814] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 12.549186] jffs2_scan_eraseblock(): End of filesystem marker found at 0x10000
[ 12.556690] jffs2_build_filesystem(): unlocking the mtd device...
[ 12.556694] done.
[ 12.565068] jffs2_build_filesystem(): erasing all blocks after the end marker...
[ 13.745710] done.
[ 13.755486] jffs2: notice: (371) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[ 13.775721] mount_root: overlay filesystem has not been fully initialized yet
[ 13.796245] mount_root: switching to jffs2 overlay
[ 13.840866] overlayfs: upper fs does not support tmpfile.
[ 14.689681] urandom-seed: Seed file not found (/etc/urandom.seed)
[ 15.068815] procd: - early -
[ 15.071942] procd: - watchdog -
[ 15.889797] procd: - watchdog -
[ 15.893482] procd: - ubus -
[ 16.238741] urandom_read: 3 callbacks suppressed
[ 16.238751] random: ubusd: uninitialized urandom read (4 bytes read)
[ 16.251599] random: ubusd: uninitialized urandom read (4 bytes read)
[ 16.258849] random: ubusd: uninitialized urandom read (4 bytes read)
[ 16.266842] procd: - init -
[ 17.732866] kmodloader: loading kernel modules from /etc/modules.d/*
[ 17.766826] zram: Added device: zram0
[ 17.793854] Loading modules backported from Linux version v5.4-rc8-0-gaf42d3466bdc
[ 17.801759] Backport generated by backports.git v5.4-rc8-1-0-g368e8c51
[ 17.849901] xt_time: kernel timezone is -0000
[ 18.128503] PPP generic driver version 2.4.2
[ 18.146420] NET: Registered protocol family 24
[ 18.271931] ath: EEPROM regdomain: 0x0
[ 18.271942] ath: EEPROM indicates default country code should be used
[ 18.271947] ath: doing EEPROM country->regdmn map search
[ 18.271966] ath: country maps to regdmn code: 0x3a
[ 18.271972] ath: Country alpha2 being used: US
[ 18.271977] ath: Regpair used: 0x3a
[ 18.287884] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[ 18.289473] ieee80211 phy0: Atheros AR9340 Rev:3 mem=0xb8100000, irq=2
[ 18.665339] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 19.057281] urngd: v1.0.1 started.
[ 19.277056] random: crng init done
[ 19.280586] random: 1 urandom warning(s) missed due to ratelimiting
[ 27.642019] zram0: detected capacity change from 0 to 13631488
[ 44.075502] br-lan: port 1(eth0) entered blocking state
[ 44.080922] br-lan: port 1(eth0) entered disabled state
[ 44.086793] device eth0 entered promiscuous mode
[ 44.123887] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[ 47.158237] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 50.047733] wlan0: authenticate with b4:75:0e:30:b4:70
[ 50.070693] wlan0: send auth to b4:75:0e:30:b4:70 (try 1/3)
[ 50.079527] wlan0: authenticated
[ 50.085326] wlan0: associate with b4:75:0e:30:b4:70 (try 1/3)
[ 50.095386] wlan0: RX AssocResp from b4:75:0e:30:b4:70 (capab=0x431 status=0 aid=1)
[ 50.103756] wlan0: associated
[ 51.108769] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

@Gingernut1978
Copy link
Contributor

@adrianschmutzler If your insterested/willing to work on porting, I also have a Belkin AC1750DB ar71xx device I can test.

@adschm
Copy link
Member Author

adschm commented Dec 10, 2019

@Gingernut1978 Thanks.

  • LEDs working?
  • Can you connect to AP?
  • Traffic in both directions via WiFi and ethernet?
  • Correct MAC address for WiFi and eth0?

If your insterested/willing to work on porting, I also have a Belkin AC1750DB ar71xx device I can test.

I did the recent PRs because support for those devices were missing in our local Freifunk (downstream) project and they were relatively easy (and thus quick to do). My motivation to migrate further devices I do not own myself is limited. But with the big pile of migrated devices that can be used as blueprint it should be too hard for other developers to add PRs for further devices ;-)

@Gingernut1978
Copy link
Contributor

LEDs work
Can connect to AP
MAC address are same for WiFi and eth0 (same as printed label)
Detected but no traffic over ethernet, WiFi seems fine.

I'm an idiot and did a device reset, now I'm locked out. Will get back to you if I get it working again.

Thx

@adschm adschm added the RFC pull request ready for comments label Dec 12, 2019
@adschm
Copy link
Member Author

adschm commented Dec 12, 2019

Based on the reports by @Gingernut1978 and on the dmesg, it seems that eth0 is not coming up properly (but everything else is fine on the WA850RE). Make sure you have WiFi enabled by default for testing, or you risk locking you out of the device. Any hints welcome on what's wrong with the network setup...

This ports support for the TL-WA850RE v1 range extender from ar71xx
to ath79.

Specifications:
  Board: AP123 / AR9341 rev. 3
  Flash/RAM: 4/32 MiB
  CPU: 535 MHz
  WiFi: 2.4 GHz b/g/n
  Ethernet: 1 port (100M)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This ports support for the TL-WA860RE v1 range extender from ar71xx
to ath79.

Specifications:
  Board: AP123 / AR9341 rev. 3
  Flash/RAM: 4/32 MiB
  CPU: 535 MHz
  WiFi: 2.4 GHz b/g/n
  Ethernet: 1 port (100M)
  Two external antennas

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
@adschm
Copy link
Member Author

adschm commented Dec 28, 2019

@Gingernut1978 Any news? Otherwise I will close this again, as you've been the only responding.

@Gingernut1978
Copy link
Contributor

@adrianschmutzler No sorry, device still unusable for further testing.

@adschm
Copy link
Member Author

adschm commented Dec 28, 2019

@Gingernut1978 Okay, that's what I feared. Since I have not found any obvious mistake in my patch, I will close this and retire it here:
https://git.openwrt.org/?p=openwrt/staging/adrian.git;a=shortlog;h=refs/heads/rft-devices-ath79

Looks like I have to wait until someone finds my mistake ...

@adschm adschm closed this Dec 28, 2019
@adschm
Copy link
Member Author

adschm commented Jan 22, 2020

@Gingernut1978 I've now acquired a WA850RE v1 myself and fixed the image, just merged it to master. Thanks for your help on the way!

@adschm
Copy link
Member Author

adschm commented Jan 22, 2020

I'm still looking for testers for the WA860RE v1. Since this one is similar to the WA850RE, the chance for bricking should be much lower now ...
Current state will be found in my staging tree for RFT devices: https://git.openwrt.org/?p=openwrt/staging/adrian.git;a=shortlog;h=refs/heads/rft-devices-ath79

@adschm adschm deleted the ath79_wa branch January 25, 2020 19:21
@adschm adschm restored the ath79_wa branch January 29, 2020 19:50
@adschm adschm reopened this Jan 29, 2020
@adschm adschm closed this Jan 29, 2020
@adschm adschm deleted the ath79_wa branch January 29, 2020 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC pull request ready for comments RFT pull request ready for testing target/ath79 pull request/issue for ath79 target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants