Adding Device Support TP-Link WR941HP

I've successfully booted my Openwrt initramfs. It trickier than I expected.

The uboot bootm command seem to only accept images with these two condition:

  1. Must have and uImage header. Uboot will verify checksum in the first 64 bytes (e.g. 0x81000040).
  2. The image type must be "Multi-File Image". The default mkimage parameters in openwrt's common-tp-link.mk is linux.

Those idea came when I tried to boot an sysupgrade image that have uImage header, but image type is MIPS Linux Kernel Image:

## Booting image at 81000000 ...
   Verifying Checksum at 0x81000040 ...OK
Wrong Image Type for bootm command    

To confirm my hypothesis, I trimmed stock firmware down to only have the header and Multi-File Image:

xpduyson@DESKTOP-9RMCMKP:~/openwrt/bin/targets/ath79/generic$ binwalk /mnt/r/tplink_wr941HPv2_bootm.bin

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             uImage header, header size: 64 bytes, header CRC: 0xAFF40B5C, created: 2017-12-22 09:13:19, image size: 1109236 bytes, Data Address: 0x80060000, Entry Point: 0x80060000, data CRC: 0x1CD39EAD, OS: Linux, CPU: MIPS, image type: Multi-File Image, compression type: lzma, image name: "MIPS OpenWrt Linux-3.3.8"
72            0x48            LZMA compressed data, properties: 0x6D, dictionary size: 8388608 bytes, uncompressed size: 3215376 bytes

uBoot accept that image and booted:

ath> tftp 0x81000000 tplink_wr941HPv2_bootm.bin
Trying eth0
eth0 link down
FAIL
Trying eth1
Using eth1 device
TFTP from server 192.168.1.10; our IP address is 192.168.1.1
Filename 'tplink_wr941HPv2_bootm.bin'.
Load address: 0x81000000
Loading: #################################################################
         #################################################################
         #################################################################
         #########################
done
Bytes transferred = 1122475 (1120ab hex)
ath> bootm
## Booting image at 81000000 ...
   Verifying Checksum at 0x81000040 ...OK
   Uncompressing Multi-File Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 67108864

Starting kernel ...

[    0.000000] Linux version 3.3.8 (jji315@ubuntu) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Fri Dec 22 17:12:43 CST 2017
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019750 (MIPS 74Kc)
[    0.000000] SoC: Qualcomm Atheros QCA956X rev 0
[    0.000000] Clocks: CPU:750.000MHz, DDR:400.000MHz, AHB:250.000MHz, Ref:25.000MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00004000
[    0.000000] Movable zone start PFN for each node
[    0.000000] Early memory PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00004000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line:  board=WR941HP console=ttyS0,115200 mtdparts=spi0.0:64k(u-boot)ro,6912k(rootfs),1088k(kernel),64k(mib0),64k(art),8000k@0x10000(firmware) rootfstype=squashfs,jffs2 noinitrd

Based on that, I changed the image type from linux to multi in mkimage command in common-tp-link.mk :

define Build/uImageArcher
	mkimage -A $(LINUX_KARCH) \
		-O linux -T multi -C $(1) -a $(KERNEL_LOADADDR) \
		-e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
		-n '$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $@ $@.new
	@mv $@.new $@
endef

This is my device profile, need to overdrive KERNEL_INITRAMFS to include uImage header:

define Device/tplink_tl-wr941hp-v2
  $(Device/tplink-8mlzma)
  SOC := tp9343
  DEVICE_MODEL := TL-WR941HP
  DEVICE_VARIANT := v2
  TPLINK_BOARD_ID := TLWR941HPV2
  SUPPORTED_DEVICES += tl-wr941hp-v2
  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImageArcher lzma
endef
TARGET_DEVICES += tplink_tl-wr941hp-v2

The Openwrt bootlog:

ath> bootm
## Booting image at 81000000 ...
   Verifying Checksum at 0x81000040 ...OK
   Uncompressing Multi-File Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 67108864

Starting kernel ...

