halbtc8723bwifionly.c 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #include "mp_precomp.h"
  2. VOID
  3. ex_hal8723b_wifi_only_hw_config(
  4. IN struct wifi_only_cfg *pwifionlycfg
  5. )
  6. {
  7. struct wifi_only_haldata *pwifionly_haldata = &pwifionlycfg->haldata_info;
  8. halwifionly_write1byte(pwifionlycfg, 0x778, 0x3); /* Set pta for wifi first priority, 0x1 need to reference pta table to determine wifi and bt priority */
  9. halwifionly_bitmaskwrite1byte(pwifionlycfg, 0x40, 0x20, 0x1);
  10. /* Set Antenna path to Wifi */
  11. halwifionly_write2byte(pwifionlycfg, 0x0765, 0x8); /* Set pta for wifi first priority, 0x0 need to reference pta table to determine wifi and bt priority */
  12. halwifionly_write2byte(pwifionlycfg, 0x076e, 0xc);
  13. halwifionly_write4byte(pwifionlycfg, 0x000006c0, 0xaaaaaaaa); /* pta table, 0xaaaaaaaa means wifi is higher priority than bt */
  14. halwifionly_write4byte(pwifionlycfg, 0x000006c4, 0xaaaaaaaa);
  15. halwifionly_bitmaskwrite1byte(pwifionlycfg, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */
  16. /* 0x948 setting */
  17. if (pwifionlycfg->chip_interface == WIFIONLY_INTF_PCI) {
  18. /* HP Foxconn NGFF at S0
  19. not sure HP pg correct or not(EEPROMBluetoothSingleAntPath), so here we just write
  20. 0x948=0x280 for HP HW id NIC. */
  21. if (pwifionly_haldata->customer_id == CUSTOMER_HP_1) {
  22. halwifionly_write4byte(pwifionlycfg, 0x948, 0x280);
  23. halwifionly_phy_set_rf_reg(pwifionlycfg, 0, 0x1, 0xfffff, 0x0); /* WiFi TRx Mask off */
  24. return;
  25. }
  26. }
  27. if (pwifionly_haldata->efuse_pg_antnum == 2) {
  28. halwifionly_write4byte(pwifionlycfg, 0x948, 0x0);
  29. } else {
  30. /* 3Attention !!! For 8723BU !!!!
  31. For 8723BU single ant case: jira [USB-1237]
  32. Because of 8723BU S1 has HW problem, we only can use S0 instead.
  33. Whether Efuse 0xc3 [6] is 0 or 1, we should always use S0 and write 0x948 to 80/280
  34. --------------------------------------------------
  35. BT Team :
  36. When in Single Ant case, Reg[0x948] has two case : 0x80 or 0x200
  37. When in Two Ant case, Reg[0x948] has two case : 0x280 or 0x0
  38. Efuse 0xc3 [6] Antenna Path
  39. 0xc3 [6] = 0 ==> S1 ==> 0x948 = 0/40/200
  40. 0xc3 [6] = 1 ==> S0 ==> 0x948 = 80/240/280 */
  41. if (pwifionlycfg->chip_interface == WIFIONLY_INTF_USB)
  42. halwifionly_write4byte(pwifionlycfg, 0x948, 0x80);
  43. else {
  44. if (pwifionly_haldata->efuse_pg_antpath == 0)
  45. halwifionly_write4byte(pwifionlycfg, 0x948, 0x0);
  46. else
  47. halwifionly_write4byte(pwifionlycfg, 0x948, 0x280);
  48. }
  49. }
  50. /* after 8723B F-cut, TRx Mask should be set when 0x948=0x0 or 0x280
  51. PHY_SetRFReg(Adapter, 0, 0x1, 0xfffff, 0x780); WiFi TRx Mask on */
  52. halwifionly_phy_set_rf_reg(pwifionlycfg, 0, 0x1, 0xfffff, 0x0); /*WiFi TRx Mask off */
  53. }