Porting guide ar71xx to ath79?

I'm trying to port CF-E375AC from the ar71xx match files but I'm struggling with the switch device. The kernel acknowledge events such as cables being plug to interfaces but I couldn't make the connectivity for the ports works (ping 192.168.1.1 on lan port or get and dhcp at the wan port). If anyone has some suggestions I've setup an initial PR here

for me the bootlog seems fine from initram at least

   Image Name:   MIPS OpenWrt Linux-5.4.52
   Created:      2020-08-14  15:04:02 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4711555 Bytes =  4.5 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x81000040 ...OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728

Starting kernel ...

[    0.000000] Linux version 5.4.52 (joao@joao-Elcomasv-01) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r14176+1-bda1c12)) #0 Fri Aug 14 15:04:02 2020
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[    0.000000] MIPS: machine is COMFAST CF-E375AC
[    0.000000] SoC: Qualcomm Atheros QCA956X ver 1 rev 0
[    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-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 114708K/131072K available (4766K kernel code, 190K rwdata, 1108K rodata, 8776K init, 196K bss, 16364K 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] random: get_random_bytes called from start_kernel+0x32c/0x518 with crng_init=0
[    0.000000] CPU clock: 775.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4932285024 ns
[    0.000007] sched_clock: 32 bits at 387MHz, resolution 2ns, wraps every 5541893118ns
[    0.008215] Calibrating delay loop... 385.02 BogoMIPS (lpj=770048)
[    0.046714] pid_max: default: 32768 minimum: 301
[    0.051702] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.059419] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.071332] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.081642] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.088935] pinctrl core: initialized pinctrl subsystem
[    0.095354] NET: Registered protocol family 16
[    0.130459] clocksource: Switched to clocksource MIPS
[    0.136890] NET: Registered protocol family 2
[    0.142190] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.151067] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.159163] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.166608] TCP: Hash tables configured (established 1024 bind 1024)
[    0.173430] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.180370] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.188026] NET: Registered protocol family 1
[    0.192668] PCI: CLS 0 bytes, default 32
[    0.329420] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.342278] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.348464] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.373996] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[    0.381064] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.388428] printk: console [ttyS0] disabled
[    0.393015] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[    0.402117] printk: console [ttyS0] enabled
[    0.402117] printk: console [ttyS0] enabled
[    0.411176] printk: bootconsole [early0] disabled
[    0.411176] printk: bootconsole [early0] disabled
[    0.436821] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.441833] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.448407] Creating 4 MTD partitions on "spi0.0":
[    0.453370] 0x000000000000-0x000000040000 : "u-boot"
[    0.459381] 0x000000040000-0x000000050000 : "art"
[    0.465093] 0x000000050000-0x000000ff0000 : "firmware"
[    0.473781] 2 uimage-fw partitions found on MTD device firmware
[    0.479950] Creating 2 MTD partitions on "firmware":
[    0.485104] 0x000000000000-0x000000160000 : "kernel"
[    0.491061] 0x000000160000-0x000000fa0000 : "rootfs"
[    0.497018] mtd: device 4 (rootfs) set to be root filesystem
[    0.504614] 1 squashfs-split partitions found on MTD device rootfs
[    0.511062] 0x000000a30000-0x000000fa0000 : "rootfs_data"
[    0.517463] 0x000000ff0000-0x000001000000 : "art-backup"
[    0.525564] libphy: Fixed MDIO Bus: probed
[    1.138451] random: fast init done
[    1.178833] libphy: ag71xx_mdio: probed
[    1.204951] switch0: Atheros AR8337 rev. 2 switch registered on mdio.0
[    1.793944] ag71xx 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd036, driver=Atheros AR8216/AR8236/AR8316]
[    1.805222] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[    1.811670] i2c /dev entries driver
[    1.815479] ath79-wdt 18060008.wdt: unable to register misc device, err=-16
[    1.822727] ath79-wdt: probe of 18060008.wdt failed with error -16
[    1.830793] NET: Registered protocol family 10
[    1.839819] Segment Routing with IPv6
[    1.843754] NET: Registered protocol family 17
[    1.848425] 8021q: 802.1Q VLAN Support v1.8
[    1.853473] PCI host bridge /ahb/pcie-controller@18250000 ranges:
[    1.859839]  MEM 0x0000000012000000..0x0000000013ffffff
[    1.865245]   IO 0x0000000000000000..0x0000000000000000
[    1.870807] PCI host bridge to bus 0000:00
[    1.875076] pci_bus 0000:00: root bus resource [mem 0x12000000-0x13ffffff]
[    1.882186] pci_bus 0000:00: root bus resource [io  0x0000]
[    1.887948] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    1.894961] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    1.903177] pci 0000:00:00.0: [168c:0056] type 00 class 0x028000
[    1.909439] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x001fffff 64bit]
[    1.916581] pci 0000:00:00.0: PME# supported from D0 D3hot
[    1.923134] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[    1.929998] pci 0000:00:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
[    1.986861] Freeing unused kernel memory: 8776K
[    1.991572] This architecture does not have kernel memory protection.
[    1.998229] Run /init as init process
[    2.015076] init: Console is alive
[    2.018917] init: - watchdog -
[    2.041215] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.059999] usbcore: registered new interface driver usbfs
[    2.065785] usbcore: registered new interface driver hub
[    2.071382] usbcore: registered new device driver usb
[    2.082221] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.090531] ehci-fsl: Freescale EHCI Host controller driver
[    2.097796] ehci-platform: EHCI generic platform driver
[    2.105381] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    2.114141] init: - preinit -
[    2.366398] random: jshn: uninitialized urandom read (4 bytes read)
[    2.475600] random: jshn: uninitialized urandom read (4 bytes read)
[    2.609304] random: jshn: uninitialized urandom read (4 bytes read)
[    2.894292] eth0: link up (1000Mbps/Full duplex)
[    2.905192] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    3.906961] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 2 is up
[    7.038186] eth0: link down
[    7.051663] procd: - early -
[    7.054794] procd: - watchdog -
[    7.607192] procd: - watchdog -
[    7.610758] procd: - ubus -
[    7.620491] urandom_read: 5 callbacks suppressed
[    7.620498] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.664053] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.671961] procd: - init -
Please press Enter to activate this console.
[    8.136162] kmodloader: loading kernel modules from /etc/modules.d/*
[    8.169668] Loading modules backported from Linux version v5.8-0-gbcf876870b95
[    8.177183] Backport generated by backports.git v5.8-1-0-g79400d9e
[    8.237692] xt_time: kernel timezone is -0000
[    8.367381] PPP generic driver version 2.4.2
[    8.383295] NET: Registered protocol family 24
[    8.407579] urngd: v1.0.2 started.
[    8.457370] ath10k 5.4 driver, optimized for CT firmware, probing pci device: 0x56.
[    8.465432] ath10k_mac_create, priv_size: 804  hw: (ptrval)  hw->priv: (ptrval)
[    8.495126] ath10k_pci 0000:00:00.0: enabling device (0000 -> 0002)
[    8.501919] ath10k_pci 0000:00:00.0: pci irq legacy oper_irq_mode 1 irq_mode 0 reset_mode 0
[    8.590977] random: crng init done
[   10.569410] ath10k_pci 0000:00:00.0: qca9888 hw2.0 target 0x01000000 chip_id 0x00000000 sub 0000:0000
[   10.578993] ath10k_pci 0000:00:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   10.599004] ath10k_pci 0000:00:00.0: firmware ver 10.4b-ct-9888-fW-13-8c5b2baa2 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,3
[   11.029676] ath10k_pci 0000:00:00.0: board_file api 2 bmi_id 0:16 crc32 f228337a
[   13.066449] ath10k_pci 0000:00:00.0: unsupported HTC service id: 1536
[   13.076838] ath10k_pci 0000:00:00.0: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[   13.084611] ath10k_pci 0000:00:00.0: msdu-desc: 2500  skid: 32
[   13.135788] ath10k_pci 0000:00:00.0: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[   13.147096] ath10k_pci 0000:00:00.0: wmi print 'free: 114572 iram: 12804 sram: 29508'
[   13.415424] ath10k_pci 0000:00:00.0: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file max-sta 32 raw 0 hwcrypto 1
[   13.595130] ieee80211 phy1: Atheros AR9561 Rev:0 mem=0xb8100000, irq=2
[   13.630855] kmodloader: done loading kernel modules from /etc/modules.d/*
[   28.865761] eth0: link up (1000Mbps/Full duplex)
[   28.878770] br-lan: port 1(eth0.2) entered blocking state
[   28.884396] br-lan: port 1(eth0.2) entered disabled state
[   28.890284] device eth0.2 entered promiscuous mode
[   28.895289] device eth0 entered promiscuous mode
[   28.901217] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   28.927974] br-lan: port 1(eth0.2) entered blocking state
[   28.933597] br-lan: port 1(eth0.2) entered forwarding state
[   29.890552] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

In some cases I think the eth0 and eth1 got switched around. Be careful about how you're composing the DTS tree, at least with respect to the old ar71xx mach.

This happened with a lot of AR9331-based SoCs.

Thanks for the feedback.
When I move the ethernet cable between lan and wan port the kernel lists them correctly with link up/down messages.

I made some progress after opening the PR for the CF-E375AC. I'm still seeing these messages on my bootlog indicating that something is wrong with the watchdog timer. Could this be something wrong with my wdt node at DTS?

The first boot after flash also has these messages about the filesystem marker found at 0x0

[ 32.951236] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[ 32.972862] jffs2_build_filesystem(): unlocking the mtd device...

From what I could poke around all the partitions seem to be working fine. But I'm not sure I should see the of the fs at 0x0.

Any help with any of these two topics would be much appreciated.

ar71xx has now been removed from OpenWrt master.

Hi @joaohcca, did you ever manage to resolve this? I'm struggling with the same problem on RB2011. Switch is detected, swconfig and dmesg shows plug/unplug events, the device even builds the ARP table of the devices on the network, but I can't connect to anything (ping doesn't work).

1 Like

Hi @danijeltudek , I've managed to fix it by making some changes to my dts. I don't recall exactly what it was the issue, but most likely something was wrong in mdio or phy nodes.

1 Like

Hi there,

This has everything to do with the pll-data in the dts.

So based on http://en.techinfodepot.shoutwiki.com/wiki/COMFAST_CF-E375AC the SoC is a QCA9563.

You should look on the board to find if it uses external PHYs or if the switch does the PHY modulation on its own.

You should check the logs of other ath79-ported devices with the same SoC to see if they used any different .pll-data values.

When porting the Meraki MR12 to ath79 I also encountered issues -- as have other developers:

TL;DR it comes down to poking pll-data (and referring also to the pll-data values in the .dtsi that your board's dts includes) so that they're set just right for the PHY to be OK.

Finally, you could also try reading through the mach.*.c files for the board when it was on ar71xx. Some C code used to be used to set up the pll just right.

Don't forget to come into the IRC if you're having any issues -- if you're patient someone will take a look if you can post code to Github. #openwrt-devel on Freenode.

1 Like

pll values are correct, I took them from the mach file. However, re-reading this thread: Porting the MikroTik SXT Lite5 (SXT 5nD r2) from ar71xx to ath79 and looking at ar934x.dtsi, I noticed that I still didn't try with phy-swap, and that ath79 defines only one gmac? RB2011 in ar71xx uses both gmac0 and gmac1...

2 Likes

Thanks for the reply, I've managed to get my ethernet ports working after some try and error using other boards as reference. I'll double-check the values with the links you sent.

I think I still need to do some work on the watchdog chip to finish the port, according to the ar71xx files it has an external chip for it but I don't know how to set it up correctly on the dts.

Hey guys!

Trying my hand at porting the Netgear WNR2000 v1 from ar71xx to ath79. According to the wiki it has an AR8216 switch. The switch is at eth0 and the WAN is eth1 on ar71xx. eth0 is coming up on ath79 but eth1 doesn't.

ar71xx boot log is showing this:

[ 0.936016] libphy: Fixed MDIO Bus: probed
[ 0.962890] libphy: ag71xx_mdio: probed
[ 1.302310] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rmii
[ 1.641720] ag71xx ag71xx.1: connected to PHY at ag71xx-mdio.0:04 [uid=004dd042, driver=Generic PHY]
[ 1.651800] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: rmii

ath79 boot log:

[    0.883985] libphy: Fixed MDIO Bus: probed
[    1.231012] ag71xx 19000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    1.240952] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rmii

My DTS so far:

WNR2000 v1 DTS
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "ar9132.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/mtd/partitions/uimage.h>

/ {
	compatible = "netgear,wnr2000-v1", "qca,ar9132";
	model = "Netgear WNR2000 v1";

	chosen {
		bootargs = "console=ttyS0,115200n8";
	};

	aliases {
		led-boot = &led_power_amber;
		led-failsafe = &led_power_amber;
		led-running = &led_power_green;
		led-upgrade = &led_power_amber;
		label-mac-device = &eth0;
	};

	keys {
		compatible = "gpio-keys";
		poll-interval = <20>;

		reset {
			label = "reset";
			linux,code = <KEY_RESTART>;
			gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
			debounce-interval = <60>;
		};

		wps {
			label = "wps";
			linux,code = <KEY_WPS_BUTTON>;
			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
			debounce-interval = <60>;
		};
	};

	leds {
		compatible = "gpio-leds";

		// Onduidelijk of onderstaande code nodig is.
		// pinctrl-names = "default";
		// pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins &clks_disable_pins>;

		led_power_green: power_green {
			label = "green:power";
			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
		};

		led_power_amber: power_amber {
			label = "amber:power";
			gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
		};

		wlan {
			label = "blue:wlan";
			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy0tpt";
		};

		wps {
			label = "green:wps";
			gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
		};
	};
};

&spi {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <25000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x0 0x40000>;
				read-only;
			};

			partition@40000 {
				label = "u-boot-env";
				reg = <0x40000 0x10000>;
			};

			partition@50000 {
				label = "firmware";
				reg = <0x50000 0x3a0000>;
				compatible = "openwrt,uimage", "denx,uimage";
				openwrt,ih-magic = <0x32303031>;
				openwrt,ih-type = <IH_TYPE_FILESYSTEM>;
			};

			art: partition@3f0000 {
				label = "art";
				reg = <0x3f0000 0x10000>;
				read-only;
			};
		};
	};
};

&eth0 {
	status = "okay";

	phy-mode = "rmii";
	mtd-mac-address = <&art 0x1000>;

	fixed-link {
		speed = <100>;
		full-duplex;
	};
};

&eth1 {
	status = "okay";

	phy-mode = "rmii";
	mtd-mac-address = <&art 0x1006>;
};

&wmac {
       status = "okay";

       mtd-cal-data = <&art 0x1000>;
       mtd-mac-address = <&art 0x0>;
       //mtd-mac-address-increment = <1>;
};

&uart {
	status = "okay";
};

The ar71xx mach file looks straightforward enough but I'm not seeing it...

Thanks!

you may need to parse that dts include chain through ar9132.dtsi down to ath79.dtsi

ath79.dtsi defines both eth0 and eth1, but then ar9132.dtsi makes additional settings only to eth0.

Note that none of the other three ar9132 devices defines eth1 in their device .dts. They all only mention eth0. Any idea, why?

EDIT:
And if you look at the ar71xx network edeafults in 19.07, those devices only set eth0, I think:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/ar71xx/base-files/etc/board.d/02_network;h=44fce970c0fd8b4811242fac0b53764a09244a2f;hb=refs/heads/openwrt-19.07

I have a PR based on ar9132.dtsi pending and there the eth1 is set. Maybe it will give you some ideas. Never mind it being "disabled" as that file is a DTSI too and the DTS turns in "okay" later on.

I have no idea how those existing tp-link devices work. From what it looks like mdio0 and mdio1 nodes are left "disabled" too. Maybe they don't need managing. And compatible values for eth0 and eth1 seem to be different at the end of the day.

Thanks, that would be PR 3062 right?

I am going to test with this:

&eth1 {
	status = "okay";

	compatible = "qca,ar9130-eth", "syscon";
	reg = <0x1a000000 0x200
		0x18070004 0x4>;

	phy-mode = "rmii";
	reset-names = "mac";
	qca,mac-idx = <1>;
	mtd-mac-address-increment = <1>;
};

What line are you referring to? Since I'm seeing this as catch-all in ar71xx_setup_interfaces():

ucidef_set_interfaces_lan_wan "eth0" "eth1"

I have no idea why the few AR9132 devices present only set eth0. The TL-WA901ND is a single-port AP e.g., so that's easy.

Yes, let's race who gets their PR approved first. :slight_smile:

Haha I'm not that ambitious :wink: . Thanks for your help and good luck!

Mine has been open since June or something, so I am not holding my breath any more. :slightly_smiling_face: It's been a bit dynamic too, I'll have to say that.

If that does not play nicely try adding the PLL. The interface might need a clock signal too.

1 Like

I naturally mean the lines for the three 9132 devices that have DTS files in ath79:

  • ar9132_tplink_tl-wa901nd-v2.dts
 141         tl-wa901nd|\
 142         tl-wa901nd-v2|\
 143         tl-wa901nd-v3|\
 144         tl-wa901nd-v4|\
 145         tl-wa901nd-v5|\
 146         tl-wr703n|\
 147         tl-wr802n-v1|\
 148         tl-wr802n-v2|\
 149         tl-wr902ac-v1|\
 150         ts-d084|\
 151         tube2h|\
 152         unifi|\
 153         unifiac-lite|\
 154         wi2a-ac200i|\
 155         wifi-pineapple-nano|\
 156         wndap360|\
 157         wp543)
 158                 ucidef_set_interface_lan "eth0"
 159                 ;;
  • ar9132_tplink_tl-wr1043nd-v1.dts
 516         tl-wr1043nd)
 517                 ucidef_add_switch "switch0" \
 518                         "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"

ar9132_tplink_tl-wr941-v2.dts

 324         rb-941-2nd)
 325                 ucidef_add_switch "switch0" \
 326                         "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:wan:1"

All those define only eth0 in the ar71xx network config.

OK, thanks. The ar71xx build for the WNR2000 v1 has both eth0 and eth1, so it must be set up in some way, no? The mach file refers to it as well. The WNR2000 has no match in /etc/board.d/02_network and that makes it revert to default settings, which is ucidef_set_interfaces_lan_wan "eth0" "eth1".

You should make sure your patches are refreshed on top of current master branch.