Bootstrap

【WiFi】QCA6174A根据GPIO加载不同bdwlan文件修改实现

QCA6174A

   Designed to deliver a cost-effective Wi-Fi/Bluetooth combo solution, the Qualcomm® QCA6174A SoC (System-on-Chip) is an integrated, single-chip solution in a small form factor for mobile and consumer electronics applications.

    QCA6174A supports high-speed Wi-Fi connectivity and enriched media experiences. It is optimized for energy efficiency, which is critical to extending the battery life of portable devices.

   QCA6174A has integrated RF front-end and single-ended design for simpler and low-cost design. There are three variants available for QCA6174A:

QCA6174A-1: supports low power PCIe 2.1 (w/L1 substate) interface for WLAN and UART/PCM interface for Bluetooth
QCA6174A-3: supports low-power SDIO 3.0 interface for WLAN and UART/PCM interface for Bluetooth
QCA6174A-5: supports low power PCIe 2.1 (w/L1 substate) for WLAN and USB 1.1 interface for Bluetooth.

驱动加载日志

[  726.670213] wlan: loading driver v4.0.11.213X
[  726.730180] msm_pcie_enable: PCIe: Assert the reset of endpoint of RC0.
[  726.734621] msm_pcie_enable: PCIe: RC0: PCIE20_PARF_INT_ALL_MASK: 0x7f80c202
[  726.735868] pcie_phy_init: PCIe RC0 PHY is ready!
[  726.746020] msm_pcie_enable: PCIe: Release the reset of endpoint of RC0.
[  726.778509] msm_pcie_link_train: PCIe RC0 link initialized
[  726.789604] cnss_wlan_pci 0000:01:00.0: Direct firmware load for evicted30.bin failed with error -2
[  726.792956] hif_pci_probe:, con_mode= 0x0
[  726.793102] PCI device id is 003e :003e
[  726.795426]
[  726.795426]  hif_pci_configure : num_desired MSI set to 0
[  726.795501]
[  726.795501]  Using PCI Legacy Interrupt
[  726.836397] hif_pci_probe: ramdump base 0xf9da142d size 2097152
[  726.845189] R0: wlan: [15212:E :HDD] hdd_apply_cfg_ini: Reg Parameter gRrmOperChanMax > allowed Maximum [8 > 7]. Enforcing Default= 4
[  726.845222] R0: wlan: [15212:E :HDD] hdd_apply_cfg_ini: Reg Parameter gRrmNonOperChanMax > allowed Maximum [8 > 7]. Enforcing Default= 4
[  726.848721] R0: wlan: [15212:E :HDD] Name = [g_mcs_tx_force2chain] Value = [0]
[  726.848782] ipa ipa3_uc_reg_rdyCB:3198 bad parm. inout=00000000
[  726.849806] R0: wlan: [15212:E :HDD] Name = [g_mcs_tx_force2chain] Value = [0]
[  726.849873] cnss_logger: cnss_logger_device_register: driver: [wlan] is registered as radio-0
[  726.849889] R0: wlan: [15212:E :HDD] nl_srv_init: radio_index: 0
[  726.851808] NUM_DEV=1 FWMODE=0x2 FWSUBMODE=0x0 FWBR_BUF 0
[  726.854714] ol_download_firmware: Using 0x1234 for the remainder of init
[  726.854723] ol_transfer_codeswap_struct: failed to get codeswap structure
[  726.876987] R0: wlan: [15212:E :VOS] __ol_transfer_bin_file: transferring file: otp30.bin size 23773 bytes done!
[  726.877234] ol_download_firmware: chip_id:0x5030000 board_id:0x0
[  726.877765] cnss_wlan_pci 0000:01:00.0: Direct firmware load for bdwlan30.b00 failed with error -2
[  726.877776] __ol_transfer_bin_file: Failed to get bdwlan30.b00:-2
[  726.882374] __ol_transfer_bin_file: Trying to load default bdwlan30.bin
[  726.885204] Board extended Data download address: 0x0
[  726.891058] R0: wlan: [15212:E :VOS] __ol_transfer_bin_file: transferring file: bdwlan30.bin size 8124 bytes done!
[  726.891375] __ol_transfer_bin_file: no Setup file defined
[  727.591508] R0: wlan: [15212:E :VOS] __ol_transfer_bin_file: transferring file: qwlan30.bin size 740130 bytes done!
[  727.592276] +HTCCreate ..  HIF :00000000
[  727.592318] -HTCCreate (0x00000000)
[  727.617188] R0: wlan: [15212:F :WDA] WMA --> wmi_unified_attach - success
[  727.617226] ol_if_dfs_attach: called; ptr=00000000, radar_info=00000000
[  727.637558] R0: wlan: [15212:E :SAP] dfs_init_radar_filters[217]: Unknown dfs domain 0
[  727.637687] +HWT
[  727.637699] pipe_num:0 pipe_info:0x00000000
[  727.637968] pipe_num:3 pipe_info:0x00000000
[  727.637997] pipe_num:4 pipe_info:0x00000000
[  727.638849] pipe_num:5 pipe_info:0x00000000
[  727.653247] Target Ready! : transmit resources : 2 size:1792, MaxMsgsPerHTCBundle = 1
[  727.653285] HTC Service Index : 1 TX : 0x100 : alloc:2
[  727.653295] HTC Service:0x0001, ULpipe:0 DLpipe:1 id:0 Ready
[  727.653300] -HWT
[  727.654568] is_full_reorder_offloaded? 1
[  727.654580] HTC Service TX : 0x300 : allocation is zero!
[  727.655319] HTC Service:0x0300, ULpipe:4 DLpipe:1 id:1 Ready
[  727.655329] HTC Service:0x0300 ep:1 TX flow control disabled
[  727.673450] HTT: full reorder offload enabled
[  727.680240] HTC Service:0x0100, ULpipe:3 DLpipe:2 id:2 Ready
[  727.680259] R0: wlan: [15212:F :WDA] WMA --> wmi_unified_connect_htc_service - success
[  727.680296] R0: wlan: [15221:F :WDA] McThread: WNI_CFG_DNLD_REQ
[  727.680364] HTC using TX credit flow control
[  727.680732] R0: wlan: [6977:F :WDA] WMA <-- WMI_SERVICE_READY_EVENTID
[  727.680745] R0: wlan: [6977:E :WDA] wma_rx_service_ready_event: Firmware build version : 000001b8
[  727.680755] R0: wlan: [6977:E :WDA] wma_rx_service_ready_event: Board version: 0.1011114
[  727.680778] R0: wlan: [6977:F :WDA] WMA --> WMI_INIT_CMDID
[  727.697414] R0: wlan: [6977:F :WDA] WMA <-- WMI_READY_EVENTID
[  727.699087] R0: wlan: [15212:E :SME] csr_init_chan_list: 408: init time country code US
[  727.699258] R0: wlan: [15212:F :HDD] pAdapter is null !!
[  727.699588] R0: wlan: [15212:E :WDA] regdmn_set_dfs_region: dfs_region: 1
[  727.700917] cnss_pci_get_wlan_mac_address: Platform Driver doesn't have any mac address
[  727.701061] cnss_wlan_pci 0000:01:00.0: Direct firmware load for wlan/qca_cld/wlan_mac.bin failed with error -2
[  727.701084] R0: wlan: [15212:F :HDD] hdd_wlan_startup: 17533: IPA is ready
[  727.701446] R0: wlan: [15221:E :WDA] Invalid wda_cli_set pdev command/Not yet implemented 0x4d
[  727.701482] R0: wlan: [15221:E :WDA] Invalid wda_cli_set pdev command/Not yet implemented 0x88
[  727.701549] R0: wlan: [15221:E :WDA] Invalid wda_cli_set pdev command/Not yet implemented 0x23
[  727.704097] R0: wlan: [15212:E :HDD] hdd_ipa_init:5250: UC Ready
[  727.707330] R0: wlan: [15212:E :HDD] hdd_ipa_uc_ol_init:2093: hdd_ipa_uc_ol_init CONS DB pipe out 0x7b720c8 TX PIPE Handle 0x0
[  727.707345] R0: wlan: [15212:E :HDD] hdd_ipa_uc_ol_init:2122: hdd_ipa_uc_ol_init: IPA RM DISABLED, IPA AWAKE
[  727.709883] R0: wlan: [15212:E :HDD] hdd_ipa_uc_ol_init:2145: hdd_ipa_uc_ol_init PROD DB pipe out 0x7b720c0
[  727.709978] R0: wlan: [15212:E :WDA] MCC TX Pause Event Handler register
[  727.709991] R0: wlan: [15212:E :WDA] Target does not support cesium network
[  727.711462] Pkt log is disabled
[  727.711492] R0: wlan: [15212:E :SME] sme_AddChAvoidCallback: Plug in CH AVOID CB
[  727.711503] R0: wlan: [15212:E :SME] sme_AddCSAIndCallback: Plug in CSA Notify CB
[  727.711579] target uses HTT version 3.87; host uses 3.28
[  727.711585] *** Warning: host/target HTT versions are different, though compatible!
[  727.713061] R0: wlan: [15221:E :WDA] wma_unified_vdev_create_send: ID = 0 VAP Addr = 00:03:7f:50:00:01
[  727.713253] R0: wlan: [15221:E :WDA] invalid rate code, ignore.
[  727.724990] R0: wlan: [15221:E :WDA] Invalid wda_cli_set pdev command/Not yet implemented 0x34
[  727.725474] Host SW:4.0.11.213X, FW:0.0.0.440, HW:QCA6174_REV3_2
[  727.725482] [CLD-REGDB-DEBUG]: freq 2412 flags 0x1a0
[  727.725488] [CLD-REGDB-DEBUG]: freq 2417 flags 0x1a0
[  727.725493] [CLD-REGDB-DEBUG]: freq 2422 flags 0x1a0
[  727.725499] [CLD-REGDB-DEBUG]: freq 2427 flags 0x1a0
[  727.725504] [CLD-REGDB-DEBUG]: freq 2432 flags 0x180
[  727.725509] [CLD-REGDB-DEBUG]: freq 2437 flags 0x180
[  727.725515] [CLD-REGDB-DEBUG]: freq 2442 flags 0x180
[  727.725520] [CLD-REGDB-DEBUG]: freq 2447 flags 0x190
[  727.725526] [CLD-REGDB-DEBUG]: freq 2452 flags 0x190
[  727.725531] [CLD-REGDB-DEBUG]: freq 2457 flags 0x190
[  727.725536] [CLD-REGDB-DEBUG]: freq 2462 flags 0x190
[  727.725542] [CLD-REGDB-DEBUG]: freq 2467 flags 0x31
[  727.725547] [CLD-REGDB-DEBUG]: freq 2472 flags 0x31
[  727.725553] [CLD-REGDB-DEBUG]: freq 2484 flags 0x31
[  727.725559] [CLD-REGDB-DEBUG]: freq 5180 flags 0x120
[  727.725564] [CLD-REGDB-DEBUG]: freq 5200 flags 0x100
[  727.725569] [CLD-REGDB-DEBUG]: freq 5220 flags 0x100
[  727.725575] [CLD-REGDB-DEBUG]: freq 5240 flags 0x100
[  727.725580] [CLD-REGDB-DEBUG]: freq 5260 flags 0x108
[  727.725586] [CLD-REGDB-DEBUG]: freq 5280 flags 0x108
[  727.725591] [CLD-REGDB-DEBUG]: freq 5300 flags 0x108
[  727.725597] [CLD-REGDB-DEBUG]: freq 5320 flags 0x118
[  727.725602] [CLD-REGDB-DEBUG]: freq 5500 flags 0x28
[  727.725607] [CLD-REGDB-DEBUG]: freq 5520 flags 0x8
[  727.725612] [CLD-REGDB-DEBUG]: freq 5540 flags 0x8
[  727.725618] [CLD-REGDB-DEBUG]: freq 5560 flags 0x8
[  727.725623] [CLD-REGDB-DEBUG]: freq 5580 flags 0x8
[  727.725628] [CLD-REGDB-DEBUG]: freq 5600 flags 0x8
[  727.725633] [CLD-REGDB-DEBUG]: freq 5620 flags 0x8
[  727.725638] [CLD-REGDB-DEBUG]: freq 5640 flags 0x8
[  727.725643] [CLD-REGDB-DEBUG]: freq 5660 flags 0x8
[  727.725648] [CLD-REGDB-DEBUG]: freq 5680 flags 0x8
[  727.725654] [CLD-REGDB-DEBUG]: freq 5700 flags 0x8
[  727.725658] [CLD-REGDB-DEBUG]: freq 5720 flags 0x18
[  727.725664] [CLD-REGDB-DEBUG]: freq 5745 flags 0x120
[  727.725669] [CLD-REGDB-DEBUG]: freq 5765 flags 0x100
[  727.725674] [CLD-REGDB-DEBUG]: freq 5785 flags 0x100
[  727.725679] [CLD-REGDB-DEBUG]: freq 5805 flags 0x100
[  727.725685] [CLD-REGDB-DEBUG]: freq 5825 flags 0x110
[  727.725690] [CLD-REGDB-DEBUG]: freq 5845 flags 0x31
[  727.725695] [CLD-REGDB-DEBUG]: freq 5865 flags 0x31
[  727.725700] [CLD-REGDB-DEBUG]: freq 5885 flags 0x31
[  727.725924] cnss_logger: logger_register_device_event: radio: 0, event: 25
[  727.725933] cnss_logger: logger_register_device_event: radio: 0, event: 17
[  727.725939] cnss_logger: logger_register_device_event: radio: 0, event: 23
[  727.730414] cnss_logger: logger_register_device_event: radio: 0, event: 27
[  727.733413] R0: wlan: [15221:E :WDA] TM sending the following to firmware: min 50 max 100 enable 1
[  727.733430] R0: wlan: [15221:E :WDA] TM Sending thermal mgmt cmd: low temp 50, upper temp 100, enabled 1
[  727.734181] R0: wlan: [15221:E :WDA] DPD Recal sending the following to firmware: delta_degreeLow 25 delta_degreehigh 35 enable 1 cooling_time 1 dpd_max_duration 120
[  727.734200] R0: wlan: [15221:E :WDA] Sending DPD Recal cmd: low temp 25, high temp 35, enabled 1 cooling_time 1, dpd_dur_max 120
[  727.734705] ol_pktlog_init: pktlogmod_init successfull
[  727.735897] ENTER sme_set_btc_coex_dutycycle = 30
[  727.735903] ENTER sme_set_btc_coex_dutycycle =30
[  727.736491] wlan: driver loaded in 1093592
[  728.801989] sgm4154x_get_state chrg_stat =37,vbus_status =24 online = 1
[  728.803983] charger_monitor_work_func
[  729.194424] web num = 68 web_rc=68
[  730.802138] R0: wlan: [0:E :HDD] __hdd_set_multicast_list: 10777: mc addr list ini is disabled
[  730.809020] R0: wlan: [0:E :HDD] __hdd_set_multicast_list: 10777: mc addr list ini is disabled
[  730.818298] R0: wlan: [0:E :HDD] __hdd_set_multicast_list: 10777: mc addr list ini is disabled
[  730.945952] R0: wlan: [0:E :HDD] __hdd_set_multicast_list: 10777: mc addr list ini is disabled
[  730.955193] R0: wlan: [15336:E :VOS] vos_get_context: vos context pointer is null
[  730.955209] R0: wlan: [15336:E :HDD] wlan_hdd_get_dfs_mode: 21067: ACS dfs mode is NONE
[  730.955490] R0: wlan: [15221:E :WDA] wma_unified_vdev_create_send: ID = 0 VAP Addr = 40:5f:7d:9c:a0:3f
[  730.955667] R0: wlan: [15221:E :WDA] invalid rate code, ignore.
[  730.955875] R0: wlan: [15336:F :HDD] __wlan_hdd_cfg80211_get_txpower: 26454: pAdapter is NULL
[  730.962325] R0: wlan: [15336:F :HDD] __wlan_hdd_cfg80211_get_txpower: 26454: pAdapter is NULL
[  730.965603] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  730.978703] R0: wlan: [6977:E :WDA] regdmn_set_dfs_region: dfs_region: 0
[  731.003443] bridge0: port 1(wlan0) entered blocking state
[  731.003454] bridge0: port 1(wlan0) entered disabled state
[  731.019400] device wlan0 entered promiscuous mode
[  731.021739] bridge0: port 1(wlan0) entered blocking state
[  731.021751] bridge0: port 1(wlan0) entered forwarding state
[  731.026793] R0: wlan: [15343:F :HDD] __wlan_hdd_cfg80211_get_txpower: 26454: pAdapter is NULL
[  734.515273] web num = 68 web_rc=68
[  736.015609] R0: wlan: [15343:E :HDD] hdd_hostapd_SAPEventCB: usrDataForCallback is null
[  736.020355] R0: wlan: [15343:F :HDD] __wlan_hdd_cfg80211_get_txpower: 26454: pAdapter is NULL
[  736.942233] R0: wlan: [15221:E :SME] sme_SelectCBMode: HW: 16 CH: 1 ORIG_BW: 0
[  736.942233]
[  736.943311] R0: wlan: [15343:F :HDD] __wlan_hdd_cfg80211_get_txpower: 26454: pAdapter is NULL
[  737.024251] R0: wlan: [15343:E :HDD] wlan_hdd_get_dfs_mode: 21067: ACS dfs mode is NONE
[  737.024273] R0: wlan: [15343:E :SAP] WLANSAP_set_Dfs_Restrict_JapanW53: 3656: Regdomain not japan, set disable JP W53 not valid
[  737.024284] R0: wlan: [15343:E :SAP] WLANSAP_set_Dfs_Preferred_Channel_location: 3730: sapdfs:NOT JAPAN REG, Invalid Set preferred chans location
[  737.025036] R0: wlan: [15343:E :SME] sme_SelectCBMode: HW: 16 CH: 1 ORIG_BW: 0
[  737.025036]
[  737.025819] R0: wlan: [15343:E :HDD] wlan_hdd_cfg80211_update_apies: 17713: qcdbg, probe resp ie len:6
[  737.025931] R0: wlan: [15343:E :SME] sme_SelectCBMode: HW: 16 CH: 1 ORIG_BW: 0
[  737.025931]
[  737.026723] R0: wlan: [15343:E :SME] sme_SelectCBMode: HW: 16 CH: 1 ORIG_BW: 0
[  737.026723]
[  737.028301] R0: wlan: [15221:E :PE ] limMlmAddBss: 1714: TRYING TO HIDE SSID 0
[  737.028328] R0: wlan: [15221:E :PE ] mlm_add_sta: 1602: GF: 0, ChnlWidth: 0, MimoPS: 3, lsigTXOP: 0, dsssCCK: 0, SGI20: 1, SGI401
[  737.028412] R0: wlan: [15221:E :WDA] wma_create_peer: Created peer with peer_addr 40:5f:7d:9c:a0:3f vdev_id 0, peer_count - 1
[  737.028502] R0: wlan: [15221:E :WDA] BSS chan width: quarterrate_flag: 0, halfrate_flag: 0
[  737.145728] R0: wlan: [15221:E :HDP] hdr::
[  737.145770] R0: wlan: [15221:E :HDP] 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 03 7f aa
[  737.145797] R0: wlan: [15221:E :HDP] 00000010: bb cc 40 5f 7d 9c a0 3f 08 00
[  737.145915] R0: wlan: [15221:E :HDP] hdr::
[  737.145946] R0: wlan: [15221:E :HDP] 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 03 7f aa
[  737.145971] R0: wlan: [15221:E :HDP] 00000010: bb cc 40 5f 7d 9c a0 3f 86 dd
[  737.154719] R0: wlan: [15221:E :HDD] wlan(0) 00:00:00:00:00:00 SCC
[  737.154754] R0: wlan: [15221:E :HDD] AP(1) 40:5f:7d:9c:a0:3f
[  737.161144] R0: wlan: [15343:E :HDD] hdd_ipa_uc_find_add_assoc_sta:1337: hdd_ipa_uc_find_add_assoc_sta: STA ID 0 does not exist, cannot delete
[  737.161178] R0: wlan: [15343:E :HDD] hdd_ipa_wlan_evt:4803: (null): STA ID 0 NOT found, not valid
[  737.161209] R0: wlan: [15343:E :HDD] hdd_softap_sta_disassoc:(00000000, false)
[  737.170722] R0: wlan: [15221:E :WDA] wma_ipa_offload_enable_disable: offload_type=0, enable=1
[  737.173706] R0: wlan: [15221:F :WDA] BSS Key setup with vdev_mac 40:5f:7d:9c:a0:3f
[  737.173706]
[  737.173966] TXRX: Couldn't find peer from ID 63 - skipping security inits
[  737.192185] ipa ipa3_ioctl:3564 using obselete command: IPA_IOC_RM_ADD_DEPENDENCY
[  737.192482] ipa ipa3_ioctl:3564 using obselete command: IPA_IOC_RM_ADD_DEPENDENCY

