2050 Radio Core Calibration is performed when the PHY is initialized.
- Accumulator 1 and 2 are both set to 0
Save RadioRegisters 0x43, 0x51, 0x52
Save PHYRegisters 0x15, 0x5A, 0x59, 0x58
- If this is a B PHY
Save PHYRegister offset 0x30
Save MMIO offset 0x3EC
Write 0xFF to PHYRegister offset 0x30
Write 0x3F3F to MMIO offset 0x3EC
If this is not a B PHY and PHYConnected is true
Save PHYRegister offset 0x811
Save PHYRegister offset 0x812
Save PHYRegister offset 0x814
Save PHYRegister offset 0x815
Save PHYRegister offset 0x429
Save PHYRegister offset 0x802
MaskSet PHYRegister offset 0x814 with mask of ~0 and set of 3
MaskSet PHYRegister offset 0x815 with mask of 0xFFFC and set of 0
MaskSet PHYRegister offset 0x429 with mask of 0x7FFF and set of 0
MaskSet PHYRegister offset 0x802 with mask of 0xFFFC and set of 0
Write 0x1B3 to PHYRegister 0x811
Write 0xFB2 to PHYRegister 0x812
If this is not a B PHY and PHYConnected is false
Save PHYRegister offset 0x35
MaskSet PHYRegister offset 0x35 with mask of 0xFF7F and set of 0
Save MMIO offset 0x3E6
Save MMIO offset 0x3F4
If the Analog Core Revision is 0
Write 0x122 to MMIO offset 0x3E6
- Otherwise
If the Analog Core Revision is 2 or greater
MaskSet PHYRegister 0x3 with mask 0xFFBF and set with 0x40
OR MMIO offset 0x3F4 with 0x2000
Find the Radio Core Calibration value using the RCCTable
- If this is a B PHY
Write 0x26 into RadioRegister 0x78
Write 0xBFAF to PHYRegister 0x15
Write 0x1403 to PHYRegister 0x2B
If PHYConnected is true
Write 0xB2 to PHYRegister 0x812
Write 0xBFA0 to PHYRegister 0x15
Set RadioRegister 0x51 with 0x4
Write 0 to RadioRegister 0x52
Write 0x9 to the lower 4 bits of RadioRegister 0x43 (leave the rest as-is!)
Write 0 to PHYRegister 0x58
- Loop 16 times from 0 to 15
Write 0x480 to PHYRegister 0x5A
Write 0xC810 to PHYRegister 0x59
Write 0xD to PHYRegister 0x58
If PHYConnected is true
Write 0x30B2 to PHYRegister 0x812
Write 0xAFB0 to PHYRegister 0x15
- Delay 10 usec
If PHYConnected is true
Write 0x30B2 to PHYRegister 0x812
Write 0xEFB0 to PHYRegister 0x15
- Delay 10 usec
If PHYConnected is true
Write 0x30B2 to PHYRegister 0x812
Write 0xFFF0 to PHYRegister 0x15
- Delay 10 usec
Read the value of PHYRegister 0x2D and add it to Accumulator 1
Write 0 to PHYRegister 0x58
If PHYConnected is true
Write 0x30B2 to PHYRegister 0x812
Write 0xAFB0 to PHYRegister 0x15
- Increment Accumulator 1 then right shift by 9.
- Delay 10 usec
Write 0 to PHYRegister 0x58
- Loop 16 times from 0 to 15 (4 bit value!)
Take the bitreversed loop index (4 bit value), left shift by 1 and bitwise OR the result with 0x20. Write this value to RadioRegister 0x78
Save the value of RadioRegister 0x78
- Delay 10 usec
- Loop 16 times from 0 to 15
Write 0xD80 to PHYRegister 0x5A
Write 0xC810 to PHYRegister 0x59
Write 0xD to PHYRegister 0x58
If PHYConnected is true
Write 0x30B2 to PHYRegister 0x812
Write 0xAFB0 to PHYRegister 0x15
- Delay 10 usec
If PHYConnected is true
Write 0x30B2 to PHYRegister 0x812
Write 0xEFB0 to PHYRegister 0x15
- Delay 10 usec
If PHYConnected is true
Write 0x30B3 to PHYRegister 0x812
Write 0xFFF0 to PHYRegister 0x15
- Delay 10 usec
Read the value of PHYRegister 0x2D and add it to Accumulator 2
Write 0 to PHYRegister 0x58
If PHYConnected is true
Write 0x30B2 to PHYRegister 0x812
Write 0xAFB0 to PHYRegister 0x15
- Increment Accumulator 2 then right shift by 8
- If Accumulator 1 is less than Accumulator 2, break from the loop
Restore the original value of PHYRegister 0x15
Restore the original values of RadioRegister 0x51, 0x52, 0x43
Restore the original values of PHYRegisters 0x5A, 0x59, 0x58
Restore the original value of MMIO offset 0x3E6
If the Analog Core Revision is not 0
Restore the original value of MMIO offset 0x3F4
Restore the original value of PHYRegister 0x35
- perform the synthetic PU workaround (channel selection)
- If this is a B PHY
Restore the original value of PHYRegister 0x30
Restore the original value of MMIO offset 0x3EC
If this isn't a B PHY and PHYConnected is true
Restore the original value of PHYRegister 0x811
Restore the original value of PHYRegister 0x812
Restore the original value of PHYRegister 0x814
Restore the original value of PHYRegister 0x815
Restore the original value of PHYRegister 0x429
Restore the original value of PHYRegister 0x802
If this isn't a B PHY and PHYConnected isn't true
- If we went through all of the loops in Loop 2
Return the saved value of RadioRegister 0x78
Otherwise, return the value from the RCCTable