OpenWrt support on rt2600ac (synology) 2021

We'll look into it on a later time as it's getting quite late here too :wink: and it's a little bit too advanced for me to figure out myself. Thanks and have a great sleep.

1 Like
setenv bootargs 'console=ttyMSM0,115200n8 init=/sbin/init root=/dev/sda2 rootwait'
setenv wrtgo 'usb start; ext2load usb 0:1 $kload kernel; bootm $kload'
run wrtgo

1 Like

Ran it, don't see an immediate difference. I've PM'd the output.

1 Like
initramfs-tips

uploaded an alternate kernel (initramfs) you should be able to mess around with for a week or so...

(just copy it over the existing kernel with the name 'kernel' it does not use the rootfs and can't save settings but you could mount that partition to save config files there)

(the same boot commands will load it ok)

(it could and should also be used to make dd images of mtd and mmcblk0 in case you ever need them for recovery mmc is 4G tho'... so you need another partition (mount /dev/sda3 /mnt) or pipe it direct to netcat>pc if unsure hold off or ask)

seems they're stripping this now... so we have to hardcode it in the dts/dtb(kernel) rather than get it from the bootloader...

my old buildroots dont run... (but it is time for a rebase/refresh) so hopefully might get some time this week to create some up to date images... edit: got it running so there is now;

  • v2.1 kernel with hardcoded /dev/sda2 + rootfs
  • 2xinitramfs files you can copy over the kernel (if 2.1 fails) (use the biggest I just copied random ones)

after that... we just need to tidy up the uboot commands a little and save them...
(we can make the usb booting automatic so if you take out the drive it will boot oem... saves you from having to edit in the future)


(rebase-mostly-done: thanks slh for the lowercase mtd code... saved me 3-5hours)

let me know if there are any programs/kmods you need...

I copied the 2.1 kernel and rootfs over to the USB key and redid what we did yesterday. It appears to lead to the same outcome. I'll PM you the console output now.

Edit: I did not touch the initramfs files as you mentioned 'if 2.1 fails'
Edit2: I also didn't copy over the [CHECKBOOTY] file (https://github.com/wulfy23/rpi4/blob/master/builds/devel/rt26usbback/usb-v2.1_hardcoded_boot_sda2/CHECKBOOTY)

1 Like

hmmm... ok... ( looks like their uboot is doing some funny fixups or I got sloppy with the files I gave you ... i'll think about it a little as i'm working on the newer build )

(pm me one more 'printenv' the next time before you try to boot... + the actual boot command you are running)

copy one of the initramfs over the kernel ( the bigger one ) and give that a go...

Alright, that seemed to the the correct kernel. Now it's booting up and I have the OpenWRT interface loaded up over HTTP.

I'll post you the full output once more (also containing your printenv). If you could tell me what to do to make it permanent and perhaps too to figure out the LED's part, that would be awesome.

1 Like

thats just an initramfs... (wont save settings)

but you can apply the uboot commands from git... and place the booty.txt on the usb drive (partition1 next to kernel) to make it automatic...

you'll need to type 'saveenv' after you verify they are the same as entered

let me know if you want/need some more programs/kmods in a new initramfs to test...

afaik 802.11r or whatever may not be so great going from forum posts... so you may be able to test it out before going through too much hassle with the device... just using an initramfs...

(worst case scenario you will have an excellent recovery tool in the initramfs and a semi-permanent autoboot logic for it if you ever need it, synology forums are littered with people who mess up their OS and are out of support life... , can't downgrade... just watch me :wink: )

the oem firmware being half decent (yet bloated) is one factor... as is it's means of auto-recovery... but we can go down that road if we get to it...

Wireless appears to be missing in the menu, not part of the kernel?

building a current initramfs (or regular kernel)... best to use that as a base to make some clearer determinations... (cannot be sure of the provinence of whatever initramfs you are running... there were some crashlogs in your boot which i've never seen so may be from a build where I was testing some random C code or something)

(cool: that initramfs was 5.4 i've never ran 5.4 world first! must have been an initial test build)

i have a suspicion that they've moved the caldata on that oem version... ( required to setup wireless ) or similar funkiness

working-wireless-stock-oem
[root@synology /]# iwinfo
wlan0     ESSID: "somessid"
          Access Point: 00:11:32:AA:BB:CC
          Mode: Master  Channel: 36 (5.180 GHz)
          Tx-Power: 23 dBm  Link Quality: 45/70
          Signal: -65 dBm  Noise: -103 dBm
          Bit Rate: 866.7 MBit/s
          Encryption: WPA2 PSK (CCMP)
          Type: nl80211  HW Mode(s): 802.11nac
          Hardware: 168C:0046 168C:CAFE [Qualcomm Atheros QCA9984]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy0

wlan1     ESSID: "somessid"
          Access Point: 00:11:32:AA:BB:CD
          Mode: Master  Channel: 10 (2.457 GHz)
          Tx-Power: 30 dBm  Link Quality: 59/70
          Signal: -51 dBm  Noise: -95 dBm
          Bit Rate: 65.0 MBit/s
          Encryption: WPA2 PSK (CCMP)
          Type: nl80211  HW Mode(s): 802.11bgn
          Hardware: 168C:0046 168C:CAFE [Qualcomm Atheros QCA9984]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy1

[root@synology-001132964267 /]# dmesg | grep ath
[   14.351752] ath10k_pci 0000:01:00.0: assign IRQ: got 35
[   14.351784] ath10k 5.4 driver, optimized for CT firmware, probing pci device: 0x46.
[   14.351877] ath10k_mac_create, priv_size: 868  hw: f09f0288  hw->priv: 5a09c63a
[   14.365708] ath10k_pci 0000:01:00.0: enabling device (0140 -> 0142)
[   14.365860] ath10k_pci 0000:01:00.0: enabling bus mastering
[   14.366514] ath10k_pci 0000:01:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[   18.514580] firmware ath10k!fwcfg-pci-0000:01:00.0.txt: firmware_loading_store: map pages failed
[   18.626613] firmware ath10k!QCA9984!hw1.0!ct-firmware-5.bin: firmware_loading_store: map pages failed
[   18.736395] firmware ath10k!QCA9984!hw1.0!ct-firmware-2.bin: firmware_loading_store: map pages failed
[   18.858468] firmware ath10k!QCA9984!hw1.0!firmware-6.bin: firmware_loading_store: map pages failed
[   18.878997] ath10k_pci 0000:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe
[   18.879065] ath10k_pci 0000:01:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   18.895908] ath10k_pci 0000:01:00.0: firmware ver 10.4b-ct-9984-fW-13-795874169 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 f3d4b769
[   21.220268] ath10k_pci 0000:01:00.0: board_file api 2 bmi_id 0:1 crc32 85498734
[   27.037039] ath10k_pci 0000:01:00.0: unsupported HTC service id: 1536
[   27.038308] ath10k_pci 0000:01:00.0: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[   27.042468] ath10k_pci 0000:01:00.0: msdu-desc: 2500  skid: 32
[   27.125586] ath10k_pci 0000:01:00.0: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[   27.126445] ath10k_pci 0000:01:00.0: wmi print 'free: 84920 iram: 13316 sram: 11224'
[   27.413597] ath10k_pci 0000:01:00.0: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file max-sta 32 raw 0 hwcrypto 1
[   27.503426] ath: EEPROM regdomain sanitized
[   27.503439] ath: EEPROM regdomain: 0x64
[   27.503446] ath: EEPROM indicates we should expect a direct regpair map
[   27.503461] ath: Country alpha2 being used: 00
[   27.503468] ath: Regpair used: 0x64
[   27.506866] ath10k_pci 0001:01:00.0: assign IRQ: got 37
[   27.506899] ath10k 5.4 driver, optimized for CT firmware, probing pci device: 0x46.
[   27.506997] ath10k_mac_create, priv_size: 868  hw: 3f936fcd  hw->priv: adf705d0
[   27.514193] ath10k_pci 0001:01:00.0: enabling device (0140 -> 0142)
[   27.520853] ath10k_pci 0001:01:00.0: enabling bus mastering
[   27.521554] ath10k_pci 0001:01:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[   27.939040] firmware ath10k!fwcfg-pci-0001:01:00.0.txt: firmware_loading_store: map pages failed
[   28.049697] firmware ath10k!QCA9984!hw1.0!ct-firmware-5.bin: firmware_loading_store: map pages failed
[   28.170071] firmware ath10k!QCA9984!hw1.0!ct-firmware-2.bin: firmware_loading_store: map pages failed
[   28.279969] firmware ath10k!QCA9984!hw1.0!firmware-6.bin: firmware_loading_store: map pages failed
[   28.280255] ath10k_pci 0001:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe
[   28.287951] ath10k_pci 0001:01:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   28.302028] ath10k_pci 0001:01:00.0: firmware ver 10.4b-ct-9984-fW-13-795874169 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 f3d4b769
[   30.630030] ath10k_pci 0001:01:00.0: board_file api 2 bmi_id 0:2 crc32 85498734
[   36.471185] ath10k_pci 0001:01:00.0: unsupported HTC service id: 1536
[   36.472568] ath10k_pci 0001:01:00.0: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[   36.476633] ath10k_pci 0001:01:00.0: msdu-desc: 2500  skid: 32
[   36.561906] ath10k_pci 0001:01:00.0: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[   36.562788] ath10k_pci 0001:01:00.0: wmi print 'free: 84920 iram: 13316 sram: 11224'
[   36.883460] ath10k_pci 0001:01:00.0: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file max-sta 32 raw 0 hwcrypto 1
[   36.978818] ath: EEPROM regdomain sanitized
[   36.978833] ath: EEPROM regdomain: 0x64
[   36.978846] ath: EEPROM indicates we should expect a direct regpair map
[   36.978871] ath: Country alpha2 being used: 00
[   36.978883] ath: Regpair used: 0x64
[   43.967645] ath: EEPROM regdomain: 0x8024
[   43.967656] ath: EEPROM indicates we should expect a country code
[   43.967663] ath: doing EEPROM country->regdmn map search
[   43.967669] ath: country maps to regdmn code: 0x3b
[   43.967678] ath: Country alpha2 being used: AU
[   43.967685] ath: Regpair used: 0x3b
[   43.967694] ath: regdomain 0x8024 dynamically updated by user
[   43.967749] ath: EEPROM regdomain: 0x8024
[   43.967756] ath: EEPROM indicates we should expect a country code
[   43.967762] ath: doing EEPROM country->regdmn map search
[   43.967768] ath: country maps to regdmn code: 0x3b
[   43.967774] ath: Country alpha2 being used: AU
[   43.967780] ath: Regpair used: 0x3b
[   43.967787] ath: regdomain 0x8024 dynamically updated by user
[   52.493697] ath10k_pci 0001:01:00.0: unsupported HTC service id: 1536
[   52.494324] ath10k_pci 0001:01:00.0: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[   52.499273] ath10k_pci 0001:01:00.0: msdu-desc: 2500  skid: 32
[   52.583325] ath10k_pci 0001:01:00.0: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[   52.584198] ath10k_pci 0001:01:00.0: wmi print 'free: 84920 iram: 13316 sram: 11224'
[   53.034977] ath10k_pci 0001:01:00.0: Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: 4
[   53.229432] ath10k_pci 0001:01:00.0: NOTE:  Firmware DBGLOG output disabled in debug_mask: 0x10000000
[   58.983574] ath10k_pci 0000:01:00.0: unsupported HTC service id: 1536
[   58.983853] ath10k_pci 0000:01:00.0: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[   58.989173] ath10k_pci 0000:01:00.0: msdu-desc: 2500  skid: 32
[   59.071400] ath10k_pci 0000:01:00.0: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[   59.072248] ath10k_pci 0000:01:00.0: wmi print 'free: 84920 iram: 13316 sram: 11224'
[   59.453177] ath10k_pci 0000:01:00.0: Firmware lacks feature flag indicating a retry limit of > 2 is OK, requested limit: 4
[ 1150.235327] ath10k_pci 0001:01:00.0: Invalid VHT mcs 15 peer stats
[ 5379.163088] ath10k_pci 0001:01:00.0: htt tx: fixing invalid VHT TX rate code 0xff
[28476.475672] ath10k_pci 0000:01:00.0: wmi: fixing invalid VHT TX rate code 0xff
root@OpenWrt:/# iwinfo
root@OpenWrt:/# dmesg | grep ath
[    0.973698] [<c031e5a0>] (__warn) from [<c031e60c>] (warn_slowpath_fmt+0x50/0x90)
[    0.973726] [<c031e60c>] (warn_slowpath_fmt) from [<c066c8dc>] (_regulator_put.part.3+0x17c/0x180)
[    0.974427] [<c031e5a0>] (__warn) from [<c031e60c>] (warn_slowpath_fmt+0x50/0x90)
[    0.974451] [<c031e60c>] (warn_slowpath_fmt) from [<c066c8dc>] (_regulator_put.part.3+0x17c/0x180)
[    0.975080] [<c031e5a0>] (__warn) from [<c031e60c>] (warn_slowpath_fmt+0x50/0x90)
[    0.975104] [<c031e60c>] (warn_slowpath_fmt) from [<c066c8dc>] (_regulator_put.part.3+0x17c/0x180)
[    1.103633] [<c031e5a0>] (__warn) from [<c031e60c>] (warn_slowpath_fmt+0x50/0x90)
[    1.103658] [<c031e60c>] (warn_slowpath_fmt) from [<c066c8dc>] (_regulator_put.part.3+0x17c/0x180)
[    1.104297] [<c031e5a0>] (__warn) from [<c031e60c>] (warn_slowpath_fmt+0x50/0x90)
[    1.104322] [<c031e60c>] (warn_slowpath_fmt) from [<c066c8dc>] (_regulator_put.part.3+0x17c/0x180)
[    1.104941] [<c031e5a0>] (__warn) from [<c031e60c>] (warn_slowpath_fmt+0x50/0x90)
[    1.104965] [<c031e60c>] (warn_slowpath_fmt) from [<c066c8dc>] (_regulator_put.part.3+0x17c/0x180)
[    5.169566] [<c031e5a0>] (__warn) from [<c031e60c>] (warn_slowpath_fmt+0x50/0x90)
[    5.176427] [<c031e60c>] (warn_slowpath_fmt) from [<c07a8bac>] (_of_add_opp_table_v2.part.2+0x43c/0x4ac)
[    5.429547] [<c031e5a0>] (__warn) from [<c031e60c>] (warn_slowpath_fmt+0x50/0x90)
[    5.436407] [<c031e60c>] (warn_slowpath_fmt) from [<c07a8bac>] (_of_add_opp_table_v2.part.2+0x43c/0x4ac)

If you have a different kernel to test with let me know

Edit, or if you can teach me how to build a kernel myself let me know

uploaded rebased + clean 202107 + static /dev/sda2

i've not yet tested it yet... will do so in the coming days...

(test with the regular kernel first (you need to replace all the files in sdX2 aka rootfs to match the kernel) then the initramfs if it fails to mount root... ( look for root= near the start of the boot output at 'Command line' )

Kernel command line: rootfstype=squashfs,ext4 root=/dev/sda2 rootwait noinitrd

seems halted again

PM'd the full output message

1 Like

dude... fantastic... can see you now have the root= cmdline passed...

the hanging is related to 'usb' and the 5.4 dts~porting...

we are close... very close...

[    2.730338] dwc3 11000000.dwc3: Failed to get clk 'ref': -2
[    2.730637] dwc3 10000000.dwc3: Failed to get clk 'ref': -2
[    2.735157] dwc3 11000000.dwc3: Failed to get clk 'ref': -2

i'l l iron it out if possible...

by any chance did you check to see if the initramfs brings up your wireless?

yes I did, but no wireless even with the initramfs:

root@OpenWrt:/# iwinfo
root@OpenWrt:/# dmesg | grep ath
[   10.084337] ath10k_pci 0000:01:00.0: assign IRQ: got 35
[   10.084358] ath10k 5.10 driver, optimized for CT firmware, probing pci device: 0x46.
[   10.084862] ath10k_pci 0000:01:00.0: enabling device (0140 -> 0142)
[   10.091216] ath10k_pci 0000:01:00.0: enabling bus mastering
[   10.091729] ath10k_pci 0000:01:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[   10.615307] ath10k_pci 0000:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe
[   10.615336] ath10k_pci 0000:01:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   10.626066] ath10k_pci 0000:01:00.0: firmware ver 10.4b-ct-9984-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 7ea63dc5
[   12.930191] ath10k_pci 0000:01:00.0: failed to fetch board data for bus=pci,vendor=168c,device=0046,subsystem-vendor=168c,subsystem-device=cafe from ath10k/QCA9984/hw1.0/board-2.bin
[   12.970843] ath10k_pci 0000:01:00.0: failed to fetch board-2.bin or board.bin from ath10k/QCA9984/hw1.0
[   12.970878] ath10k_pci 0000:01:00.0: failed to fetch board file: -12
[   12.979363] ath10k_pci 0000:01:00.0: could not probe fw (-12)
[   12.986273] ath10k_pci 0001:01:00.0: assign IRQ: got 37
[   12.986297] ath10k 5.10 driver, optimized for CT firmware, probing pci device: 0x46.
[   12.992009] ath10k_pci 0001:01:00.0: enabling device (0140 -> 0142)
[   12.999235] ath10k_pci 0001:01:00.0: enabling bus mastering
[   12.999783] ath10k_pci 0001:01:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[   13.538869] ath10k_pci 0001:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe
[   13.538916] ath10k_pci 0001:01:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   13.550442] ath10k_pci 0001:01:00.0: firmware ver 10.4b-ct-9984-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 7ea63dc5
[   15.847195] ath10k_pci 0001:01:00.0: failed to fetch board data for bus=pci,vendor=168c,device=0046,subsystem-vendor=168c,subsystem-device=cafe from ath10k/QCA9984/hw1.0/board-2.bin
[   15.903682] ath10k_pci 0001:01:00.0: failed to fetch board-2.bin or board.bin from ath10k/QCA9984/hw1.0
[   15.903713] ath10k_pci 0001:01:00.0: failed to fetch board file: -12
[   15.912048] ath10k_pci 0001:01:00.0: could not probe fw (-12)

1 Like

well good news is that we are not stuck with usb...

we can simply point to a free mmc partition (but I need to make another kernel with that hardcoded)... the wireless has me a little stuck tho...

so might wait to see if anyone recognizes anything in that log... seem like the hardware is detected but some sort of drama with the right board/version being recognized or something... vaguely recall some random file we can add id's to... not sure if that is the case here... (if my board does the same then it's on me / also something i've overlooked with the 5.4 porting... simple enough to test)

(if you get bored in the meantime... i've routed an extension wire from the uart/serial to the center-rear-bottom of the case and tapped a small slot for female 4 pin connector (only need 3) so you can close the case up but still have serial access, have to give them credit it's a beautifully designed unit even room underneath to mount a 2.5 ssd>usb3)

Haha, i already did that this morning :smiley: I got very curious kids wandering around here and even with a 12V model you don't know the ground floating voltage. So I soldered a dupont cable that extends from one of the holes in the bottom and closed the unit already. Not the most elegant solution, but it's safe, and it's a router, so it's usually attached to the wall anyway and you won't see the cable.

You kinda got me hooked now so I wish to do something with it ^^ So if I can test something else, let me know.

1 Like

If you're talking about this one. I did find some posts about this hardware id and library. Perhaps you can tie the knots together.

https://www.mail-archive.com/search?l=ath10k@lists.infradead.org&q=subject:"QCA9984+bmi+identification+failure"&o=newest&f=1

well if you get really bored... you can mess around with the 'hexdump' command on your mtd ( or a dd image of it )

cat /proc/mtd

find which number is VENDORPART

careful with the dd command

dd if=/dev/mtdN of=/tmp/mtdN
hexdump -C /tmp/mtdN | grep MACBIT

looking for your original mac addresses....

don't spend too long on it tho'... but either I need to fix the logic or the macs are in an alternate location or both-ish...

(no need to post the macs... but hexdump should list an offset where they are stored... )

mine are on this line(s);

hexdump -C /dev/mtd11 | grep '000000d0'
hexdump -C /dev/mtd11 | grep '000000e0'

(p.s. your serial number is there too back that up also)

o no... there is no mtd in your dmesg... ok... that's interesting(and explains alot)... i'll definitely need to test this build on my device...