功能描述

根据不同的硬件配置,加载不同的golden bin文件实现

软件通过不同GPIO配置来判断加载不同的golden bin文件,使用GPIO81/GPIO83/GPIO84/GPIO88

 gpio81  : in  low  func0 2mA pull down
 gpio83  : in  low  func0 2mA pull down
 gpio84  : in  low  func0 2mA pull down
 gpio88  : in  low  func0 2mA pull down

gpio列表

/ # cat /sys/kernel/debug/gpio
gpiochip1: GPIOs 912-923, parent: platform/200f000.qcom,spmi:qcom,pmd9650@0:pinctrl@c000, 200f000.qcom,spmi:qcom,pmd9650@0:pinctrl@c000:
 gpio1 : out  high normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio2 : ---
 gpio3 : ---
 gpio4 : ---
 gpio5 : in   low  normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio6 : out  high normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio7 : in   low  normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio8 : in   low  normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio9 : out  low  func1   vin-0 pull-down 10uA              open-source medium  atest-1 dtest-0
 gpio10: in   low  normal  vin-0 pull-down 10uA              push-pull  high    atest-1 dtest-0
 gpio11: ---
 gpio12: ---
gpiochip0: GPIOs 924-1023, parent: platform/1000000.pinctrl, 1000000.pinctrl:
 gpio0   : out low  func0 2mA no pull
 gpio1   : in  high func1 2mA no pull
 gpio2   : out low  func0 2mA no pull
 gpio3   : out low  func0 2mA no pull
 gpio4   : in  high func0 2mA no pull
 gpio5   : in  high func0 2mA no pull
 gpio6   : in  high func0 2mA no pull
 gpio7   : in  high func0 2mA no pull
 gpio8   : out low  func3 2mA no pull
 gpio9   : out low  func3 2mA no pull
 gpio10  : in  high func4 2mA pull up
 gpio11  : in  high func4 2mA pull up
 gpio12  : in  high func0 2mA pull down
 gpio13  : in  low  func0 2mA pull down
 gpio14  : in  low  func0 2mA pull down
 gpio15  : in  low  func0 2mA pull down
 gpio16  : in  low  func0 2mA pull down
 gpio17  : in  low  func0 2mA pull down
 gpio18  : in  low  func0 2mA pull down
 gpio19  : in  low  func0 2mA pull down
 gpio20  : in  low  func0 2mA pull down
 gpio21  : in  low  func0 2mA pull down
 gpio22  : in  low  func0 2mA pull down
 gpio23  : in  low  func0 2mA pull down
 gpio24  : in  low  func0 2mA pull down
 gpio25  : in  high func0 2mA pull down
 gpio26  : in  low  func1 4mA pull down
 gpio27  : in  low  func1 4mA pull down
 gpio28  : out high func0 2mA pull down
 gpio29  : out low  func2 2mA no pull
 gpio30  : out low  func1 2mA no pull
 gpio31  : out low  func1 2mA no pull
 gpio32  : out low  func1 2mA no pull
 gpio33  : out low  func1 2mA no pull
 gpio34  : out low  func1 2mA no pull
 gpio35  : out low  func1 2mA no pull
 gpio36  : in  low  func0 2mA pull down
 gpio37  : out low  func0 2mA pull down
 gpio38  : out low  func1 2mA no pull
 gpio39  : out low  func1 2mA no pull
 gpio40  : in  low  func0 2mA pull down
 gpio41  : in  low  func1 2mA pull down
 gpio42  : in  high func1 2mA pull down
 gpio43  : in  low  func0 2mA pull down
 gpio44  : in  low  func1 6mA pull down
 gpio45  : in  low  func1 6mA pull down
 gpio46  : in  low  func1 6mA pull down
 gpio47  : in  low  func1 6mA pull down
 gpio48  : in  low  func1 4mA pull down
 gpio49  : in  low  func1 4mA pull down
 gpio50  : out high func0 2mA pull down
 gpio51  : in  high func0 2mA keeper
 gpio52  : out low  func1 2mA pull up
 gpio53  : in  high func1 2mA pull up
 gpio54  : in  high func0 2mA keeper
 gpio55  : in  low  func0 2mA keeper
 gpio56  : in  high func0 2mA keeper
 gpio57  : in  high func0 2mA keeper
 gpio58  : in  low  func0 2mA pull down
 gpio59  : in  low  func0 2mA pull down
 gpio60  : out high func0 2mA pull down
 gpio61  : in  high func0 2mA no pull
 gpio62  : in  low  func0 2mA pull down
 gpio63  : in  high func0 2mA pull down
 gpio64  : in  high func1 2mA pull up
 gpio65  : in  high func0 2mA pull up
 gpio66  : in  low  func0 2mA pull down
 gpio67  : in  low  func0 2mA pull down
 gpio68  : in  low  func0 2mA pull down
 gpio69  : out low  func1 2mA pull down
 gpio70  : in  low  func0 2mA pull down
 gpio71  : in  low  func0 2mA pull down
 gpio72  : in  low  func1 4mA pull down
 gpio73  : in  low  func1 4mA pull down
 gpio74  : in  low  func1 4mA pull down
 gpio75  : in  low  func1 4mA pull down
 gpio76  : out low  func0 2mA no pull
 gpio77  : in  low  func1 2mA no pull
 gpio78  : out low  func0 2mA no pull
 gpio79  : out low  func0 2mA no pull
 gpio80  : in  low  func0 2mA pull down
 gpio81  : in  low  func0 2mA pull down
 gpio82  : out low  func0 2mA pull down
 gpio83  : in  low  func0 2mA pull down
 gpio84  : in  low  func0 2mA pull down
 gpio85  : out low  func0 2mA pull down
 gpio86  : in  high func0 2mA pull down
 gpio87  : out low  func0 2mA pull down
 gpio88  : in  low  func0 2mA pull down
 gpio89  : in  low  func0 2mA pull down
 gpio90  : in  low  func0 2mA pull down
 gpio91  : out low  func0 2mA pull down
 gpio92  : in  low  func0 2mA pull down
 gpio93  : in  high func0 2mA pull down
 gpio94  : in  low  func0 2mA pull down
 gpio95  : out high func0 2mA pull down
 gpio96  : in  low  func0 2mA pull down
 gpio97  : in  low  func0 2mA pull down
 gpio98  : in  low  func0 2mA pull down
 gpio99  : in  low  func0 2mA pull down

