USB improvements (#116)

* Add new heap manager.

* Convert OHCI driver to use new heap manager.

* Convert UHCI driver to use new heap manager.

* Convert EHCI driver to use new heap manager.

* Convert XHCI driver to use new heap manager.

* Convert SMP to use new heap manager.

* Add a "usbinit" boot option to handle various buggy USB devices.

This replaces the "keyboard=buggy-usb" option, and adds a second
workaround to handle the problem seen in issue #107.
This commit is contained in:
martinwhitaker
2022-07-16 12:34:08 +01:00
committed by GitHub
parent 89e2643de4
commit e6e0f0c8e7
14 changed files with 355 additions and 164 deletions

View File

@@ -177,9 +177,6 @@ static void parse_option(const char *option, const char *params)
keyboard_types = KT_LEGACY;
} else if (strncmp(params, "usb", 4) == 0) {
keyboard_types = KT_USB;
} else if (strncmp(params, "buggy-usb", 10) == 0) {
keyboard_types = KT_USB;
usb_init_options |= USB_EXTRA_RESET;
}
} else if (strncmp(option, "powersave", 10) == 0) {
if (strncmp(params, "off", 4) == 0) {
@@ -203,6 +200,14 @@ static void parse_option(const char *option, const char *params)
enable_trace = true;
} else if (strncmp(option, "usbdebug", 9) == 0) {
usb_init_options |= USB_DEBUG;
} else if (strncmp(option, "usbinit", 8) == 0) {
if (strncmp(params, "1", 2) == 0) {
usb_init_options |= USB_2_STEP_INIT;
} else if (strncmp(params, "2", 2) == 0) {
usb_init_options |= USB_EXTRA_RESET;
} else if (strncmp(params, "3", 2) == 0) {
usb_init_options |= USB_2_STEP_INIT|USB_EXTRA_RESET;
}
} else if (strncmp(option, "nosm", 5) == 0) {
enable_sm = false;
}

View File

@@ -22,6 +22,7 @@
#include "cache.h"
#include "cpuid.h"
#include "cpuinfo.h"
#include "heap.h"
#include "hwctrl.h"
#include "hwquirks.h"
#include "io.h"
@@ -216,6 +217,8 @@ static void global_init(void)
pmem_init();
heap_init();
pci_init();
quirks_init();