1. 13 May, 2020 4 commits
    • Ping-Ke Shih's avatar
      rtw88: 8723d: Add power tracking · 608d2a08
      Ping-Ke Shih authored
      When chip's temperature is changed, RF characters are changed. To keep the
      characters to be consistent, 8723d uses thermal meter to assist in
      calibrating LCK, IQK, crystal and TX power.
      
      A base thermal value is programmed in efuse, all calibration data in
      MP process is based on this thermal value. So we calucate the delta of
      thermal value between the base value, and use this delta to reference XTAL
      and TX power offset tables to know how much we need to adjust.
      
      For IQK and LCK, driver checks if delta of thermal value is over 8, then
      they are triggered.
      
      For crystal adjustment, when delta of thermal value is changed, we check
      XTAL tables to get offset of XTAL value. If thermal value is larger than
      base value, positive table (_p as suffix) is used. Otherwise, we use
      negative table (_n as suffix). Then, we add offset to XTAL default value
      programmed in efuse, and write sum value to register.
      
      To compensate TX power, there are two hierarchical tables. First level use
      delta of thermal value to access eight tables to yield delta of TX power
      index. Then, plus base TX power index to get index of BB swing table
      (second level tables) where register value is induced.
      
      BB swing table can't deal with all cases, if index of BB swing table is
      over the size of the table. In this case, TX AGC is used to compensate the
      remnant part. Assume 'upper' is the upper bound of BB swing table, and
      'target' is the desired index. Then, we can illustrate them as
      
        compensation method    BB swing        TX AGC
        -------------------    --------    --------------
        target > upper         upper       target - upper
        target < 0             0           target
        otherwise              target      0
      
      For debug purpose, add a column 'rem' to tx_pwr_tbl entry, and it looks
      like
      
        path rate       pwr       base      (byr  lmt ) rem
          A  CCK_1M     32(0x20)   34   -2 (   0   -2)    0
      Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
      Signed-off-by: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200512102621.5148-4-yhchuang@realtek.com
      608d2a08
    • Ping-Ke Shih's avatar
      rtw88: 8723d: add IQ calibration · 1d229e88
      Ping-Ke Shih authored
      IQ calibration is used to calibrate RF characteristic to yield expected
      performance. Basically, we do calibration twice and compare the similarity
      to determine calibration is good or not, if not we do the third
      calibration, and then compare with the results of first and second
      calibration. If it still not similar, IQK is failed.
      
      Before doing calibration, we need to backup registers that will be
      modified in calibration procedure, and restore these registers after
      calibration is done.
      
      A calibration procedure can divided into four sub-procedures that are
      S1-TX, S1-RX, S0-TX and S0-RX. Where, S1 and S0 represent to path A and B
      respectively. Each sub-procedure configure proper registers, and then
      rigger one-shot calibration and poll until completion. For RX calibration,
      it needs to do twice one-shot calibration, first one is to yield parameter
      used by second one.
      
      The result of TX part is stored for TX power tracking that adjusts TX AGC
      to output expected power.
      Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
      Signed-off-by: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200512102621.5148-3-yhchuang@realtek.com
      1d229e88
    • Ping-Ke Shih's avatar
      rtw88: 8723d: Add LC calibration · f71eb7f6
      Ping-Ke Shih authored
      LC calibration is done by hardware circuit. Driver sets the LCK bit to kick
      start, and then poll the bit to check if it's done.
      Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
      Signed-off-by: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200512102621.5148-2-yhchuang@realtek.com
      f71eb7f6
    • Chung-Hsien Hsu's avatar
      brcmfmac: fix WPA/WPA2-PSK 4-way handshake offload and SAE offload failures · b2fe11f0
      Chung-Hsien Hsu authored
      An incorrect value of use_fwsup is set for 4-way handshake offload for
      WPA//WPA2-PSK, caused by commit 3b1e0a7b ("brcmfmac: add support for
      SAE authentication offload"). It results in missing bit
      BRCMF_VIF_STATUS_EAP_SUCCESS set in brcmf_is_linkup() and causes the
      failure. This patch correct the value for the case.
      
      Also setting bit BRCMF_VIF_STATUS_EAP_SUCCESS for SAE offload case in
      brcmf_is_linkup() to fix SAE offload failure.
      
      Fixes: 3b1e0a7b ("brcmfmac: add support for SAE authentication offload")
      Signed-off-by: default avatarChung-Hsien Hsu <stanley.hsu@cypress.com>
      Signed-off-by: default avatarChi-Hsien Lin <chi-hsien.lin@cypress.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/1589277788-119966-1-git-send-email-chi-hsien.lin@cypress.com
      b2fe11f0
  2. 12 May, 2020 15 commits
  3. 08 May, 2020 21 commits