Tuesday, July 01, 2014

How to check ASPM on PCIE device

Most of BIOS engineer may face such topic during development phase. I wrote this down in case I won't forget next time... I always easily forgot so many basic things..

First of all, before we learn how to check the ASPM on this PCIE device, we should understand how to find the correct register of ASPM.

Key point: PCI Capability Pointer

1. Look the Standard PCIE space, yes, the PCI Capability Pointer is the entry of this topic.
 
 2. Why we should find Capability Pointer first? Because ASPM information can be found at Link Control Register. The register under Capability Structure.
    Now, the first job is, according to the Capability Pointer, to find out where the Structure is.
 
Key point: PCI Capability ID is 0x10
3. Second, as we are looking for Capability Structure, we are according to Capability Pointer to find the entry. However, not every entry are the base of Capability Structure. We should check every entry's offset 0x00 bit[7:0], if the Capability ID is not 0x10, go to next the Capability Pointer to check Capability ID again.
 
 
4. Untill we found the Capability ID is 0x10, then we can ensure this Capability Pointer is the correct base of Capability Structure.
5. The Link Control Register is offset 0x10 of Capability Structure. Example, if the Capability Structure entry is at 0xE0h, then Link Control Register should be at offset 0xF0h
6. Check 0xF0h bit[1:0], that's the ASPM information is.
 
 
 
..... End