Endpoint Autonomous Link Bandwidth Management

The PCIe Controller performs link bandwidth management by enabling the endpoint to change the link speed autonomously (which is permitted by the PCIe specification). However, the PCIe specification does not define the mechanism to initiate the autonomous change. In the PCIe Controller, firmware can initiate the autonomous link speed change.

Upon reset de-assertion, the link initially trains up to Gen4 speed if supported by both link devices. Otherwise, the link initially trains up to Gen1 speed. The endpoint can autonomously initiate a link speed change with the following process:

  1. Check the current negotiated link speed by reading the Negotiated Link Speed field of the Link Control and Status Configuration Register (bits [19:16]).
  2. Check the host's upper link speed limit by reading the Target Link Speed field in the Link Control 2 Configuration Register.
  3. If the endpoint needs to change the link speed within the limit constrained by the host:
    1. Program the required speed in the endpoint's Target Link Speed field of the Local Management Register - Link Width Control Register (bits [25:24]) .
    2. Trigger link retraining by writing a 1 to the endpoint's Link Speed Change Retrain Link bit of the Local Management Register - Linkwidth Control Register.
    3. Wait for the endpoint Link Speed Change Retrain Link bit to clear. The PCIe Controller clears this bit when link retraining is complete.
  4. To check if the speed change was successful, read the Negotiated Link Speed field of the Link Control and Status Configuration Register (bits [19:16]).

The host can disable autonomous link speed changes on the endpoint by setting the Hardware Autonomous Speed Disable bit in the Link Control and Status Register 2. If the host sets this bit, any endpoint request to change the link speed will not be successful. The PCIe Controller enters recovery but does not initiate a speed change.

The firmware should always wait for a link retraining request to complete before initiating another retraining request.

After initiating a link retrain request, do not write to the Linkwidth Control Register utill the retraining request is completed.