Porting guide ar71xx to ath79?

A selfbuilt version r7713-a2a225517d from master (no extra PR's merged) for 1043v1 works only with pre-enabled wifi for me.

That has been fixed (merged to master) yesterday, just confirmed it on a TL-WR1043ND v1.4.

1 Like

It is too old. You need to build after this:

I built from commit 03e5dcbf10:

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   package/kernel/mac80211/files/lib/wifi/mac80211.sh

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        config.seed.mifi
        glinet-300m-nand.diff.config
        package/snapos

no changes added to commit (use "git add" and/or "git commit -a")
$ git branch -v
* master 03e5dcbf10 firewall: bump to git HEAD
$ git pull
Already up-to-date.
$ grep -Hn 'pll-reg = <0x4 0x14 20>;' target/linux/ath79/dts/ar9132.dtsi
target/linux/ath79/dts/ar9132.dtsi:192: pll-reg = <0x4 0x14 20>;

What am I and my build tree missing?

Re-building:

Summary
WARNING: Makefile 'package/feeds/packages/libsoup/Makefile' has a dependency on 'libpsl', which does not exist
WARNING: Makefile 'package/feeds/packages/nfs-kernel-server/Makefile' has a dependency on 'rpcbind', which does not exist
make[2]: Entering directory '/tmp/openwrt/scripts/config'
make[2]: Leaving directory '/tmp/openwrt/scripts/config'
 make[1] world
 make[2] target/compile
 make[2] package/cleanup
 make[3] -C target/linux compile
 make[2] diffconfig
 make[2] package/compile
 make[3] -C package/libs/libjson-c host-compile
 make[3] -C package/libs/toolchain compile
 make[3] -C package/libs/ncurses host-compile
 make[3] -C package/system/fwtool host-compile
 make[3] -C package/system/usign host-compile
 make[3] -C package/system/openwrt-keyring compile
 make[3] -C feeds/luci/modules/luci-base host-compile
 make[3] -C package/utils/lua host-compile
 make[3] -C package/libs/mbedtls compile
 make[3] -C feeds/packages/libs/jansson compile
 make[3] -C package/firmware/wireless-regdb compile
 make[3] -C package/kernel/gpio-button-hotplug compile
 make[3] -C package/firmware/b43legacy-firmware compile
 make[3] -C package/libs/openssl compile
 make[3] -C package/libs/gettext compile
 make[3] -C package/libs/libiconv compile
 make[3] -C package/libs/libtool compile
 make[3] -C package/libs/libmnl compile
 make[3] -C package/network/services/dropbear compile
 make[3] -C package/libs/libpcap compile
 make[3] -C package/network/utils/linux-atm compile
 make[3] -C package/network/utils/resolveip compile
 make[3] -C package/utils/busybox compile
 make[3] -C package/libs/libubox host-compile
 make[3] -C package/libs/libnl-tiny compile
 make[3] -C package/libs/libjson-c compile
 make[3] -C package/utils/lua compile
 make[3] -C package/firmware/linux-firmware compile
 make[3] -C package/firmware/prism54-firmware compile
 make[3] -C package/libs/zlib compile
 make[3] -C package/system/fwtool compile
 make[3] -C feeds/luci/libs/luci-lib-ip compile
 make[3] -C feeds/luci/libs/luci-lib-jsonc compile
 make[3] -C feeds/luci/libs/luci-lib-nixio compile
 make[3] -C feeds/luci/contrib/package/lucihttp compile
 make[3] -C feeds/luci/protocols/luci-proto-ppp compile
 make[3] -C feeds/luci/themes/luci-theme-bootstrap compile
 make[3] -C feeds/luci/protocols/luci-proto-ipv6 compile
 make[3] -C package/libs/wolfssl compile
 make[3] -C package/network/utils/iw compile
 make[3] -C package/libs/libnftnl compile
 make[3] -C package/system/opkg host-compile
 make[3] -C package/libs/libubox compile
 make[3] -C package/libs/ncurses compile
 make[3] -C package/system/ucert host-compile
 make[3] -C package/utils/util-linux compile
 make[3] -C package/utils/jsonfilter compile
 make[3] -C package/system/ubus compile
 make[3] -C package/system/uci compile
 make[3] -C package/system/usign compile
 make[3] -C package/libs/ustream-ssl compile
 make[3] -C package/network/config/swconfig compile
 make[3] -C package/network/ipv6/odhcp6c compile
 make[3] -C package/network/services/dnsmasq compile
 make[3] -C package/network/services/odhcpd compile
 make[3] -C package/system/mtd compile
 make[3] -C package/system/ucert compile
 make[3] -C package/network/config/netifd compile
 make[3] -C package/system/ubox compile
 make[3] -C package/network/utils/iwinfo compile
 make[3] -C package/network/services/uhttpd compile
 make[3] -C package/network/services/hostapd compile
 make[3] -C package/libs/uclient compile
 make[3] -C package/kernel/linux compile
 make[3] -C package/system/procd compile
 make[3] -C package/system/rpcd compile
 make[3] -C package/system/opkg compile
 make[3] -C feeds/luci/libs/rpcd-mod-rrdns compile
 make[3] -C feeds/luci/modules/luci-base compile
 make[3] -C package/system/fstools compile
 make[3] -C package/network/utils/iptables compile
 make[3] -C package/kernel/mac80211 compile
 make[3] -C package/network/services/ppp compile
 make[3] -C package/network/utils/nftables compile
 make[3] -C package/base-files compile
 make[3] -C package/boot/uboot-envtools compile
 make[3] -C package/network/config/firewall compile
 make[3] -C feeds/luci/applications/luci-app-firewall compile
 make[3] -C feeds/luci/modules/luci-mod-admin-full compile
 make[3] -C feeds/luci/collections/luci compile
 make[2] package/install
 make[2] target/install
 make[3] -C target/linux install
 make[2] package/index
 make[2] checksum

This build should work. If it doesn't, drop your settings by 'firstboot'.

Actually there are two commits that fix 1043ndv1


firstboot didn't help.

Trying to clean my tree.

Do you have a factory u-boot? If not, you may need another patch.

Sure I have! :wink:

I have exactly same device and the same u-boot. It works for me.
There is a small chance that I had an additional patch there, I can't check it now.

Just in case, if a clean build still doesn't work, try to add

https://github.com/openwrt/openwrt/commit/7416bf615074c093a0aa7c7919cb49229ca45d4e.patch

But it should work without this.

This build has issue on my 3800: eth1 fails with errors. Tested twice and rollback to 20180811.
Here in dmesg:

[   52.112939] ------------[ cut here ]------------
[   52.117588] WARNING: CPU: 0 PID: 1609 at net/sched/sch_generic.c:320 dev_watchdog+0x164/0x274
[   52.126110] NETDEV WATCHDOG: eth1 (ag71xx): transmit queue 0 timed out
[   52.132614] Modules linked in: ath9k ath9k_common pppoe ppp_async ath9k_hw ath pptp pppox ppp_mppe ppp_generic mac80211 iptable_nat ipt_REJECT ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_tcpmss xt_statistic xt_state xt_recent xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_esp xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_HL xt_FLOWOFFLOAD xt_DSCP xt_CLASSIFY usbserial slhc owl_loader nf_reject_ipv4 nf_nat_rtsp nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv4 nf_conntrack_rtsp nf_conntrack_rtcache nf_conntrack_netlink iptable_mangle iptable_filter ipt_ah ipt_ECN ip_tables crc_ccitt compat sch_cake act_skbedit act_mirred em_u32 cls_u32
[   52.203299]  cls_tcindex cls_flow cls_route cls_fw sch_tbf sch_htb sch_hfsc sch_ingress ledtrig_usbport xt_set ip_set_list_set ip_set_hash_netiface ip_set_hash_netport ip_set_hash_netnet ip_set_hash_net ip_set_hash_netportnet ip_set_hash_mac ip_set_hash_ipportnet ip_set_hash_ipportip ip_set_hash_ipport ip_set_hash_ipmark ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip ip_set nfnetlink ip6t_NPT ip6t_MASQUERADE nf_nat_masquerade_ipv6 ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 nf_nat nf_conntrack ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables msdos ip_gre gre ifb sit tunnel4 ip_tunnel tun vfat fat ntfs hfsplus cifs nls_utf8 nls_iso8859_15 nls_iso8859_1 nls_cp850 nls_cp437 nls_cp1250 sha256_generic sha1_generic
[   52.274229]  md5 md4 hmac ecb des_generic usb_storage ohci_platform ohci_hcd ehci_platform sd_mod scsi_mod ehci_hcd gpio_button_hotplug ext4 jbd2 mbcache usbcore nls_base usb_common crc16 aead crypto_null cryptomgr crc32c_generic crypto_hash
[   52.295617] CPU: 0 PID: 1609 Comm: dropbearkey Not tainted 4.14.62 #0
[   52.302042] Stack : 00000000 00000000 80647522 00000039 87cf2954 804ed907 80497054 00000649
[   52.310396]         80643670 00000140 804f8d14 804f8cd4 804f8cc0 00000001 87c09db8 d1f57db5
[   52.318750]         00000000 00000000 80640000 00004d80 00000000 00000000 00000007 00000000
[   52.327097]         000000f4 f0073e3a 000000f3 00000000 80000000 00000000 804be1a0 8030faac
[   52.335444]         00000009 00000140 804f8d14 804f8cd4 00000000 8025ebc4 00000000 80640000
[   52.343790]         ...
[   52.346227] Call Trace:
[   52.348680] [<8006a90c>] show_stack+0x58/0x100
[   52.353141] [<80080900>] __warn+0xe4/0x118
[   52.357231] [<80080964>] warn_slowpath_fmt+0x30/0x3c
[   52.362187] [<8030faac>] dev_watchdog+0x164/0x274
[   52.366907] [<800b99e0>] call_timer_fn.isra.4+0x24/0x84
[   52.372124] [<800b9bb0>] run_timer_softirq+0x170/0x1e8
[   52.377259] [<804039c8>] __do_softirq+0xe8/0x2bc
[   52.381875] [<8020ed20>] plat_irq_dispatch+0xc0/0x120
[   52.386924] [<800658f8>] handle_int+0x138/0x144
[   52.391447] ---[ end trace 1b7ea71f49d352c4 ]---
[   52.396061] eth1: tx timeout

You need the above mentioned patches. Actually the only

to fix the crash on this device.

@981213 does awesome work nowadays! :+1:

OK!
make dirclean, make, and the new r7847-03e5dcbf10 image works fine! :+1:

Thanks @slh, @Pilot6!

Does this phandle warning mean something?

[    0.425399] rtl8366rb rtl8366rb: cannot find mdio node phandle

it's for additional options, if they are needed, so you can ignore it.
glad that in the end ath79 is taking a good shape

LAN Port 4 doesn't have link with ath79.

Interestingly ar71xx have link after reboot (e.g. ar71xx + k4.14).
Is this a hardware problem?

I think it will have if you wait a bit, is an ath79 problem

Did you check your switch config? I can't check on real hardware till Thursday night.
It could happen if port count is wrong.

What does
swconfig dev switch0 show
output?

Please note that I use the device as a dumb AP, and the WAN port is in untagged in VLAN1 like the other ports.

swconfig
root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
        enable_learning: 1
        enable_vlan: 1
        enable_vlan4k: 1
        blinkrate: 0
        enable_qos: 1
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        enable_monitor_isolation: 0
        enable_mirror_pause_frames: 0
        mirror_monitor_port: 0
        mirror_source_port: 0
Port 0:
        mib: Port 0 MIB counters
IfInOctets                          : 68429201
EtherStatsOctets                    : 68429201
EtherStatsUnderSizePkts             : 0
EtherFragments                      : 0
EtherStatsPkts64Octets              : 1385
EtherStatsPkts65to127Octets         : 15332
EtherStatsPkts128to255Octets        : 1069
EtherStatsPkts256to511Octets        : 252
EtherStatsPkts512to1023Octets       : 374
EtherStatsPkts1024to1518Octets      : 44172
EtherOversizeStats                  : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 61382
EtherStatsMulticastPkts             : 707
EtherStatsBroadcastPkts             : 495
EtherStatsDropEvents                : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
IfOutOctets                         : 39280303
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 870
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 18
IfOutUcastPkts                      : 53418
IfOutMulticastPkts                  : 2575
IfOutBroadcastPkts                  : 550

        led: 2
        disable: 0
        rate_in: 1048512
        rate_out: 1048512
        pvid: 1
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        mib: Port 1 MIB counters
IfInOctets                          : 435395
EtherStatsOctets                    : 435395
EtherStatsUnderSizePkts             : 0
EtherFragments                      : 0
EtherStatsPkts64Octets              : 473
EtherStatsPkts65to127Octets         : 993
EtherStatsPkts128to255Octets        : 581
EtherStatsPkts256to511Octets        : 78
EtherStatsPkts512to1023Octets       : 203
EtherStatsPkts1024to1518Octets      : 23
EtherOversizeStats                  : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 877
EtherStatsMulticastPkts             : 1189
EtherStatsBroadcastPkts             : 285
EtherStatsDropEvents                : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
IfOutOctets                         : 425139
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 3
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 15
IfOutUcastPkts                      : 841
IfOutMulticastPkts                  : 127
IfOutBroadcastPkts                  : 159

        led: 3
        disable: 0
        rate_in: 1048512
        rate_out: 1048512
        pvid: 1
        link: port:1 link:down
Port 2:
        mib: Port 2 MIB counters
IfInOctets                          : 1038258
EtherStatsOctets                    : 1038322
EtherStatsUnderSizePkts             : 0
EtherFragments                      : 0
EtherStatsPkts64Octets              : 788
EtherStatsPkts65to127Octets         : 2625
EtherStatsPkts128to255Octets        : 440
EtherStatsPkts256to511Octets        : 248
EtherStatsPkts512to1023Octets       : 136
EtherStatsPkts1024to1518Octets      : 348
EtherOversizeStats                  : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 3499
EtherStatsMulticastPkts             : 863
EtherStatsBroadcastPkts             : 223
EtherStatsDropEvents                : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
IfOutOctets                         : 986233
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 16
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 3096
IfOutMulticastPkts                  : 546
IfOutBroadcastPkts                  : 150

        led: 4
        disable: 0
        rate_in: 1048512
        rate_out: 1048512
        pvid: 1
        link: port:2 link:up speed:1000baseT full-duplex txflow rxflow
Port 3:
        mib: Port 3 MIB counters
IfInOctets                          : 250496
EtherStatsOctets                    : 250496
EtherStatsUnderSizePkts             : 0
EtherFragments                      : 0
EtherStatsPkts64Octets              : 685
EtherStatsPkts65to127Octets         : 783
EtherStatsPkts128to255Octets        : 187
EtherStatsPkts256to511Octets        : 45
EtherStatsPkts512to1023Octets       : 67
EtherStatsPkts1024to1518Octets      : 26
EtherOversizeStats                  : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 1290
EtherStatsMulticastPkts             : 398
EtherStatsBroadcastPkts             : 105
EtherStatsDropEvents                : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
IfOutOctets                         : 292098
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 1313
IfOutMulticastPkts                  : 94
IfOutBroadcastPkts                  : 153

        led: 0
        disable: 0
        rate_in: 1048512
        rate_out: 1048512
        pvid: 1
        link: port:3 link:down
Port 4:
        mib: Port 4 MIB counters
IfInOctets                          : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherFragments                      : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherOversizeStats                  : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
EtherStatsDropEvents                : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0

        led: ???
        disable: 0
        rate_in: 1048512
        rate_out: 1048512
        pvid: 1
        link: port:4 link:down
Port 5:
        mib: Port 5 MIB counters
IfInOctets                          : 38689877
EtherStatsOctets                    : 38689877
EtherStatsUnderSizePkts             : 0
EtherFragments                      : 0
EtherStatsPkts64Octets              : 374
EtherStatsPkts65to127Octets         : 26285
EtherStatsPkts128to255Octets        : 1039
EtherStatsPkts256to511Octets        : 1469
EtherStatsPkts512to1023Octets       : 85
EtherStatsPkts1024to1518Octets      : 23693
EtherOversizeStats                  : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 51637
EtherStatsMulticastPkts             : 307
EtherStatsBroadcastPkts             : 1001
EtherStatsDropEvents                : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
IfOutOctets                         : 68216635
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 1028
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 1012
IfOutUcastPkts                      : 59952
IfOutMulticastPkts                  : 3157
IfOutBroadcastPkts                  : 1108

        led: ???
        disable: 0
        rate_in: 1048512
        rate_out: 1048512
        pvid: 1
        link: port:5 link:up speed:1000baseT full-duplex txflow rxflow auto
VLAN 1:
        info: VLAN 1: Ports: '012345t', members=003f, untag=001f, fid=0
        fid: 0
        ports: 0 1 2 3 4 5t
VLAN 2:
        info: VLAN 2: Ports: '5t', members=0020, untag=0000, fid=0
        fid: 0
        ports: 5t

It is obviously a wrong config. Did you intentionally remove port 0 (4 on the case) from vlan2?
Wat is the switch config in /etc/config/network?