Kevin O'Connor [Fri, 26 Feb 2010 13:57:13 +0000 (08:57 -0500)]
Prefer passing a USB "pipe" structure over a USB endp encoding.
Instead of passing the "u32 endp" encoding of the usb endpoint,
allocate a "struct usb_pipe" for each end point and pass that.
Allocate a control pipe for every device found. Support freeing the
pipes after they are done.
Implement pipe allocation and freeing for both UHCI and OHCI
controllers.
Also, don't define every UHCI qh to include a pipe - create a separate
structure "struct uhci_pipe". Also, be sure to clear the
USBControllers on reset. Also, convert usb_hub_init to return 0 on
success. Also, cleanup some of the USB debug messages to make them
more consistent.
Kevin O'Connor [Mon, 22 Feb 2010 04:20:10 +0000 (23:20 -0500)]
Cleanup - build drive description in temp memory during init.
Remove describe_drive() mechanism for calling printf with a drive
description. Instead, have each drive build a description in
temporary ram during drive initialization.
Also, remove fields now unneeded from 'struct disk_s' - model and
cntl_info.
Jes Sorensen [Tue, 16 Feb 2010 08:46:08 +0000 (09:46 +0100)]
Seabios e820 reservation portion v3
On 02/16/10 01:43, Kevin O'Connor wrote:
> On Mon, Feb 15, 2010 at 06:33:59PM +0100, Jes Sorensen wrote:
>> Hi,
>>
>> This is the Seabios part to match my e820 reservation via fw_cfg patch.
>
> This still has 'struct e820_entry' which is too similar to 'struct
> e820entry' in memmap.h. Otherwise, it looks good to me.
Hmmm didn't catch that one earlier, thanks for pointing it out. I have
renamed it to struct e820_reservation to make it different.
Hope this version does the trick then.
Cheers,
Jes
Read optional table of e820 entries from qemu_cfg
Read optional table of e820 entries through qemu_cfg, allowing QEMU to
provide the location of KVM's switch area etc. rather than rely on
hard coded values.
For now, fall back to the old hard coded values for the TSS and EPT
switch page for compatibility reasons. Compatibility code could
possibly be removed in the future.
Kevin O'Connor [Thu, 18 Feb 2010 04:24:42 +0000 (23:24 -0500)]
Initial support for booting from USB drives.
This patch adds initial support for USB Mass Storage Controllers.
This includes support for bulk transfers on UHCI controllers.
Code to detect a USB MSC device is added, and wrappers for sending
"cdb" block commands over USB are added.
The scsi "inquiry" command is also added.
Kevin O'Connor [Sun, 14 Feb 2010 02:51:47 +0000 (21:51 -0500)]
Support USB interrupt schedules on OHCI and UHCI.
The existing code always checks for USB "interrupt in" events every
millisecond. Although that's okay, it consumes extra bandwidth. This
change interrupt checks to be scheduled according to their requested
interval time.
Kevin O'Connor [Sat, 13 Feb 2010 23:49:24 +0000 (18:49 -0500)]
Add some ASSERT32FLAT() to help compiler eliminate dead code.
The function pointer passed to run_thread() can confuse the compiler
into thinking the function needs to be emitted. Add ASSERT32FLAT() to
help the compiler eliminate this code.
Kevin O'Connor [Fri, 12 Feb 2010 03:32:12 +0000 (22:32 -0500)]
Support USB keyboard auto-repeat.
Support handling of multiple keys pressed simultanously.
Support auto-repeat via USB HID Set_Idle command.
Also, add "noinline" directives to reduce stack usage of timer irq.
Kevin O'Connor [Sun, 10 Jan 2010 05:38:53 +0000 (00:38 -0500)]
Add explicit Program Headers to linker scripts.
Looks like some versions of binutils are aligning the LOAD program
header to a large size. This is causing an issue for coreboot users,
so add an explicit LOAD program header with a reasonable value.
Kevin O'Connor [Sun, 3 Jan 2010 23:33:00 +0000 (18:33 -0500)]
Reduce #ifs by weeding out some cross-chunk function definitions.
Reduce the need for placing #if guards around functions that are
marked as VISIBLE in another code chunk by declaring the functions as
"weak" when they are not needed.
It's still necessary to ensure that no C code references the data from
a different chunk (or an -fwhole-program compile might try to keep a
local reference).
Kevin O'Connor [Fri, 1 Jan 2010 17:46:54 +0000 (12:46 -0500)]
Force a link error if a function is used from the wrong code chunk.
Force functions intended for other code segments to be discarded
during link - this will cause a link error if it used.
Clean up rom layout code to ensure discarded sections are not used.
Gleb Natapov [Thu, 24 Dec 2009 12:37:16 +0000 (14:37 +0200)]
prevent acpi from rerouting SCI interrupt
SCI interrupt in piix4 chipset is hardwired to gsi 9, but we allow it
to be reconfigured by acpi. Fix this by providing fixed gsi for
PCI device 1 pin 0.
Kevin O'Connor [Wed, 30 Dec 2009 17:14:53 +0000 (12:14 -0500)]
Add support for 32bit PCI BIOS entry.
Create a new code blob (code32seg) with support for 32bit functions
that need to utilize explicit segment accesses.
This code blob uses global variables relative to %gs and with a
dynamic code offset (determined by get_global_offset()).
Add BIOS32 structure and code.
Add code for 32bit PCI BIOS code.
Kevin O'Connor [Sun, 27 Dec 2009 04:23:15 +0000 (23:23 -0500)]
Remove pci_bios_bigmem_addr; set pci_bios_mem_addr=0xe0000000
This patch removes pci_bios_bigmem_addr, and it changes
pci_bios_mem_addr to start at 0xe0000000.
The pci_bios_bigmem_addr was removed from bochs. Also, the current
code looks wrong as nothing stops an address given from
pci_bios_bigmem_addr from overlapping an address given from
pci_bios_mem_addr.
The change also moves pci_bios_mem_addr back to 0xe0000000 - both the
acpi and mtrr code use 0xe0000000.
Kevin O'Connor [Sun, 20 Dec 2009 18:11:17 +0000 (13:11 -0500)]
Fix yield() so it works from boot code.
In boot code, the f-segment is read-only, so make sure yield() doesn't
rely on writes.
Easiest way to do this is to avoid stack switches when not needed.
Kevin O'Connor [Sat, 19 Dec 2009 16:03:40 +0000 (11:03 -0500)]
Fix potential build failure due to text16 section being too large.
A relative PC jump can't exceed 32K, but .text16 can be bigger than 32K.
Separate out .text16 into data sections (.data16) and code (.text16).
Place text and fixed sections together at end of f-segment.
This reduces 16bit text size to ~28K which fixes build errors for now.
Gerd Hoffmann [Fri, 18 Dec 2009 11:16:04 +0000 (12:16 +0100)]
qemu: add rom loading via fw_cfg
Add support for loading roms using the qemu fw_cfg interface,
modeled after the existing cbfs support. Use it to look for
vgabios (vgaroms/*) and option roms (genroms/*).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Kevin O'Connor [Sun, 13 Dec 2009 18:04:17 +0000 (13:04 -0500)]
Distinguish between debug reports for unimplemented vs invalid calls.
Don't use "fail" in the debug output - as this confuses users.
When reporting on an invalid parameter - use the word "invalid".
When reporting on an unimplemented call - state it is unimplemented.
Add separate debug levels for unimplemented vs invalid calls.
Also, increase the debug level of several entry points.
Kevin O'Connor [Sun, 13 Dec 2009 17:02:55 +0000 (12:02 -0500)]
ATA 48bit LBA should only be activated on read/write commands.
Check explicitly for an extended read/write command instead of 0x04
bit set. The identify command has that bit set, but doesn't need
the 48bit lba registers set.
Kevin O'Connor [Sun, 13 Dec 2009 16:25:25 +0000 (11:25 -0500)]
Enhance experimental option rom "threading" - enable preemption.
When experimental support for parallelizing option roms and hardware
init (default disabled) is selected, add support for checking on
hardware init progress from the RTC irq handler.
Enable ability for RTC to be turned on for additional users.
Allow regular option roms (not just vga option roms) to run in
parallel with hardware init.
Don't use stack in transition32 / transition16 until new mode is
entered.
Also, cleanup leaking of data handlers in usb code.
Also, decrease frequency of iomemcpy checks (every 2K instead of 1K).
Kevin O'Connor [Fri, 11 Dec 2009 01:13:57 +0000 (20:13 -0500)]
Make SMBIOS table pass MS SVVP test
Microsoft SVVP (Server Virtualization Validation Program) expects
arbitrary SMBIOS field to have certain values otherwise it fails.
We all want to make Microsoft happy don't we? So lets put values MS
expects in there.
Values modified by the patch:
Type 0:
Bit 2 of byte 2 must be 1
Type 1:
Manufacturer/product string should not be empty
Type 3:
Manufacturer string should not be empty
Type 4:
Processor manufacturer should no be empty
Max/current CPU speed shouldn't be unknown
Type 16:
Memory should have error correction.
---
v1->v2:
Use CONFIG_APPNAME instead of open coding strings
Use snprintf.
Kevin O'Connor [Thu, 10 Dec 2009 02:15:59 +0000 (21:15 -0500)]
Unify ps2 port data processing.
Unify the code for mouse and keyboard irq handling.
Support case where mouse irq fires but keyboard data present and
vice-versa.
Support data in i8042 queue while ps2 command being processed.
Kevin O'Connor [Sat, 5 Dec 2009 23:51:53 +0000 (18:51 -0500)]
Introduce optimized iomemcpy function for copying from io memory.
Reading from IO memory (pci rom or flash) is very slow, so add
iomemcpy() which will yield during copy. Use a 4 byte copy to
optimize accesses.
Also, decompress cbfs data files from a temp memory buffer so that
ulzma doesn't read from slow IO memory.
Kevin O'Connor [Sat, 5 Dec 2009 18:36:18 +0000 (13:36 -0500)]
Fix ATA iobase2 access on PCI native mode interfaces.
The ctrl register is iorange + 2 not iorange + 6.
Rework port definitions to be based on PCI offsets instead of ISA.
Also, properly define ATA irqs when in PCI compatibility mode.
Kevin O'Connor [Sat, 5 Dec 2009 16:25:09 +0000 (11:25 -0500)]
Support ISA ATA devices for qemu's "-M isapc" mode.
Add probing for ISA ATA devices when no pci devices found.
Also, add defines for common ATA ports.
Also, make sure irq and pci_bdf are defined for both pci ata controllers.