bcm-v4

[Specification

int N PHY Cal RX IQ Rev3 (struct nphy_txgains target, u8 type, bool debug)

  1. Establish a 2-element struct nphy_iqcal_params array called params
  2. Establish 2-element u16 arrays named save and gain
  3. Establish a 2-element u8 array named best
  4. Read PHY Register 0x01 and save as BBconfig
  5. Clear bit 0x8000 in PHY Register 0x01
  6. If PHY Revision >= 4

    1. Set phyhang to phyhang_avoid

    2. Set phyhang_avoid to 0

  7. Read an N PHY Table with ID 7, length 2, offset 0x110, width 16, and data save
  8. Loop 2 times with index i
    1. Call N PHY IQ Cal Gain Params with i, target, &params[i] as arguments

    2. Set gain[i] to params[i].cal_gain
  9. Write an N PHY Table with ID 7, length 2, offset 0x110, width 16, and data from gain
  10. Call N PHY RX Core Get State and save result as state

  11. Loop 2 times with index i
    1. If state & (1 << i) is not zero

      1. Set skip to 1
    2. Otherwise
      1. Set skip to 0
    3. Call N PHY RX Cal PHY Setup with i as argument

    4. Call N PHY Radio Setup with i as argument

    5. If (skip is zero and type is zero) or (type is 2)
      1. Call N PHY RX Cal Gain Ctrl with i, NULL, 0 as arguments

      2. Call N PHY TX Tone with 2000, 181, 0, type as arguments

      3. Call N PHY Calc RX IQ Comp with i + 1 as argument

      4. Call N PHY Stop Playback

    6. If type is 1 or 2
      1. If i is 1
        1. If state is 1
          1. Call N PHY RX Core Set State with 3 as argument

        2. Call N PHY RX Cal Gain Ctrl with i, NULL, 1 as arguments

        3. Call N PHY RC Sweep with i, 1 as arguments - save result as best[i]

        4. Set nphy_rccal_value to best[i]

        5. if state is 1
          1. Call N PHY RX Core Set State with state as argument

    7. Call N PHY RX Cal Radio Cleanup with i as argument

    8. Call N PHY RX Cal PHY Cleanup with i as argument

    9. Call N PHY Force RF Seq with 2 as argument

  12. If type is 1 or 2
    1. Set best[0] to best[1]
    2. Write best[0] | 0x80 to Radio Register 0x606B
    3. Loop 2 times with i as index
      1. Set tmp1 to ((best[i] - 12) >> 1) + 10

      2. Set tmp2 to (best[i] - 2
      3. If (nphy_ipa2g_on and the band is 2GHz) or (nphy_ipa5g_on and the band is 5GHz)

        1. If the band width is 40 MHz
          1. Set tmp2 to 24
          2. Set tmp to 0x0E
        2. Otherwise
          1. Set tmp2 to 12
          2. Set tmp to 0x13
      4. If i is 0
        1. Write tmp to Radio Register 0x2078
      5. Otherwise
        1. Write tmp to Radio Register 0x3078
      6. Clamp tmp1 from 0 to 31
      7. Clamp tmp2 from 0 to 31
      8. If i is 0
        1. Write tmp1 | 0x80 to Radio Register 0x6062
        2. Write tmp2 | 0x80 to Radio Register 0x2069
      9. Otherwise
        1. Write tmp1 | 0x80 to Radio Register 0x7062
        2. Write tmp2 | 0x80 to Radio Register 0x3069
  13. Write BBconfig to PHY Register 0x01
  14. Call N PHY Reset CCA

  15. Call N PHY RF Ctrl Override with 0x1000, 0, 3, 1 as arguments

  16. Call N PHY Force RF Seq with 2 as argument

  17. Write an N PHY Table with ID 7, length 2, offset 0x110, width 16, and data from save
  18. If PHY Revision >= 4

    1. Set phyhang_avoid to phyhang

  19. Call N PHY Stay in Carrier Search with 0 as argument


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