OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: XHCI Legacy
PostPosted: Sun Jul 30, 2017 2:28 am 
Offline
Member
Member

Joined: Tue Oct 01, 2013 2:50 am
Posts: 118
Location: Budapest, Hungary
I had some time to work on my XHCI-driver (in intel assembly).
I still don't get the Device Descriptor, but SetAddress returns with OK.

I have a problem with the Legacy Support.
IDs of Extended Capabilities:
VirtualBox: 02 02 (so there are two "Supported Protocol"-entries)
Dell Inspiron 5559: 02 02 C0 01 C6 C7 C2 0A C3 C4 C5

As it can be seen above, there is no ID=1, so VirtualBox provides no Legacy Support.
Lunt says in his book(1st ed. page 9-9) that if the Legacy Support is found, then it must be the first item in the list.
That's why the 01 in case of Dell Inspiron 5559 shouldn't be Legacy Support (!?).
According to the XHCI-specs (7.1): "The USB Legacy Support provided by the xHC is optional normative functionality ...".

The question is how can I turn off Legacy Support, if it is not present in the list of Extended Capabilities?

I have a working EHCI-driver (can read/write files from/to pendrives), so turning off Legacy Support works for me in case of EHCI.

Regards,
rob


Top
 Profile  
 
 Post subject: Re: XHCI Legacy
PostPosted: Sun Jul 30, 2017 5:31 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
If there is no USB Legacy Support Extended Capability (ID 0x01) then the XHCI does not implement legacy support. Thus it does not need to be turned off. If it is present you need to acquire the OS-BIOS semaphore, similar to EHCI.

I don't see where the spec states that capability 0x01 has to be the first capability.

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


Top
 Profile  
 
 Post subject: Re: XHCI Legacy
PostPosted: Sun Jul 30, 2017 5:58 am 
Offline
Member
Member

Joined: Tue Oct 01, 2013 2:50 am
Posts: 118
Location: Budapest, Hungary
Korona wrote:
Thus it does not need to be turned off.


So, does this mean, that BIOS won't interfere, if Legacy-Support is not present in the ExtCaps?


Top
 Profile  
 
 Post subject: Re: XHCI Legacy
PostPosted: Sun Jul 30, 2017 7:04 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
Yes.

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


Top
 Profile  
 
 Post subject: Re: XHCI Legacy
PostPosted: Sun Jul 30, 2017 12:17 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 934
Location: USA
Korona wrote:
I don't see where the spec states that capability 0x01 has to be the first capability.

Section 7.1.1 in version 1.1
"This register is an xHCI extended capability register. It includes a specific function section and a pointer
to the next xHCI Extended Capability. This register is used by pre-OS software (BIOS) and the operating
system to coordinate ownership of the xHC."

It is used as a start for the extended capabilities list and is at offset "xECP + 00h".

Therefore, it is pretty much required to be present. I don't know of any xHCI implementation that does not support Legacy Support, but it has been a few months since I have worked with USB.

Ben
http://www.fysnet.net/the_universal_serial_bus.htm


Top
 Profile  
 
 Post subject: Re: XHCI Legacy
PostPosted: Sun Jul 30, 2017 12:35 pm 
Offline
Member
Member

Joined: Tue Oct 01, 2013 2:50 am
Posts: 118
Location: Budapest, Hungary
BenLunt wrote:
It is used as a start for the extended capabilities list and is at offset "xECP + 00h".

Therefore, it is pretty much required to be present.


Thanks Ben.
I checked my code many times but it still seems that there is no xhci-Legacy-Support in virtualbox.
As for the Dell-Inspiron, I will check that ID=1 which is not at xECP+00h.

Sooner or later I will have working xHCI-driver. :)


Top
 Profile  
 
 Post subject: Re: XHCI Legacy
PostPosted: Sun Jul 30, 2017 2:05 pm 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
BenLunt wrote:
It is used as a start for the extended capabilities list and is at offset "xECP + 00h".

Even though that says xECP I think they mean "start of the capability" and not the literal xECP register here. I might be wrong though.

XHCIs on PCI expansion cards will probably not provide legacy support. I don't think there is a PCIe packet that causes the system to enter SMM; therefore those cards should be unable to implement legacy support.

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 58 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