bcm-v4

[Specification

N PHY Periodic Calibration Run (u8 type)

  1. Set fullcal to TRUE
  2. Set restore to FALSE
  3. If bit 0x10 in measure_hold is set

    1. return
  4. If type is zero
    1. Set fullcal to (radio_chanspec not equal to nphy_txiqlocal_chanspec

  5. Else if type is 2
    1. Set fullcal to FALSE
  6. If cal_type_override not zero

    1. If cal_type_override is not 1

      1. Set fullcal to false
  7. If mphase_cal_phase_id > 1

    1. If nphy_txiqlocal_chanspec not equal to radio_chanspec

      1. Call PHY Perical Mphase Restart

  8. If mphase_cal_phase_id is 9

    1. Write 10000 to shared memory location (0x5c * 2)
  9. Suspend MAC
  10. Call PHY Register Enter

  11. If mphase_cal_phase_id is 0 or 1

    1. Set nphy_cal_orig_pwr_idx[0] to (PHY Register 0x1ED >> 8) & 0x7F

    2. Set nphy_cal_orig_pwr_idx[1] to (PHY Register 0x1EE >> 8) & 0x7F

    3. If nphy_txpwrctrl is 0

      1. Read the N PHY Table with ID 7, length 2, offset 0x110, width 16, and data at nphy_cal_orig_tx_gain

    4. Otherwise
      1. Set nphy_cal_orig_tx_gain[0] and [1] to 0

  12. Set target to the returned value from N PHY Get TX Gain

  13. Set state to nphy_txpwrctrl

  14. Call N PHY TX Power Control Enable with argument 0

  15. If antsel is 2

    1. Call N PHY Antenna Select Init with true as argument

  16. Set mphase to (mphase_cal_phase_id != 0)

  17. If mphase is not true
    1. If PHY revision >= 3

      1. Call N PHY Precal TX Gain

      2. Set nphy_cal_target_gain to the output of N PHY Get TX Gain

      3. Set restore to true
      4. Set target to nphy_cal_target_gain

    2. If the output of N PHY Cal TX IQ Lo with arguments target, fullcal and mphase is 0

      1. If (ipa2g_on and this is a 2G channel) OR (ipa5g_on and this is a 5G channel)

        1. Call PHY a4 with argument true

      2. Call PHY Register Exit

      3. Enable MAC
      4. Write 10000 to shared memory location (0x5c * 2)
      5. Disable MAC
      6. Call PHY Register Enter

      7. If (cal_type_override == 1)

        1. Set tmp to 2
      8. Otherwise
        1. Set tmp to 0
      9. If the output of (N PHY Cal RX IQ with arguments target, (first_cal_after_assoc OR tmp, and false) is zero

        1. Call N PHY Save Cal

        2. Call N PHY TX Power Ctrl Coeff Setup

        3. Set nphy_perical_last to now

    3. If type is 0
      1. Call N PHY RSSI Calibrate

    4. If first_cal_after_assoc OR cal_type_override equals 1

      1. Set first_cal_after_assoc to false

      2. Call N PHY TX Power Control Idle TSSI

      3. Call N PHY TX Power Control TSSI

      4. Call N PHY TX Power Control Setup

    5. If PHY Revision >= 3

      1. Call N PHY Radio 205x VCO Cal

  18. Otherwise
    1. If mphase_cal_phase_id is 1

      1. Set nphy_perical_last to now

      2. Set nphy_txiqlocal_chanspec to radio_chanspec

      3. If PHY Revisio0n >= 3

        1. Call N PHY PreCalibrate TX Gain

      4. Set nphy_cal_target_gain to the output value of N PHY Get TX Gain

      5. Increment mphase_cal_phase_id

    2. Else if mphase_cal_phase_id is 2, 3, 4, 5, 6, or 7

      1. If radar_percal_mask AND 0x10 is not zero

        1. Set nphy_rxcal_active to true

      2. If the output of N PHY Cal TX IQ LO with arguments nphy_cal_target_gain, fullcal, and true is not zero

        1. Call PHY Periodic Calibration Multi-Phase Reset

        2. Break
      3. If PHY Revision < 3 AND (mphase_cal_phase_id is 6

        1. Add 2 to mphase_cal_phase_id

      4. Otherwise
        1. Increment mphase_cal_phase_id

    3. Else if mphase_cal_phase_id is 8

      1. If radar_percal_mask & 0x2 is not zero

        1. If (ipa2g_on and this is a 2G channel) OR (ipa5g_on and this is a 5G channel)

          1. Call PHY a4 with argument true

        2. Increment mphase_cal_phase_id

        3. Break
    4. Else if mphase_cal_phase_id is 9

      1. If radar_percal_mask & 0x1 is not zero

        1. Set nphy_rxcal_active to true

        2. If (cal_type_override == 1)

          1. Set tmp to 2
        3. Otherwise
          1. Set tmp to 0
        4. If the output of (N PHY Cal RX IQ with arguments target, (first_cal_after_assoc OR tmp, and false) is zero

          1. Call N PHY Save Cal

        5. Increment mphase_cal_phase_id

    5. Else if mphase_cal_phase_id is 10

      1. If radar_percal_mask & 0x4 is not zero

        1. Set nphy_rxcal_active to true

      2. Call N PHY TX Power Ctrl Coeff Setup

      3. Call N PHY RSSI Calibrate

      4. If PHY Revision >= 3

        1. Call N PHY Radio 205x VCO Cal

      5. Set restore to true
      6. If first_cal_after_assoc

        1. Increment mphase_cal_phase_id

      7. Else
        1. Call PHY Periodic Calibration Multi-Phase Reset

    6. Else if mphase_cal_phase_id is 11

      1. If radar_percal_mask & 0x8 is not zero

        1. Set nphy_rxcal_active to true

      2. If first_cal_after_assoc

        1. Set first_cal_after_assoc to false

        2. Call N PHY TX Power Control Idle TSSI

        3. Call N PHY TX Power Control TSSI

        4. Call N PHY TX Power Control Setup

      3. Call PHY Periodic Calibration Multi-Phase Reset

    7. Otherwise
      1. Call PHY Periodic Calibration Multi-Phase Reset

  19. If PHY Revision >= 3

    1. If restore is true
      1. If state is true
        1. Call N PHY TX Power Index with arguments 1, nphy_cal_orig_pwr_idx[0], false

        2. Call N PHY TX Power Index with arguments 2, nphy_cal_orig_pwr_idx[1], false

        3. Set nphy_txpwrindex[0].index to -1

        4. Set nphy_txpwrindex[1].index to -1

      2. Otherwise
        1. Call N PHY TX Power Index with arguments 1, nphy_txpwrindex[0].index_internal, false

        2. Call N PHY TX Power Index with arguments 2, nphy_txpwrindex[1].index_internal, false

  20. Call N PHY TX Power Control Enable with argument state

  21. Call PHY Register Exit

  22. Enable MAC

Exported/Archived from the wiki to HTML on 2016-10-27