Age | Commit message (Collapse) | Author | Files | Lines |
|
Make sure to clear the token before reuse as it may otherwise have an
incorrect toggle setting.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Split pci.c into pci.c and pcidevice.c. The low-level code that
interacts directly with the PCI devices remains in pci.c, while
functions dealing with the higher level pci_device cache move to
pcidevice.c. Only pci.c is needed in 16bit mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Handle '%pP' format descriptions as a pointer to a 'struct pci_device'
and display it in bus:device.function (%02x:%02x.%x) format.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Use the pci_enable_x() functions.
The ehci controller code will now explicitly set PCI_COMMAND_MEMORY
instead of assuming it has already been enabled.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
There are no longer any sleep or yield calls during the usb controller
device scans, so there is no need to run these device scans in a
separate thread.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
EHCI controller setup needs to occur prior to checking any UHCI or
OHCI ports to ensure a high speed device is not mistakenly configured
on a full speed "companion" controller. However, only the UHCI/OHCI
port scan needs to be delayed, not the full UHCI/OHCI controller init.
This change moves back the ehci controller setup check until port
scan in UHCI/OHCI.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
There is no need to pass 'cmdsize' to the usb drivers as the cmdsize
is always 8 bytes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Merge both the control and bulk pipe sending functions into one new
function: ehci_send_pipe(). The two existing functions were similar,
and by merging them the resulting code supports more flexible control
transfers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Simplify the calculation of the maximum transfer size per qtd,
simplify the fillTDbuffer() function so that it only fills the buffer
pointers, and rename fillTDbuffer() to ehci_fill_tdbuf().
Also, don't modify 'data' or 'datasize' so that usb_xfer_time() can
use 'datasize' at the end of the function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The maximum bulk transfer is 64K and 4 QTDs can always transfer 64K.
So, there is no need to support a transfer with more than 4 QTDs.
Build the entire transaction and then submit it in one operation to
simplify the code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Support alloc, update, and free from the single exported function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Rename usb_getFreePipe() to usb_get_freelist(). Add usb_is_freelist()
and usb_add_freelist() functions.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just function renaming - no code implementation changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
This is just function renaming - no code implementation changes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The usbdev->port field is zero indexed, while the USB spec expects the
port values to start at one.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move the 100ms (USB_TIME_SIGATT) device detect polling from the
ohci/uhci/usb-hub code to the generic usb_hub_port_setup() code. This
extends the 100ms polling to ehci and xhci controllers. The code in
usb_hub_port_setup() now compares USB_TIME_SIGATT to the start of
usb_enumerate(), which may make boots faster when threads are
disabled.
This patch also changes the meaning of the return code for
hub->op->detect() calls. Now 1 indicates device found, 0 indicates
device not found, and -1 indicates permanent failure.
Also, the xhci controller generic delay of 100ms is replaced with a
20ms root hub power stabilize time. This in combination with the
100ms for USB_TIME_SIGATT should be closer to the USB2 spec (the USB3
spec does not seem to declare an equivalent of USB_TIME_SIGATT).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Now that uhci and ohci will continually poll for a device connect, the
ehci controller only needs to ensure that the default routing is setup
properly before allowing uhci and ohci to be initialized.
This also fixes two error paths in configure_ehci() that were not
properly updating PendingEHCIPorts.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Don't perform port power up in the detect code. Instead do it prior
to calling usb_enumerate(). This makes the code more similar to the
ohci and xhci drivers. It can also reduce the total boot time when
threads are disabled.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The qTD structures were not being cleared in ehci_alloc_intr_pipe()
and it was possible that garbage could have been in some of the
fields. Also, memset the data array for sanity purposes.
A similar fix is in the Chromium seabios repo (3e711dc261).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
The previous code attempts to correlate which UHCI and OHCI
controllers correlate with which EHCI controllers so that it can
ensure high speed devices are handled by the EHCI code while low/full
speed devices are handled by the UHCI/OHCI code. Replace this logic
by initializing all EHCI controllers first, and then initializing all
UHCI and OHCI controllers. This simplifies the code and improves
support for some hardware devices that don't follow the OHCI/UHCI to
EHCI correlation standard.
Also, remove the unused usb->busid field.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move the inb(), insb(), etc. code from ioport.h to x86.h. Move the
PORT_* definitions to their appropriate hardware files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Also, sort the order of include files in the c files.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
Move many C files from the src/ directory to the new src/hw/ directory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|