Porting guide ar71xx to ath79?


#789

The second msg is OK. mdio is not used and it falls back to gpio lines.
The first one can be seen on all devices. I plan to find out why this happens. Resets seem to be OK.
Both are not critical and don't affect performance.


#790

For the WZR-HP-AGH300H, I can get the ethernet wan port up and running both by using either

&mdio0 {
	// ...
	phy0: ethernet-phy@0 {
		reg = <0>;
		phy-mode = "rgmii";
	};
};
&eth0 {
	// ...
	phy-handle: <&phy0>;
};

which results in

ar8316: Using port 4 as switch port
ag71xx 19000000.eth: connected to PHY at mdio-bus.0:00 [uid=004dd041, driver=Atheros AR8216/AR8236/AR8316]

or

&eth0 {
	// ...
	fixed-link {
		speed = <1000>;
		full-duplex;
	};
};

which results in

ag71xx 19000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]

The old ar71xx target produced the first output.

ar8316: Using port 4 as switch port
ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd041, driver=Atheros AR8216/AR8236/AR8316]

So which is "better"?


#791

If eth0 is really connected to switch, then fixed-link is better. We don't need phy in this case.


#792

Thanks!

I've created a pull request for the WZR-HP-AG300H: https://github.com/openwrt/openwrt/pull/1345

@drvlabo, @musashino, perhaps you want to confirm that everything works for you?

Thanks for all the input in this thread, this was a great help!


#793

Sorry for the noob question: why ath79 targets are not available in openwrt snapshot builds ?


#794

Because it is still highly experimental. Some devices work ok, others need modifications. It is not yet ready for general end-user usage.


#795

Hi, I fancy having a crack at porting ath79 for one of these:

https://openwrt.org/toh/mikrotik/rb493g

What's the latest advice for a starting point?


#796

Hi, I found that initramfs images for WNDR3800 stopped booting for some time.
I think it was introduced by commit b58df9919ef827e4d591e8b1990f0d306f7bdb5f.

I would like then to suggest the following patch. It fixed the issue for me.

diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index e968dcf..7b4f17f 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -235,6 +235,7 @@ TARGET_DEVICES += pcs_cr5000
 define Device/netgear_wndr3x00
   ATH_SOC := ar7161
   KERNEL := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma
   IMAGES := sysupgrade.bin factory.img
   IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
   IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)

#797

I removed that initramfs recipe, as @mkresin suggested that in https://github.com/openwrt/openwrt/pull/1270#issuecomment-412298618


#798

Hi @hnyman, I tested the same version (r8053-9926f7c) without the patch and it doesn't boot at all.

Boot not Ok

ar7100> bootm
## Booting image at 81000000 ...
Bad Magic Number
Trying eth0

Boot Ok

ar7100> bootm
## Booting image at 81000000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.68
   Created:      2018-09-10  15:50:40 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    3532473 Bytes =  3.4 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728

Starting kernel ...

#800

Hi.

Ath79 snapshot r8064, wifi not working with AG300H/600DHP. Anyone can confirm ?


#801

Didn't try r8064, but r8061 worked for me on the following device:


#802

You need clean config files and run wifi after first flash on ath79.


#803

Thank for the tips. On ar7xx build radio0 is 2.4ghz, radio1 is 5ghz. Ath79 build is reversed, that's why wifi not work.


#804

I flashed TP-Link TL-WR741ND v1. It is fine but network restart is not working and during upgrade the configuration was reset to default.


#805

Comment/observation, not a "bug report":

Archer C7 v2, USB connection of low-speed device (APC UPS):

The behavior with ath79 is the same as with ar71xx in that an intermediate hub is required to connect to the device.

An Anker USB 3.0, 4-port (unpowered) hub works.

In case anyone tries to search for it on the forums, here are typical log messages

