OpenWrt support for TP Link EAP115

Below diff log from OpenWRT 22.03 baseline to my changes/additions:

Added device to `02_network` script and device images creation and recipe for image creation (at the moment I'm only using `initramfs`, neither `factory` nor `sysupgrade` has been verified yet)
user@2f4e8d5980b0:/home/openwrt$ git diff
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index 4d3296c0af..078e867d97 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -76,6 +76,7 @@ ath79_setup_interfaces()
        tplink,cpe610-v1|\
        tplink,cpe610-v2|\
        tplink,cpe710-v1|\
+       tplink,eap115-v4|\
        tplink,eap225-outdoor-v1|\
        tplink,eap225-v1|\
        tplink,eap225-v3|\
diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
index fed572c884..612872ef98 100644
--- a/target/linux/ath79/image/generic-tp-link.mk
+++ b/target/linux/ath79/image/generic-tp-link.mk
@@ -381,6 +381,19 @@ define Device/tplink_cpe710-v1
 endef
 TARGET_DEVICES += tplink_cpe710-v1
 
+define Device/tplink_eap115-v4
+  $(Device/tplink-safeloader)
+  SOC := qca9533
+  IMAGE_SIZE := 7680k
+  DEVICE_MODEL := EAP115
+  DEVICE_VARIANT := v4
+  TPLINK_BOARD_ID := EAP115V4
+  DEVICE_PACKAGES := -rssileds
+  LOADER_TYPE := elf
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
+endef
+TARGET_DEVICES += tplink_eap115-v4
+
 define Device/tplink-eap2x5
   $(Device/tplink-safeloader)
   LOADER_TYPE := elf

Here come new device-tree files:

qca9533_tplink_eap115-v4.dts
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "qca9533_tplink_eap11x.dtsi"

/ {
	compatible = "tplink,eap115-v4", "qca,qca9533";
	model = "TP-Link EAP115 v4";
};

&eth1 {
	compatible = "syscon", "simple-mfd";
};
qca9533_tplink_eap11x.dtsi
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "qca953x.dtsi"

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

/ {

	aliases {
		led-boot = &led_status_green;
		led-failsafe = &led_status_amber;
		led-running = &led_status_green;
		led-upgrade = &led_status_amber;
		label-mac-device = &wmac;
	};
	
	leds: leds {
		compatible = "gpio-leds";

		led_status_green: status_green {
			label = "green:status";
			gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_STATUS;
			default-state = "on";
		};

		led_status_amber: status_amber {
			label = "amber:status";
			gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
			color = <LED_COLOR_ID_AMBER>;
			function = LED_FUNCTION_STATUS;
		};
			
		led_status_red: status_red {
			label = "red:status";
			gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
			color = <LED_COLOR_ID_RED>;
			function = LED_FUNCTION_PANIC;			
		};
	};
	
	keys {
		compatible = "gpio-keys";

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

&spi {
	status = "okay";

	flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		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 0x020000>;
				read-only;
			};

			partition@20000 {
				label = "partition-table";
				reg = <0x020000 0x010000>;
				read-only;
			};

			info: partition@30000 {
				label = "info";
				reg = <0x030000 0x010000>;
				read-only;
			};

			partition@40000 {
				label = "firmware";
				reg = <0x040000 0x780000>;
				compatible = "tplink,firmware";
			};

			config: partition@7c0000 {
				label = "config";
				reg = <0x7c0000 0x030000>;
				read-only;
			};

			art: partition@7f0000 {
				label = "art";
				reg = <0x7f0000 0x010000>;
				read-only;
			};
		};
	};
};

&eth0 {
	status = "okay";

	phy-handle = <&swphy4>;

	nvmem-cells = <&macaddr_info_8>;
	nvmem-cell-names = "mac-address";
};

&wmac {
	status = "okay";

	mtd-cal-data = <&art 0x1000>;
	nvmem-cells = <&macaddr_info_8>;
	nvmem-cell-names = "mac-address";
};

&info {
	compatible = "nvmem-cells";
	#address-cells = <1>;
	#size-cells = <1>;

	macaddr_info_8: macaddr@8 {
		reg = <0x8 0x6>;
	};
};
...and modifications in tplink-safeloader.c
user@2f4e8d5980b0:/home/openwrt$ diff ../bak/tplink-safeloader.bak ./build_dir/host/firmware-utils-2022-04-25-ddc3e00e/src/tplink-safeloader.c  --color -c
*** ../bak/tplink-safeloader.bak        Sun Apr 24 20:35:46 2022
--- ./build_dir/host/firmware-utils-2022-04-25-ddc3e00e/src/tplink-safeloader.c Sat Dec 10 12:05:53 2022
***************
*** 1518,1523 ****
--- 1518,1553 ----
                .last_sysupgrade_partition = "file-system"
        },
  
+       /** Firmware layout for the EAP115 V4 */
+       {
+               .id     = "EAP115V4",
+               .vendor = "",
+               .support_list =
+                       "SupportList:\r\n"
+                       "EAP110-Outdoor(TP-LINK|UN|N300-2):3.0\r\n"
+                       "EAP110(TP-LINK|UN|N300-2):4.0  841\r\n"
+                       "EAP115-Wall(TP-LINK|UN|N300-2):1.0\r\n"
+                       "EAP115(TP-LINK|UN|N300-2):4.0  841\r\n",
+ 
+               .soft_ver = SOFT_VER_DEFAULT,
+ 
+               .partitions = {
+                       {"fs-uboot", 0x00000, 0x20000},
+                       {"partition-table", 0x20000, 0x02000},
+                       {"default-mac", 0x30000, 0x01000},
+                       {"support-list", 0x31000, 0x00100},
+                       {"product-info", 0x31100, 0x00400},
+                       {"soft-version", 0x32000, 0x00100},
+                       {"firmware", 0x40000, 0x780000},
+                       {"user-config", 0x7c0000, 0x30000},
+                       {"radio", 0x7f0000, 0x10000},
+                       {NULL, 0, 0}
+               },
+ 
+               .first_sysupgrade_partition = "os-image",
+               .last_sysupgrade_partition = "file-system"
+       },
+ 
        /** Firmware layout for the EAP120 */
        {
                .id     = "EAP120",

The initramfs kernel image works okay (sideload from console and tested uci and manual configurations for both AP and STA mode - remember these settings aren't persistent).

The file is shared here openwrt-ath79-generic-tplink_eap115-v4-initramfs-kernel.bin. Feel free to test it more and provide feedback.

My next steps are:

  • Verify factory and sysupgrade images format/content/size
  • Find way to flash factory image from stock firmware - probably need to patch TP-Link's uclited utility, however my bin differs to the one from here