[    0.000000] Linux version 4.19.101 (xpduyson@DESKTOP-9RMCMKP) (gcc version 8.3.0 (OpenWrt GCC 8.3.0 r12191-aca274091a)) #0 Thu Feb 6 10:36:15 2020
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[    0.000000] MIPS: machine is TP-Link TL-WR941HP v2
[    0.000000] SoC: Qualcomm Atheros TP9343 rev 0
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    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-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 0x804886c4 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    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: 52020K/65536K available (3575K kernel code, 157K rwdata, 516K rodata, 8032K init, 199K bss, 13516K 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] CPU clock: 750.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5096694524 ns
[    0.000009] sched_clock: 32 bits at 375MHz, resolution 2ns, wraps every 5726622718ns
[    0.008247] Calibrating delay loop... 373.55 BogoMIPS (lpj=1867776)
[    0.074848] pid_max: default: 32768 minimum: 301
[    0.079926] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.086903] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.098778] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.109201] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.115738] pinctrl core: initialized pinctrl subsystem
[    0.122423] NET: Registered protocol family 16
[    0.156091] clocksource: Switched to clocksource MIPS
[    0.162766] NET: Registered protocol family 2
[    0.168227] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[    0.176398] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.183761] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.190489] TCP: Hash tables configured (established 1024 bind 1024)
[    0.197381] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.203563] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.210577] NET: Registered protocol family 1
[    0.423544] Crashlog allocated RAM at address 0x3f00000
[    0.430833] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.443323] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.449533] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.494216] io scheduler noop registered
[    0.498413] io scheduler deadline registered (default)
[    0.505905] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[    0.513284] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.520867] console [ttyS0] disabled
[    0.524679] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[    0.533835] console [ttyS0] enabled
[    0.533835] console [ttyS0] enabled
[    0.541402] bootconsole [early0] disabled
[    0.541402] bootconsole [early0] disabled
[    0.559733] m25p80 spi0.0: gd25q64 (8192 Kbytes)
[    0.564555] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.571191] Creating 4 MTD partitions on "spi0.0":
[    0.576172] 0x000000000000-0x000000010000 : "u-boot"
[    0.582248] 0x000000010000-0x0000007e0000 : "firmware"
[    0.591606] 0x0000007e0000-0x0000007f0000 : "mib0"
[    0.597594] 0x0000007f0000-0x000000800000 : "art"
[    0.604574] libphy: Fixed MDIO Bus: probed
[    0.967185] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    1.646520] libphy: ag71xx_mdio: probed
[    1.651334] libphy: ar8xxx-mdio: probed
[    1.726495] switch0: Atheros AR8229 rev. 1 switch registered on mdio-bus.0
[    1.813672] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    1.823704] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    1.833397] NET: Registered protocol family 10
[    1.844673] Segment Routing with IPv6
[    1.848658] NET: Registered protocol family 17
[    1.853328] 8021q: 802.1Q VLAN Support v1.8
[    2.199738] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:1f:04 [uid=004dd042, driver=Generic PHY]
[    2.210617] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[    2.283234] Freeing unused kernel memory: 8032K
[    2.287952] This architecture does not have kernel memory protection.
[    2.294603] Run /init as init process
[    2.314074] init: Console is alive
[    2.318082] init: - watchdog -
[    2.331918] random: fast init done
[    2.347231] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.357810] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    2.366641] init: - preinit -
[    2.593375] random: jshn: uninitialized urandom read (4 bytes read)
[    2.685913] random: jshn: uninitialized urandom read (4 bytes read)
[    2.823716] random: jshn: uninitialized urandom read (4 bytes read)
[    3.180311] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    3.186539] IPv6: ADDRCONF(NETDEV_UP): eth0.1: link is not 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
[    4.257302] eth0: link up (1000Mbps/Full duplex)
[    4.263053] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    4.282325] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[    7.375449] eth0: link down
[    7.400929] procd: - early -
[    7.404043] procd: - watchdog -
[    7.958417] procd: - watchdog -
[    7.962054] procd: - ubus -
[    7.972879] urandom_read: 5 callbacks suppressed
[    7.972888] random: ubusd: uninitialized urandom read (4 bytes read)
[    8.015807] random: ubusd: uninitialized urandom read (4 bytes read)
[    8.024119] procd: - init -
Please press Enter to activate this console.
[    8.540306] kmodloader: loading kernel modules from /etc/modules.d/*
[    8.598523] Loading modules backported from Linux version v5.4-rc8-0-gaf42d3466bdc
[    8.606424] Backport generated by backports.git v5.4-rc8-1-0-g368e8c51
[    8.670484] xt_time: kernel timezone is -0000
[    8.834538] urngd: v1.0.2 started.
[    8.841142] PPP generic driver version 2.4.2
[    8.857249] NET: Registered protocol family 24
[    9.009707] ieee80211 phy0: Atheros AR9561 Rev:0 mem=0xb8100000, irq=2
[    9.086616] kmodloader: done loading kernel modules from /etc/modules.d/*
[    9.133300] random: crng init done
[   38.868525] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   38.875831] eth0: link up (1000Mbps/Full duplex)
[   38.888405] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   38.926530] br-lan: port 1(eth0.1) entered blocking state
[   38.932116] br-lan: port 1(eth0.1) entered disabled state
[   38.938142] device eth0.1 entered promiscuous mode
[   38.943101] device eth0 entered promiscuous mode
[   38.979533] br-lan: port 1(eth0.1) entered blocking state
[   38.985128] br-lan: port 1(eth0.1) entered forwarding state
[   38.991186] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   39.078754] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   39.936939] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready



BusyBox v1.31.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r12191-aca274091a
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/#

1 Like

Openwrt support for this device as of today:

Works:

  • Wifi: works "out of the box", no need to change anything. Transmission power can goes up to 30 dBm (1000mW).
  • LEDs.
  • Buttons.
  • Ethernet:
    • Corrected MAC address.
    • Eth0 and eth1 are swapped, this happen due to ar71xx to ath79 port.
    • LAN ports are now in correct label order.

Brokens:

  • Ethernet:
    • Openwrt thinks the LAN port label number 4 is also a WAN port. When plugged in port no. 4, both LAN and WAN led light up, but that port still behave as an LAN port. The blue WAN port is not respond to anything. Here is my current 02_network and dts Ethernet part, if anyone know what I did wrong please let me know:
	tplink,tl-wr941hp-v2)
		ucidef_set_interface_wan "eth1"
		ucidef_add_switch "switch0" \
			"0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
		;;
&eth0 {
	status = "okay";

	phy-handle = <&swphy4>;

	mtd-mac-address = <&mib0 0x8>;
	mtd-mac-address-increment = <1>;
};

&eth1 {
	status = "okay";
	
	mtd-mac-address = <&mib0 0x8>;
};
  • Factory Image:
    • This device have a strange partition table. Mostly similar to TP-link Archer (need something called tplink-safeloader to build), but kernel sit at the bottom of firmware.
[    0.690000] Creating 6 MTD partitions on "spi0.0":
[    0.700000] 0x000000000000-0x000000010000 : "u-boot"
[    0.700000] 0x000000010000-0x0000006d0000 : "rootfs"
[    0.710000] mtd: partition "rootfs" set to be root filesystem
[    0.720000] mtd: partition "rootfs_data" created automatically, ofs=6A0000, len=30000
[    0.720000] 0x0000006a0000-0x0000006d0000 : "rootfs_data"
[    0.730000] 0x0000006d0000-0x0000007e0000 : "kernel"
[    0.740000] 0x0000007e0000-0x0000007f0000 : "mib0"
[    0.740000] 0x0000007f0000-0x000000800000 : "art"
[    0.750000] 0x000000010000-0x0000007e0000 : "firmware"

If i put the kernel back to the beginning, uboot chose the old stock kernel instead of openwrt's one (???). If I put it to the "correct" order, the kernel (os-image) have to be expanded since the default size is too small for modern kernel. Now it seem to replaced the stock kernel, but I'm stuck with Bad Magic number again ...

2 Likes

Hi @xpduyson, well done! Do you had any progress so far?

Sorry for late reply!
Because the modern openwrt ath79 kernel cannot fit inside wr941hp's kernel partition, so it is impossible for me to continue.

1 Like

If you use the "TL-WR941HP v1" or "TL-WR941ND v6" u-boot, the kernel partition size problem is resolved. This can be extracted from the firmware downloaded from the official tp-link website. Remember to save the art partition for later recovery.

2 Likes

I got it for the "TL-WR941HP v1"!
1-Ethernets are working
2-The SPI has been fixed
3-Flash by browser normely
3-Upgrade by browser normely
4-Leds are working
5-Transmission power 1000mw works in US Country option

My GitHub:

../openwrt/tools/firmware-utils/src/tplink-safeloader.c

	/** Firmware layout for the TL-WR941HP v1 */
	{
		.id     = "TL-WR941HP-V1",
		.vendor = "",
		.support_list =
			"SupportList:\n"
			"{product_name:TL-WR941HP,product_ver:1.0.0,special_id:00000000}\n",
		.part_trail = 0x00,
		.soft_ver = NULL,

		/**
		   384KB were moved from file-system to os-image
		   in comparison to the stock image
		*/
		.partitions = {
			{"fs-uboot", 0x00000, 0x20000},
			{"firmware", 0x20000, 0x730000},
			{"default-mac", 0x750000, 0x00200},
			{"pin", 0x750200, 0x00200},
			{"product-info", 0x750400, 0x0fc00},
			{"soft-version", 0x760000, 0x0b000},
			{"support-list", 0x76b000, 0x04000},
			{"profile", 0x770000, 0x04000},
			{"default-config", 0x774000, 0x0b000},
			{"user-config", 0x780000, 0x40000},
			{"partition-table", 0x7c0000, 0x10000},
			{"log", 0x7d0000, 0x20000},
			{"radio", 0x7f0000, 0x10000},
			{NULL, 0, 0}
		},

		.first_sysupgrade_partition = "os-image",
		.last_sysupgrade_partition = "file-system",
	},

