bcm-v4

[Specification

LP PHY TxpwrtblIqlo Cal

  1. Create an LP PHY table and a u32 data word
  2. Create a target gains structure (lpphy_txgains)
  3. Call LP PHY Get BBmult and save the result

  4. Set the saved pa gain to zero
  5. If the PHY revision is less than 2
    1. Set bb_mult to 0x96
    2. If the board flags AND 0x12000 is zero
      1. If the chip ID is 5354 AND the chip rev >= 3

        1. Set the gm_gain member of the target gains to 7
        2. Set the pga_gain member of the target gains to 0xF
        3. Set the pad_gain member of the target gains to 0xA
        4. Set the dac_gain member of the target gains to 0
        5. Set bb_mult to 0x40
      2. Otherwise
        1. Set the gm_gain member of the target gains to 7
        2. Set the pga_gain member of the target gains to 0xF
        3. Set the pad_gain member of the target gains to 0xE
        4. Set the dac_gain member of the target gains to 0
        5. Set bb_mult to 0x96
    3. Otherwise
      1. If the current band is 5 GHz
        1. Set the gm_gain member of the target gains to 7
        2. Set the pga_gain member of the target gains to 0xF
        3. Set the pad_gain member of the target gains to 0xE
        4. Set the dac_gain member of the target gains to 0
        5. Set bb_mult to 0x40
      2. Otherwise
        1. Set the gm_gain member of the target gains to 4
        2. Set the pga_gain member of the target gains to 0xE
        3. Set the pad_gain member of the target gains to 0x9
        4. Set the dac_gain member of the target gains to 0
        5. Set bb_mult to 0x40
      3. Call LP PHY Set BBmult with bb_mult as the argument

  6. Otherwise
    1. If the PHY Revision >= 3

      1. If the current band is 2G
        1. Set pa_gain to 0x10
      2. Otherwise
        1. Set pa_gain to 0x30
    2. Otherwise
      1. If the current band is 2G
        1. Set pa_gain to 0x20
      2. Otherwise
        1. Set pa_gain to 0x40
    3. Call LP PHY Get PA Gain and save the result as save_pa_gain

    4. Call LP PHY Set PA Gain with pa_gain as argument

    5. If the currend band is 5 GHz
      1. Set the gm_gain member of the target gains to 0xFF
      2. Set the pga_gain member of the target gains to 0x3C
      3. If the PHY Revision is 2
        1. Set the pad_gain member of the target gains to 0xFF
      4. Otherwise
        1. Set the pad_gain member of the target gains to 0xF0
    6. Otherwise
      1. Set the gm_gain member of the target gains to 0x7
      2. Set the pga_gain member of the target gains to 0x3C
      3. Set the pad_gain member of the target gains to 0xF8
      4. Set the dac_gain member of the target gains to 0
  7. LP PHY TX IQLO Cal with arguments ( &target_gains, 0, 0)

  8. If the PHY revision equals 2
    1. Call LP PHY Get Radio Loft with arguments ( &ei0, &eq0, &fi0, &fq0)

    2. If fi0 equals 0xF AND fq0 equals 0xF
      1. Set the gm_gain member of the target gains to 0x7
      2. Set the pga_gain member of the target gains to 0x2D
      3. Set the pad_gain member of the target gains to 0xBA
      4. Set the dac_gain member of the target gains to 0
      5. Call LP PHY TX IQLO Cal with arguments ( &target_gains, 0, 0)

  9. LP PHY Get TX IQCC with arguments ( &a, &b)

  10. Call LP PHY Get TX LOCC and save the result as didq

  11. If the PHY revision is less than 2
    1. Set the table ID to 0xA
  12. Otherwise
    1. Set the table ID to 0x7
  13. Loop on idx from 0 to 127 (inclusive) with a step of 1
    1. Set the table width to 32, the table length to 1, and the table offset to 0x140 + idx
    2. Set the table data pointer to a u32 variable val
    3. Read the LP table

    4. Bitwise AND val with 0xFF00000, OR with (a ANDed with 0x3FF rightshifted by 0xA), then OR with b ANDed with 0x3FF
    5. Write the LP table

    6. Replace the contents of the table data work with those of didq
    7. Set the table offset to 0x1C0 + idx
    8. Write the LP table

  14. Call LP PHY Set BBMult with argument save_bb_mult

  15. If the PHY revision is >= 2

    1. LP PHY Set PA Gain with argument save_pa_gain


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