Porting guide ar71xx to ath79?

Here is output from dmesg -n 8

reset button would not work
I could only recover it by using initramfs and wrote the ar71xx sysupgrade image
what could be the problem ? I used this:

  IMAGE_SIZE := 15552k
  DEVICE_TITLE := TP-LINK TL-WR1043N/ND v4
  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
  TPLINK_HWID := 0x10430004
  TPLINK_BOARD_ID := TLWR1043NDV4
  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory

Well,if you have serial console then you can call the tftp recovery function in U-boot

obviously I used the serial console :slight_smile:

but wonder why the image is not generated as it should

Hm,that is weird.

I found some tswconf utility by UBNT for debugging.
It enables reading register values.
Will simply copy those to DTS

Without a complete GPL source or a existing mach-file this would be hard...
Kernel log of stock fw did´t help here.

Does it not work in openwrt?
Probably interrupt driven gpios did not work...
Try "gpio-keys-polled" as compatible.

no, for recovery, in openwrt all is working

I'm trying now the exact image creation like on ar71xx to see if will work
tftboot instructions for v2 and v3 I think are not ok for v4
but if I write from tft it will give me Stream with EOS marker is not supported
write from sysupgrade will give me Too big uncompressed stream

Digged the values using the ubnt utility and it appears to be working.
Even LEDs.

Now gotta figure out how to enable the built in port and then figure out GPIO combinations from 2 74HC595s.
One is for enabling MOSFETs and other one looks to be enabling POE LEDs

ok, I solved the v4, it needed the KERNEL directive

Thank's for the outputs. Looks like the same problem as mine. Like I stated before, I'll do a post on ML and wait for feedback.

@lucize First of all, thanks for the hard work, I'm testing it on a wr1043nd v4 and for the moment everything has been wonderful

did you tried my last qca9557.dtsi pr ? it should solve the usb and wifi problems

and for ath10k, maybe is like ubiquiti pr

Still can't get it to work though. Dmesg here.
I also updated my git tree.

I see that you have error -22, so cal-data is not loaded, the board has compatible = "tplink,archer-c7-v2", "qca,qca9558"; defined, is cat /tmp/sysinfo/board_name returning archer-c7 as defined in 11-ath10k-caldata ? change the script to "tplink,archer-c7-v2"

but ath9k should have worked, strange

[   28.475873] ath9k 18100000.wmac: failed to initialize device
[   28.481653] ath9k: probe of 18100000.wmac failed with error -5

is it working without pcie enabled ?

also is kmod-usb2 enabled in menuconfig ?

// linux,default-trigger = "phy1tpt"; should be for 2.4g and phy0tpt for 5g

edit:
also from dmesg the address for ath10k is cal-pci-0000:00:00.0.bin not cal-pci-0000:01:00.0.bin
you don't need the

			nvmem-provider;
			#address-cells = <1>;
			#size-cells = <1>;

in art

edit2:
[ 0.389030] m25p80 spi0.0: w25q128 (16384 Kbytes)
I see that https://wikidevi.com/wiki/TP-LINK_Archer_C7_v2.x had 16mb so maybe the flash partitions are not correctly set up so the art is at another location, do you have a dmesg for ar71xx target ? or cat /proc/mtd so you can see the size of the partitions

the 1043v4 16mb has the art like

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

@lucize

First, I have a ar71xx dmesg here.

Changing the art to the 1043v4 snippet seems to do the trick, as 2.4g is now functioning.

cat /tmp/sysinfo/board_name returns tplink,archer-c7-v2, so I changed that in 11-ath10k-caldata. (see dmesg for current log)

kmod-usb2 was not enabled. The first usb port seems to be working. I tried adding the following snippet for the second one, but no luck so far.

&usb1 {
        status = "okay";

        hub_port1: port@1 {
                reg = <1>;
                #trigger-source-cells = <0>;
        };
};

Dmesg here

Firstoff I liked better the dmesg with white on black :smiley:

the cal-data searches for art partition, but I was sure you will get only the address from my example (but I had doubts :slight_smile: )
ath10kcal_extract "art" 20480 2116 so you also renamed the art to ART and the userspace is not reading from dts so it will try for art but you have ART, and adjust the firmware length too
[ 0.411866] 0x000000020000-0x0000007f0000 : "firmware"
vs ar71xx
[ 0.967298] 0x000000020000-0x000000ff0000 : "firmware"
I think FD0000
for usb you need to also enable the phy with address 0x1b400000

@robimarko do you have time to test the UAP ? like if the image generated is working ?
I had mine with original firmware and I don't know yet if I should write openwrt on it
Thanks

OK,can test it today or tommorow

After enabling usb_phy1 the other port also works now, thanks!

No luck with the 5g wifi though. I noticed the pci device code is different.
ath79

[   12.055603] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)

ar71xx

[   10.793238] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)

Full dmesg

Still the caldata is not doing it's stuff, did you verified that the firmware is built-in? /lib/firmware /