Add support for Linksys EA6350 v3

Good news, the ipq40xx target already exists in OpenWrt...it won't be too hard..hopefully others are looking and can get you closer to what tweaks, etc. you'll need to support this device. A major one is the location where the bootloader looks for the Kernel (in Hex).

But starting point would be to create a build environment to create my image, then work out what options to use in menuconfig?

Do you know of a howto where I can take work that appears to be almost complete e.g.
https://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4

and customize it for my exact hardware?
Thank you Wayne for all your help so far :):smiley:

You need to write a dts file for you hardware.
There are already a few devices supported on ipq4018.

1 Like

I think I have a working build platform. I used Ubuntu 18.04LTS server and cloned chaos-calmer. I had a fight with a few dependencies and had to modify ./include/prereq-build.mk so that I didn't get an error about the git version found the answer in the patch here (https://gitlab.labs.nic.cz/turris/openwrt/issues/56)

I am now at the point where I should build an image but couple of questions:

  1. which CPU should I pick? ARMv8 or ARM?
  2. Can anyone explain how to fix the menu showing with 'x' and 'q' instead of line characters? (I tried changing Terminal -> Data -> Terminal-type string --> putty (was xterm) but this didn't have any effect. Window -> Translation has remote character set as UTF-8 and when I check 'locale' it is all en_US.UTF-8)
    Putty%20menu%20line%20character%20problem

Qualcomm Atheros IPQ40XX

ARMv8 == ARM64 == AARCH, this would cover ARM Cortex A53 and newer.

ARMv7 == 32 bit ARM == armhf, this covers the older 32 bit cores, like Cortex A5-A17.

The ipq40xx family of SOCs is based on Cortex A7 ARMv7 cores.

You can't build an image for a new device just by selecting something in menuconfig.
Some work needs to be done first. After this work your device will appear in menuconfig.

Start with writing a DTS file. It is not so easy...

1 Like

OK. I've read Thomas Petazzoni's Device Tree for dummies and realize that this process is somewhat involved. I also now understand why Wayne suggested I ask Linksys for the source - the DTS file already exists for my hardware and I could copy it to build using the latest OpenWRT release.

Please can anyone tell me how I can reach the right contact in Linksys to get this information?

Linksys GPL Code Center

https://www.linksys.com/us/support-article?articleNum=114663

Of course it couldn't be that simple :frowning:

I can't find anything like a dts file in the GPL files. Can someone give me a tip on how to perhaps reverse engineer the Linksys source to work out what I need?

Well,its pretty much guaranteed that they did not make it.
They mostly just reuse one of many QCA QSDK DTS files or edit them slightly.
Even in the bootlog it says Machine model: Linksys EA6350v3 based on Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C2
So its either in GPL or you can extract the dtb from kernel in the upgrade image and then convert that to dts.
Altought GPL way is easier.

Just took a lookg at GPL and the DTS is in publication/src/linux/patches/022_arcadyan-dk01-c2.patch
They are just using QSDK qcom-ipq40xx-ap.dk01.1.dtsi with LEDs defined.

robimarko - I see you found DTS info in the patches directory. I'm sorry to keep asking basic questions but I don't know what to do with that information :slight_smile: (curious how did you find this patch? did you grep for some particular string in all files?)

Working from that file, would the below be my dts file? or is that still only a starting point?

#include "qcom-ipq40xx-ap.dk01.1.dtsi"

/ {
	model = "Linksys EA6350v3 based on Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C2";


	soc {
		spi_0: spi@78b5000 { /* BLSP1 QUP1 */
			status = "okay";
			qcom,gpio-cs1 = <&tlmm 59 0>;
			clocks = <&gcc GCC_DUMMY_CLK>,
				<&gcc GCC_DUMMY_CLK>;
			clock-names = "iface_clk", "core_clk";

			mt29f@1 {
				#address-cells = <1>;
				#size-cells = <1>;
				compatible = "spinand,mt29f";
				reg = <1>;
				spi-max-frequency = <24000000>;	

			};

		};
		gpio_keys {
			compatible = "gpio-keys";
			status = "okay";

			button@0 {
				label = "wps";
				linux,code = <KEY_WPS_BUTTON>;
				gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
				linux,input-type = <1>;
			};
			button@1 {
				label = "reset";
				linux,code = <KEY_RESTART>;
				gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
				linux,input-type = <1>;
			};
		};
		gpio_leds {
			compatible = "gpio-leds";
			status = "okay";
			led1 {
				gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>;
				label = "panel";
				linux,default-trigger = "heartbeat";
			};
		};
	};
	chosen {
		bootargs-append = " mtdparts=spi0.1:40M(kernel),37M@0x300000(rootfs),40M@0x2800000(alt_kernel),37M@0x2b00000(alt_rootfs),1M(sysdiag),47M(syscfg),-(offlimit) clk_ignore_unused ";
	};
	watchdog@b017000 {
		compatible = "qcom,kpss-wdt-ipq40xx";
		timeout-sec = <15>;
		status = "okay";
	};
};

/*&tlmm {
	pinctrl-names = "default";
	pinctrl-0 = <&led_pins>;

	led_pins: led_pinmux {
		pins = <2>; //"gpio58";
                drive-strength = <8>;
		bias-pull-up;
                output-high;
	};
};*/

I've read more about the process and guess I either need to become much more proficient as a programmer and learn a lot more about embedded systems or I find an existing developer who might be prepared to work with me. What I would like to produce is a complete how-to guide with each step documented so that someone like me could in future at least know all the steps required and why.

What is the motivation for most of the developers in this community?

Maybe a guide is not enough, you will find that you need some technical skill first. Either formal training or self learning.

A guide could only be a demonstration on how you would apply that skill in a very specific way. You need to use your knowledge skill in different applications.

PS
What I mean instead of developing your skills on something like openwrt. Start on a devkit geared towards learning such as the raspberry PI or arduino which have lots of educational material and support.

2 Likes

Well, I simply searched for the model in the GPL.
Now you know where things are connected so a DTS for OpenWRT can be made.
But It's not copy-paste as QSDK DTS files have a lot of properties that are either named differently in the upstream or don't exist at all.

I am sorry but If you haven't done this at all before it would be close to impossible.
You would need to start off with a much simpler target like mt7628.

Thank you robimarko - I was coming to the same conclusion. There are many hoops I need to have already jumped through. I think I will work with a Raspberry Pi 2 B+ to solve my immediate problem which is monitoring my home network, and then think again what my motivation is for understanding embedded Linux more.

Couldn't you just install opkg and then install the software you need?

You need opkg to install the opkg IPK file. :wink:

Hey,

I need to compile OpenWRT for this router too. I'll be working on this for the next couple of weeks if anyone else is interested in developing for this?
Hardware should arrive in a couple of days.

I have plenty of experience writing DTBs & patches, compiling with buildroot, compiling linux kernels and general embedded stuff, but have never compiled OpenWRT.

If not I shall probably modify the GPL source instead.

I've built from source without LED, ethernet or GPIO defined - When the hardware arrives I will double check all the definitions and then play with the build from ramdisk.

If all goes well I will submit a patch :slight_smile:

1 Like