Porting guide ar71xx to ath79?

Please don't quote that to me.
That was just a quote from the mailing list, like I provided the link.

I know it wasn't you, sorry if my message implied that way. Was just thinking out loud :slight_smile:

Thank you all for your helpful replies.

I forgot about the problem with mach files...

I think no one will create dts files and compatible drivers for my wdr3600 and i can live with 4.9 kernel too.

Where would a perhaps naive but enthusiastic individual find out what is involved in contributing to this, especially for an aging, but reasonably popular target like the Archer C7?

googling?
ar71xx dts

reveals some interesting links...

But it will be low-level hardware stuff. Figuring out how to connect the drivers in the current kernel to the hardware via correct definitions in th DTS files.

1 Like

Hmm... :slight_smile:

WDR3600 is DB120 and there exists a predefined machine within ath79_defconfig on 4.14 kernel...

It could be possible to create a dts with the one from reference board...

Edit: There is no dts for db120 and also no dtsi for ar9344.

Looks like blogic has just refreshed his ath79 staging branch based on kernel 4.14:
https://git.openwrt.org/?p=openwrt/staging/blogic.git;a=shortlog;h=refs/heads/ath79

It seems to e.g. have DTS file WNDR3800 that I have. (but e.g. the network config is still missing for that router, so the branch is largely just a skeleton at the moment.)

Please refrain from such deragatory analogies. If you disagree with the direction of the development, feel free to discuss on the mailing lists and provide compelling arguments (and more importantly invest actual effort) on why developers should voluntarely start working on upgrading to 4.14 while losing support for a large number of devices.

With total respect towards the developers, my suggestion is flow offload, which would be available for these older and much weaker SoCs with kernel 4.14, and they would profit a lot from it. If this is possible by backporting instead of upgrading the kernel, that would be fine as well, but a lot of devices would benefit from that feature.

2 Likes

That would be beautiful if this great feature would be backported...

1 Like

I am totally agree with you

Yes, this would be great if backported. If the challenge is access to hardware, happy to supply a C7v2 or v4 to a dev (US based) willing to get this going.

As the first kernel selected for Super Long Term Support (SLTS), the Civil Infrastructure Platform will provide [kernel 4.4] support until at least 2026, possibly until 2036.

https://wiki.linuxfoundation.org/civilinfrastructureplatform/cipkernelmaintenance

I have a big ol' stack of ar71xx devices I'd like to see rolled to the ath79 side. I'm willing to put in the effort. Is there a guide or some examples of other devices that have been successfully switched?

see https://github.com/p-wassi/lede-source/commits/ath79_devicetree
and
https://git.openwrt.org/?p=openwrt/staging/blogic.git;a=shortlog;h=refs/heads/ath79

2 Likes

That looks like a fantastic starting point. Thanks!

ath79 target is now in master, but most of the boards still need to be ported.
See http://lists.infradead.org/pipermail/lede-dev/2018-May/012152.html

2 Likes

That are great news :grinning:

I would like to try the Tplink 1043nd v3 and v4, does anybody started to work on it ?

so I tried to poke around and I got this

[    0.000000] Linux version 4.14.37 (build@build) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r6854-4aacd6388a)) #0 Mon May 7 16:54:23 2018
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[    0.000000] SoC: Qualcomm Atheros QCA9558 ver 1 rev 0
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] OF: fdt: No valid device tree found, continuing without
[    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-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x8c/0x474 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k(uImage),64k(mib0),64k(ART) mem=64M rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 58424K/65536K available (3639K kernel code, 145K rwdata, 868K rodata, 1228K init, 212K bss, 7112K 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] Failed to get CPU node
[    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns

this is the DTS file

Summary
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;

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

#include "qca9557.dtsi"

/ {
	compatible = "tplink,tl-wr1043nd-v2", "qca,qca9557";
	model = "TP-Link TL-WR1043ND Version 2";

	memory@0 {
		device_type = "memory";
		reg = <0x0 0x8000000>;
	};

	extosc: ref {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-output-names = "ref";
		clock-frequency = <40000000>;
	};

	leds {
		compatible = "gpio-leds";

		system {
			label = "tp-link:green:system";
			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "heartbeat";
		};

		usb {
			label = "tp-link:green:usb";
			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		wifi_green {
			label = "tp-link:green:wlan";
			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};

		wifi_wps {
			label = "tp-link:green:wps";
			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
			default-state = "off";
		};
	};

	keys {
		compatible = "gpio-keys-polled";
		#address-cells = <1>;
		#size-cells = <0>;
		poll-interval = <100>;

		button@0 {
			label = "Reset button";
			linux,code = <KEY_RESTART>;
			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
			debounce-interval = <60>;
		};

		button@1 {
			label = "RFKILL button";
			linux,code = <KEY_RFKILL>;
			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
			debounce-interval = <60>;
		};
	};
};

//&pcie0 {
//	status = "okay";
//};

&uart {
	status = "okay";
};

&pll {
	clocks = <&extosc>;
};

&spi {
	status = "okay";
	num-cs = <1>;

	flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "s25sl064a";
		reg = <0>;
		spi-max-frequency = <25000000>;

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

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

//			partition@1 {
//				label = "u-boot-env";
//				reg = <0x040000 0x010000>;
//			};

//			partition@2 {
//				label = "firmware";
//				reg = <0x850000 0x7a0000>;
//			};

//			partition@3 {
//				label = "ART";
//				reg = <0xff0000 0x010000>;
//				read-only;
//			};
		};
	};
};

&mdio0 {
	status = "okay";

	phy4: ethernet-phy@4 {
		reg = <4>;
		phy-mode = "rgmii-id";
	};
};

&mdio1 {
	status = "okay";

	phy1: ethernet-phy@1 {
		reg = <1>;
		phy-mode = "sgmii";
	};
};

&eth0 {
	status = "okay";

	phy-handle = <&phy4>;
	phy-mode = "rgmii";
};

&eth1 {
	status = "okay";

	phy-handle = <&phy1>;
	phy-mode = "sgmii";
};

If somebody has something to say I'm all ears :slight_smile: