G PHY ACI Control ( bool enable)
Note: The locations used to save/restore register contents must be global or static as they are used across calls.
If PHY Register 0x33 is 0x0800
- Set tmp TRUE
- Otherwise
- Set tmp FALSE
- If tmp equals enable
- Return
- If enable is true
Set bit 2 in aci_state
Save PHY Registers 0x401 and 0x429
- If the PHY revision is 1
Save PHY Register 0x406
- Otherwise
Save PHY Registers 0x4C0 and 0x4C1
Save PHY Registers 0x33, 0x4A7, 0x4A3, 0x4A9, 0x4AA, 0x4AC, 0x493, 0x4A1, 0x4A0, 0x4A2, 0x48A, 0x4A8, and 0x4AB
If PHY revision >= 2
Save PHY Register 0x4AD
- If PHY revision is 2
Save PHY Register 0x4AE
- Otherwise
Save PHY Registers 0x415, 0x416, and 0x417
Save APHY Read Table Entry with arguments ( 0x407, 2) save table 2
Save APHY Read Table Entry with arguments ( 0x407, 3) save table 3
Save PHY Registers 0x42B and 0x48C
Clear bit 0x1000 in PHY Register 0x401
MaskSet PHY Register 0x429 with mask 0xFFFC and set with 0x0002
Write 0x0800 to PHY Register 0x33
Write 0x2027 to PHY Register 0x4A3
Write 0x1CA8 to PHY Register 0x4A9
Write 0x287A to PHY Register 0x493
Write 0x1CA8 to PHY Register 0x4AA
Write 0x287A to PHY Register 0x4AC
MaskSet PHY Register 0x4A0 with mask 0xFFC0 and set with 0x001A
Write 0x000D to PHY Register 0x4A7
- If PHY revision is 1
Write 0xFF0D to PHY Register 0x406
- Else if PHY revision is 2
Write 0xFFFF to PHY Register 0x4C0
Write 0x00A9 to PHY Register 0x4C1
- Otherwise
Write 0x00C1 to PHY Register 0x4C0
Write 0x0059 to PHY Register 0x4C1
MaskSet PHY Register 0x4A1 with mask 0xC0FF and set with 0x1800
MaskSet PHY Register 0x4A1 with mask 0xFFC0 and set with 0x0015
MaskSet PHY Register 0x4A8 with mask 0xCFFF and set with 0x1000
MaskSet PHY Register 0x4A8 with mask 0xF0FF and set with 0x0A00
MaskSet PHY Register 0x4AB with mask 0xCFFF and set with 0x1000
MaskSet PHY Register 0x4AB with mask 0xF0FF and set with 0x0800
MaskSet PHY Register 0x4AB with mask 0xFFCF and set with 0x0010
MaskSet PHY Register 0x4AB with mask 0xFFF0 and set with 0x0005
MaskSet PHY Register 0x4A8 with mask 0xFFCF and set with 0x0010
MaskSet PHY Register 0x4A8 with mask 0xFFF0 and set with 0x0006
MaskSet PHY Register 0x4A2 with mask 0xF0FF and set with 0x0800
MaskSet PHY Register 0x4A0 with mask 0xF0FF and set with 0x0500
MaskSet PHY Register 0x4A2 with mask 0xFFF0 and set with 0x000B
If PHY revision <= 2
Set bit 0x1000 in PHY Register 0x48A
MaskSet PHY Register 0x48A with mask 0x9FFF and set with 0x2000
Call mhf with arguments ( 0, 0x0800, 0x0800, 0 )
- Otherwise
Clear bit 0x1000 in PHY Register 0x48A
MaskSet PHY Register 0x415 with mask 0x8000 and set with 0x36DB
MaskSet PHY Register 0x416 with mask 0x8000 and set with 0x36DB
MaskSet PHY Register 0x417 with mask 0xFE00 and set with 0x016D
If the PHY revision >= 2
Set bit 0x0800 in PHY Register 0x42B
MaskSet PHY Register 0x48C with mask 0xF0FF and set with 0x0200
- If the PHY revision is 2
MaskSet PHY Register 0x4AE with mask 0xFF00 and set with 0x007F
MaskSet PHY Register 0x4AD with mask 0x00FF and set with 0x1300
Else if the PHY revision >= 6
Call APHY Write Table Entry with arguments ( 0x407, 0x3, 0x7F)
Call APHY Write Table Entry with arguments ( 0x407, 0x2, 0x7F)
Clear bits 0xFF00 in PHY Register 0x4AD
- Otherwise
Clear bit 2 in aci_state
Restore PHY Registers 0x401, 0x429, 0x33, 0x4A3, 0x4A9, 0x493, 0x4AA, 0x4AC, 0x4A0, and 0x4A7
- If the PHY revision is 1
Restore PHY Register 0x406
- Otherwise
Restore PHY Registers 0x4C0 and 0x4C1
Restore PHY Registers 0x4A1, 0x4AB, and 0x4A8
If the PHY revision >= 2
Restore PHY Register 0x4AD
- If the PHY revision is 2
Restore PHY Register 0x4AE
- Otherwise
Restore PHY Registers 0x415, 0x416, and 0x417
Call APHY Write Table Entry using 0x407, 0x2, and save table 2 as arguments
Call APHY Write Table Entry using 0x407, 0x3, and save table 3 as arguments
Restore PHY Registers 0x4A2, 0x48A, 0x42B, and 0x48C
Call mhf with arguments ( 0, 0x0800, 0, 0)