PHYSICAL LAYER DEEP-DIVE

LTSSM Complete State Machine Guide

Link Training and Status State Machine: All states, substates, transitions, timeouts, and variables

1. LTSSM Overview

The Link Training and Status State Machine (LTSSM) is the heart of PCIe Physical Layer operation. It manages link initialization, training, power management, error recovery, and link width/speed changes.

LTSSM Main States

State Purpose Link Status
Detect Detect receiver presence Inactive
Polling Establish bit/symbol lock, lane polarity Training
Configuration Negotiate link width, assign lane numbers Training
L0 Normal operation, TLP/DLLP exchange Active (DL_Up)
Recovery Error recovery, speed/EQ changes Temporarily Down
L0s Low-latency power saving (ASPM) Power Saving
L1 Low-power state (deeper ASPM) Power Saving
L2 Very low power (aux power) Power Down
Disabled Link disabled (DPC, software) Disabled
Loopback Testing/diagnostic mode Test
Hot Reset In-band reset via TS1 Reset

2. LTSSM State Diagram

                                    ┌─────────┐
                      ┌─────────────│  RESET  │─────────────┐
                      │             └────┬────┘             │
                      │                  │                  │
                      │                  ▼                  │
                      │            ┌──────────┐             │
                      │            │  DETECT  │◄────────────┼───────────────┐
                      │            └────┬─────┘             │               │
                      │                 │ Receiver          │               │
                      │                 │ Detected          │               │
                      │                 ▼                   │               │
                      │           ┌──────────┐              │               │
                      │           │ POLLING  │──────────────┤               │
                      │           └────┬─────┘   Timeout    │               │
                      │                │                    │               │
                      │                │ TS1/TS2            │               │
                      │                │ Exchange           │               │
                      │                ▼                    │               │
                      │        ┌─────────────────┐          │               │
                      │        │ CONFIGURATION   │──────────┤               │
                      │        └────────┬────────┘ Timeout  │               │
                      │                 │                   │               │
                      │                 │ Width/Lane        │               │
                      │                 │ Configured        │               │
                      │                 ▼                   │               │
       ┌──────────────┼─────────────► L0 ◄──────────────────┤               │
       │              │             (Normal)                │               │
       │              │                │                    │               │
       │  ┌───────────┼────────────────┼────────────────────┼───────────┐   │
       │  │           │                │                    │           │   │
       │  │  L0s ◄────┤                │                    │           │   │
       │  │  (ASPM)   │                │                    │    L1 ◄───┤   │
       │  │           │                │                    │   (ASPM)  │   │
       │  └───────────┤                │                    │           │   │
       │              │                │                    └───────────┤   │
       │              │                │                                │   │
       │              │                ▼                                │   │
       │              │         ┌──────────┐                            │   │
       │              └─────────│ RECOVERY │◄───────────────────────────┘   │
       │                        └────┬─────┘                                │
       │                             │                                      │
       │     ┌───────────────────────┼───────────────────────┐              │
       │     │                       │                       │              │
       │     ▼                       ▼                       ▼              │
       │  DISABLED              HOT RESET               LOOPBACK            │
       │     │                       │                       │              │
       │     └───────────────────────┴───────────────────────┴──────────────┘
       │                                     │
       │                                     ▼
       │                                ┌─────────┐
       └────────────────────────────────│   L2    │
                                        └─────────┘

3. Detect State

Detect State - Receiver Detection

The LTSSM begins in Detect after reset. This state detects the presence of a receiver on the other end of the link.

Substates:

  • Detect.Quiet: Transmitter in electrical idle, waiting
  • Detect.Active: Performing receiver detection

Receiver Detection Mechanism

Receiver detection uses impedance measurement:

Detect Timeouts

Timer Value Description
Detect.Quiet timeout 12ms Wait before detection attempt
Detect.Active timeout 12ms Maximum detection time

Transitions

4. Polling State

Polling State - Bit Lock and Lane Polarity

Polling establishes bit lock, symbol lock, and determines lane polarity inversion.

Substates:

  • Polling.Active: Send TS1, achieve bit/symbol lock
  • Polling.Configuration: Send TS2, verify configuration
  • Polling.Compliance: Compliance pattern mode

Ordered Sets Used

Polling Timeouts

Timer Value
Polling.Active timeout 24ms
Polling.Configuration timeout 48ms

5. Configuration State

Configuration State - Link Width Negotiation

Configuration negotiates the final link width and assigns lane numbers.

Substates:

  • Configuration.Linkwidth.Start: Begin width negotiation
  • Configuration.Linkwidth.Accept: Accept proposed width
  • Configuration.Lanenum.Wait: Wait for lane numbers
  • Configuration.Lanenum.Accept: Accept lane assignment
  • Configuration.Complete: Configuration done
  • Configuration.Idle: Send Idle data before L0

Link Width Negotiation

Both ports advertise supported widths and negotiate the maximum common width:

Configuration Timeouts

Timer Value
Configuration.Linkwidth timeout 24ms
Configuration.Lanenum timeout 2ms
Configuration.Idle timeout 2ms

6. L0 State - Normal Operation

L0 State - Active Link

L0 is the normal operational state where TLPs and DLLPs are exchanged. The link is fully active and at full bandwidth.

L0 Characteristics

Transitions from L0

7. Recovery State

Recovery State - Error Recovery and Speed Changes

Recovery handles various scenarios including error recovery, speed changes, and link equalization.

Substates:

  • Recovery.RcvrLock: Re-establish bit/symbol lock
  • Recovery.Equalization: Perform link equalization (8 GT/s+)
  • Recovery.Speed: Change link speed
  • Recovery.RcvrCfg: Reconfigure receiver
  • Recovery.Idle: Return to L0

Recovery Triggers

Link Equalization in Recovery

For speeds of 8.0 GT/s and above, Recovery.Equalization performs link equalization:

8. Power Management States

L0s - Low Latency Power Saving

L1 - Low Power State

L1 Substates (L1.1, L1.2)

L2 - Auxiliary Power State

9. Special States

Disabled State

Link is disabled by software or hardware (e.g., DPC):

Hot Reset State

In-band reset using TS1 with Hot Reset bit:

Loopback State

Diagnostic/test mode:

10. Key LTSSM Variables

Variable Description
directed_speed_change Speed change has been requested
upconfigure_capable Link can increase width
equalization_done_8GT 8.0 GT/s equalization completed
equalization_done_32GT 32.0 GT/s equalization completed
equalization_done_64GT 64.0 GT/s equalization completed
start_equalization_w_preset Use preset for equalization start
idle_to_rlock_transitioned Tracks Recovery.Idle to RcvrLock transitions

11. PCIe 7.0 LTSSM Changes

128 GT/s Support

Flit Mode Integration

L0p State