IPQ8074A Tp link deco x80 5g info thread

I did not try to switch the boot part I was going to try that next by running the uboot tools from command line, but the partition was erased after reboot.

the second root partition shows up in openwrt as tempfs as part of automount preinit scripts. the partition was written with oem dump and i browsed around the fs but after reboot it is seemingly formatted.

it does not really matter but it would of been handy to switch between either partition.

If you mean "tmpfs", this is RAM.
https://openwrt.org/docs/techref/filesystems#tmpfs

I don't see any mount of the rootfs_1 in your bootlog.

what I'm doing is ubiformat /dev/mtd13 -y -f /tmp/mtd12.ubi and it writes onto the temp space
then I reboot and the temp space 42mb partition is empty afterwards

I can browse the contents after format but after reboot it is gone.

status

dev:    size          erasesize  name
mtd0: 00100000 00020000 "0:sbl1"
mtd1: 00100000 00020000 "0:mibib"
mtd2: 00080000 00020000 "0:bootconfig"
mtd3: 00080000 00020000 "0:bootconfig1"
mtd4: 00300000 00020000 "0:qsee"
mtd5: 00080000 00020000 "0:devcfg"
mtd6: 00080000 00020000 "0:apdp"
mtd7: 00080000 00020000 "0:rpm"
mtd8: 00080000 00020000 "0:cdt"
mtd9: 00180000 00020000 "0:appsblenv"
mtd10: 00200000 00020000 "0:appsbl"
mtd11: 00080000 00020000 "0:art"
mtd12: 02a00000 00020000 "rootfs"
mtd13: 02a00000 00020000 "rootfs_1"
mtd14: 00080000 00020000 "0:ethphyfw"
mtd15: 00900000 00020000 "factory_data"
mtd16: 01100000 00020000 "runtime_data"

offsets:
mtd0 	0		        0x000000
mtd1	1048576 		0x100000  
mtd2 	2097152		0x200000  
mtd3 	2621440		0x280000  
mtd4 	3145728		0x300000  
mtd5 	6291456		0x600000  
mtd6 	6815744		0x680000  
mtd7 	7340032		0x680000  
mtd8 	7864320		0x780000  
mtd9 	8388608		0x800000  
mtd10	9961472		0x980000  
mtd11	12058624	0xb80000  
mtd12	12582912	0xc00000  
mtd13       56623104	0x3600000
mtd14	100663296 	0x6000000
mtd15	101187584 	0x6080000
mtd16	110624768 	0x6980000
IPQ807x# smeminfo
smeminfo
flash_type:             0x2
flash_index:            0x0
flash_chip_select:      0x0
flash_block_size:       0x20000
flash_density:          0x100000
partition table offset  0x0
No.: Name             Attributes            Start             Size
  0: 0:SBL1           0x0000ffff              0x0         0x100000
  1: 0:MIBIB          0x0000ffff         0x100000         0x100000
  2: 0:BOOTCONFIG     0x0000ffff         0x200000          0x80000
  3: 0:BOOTCONFIG1    0x0000ffff         0x280000          0x80000
  4: 0:QSEE           0x0000ffff         0x300000         0x300000
  5: 0:DEVCFG         0x0000ffff         0x600000          0x80000
  6: 0:APDP           0x0000ffff         0x680000          0x80000
  7: 0:RPM            0x0000ffff         0x700000          0x80000
  8: 0:CDT            0x0000ffff         0x780000          0x80000
  9: 0:APPSBLENV      0x0000ffff         0x800000         0x180000
 10: 0:APPSBL         0x0000ffff         0x980000         0x200000
 11: 0:ART            0x0000ffff         0xb80000          0x80000
 12: rootfs           0x0000ffff         0xc00000        0x2a00000
 13: rootfs_1         0x0000ffff        0x3600000        0x2a00000
 14: 0:ETHPHYFW       0x0000ffff        0x6000000          0x80000
 15: factory_data     0x0000ffff        0x6080000         0x900000
 16: runtime_data     0x0000ffff        0x6980000        0x1100000

it sure sounds like you are uploading mtd12.ubi (source? command?) into /tmp, seeing that free space on tmp has decreased due to adding the uploaded file, using ubiformat to write from /tmp/mtd12.ubi to mtd13, rebooting without setting the tp_boot_idx, and noticing that the tmp is clear and mtd12 is the booted partition. this all sounds expected since you didn't make any attempt to set the tp_boot_idx to use the just-written mtd13, and the /tmp folder by nature is cleared every reboot.

if you want help with dualboot:
show us commands used and output when you upload the file to tmp, write to mtd13, and browse the contents of mtd13 to see its contents before reboot, and again after reboot when you determine that it is empty

