bcm-v4

[Specification

LP PHY RC Calibration Rev 0

  1. Create a 21-element u32 data array for ideal power with the following entries:
    1. 0x10000, 0x10557, 0x10e2d, 0x113e0, 0x10f22, 0x0ff64,
    2. 0x0eda2, 0x0e5d4, 0x0efd1, 0x0fbe8, 0x0b7b8, 0x04b35,
    3. 0x01a5e, 0x00a0b, 0x00444, 0x001fd, 0x000ff, 0x00088,
    4. 0x0004c, 0x0002c, 0x0001a
  2. Create an lpphy_iq_est structure and set its contents to zero
  3. Define a variable for the least mean square power and initialize it to zero
  4. Create Channel Spec for channel 7 and call Set Channel Spec for LP PHY with that chanspec

  5. If PHY register 0x43B ANDed with 0x40 is not zero
    1. Set old TX gain override to 1
    Otherwise
    1. Set old TX gain override to 0
  6. Call LP PHY Get BB Mult and save result as the old bbmult

  7. If the saved value of old_tx_gain_override is not zero
    1. Call LP PHY Get TX Gain with an lpphy_txgains structure as the argument

  8. Save PHY Register 0x44C

  9. Save PHY Register 0x44D

  10. Save PHY Register 0x43B

  11. Save PHY Register 0x43C

  12. Save PHY Register 0x4B0

  13. Save PHY Register 0x4B1

  14. Save PHY Register 0x448

  15. Read PHY Register 0x4A4, AND with 0xE000 and save the result as the old TX power control

  16. Call LP PHY Set TX Power Control with argument 0

  17. Call LP PHY Disable CRS with argument TRUE

  18. Call LP PHY Loopback and save the result as tmp

  19. If tmp is -1
    1. Go to finish
  20. Call LP PHY Set RX Gain by Index with tmp as the argument

  21. MaskSet PHY Register 0x448 with mask 0xFFBF and set 0x40

  22. MaskSet PHY Register 0x4B1 with mask 0xFFF8 and set 0x1

  23. MaskSet PHY Register 0x4B1 with mask 0xFFC7 and set 0x8

  24. MaskSet PHY Register 0x4B1 with mask 0xFF3F and set 0xC0

  25. Loop with index i from 128 through 159 (inclusive) in steps of 1
    1. Write i to Radio Register 0x3A

    2. Clear an inner loop summation variable
    3. Loop with index j from 5 to 25 (inclusive) in steps of 1
      1. Call LP PHY Run DDFS with arguments (1, 1, j, j, 0)

      2. Call LP PHY RX IQ Est with arguments (1000, 32, lpphy_iq_est structure)

      3. If the result is zero
        1. Go to finish
      4. Calculate the mean square power by adding the Q and I power values from the lpphy_iq_est structure
      5. If this is the first time through the inner loop
        1. Save the value of the mean square power as temp
      6. Calculate ideal power as the j-5 th entry in the ideal power data array, shift right by 3, add 1, and right shift 1.
      7. Calculate normal power by calling LP PHY Qdiv Roundup with mean square power, temp, and 12 as the arguments

      8. Subtract normal power from ideal power
      9. Square the result and save as the mean square power
      10. Add the result to the inner loop summation variable
    4. If i equals 0x80 OR the inner loop summation is less then the least mean squarepower
      1. Set lpphy_rc_cap to the outer loop variable
      2. Save the inner loop summation variable as the new least mean square power
  26. Call LP PHY Stop DDFS

  27. Fall through to finish

Finish:

  1. LP PHY Restore CRS with argument TRUE

  2. Restore the old value of PHY Register 0x44D

  3. Restore the old value of PHY Register 0x44C

  4. Restore the old value of PHY Register 0x43C

  5. Restore the old value of PHY Register 0x43B

  6. Restore the old value of PHY Register 0x4B1

  7. Restore the old value of PHY Register 0x4B0

  8. Restore the old value of PHY Register 0x448

  9. Call LP PHY Set BB Mult with the old value of bbmult as the argument

  10. If the old TX gain override is not zero
    1. Call LP PHY Set TX Gain with the lpphy_txgains structure defined above as the argument(Note: The Broadcom driver has "Get", but that makes no sense)

  11. Restore the gains using LP PHY Set TX Power Control with the old TX power control value as argument

  12. If lpphy_rc_cap is not zero
    1. Call LP PHY Set RC Cap with lpphy_rc_cap as the argument

Note: lpphy_rc_cap is in the struct containing PHY variables. All other variables are local.


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