Porting guide ar71xx to ath79?

Yeah, the same files are there.

root@OpenWrt:/lib/firmware/ath10k/QCA988X/hw2.0# ls
board.bin       firmware-5.bin

I fixed it, 5g is now working. I had to change /etc/hotplug.d/firmware/11-ath10k-caldata. Will be testing the build to see how everything is working.

I'm glad, but I told you earlier to use case under cal-pci-0000:00:00.0.bin, maybe is better to put the name in quotation mark like "tplink,archer-c7-v2") as all the other scripts they are using quotation

I changed the switch statement to use quotation marks.
What should I do next, create a pull request on github?

Yes, or maybe you can wait for the irq cascade driver to be reworked and then rebase the PR to depend on that https://github.com/openwrt/openwrt/pull/1055

did you do a torrent test ?
I tried one in a dual wan config and is crashing after few seconds, no more internet traffic, maybe the patch that solved this issue before was not well ported

edit
the pppoe seems to crash the router, with the other, all is fine

Anybody got idea how to properly configure built in port in AR7242?
Its really weird,if I set it to be registered and 18 with phy mask of 18 it gets detected at 12.
But if I configure it to 12 it does not get detected at all.

And even if it is detected link is detected as down.
And fixed-link makes it to not getected again.

Do you have a link to the source where you get your information?

phy-mask is a mask and is in hex... This would be port 3 and 4 if iĀ“m right. All above 5 is abnormal i think...
Do you have a bootlog of ar71xx openwrt?

Sure,there is pretty much zero information on the eth1 built in port.
Only thing I was able to find is this:http://openwrt-devel.openwrt.narkive.com/6JxKuaZu/patch-ar71xx-allow-for-activation-of-second-mdio-bus-in-ar7242-ag71xx-driver

There is full datasheet available here:https://github.com/Deoptim/atheros/blob/master/AR7242_nowatermark.pdf

At page 24 there is block diagram and info on the built in port.
There is no ar71xx bootlog since this device was never supported before

Mr. @lucize. Do you have some free time for porting the TP-Link TL-WR2543ND to the new ath79 profile?, I can build firmwares from your repo, test and provide information that you need from this device, my device have hackpascal's breed bootloader, so I'm not afraid to break this device a couple of times. Here is some info that maybe could be useful for initial porting.

