Minor - clear unused f-segment data at start of f-segment.

Zero the space - some old applications can use the space for UMB if it
is zeroed.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
move usb mass storage defines to usb.h

With the arrival of usb attached scsi support they
will be needed outside usb-msd.c too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb attached scsi boot support

This patch adds support for booting from UAS (usb
attached scsi) devices.

For now only usb 2.0 support is there.  On usb 3.0 the
UAS protocol uses streams, so changes will be required
to make usb 3.0 devices fly once we have a xhci host
controller driver.

So far the driver has been tested on qemu-emulated
virtual hardware only.  In theory should just work on
bare metal too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
lsi53c895a boot support

This patch adds support for the lsi53c895a scsi host adapter,
allowing seabios to boot from scsi disks and cdroms connected
to the lsi scsi hba emulated by qemu.

This driver was written by looking at the expectations of qemu's
lsi emulation.  I have no idea idea how close this is to work on
real hardware, and I somehow doubt anyone cares given the age of
physical lsi scsi cards.  It depends on !COREBOOT for that reason.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Unify ATAPI command processing.

Unify the ATA and AHCI ATAPI command processing into one function in
block.c (process_atapi_op).

This patch disables the existing handlers for ATA ATAPI isready and
reset.  However, it's unlikely that support is needed and it does not
appear that the implemented support is fully correct.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Increase debug level of Xen detection code.

Now that Xen is enabled by default the detection code will frequently
not find a valid Xen hypervisor signature, so don't spam the debug
logs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
EHCI: increase CONNECT detection delay

Increase delay to fix detection issues found.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Sven Schnelle <svens@stackframe.org>
report real I/O APIC ID (0) on MADT and MP-table (v3)

When resetting an I/O APIC, its ID is set to 0, and SeaBIOS doesn't
change it, so report it correctly on the ACPI MADT table and MP-table.

Some hardware may require the BIOS to initialize I/O APIC ID to an
unique value, but SeaBIOS doesn't do that. This patch at least makes the
tables reflect reality.

Changes v2 -> v3:
 - Fix MP-table too, not just ACPI MADT table

Changes v1 -> v2:
 - Cosmetic: whitespace change (removed extra newline)
 - New patch description

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
allow CPUs to have non-contiguous Local APIC IDs (v2)

Extract Local APIC IDs directly from the CPUs, and instead of check for
"i < CountCPUs", check if the APIC ID was present on boot, when building
ACPI tables and the MP-Table.

This keeps ACPI Processor ID == APIC ID, but allows the
hardware<->SeaBIOS interface be completely APIC-ID based and not depend
on any other kind of "CPU identifier". This way, SeaBIOS may change the
way ACPI Processor IDs are chosen in the future.

As currently SeaBIOS supports only xAPIC and not x2APIC, the list of
present-on-boot APIC IDs is a 256-bit bitmap. If one day SeaBIOS starts
to support x2APIC, the data structure used to enumerate the APIC IDs
will have to be changed (but this is an internal implementation detail,
not visible to the OS or on any hardware<=>SeaBIOS interface).

For current QEMU versions (that always make the APIC IDs contiguous),
the OS-visible behavior and resulting ACPI tables should be exactly the
same. This patch will simply allow QEMU to start setting non-contiguous
APIC IDs (that is a requirement for some sockets/cores/threads topology
settings).

Changes v1 -> v2:
 - Use size suffixes on all asm instructions on smp.c
 - New patch description

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Merge branch 'upstream'