../openwrt/target/linux/ath79/image/generic-tp-link.mk

define Device/tplink_tl-wr941hp-v1
  $(Device/tplink-safeloader)
  SOC := tp9343
  DEVICE_MODEL := TL-WR941HP
  DEVICE_VARIANT := v1
  TPLINK_BOARD_ID := TL-WR941HP-V1
  IMAGE_SIZE := 7360k
  SUPPORTED_DEVICES += tplink,tl-wr941hp-v1
endef
TARGET_DEVICES += tplink_tl-wr941hp-v1

../openwrt/target/linux/ath79/generic/base-files/etc/board.d/02_network

	tplink,tl-wr941hp-v1)
		ucidef_set_interface_wan "eth1"
		ucidef_add_switch "switch0" \
			"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
		;;

(fixed)
../openwrt/target/linux/ath79/generic/base-files/etc/board.d/01_leds

tplink,tl-wr941hp-v1)
	ucidef_set_led_netdev "wan-data" "WAN-ON" "blue:wan" "eth1" "tx rx"
	ucidef_set_led_netdev "wan" "WAN-OFF" "red:wan" "eth1" "link"
	ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x1e"
	;;

../openwrt/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts

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

#include "qca956x.dtsi"

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

/ {
	//mod
	compatible = "tplink,tl-wr941hp-v1", "qca,tp9343";
	model = "TP-Link TL-WR941HP v1";

	//mod2
	aliases{
		label-mac-device = &wmac;
		led-boot = &led_system;
		led-failsafe = &led_system;
		led-running = &led_system;
		led-upgrade = &led_system;
	};
	leds {
		compatible = "gpio-leds";

		led_system: system {
			label = "blue:system";
			gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
			default-state = "on";
		};

		qss {
			label = "blue:qss";
			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
		};

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

		wan_blue {
			label = "blue:wan";
			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
		};

		wan_red {
			label = "red:wan";
			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
		};

		lan {
			label = "blue:lan";
			gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
		};

	};

	keys {
		compatible = "gpio-keys";

		wifi {
			label = "WiFi button";
			linux,code = <KEY_RFKILL>;
			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
		};

		reset {
			label = "Reset button";
			linux,code = <KEY_RESTART>;
			gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
		};
	};

};
//ok
&uart {
	status = "okay";
};
//mod
&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>;

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

			partition@20000 {
				compatible = "tplink,firmware";
				label = "firmware";
				reg = <0x020000 0x730000>;
			};

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

			partition@760000 {
				label = "tplink";
				reg = <0x760000 0x090000>;
				read-only;
			};

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

