Help Needed on Porting bcm53xx arm Asus RT-AC88U

Update:

This router will be on the official OpenWrt trunk soon. Only the DSA driver for the rtl8365mb switch is left to work on.

Here's the OpenWrt 21.02.0 image for Asus RT-AC88U:


I'm working on porting OpenWrt for Asus RT-AC88U router.
Track the progress here:

Port is being worked on this repository:

Specifications of the router

CPU: Broadcom BCM4709C0
Platform: bcm53xx arm
Switch: 4GbE BCM4709C0 + 4GbE Realtek RTL8365MB
Wireless: Broadcom BCM4366C0
128MB NAND
512MB RAM


OpenWrt bootlog: https://pastebin.com/7EK0aMVM
Asuswrt bootlog: https://pastebin.com/s1sx3cFZ


Realtek Switch and Broadcom Wireless only have proprietary closed source drivers. Is it legally possible to include these drivers in the OpenWRT repository? It's been figured out.

I'm pretty much new to everything. Thanks to the OpenWRT Wiki, I was able to quickly take a grasp of how to create patches and port devices.
After putting up a DTS patch, I was able to successfully boot OpenWRT. Thanks to @svanheule for leading me in the right direction.

Memory and Partitioning

I took shortcuts on specifying partitions and memory without really understanding what I'm doing. Not anymore.
Let me know if there's anything wrong with memory and partitions.

GPIO

I was able to specify GPIOs using the GPIO scripts from the OpenWrt Wiki.

Check the current device tree and let me know if there're GPIOs for LEDs and buttons missing.

I couldn't find GPIOs for white wan, white 2.4 & 5 GHz wireless LEDs. I suspect wireless LEDs are controlled by the wireless firmware. If anyone figure these out, let me know.

Is there a specific naming scheme to GPIO LED and key names?
Where can I find examples like "bcm53xx:white:lan"?
I have put up some "linux,code" entries by looking at device trees of other bcm53xx devices.
Is there a place I can find the "linux,code" commands for GPIO keys?

Help Needed

I don't know how to make LAN work. Can anybody experienced with this architecture give a hand? Already done.

Paging @updateing

1 Like

Upstream is implementing this too, so OpenWrt switched to the new "color:function" naming scheme recently.

These are all supported event codes:

Details on how this is used in OpenWrt:

1 Like

Is this change only for the ath79 platform or global? I'll update the DTS file according to this if it's the latter.
Edit: Now I get to play around with that, I see it's just a naming standart set by OpenWRT. I'll update the DTS file accordingly.

I've just commited an update to resolve that.

I figured Broadcom switch works at port 7, eth1. Realtek switch won't work without proper drivers.
The router is working properly with the latest commit on my fork.

This router has two cores but I couldn't make eth0 work under port 5, 6, and 8.
Screenshots from LuCI:


1 Like

That sounds great to me. But I assume that the WIFI abilities are limited due to the non existing open-source driver from Broadcom.

That is pretty much what prevents it from being a useful home gateway device. Right now, I make use of this router as a managed switch, if you can believe it.

1 Like

A shame, it would have been too nice. Because of its decent WLAN coverage I use the router as AP and as firmware Merlin-WRT to be able to put the guest WLAN into a separate VLAN.

Nevertheless thank you for bringing OpenWRT to the RT-AC88u.

1 Like

Thank you. Actually, you wouldn't need to have an open-source wireless driver to make it work on OpenWrt. I did load Broadcom wireless firmware on OpenWrt (it's a very standart procedure, nothing specific that you need to do) but Wi-Fi just wouldn't work.

I believe there needs to be changes made on the DTS file for the device but I stopped working on it before I got there. This is where I left off:

Thank you very much for the explanation. Unfortunately I am not skilled enough to do the adjustments. Therefore I will stick to Merlin-WRT.

Welcome to the forum. I'm a bit rusty on this type of work. I believe I gathered information for devices on these websites.

https://wikidevi.wi-cat.ru/Main_Page

http://en.techinfodepot.shoutwiki.com/wiki/Main_Page

1 Like

