bcm-v4

[Specification

N PHY Cal TX Gain Control (int target, bool debug)

  1. Create a 2-element u32 array called power
  2. Call N PHY TX Power Index with 1, nphy_cal_orig_pwr_index[0], 1 as arguments

  3. Call N PHY TX Power Index with 1, nphy_cal_orig_pwr_index[1], 1 as arguments

  4. If phyhang_avoid

    1. Call N PHY Carrier Search with 1 as argument

  5. Save value in phyhang_avoid

  6. Set phyhang_avoid to 0

  7. Save PHY Registers 0x91, 0x92, 0xE7 and 0xEC
  8. Call N PHY RF Control Intc Override with 2, 1, 3 as arguments

  9. If debug is 0
    1. Call N PHY RF Control Intc Override with 1, 2, 1 as arguments

    2. Call N PHY RF Control Intc Override with 1, 8, 2 as arguments

  10. Otherwise
    1. Call N PHY RF Control Intc Override with 1, 1, 1 as arguments

    2. Call N PHY RF Control Intc Override with 1, 7, 2 as arguments

  11. Save PHY Register 0x01
  12. Mask PHY Register 0x01 with mask 0xFFDA
  13. Write 0x3C57 to PHY Register 0x72
  14. Read PHY Register 0x73 and save as m1
  15. Loop 2 times with index i
    1. Set index to nphy_cal_orig_pwr_idx[i]

    2. Loop 2 times with index j
      1. Call N PHY TX Tone with 2500, 250, 0, 0 as arguments

      2. If i is 0
        1. Mask m1 with 0xFF00 and save as m2
      3. Otherwise
        1. Mask m1 with 0x00FF and save as m2
      4. Write 0x3C57 to PHY Register 0x72
      5. Write m2 to PHY Register 0x73
      6. Write 0x3C5F to PHY Register 0x72
      7. Write m2 to PHY Register 0x73
      8. Delay 50 usec
      9. Call N PHY Estimate Tone Power with power, 128 as arguments

      10. Set nphy_bb_mult_save to 0

      11. Call N PHY Stop Playback

      12. Set diff to target * 4 - power[i]
      13. Reduce index by diff
      14. Clamp index between 0 and 127
      15. Call N PHY TX Power Index with 1 << i, index, 1 as arguments

    3. Set nphy_cal_orig_pwr_idx[i] to index

    4. If debug is 1
      1. Write 0x3C57 to PHY Register 0x72
      2. Read PHY Register 0x73 and save as tmp
      3. Call N PHY TX Tone with 2500, 450, 0, 0 as arguments

      4. Write 0x3C57 to PHY Register 0x72
      5. Write tmp to PHY Register 0x73
      6. Write 0x3C5F to PHY Register 0x72
      7. Write tmp to PHY Register 0x73
      8. Delay 100 usec
      9. Call N PHY Estimate Tone Power with power, 64 as arguments

      10. Write (0x1D10 + i) to PHY Register 0x72
      11. Read PHY Register 0x73 and save as gain
      12. Sleep for 4 seconds (??????)
      13. Set nphy_bb_mult_save to 0

      14. Call N PHY Stop Playback

  16. Call N PHY TX Power Index with 1, nphy_txcal_pwr_idx[0], 1 as arguments

  17. Call N PHY TX Power Index with 2, nphy_txcal_pwr_idx[1], 1 as arguments

  18. Write 0x3C57 to PHY Register 0x72
  19. Read PHY Register 0x73 and save as nphy_txcal_bbmult

  20. Restore PHY Registers 0x01, 0x91, 0x92, 0xE7 and 0xEC
  21. Restore original value of phyhang_avoid

  22. If phyhang_avoid

    1. Call N PHY Carrier Search with 0 as argument


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