2018 Sep 22 10:12:49 front info kernel: [   68.540370] usb 1-1: new low-speed USB device number 4 using ehci-platform
[...]
2018 Sep 22 10:12:59 front err kernel: [   79.074628] usb 1-1: device not accepting address 4, error -145
2018 Sep 22 10:12:59 front info kernel: [   79.234619] usb 1-1: new low-speed USB device number 5 using ehci-platform
2018 Sep 22 10:28:46 front err kernel: [   89.794601] usb 1-1: device not accepting address 5, error -145
2018 Sep 22 10:28:46 front err kernel: [   89.800699] usb usb1-port1: unable to enumerate USB device

and the usb-related packages

$ sudo opkg list | fgrep usb
kmod-phy-ath79-usb - 4.14.67-1
kmod-usb-core - 4.14.67-1
kmod-usb-ehci - 4.14.67-1
kmod-usb-hid - 4.14.67-1
kmod-usb-ledtrig-usbport - 4.14.67-1
kmod-usb2 - 4.14.67-1
libusb-1.0 - 1.0.22-1
libusb-compat - 0.1.5-1

Keywords: apcupsd APC UPS SmartUPS Smart-UPS SUA1500 XL750


#806

Currently, ath9k-leds seems to be broken in ath79.

WZR-HP-G450H has 3x ath9k-leds, but they have not appeared in /sys/class/leds/. And also, 7x ath9k-leds have not appearded in WZR-HP-AG300H. Of course, ath9k driver is installed.

/sys/kernel/debug/gpios (WZR-HP-AG300H):

# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/18040000.gpio, 18040000.gpio:
 gpio-1   (                    |buffalo:red:diag    ) out hi    
 gpio-2   (                    |buffalo:power:usb   ) out hi    
 gpio-3   (                    |gpio-keys           ) in  hi    
 gpio-5   (                    |gpio-keys           ) in  hi    
 gpio-6   (                    |gpio-keys           ) in  hi    
 gpio-7   (                    |gpio-keys           ) in  hi    
 gpio-8   (                    |gpio-keys           ) in  hi    
 gpio-11  (                    |gpio-keys           ) in  hi    

gpiochip2: GPIOs 492-501, ath9k-phy1:

gpiochip1: GPIOs 502-511, ath9k-phy0:

After reversing following commit, LEDs again appeared:


#807

Confirm this bug in my wndr3700v2 - no wifi leds:

cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/18040000.gpio, 18040000.gpio:
 gpio-0   (                    |netgear:orange:wps  ) out hi    
 gpio-1   (                    |netgear:orange:power) out hi    
 gpio-2   (                    |netgear:green:power ) out lo    
 gpio-3   (                    |wps                 ) in  hi    
 gpio-4   (                    |netgear:green:wps   ) out hi    
 gpio-5   (                    |rtl8366s            ) in  hi    
 gpio-6   (                    |netgear:green:wan   ) out hi    
 gpio-7   (                    |rtl8366s            ) in  hi    
 gpio-8   (                    |reset               ) in  hi    
 gpio-11  (                    |rfkill              ) in  hi    

gpiochip2: GPIOs 492-501, ath9k-phy1:

gpiochip1: GPIOs 502-511, ath9k-phy0:
root@OpenWrt:~#

My build: OpenWrt SNAPSHOT, r8170-d8274451cb

Under OpenWrt SNAPSHOT r8055-6e80dd58bb wifi leds working OK, so this is version kernel issue - in older wifi leds work, in newest not.


#808

Some crack that adds support for Mikrotik SXT Lite 5 AC (RBSXT5HacD2n)?


#809

Confirming the same observation with WNDR3800 on ath79 target.
ath9k wifi LEDs are dark.

Reverting the commit ccab68f2 from @nbd fixes ath9k wifi LEDs.
Apparently the ath9k LED functionality in ath79 requires the GPIO chip parent registration that got removed with ccab68f2

@nbd
Any ideas, what could be done in ath79 to return the ath9k LED functionality?