bcm-v4

[Specification

N PHY Gain Control Workaround

  1. Initialize a 6-element u8 array lpf_gain_db to 0x00, 0x06, 0x0C, 0x12, 0x12, 0x12
  2. Initialize a 6-element u8 array lpf_gainbits to 0, 1, 2, 3, 3, 3
  3. If this is a 5G channel
    1. Set triso tp SPROM FEM 5G TRISO
  4. Otherwise
    1. Set triso tp SPROM FEM 2G TRISO
  5. If PHY Revision >= 7

    1. If Radio Revision is 5
      1. Call N PHY Workarounds Gain Control 2057 Rev 5

    2. Else if Radio Revision is 7
      1. Call N PHY Workarounds Gain Control 2057 Rev 6

      2. Maskset PHY Register 0x283 with mask 0xFF00 and set with 0x44
      3. Maskset PHY Register 0x280 with mask 0xFF00 and set with 0x44
    3. Else if Radio Revision is 3 or 8
      1. Call N PHY Workarounds Gain Control 2057 Rev 6

      2. If Radio Revision is 8
        1. Maskset PHY Register 0x283 with mask 0xFF00 and set with 0x44
        2. Maskset PHY Register 0x280 with mask 0xFF00 and set with 0x44
    4. Otherwise
      1. Call N PHY Workarounds Gain Control 2057 Rev 6

  6. Else if PHY Revision >= 3

    1. Set bit 0x0040 in PHY Register 0xA0
    2. Set bit 0x2000 in PHY Register 0x1C
    3. Set bit 0x2000 in PHY Register 0x32
    4. Read PHY Register 0x09 and mask with 0x0001
    5. If the result is 0
      1. If PHY Revision >= 6

        1. If Radio Revision equals 11
          1. Set lna1_gain_db to contain 10, 14, 19, 27
          2. Set lna2_gain_db to contain -5, 6, 10, 15
          3. Set rfseq_init_gain to contain 0x413f, 0x413f
          4. Set init_gaincode to 0x427E
          5. Set clip1hi_gaincode to 0x007e
          6. Set clip1lo_gaincode to 0x1074
          7. Set nbclip_th to 0x1d0
          8. Set w1clip_th to 5
          9. Set crsmin_th to 0x18
          10. Set crsminl_th to 0x18
          11. Set crsminl_th to 0x18
          12. Set crsminu_th to 0x18
          13. Set rssi_gain to 0x50
        2. Otherwise
          1. Set lna1_gain_db to contain 8, 13, 18, 25
          2. Set lna2_gain_db to contain -5, 6, 10, 14
          3. If boardflags & 0x1000 is not zero

            1. Set rfseq_init_gain to 0x113f, 0x113f
            2. Set init_gaincode to 0x127e
          4. Otherwise
            1. Set rfseq_init_gain to 0x513f, 0x513f
            2. Set init_gaincode to 0x527e
          5. Set clip1hi_gaincode to 0x1076
          6. If triso is 0
            1. Set clip1lo_gaincode to 0x0062
          7. Else if triso is 1
            1. Set clip1lo_gaincode to 0x0064
          8. Else if triso is 2
            1. Set clip1lo_gaincode to 0x006a
          9. Else if triso is 3
            1. Set clip1lo_gaincode to 0x106a
          10. Else if triso is 4
            1. Set clip1lo_gaincode to 0x106c
          11. Else if triso is 5
            1. Set clip1lo_gaincode to 0x1074
          12. Else if triso is 6
            1. Set clip1lo_gaincode to 0x107c
          13. Else if triso is 7
            1. Set clip1lo_gaincode to 0x207c
          14. Otherwise
            1. Set clip1lo_gaincode to 0x106a
          15. Set nbclip_th to 0x1d0
          16. Set w1clip_th to 9
          17. Set crsmin_th to 0x18
          18. Set crsminl_th to 0x18
          19. Set crsminu_th to 0x18
          20. Set rssi_gain to 0x50
      2. Else if PHY Revision is 5
        1. Set lna1_gain_db to 9, 13, 18, 26
        2. Set lna2_gain_db to-3, 7, 11, 16
        3. If boardflags & 0x1000 is not zero

          1. Set rfseq_init_gain to 0x013f, 0x013f, 0x013f, 0x013f
          2. Set init_gaincode to 0x027e
        4. Otherwise
          1. Set rfseq_init_gain to 0x413f, 0x413f, 0x413f, 0x413f
          2. Set init_gaincode to 0x427e
          3. Set clip1hi_gaincode to 0x1076
          4. If triso is 0
            1. Set clip1lo_gaincode to 0x0062
          5. Else if triso is 1
            1. Set clip1lo_gaincode to 0x0064
          6. Else if triso is 2
            1. Set clip1lo_gaincode to 0x006a
          7. Else if triso is 3
            1. Set clip1lo_gaincode to 0x106a
          8. Else if triso is 4
            1. Set clip1lo_gaincode to 0x106c
          9. Else if triso is 5
            1. Set clip1lo_gaincode to 0x1074
          10. Else if triso is 6
            1. Set clip1lo_gaincode to 0x107c
          11. Else if triso is 7
            1. Set clip1lo_gaincode to 0x207c
          12. Otherwise
            1. Set clip1lo_gaincode to 0x106a
          13. Set nbclip_th to 0x1d0
          14. Set w1clip_th to 9
          15. Set crsmin_th to 0x18
          16. Set crsminl_th to 0x18
          17. Set crsminu_th to 0x18
          18. Set rssi_gain to 0x50
      3. Else if PHY Revision is 4
        1. Set lna1_gain_db to 8, 12, 17, 25
        2. Set lna2_gain_db to -5, 6, 10, 14
        3. Set rfseq_init_gain to 0x513f, 0x513f, 0x513f, 0x513f
        4. Set init_gaincode to 0x527e
        5. Set clip1hi_gaincode to 0x007e
        6. Set clip1lo_gaincode to 0x0074
        7. Set nbclip_th to 0x1a1
        8. Set w1clip_th to 5
        9. Set crsmin_th to 0x18
        10. Set crsminl_th to 0x18
        11. Set crsminu_th to 0x18
        12. Set rssi_gain to 0x50
      4. Otherwise
        1. Set lna1_gain_db to 7, 11, 16, 23
        2. Set lna2_gain_db to -5, 6, 10, 14
        3. Set rfseq_init_gain to 0x613f, 0x613f, 0x613f, 0x613f
        4. Set init_gaincode to 0x627e
        5. Set clip1hi_gaincode to 0x107e
        6. Set clip1lo_gaincode to 0x0074
        7. Set nbclip_th to 0x1a1
        8. Set w1clip_th to 5
        9. Set crsmin_th to 0x18
        10. Set crsminl_th to 0x18
        11. Set crsminu_th to 0x18
        12. Set rssi_gain to 0x50
      5. Set tia_gain_db to 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A
      6. Set tia_gainbits to 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03
      7. Set clip1md_gaincode to 0x0066
    6. Otherwise
      1. If PHY Revision >= 6

        1. Set lna1_gain_db to 6, 10, 16, 21
        2. Set lna2_gain_db to -7, 0, 4, 8
        3. Set tia_gain_db to 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d
        4. Set tia_gainbits to 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04
        5. Set rfseq_init_gain to 0x714f, 0x714f
        6. Set init_gaincode to 0x729e
        7. Set clip1hi_gaincode to 0x029e
        8. Set clip1md_gaincode to 0x2084
        9. Set clip1lo_gaincode to 0x2086
        10. Set crsmin_th to 0x24
        11. Set crsminl_th to 0x24
        12. If Radio Revision equals 11 and thes is not a 40 MHZ channel
          1. Set crsminu_th to 0x2d
        13. Otherwise
          1. Set crsminu_th to 0x24
        14. Set nbclip_th to 0x0f0
        15. Set rssi_gain to 0x90
      2. Else if PHY Revision is 5
        1. Set lna1_gain_db to 6, 10, 16, 21
        2. Set lna2_gain_db to -7, 0, 4, 8
        3. Set tia_gain_db to 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d
        4. Set tia_gainbits to 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04
        5. Set rfseq_init_gain to 0x714f, 0x714f, 0x714f, 0x714f
        6. Set init_gaincode to 0x729e
        7. Set clip1hi_gaincode to 0x029e
        8. Set clip1md_gaincode to 0x2084
        9. Set clip1lo_gaincode to 0x2086
        10. Set crsmin_th to 0x24
        11. Set crsminl_th to 0x24
        12. Set crsminu_th to 0x2d
        13. Set nbclip_th to 0x0a9
        14. Set rssi_gain to 0x90
      3. Else if PHY Revision is 4
        1. Set lna1_gain_db to 8, 12, 18, 23
        2. Set lna2_gain_db to -5, 2, 6, 10
        3. Set tia_gain_db to 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d
        4. Set tia_gainbits to 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04
        5. If boardflags & 0x10000000 is not zero

          1. Set rfseq_init_gain to 0x314f, 0x314f, 0x314f, 0x314f
          2. Set init_gaincode to 0x329e
        6. Otherwise
          1. Set rfseq_init_gain to 0x614f, 0x614f, 0x614f, 0x614f
          2. Set init_gaincode to 0x629e
        7. Set clip1hi_gaincode to 0x029e
        8. Set clip1md_gaincode to 0x1084
        9. Set clip1lo_gaincode to 0x0086
        10. Set crsmin_th to 0x24
        11. Set crsminl_th to 0x24
        12. Set crsminu_th to 0x2d
        13. Set nbclip_th to 0x0a9
        14. Set rssi_gain to 0x90
      4. Otherwise
        1. Set lna1_gain_db to 7, 11, 17, 23
        2. Set lna2_gain_db to -6, 2, 6, 10
        3. Set tia_gain_db to 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13
        4. Set tia_gainbits to 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06
        5. Set rfseq_init_gain to 0x516f, 0x516f, 0x516f, 0x516f
        6. Set init_gaincode to 0x52de
        7. Set clip1hi_gaincode to 0x00de
        8. Set clip1md_gaincode to 0x00ca
        9. Set clip1lo_gaincode to 0x00cc
        10. Set crsmin_th to 0x1e
        11. Set crsminl_th to 0x1e
        12. Set crsminu_th to 0x1e
        13. Set nbclip_th to 0x1a1
        14. Set rssi_gain to 0x50
      5. Set w1clip_th to 25
    7. Write 0x17 to PHY Register 0x6037
    8. Write 0x17 to PHY Register 0x7037
    9. Write 0xF0 to PHY Register 0x6038
    10. Write 0xF0 to PHY Register 0x7038
    11. Write rssi_gain to PHY Register 0x6029
    12. Write rssi_gain to PHY Register 0x7029
    13. Write 0x17 to PHY Register 0x6030
    14. Write 0x17 to PHY Register 0x7030
    15. Write 0xFF to PHY Register 0x6031
    16. Write 0xFF to PHY Register 0x7031
    17. Write an N PHY Table with ID 0, length 4, offset 8, width 8, and data from lna1_gain_db
    18. Write an N PHY Table with ID 1, length 4, offset 8, width 8, and data from lna1_gain_db
    19. Write an N PHY Table with ID 0, length 4, offset 16, width 8, and data from lna2_gain_db
    20. Write an N PHY Table with ID 1, length 4, offset 16, width 8, and data from lna2_gain_db
    21. Write an N PHY Table with ID 0, length 10, offset 32, width 8, and data from tia_gain_db
    22. Write an N PHY Table with ID 1, length 10, offset 32, width 8, and data from tia_gain_db
    23. Write an N PHY Table with ID 2, length 10, offset 32, width 8, and data from tia_gainbits
    24. Write an N PHY Table with ID 3, length 10, offset 32, width 8, and data from tia_gainbits
    25. Write an N PHY Table with ID 0, length 6, offset 0x40, width 8, and data from lpf_gain_db
    26. Write an N PHY Table with ID 1, length 6, offset 0x40, width 8, and data from lpf_gain_db
    27. Write an N PHY Table with ID 2, length 6, offset 0x40, width 8, and data from lpf_gainbits
    28. Write an N PHY Table with ID 3, length 6, offset 0x40, width 8, and data from lpf_gainbits
    29. Write init_gaincode to PHY register 0x20
    30. Write init_gaincode to PHY register 0x2A7
    31. Write an N PHY Table with ID 7, length 2, offset 0x106, width 16, and data from rfseq_init_gain
    32. Write clip1hi_gaincode to PHY Register 0x22
    33. Write clip1hi_gaincode to PHY Register 0x2A9
    34. Write clip1md_gaincode to PHY Register 0x24
    35. Write clip1md_gaincode to PHY Register 0x2AB
    36. Write clip1lo_gaincode to PHY Register 0x37
    37. Write clip1lo_gaincode to PHY Register 0x2AD
    38. MaskSet PHY Register 0x27D with mask 0xFF00 and set with crsmin_th

    39. MaskSet PHY Register 0x280 with mask 0xFF00 and set with crsminl_th

    40. MaskSet PHY Register 0x283 with mask 0xFF00 and set with crsminu_th

    41. Write nbclip_th to PHY Register 0x2B
    42. Write nbclip_th to PHY Register 0x41
    43. MaskSet PHY Register 0x27 with mask 0xFFC0 and set with w1clip_th

    44. MaskSet PHY Register 0x3D with mask 0xFFC0 and set with w1clip_th

    45. Write 0x809C to PHY Register 0x150
  7. Otherwise
    1. MaskSet PHY Register 0x1C with mask 0xDFFF and set with 0x2000

    2. MaskSet PHY Register 0x32 with mask 0xDFFF and set with 0x2000

    3. Write 0x84 to PHY Register 0x2B
    4. Write 0x84 to PHY Register 0x41
    5. If the band width is 20 MHz
      1. Write 0x002B to PHY Register 0x6B
      2. Write 0x002B to PHY Register 0x6C
      3. Write 0x0009 to PHY Register 0x6D
      4. Write 0x0009 to PHY Register 0x6E
    6. MaskSet PHY Register 0x27 with mask 0xFFC0 and set with 21

    7. MaskSet PHY Register 0x3D with mask 0xFFC0 and set with 21

    8. If the band width is 20 MHz
      1. MaskSet PHY Register 0x1C with mask 0xFFE0 and set with 0x0001

      2. MaskSet PHY Register 0x32 with mask 0xFFE0 and set with 0x0001

      3. MaskSet PHY Register 0x1D with mask 0xFFE0 and set with 0x0001

      4. MaskSet PHY Register 0x33 with mask 0xFFE0 and set with 0x0001

    9. Write 0x809C to PHY Register 0x150
    10. If nphy_gain_boost is not zero

      1. If the band is 2 GHz and the band width is 40 MHz
        1. Set code to 4
      2. Otherwise
        1. Set code to 5
    11. Otherwise
      1. If the band width is 40 MHz
        1. Set code to 6
      2. Otherwise
        1. Set code to 7
    12. MaskSet PHY Register 0x20 with mask 0xF07F and set with code << 7

    13. MaskSet PHY Register 0x36 with mask 0xF07F and set with code << 7

    14. Write 0x1D06 to PHY Register 0x72
    15. Loop 4 times with ctr as index
      1. Set regval[ctr] to (code << 8) | 0x7C

    16. Write an N PHY Table with ID 7, length 4, offset 0x106, width 16, and data from regval
    17. Call N PHY Adjust LNA Gain Table

    18. If nphy_elna_gain_config is not zero

      1. Set regval to 0, 1, 1, 1
      2. Write an N PHY Table with ID 2, length 4, offset 8, width 16, and data from regval
      3. Write an N PHY Table with ID 3, length 4, offset 8, width 16, and data from regval
      4. Loop 4 times with index ctr
        1. Set regval[ctr] to (code << 8) | 0x74

      5. Write an N PHY Table with ID 7, length 4, offset 0x106, width 16, and data from regval
    19. If PHY Revision is 2
      1. Write 0x20 to PHY Register 0x72
      2. Loop 21 times with index starting at 0
        1. Set regval[index] to 3 * index
      3. Write an N PHY Table with ID 0, length 21, offset 32, width 16, and data from regval
      4. Write an N PHY Table with ID 1, length 21, offset 32, width 16, and data from regval
      5. Loop 21 times with index starting at 0
        1. Set regval[index] to index
      6. Write an N PHY Table with ID 2, length 21, offset 32, width 16, and data from regval
      7. Write an N PHY Table with ID 3, length 21, offset 32, width 16, and data from regval
    20. Preset an array called rfseq_events with 6, 8, 7
    21. Preset an array called rfseq_delays with 10, 30, 1
    22. Call N PHY Set RF Seq with 5, rfseq_events, rfseq_delays, 3 as arguments

    23. MaskSet PHY Register 0x153 with mask 0x00FF and set with 0x5A00

    24. If the current band is 2 GHz
      1. MaskSet PHY Register 0xC5D with mask 0xFF80 and set with 4


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