[    0.000000] Linux version 4.9.102 (valkyria@Valkyria-Z) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7054-64b53247c4) ) #0 Mon May 28 21:53:15 2018
[    0.000000] MyLoader: sysp=00000100, boardp=00002000, parts=00400000
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7242 rev 1
[    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] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 804541b4, node_mem_map 81000020
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line:  board=TL-WR2543N  console=ttyS0,115200 rootfstype=squashfs noinitrd
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    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=0005f860
[    0.000000] Readback ErrCtl register=0005f860
[    0.000000] Memory: 59960K/65536K available (3160K kernel code, 171K rwdata, 720K rodata, 292K init, 213K bss, 5576K 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] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:40.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000013] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.007982] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.090714] pid_max: default: 32768 minimum: 301
[    0.095528] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.102194] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.112971] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.122906] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.129894] NET: Registered protocol family 16
[    0.136476] MIPS: machine is TP-LINK TL-WR2543N/ND
[    0.173465] registering PCI controller with io_map_base unset
[    0.437360] PCI host bridge to bus 0000:00
[    0.441578] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[    0.448494] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.454115] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.460948] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.468970] pci 0000:00:00.0: [168c:0030] type 00 class 0x028000
[    0.468983] pci 0000:00:00.0: invalid calibration data
[    0.474195] pci 0000:00:00.0: reg 0x10: [mem 0x10000000-0x1001ffff 64bit]
[    0.474288] pci 0000:00:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    0.474372] pci 0000:00:00.0: supports D1
[    0.474387] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.474674] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[    0.474712] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1001ffff 64bit]
[    0.482129] pci 0000:00:00.0: BAR 6: assigned [mem 0x10020000-0x1002ffff pref]
[    0.489403] pci 0000:00:00.0: using irq 40 for pin 1
[    0.495369] clocksource: Switched to clocksource MIPS
[    0.501961] NET: Registered protocol family 2
[    0.507581] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.514620] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.521089] TCP: Hash tables configured (established 1024 bind 1024)
[    0.527653] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.533552] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.540241] NET: Registered protocol family 1
[    0.544679] PCI: CLS 0 bytes, default 32
[    0.550349] Crashlog allocated RAM at address 0x3f00000
[    0.556943] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.573701] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.579611] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.600310] io scheduler noop registered
[    0.604271] io scheduler deadline registered (default)
[    0.610012] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.617015] console [ttyS0] disabled
[    0.640647] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 12500000) is a 16550A
[    0.649433] console [ttyS0] enabled
[    0.656451] bootconsole [early0] disabled
[    0.668933] m25p80 spi0.0: found s25sl064p, expected m25p80
[    0.674563] m25p80 spi0.0: s25sl064p (8192 Kbytes)
[    0.680448] 5 tp-link partitions found on MTD device spi0.0
[    0.686106] Creating 5 MTD partitions on "spi0.0":
[    0.690938] 0x000000000000-0x000000020000 : "u-boot"
[    0.697898] 0x000000020000-0x00000016ef14 : "kernel"
[    0.705029] 0x00000016ef14-0x0000007f0000 : "rootfs"
[    0.712234] mtd: device 2 (rootfs) set to be root filesystem
[    0.718058] 1 squashfs-split partitions found on MTD device rootfs
[    0.724284] 0x000000710000-0x0000007f0000 : "rootfs_data"
[    0.731863] 0x0000007f0000-0x000000800000 : "art"
[    0.738865] 0x000000020000-0x0000007f0000 : "firmware"
[    0.746971] rtl8367 rtl8367: using GPIO pins 1 (SDA) and 6 (SCK)
[    0.753639] rtl8367 rtl8367: RTL8367R ver. 0 chip found
[    2.595482] random: fast init done
[    2.847689] libphy: rtl8367: probed
[    2.852067] libphy: Fixed MDIO Bus: probed
[    3.487464] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[    3.495774] NET: Registered protocol family 10
[    3.504273] NET: Registered protocol family 17
[    3.509024] 8021q: 802.1Q VLAN Support v1.8
[    3.522987] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    3.532527] Freeing unused kernel memory: 292K
[    3.537035] This architecture does not have kernel memory protection.
[    4.679385] init: Console is alive
[    4.683082] init: - watchdog -
[    7.156372] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    7.517725] usbcore: registered new interface driver usbfs
[    7.523369] usbcore: registered new interface driver hub
[    7.528932] usbcore: registered new device driver usb
[    7.542302] exFAT: Version 1.2.9
[    7.588940] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    7.609054] SCSI subsystem initialized
[    7.619357] ehci-platform: EHCI generic platform driver
[    7.624769] ehci-platform ehci-platform: EHCI Host Controller
[    7.630638] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[    7.640787] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[    7.675421] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[    7.682941] hub 1-0:1.0: USB hub found
[    7.687195] hub 1-0:1.0: 1 port detected
[    7.697122] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    7.705309] ohci-platform: OHCI generic platform driver
[    7.714013] uhci_hcd: USB Universal Host Controller Interface driver
[    7.726524] usbcore: registered new interface driver usb-storage
[    7.733389] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    7.743318] init: - preinit -
[    9.380889] eth0: link up (1000Mbps/Full duplex)
[    9.415547] random: procd: uninitialized urandom read (4 bytes read)
[   12.601969] mount_root: loading kmods from internal overlay
[   12.670054] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[   12.680392] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[   13.509049] jffs2: Empty flash at 0x00091df8 ends at 0x0009fd08
[   13.515083] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0009fd08: 0xffff instead
[   13.532130] jffs2: notice: (417) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   13.548333] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[   13.560118] block: extroot: not configured
[   13.606399] jffs2: notice: (415) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   13.869517] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[   13.881140] block: extroot: not configured
[   13.886746] mount_root: switching to jffs2 overlay
[   13.961987] urandom-seed: Seeding with /etc/urandom.seed
[   14.231156] eth0: link down
[   14.250058] procd: - early -
[   14.253085] procd: - watchdog -
[   15.200552] procd: - watchdog -
[   15.204061] procd: - ubus -
[   15.423521] random: ubusd: uninitialized urandom read (4 bytes read)
[   15.439204] random: ubusd: uninitialized urandom read (4 bytes read)
[   15.446311] random: ubusd: uninitialized urandom read (4 bytes read)
[   15.453944] procd: - init -
[   16.288733] kmodloader: loading kernel modules from /etc/modules.d/*
[   16.357453] ntfs: driver 2.1.32 [Flags: R/O MODULE].
[   16.377428] tun: Universal TUN/TAP device driver, 1.6
[   16.382522] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[   16.400486] Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[   16.437605] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   16.480560] cryptodev: driver 1.9 loaded.
[   16.526102] fuse init (API version 7.26)
[   16.571623] Loading modules backported from Linux version wt-2017-11-01-0-gfe248fc2c180
[   16.579748] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d
[   16.621566] ip_tables: (C) 2000-2006 Netfilter Core Team
[   16.638263] usbcore: registered new interface driver ipheth
[   16.671018] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   16.771952] usbcore: registered new interface driver usblp
[   16.807396] xt_time: kernel timezone is -0000
[   16.815330] usbcore: registered new interface driver cdc_ether
[   16.859152] usbcore: registered new interface driver dm9601
[   16.926935] usbcore: registered new interface driver mt7601u
[   16.941582] PPP generic driver version 2.4.2
[   16.954626] NET: Registered protocol family 24
[   16.963040] usbcore: registered new interface driver rndis_host
[   16.989174] usbcore: registered new interface driver rt73usb
[   17.013558] usbcore: registered new interface driver sr9700
[   17.028138] usbcore: registered new interface driver zd1211rw
[   17.081951] usbcore: registered new interface driver rt2500usb
[   17.105892] usbcore: registered new interface driver rt2800usb
[   17.134707] usbcore: registered new interface driver rtl8192cu
[   17.164679] ath: EEPROM regdomain: 0x0
[   17.164691] ath: EEPROM indicates default country code should be used
[   17.164696] ath: doing EEPROM country->regdmn map search
[   17.164716] ath: country maps to regdmn code: 0x3a
[   17.164724] ath: Country alpha2 being used: US
[   17.164729] ath: Regpair used: 0x3a
[   17.178695] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   17.185319] ieee80211 phy0: Atheros AR9300 Rev:3 mem=0xb0000000, irq=40
[   17.436879] kmodloader: done loading kernel modules from /etc/modules.d/*
[   19.576844] urandom_read: 5 callbacks suppressed
[   19.576856] random: jshn: uninitialized urandom read (4 bytes read)
[   36.739675] eth0: link up (1000Mbps/Full duplex)
[   36.744454] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   36.777578] br-lan: port 1(eth0.1) entered blocking state
[   36.783029] br-lan: port 1(eth0.1) entered disabled state
[   36.789112] device eth0.1 entered promiscuous mode
[   36.793940] device eth0 entered promiscuous mode
[   36.823269] br-lan: port 1(eth0.1) entered blocking state
[   36.828784] br-lan: port 1(eth0.1) entered forwarding state
[   36.834615] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   37.785754] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   37.792779] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   42.135699] ath: EEPROM regdomain: 0x809e
[   42.139747] ath: EEPROM indicates we should expect a country code
[   42.145916] ath: doing EEPROM country->regdmn map search
[   42.151257] ath: country maps to regdmn code: 0x50
[   42.156087] ath: Country alpha2 being used: TW
[   42.160558] ath: Regpair used: 0x50
[   42.164066] ath: regdomain 0x809e dynamically updated by user
[   44.409304] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   44.441138] br-lan: port 2(wlan0) entered blocking state
[   44.446567] br-lan: port 2(wlan0) entered disabled state
[   44.452497] device wlan0 entered promiscuous mode
[   47.863162] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   47.869850] br-lan: port 2(wlan0) entered blocking state
[   47.875236] br-lan: port 2(wlan0) entered forwarding state
[   79.295468] random: crng init done
cat /proc/mtd

dev:    size   erasesize  name
mtd0: 00020000 00010000 "u-boot"
mtd1: 0014ef14 00010000 "kernel"
mtd2: 006810ec 00010000 "rootfs"
mtd3: 000e0000 00010000 "rootfs_data"
mtd4: 00010000 00010000 "art"
mtd5: 007d0000 00010000 "firmware"

cat /proc/interrupts

           CPU0       
  3:          0      MIPS   3  ehci_hcd:usb1
  4:   16653856      MIPS   4  eth0
  7:   17623074      MIPS   7  timer
 11:         26      MISC   3  serial
 40:   22486365  AR724X PCI    0  ath9k
ERR:       5337

you don't have to break it :slight_smile:
you can use tftboot and bootm to boot the initramfs image until everything is working and only after that you need to write the image to flash
I could look at it..

@Mynzer try this https://github.com/lucize/openwrt/tree/TL-WR2543ND

use

tftpboot 0x81000000 openwrt-ath79-generic-tl-wr2543-v1-initramfs-kernel.bin
bootm 0x81000000

Wow, that was fast :grin:, let me compile the new firmware. @lucize Do you need some specific information from the device once that the new firmware is running?

at least dmesg if something is not running, I'm not so sure about wifi leds, or wifi itself, but try it and let's see

Hey there,
i saw the uap-ac-lite and lr went in and was wondering if there was a specific reason not to include the pro version.

Afaik it only has a different 5ghz module / usb and QCA8334-AL3C as ethernet NIC.

Kind regards
MartB

sorry, I don't have one, so I couldn't test it..

I can act as a volunteer then!
If you have a semi working Device Tree i can try it.

(im not really capable enough to create a device tree myself otherwise i would have tried already.)

maybe after I sleep a bit :smiley:

haha, sure no reason to rush it!
Have a good night.

Thanks for your effort.

@MartB try this https://github.com/lucize/openwrt/tree/ath79-unifiac-pro
you should to a tftpboot and a bootm like the example I put earlyer