| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Support alloc, update, and free from the single exported function.
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>
|
|
|
|
|
|
| |
Support alloc, update, and free from the single exported function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
Instead of exporting both xhci_alloc_pipe() and xhci_update_pipe(),
export only xhci_realloc_pipe() and support alloc, update, and free
from it.
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>
|
|
|
|
|
|
| |
Also, pass in usbdev to usb_free_pipe().
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Previously, the a20 line would always be enabled and left on after
call32_sloppy(). The setting should really be backed up and restored
on each call.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
Although the a20 functionality was originally implemented in the ps2
controller, that is just a historical artifact. It's a core feature
of modern x86 cpus and the code is better located in the x86.h header.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for jumping into 32bit mode using a System Management Mode
(SMM) handler. When available, this allows SeaBIOS to transition to
32bit mode even when called in vm86 mode. It will also prevent the
clobbering of the segment registers.
Currently, the SMM mode is only supported in QEMU when running in TCG
mode. Also, QEMU v2.1 (or later) is needed for it to work when in
vm86 mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
When transitioning back to 16bit mode from within call32(), restore
the full state (cmos index, gdt, fs/gs) in addition to restoring the
original stack.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
This separates call32() into two functions. It also moves the
call16_sloppy() code next to the call32_sloppy() code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
| |
Use inline assembler in call16 type functions instead of using
__call16() in romlayout.S.
Since call16() and call16big() are now only called with %ss==0 they do
not need to update the stack pointer. Only call16_sloppy() requires
the stack manipulation code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
Add support for a FUNCFSEG macro that will force a "32bit flat" C
function to be located in the f-segment. This is useful for 32bit
code with inline assembler that thunks to 16bit mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change, farcall16() is only used for external API calls and
is only invoked from a 32bit mode entered directly via transition32.
farcall16big() is also only used for external API calls and is only
invoked from a 32bit mode entered directly via transition32.
call16_int() now calls _farcall16() directly, and it will use normal
16bit mode or big real mode as required.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
| |
If 32bit mode is entered directly via transition32, then use a simple
call16() when hopping back to 16bit mode. Use only call16big() during
post and when entering 32bit mode via call32().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
| |
Also, update callers to rely on this feature.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Make the mouse handler stack_hop_back() code similar to the other
users that use need_stack_hop().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Also, use need_hop_back() instead of on_extra_stack() in code that
determines whether or not to call stack_hop_back().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
| |
This change is a just code movement.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
If the pmm entry point was called with a non-zero stack segment, the
pointer to the arguments on the stack would not be valid once the
code transitioned to 32bit mode. Fix by adding the stack segment
offset into the args pointer.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's not valid to pass a pointer to a stack variable through the
stack_hop() call (because the call changes the stack segment). This
bug was probably not noticed before because by default
(CONFIG_ENTRY_EXTRASTACK) SeaBIOS uses the extra stack on all 16bit
entry points, and the internal stack_hop() with that config option is
effectively a no-op.
This reverts commit d488a7683d90bf8fae7ceb8c3ad9e95fbbd92079.
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>
|
|
|
|
|
|
|
|
| |
According to the USB2 specification, a device may take up to 100ms
(USB_TIME_SIGATT) after port power stabilizes to be detected. So,
continually recheck for a device connection event.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the USB2 specification, a device may take up to 100ms
(USB_TIME_SIGATT) after port power stabilizes to be detected. So,
continually recheck for a device connection event.
Technically, the uhci root hub ports are always powered up, but it's
not possible to know how long the machine has been on, so it's better
to be safe here.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
Use the connect status bit to determine if a device is connected
instead of the port link state state machine status. This makes the
driver more similar to the other drivers and may help diagnose devices
that take longer to boot up.
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
usb root hub drivers. It can also reduce the total boot time when
threads are disabled.
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>
|
|
|
|
|
|
|
|
| |
Add these two functions so that the xhci code is more similar to the
other USB controllers. Also, store the temporary hub structure on the
stack instead of in struct usb_xhci_s.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
| |
Move the setup code to the top of the file so that like code is
together and to make the code layout more similar to the other usb
controllers.
This change is purely code movement.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Now that the driver runs exclusively in 32bit mode, avoid using the
scarce low memory resource.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
The usb-xhci.c file is only compiled in 32bit mode now, so remove all
the 16bit macros.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Make sure to call usb_desc2pipe() when updating a pipe settings. This
ensures that pipe->devaddr is properly updated.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
Make sure to wrap accesses to the usb_pipe struct with GET_LOWFLAT so
that it works in 16bit mode. This bug impacts both ehci and uhci usb
controllers (it should not impact ohci and xhci as those never call
the function in 16bit mode).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
| |
Instead of magic numbers, use specified macros for FADT Fixed Feature Flags.
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Use hex numbers for the rom instance count in boot order open firmware
device naming. The ":rom" suffix isn't part of a standard and it's
highly unlikely any rom would have 10 or more drives on it, but this
change makes the code more similar to the numbering of other boot
order devices.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We identify devices by their Open Firmware device paths. The path
component for the logical unit on a bus is incorrect:
bootprio_find_scsi_device() and bootprio_find_usb() format target
(a.k.a. SCSI ID) and lun in decimal, while QEMU uses hexadecimal.
Bootorder list entries with target, lun > 9 aren't found (lucky case),
or attributed to the wrong logical unit (unlucky case).
The relevant spec[*] agrees with QEMU (and OVMF, for that matter).
Change %d to %x.
No actual impact on USB, because QEMU only uses LUN 0 there.
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1096560
[*] Open Firmware Recommended Practice: SCSI-3 Parallel Interface,
Version 1, Section 3.1 Physical Address Formats and Representations
http://www.openfirmware.org/1275/practice/spi/spi1_0.ps
IEEE Standard for Boot (Initialization Configuration) Firmware: Core
Requirements and Practices, IEEE Std 1275-1994, Annex E SCSI host
adapter package class, section E.2.1 Physical address formats and
representations
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
attached
Commit c6e298e1f12e0f4ca02b6da5e42919ae055f6830
hw/pci: reserve IO and mem for pci-2-pci bridges with no devices attached
introduced support for hot-plugging devices behind pci-2-pci bridges.
Extend hotplug support also for pci express downstream ports.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes:
Compiling (16bit) out/romlayout.o
src/romlayout.S: Assembler messages:
src/romlayout.S:285: Error: expecting string instruction after `rep'
make: *** [out/romlayout.o] Error 1
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The xhci controller had a hardcoded 1 second timeout for both bulk and
control transfers. The 1 second bulk timeout is too small for some
real devices.
Increase both times to 5.1 seconds - according to the USB spec, the
maximum time a command should take is 5 seconds. However, have the
set_address command only wait for 150ms (spec says set_address should
take no more than 50ms).
Introduce usb_xfer_time() to calculate maximum command time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|