Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2018 14:21:41 +0000
From:      Tom Jones <thj@freebsd.org>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Missing USB on Intel Cherryview
Message-ID:  <20181127142141.GA15340@tom-desk.erg.abdn.ac.uk>
In-Reply-To: <ac5631df-04cc-1b53-0257-f24461f015b1@selasky.org>
References:  <20181127115327.GA84974@tom-desk.erg.abdn.ac.uk> <ac5631df-04cc-1b53-0257-f24461f015b1@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

Thanks for your reply. 

> Currently there is not so much to try, but you can start poking in 
> sys/dev/usb/controller/xhci*.[ch] . I have not made any USB-C specific 
> changes to the XHCI driver in FreeBSD, so yes, it might not work.
> 
> There are also some debug knobs: sysctl -a | grep xhci

USB-C here is a red herring, there is a i2c controlled mux involved
before it will work for USB data. 

I think we are missing a second usb instance (instances? I am not sure
of the terminology) on the xhci controller.

Looking at Linux and NetBSD, they both launch two USB from their
xhci_pci drivers.  

Linux creates the first here:
https://github.com/torvalds/linux/blob/master/drivers/usb/host/xhci-pci.c#L326
the second here
https://github.com/torvalds/linux/blob/master/drivers/usb/host/xhci-pci.c#L334

NetBSD manages two instances of bus in the softc, sc_bus and sc_bus2
sc_bus2 is configured here, the same as the first bus but with an
explicit usb revision set to USBREV_2_0. They share the same dmatag.

https://github.com/NetBSD/src/blob/trunk/sys/dev/usb/xhci.c#L929

Both instances are then registered with the usb subsystem here:
https://github.com/NetBSD/src/blob/trunk/sys/dev/pci/xhci_pci.c#L281

I seem a similar pattern in the tegra xhci drivers for NetBSD and Linux.

I am going to have a dive into the intel xHCI Interface docs to get more
background.

https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf

Could you tell me if this multiple usb instance interface is something
we are missing or something we implement in a different manner?

- Tom



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181127142141.GA15340>