genode/repos/dde_linux/src/drivers/usb_host
Norman Feske aa66b5d62f base: remove dependency from deprecated APIs
This patch adjusts the implementation of the base library and core such
that the code no longer relies on deprecated APIs except for very few
cases, mainly to keep those deprecated APIs in tact for now.

The most prominent changes are:

- Removing the use of base/printf.h

- Removing of the log backend for printf. The 'Console' with the
  format-string parser is still there along with 'snprintf.h' because
  the latter is still used at a few places, most prominently the
  'Connection' classes.

- Removing the notion of a RAM session, which does not exist in
  Genode anymore. Still the types were preserved (by typedefs to
  PD session) to keep up compatibility. But this transition should
  come to an end now.

- Slight rennovation of core's tracing service, e.g., the use of an
  Attached_dataspace as the Argument_buffer.

- Reducing the reliance on global accessors like deprecated_env() or
  core_env(). Still there is a longish way to go to eliminate all such
  calls. A useful pattern (or at least a stop-gap solution) is to
  pass the 'Env' to the individual compilation units via init functions.

- Avoiding the use of the old 'Child_policy::resolve_session_request'
  interface that returned a 'Service' instead of a 'Route'.

Issue #1987
2019-02-19 11:08:17 +01:00
..
spec dde_linux: iterate over PCI devices in ascending BDF order 2019-02-12 10:33:15 +01:00
dummies.c dde_linux: support of GSIs in new usb_host_drv 2018-09-13 15:21:11 +02:00
lx_emul.cc dde_linux: support of GSIs in new usb_host_drv 2018-09-13 15:21:11 +02:00
lx_emul.h dde_linux: use correct type in lx_emul's min 2018-09-13 14:54:20 +02:00
main.cc base: remove dependency from deprecated APIs 2019-02-19 11:08:17 +01:00
platform.h dde_*: remove the use of deprecated APIs 2019-01-30 13:49:54 +01:00
raw_driver.c
raw.cc dde_*: remove the use of deprecated APIs 2019-01-30 13:49:54 +01:00
raw.h
README Adapt usb_drv RAM quota to 12M 2019-02-12 10:33:32 +01:00
signal.h dde_*: remove the use of deprecated APIs 2019-01-30 13:49:54 +01:00
target.inc

USB host controller driver
##########################

Allows access to USB devices via the 'Usb' session interface.

Configuration snippet:

!<start name="usb_host_drv">
!  <resource name="RAM" quantum="10M"/>
!  <provides><service name="Usb"/></provides>
!  <config>
!     <report devices="yes"/>
!  </config>
!</start>

The optional 'devices' report lists the connected devices and gets updated
when devices are added or removed.

Example report:

!<devices>
!  <device label="usb-1-2" vendor_id="0x046d" product_id="0xc077" bus="0x0001" dev="0x0002" class="0x03"/>
!  <device label="usb-1-1" vendor_id="0x1d6b" product_id="0x0002" bus="0x0001" dev="0x0001" class="0x09"/>
!</devices>

For every device a unique identifier is generated that is used to access the
USB device. Only devices that have a valid policy configured at the USB driver
can be accessed by a client. The following configuration allows 'comp1' to
access the device 'usb-1-6':

!<start name="usb_drv">
!  <resource name="RAM" quantum="12M"/>
!  <provides><service name="Usb"/></provides>
!  <config uhci="yes" ohci="yes" ehci="yes" xhci="yes">
!    <raw>
!        <report devices="yes"/>
!        <policy label="comp1 -> usb-1-6" vendor_id="0x13fe" product_id="0x5200" bus="0x0001" dev="0x0006"/>
!    </raw>
!  </config>
!</start>

In addition to the mandatory 'label' attribute the policy node also
contains optional attribute tuples of which at least one has to be present.
The 'vendor_id' and 'product_id' tuple selects a device regardless of its
location on the USB bus and is mostly used in static configurations. The
'bus' and 'dev' tuple selects a specific device via its bus locations and
device address. It is mostly used in dynamic configurations because the device
address is not fixed and may change every time the same device is plugged in.
If the class attribute is defined only, the usb host controller driver allows
access to all devives of that class. In that case the actual device is chosen
by the last label given when a session gets opened.


BIOS Handoff
~~~~~~~~~~~~

Per default the USB driver performs a hand off of the USB controller from the
BIOS, since it still may access the controller when booting, for example, from
a USB device. The BIOS hand off induces the execution of BIOS/SMM USB driver
code and potentially DMA operations. Unfortunately, some ACPI tables report
wrong RMRR information, which implicates IOMMU faults on illegal DMA
operations and consequently the hand off may fail after noticeably long
timeouts. Therefore, the hand off can be disabled in the USB driver
configuration like follows.

! <config bios_handoff="no"/>