Adding FPU support for Asus RT-AX53U

I was installing Debian using this guide
https://openwrt.org/docs/guide-user/services/chroot

Unfortunately the install fails every time
The follwing command fails:
debootstrap --arch=mipsel bullseye /mnt/usb-drive http://ftp.de.debian.org/debian

Error
/mnt/usb-drive//var/ 100% |*******************************| 88748 0:00:00 ETA
Download completed (88748 bytes)
Illegal instruction

The cause
After researching the issue, it looks like FPU not being enabled is the cause of the error. It's not displayed in the "/sys/kernel/debug/mips" directory which indicates it's not available.

Source: https://www.mail-archive.com/debian-mips@lists.debian.org/msg10581.html

adguardhome
Currently the "adguardhome" package is installed as DNS filter, but it uses way too much RAM. I solved it by adding fast USB storage and mounted it as SWAP. It works, but adguardhome using about 200MB RAM when updating the blocklists is too much and it takes forever (500.000 domains about 5 minutes).

Pi-Hole
After booting without adguardhome there is about 140MB RAM available. Running Debian with minimal packages and install Pi-Hole would need abount 140MB RAM:
» Debian 128MB recommended
» Pi-Hole 22MB (amount RAM it uses running in WSL2 on Windows with 3.000.000 domains blocked

Pi-Hole doesn't use a littlebit to no extra RAM when updating the blocklists, so it running Pi-Hole on the Asus RT-AX53U should be possible. Whenever a littlebit more storage is needed the SWAP storage will be available.

My request
Is it possible to add FPU support for the Asus RT-AX53U? It looks like it's changing only 1 settings when building the next release. Or do I have to build my own image?

How to build
» https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem
» https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem

From what I can find MT7621 does not have a FPU. You can't add support for something that's not there.

This topic might interest you though:

mt7621 doesn't have a hardware FPU, and the software emulated FPU support is buggy and extremely slow (what takes a few seconds on a real FPU may take hours under emulation). As nothing in OpenWrt requires FPU support, it's disabled (enabling it requires considerable space - and as mentioned, it's barely usable anyways).

If you want it, you will have to recompile from source with the kernel option enabled, but it's intentionally disabled for OpenWrt (and will remain disabled).

The Asus RT-AX53U has a MediaTek MT7621 CPU which has a 1004kc kernel.

According to the datasheets FPU should be supported:
https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00745-2B-CMP-DTS-01.03.pdf
https://deviwiki.com/wiki/MIPS32#MIPS32_1004Kc_.2F_1004Kf
https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00638-2B-1004K-PRG-01.20.pdf

a) you're reading too much into the term "optional".
b) for mt7621a, we're talking about 1004Kc, not 1004Kf.

1 Like

1004kc does not have the HW floating point unit, only the kf variant does.

There's no benefit to enabling the FPU emulator, and code will not run any faster.

I've only seen a couple of use cases where MIPS needs it, and those are being addressed upstream - mostly around node.js, which is also a problem for ARM cores that do not have FPU hardware (some cortex-A9's for example over in MIPSEL land)

The exception that I've noted earlier is that MIPS doesn't denormalized numbers with the HW fpu, and the kernel knows this, so it will do those in software.

1 Like

Thank you for the feedback.

I found an old Android phone:

  1. installed the "Linux deploy" app
  2. installed Debian 10 Buster
  3. upgraded to Debian 11 Bullseye
  4. installed AdGuardHome
  5. set the phone as DNS server in OpenWrt

So far no issues.