宿舍设备密度太太太大
总方向自然是越便宜越好
硬件篇
收到货
配置:
CPU: QCA9563+128M DDR2+16M SPI Flash
2.4G: CPU自带 2.4G 功能+SKY85310-21 独立功放
5G: QCA9886+MSC589H功放
全千兆网口
虽然功放是外置的但是似乎参数一般
12V1.5A DC 5.5*2.1mm
巨大的外壳
拆出来主板其实跟硕大的铁壳相比小多了
用料还可以
板子上还有
左上角可以看到两颗芯片
原厂固件篇
自带的固件是
nmap
先上
先刷breed-qca956x-uart_rx18_tx22-reset2(Auto).bin
用
逛了逛
Caldata
:
2.4G: /tmp/wifi0.caldata 来自ART 分区 skip=4096 count=1088
5G: /tmp/wifi1.caldata 来自ART 分区 skip=20480 count=12064
Board Data FileboardData_2_0_QCA9888_5G_Y9690.bin :
/lib/firmware/QCA9888/hw.2/boarddata_0.bin 来自 /usr/share/base-config/9886_calData_20171012_edit.bin
Code swap structure:
bin_filename=QCA9888/hw.2/athwlan.bin swap_filename=/lib/firmware/QCA9888/hw.2/athwlan.codeswap.bin
此外虽然我们没有在原厂固件发现挖矿相关的信息
代码位置在
至于有些啥
番外篇
其实也不算秘密
前脚给矿机做系统赚一波钱
不过对于垃圾佬来说
这个机子就是这样的
这个民间大神倒是确实是也应该对路由器感兴趣
那他跟这路由还有啥关系呢
随手搜一下
其实用
适配篇
据说此板的原型是高通的
固件适配没什么太多好讲的
不过有一些题外话可以讲
在上面的
我当然希望适配最新的分支
我们路由器本身的闪存大小是足够的
到这里固件就已经可以生成了
此外
芯片还支持
此外
榨干他
不过到这里还没完
下面的内容全网都找不到资料
ath10k
来分析原厂固件的
[ 16.500296] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[ 16.506154] hif_pci_enable_bus: hif_enable_pci done *********** QCA9888 *************hif_pci_enable_bus: hif_type = 0xe, target_type = 0xchif_pci_enable_bus: hif_pci_probe_tgt_wakeup donehif_target_sync: Loop checking FW signalhif_target_sync: Got FW signal, retries = 0hif_config_ce: ce_init donehif_config_ce: X, ret = 0hif_set_hia: Ehif_set_hia_extnd: E
[ 16.549333] chip_id 0xc chip_revision 0x0
[ 16.553665]
[ 16.553665] CLOCK PLL skipped
[ 16.558341] hif_set_hia_extnd: setting the target pll frac ffffffff intval ffffffff
[ 16.566251] hif_set_hia_extnd: no frac provided, skipping pre-configuring PLL
[ 16.576652] hif_pci_bus_configure: hif_set_hia donehif_configure_irq: Ehif_pci_configure_legacy_irq: Ehif_pci_configure_legacy_irq: X, ret = 0hif_enable: X OKhif_napi_create: NAPI structures initializedhif_napi_create: NAPI id 6 created for pipe 5qca_napi_create: napi instance 32 created on pipe 4
[ 16.604002] hif_napi_event: received evnt: CONF cmd; v = 1 (state=0x1)hif_napi_event: setting configuration to ON
__ol_ath_attach() Allocated scn 86080420
[ 16.619839] __ol_ath_attach: dev name wifi1
[ 16.624195] ol_ath_attach interface_id 1
[ 16.628920] ol_target_init() BMI inited.
[ 16.633118] ol_target_init() BMI Get Target Info.
[ 16.637977] Chip id: 0xc, chip version: 0x1000000
[ 16.642853]
[ 16.642853] CE WAR Disabled
[ 16.647498] NUM_DEV=1 FWMODE=0x2 FWSUBMODE=0x0 FWBR_BUF 0
[ 16.653299] ol_target_init() configure Target .
[ 16.658076]
[ 16.658076] Target Version is 1000000
[ 16.663493]
// 这上面都是启用设备的过程
[ 16.663493] Flash Download Address c0000
// 开始确定下载的地址了
[ 16.669337] ol_transfer_bin_file: flash data file defined
[ 16.674920] ol_transfer_bin_file[3637] Get Caldata for wifi1.
[ 16.680963] qdf_fs_read[59], Open File /tmp/wifi1.caldata SUCCESS!!file system magic:16914836super blocksize:4096inode 205file size:12064qc98xx_verify_checksum: flash checksum passed: 0x5bb1
// 第一次下载, 载入了/tmp/wifi1.caldata
// 在 rootfs/lib/preinit/81_load_board 发现将 art 分区中的校准参数保存到了/tmp/wifi1.caldata
// 所以说其实第一步加载的是 art 分区
[ 16.698681] ol_transfer_bin_file 3698: Download Flash data len 12064
// Flash data 来自 art 分区
[ 16.705704] Board extended Data download address: 0x0
// 这里没有 log 不知道 Board extended Data 从哪来的
// 也可能是没有下载 Board extended Data 所以没有 log
[ 16.734002]
[ 16.734002] Board data initialized
// Board extended Data
[ 16.739185] ol_ath_download_firmware: Download OTP, flash download ADDRESS 0xc0000
[ 16.747020]
[ 16.747020] Selecting OTP binary for CHIP Version 0
[ 16.812795] ol_transfer_bin_file 3518: downloading file 0, Download data len 9084
// 9084 这个 size 很少见 几乎可以肯定是来自 rootfs/lib/firmware/QCA9888/hw.2/otp.bin
[ 16.855272]
[ 16.855272] First OTP send param 8000
[ 17.101422] ol_ath_download_firmware :First OTP download and Execute is good address:0x4000 return param 4660
[ 17.111673] ol_ath_download_firmware:##Board Id 16 , CHIP Id 0
// 又一关键信息 Board Id 16
[ 17.117804] ol_ath_download_firmware: BOARDDATA DOWNLOAD TO address 0xc0000
[ 17.125019]
// OTP 结束 来自 rootfs/lib/firmware/QCA9888/hw.2/otp.bin
[ 17.125019] wifi1: Selecting board data file name boardData_2_0_QCA9888_5G_Y9690.bin
[ 17.134651] ol_transfer_bin_file: Board Data File download to address=0xc0000 file name=QCA9888/hw.2/boardData_2_0_QCA9888_5G_Y9690.bin
[ 17.147593] ol_transfer_bin_file 3518: downloading file 3, Download data len 12064
// 重新加载了 boardData? 不是很懂原因
// 猜想大概是因为上面获得了 EMI Board ID 所以重新匹配?
[ 17.155881] Board extended Data download address: 0x0
// 这应该是没有下载
[ 17.184361] ol_ath_download_firmware: Using 0x1234 for the remainder of init
[ 17.191666]
[ 17.191666] Selecting OTP binary for CHIP Version 0
[ 17.198614] ol_transfer_bin_file 3518: downloading file 0, Download data len 9084
// 又一次 OTP?
[ 17.241076]
[ 17.241076] [Flash] : Ignore Module param
[ 17.246836]
[ 17.246836] Second otp download Param 10000
// 确实是 second otp
[ 17.503711] ol_ath_download_firmware : Second OTP download and Execute is good, param=0x0
[ 17.512254]
[ 17.512254] Mission mode: Firmware CHIP Version 0
[ 17.660982] ol_swap_seg_alloc: Successfully allocated memory for SWAP size=262144
[ 17.673891] Swap: bytes_left to copy: fw:16; dma_page:27561
[ 17.679651] Swap: wrong length read:0
[ 17.683460] ol_swap_wlan_memory_expansion: Swap total_bytes copied: 234583 Target address 41a508
[ 17.692775] scn=86080420 target_write_addr=41a508 seg_info=86138010
[ 17.699425] ol_transfer_swap_struct:Code swap structure successfully downloaded for bin type =2
[ 17.708514] bin_filename=QCA9888/hw.2/athwlan.bin swap_filename=/lib/firmware/QCA9888/hw.2/athwlan.codeswap.bin
// 下载 USB firmware
// codeswap 不知道是干嘛的
[ 17.719098] ol_transfer_bin_file: Downloading firmware file: QCA9888/hw.2/athwlan.bin
[ 18.077288] ol_transfer_bin_file 3518: downloading file 1, Download data len 372784
// 根据这个大小应该可以确定是 rootfs/lib/firmware/QCA9888/hw.2/athwlan.bin
[ 19.516913] ol_target_init() Download FW done.
// 下载过程完毕
根据这次启动过程
其中QCA9888/hw.2/boardData_2_0_QCA9888_5G_Y9690.bin
/tmp/wifi1.caldata
/lib/preinit/81_load_board
9886_calData_20171012_edit.bin
/lib/firmware/QCA9888/hw.2/boarddata_0.bin
OTP/lib/firmware/QCA9888/hw.2/otp.bin
athwlan.bin/lib/firmware/QCA9888/hw.2/athwlan.bin
ps
上面的启动过程是
qsdk 的 在 , Openwrt 中并没有这么多的文件 只有 , board-2.bin
,board.bin
,firmware-5.bin
其中 , board.bin
还是一个空文件 文件实际上是一串 ( ASCII 文本 “ ../../cal-pci-0000:01:00.0.bin” ) 那么这些固件是怎么加载的呢 , ?
上面的启动过程是board-2.bin
,board.bin
,firmware-5.bin
board.bin
实际上是
[1]board-2.bin
所以说
ps-ct
ath10k 驱动笔记
HTT-MGT
The HTT-MGT variants transport management frames over the normal HTT tx path, just like data frames.
This saves limitted WMI buffers which can become depleted if lots of management frames become stuck in TX queues due to peer that went away.
In addition, at least for the wave-1 firmware, htt-mgt is required in order for 802.11r (fast roaming) authentication to function properly.
CT
The htt-mgt firmware requires the use of the ath10k-ct driver. Normal non-htt-mgt ath10k-ct firmware should work
with stock drivers.
ath10k
I recall qca4019 have the following flow: pre-cal -> otp get chip id -> get proper board file -> populate via otp (see commit 3d9195ea19e48).
所以说看来我之前的猜测是正确的
openwrt
pre-cal
参考资料:
https://lists.infradead.org/pipermail/ath10k/2016-November/008766.html
https://lists.infradead.org/pipermail/ath10k/2017-January/009025.html
ps: 邮件列表真是个好地方