&mdio1 {
	status = "okay";
	resets = <&rst 23>;
	reset-names = "mdio";
	builtin-switch;

	builtin_switch: switch0@1f {
		compatible = "qca,ar8229";
		reg = <0x1f>;
		resets = <&rst 8>;
		reset-names = "switch";
		phy-mode = "gmii";
		//remove this line is important
		//qca,phy4-mii-enable;
		qca,mib-poll-interval = <500>;

		mdio-bus {
			#address-cells = <1>;
			#size-cells = <0>;

			phy0: ethernet-phy@0 {
				reg = <0>;
				phy-mode = "mii";
			};

		};
	};
};
&uart {
	status = "okay";
};

&eth0 {
	status = "okay";

	phy-handle = <&phy0>;

	mtd-mac-address = <&info 0x8>;
	mtd-mac-address-increment = <1>;
};

&eth1 {
	status = "okay";
	mtd-mac-address = <&info 0x8>;
	mtd-mac-address-increment = <2>;
};

&wmac {
	status = "okay";

	mtd-cal-data = <&art 0x1000>;
	mtd-mac-address = <&info 0x8>;
};
3 Likes

I fixed the wireless transmission power for 1000mw. I only selected the US country and then work normely.
I have the solution for version 2, but I will only post it when I finish version 1.