There is support for Phicomm K3 AC3150 which is very similar router, i use it as a daily driver and is very stable. I use binary wifi drivers extracted from the Asus FWs and the speeds are great. Look around in the forum. Also check https://github.com/coolsnowwolf/lede openwrt fork, it is a chinese thing but very popular and doesn't care if something is proprietary or not.

That’s actually what @npcomplete and I did. We tested a bunch of wireless firmware on different versions, extracted from the kernel modules from Asus and Linksys firmwares.

I think the wireless firmware fails to run on newer kernels which I believe a specific configuration on the DTS file would solve it. Some examples are there on the Notion page where I stopped working on it.

could be, I'm on 4.14.221 kernel with latest (i think) brcmfmac4366c-pcie.bin

@arinc9
I tried your openwrt fork today because I was really curious to see if I could get it working on my hardware. After manually adding libcap from the openwrt repository to the / package / libs directory, the compilation worked fine. I had to use the -i (ignore) switch to suppress an error on some TP-Link Archer device. Then I flashed the trx file via the router's CFE interface and was able to access the LUCI web interface. At least everything is working fine at first glance, even a wireless connection is possible, which I did not expect.
So here comes my question. Do you think you could update your fork to the latest snapshot or, alternatively, commit your changes to the openwrt master?

That's kind of broken. You won't be able to connect and maintain stable connection, because the wireless firmware fails to start on Linux kernel 5 and newer. I plan to put my changes on the latest version of OpenWrt 19.07 to see if the firmware works on kernel 4.14.x

In the meantime, I will update the current fork to the latest master commit as you requested. There's a change on upstream that conflicts with one of my patches. I'm working on solving it.

Did putting the OpenWrt trx image on the CFE web UI work?
I had to run a TFTP server and a command like http://192.168.1.1/do.htm?cmd=flash+-noheader+192.168.1.2:firmware.trx+flash0.trx on the browser to bypass the image integrity check.

Edit: That conflict is a bigger problem than I thought. I'll work on it in the upcoming days.

@arinc9
Thank you for your quick reply and your efforts of updating the repro.

Well wireless connections are kind of fractile. For example 802.11w Management Frame Protection has to be disabled, otherwise for me no WLAN encrypted connection is possible with devices like Galaxy S10e or Macbook Pro.
Concerning the flash from CFE I had no real problems. First I reset the NVRAM values to default than I flashed the trx file without problems. Maybe this comes from the fact that I use Merlin 386.1.2 and not on of the official 386.4 versions of ASUS. Maybe the reason are different versions of CFE.

Take your time. No need to rush because in my opinion the your firmware is already doing a marvelous job. It is just the wish to be well prepared for future security updates, that drives my asking.

Just updated and tested it on my device. Works fine. I got a few things to work on. It's currently the same deal but on newer commits.

I also took the liberty to upload an image with LuCI packages, you can download it here:

Thank you for working on this. I will give the updated release a shot later today.

I also uploaded 19.07.7 build on kernel 4.14.221. Let me know what happens with Wi-Fi.
It's still broken for me.

First findings with OpenWrt SNAPSHOT r16725-6cd7bf7e5e / LuCI Master git-21.132.35841-3c66c5b.

Extracted from system.log

