usb_host: support to disable usb controller types

The commits adds the same configuration values as supported up to now by
the monolithic usb driver. In contrast to the original, by default all drivers
are started. Disabling a controller type is used by Sculpt, e.g. for OHCI if
running Sculpt inside Virtualbox.
This commit is contained in:
Alexander Boettcher 2021-03-23 11:32:55 +01:00 committed by Norman Feske
parent 521f61b9e0
commit 53041f4cd8
2 changed files with 27 additions and 8 deletions

View File

@ -26,6 +26,12 @@ struct Services
{
Genode::Env &env;
/* Controller types */
bool uhci = true; /* 1.0 */
bool ohci = true;
bool ehci = true; /* 2.0 */
bool xhci = true; /* 3.0 */
/* report generation */
bool raw_report_device_list = false;
@ -39,6 +45,11 @@ struct Services
Genode::Xml_node node_report = config_node.sub_node("report");
raw_report_device_list = node_report.attribute_value("devices", false);
} catch (...) { }
uhci = config_node.attribute_value("uhci", uhci);
ohci = config_node.attribute_value("ohci", ohci);
ehci = config_node.attribute_value("ehci", ehci);
xhci = config_node.attribute_value("xhci", xhci);
}
};

View File

@ -220,15 +220,23 @@ extern "C" void module_xhci_pci_init();
void platform_hcd_init(Genode::Env &, Services *s)
{
module_xhci_hcd_init();
module_xhci_pci_init();
if (s->xhci) {
module_xhci_hcd_init();
module_xhci_pci_init();
}
/* ehci_hcd should always be loaded before uhci_hcd and ohci_hcd, not after */
module_ehci_hcd_init();
module_ehci_pci_init();
if (s->ehci) {
/* ehci_hcd should always be loaded before uhci_hcd and ohci_hcd, not after */
module_ehci_hcd_init();
module_ehci_pci_init();
}
module_ohci_hcd_mod_init();
module_ohci_pci_init();
if (s->ohci) {
module_ohci_hcd_mod_init();
module_ohci_pci_init();
}
module_uhci_hcd_init();
if (s->uhci) {
module_uhci_hcd_init();
}
}