Porting guide ar71xx to ath79?

So, they worked for you and me on 1000 and didn't for me on 100.
Now they work for me on 100 and don't for you in 1000.
Can you test it on 100 and provide some reads by devmem?

And also devmem can write to registers. If it's related to mii speed, we can fix it right away.

What are the exact settings for devmem builds? a few items for kernel config but also something for busybox?

Two items in Openwrt .config:

CONFIG_KERNEL_DEVMEM=y
CONFIG_BUSYBOX_CONFIG_DEVMEM=y

1 Like

When you have the build, provide output of

devmem 0x18050014
devmem 0x18070004

with eth1 connected to 1000Mbit link.

This is posted by using my WNDR3800 :slight_smile:

The third patch fixed things for me, at least with 1000 Mbit/s wan.

I made a minimal build with devmem and the third patch.
ath79-kernel4.14-master-test-20180815
r7862-ae9c3105a3

the devmem output:

root@OpenWrt:~# devmem 0x18050014
0x11110000
root@OpenWrt:~# devmem 0x18070004
0x00000020
root@OpenWrt:~# cat /sys/class/net/eth1/speed
1000

EDIT:
just for reference, the third patch that fixed 1000Mbit connection for me is:
https://github.com/openwrt/openwrt/pull/1271/commits/7416bf615074c093a0aa7c7919cb49229ca45d4e

Now run
devmem 0x18070004 32 0x22
and check if eth1 works.

Don't do anything else. After the crash just run the command.

It won't work. 0x22 is invalid for the second gmac.

It's not invalid. It's mii speed. Just try it.
I did in on two devices now and it fixed right away.

1 Like

OK, I see now. 20 is correct.

@hnyman Can you test it with a 100Mbit link? You can connect it anywhere, just set there 100 by ethtool.

I didn't see this. Now it's clear what happens. But it's not so easy to solve in some good manner.

can you clarify that?

The 3rd patch does fix setting the IF, but it is a bit hacky. That was the reason that it wasn't merged.
So my first guess was correct. The problem was in your u-boot.

1 Like

If I look at the WNDR3700 implementation in ar71xx, the mach file explicitly sets RGMII mode for both eth0 and eth1, so I guess that it might be needed in ath79, too.
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/ar71xx/files/arch/mips/ath79/mach-wndr3700.c;hb=HEAD#l131

We do have it in ar7100.dtsi
But it doesn't work

The puzzle is why did it work before :slight_smile:

@981213 It may be not so bad really, if we replace ar7100-eth with ar7100-eth0 and ar7100-eth1 everywhere.
These are actually two different devices with different settings.

@Borromini
I am curious, as your own fresh build seemed to work a few hours ago.
is you wan link speed 100 Mbit or 1000 Mbit?

cat /sys/class/net/eth1/speed