OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 9:18 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: PCIe Link Speed Retraining
PostPosted: Tue Aug 27, 2019 7:41 am 
Offline
Member
Member

Joined: Mon Oct 15, 2007 3:04 pm
Posts: 296
Hi,

After a long break from OS related tinkering I thought I'd give it another go, this time using UEFI which has actually been pretty pleasant.
I'm doing some work on PCIe specifically, (for a specific device) .. so from the configuration space offset 0x34 I've followed the pointers to find the PCIe extended configuration structure (id = 0x10).
From here I've used offset 0x04 to determine maximum payload (which I set through offset 0x08). In my case it's 256bytes.
The link capabilities register gives a max link width of 0x16 and a max link speed of 3 (from register offset 0x0c).
The link status register (0x12) is showing me negotiated link width of x16 (so nothing to do there) but a current link speed of 1.

Using register 0x30 (Link Control 2 Register) I set bits 0:3 to link speed 3.

Using register 0x10 (Link Control Register) I set bit 5 to trigger a link re-train.

The I wait a small duration (1second just for debugging)

In a polling loop I test bit 11 of the Link status Register (Link Training) until it's clear.

Read the info back from link status register (0x12) and it's still showing me a link speed of 1.

Do I need to configure the de-emphasis values as well ? Perhaps someone can shed some light on the correct process to correctly set and retrain the PCIe device link to a higher speed.

Thanks!
John


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 54 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group