Dynalink DL-WRX36 Askey RT5010W IPQ8074 OpenWrt support

I've created a rough draft script that can be run on the stock OS to download and flash OpenWrt from u-boot without user interaction. This also adds a crude bootcounter - from what I have seen (and I may be wrong), the device's u-boot doesn't have bootcount capability enabled - so as to switch partitions after 3 boot failures, and then to tftp recovery if booting on both partitions fails 3 times.

Still in draft so please don't run it, however it would be good if someone with UART can test manually. Also not 100% sure if all the variables at the top of the list are necessary. bootargs can also be shortened.

Using the bootcounter also requires bootcount to be reset to 0 here.

1 Like

I apologise for my ignorance but on the script you are mixing uboot hush with openwrt fw_setenv will this mix work? ... have you tested?

@robimarko reporting that i applied the recent ath11k patch issued on the ax3600 forum and all fine so far (as in my ax3600 as well) no noticeable improvements as there will be more. This device is so much better

The idea is that the user runs this script from the stock OS that saves everything to the ubootenv. Next time the router boots it uses this env. In this case it's set up to perform a tftp recovery that will install OpenWrt, after which it will boot from the NAND based on the change of the active variable.

Haven't tested on this device but I have something very similar on another device.

I don't have stock firmware anymore but how will this work ? openwrt and u-boot ... like the below

fw_setenv bootlinux 'ubi read 0x44000000 kernel 0x80000000 &&
bootm 0x44000000#config@rt5010w-d350-rev0'

This creates an environment variable called bootlinux, with the content as in the single quotes. fw_setenv performs the same actions as setenv followed by saveenv in u-boot. If you look at bootcmd, it contains run bootlinux that will run the content of bootlinux when called.

@rmandrad or anyone else has UART access, could you please test the u-boot env script? Running from an existing OpenWrt installation is fine. I have modified it to not run recovery on next boot so it won't wipe the existing installation. Just need to make sure there are no issues. I don't have a suitable connector here so can't confirm.

at the moment I can't as the device is in production and actually doing so well :slight_smile: that I replaced the ax3600 for the 5ghz channel ...don't want mess anything if testing fails... your logic seems fine though ...

do you know if there is way to back up the uboot env variables ? i am unsure on which mtd they are stored.

@thorsten97 you were earlier moving from stock to openwrt. Are you able to test @clayface uboot script?

if testing failed you would need to restore in u-boot:

env default -a

Then you can apply your previous changes before saving everything, eg:

bootargs=ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs
mtdparts=mtdparts=nand0:0x6100000@0x1000000(fs),0x6100000@0x7a00000(fs_1),
mtdids=nand0=nand0
setpartfs=ubi part fs;ubi read 0x44000000 kernel 0x80000000
setpartfs1=ubi part fs_1;ubi read 0x44000000 kernel 0x80000000
bootcmd=run setpartfs;bootm 0x44000000#config@rt5010w-d350-rev0
saveenv
2 Likes

can check it tomorrow! :slight_smile:

how can we go back to the stock firmware?
A binary is posted in this thread but how do I write it to the nand??

I would prefer to test your script with the stock firmware to demonstrate that it is usable for new users ..

The same way you wrote openwrt to the flash.
Boot initramfs and use ubiformat.

1 Like

I was able to get UART access and fixed some issues with the install script.

There is one issue that I haven't worked out, but doesn't prevent installation:

IPQ807x# tftpboot 0x44000000 ${factoryimg}
ipq807x_eth_halt: done
eth0 PHY0 Down Speed :10 Half duplex
eth0 PHY1 Down Speed :10 Half duplex
eth0 PHY2 Down Speed :10 Half duplex
eth0 PHY3 up Speed :1000 Full duplex
eth0 PHY4 Down Speed :10 Half duplex
eth0 PHY5 Down Speed :10 Half duplex
ipq807x_eth_init: done
Using eth0 device
TFTP from server 192.168.1.10; our IP address is 192.168.1.250
Filename 'openwrt-ipq807x-generic-dynalink_dl-wrx36-squashfs-nand-factory.ubi'.
Load address: 0x44000000
Loading: *
Got TFTP_OACK: TFTP remote port: changes from 69 to 59542
#################################################################
      ...
         #########################################
         3.6 MiB/s