and/or

show us commands used and output and boot logs when you set the tp_boot_idx to 1 to try to boot mtd13

Again: temp space is tmpfs - available RAM

This has nothing to do with the contents of the nand

So after playing around in the OEM image it has thermal control for the 5g modem tied in with the cpu and gpio-fan control.

the modem at command set has temperature commands to thermally throttle the device by software and sensor output for hardware.

as any device that attaches to the serial port takes over the at command interface what is my best process to integrate fan support with modem temp?

Should I ask modem manager to include such features in their software? it seems this device has it's own modems software and scripts specific to this device.

also it has a few I/O to indicate wan and status that looks like it might need further testing in a 4g and 5g area to see what is connected up to GPIO.

The modem has two audio interfaces for telephony support is that something I can get working under openwrt?

I guess it's good idea to ask on their bugtracker (since modemmanager-devel seems almost dead).

As I remember modem is exposed as USB device to OS so I wonder that maybe something like this could work? Although I not sure if it's easy to configure this on barebones Asterisk from OpenWRT repo, or you'll need chroot or Docker with FreePBX.

Ok so I had reliability issues with mounting the UBI partition from preinit because ubiattach exits before fully having the partition ready and putting sleep to delay the boot for it to word does not seem like a great idea so I have converted from smem to fixed partitions.
It now attaches when the kernel loads not later on during preinit.

It successfully captures the mac address in the factory partition and updates caldata for the ath11k firmware but the lan/ wan mac script does not seem to work.
anyone have any idea how to update the lan and wan mac properly?

This is what I'm using but it does not seem to work:

		tplink,deco-x80-5g)
			label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
			lan_mac=$(macaddr_add $label_mac 1)
			wan_mac=$label_mac
		;;

But this works for the wifi using the same library functions:

	tplink,deco-x80-5g)
		caldata_extract "0:ART" 0x1000 0x20000
		label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0)
		ath11k_patch_mac $(macaddr_add $label_mac -1) 0
		ath11k_patch_mac $(macaddr_add $label_mac -2) 1
		ath11k_set_macflag

When converting to fixed partitions I noticed an issue in the log and I don't know what it relates to:

OF: Bad cell count for /soc@0/nand-controller@79b0000/nand@0/partitions

How do I find the uboot env offset and size?

When I originally started porting OpenWrt I just populated the info with something similar but I know it is wrong as the boot options from OpenWrt wont boot to the alternate image partition on flash upgrade, but i guess I'm lucky so far it has not broken boot.

I'm trying to get the alternate partition flashing and booting working at the moment it just boots the same partition again.

tplink,deco-x80-5g)
	ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x20000"

There has been two new tplink targets since i started my project is it safe to assume that I
can just use their values assuming it is the same or is there a proper method?

tplink,eap620hd-v1|\
tplink,eap660hd-v1)
	ubootenv_add_mtd "0:appsblenv" "0x0" "0x40000" "0x20000"

I'm a bit hesitant to be messing in uboot but can I write something to envarg's there and then read back the partition dump or something after booting an initram based image or something.?

See stock firmware's /etc/fw_env.config:

# MTD device name   Device offset   Env. size   Flash sector size  Number of sectors
/dev/mtd9           0x0000          0x40000     0x20000            2
1 Like

I have now added feature to this project', I have a new kernel driver to control the RGB led.

It basically groups individual led's and exposes it as individual virtual led's but there is more to it.

It also includes priority and logic so you can ensure what is important is displayed, and the latest driven one has priority.

This will be very handy for a lot of other devices to make use of the status led and reimplement many of the oem functions of the LED Without userspace scripting.

kernel: add led group virtual color driver by professor-jonny · Pull Request #17691 · openwrt/openwrt

I have also created a test image trialing my kernel driver on this device and have been playing with it for some time.

professor-jonny/pj_openwrt at kmod_virtual_led_test

define individual elements of rgb led:

		compatible = "gpio-leds";
		pinctrl-0 = <&led_pins>;
		pinctrl-names = "default";
			/*note the LED's defined here are not individual they are a single combined RGB element
			they will be overridden by the virtual leds if the leds group virtual color
			kernel driver is loaded */

		led_system_green: green {
			gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; /* green led component of rgb led */
			color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_INDICATOR;
		};

		led_system_red: red {
			gpios = <&tlmm 51 GPIO_ACTIVE_HIGH>; /* red led component of rgb led */
			color = <LED_COLOR_ID_RED>;
			function = LED_FUNCTION_INDICATOR;
		};

		led_system_blue: blue {
			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>; /* blue led component of rgb */
			color = <LED_COLOR_ID_BLUE>;
			function = LED_FUNCTION_INDICATOR;
		};
	};

