bcm-v4

[Specification

Loopback Gain Supported

If the PHY Revision is 2 or greater or if Core Flags has the G Mode Enable flag (0x20000000) set, Loopback Gain is enabled.

Find the Loopback Gain

  1. Backup PHY Registers 0x429, 0x1, 0x811, 0x812, 0x814, 0x815, 0x5A, 0x59, 0x58, 0xA, 0x3, 0x80F, 0x810, 0x2B, 0x15, 0x2D

  2. Back up the current Baseband Attenuation
  3. Back up Radio Registers 0x52, 0x43, 0x7A

  4. AND PHY Register 0x429 with 0x3FFF

  5. OR PHY Register 0x1 with 0x8000

  6. OR PHY Register 0x811 with 0x0002

  7. AND PHY Register 0x812 with 0xFFFD

  8. OR PHY Register 0x811 with 0x0001

  9. AND PHY Register 0x812 with 0xFFFE

  10. OR PHY Register 0x814 with 0x0001

  11. AND PHY Register 0x815 with 0xFFFE

  12. OR PHY Register 0x814 with 0x0002

  13. AND PHY Register 0x815 with 0xFFFD

  14. OR PHY Register 0x811 with 0x000C

  15. OR PHY Register 0x812 with 0x000C

  16. OR PHY Register 0x811 with 0x30

  17. MaskSet PHY Register 0x812 with mask 0xFFCF and set with 0x10

  18. Write 0x780 to PHY Register 0x5A

  19. Write 0xC810 to PHY Register 0x59

  20. Write 0x000D to PHY Register 0x58

  21. OR PHY Register 0xA with 0x2000

  22. OR PHY Register 0x814 with 0x4

  23. AND PHY Register 0x815 with 0xFFFB

  24. MaskSet PHY Register 0x3 with mask 0xFF9F and set with 0x40

  25. If the Radio Revision is 8
    1. Write 0xF to Radio Register 0x43

  26. Otherwise
    1. Write 0 to Radio Register 0x52

    2. MaskSet Radio Register 0x43 with mask 0xFFF0 and set with 0x9

  27. Set the Baseband Attenuation to 0xB
  28. If the PHY Revision is 3 or greater
    1. Write 0xC020 to PHY Register 0x80F

  29. Otherwise
    1. Write 0x8020 to PHY Register 0x80F

  30. Write 0 to PHY Register 0x810

  31. MaskSet PHY Register 0x2B with mask 0xFFC0 and set with 1

  32. MaskSet PHY Register 0x2B with mask 0xC0FF and set with 0x800

  33. OR PHY Register 0x811 with 0x100

  34. AND PHY Register 0x812 with 0xCFFF

  35. If the PHY Revision is 7 or greater and the EXT_LNA flag is set in Board Flags

    1. OR PHY Register 0x811 with 0x800

    2. OR PHY Register 0x812 with 0x8000

  36. AND Radio Register 0x7A with 0xF7

  37. Loop 0xF times if the Radio Revision is 8, 9 times otherwise (starting with the maximum value and going down)
    1. Loop 16 times
      1. Write the outer loop position to Radio Register 0x43

      2. MaskSet PHY Register 0x812 with mask 0xF0FF and set with the current inner loop value left shifted by 8

      3. MaskSet PHY Register 0x15 with mask 0x0FFF and set with 0xA000

      4. OR PHY Register 0x15 with 0xF000

      5. Delay 20 uSec
      6. If the value of PHY Register 0x2D is 0xDFC or greater, break out of the loops

  38. If the number of times last through the inner loop was 8 or greater
    1. OR PHY Register 0x812 with 0x30

    2. Start with a TRSW RX Gain value of 0x1B
    3. Starting with the number of times through the inner loop - 8, loop up to 16 times, incrementing the inner loop value each time
      1. MaskSet PHY Register 0x812 with mask 0xF0FF and set with the current loop value left shifted by 8

      2. MaskSet PHY Register 0x15 with mask 0x0FFF and set with 0xA000

      3. OR PHY Register 0x15 with 0xF000

      4. Delay 20 uSec
      5. Decrease the TRSW RX Gain value by 3
      6. If the value of PHY Register 0x2D is 0xDFC or greater, break out of the loop

  39. Otherwise
    1. The TRSW RX Gain value is 0x18
  40. Restore PHY Registers 0x814, 0x815, 0x5A, 0x59, 0x58, 0xA, 0x3, 0x80F, 0x810, 0x2B, 0x15

  41. Restore the Baseband Attenuation
  42. Restore Radio Registers 0x52, 0x43, 0x7A

  43. Restore PHY Register 0x811 OR'd with 3

  44. Delay 10 uSec
  45. Restore PHY Registers 0x811, 0x812, 0x429, 0x1

  46. Find and save the Maximum Loopback Gain in hdB:
    1. Take the last number of loops from the first inner loop times 6, subtract from that the last loop value in the first outer loop times 4 and subtract 0xB from the result
  47. Save the TRSW RX Gain in hdB by multiplying the TRSW RX Gain value by 2

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