done
Bytes transferred = 22544384 (1580000 hex)
ipq807x_eth_halt: done
IPQ807x# imxtract 0x44000000 ubi
Invalid image type for imxtract

I am wondering if imxtract has been modified to look for a custom header? Either way, this correclty exposes $fileaddr and $filesize that are used by nand write and everything subsequent works as it should.

@robimarko do you have any views on using this install script or a variation of it for the install method?

I dont really have an opinion right now, haven't touched the Dynalink in a while.

imxtract and all other image commands only work on FIT images.
We can actually do what QCA does and that is make a FIT image with a installation script inside

any chance of syncing your repo with the openwrt master (just seen you have done it for ax3600)?

so far all working fine with this device for my use case apart from the reverse order of lan/wan devices that I reported earlier but not a showstopper. All else stable, memory etc ...

Cant really tell you when I will get to it

System works fantastic! The only thing that does not work on my side is sysupgrade. I always need to tftp the initramfs and ubiformat the factory image ...

I am also not able to switch to mtd20, my system is constantly booting from mtd18 no matter what I do ...

root@OpenWrt:~# fw_printenv 
baudrate=115200
bootargs=ubi.mtd=rootfs root=mtd:ubi_rootfs rootfstype=squashfs
bootdelay=23
eth1addr=a4:97:33:df:9a:5f
eth2addr=a4:97:33:df:9a:5f
eth3addr=a4:97:33:df:9a:5f
eth4addr=a4:97:33:df:9a:5f
ethact=eth0
ethaddr=a4:97:33:df:9a:5e
fdt_high=0x4A400000
fdtcontroladdr=4a971480
flash_type=2
machid=8850105
mtddevnum=0
mtdids=nand0=nand0
mtdparts=mtdparts=nand0:0x6100000@0x7a00000(fs),0x6100000@0x1000000(fs_1),
partition=nand0,0
setpartfs=ubi part fs;ubi read 0x44000000 kernel 0x80000000
setpartfs1=ubi part fs_1;ubi read 0x44000000 kernel 0x80000000
soc_version_major=2
soc_version_minor=0
stderr=serial@78B3000
stdin=serial@78B3000
stdout=serial@78B3000
active=1
bootlinux=ubi read 0x44000000 kernel 0x80000000
bootcmd=run setpartfs;bootm 0x44000000#config@rt5010w-d350-rev0

if I change

bootcmd=run setpartfs;bootm 0x44000000#config@rt5010w-d350-rev0

to

bootcmd=run setpartfs1;bootm 0x44000000#config@rt5010w-d350-rev0

it is still useing mtd18 to boot. No idea what I am doing wrong?

1 Like

completely agree! this is such a good device, stable and performant.

check this approach that changes the target/linux/ipq807x/base-files/lib/upgrade/platform.sh Dynalink DL-WRX36 Askey RT5010W IPQ8074 OpenWrt support - #139 by rmandrad the script is using the uboot variables I defined.

however I feel @clayface approach on the uboot is much more elegant ... still I think the platform.sh will need to be changed in order to set the active partition. plus there is what @robimarko suggested @ Dynalink DL-WRX36 Askey RT5010W IPQ8074 OpenWrt support - #177 by robimarko

this is what I get using the wlan0

memory

So, somehow I can't get ethtool to list settings

ethtool eth4
Settings for eth4:
Cannot get device settings: No such device
        Link detected: yes

ifconfig eth4
eth4      Link encap:Ethernet  HWaddr  
          inet6 addr:  Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:9000  Metric:1
          RX packets:17266361 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9762275 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:19378113137 (18.0 GiB)  TX bytes:10382685631 (9.6 GiB)
          Base address:0x7000

anyone having this issue? thx