define the virtual led's:

	virtualcolor_leds {
		compatible = "leds-group-virtualcolor";
		/*note the LED's defined here are virtual
		by mixing the individual colors of the monochromatic system led.
		The OEM default behavior of the multifunction status led is as follows:
		pulse Yellow: resetting/ rebooting.
		Solid Yellow: starting up.
		Pulse Blue: factory reset/ first boot ready for setup or WPS in progress.
		to suit the TP-Link Deco X80-5G target */
		Pulse Red: mesh failure cant find peers.
		Solid Red: fault */

		led_virtual_red: virtual_red {
			color = <LED_COLOR_ID_RED>;

			function = LED_FUNCTION_STATUS;
			leds = <&led_system_red>;
		};

		led_virtual_green: virtual_green {
			color = <LED_COLOR_ID_GREEN>;

			function = LED_FUNCTION_STATUS;
			leds = <&led_system_green>;
		};

		led_virtual_blue: virtual_blue {

			color = <LED_COLOR_ID_BLUE>;
			function = LED_FUNCTION_STATUS;
			leds = <&led_system_blue>;
		};

		led_virtual_yellow: virtual_yellow {
			color = <LED_COLOR_ID_YELLOW>;
			function = LED_FUNCTION_STATUS;
			leds = <&led_system_green>, <&led_system_red>;
		};

		led_virtual_cyan: virtual_cyan {
			color = <LED_COLOR_ID_CYAN>;
			function = LED_FUNCTION_STATUS;
			leds = <&led_system_green>, <&led_system_blue>;
		};

		led_virtual_violet: virtual_violet {
			color = <LED_COLOR_ID_VIOLET>;
			function = LED_FUNCTION_STATUS;
			leds = <&led_system_red>, <&led_system_blue>;
		};

		led_virtual_white: virtual_white {
			color = <LED_COLOR_ID_WHITE>;
			function = LED_FUNCTION_STATUS;
			leds = <&led_system_green>, <&led_system_red>, <&led_system_blue>;
		};
	};

showing usage of virtual led's for alias triggers:

led-boot = &led_virtual_yellow;
led-failsafe = &led_virtual_blue;
led-running = &led_virtual_yellow;
led-upgrade = &led_virtual_green;
1 Like

I'm not too sure but for some reason my wifi is not working where it was previously working.

There is a board-2.bin file in the lib firmware ath11k directory and the header matches the calibration variant.

I'm kind of stumped.

[   11.802932] ath11k c000000.wifi: ipq8074 hw2.0
[   11.802966] ath11k c000000.wifi: FW memory mode: 0
[   11.840154] remoteproc remoteproc0: powering up cd00000.q6v5_wcss
[   11.840500] remoteproc remoteproc0: Booting fw image IPQ8074/q6_fw.mdt, size 668
[   12.995084] remoteproc remoteproc0: remote processor cd00000.q6v5_wcss is now up
[   13.038781] ath11k c000000.wifi: qmi fail to get qcom,m3-dump-addr, ignore m3 dump mem req
[   13.046243] ath11k c000000.wifi: chip_id 0x0 chip_family 0x0 board_id 0xff soc_id 0xffffffff
[   13.046280] ath11k c000000.wifi: fw_version 0x290b84a5 fw_build_timestamp 2024-09-23 11:32 fw_build_id WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1
[   13.134952] ath11k c000000.wifi: qmi failed to load CAL data file:cal-ahb-c000000.wifi.bin
[   13.135071] ath11k c000000.wifi: failed to load board data file: -12
[   31.844667] l11: disabling
[   38.794640] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[   74.724671] ath11k c000000.wifi: Coldboot Calibration timed out

I feel dumb I copied the caldata field from another device so it was in alphabetical order and the partition name case was incorrect so I did not know it was case sensitive so it could not find the cal partition

1 Like

hey, I'd just like to say this target has now been merged into OpenWrt thanks everyone for the help!!!!

3 Likes

Hi, just a note — I also collected full logs for the AmpliFi Alien (same SoC IPQ8074A) if you want extra test cases.

If you start a new thread for your device I can attempt to help add support for your device.

I actually enjoyed the learning on my device and was going to buy another device to port across :slight_smile:

If you can get dumps of the partitions and source a factory image and the gpl sources from the manufacturer and post them in your thread.

1 Like

Thanks a lot!
Here’s my thread for the AmpliFi Alien where I posted full logs, system dump, and all available information:
[(UniFi) (Ubiquiti) (Ubnt) (device-support) (ipq8074) (ipq807x) IPQ8074A: Add Support for Ubiquiti AmpliFi Alien Router]

Really appreciate your help!