功能实现

新增golden bin

cnss_proc_firmware/cnss_proc/wlan/fw/target/halphy/ftm/host/systemtools/tools/eepromUtil/qc6174/bdwlan30_new.bin	

修改打包新的golden bin

common/config/contents.xml

找到对应平台的wifi bin打包位置,新增


      <file_ref get_binary="True" ubi_file="True" minimized="True">
        <file_name>bdwlan30_new.bin</file_name> 

<file_path>cnss_proc_firmware/cnss_proc/wlan//fw/target/halphy/ftm/host/systemtools/tools/eepromUtil/qc6174/</file_path>
      </file_ref>

修改wifi驱动

apps_proc/wlan/qcacld-2.0/CORE/SERVICES/BMI/ol_fw.c

注意:

     GPIO在驱动里面需要增加偏移924

diff --git a/apps_proc/wlan/qcacld-2.0/CORE/SERVICES/BMI/ol_fw.c b/apps_proc/wlan/qcacld-2.0/CORE/SERVICES/BMI/ol_fw.c
--- a/apps_proc/wlan/qcacld-2.0/CORE/SERVICES/BMI/ol_fw.c
+++ b/apps_proc/wlan/qcacld-2.0/CORE/SERVICES/BMI/ol_fw.c
@@ -27,6 +27,9 @@
 
 #include <linux/firmware.h>
 #include <linux/pm_qos.h>
