Adding OpenWrt support for QNAP QHora-301W

I don't understand, just followed the instructions from the commit message after backuping everything from a running OpenWrt initramfs.

1 Like

@kirdes Am I wrong or does the stock FW use different FW for the first and second AQR-s?

Yes they are slightly different (according to a diff)
But in u-boot there is no way to load different firmwares, right?

And we still have no way to load the firmware from userspace.

Yes, there is currently no way for loading different FW.
The issue with the userspace tool is that it's using IOCTL-s for MDIO read/write-s.
This is problematic as MDIO IOCTL-s are like half-implemented in reality, have no C45 support at all and depend on the MDIO device being attached to a network device, so like the worst possible solution.

Hi @valvince

Could you clarify if the 2 10G ports work in your case? Do both ports function normally as WAN or LAN when connected to 1G devices?

And did you encounter any issues while building the ipq807x-5.15 branch? I was made to understand that this is not the recommended branch but looks promising since it runs a more recent kernel version

Hi @TempestJunior

Regarding 10g ports :

  • 10G-2 is by default used as a wan port. It's currently connected to the 2.5G port of my ISP's box/modem
  • 10G-1 is properly working (currently writing this message down connected to it :D) connected to a basic non manageable 1G switch

Regarding compilation it didn't work until I found information about the current non working state of some kmod-qca-nss packages in this branch in the xiaomi ax3600 thread
I had to manually edit the .config file to comment some kmod-qca-nss lines (if I remember well but I'm not sure) as some of them couldn't be disabled through TUI:

CONFIG_PACKAGE_kmod-qca-nss-drv-bridge-mgr

After that it worked.
I have a very basic usage of it, and honestly know pretty nothing about network but so far so good. I've been using it for 3 days as the main routeur, using ethernet, wifi6, 5g and 2.4g wifi networks and nothing to complain about so far.

2 Likes

this is what I see in default fw

# cat /usr/share/10G_FW/uploadfm
#upload 10G AQR113C-B0 FM

aq-fw-download AQR-G4_v5.4.C-AQR_CIG_WF-1945_0x0_ID44778_VER1630.cld miireg 0
sleep 1
aq-fw-download AQR-G4_v5.4.C-AQR_CIG_WF-1945_0x8_ID44776_VER1630.cld miireg 8
sleep 1
ssdk_sh debug phy set 0 0x4004c441 0x8
ssdk_sh debug phy set 8 0x4004c441 0x8

Yeah, I know, they are loading different FW per PHY.
Unfortunately, currently we have no way of loading the PHY FW from Linux

I added permanent access to fw like this (after wps)
in /etc/rc.d create a file like
S99ssh_access

#!/bin/sh /etc/rc.common

START=99

start() {
         /sbin/iptables -I INPUT -p tcp --dport 22220 -j ACCEPT
        /etc/init.d/dropbear restart
}

/usr is read only, with rc.d you can customize the firmware, also beware that /var/log is writing a lot on the flash, fist thing should be to create a tmpfs on that

cat /etc/rc.d/S00tmpfs
#!/bin/sh /etc/rc.common

START=00

start() {
         /bin/mount -F -o noatime,nodev -t tmpfs tmpfs /var/lock
         /bin/mount -F -o noatime,nodev -t tmpfs tmpfs /var/log
         /bin/mount -F -o noatime,nodev -t tmpfs tmpfs /var/state
}
1 Like

Quick question, is there a need to restore the "/dev/mtd10" partition when returning back to stock firmware?

There shouldnt as the PHY FW is loaded from userspace anyway

1 Like

Thanks @robimarko

Regarding this entry: setenv "'bootcmd aq_load_fw 0 && aq_load_fw 8 && bootipq'"

Would there be a need to role back to the stock bootcmd env value?

I suppose it would be smart as stock FW loads the AQR FW from userspace.
Stock bootcmd is probably just bootipq

1 Like

@kirdes Spent some time debugging the userspace loader, it wasn't actually its fault at all as its just using IOCTL-s for PHY read/write.
The kernel has split the IOCTL ops for the ethernet/PHY-related IOCTL into a new op and obviously, NSS-DP didn't implement that.

Fixed that, cleaned up the loader and you can now load the FW from userspace.
It's been added to the NSS packages feed and pushed.
Unfortunately, the right 10G port still doesn't really work in 1G mode.

BTW, the register that they are tweaking using the SSDK tool is:
4.C441 PHY XS Transmit (XAUI Rx) Reserved Vendor Provisioning 2

And as far as I can tell, its enabling: USX Autoneg Control For MAC

Another docs says: 4.C441 3 USXGMII Enable

1 Like

that's mean that we don't need to load the firmware from u boot anymore?

Yes, its now possible to load it from userspace as well.

Though its currently easier to let U-boot load the FW as even when loading the per PHY FW from the stock FW nothing really changed

1 Like

That's great, but another strange thing that the right 10G port still doesn't work with 1G link speed.
Do you use the 2 different stock firmwares?

P.S.
in the init script they poweroff the switch ports via ssdk_shell after the firmware upload

#poweroff physical switch port
	MAXPORT=`/sbin/swconfig dev switch0 show | /bin/awk '/Port [1-9]+ /{maxport=$3}END{print maxport;}'`
	for p in `/bin/seq ${MAXPORT}`;
	do
	   /sbin/ssdk_sh port poweroff set ${p}
	done

No clue why....

Yeah, I used the same ones they use in stock FW.
No idea why would they disable the switch ports, but they are doing that after SSDK is loaded as well.

firmware loading from user space isn't working for me

aq-fw-download /lib/firmware/AQR-G4_v5.4.C-AQR_CIG_WF-1945_0x8_ID44776_VER1630.cld miireg 8
SIOCSMIIREG on miireg failed: Not supported
SIOCSMIIREG on miireg failed: Not supported
SIOCGMIIREG on miireg failed: Not supported
SIOCGMIIREG on miireg failed: Not supported
Scratchpad Read/Write test fail

Am I missing something?

You have to replace miireg with the ethernet interface name that the PHY is attached to.
eth5 is for PHY addr 0 and eth4 is for PHY addr 8 as far as I remember.

You can see with ethtool what the PHY addr that is attached to a certain interface.
miireg was some kind of a fake interface as far as I can figure out.