Now only the leds are missing.

2 Likes

Please mind that you should always set the country to the country your router is in, not the country where you get the most wifi power out of your router.

Version 1 is ready. I gave up on version 2. My expectations flared to version 2.

2 Likes

Please don't give up on version 2 :pray:t3:

I can run version 2 by changing the bootloader using "ch341a programmer" and "AsProgrammer". But I can't change the bootloader via the web browser. If someone can create an image that changes the bootloader then it will be possible. Another alternative would be to reduce the size of the kernel by moving some packages to rootfs however I don't know if you can do this.

Thank you very much. Using the firmware on my tp-link wr941hp v1. It gained some more usage time, since I bought an Tenda ac23. Now the wr941hp is a relay from my Tenda, since the house is 25x20m and has two floors.

Could you put a step-by-step installation? I believe I did it right, because I sent "openwrt-ath79-generic-tplink_tl-wr941hp-v1-squashfs-factory.bin" to upload tplink, then I updated openwrt with "openwrt-ath79-generic-tplink_tl-wr941hp- v1-squashfs-sysupgrade.bin ". But there is still the file "openwrt-ath79-generic-tplink_tl-wr941hp-v1-initramfs-kernel.bin" that I don't know what it is for.

Hello, I have no idea how it would be done, but if you tell me I could do it. I have a v2 and want to put OpenWrt on it.

the initramfs file and sysupgrade can be ignored.
"Initramfs" is for testing without flashing.
And "sysupgrade" you will only use when you build a custom image yourself using the "image builder".
The installation procedure is the same as for most routers, without complications (but this only applies to tl-wr941hp v1). You probably did it the right way.