+#if (defined(CONFIG_CNSS) || defined(HIF_SDIO))
+#include <linux/gpio.h>  
+#endif
 #include "ol_if_athvar.h"
 #include "ol_fw.h"
 #include "targaddrs.h"
@@ -623,12 +626,40 @@
 	return QCA_FIRMWARE_FILE;
 }
 #endif

+#if (defined(CONFIG_CNSS) || defined(HIF_SDIO))
+int check_wifi_bdwlan_filename(char *filename)
+{
+	int hwid[4] = {0};
+
+	hwid[0] = gpio_get_value(1005);
+	hwid[1] = gpio_get_value(1007);
+	hwid[2] = gpio_get_value(1008);
+	hwid[3] = gpio_get_value(1012);
+	
+	
+	if( hwid[0] == 0 && hwid[1] == 0 && hwid[2] == 1 && hwid[3] == 0)
+    {
+		strncpy(filename,"bdwlan30_new.bin",strlen("bdwlan30_new.bin"));
+		pr_info("HWID:%d%d%d%d\n",hwid[0],hwid[1],hwid[2],hwid[3]);
+		return 1;
+    }
+    else
+    {
+        pr_info("HWID:%d%d%d%d\n",hwid[0],hwid[1],hwid[2],hwid[3]);
+		return 0;
+    }	
+}
+#endif
 
 static int __ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file,
 				u_int32_t address, bool compressed)
 {
 	int status = EOK;
 	const char *filename = NULL;
+	char tmpfilename[32] = {0};
 	const struct firmware *fw_entry;
 	u_int32_t fw_entry_size;
 	u_int8_t *tempEeprom;
@@ -777,11 +808,23 @@
 				return -1;
 			}
 
-			pr_info("%s: Trying to load default %s\n",
-							__func__, filename);
-
-			status = qca_request_firmware(&fw_entry, filename,
+		    
+			if(check_wifi_bdwlan_filename(tmpfilename) == 1)
+			{
+                
+				status = qca_request_firmware(&fw_entry, tmpfilename,
+					scn->sc_osdev->device); 
+				pr_info("%s: Trying to load default oldfilename=%s newfilename=%s\n",
+							__func__, filename,tmpfilename);
+			}
+			else
+			{
+				status = qca_request_firmware(&fw_entry, filename,
 					scn->sc_osdev->device);
+				pr_info("%s: Trying to load default %s\n",
+							__func__, filename);
+			}
+		
 			if (status) {
 				pr_err("%s: Failed to get %s:%d\n",
 						__func__, filename, status);

测试验证

加载驱动查看log

加载bdwlan30.bin log

[  119.339837] check_wifi_bdwlan_filename:HWID:0001

加载bdwlan30_new.bin log

[   64.640328] check_wifi_bdwlan_filename:HWID:0010

;