LP PHY TxpwrtblIqlo Cal
- Create an LP PHY table and a u32 data word
- Create a target gains structure (lpphy_txgains)
Call LP PHY Get BBmult and save the result
- Set the saved pa gain to zero
- If the PHY revision is less than 2
- Set bb_mult to 0x96
- If the board flags AND 0x12000 is zero
If the chip ID is 5354 AND the chip rev >= 3
- Set the gm_gain member of the target gains to 7
- Set the pga_gain member of the target gains to 0xF
- Set the pad_gain member of the target gains to 0xA
- Set the dac_gain member of the target gains to 0
- Set bb_mult to 0x40
- Otherwise
- Set the gm_gain member of the target gains to 7
- Set the pga_gain member of the target gains to 0xF
- Set the pad_gain member of the target gains to 0xE
- Set the dac_gain member of the target gains to 0
- Set bb_mult to 0x96
- Otherwise
- If the current band is 5 GHz
- Set the gm_gain member of the target gains to 7
- Set the pga_gain member of the target gains to 0xF
- Set the pad_gain member of the target gains to 0xE
- Set the dac_gain member of the target gains to 0
- Set bb_mult to 0x40
- Otherwise
- Set the gm_gain member of the target gains to 4
- Set the pga_gain member of the target gains to 0xE
- Set the pad_gain member of the target gains to 0x9
- Set the dac_gain member of the target gains to 0
- Set bb_mult to 0x40
Call LP PHY Set BBmult with bb_mult as the argument
- If the current band is 5 GHz
- Otherwise
If the PHY Revision >= 3
- If the current band is 2G
- Set pa_gain to 0x10
- Otherwise
- Set pa_gain to 0x30
- If the current band is 2G
- Otherwise
- If the current band is 2G
- Set pa_gain to 0x20
- Otherwise
- Set pa_gain to 0x40
- If the current band is 2G
Call LP PHY Get PA Gain and save the result as save_pa_gain
Call LP PHY Set PA Gain with pa_gain as argument
- If the currend band is 5 GHz
- Set the gm_gain member of the target gains to 0xFF
- Set the pga_gain member of the target gains to 0x3C
- If the PHY Revision is 2
- Set the pad_gain member of the target gains to 0xFF
- Otherwise
- Set the pad_gain member of the target gains to 0xF0
- Otherwise
- Set the gm_gain member of the target gains to 0x7
- Set the pga_gain member of the target gains to 0x3C
- Set the pad_gain member of the target gains to 0xF8
- Set the dac_gain member of the target gains to 0
LP PHY TX IQLO Cal with arguments ( &target_gains, 0, 0)
- If the PHY revision equals 2
Call LP PHY Get Radio Loft with arguments ( &ei0, &eq0, &fi0, &fq0)
- If fi0 equals 0xF AND fq0 equals 0xF
- Set the gm_gain member of the target gains to 0x7
- Set the pga_gain member of the target gains to 0x2D
- Set the pad_gain member of the target gains to 0xBA
- Set the dac_gain member of the target gains to 0
Call LP PHY TX IQLO Cal with arguments ( &target_gains, 0, 0)
LP PHY Get TX IQCC with arguments ( &a, &b)
Call LP PHY Get TX LOCC and save the result as didq
- If the PHY revision is less than 2
- Set the table ID to 0xA
- Otherwise
- Set the table ID to 0x7
- Loop on idx from 0 to 127 (inclusive) with a step of 1
- Set the table width to 32, the table length to 1, and the table offset to 0x140 + idx
- Set the table data pointer to a u32 variable val
- Bitwise AND val with 0xFF00000, OR with (a ANDed with 0x3FF rightshifted by 0xA), then OR with b ANDed with 0x3FF
- Replace the contents of the table data work with those of didq
- Set the table offset to 0x1C0 + idx
Call LP PHY Set BBMult with argument save_bb_mult
If the PHY revision is >= 2
LP PHY Set PA Gain with argument save_pa_gain