The procedure is not feasible for most people. There is also a risk of damaging the router. If you do not yet have the proper tools to perform the procedure, you will also incur costs, as you will have to purchase them.
Summary procedure:
1- Dessolding the SPI chip from the router's motherboard
2- Place it correctly in the "programmer ch341a" tool
3- Extract the image of the SPI chip using the software "AsProgrammer v1.4.1" (I assume you have already downloaded and installed everything correctly on the computer)
4- Modify the bootloader and image using the "HxD - Freeware Hex Editor" software, insert the "tl-wr941hp v1" bootloader and the compatible openwrt image (This is the most important part) ----> You must do a specific version 2 image, I have it but I didn't make it available because the procedure is very complicated.
5- Assuming that the image was modified correctly, write the image created on the Chip SPI using "ASProgrammer" and "ch341a".
6- Resolding the chip correctly on the router and it will be working.

Only with this summary you probably will not be able to, but if you confirm that you are really going to do it, I will post the entire procedure.

I would be very happy if my version 1 was inserted in the compatibility table. This compilation I made has the possibility to open support for the TL-WR841HP version but I don't have that router to do it.

Hello. I have no experience in the subject, but I am an electronics technician, and I am not afraid of this, although I do not work on this, and I should make the time.

I should buy the programmer tool. I don't know if I'll ever use it again. Does this tool work for computer chipsets and all routers? or just some? I saw that there are 150mm, 200mm, 8, 16, I don't know which one would do. I also did not understand anything about point 4, but could I encourage myself to do it, or could I pass the file to you and you can edit it?

If you guide me, I may make the decision to do so. This is a page in my country where I could buy the tool. Could you tell me which one would work? I understand that those who have thought prevent me from desoldering the chip, correct?

https://listado.mercadolibre.com.ar/ch341#D[A:ch341]

These are the same as the ones I have:

Programador Ch341 Usb Y Pinza Soic8 Eeprom 24/25 Zif Bios | Mercado Libre

Zocalo Adaptador Smd Soic8 A Dip8 200mil Eeprom Ch341 | Mercado Libre

To desolder and solder I use it:
Estacion De Soldado Soldador Lapiz Cautin Aire Caliente Smd | Mercado Libre

I can help you with whatever you need.
You can use the tool to perform procedures on most routers, computer BIOS and any other equipment that needs to rewrite the SPI.
If you send the image I will mount it. Reset the router before starting.
Point 4 has many more substeps. I have to get organized enough to explain.
You said you're an electronics technician, so I assume you already know how to solder the chip, right?

The necessary programs are:
AsProgrammer_1.4.zip - Google Drive
HxD - Freeware Hex Editor and Disk Editor (mh-nexus.de)

I need to clarify. If I buy this kit, do I avoid desoldering and soldering?
https://articulo.mercadolibre.com.ar/MLA-873134440-programador-ch341-usb-y-pinza-soic8-eeprom-2425-zif-bios-_JM#position=4&type=item&tracking_id=912f9de6-b4b7-4bcb- 9eb0-b04affa4a8eb

But if I buy this, I should buy the soldier station, too, right?
https://articulo.mercadolibre.com.ar/MLA-856065383-zocalo-adaptador-smd-soic8-a-dip8-200mil-eeprom-ch341-_JM#position=1&type=item&tracking_id=912f9de6-b4b7-4bcb-9eb0- b04affa4a8eb

The point is that the soldier station is too much money for a use that is not likely to repeat itself. But if it's just the first, I might as well decide to do it.

you can try with "Pinza Soic8". But you may have bad contact problems and be unable to resolve them. And I also think that the circuit board can prevent you from reading or writing the flash for some reason that I will not be able to explain. I have been successful with this cable a few times, but not always.

and yes, you would avoid soldering and unsoldering.

I could assemble a kit with cheaper materials to make this weld. but it will also require skill to make the weld. if you go that route, I recommend that you train on other boards first.

And I didn't mention that you also have to buy the solder and the materials to clean the board.

Interestingly, you can expand the storage memory by placing an SPI chip with more memory and compiling your own image in the "image builder". But only if it is able to solder and unsolder.

And just to remind you as soon as you start the procedure, make a backup and keep a copy of your router's firmware.