N PHY Workarounds Gain Control 2057 Rev6
Set bit 1 << 13 in PHY Regtister 0x1C
Set bit 1 << 13 in PHY Regtister 0x32
- Read PHY Register 0x09 amd mask with 1
- If the result is 0
- Write an N PHY Table with ID 0, length 4, offset 8, width 8, and data 9, 14, 19, 24
- Write an N PHY Table with ID 1, length 4, offset 8, width 8, and data 9, 14, 19, 24
- Maskset PHY Register 0x283 with mask 0xFF00 and set 0x40
- If this is a 40 MHz channel
- Maskset PHY Register 0x280 with mask 0xFF00 and set 0x3E
- Maskset PHY Register 0x283 with mask 0xFF00 and set 0x3E
- Maskset PHY Register 0x289 with mask 0xFF00 and set 0x46
- If the BW is 20 MHz
- Maskset PHY Register 0x300 with mask 0xFFC0 and set 0xD
- Maskset PHY Register 0x301 with mask 0xFFC0 and set 0xD
- Otherwise
- Set init_gaincode to 0x9e
- Set clip1hi_gaincode to 0x9e
- Set clip1md_gaincode_B to 0x24
- Set clip1lo_gaincode to 0x8a
- Set clip1lo_gaincode_B to 8
- Set rfseq_init_gain to 0x624f, 0x624f
- Set tia_gain_db to -9, -6, -3, 0, 3, 3, 3, 3, 3, 3
- Set tia_gainbits to 0, 1, 2, 3, 4, 4, 4, 4, 4, 4
- Set freq to the frequency of the channel
- If the BW is 20 MHz
- Set w1clip_th to 25
- Set clip1md_gaincode to 0x82
If freq <= 5080 or freq == 5825
- Set lna1_gain_db to 11, 16, 20, 24
- Set lna1_gain_db_2 to 11, 17, 22, 25
- Set lna2_gain_db to -1, 6, 10, 14
- Set crsminu_th to 0x3e
Else if freq >= 5500 and freq <= 5700
- Set lna1_gain_db to 11, 17, 21, 25
- Set lna1_gain_db_2 to 12, 18, 22, 26
- Set lna2_gain_db to 1, 8, 12, 16
- Set crsminu_th to 0x45
- Set clip1md_gaincode_B to 0x14
- Set nbclip_th to 0xff
- Set chg_nbclip_th to 1
- Otherwise
- Set lna1_gain_db to 12, 18, 22, 26
- Set lna1_gain_db_2 to 12, 18, 22, 26
- Set lna2_gain_db to -1, 6, 10, 14
- Set crsminu_th to 0x41
If freq <= 4920
- Set nvar_baseline_offset0 to 5
- Set nvar_baseline_offset1 to 5
Else if (freq > 4920) && (freq <= 5320)
- Set nvar_baseline_offset0 to 3
- Set nvar_baseline_offset1 to 5
Else if (freq > 5320) && (freq <= 5700)
- Set nvar_baseline_offset0 to 3
- Set nvar_baseline_offset1 to 2
- Otherwise
- Set nvar_baseline_offset0 to 4
- Set nvar_baseline_offset1 to 0
- Otherwise
- Set crsminu_th to 0x3a
- Set crsminl_th to 0x3a
- Set w1clip_th to 20
If (freq >= 4920) && (freq <= 5320)
- Set nvar_baseline_offset0 to 4
- Set nvar_baseline_offset1 to 5
Else if (freq > 5320) && (freq <= 5550)
- Set nvar_baseline_offset0 to 4
- Set nvar_baseline_offset1 to 2
- Otherwise
- Set nvar_baseline_offset0 to 5
- Set nvar_baseline_offset1 to 3
- Write init_gaincode to PHY Register 0x20
- Write init_gaincode to PHY Register 0x2A7
- Write an N PHY Table with ID 7, length 2, offset 0x106, width 16, and data from rfseq_init_gain
- Write clip1hi_gaincode to PHY Register 0x22
- Write clip1hi_gaincode to PHY Register 0x2A9
- Write clip1md_gaincode_B to PHY Register 0x36
- Write clip1md_gaincode_B to PHY Register 0x2AC
- Write clip1lo_gaincode to PHY Register 0x37
- Write clip1lo_gaincode to PHY Register 0x2AD
- Write clip1lo_gaincode_B to PHY Register 0x38
- Write clip1lo_gaincode_B to PHY Register 0x2AE
- Write an N PHY Table with ID 0, length 10, offset 0x20, width 8, and data from tia_gain_db
- Write an N PHY Table with ID 1, length 10, offset 0x20, width 8, and data from tia_gain_db
- Write an N PHY Table with ID 2, length 10, offset 0x20, width 8, and data from tia_gainbits
- Write an N PHY Table with ID 3, length 10, offset 0x20, width 8, and data from tia_gainbits
- Maskset PHY Register 0x283 with mask 0xFF00 and set with crsminu_th
- If chg_nbclip_th == 1
- Write nbclip_th to PHY Register 0x2B
- Write nbclip_th to PHY Register 0x41
- Maskset PHY Register 0x300 with mask 0xFFC0 and set with w1clip_th
- Maskset PHY Register 0x301 with mask 0xFFC0 and set with w1clip_th
- Maskset PHY Register 0x2E4 with mask 0xFFC0 and set with nvar_baseline_offset0
Maskset PHY Register 0x2E4 with mask 0xF03F and set with nvar_baseline_offset1 << 6
- If BW is 20 MHz
- Write an N PHY Table with ID 0, length 4, offset 8, width 8, and data from lna1_gain_db
- Write an N PHY Table with ID 1, length 4, offset 8, width 8, and data from lna1_gain_db_2
- Write an N PHY Table with ID 0, length 4, offset 16, width 8, and data from lna2_gain_db
- Write an N PHY Table with ID 1, length 4, offset 16, width 8, and data from lna2_gain_db_2
- Write clip1md_gaincode to PHY Register 0x24
- Write clip1md_gaincode to PHY Register 0x2AB
- Otherwise
- Maskset PHY Register 0x280 with mask 0xFF00 and set with crsminl_th