openwrt cc在mt7688上使用原厂wifi驱动出现“ERROR!!! MCUSysInit: NICLoadFirmware failed, Status[=0x00000001]”的解决方

在mtk官方的openwrt版本上,编译mt7688的版本,使用源码驱动包,没有任何问题,该版本使用的内核版本是3.10.14,但是将源码驱动包移植到openwrt cc(kernel 3.18.23)上时,就会出现如下错误:

[   23.610000] ===> rt2880_probe
[   23.610000] --> RTMPAllocAdapterBlock
[   23.780000] 
[   23.780000] 
[   23.780000] === pAd = c05f2000, size = 1457720 ===
[   23.780000] 
[   23.800000] -->RTMPAllocTxRxRingMemory
[   23.810000] TxRing[0]: total 1024 bytes allocated
[   23.820000] TxRing[1]: total 1024 bytes allocated
[   23.830000] TxRing[2]: total 1024 bytes allocated
[   23.840000] TxRing[3]: total 1024 bytes allocated
[   23.850000] MGMT Ring: total 2048 bytes allocated
[   23.860000] CTRL Ring: total 2048 bytes allocated
[   23.870000] Beacon Ring: total 320 bytes allocated
[   23.870000] TxBmcRing: total 1024 bytes allocated
[   23.880000] Rx[0] Ring: total 2048 bytes allocated
[   23.890000] Rx[1] Ring: total 1024 bytes allocated
[   23.900000] <-- RTMPAllocTxRxRingMemory, Status=0, ErrorValue=0x
[   23.920000] <-- RTMPAllocAdapterBlock, Status=0
[   23.930000] AP Driver version-4.0.1.3
[   23.930000] pAd->infType=4
[   23.940000] RtmpChipOpsHook(492): Not support for HIF_MT yet!
[   23.950000] CN: 3637544d     CID = 10102
[   23.960000] mt7628_init()-->
[   23.960000] mt7628_init(FW(8a00), HW(8a01), CHIPID(7628))
[   23.970000] e2.bin mt7628_init(1117)::(2), pChipCap->fw_len(63056)
[   23.980000] mt_bcn_buf_init(218): Not support for HIF_MT yet!
[   24.000000] <--mt7628_init()
[   24.000000] Chip specific bbpRegTbSize=0!
[   24.010000] Chip VCO calibration mode = 0!
[   24.020000] [PMF] Encryption mode = 2
[   24.030000] get_dev_name_prefix(): dev_idx = 0, dev_name_prefix=ra
[   24.040000] Allocate a net device with private data size=16!
[   24.130000] Allocate net device ops success!
[   24.130000] The name of the new ra interface is ra0
[   24.140000] Assign wdev_idx=0
[   24.150000] RtmpOSNetDevAttach()--->
[   24.160000] <---RtmpOSNetDevAttach(), ret=0
[   24.170000] ra0: at CSR addr 0xb0300000, IRQ 4. 
[   24.170000] <=== rt2880_probe
[   24.220000] MAC[Ver:Rev/ID=0x76280000 : 0x00007628]
[   24.230000] hif_sys_init()-->
[   24.240000] hif_sys_init():Disable WPDMA
[   24.250000] TxRing[0]: total 64 entry initialized
[   24.260000] TxRing[1]: total 64 entry initialized
[   24.270000] TxRing[2]: total 64 entry initialized
[   24.280000] TxRing[3]: total 64 entry initialized
[   24.290000] TX_BCN DESC a6366000 size = 320
[   24.290000] RX[0] DESC a6370000 size = 2048
[   24.300000] RX[1] DESC a6371000 size = 1024
[   24.310000] ==>  DMAIdle, GloCfg=0x50000450
[   24.320000] -->TX_RING_0[0x4310]: Base=0x6360000, Cnt=64!
[   24.330000] -->TX_RING_1[0x4300]: Base=0x6361000, Cnt=64!
[   24.340000] -->TX_RING_2[0x4320]: Base=0x6362000, Cnt=64!
[   24.350000] -->TX_RING_3[0x4330]: Base=0x6363000, Cnt=64!
[   24.360000] -->TX_BMC_RING [0x4380]: Base=0x6367000, Cnt=64!
[   24.380000] -->TX_RING_MGMT[0x4340]: Base=0x6364000, Cnt=128!
[   24.390000] -->TX_RING_BCN: Base=0x6366000, Cnt=20!
[   24.400000] -->TX_RING_CTRL: Base=0x6365000, Cnt=128!
[   24.410000] -->RX_RING0[0x4400]: Base=0x6370000, Cnt=128
[   24.420000] -->RX_RING1[0x4410]: Base=0x6371000, Cnt=128
[   24.430000] <--hif_sys_init(), Success!
[   24.590000] -->WscThreadInit()
[   24.600000] <--WscThreadInit(), status=0!
[   26.870000] <-- MLME Initialize
[   26.870000] --> UserCfgInit
[   26.880000] --> UserCfgInit. BACapability = 0x3024040
[   26.890000] <-- UserCfgInit
[   26.900000] CountryRegion=1
[   26.900000] CountryRegionABand=0
[   26.910000] E2pAccessMode=2
[   26.910000] CountryCode=
[   26.920000] BssidNum=1
[   26.920000] SSID[0]=mt7628-136A
[   26.930000] Channel=0
[   26.940000] cfg_mode=9
[   26.940000] BSS0 PhyMode=14
[   26.950000] cfg_mode=9
[   26.950000] Old WirelessMode:B/G(0x6), New WirelessMode:B/G/gN(0xe)!
[   26.960000] wmode_band_equal(): Band Equal!
[   26.970000] RT_CfgSetWirelessMode(): Set WMODE=B/G/gN(0xe)
[   26.980000] PhyMode=14
[   26.990000] BasicRate=15
[   26.990000] BeaconPeriod=200
[   27.000000] FreqDelta=0
[   27.000000] DtimPeriod=1
[   27.010000] TxPower=100
[   27.010000] BGProtection=0
[   27.020000] OLBCDetection=0
[   27.020000] TxPreamble=0
[   27.030000] RTSThreshold=2347
[   27.040000] FragThreshold=2346
[   27.040000] TxBurst=0
[   27.050000] PktAggregate=0
[   27.050000] I/F(ra0) WmmCapable=1
[   27.060000] I/F(ra0) DLSCapable=0
[   27.070000] APAifsn[0]=3
[   27.070000] APAifsn[1]=7
[   27.080000] APAifsn[2]=1
[   27.080000] APAifsn[3]=1
[   27.090000] APCwmin[0]=4
[   27.090000] APCwmin[1]=4
[   27.100000] APCwmin[2]=3
[   27.100000] APCwmin[3]=2
[   27.110000] APCwmax[0]=6
[   27.110000] APCwmax[1]=10
[   27.120000] APCwmax[2]=4
[   27.120000] APCwmax[3]=3
[   27.130000] APTxop[0]=0
[   27.130000] APTxop[1]=0
[   27.140000] APTxop[2]=94
[   27.140000] APTxop[3]=47
[   27.150000] APACM[0]=0
[   27.150000] APACM[1]=0
[   27.160000] APACM[2]=0
[   27.160000] APACM[3]=0
[   27.160000] BSSAifsn[0]=3
[   27.170000] BSSAifsn[1]=7
[   27.170000] BSSAifsn[2]=2
[   27.180000] BSSAifsn[3]=2
[   27.190000] BSSCwmin[0]=4
[   27.190000] BSSCwmin[1]=4
[   27.200000] BSSCwmin[2]=3
[   27.200000] BSSCwmin[3]=2
[   27.210000] BSSCwmax[0]=10
[   27.210000] BSSCwmax[1]=10
[   27.220000] BSSCwmax[2]=4
[   27.220000] BSSCwmax[3]=3
[   27.230000] BSSTxop[0]=0
[   27.230000] BSSTxop[1]=0
[   27.240000] BSSTxop[2]=94
[   27.240000] BSSTxop[3]=47
[   27.250000] BSSACM[0]=0
[   27.250000] BSSACM[1]=0
[   27.260000] BSSACM[2]=0
[   27.260000] BSSACM[3]=0
[   27.270000] AckPolicy[0]=0
[   27.270000] AckPolicy[1]=0
[   27.280000] AckPolicy[2]=0
[   27.280000] AckPolicy[3]=0
[   27.290000] APSDCapable[0]=1
[   27.290000] APSDCapable[1]=1
[   27.300000] APSDCapable[2]=1
[   27.310000] APSDCapable[3]=1
[   27.310000] APSDCapable[4]=1
[   27.320000] APSDCapable[5]=1
[   27.320000] APSDCapable[6]=1
[   27.330000] APSDCapable[7]=1
[   27.330000] APSDCapable[8]=1
[   27.340000] APSDCapable[9]=1
[   27.350000] APSDCapable[10]=1
[   27.350000] APSDCapable[11]=1
[   27.360000] APSDCapable[12]=1
[   27.360000] APSDCapable[13]=1
[   27.370000] APSDCapable[14]=1
[   27.380000] APSDCapable[15]=1
[   27.380000] default ApCliAPSDCapable[0]=1
[   27.390000] default ApCliAPSDCapable[1]=1
[   27.400000] I/F(ra0) NoForwarding=0
[   27.410000] NoForwardingBTNBSSID=0
[   27.410000] I/F(ra0) HideSSID=0
[   27.420000] I/F(ra0) StationKeepAliveTime=0
[   27.430000] AutoChannelAtBootup=1
[   27.430000] ShortSlot=1
[   27.440000] IEEE80211H=0
[   27.440000] RDRegion=0
[   27.450000] IF(ra0)::AuthMode=7
[   27.460000] I/F(ra0) EncrypType=8
[   27.460000] I/F(ra0) ReKeyMethod=0
[   27.470000] I/F(ra0) ReKeyInterval=3600
[   27.480000] I/F(ra0) PMKCachePeriod=60000
[   27.490000] I/F(ra0) WPAPSK_KEY=12345678
[   27.680000] I/F(ra0) WPAPSK Key => 
[   27.690000] 7f:5e:bf:6c:10:03:43:3d:22:5c:9f:85:8f:79:9f:db:
[   27.700000] 52:9e:8b:34:d7:f5:4b:1f:c8:8c:4f:75:37:67:78:33:
[   27.710000] 
[   27.720000] I/F(ra0) DefaultKeyID(0~3)=0
[   27.720000] Key1Str is Invalid key length(0) or Type(0)
[   27.730000] Key2Str is Invalid key length(0) or Type(0)
[   27.740000] Key3Str is Invalid key length(0) or Type(0)
[   27.760000] Key4Str is Invalid key length(0) or Type(0)
[   27.770000] AccessPolicy0=0
[   27.770000] AccessControlList0=Get 0 Mac Address
[   27.780000] AccessPolicy1=0
[   27.790000] AccessControlList1=Get 0 Mac Address
[   27.800000] AccessPolicy2=0
[   27.800000] AccessControlList2=Get 0 Mac Address
[   27.810000] AccessPolicy3=0
[   27.820000] AccessControlList3=Get 0 Mac Address
[   27.830000] ApCliEntry[0].Enable=0
[   27.840000] I/F(apcli0) DefaultKeyID(0~3)=0
[   27.850000] own_ip_addr=192.168.5.234(ea05a8c0)
[   27.860000] session_timeout_interval=0
[   27.870000] NO.0 EAPifname=br-lan, len=6
[   27.880000] NO.0 PreAuthifname=br-lan, len=6
[   27.890000] I/F(ra0) PreAuth=0
[   27.890000] IF(ra0), radius_ip(seq-1)=0(0)
[   27.900000] IF(ra0), radius_port(seq-1)=1812
[   27.920000] HT: Protection  = Enable
[   27.920000] HT: BA Decline  = Disable
[   27.930000] HT: Auto BA  = Enable
[   27.940000] HT: RDG = Disable
[   27.940000] HT: Tx A-MSDU = Disable
[   27.950000] HT: MPDU Density = 5
[   27.960000] HT: BA Windw Size = 64
[   27.960000] HT: Guard Interval = 400
[   27.970000] HT: HT_LDPC = 1
[   27.980000] HT: Operate Mode = Mixed Mode
[   27.990000] (IF-ra0) Fixed Tx Mode = 0
[   27.990000] HT: Channel Width = 40 MHz
[   28.000000] HT: Ext Channel = BELOW
[   28.010000] (IF-ra0) HT: MCS = AUTO(33)
[   28.020000] HT: STBC = 0
[   28.020000] HT: Tx Stream = 2
[   28.030000] HT: Rx Stream = 2
[   28.030000] HT: Disallow TKIP mode = OFF
[   28.040000] HT: 20/40 BssCoexSupport = OFF
[   28.050000] I/F(ra0) WscConfMode=0
[   28.060000] I/F(ra0) WscConfStatus=2
[   28.070000] WCNTest=0
[   28.090000] RT_CfgSetWscPinCode():Wsc PinCode=0
[   28.100000] RTMPSetProfileParameters - WscVendorPinCode= (1)
[   28.110000] RTMPSetDefaultChannel() : default channel to 1 
[   28.120000] MCUSysInit
[   28.130000] AndesMTPciFwInit
[   28.130000] ==>  DMAIdle, GloCfg=0x52000850
[   28.140000] <== RT28XXDMAEnable(): WPDMABurstSIZE = 3
[   28.150000] load fw image from fw_header_image
[   28.160000] AndesMTLoadFwMethod1(2174)::pChipCap->fw_len(63056)
[   28.170000] FW Version:_e2_mp
[   28.180000] FW Build Date:20150211175503
[   28.190000] 
[   28.190000] download len = 63020
[   28.200000] TOP_MSIC = 71
[   28.200000] Start address = 100000, DL length = 63020, Data mode = 80000000
[   29.100000] Not expected one of them is 0, TxTotalByteCnt = 0, RxTotalByteCnt = 0
[   29.110000] CmdSlotTimeSet:(ret = 0)
[   29.120000] MtAsicSetSlotTime(1226): SetSlotTime!
[   30.110000] Not expected one of them is 0, TxTotalByteCnt = 0, RxTotalByteCnt = 0
[   31.120000] Not expected one of them is 0, TxTotalByteCnt = 0, RxTotalByteCnt = 0
[   31.210000] command (1), ext_cmd_type (0), seq(1), timeout(3000ms)
[   31.220000] txq qlen = 0
[   31.220000] rxq qlen = 0
[   31.230000] kickq qlen = 0
[   31.230000] ackq qlen = 1
[   31.240000] tx_doneq.qlen = 0
[   31.240000] rx_done qlen = 0
[   31.250000] AndesSendCmdMsg: msg state = 8
[   31.260000] msg->retransmit_times = 0
[   31.260000] AndesSendCmdMsg: msg state = 3
[   31.270000] CmdAddressLenReq:(ret = 1)
[   31.280000] NICLoadFirmware::load fw spent 3130ms
[   31.290000] ERROR!!! MCUSysInit: NICLoadFirmware failed, Status[=0x00000001]
[   31.300000] AndesMTPciFwExit
[   31.310000] tx_kickout_fail_count = 0
[   31.320000] tx_timeout_fail_count = 1
[   31.320000] rx_receive_fail_count = 0
[   31.330000] alloc_cmd_msg = 2
[   31.340000] free_cmd_msg = 2
[   31.340000] ==> MlmeHalt
[   31.350000] <---MlmeThread
[   31.420000] --->Disable TSF synchronization
[   31.520000] <== MlmeHalt
[   35.560000] <---RTPCICmdThread
[   35.810000] !!! rt28xx init fail !!!

花了很长时间去调试,也试过mtk提供的ko文件(https://github.com/MediaTek-Labs/linkit-smart-7688-feed),但是加载后up ra0内核会crash(去掉netfilter就好了)。

最终解决方法很简单,就是将驱动中rtmp_rbs.h中的RTMP_MAC_IRQ_NUM的定义有4改为6,之后wifi一切正常。至于具体原因,如有人能够解答,不胜感激。

相关文章
相关标签/搜索