Fri May 14 14:51:20 2021 user.info kernel: [   10.887538] kmodloader: loading kernel modules from /etc/modules.d/*
Fri May 14 14:51:20 2021 kern.info kernel: [   10.935577] Loading modules backported from Linux version v5.10.34-0-g0aa66717f684
Fri May 14 14:51:20 2021 kern.info kernel: [   10.943278] Backport generated by backports.git v5.10.34-1-0-g7b5533e1
Fri May 14 14:51:20 2021 kern.info kernel: [   10.960408] xt_time: kernel timezone is -0000
Fri May 14 14:51:20 2021 kern.info kernel: [   10.980052] PPP generic driver version 2.4.2
Fri May 14 14:51:20 2021 kern.info kernel: [   10.986083] NET: Registered protocol family 24
Fri May 14 14:51:20 2021 kern.info kernel: [   10.999086] usbcore: registered new interface driver brcmfmac
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.005055] pci_generic_config_write32: 50 callbacks suppressed
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.005065] pci_bus 0000:01: 1-byte config write to 0000:01:00.0 offset 0x3c may corrupt adjacent RW1C bits
Fri May 14 14:51:20 2021 kern.info kernel: [   11.020788] pci 0000:00:00.0: enabling device (0140 -> 0142)
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.026466] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0x4 may corrupt adjacent RW1C bits
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.036155] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0x4 may corrupt adjacent RW1C bits
Fri May 14 14:51:20 2021 kern.info kernel: [   11.045839] brcmfmac 0000:01:00.0: enabling device (0140 -> 0142)
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.051954] pci_bus 0000:01: 2-byte config write to 0000:01:00.0 offset 0x4 may corrupt adjacent RW1C bits
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.061644] pci_bus 0000:01: 2-byte config write to 0000:01:00.0 offset 0x4 may corrupt adjacent RW1C bits
Fri May 14 14:51:20 2021 kern.info kernel: [   11.240153] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4366c-pcie for chip BCM43664/4
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.461088] brcmfmac 0000:01:00.0: Direct firmware load for brcm/brcmfmac4366c-pcie.asus,rt-ac88u.txt failed with error -2
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.472228] brcmfmac 0000:01:00.0: Direct firmware load for brcm/brcmfmac4366c-pcie.txt failed with error -2
Fri May 14 14:51:20 2021 kern.info kernel: [   11.812838] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4366c-pcie for chip BCM43664/4
Fri May 14 14:51:20 2021 kern.info kernel: [   11.821672] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
Fri May 14 14:51:20 2021 kern.info kernel: [   11.832936] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43664/4 wl0: Nov  5 2018 03:19:56 version 10.28.2 (r769115) FWID 01-d2cbb8fd
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.854215] pci_bus 0001:01: 1-byte config write to 0001:01:00.0 offset 0x3c may corrupt adjacent RW1C bits
Fri May 14 14:51:20 2021 kern.info kernel: [   11.864053] pci 0001:00:00.0: enabling device (0140 -> 0142)
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.869733] pci_bus 0001:00: 2-byte config write to 0001:00:00.0 offset 0x4 may corrupt adjacent RW1C bits
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.879465] pci_bus 0001:00: 2-byte config write to 0001:00:00.0 offset 0x4 may corrupt adjacent RW1C bits
Fri May 14 14:51:20 2021 kern.info kernel: [   11.889175] brcmfmac 0001:01:00.0: enabling device (0140 -> 0142)
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.895305] pci_bus 0001:01: 2-byte config write to 0001:01:00.0 offset 0x4 may corrupt adjacent RW1C bits
Fri May 14 14:51:20 2021 kern.warn kernel: [   11.905035] pci_bus 0001:01: 2-byte config write to 0001:01:00.0 offset 0x4 may corrupt adjacent RW1C bits
Fri May 14 14:51:20 2021 kern.info kernel: [   12.080156] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4366c-pcie for chip BCM43664/4
Fri May 14 14:51:20 2021 kern.warn kernel: [   12.091824] brcmfmac 0001:01:00.0: Direct firmware load for brcm/brcmfmac4366c-pcie.asus,rt-ac88u.txt failed with error -2
Fri May 14 14:51:20 2021 kern.warn kernel: [   12.102971] brcmfmac 0001:01:00.0: Direct firmware load for brcm/brcmfmac4366c-pcie.txt failed with error -2
Fri May 14 14:51:20 2021 kern.info kernel: [   12.442873] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4366c-pcie for chip BCM43664/4
Fri May 14 14:51:20 2021 kern.info kernel: [   12.451675] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
Fri May 14 14:51:20 2021 kern.info kernel: [   12.462949] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43664/4 wl0: Nov  5 2018 03:19:56 version 10.28.2 (r769115) FWID 01-d2cbb8fd
Fri May 14 14:51:20 2021 user.info kernel: [   12.492007] kmodloader: done loading kernel modules from /etc/modules.d/*

At least there is a connection with the wireless devices.

Will now flash your 19.07.xx version and post the results.