Porting ENS202EXT to ath79

Hi all,

I have an ENS202EXT free to experiment with and I would like to help the porting process for it to the ath79 kernel. It is not a very popular model so I would imagine most if not all devs don't have it. I have Linux experience, but pretty much no experience writing in C or the DTS files.

I imagine I would be using a similar commit as a template, like this one which has the same SoC as I understand:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=9601d94138de66e4fc9f55a08dfb348cdfcc3181

My board has OpenWRT on it, and I'm sure I can use it to gather most of the hardware info. If someone can help me with a list of what I need to find out, and what on this example commit I don't need to copy, and relevant commands, that would be much appreciated.

If it's easier to translate it from the mach file in ar71xx, how would I go about that?

Here is what i have as a DTS so far...

Two problems right now:

After building, a factory.bin did not exist, only the initramfs-kernel.bin and sysupgrade.bin. I set the IMAGE_SIZE variable equal to the size of the "firmware" mtd. Anything wrong with that?

After trying the initramfs-kernel through tftpboot, the serial console dies, despite the kernel command line being console=ttyS0,115200 rootfstype=squashfs,jffs2 it seems to have changed the baud rate? but it's not working on that baud anyway...:

[    0.807246] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.819536] console [ttyS0] disabled
[    0.825805] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
%!!-99¢%qíq*çl¢a)I©Yê %ƒ(£+£,,B©µ­¥*ÿ.ß•÷(ï¡J©_á%!!-91¢%yn~I«YhÆ„üЂ‡mpYê %ƒ(£+£,§,B©µ®­Õ+¥¨Z¨©÷(ßµT©‰ø%!!-=9E&)›,15z-5)Ð¥,19ah=Ë.Úô×è %!!-=Ëí=-…v'lp‡nykPr‹z‡«I¨þ·*-A¢Â)ÄúšÐ‹z-	ø%!!-19ƒ›r‡ëP¢Â1„ôQèq--AiðA+%[á%!!-1Â11P11111)11119115%f%y.	ø%!!-1«¯1P111E,111119115%f%yîX«Ð %!!-1£9å(11119111111!115%šr·*	ø%!!-ƒ=1âP1111!111111·,1!‹©zÛöð"ü%!!-£5eì‚1111·,1)1111·,1!‹©òqmô"ü%!!-£1¢9a1P11-G,111111115%„tZá%!!-ƒ1¢5a)pi-
...
...
...

The DTS:

// 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 "ar9341.dtsi"

/ {
        model = "Engenius ENS202EXT";
        compatible = "engenius,ens202ext", "qca,ar9341";

        aliases {
                serial0 = &uart;
                led-boot = &system;
                led-failsafe = &system;
                led-running = &system;
                led-upgrade = &system;
        };

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

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

        leds {
                compatible = "gpio-leds";

                system: power {
                        label = "engenius:amber:power";
                        gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                };

                wlan {
                        label = "engenius:amber:wlan0";
                        gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "phy0tpt";
                };

                rssilow {
                        label = "engenius:red:wlan1";
                        gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
                };

                rssimedium {
                        label = "engenius:amber:wlan2";
                        gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
                };

                rssihigh {
                        label = "engenius:green:wlan3";
                        gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
                };
        };
};

&ref {
        clock-frequency = <25000000>;
};

&uart {
        status = "okay";
};

&gpio {
        pinctrl-names = "default";
        pinctrl-0 = <&jtag_disable_pins>;
};

&spi {
        num-cs = <1>;

        status = "okay";

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

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

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

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

                        partition@50000 {
                                label = "custom";
                                reg = <0x050000 0x050000>;
                                read-only;
                        };

                        partition@a0000 {
                                compatible = "engenius,firmware";
                                label = "firmware";
                                reg = <0x0a0000 0xd50000>;
                        };

                        partition@df0000 {
                                label = "failsafe";
                                reg = <0xdf0000 0x200000>;
                                read-only;
                        };

                        art: partition@ff0000 {
                                label = "art";
                                reg = <0xff0000 0x010000>;
                                read-only;
                        };
                };
        };
};

&eth0 {
        status = "okay";

        phy-handle = <&swphy0>;
        mtd-mac-address = <&art 0x0>;
        mtd-mac-address-increment = <(-1)>;
};

&wmac {
        status = "okay";

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