seabios.git
14 years agoAdd USB EHCI controller support.
Kevin O'Connor [Wed, 10 Mar 2010 00:43:52 +0000 (19:43 -0500)]
Add USB EHCI controller support.

Initial support for EHCI high-speed USB controllers.

14 years agoSome USB UHCI and OHCI fixes and cleanups.
Kevin O'Connor [Wed, 10 Mar 2010 00:33:22 +0000 (19:33 -0500)]
Some USB UHCI and OHCI fixes and cleanups.

Don't send a data packet on OHCI if no data to be sent.
Add some barrier() calls where needed.
Move toggle definition from generic pipe struct to uhci pipe struct.
Check for malloc failure on ohci and uhci "tds" request.
Be sure to always allocate an even number of intr tds on uhci - toggle
    setting depends on it.

14 years agoMinor - USB OHCI interrupt queue should be one larger.
Kevin O'Connor [Sun, 28 Feb 2010 07:36:32 +0000 (02:36 -0500)]
Minor - USB OHCI interrupt queue should be one larger.

One of the entries in the queue can't be used, so the total queue size
needs to be one larger than it currently is.

14 years agoReduce size of USB 'struct uhci_td'.
Kevin O'Connor [Sun, 28 Feb 2010 04:50:48 +0000 (23:50 -0500)]
Reduce size of USB 'struct uhci_td'.

Reduce the size to make arrays of tds smaller.  For interrupt in
pipes, allocate the data space separately.

14 years agoDynamically allocate USB controller structures.
Kevin O'Connor [Sun, 28 Feb 2010 07:23:19 +0000 (02:23 -0500)]
Dynamically allocate USB controller structures.

Have each controller type allocate its own data structure.

Also, implement freeing of unused uhci controller structures.

14 years agoReplace USB encoded 'u32 endp' scheme with explicit struct fields.
Kevin O'Connor [Sun, 28 Feb 2010 07:17:28 +0000 (02:17 -0500)]
Replace USB encoded 'u32 endp' scheme with explicit struct fields.

Expand 'struct usb_pipe' with all the fields that are needed from the
encoded 'u32 endp' field.

14 years agoFurther parallelize USB init by launching a thread per usb port.
Kevin O'Connor [Wed, 10 Mar 2010 00:58:23 +0000 (19:58 -0500)]
Further parallelize USB init by launching a thread per usb port.

Run a thread per usb port in addition to the existing thread per usb
controller.  This can reduce total boot time by allowing multiple USB
devices on the same controller to initialize in parallel.  It also
makes startup time for critical devices (eg, the keyboard) less
dependent on which port they are plugged into.

14 years agoIntroduce simple "mutex" locking code.
Kevin O'Connor [Sat, 27 Feb 2010 18:49:47 +0000 (13:49 -0500)]
Introduce simple "mutex" locking code.

Locks are not normally necessary because SeaBIOS uses a cooperative
multitasking system.  However, occasionally it is necessary to be able
to lock a resource across yield calls.  This patch introduces a simple
mechanism for doing that.

14 years agoOnly compile usb-hub.c and paravirt.c with 32bit code.
Kevin O'Connor [Sat, 27 Feb 2010 18:43:47 +0000 (13:43 -0500)]
Only compile usb-hub.c and paravirt.c with 32bit code.

Those files are only used by 32bit code, so don't bother including
them with the 16bit code.

14 years agoPrefer passing a USB "pipe" structure over a USB endp encoding.
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.

14 years agoAdd a generic "internal error" warning function.
Kevin O'Connor [Fri, 26 Feb 2010 13:45:00 +0000 (08:45 -0500)]
Add a generic "internal error" warning function.

14 years agoDynamically allocate ata_channel info; introduce custom atadrive_s struct.
Kevin O'Connor [Sun, 28 Feb 2010 06:28:11 +0000 (01:28 -0500)]
Dynamically allocate ata_channel info; introduce custom atadrive_s struct.

Don't limit the number of ATA controllers supported - just dynamically
allocate the structs.

Create an atadrive_s struct that extends the standard 'struct drive_s'
and have the new struct store a pointer to the ata channel info.

Also, prefer storing drive_s pointers as 32bit "flat" pointers -
adjust them as needed in the 16bit code.

14 years agoCleanup - build drive description in temp memory during init.
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.

14 years agoSeabios e820 reservation portion v3
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.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
14 years agoInitial support for booting from USB drives.
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.

14 years agoIntroduce helper functions for finding USB end-points.
Kevin O'Connor [Thu, 18 Feb 2010 04:06:52 +0000 (23:06 -0500)]
Introduce helper functions for finding USB end-points.

Introduce findEndPointDesc() and mkendpFromDesc() and refactor usb-hid
code.

14 years agoUSB UHCI cleanups.
Kevin O'Connor [Thu, 18 Feb 2010 03:59:53 +0000 (22:59 -0500)]
USB UHCI cleanups.

Add barrier() calls before memory accesses that can be seen by controller.
Fix TD_CTRL_ANY_ERROR macro definition.
Other cleanups.

14 years agoMinor - arrange struct drive_s to clarify field roles.
Kevin O'Connor [Thu, 18 Feb 2010 03:55:36 +0000 (22:55 -0500)]
Minor - arrange struct drive_s to clarify field roles.

14 years agoFix off by one error in strtcpy.
Kevin O'Connor [Thu, 18 Feb 2010 03:49:01 +0000 (22:49 -0500)]
Fix off by one error in strtcpy.

The strtcpy function could overrun its output buffer.

14 years agoDon't require a valid physical cylinders/heads/spt for logical mapping.
Kevin O'Connor [Wed, 17 Feb 2010 06:07:36 +0000 (01:07 -0500)]
Don't require a valid physical cylinders/heads/spt for logical mapping.

Modern drives don't provide a "physical" chs report - try to detect
that and force an LBA mapping in that case.

Also, don't require setup_translation be called only on ATA drives.

14 years agoMove common "command data block" functions to new file blockcmd.c.
Kevin O'Connor [Wed, 17 Feb 2010 06:01:32 +0000 (01:01 -0500)]
Move common "command data block" functions to new file blockcmd.c.

Move common "cdb" request functions to a new file.

14 years agoDynamically allocate each drive_g with malloc_fseg().
Kevin O'Connor [Tue, 16 Feb 2010 03:48:28 +0000 (22:48 -0500)]
Dynamically allocate each drive_g with malloc_fseg().

This eliminates the limit on the number of available drives.  It also
allows for each driver to allocate additional custom fields.

14 years agoAdd *.pyc to .gitignore.
Kevin O'Connor [Tue, 16 Feb 2010 00:31:23 +0000 (19:31 -0500)]
Add *.pyc to .gitignore.

14 years agoAdd common "block command" definitions and update cdrom code.
Kevin O'Connor [Mon, 15 Feb 2010 16:56:07 +0000 (11:56 -0500)]
Add common "block command" definitions and update cdrom code.

Introduce standard definitions and names for the "command data block"
commands used in the cdrom code.

14 years agoOptimize ntohl() code.
Kevin O'Connor [Mon, 15 Feb 2010 15:46:37 +0000 (10:46 -0500)]
Optimize ntohl() code.

Use the assembler bswapl instruction if the value is not constant.

14 years agoMinor - sort ATA CMD definitions.
Kevin O'Connor [Mon, 15 Feb 2010 07:21:10 +0000 (02:21 -0500)]
Minor - sort ATA CMD definitions.

14 years agoInitial support for USB hubs.
Kevin O'Connor [Mon, 15 Feb 2010 23:58:12 +0000 (18:58 -0500)]
Initial support for USB hubs.

Add support for detecting, initializing, and enumerating USB hubs.

14 years agoMinor - increase debug level of some USB debug statements.
Kevin O'Connor [Mon, 15 Feb 2010 00:07:43 +0000 (19:07 -0500)]
Minor - increase debug level of some USB debug statements.

14 years agoDon't leave USB UHCI ports disabled for extended time during reset.
Kevin O'Connor [Mon, 15 Feb 2010 00:05:35 +0000 (19:05 -0500)]
Don't leave USB UHCI ports disabled for extended time during reset.

Disabling the port will cause device to go into suspend - so don't do
that during the reset sequence.

14 years agoDon't parallelize USB OHCI root port reset.
Kevin O'Connor [Sun, 14 Feb 2010 23:59:48 +0000 (18:59 -0500)]
Don't parallelize USB OHCI root port reset.

If multiple ports are reset simultaneously, they could both respond to
the default address.  So, only reset one at a time.

14 years agoIntroduce standard warnings for allocation failures and timeouts.
Kevin O'Connor [Sun, 14 Feb 2010 18:07:54 +0000 (13:07 -0500)]
Introduce standard warnings for allocation failures and timeouts.

There is no need for custom warnings for many common failures.
Introduce a common warning which is consistent and more visible.

14 years agoAdd symbolic definitions for USB delays.
Kevin O'Connor [Sun, 14 Feb 2010 17:16:32 +0000 (12:16 -0500)]
Add symbolic definitions for USB delays.

14 years agoSupport USB interrupt schedules on OHCI and UHCI.
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.

14 years agoAdd some ASSERT32FLAT() to help compiler eliminate dead code.
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.

14 years agoseabios: acpi: fix memory leak in build_srat().
Isaku Yamahata [Fri, 12 Feb 2010 02:36:20 +0000 (11:36 +0900)]
seabios: acpi: fix memory leak in build_srat().

numadata() is allocated for temporal use, but not freed.
free it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
14 years agoSupport USB keyboard auto-repeat.
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.

14 years agomptable: Pull cpuid_signature/features setting out of loop.
Kevin O'Connor [Fri, 12 Feb 2010 03:19:14 +0000 (22:19 -0500)]
mptable: Pull cpuid_signature/features setting out of loop.

14 years agoRework disabling of ps2 port irqs.
Kevin O'Connor [Fri, 29 Jan 2010 01:35:21 +0000 (20:35 -0500)]
Rework disabling of ps2 port irqs.

Disable the ps2 port irqs in software instead of hardware.  This
prevents a race where an irq could get queued and later called when
not desired.

14 years agoGo back to using 0xf0000000 for PCI memory start.
Kevin O'Connor [Fri, 29 Jan 2010 01:33:20 +0000 (20:33 -0500)]
Go back to using 0xf0000000 for PCI memory start.

Qemu/Kvm still has some dependencies on 0xe0000000, so go back until
they are ready.

14 years agoRead APIC version from APIC instead of using a hard-coded value.
Magnus Christensson [Mon, 23 Nov 2009 13:01:19 +0000 (14:01 +0100)]
Read APIC version from APIC instead of using a hard-coded value.

Signed-off-by: Magnus Christensson <mch@virtutech.com>
14 years agoWork around bochs floppy issue with wait_irq().
Kevin O'Connor [Sun, 17 Jan 2010 18:00:49 +0000 (13:00 -0500)]
Work around bochs floppy issue with wait_irq().

Bochs turns off floppy dma when cpu is halted, so work around problem.

14 years agoAdd CONFIG_ATA_DMA option; default to off for now.
Kevin O'Connor [Sun, 17 Jan 2010 17:58:47 +0000 (12:58 -0500)]
Add CONFIG_ATA_DMA option; default to off for now.

Allow compile option to disable ATA DMA support.
Turn it off by default for now - some coreboot users are seeing issues
    with it.

14 years agoFix PkgLength calculation for the SSDT.
Magnus Christensson [Wed, 25 Nov 2009 15:26:58 +0000 (16:26 +0100)]
Fix PkgLength calculation for the SSDT.

Signed-off-by: Magnus Christensson <mch@virtutech.com>
14 years agoAdd explicit Program Headers to linker scripts.
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.

14 years agoPrep version for next release.
Kevin O'Connor [Sun, 10 Jan 2010 05:38:24 +0000 (00:38 -0500)]
Prep version for next release.

14 years agoUpdate version to 0.5.1
Kevin O'Connor [Sat, 9 Jan 2010 04:49:31 +0000 (23:49 -0500)]
Update version to 0.5.1

14 years agoFix sign error preventing incorrect memory over 4gig calculation.
Kevin O'Connor [Wed, 6 Jan 2010 00:50:04 +0000 (19:50 -0500)]
Fix sign error preventing incorrect memory over 4gig calculation.

14 years agoMinor - better indent assembler in int1587.
Kevin O'Connor [Tue, 5 Jan 2010 02:04:04 +0000 (21:04 -0500)]
Minor - better indent assembler in int1587.

14 years agoAdd comment explaining why mptable is in low memory.
Kevin O'Connor [Tue, 5 Jan 2010 01:49:45 +0000 (20:49 -0500)]
Add comment explaining why mptable is in low memory.

14 years agoAdd int1589 support.
Kevin O'Connor [Tue, 5 Jan 2010 01:48:20 +0000 (20:48 -0500)]
Add int1589 support.

Int1589 switches into protected mode for the caller.
Also, consistently use BUILD_BIOS_ADDR/SIZE in GDT macros.

14 years agoSet FDPT in irq table even for small drives.
Kevin O'Connor [Mon, 4 Jan 2010 03:24:18 +0000 (22:24 -0500)]
Set FDPT in irq table even for small drives.

Fix bug due to fill_fdpt exiting early in non-logical drive case.

14 years agoReduce #ifs by weeding out some cross-chunk function definitions.
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).

14 years agoFix vgahook sign issue; add warning to build to catch future cases.
Kevin O'Connor [Sun, 3 Jan 2010 23:09:08 +0000 (18:09 -0500)]
Fix vgahook sign issue; add warning to build to catch future cases.

14 years agovgabios: Fix compile error due to fixed prototypes.
Kevin O'Connor [Sun, 3 Jan 2010 22:53:58 +0000 (17:53 -0500)]
vgabios: Fix compile error due to fixed prototypes.

14 years agoBe sure to add "void" to all function prototypes that take no args.
Kevin O'Connor [Sun, 3 Jan 2010 22:43:37 +0000 (17:43 -0500)]
Be sure to add "void" to all function prototypes that take no args.

Omitting "void" leads to a K&R style declaration which was not intended.

14 years agomptable: Reset pinmask on new bus or device.
Kevin O'Connor [Sun, 3 Jan 2010 20:14:11 +0000 (15:14 -0500)]
mptable: Reset pinmask on new bus or device.

Fix small possibility of bus changing without device changing.

14 years agoDetect latest FC12 gcc -combine breakage.
Kevin O'Connor [Sun, 3 Jan 2010 20:12:00 +0000 (15:12 -0500)]
Detect latest FC12 gcc -combine breakage.

Now, assigning a value to a global is needed to triger ICE.

14 years agoMinor vga binary cleanups.
Kevin O'Connor [Fri, 1 Jan 2010 17:53:32 +0000 (12:53 -0500)]
Minor vga binary cleanups.

14 years agoMake MTRR region 0xc0000-0x100000 be cached.
Kevin O'Connor [Fri, 1 Jan 2010 17:50:04 +0000 (12:50 -0500)]
Make MTRR region 0xc0000-0x100000 be cached.

Use the "write protect" setting instead of "uncached" for that region.
Also, make sure to clear all variable MTRRs before enabling them.

14 years agoForce a link error if a function is used from the wrong code chunk.
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.

14 years agoAdd __noreturn define for __attribute__((noreturn)).
Kevin O'Connor [Fri, 1 Jan 2010 08:04:19 +0000 (03:04 -0500)]
Add __noreturn define for __attribute__((noreturn)).

14 years agoImplement native 32bit APM support.
Kevin O'Connor [Fri, 1 Jan 2010 18:03:17 +0000 (13:03 -0500)]
Implement native 32bit APM support.

Add APM code to 32bit segmented code.
Use 32bit APM code instead of jumping into 16bit mode.

14 years agoCommit compiled dsdt file; misc comment updates.
Kevin O'Connor [Wed, 30 Dec 2009 17:36:22 +0000 (12:36 -0500)]
Commit compiled dsdt file; misc comment updates.

Commit new dsdt with recent changes.
Add some misc comments.
Also, fix uninitialized warning in mptable code.

14 years agoprevent acpi from rerouting SCI interrupt
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.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
14 years agoenumerate all PCI buses in mptable
Gleb Natapov [Mon, 28 Dec 2009 09:04:46 +0000 (11:04 +0200)]
enumerate all PCI buses in mptable

Signed-off-by: Gleb Natapov <gleb@redhat.com>
14 years agoAdd support for 32bit PCI BIOS entry.
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.

14 years agoOnly add "addr32" to memory accesses that require them.
Kevin O'Connor [Sun, 27 Dec 2009 05:14:26 +0000 (00:14 -0500)]
Only add "addr32" to memory accesses that require them.

Extract out addr32 to a parameter to the READx/WRITEx_SEG macros.

14 years agoIntroduce MODESEGMENT define; rename VISIBLE32 to VISIBLE32FLAT.
Kevin O'Connor [Sun, 27 Dec 2009 04:32:57 +0000 (23:32 -0500)]
Introduce MODESEGMENT define; rename VISIBLE32 to VISIBLE32FLAT.

Prepare for support of segmented 32bit code.
Add new MODESEGMENT definition, and clarify existing 32bit mode defs.

14 years agoAllocate smbios in temp space and copy into final location.
Kevin O'Connor [Sun, 27 Dec 2009 04:26:44 +0000 (23:26 -0500)]
Allocate smbios in temp space and copy into final location.

This reduces memory needed in the reserved high memory area.

14 years agoClear user reserved interrupts (0x60-0x66).
Kevin O'Connor [Sun, 27 Dec 2009 04:24:52 +0000 (23:24 -0500)]
Clear user reserved interrupts (0x60-0x66).

This patch is equivalent to a patch recently committed to Bochs bios
(d8b4b998).

14 years agoRemove pci_bios_bigmem_addr; set pci_bios_mem_addr=0xe0000000
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.

14 years agoAdd initial support for ATA DMA.
Kevin O'Connor [Sun, 27 Dec 2009 04:21:38 +0000 (23:21 -0500)]
Add initial support for ATA DMA.

Add support for detecting and using SFF 8038 compatible PCI devices.
Currently, only ATA transfers (not ATAPI) will use DMA.

14 years agoAllocate mptable in temp space and copy into final location.
Kevin O'Connor [Sat, 26 Dec 2009 16:15:31 +0000 (11:15 -0500)]
Allocate mptable in temp space and copy into final location.

Copying into the f-segment ensures no extra space is needed.

14 years agoAlso report memory over 4G during init.
Kevin O'Connor [Thu, 24 Dec 2009 16:09:30 +0000 (11:09 -0500)]
Also report memory over 4G during init.

14 years agoprovide correct pci routing information in mptable
Gleb Natapov [Thu, 24 Dec 2009 12:29:43 +0000 (14:29 +0200)]
provide correct pci routing information in mptable

OpenBSD uses irq routing from mptable, but doesn't create it correctly
for PCI bus. This patch adds PCI routing info into mptable.

14 years agoAdd symbolic definitions for MTRR code.
Kevin O'Connor [Thu, 24 Dec 2009 02:24:27 +0000 (21:24 -0500)]
Add symbolic definitions for MTRR code.

14 years agoFix yield() so it works from boot code.
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.

14 years agoFix potential build failure due to text16 section being too large.
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.

14 years agoIncrease version in preparation for next release.
Kevin O'Connor [Sat, 19 Dec 2009 15:51:29 +0000 (10:51 -0500)]
Increase version in preparation for next release.

14 years agoUpdate version to 0.5.0.
Kevin O'Connor [Sat, 19 Dec 2009 03:21:26 +0000 (22:21 -0500)]
Update version to 0.5.0.

14 years agoqemu: add rom loading via fw_cfg
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>
14 years agomove htonl() + friends to util.h
Gerd Hoffmann [Fri, 18 Dec 2009 11:16:03 +0000 (12:16 +0100)]
move htonl() + friends to util.h

As the next patch will add one more user of the macros move them
to util.h.  Also add the 16bit variants.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoDisable CONFIG_OPTIONROMS_DEPLOYED by default
Anthony Liguori [Fri, 18 Dec 2009 11:16:02 +0000 (12:16 +0100)]
Disable CONFIG_OPTIONROMS_DEPLOYED by default

Since qemu now supports loading option roms through PCI

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoDo not guard qemu shadow ram work around in CONFIG_OPTIONROMS_DEPLOYED
Anthony Liguori [Fri, 18 Dec 2009 11:16:01 +0000 (12:16 +0100)]
Do not guard qemu shadow ram work around in CONFIG_OPTIONROMS_DEPLOYED

As we are going to disable CONFIG_OPTIONROMS_DEPLOYED under QEMU so that we can
make proper use of DDIM.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoDistinguish between debug reports for unimplemented vs invalid calls.
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.

14 years agoATA 48bit LBA should only be activated on read/write commands.
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.

14 years agoExtract out new call32() function from check_preempt() code in stacks.c.
Kevin O'Connor [Sun, 13 Dec 2009 16:48:18 +0000 (11:48 -0500)]
Extract out new call32() function from check_preempt() code in stacks.c.

14 years agoEnhance experimental option rom "threading" - enable preemption.
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).

14 years agoFix use before free in boot_cbfs (boot.c).
Kevin O'Connor [Sun, 13 Dec 2009 16:19:01 +0000 (11:19 -0500)]
Fix use before free in boot_cbfs (boot.c).

14 years agoEnhance readserial.py to try to account for host time offsets.
Kevin O'Connor [Sat, 12 Dec 2009 18:28:38 +0000 (13:28 -0500)]
Enhance readserial.py to try to account for host time offsets.

Try to account for time related to the host sending blocks of data to
    the script.

14 years agoMove stack manipulation code from util.c to new file stacks.c.
Kevin O'Connor [Fri, 11 Dec 2009 02:35:49 +0000 (21:35 -0500)]
Move stack manipulation code from util.c to new file stacks.c.

Move the threading and stack_hop code to a new file.

14 years agoRefactor __call16_from32 - introduce transition16.
Kevin O'Connor [Fri, 11 Dec 2009 02:16:07 +0000 (21:16 -0500)]
Refactor __call16_from32 - introduce transition16.

Add a transition16 call that just jumps into 16bit mode.
__call16_from32 (and call16big) just uses transition16 and __call16.

14 years agoMinor - use wait_irq() instead of irq_enable()/hlt() in apm.
Kevin O'Connor [Fri, 11 Dec 2009 02:15:04 +0000 (21:15 -0500)]
Minor - use wait_irq() instead of irq_enable()/hlt() in apm.

14 years agoMake SMBIOS table pass MS SVVP test
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.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
14 years agoUnify ps2 port data processing.
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.

14 years agoMove ps2 specific keyboard and mouse code to ps2port.c.
Kevin O'Connor [Thu, 10 Dec 2009 02:00:41 +0000 (21:00 -0500)]
Move ps2 specific keyboard and mouse code to ps2port.c.

14 years agoAdd experimental feature to run vga optionrom in parallel with init.
Kevin O'Connor [Thu, 10 Dec 2009 01:18:31 +0000 (20:18 -0500)]
Add experimental feature to run vga optionrom in parallel with init.

Add option (default disabled) that allows the vga rom to run while
    hardware init is still in progress.

14 years agoClear thread info on each boot.
Kevin O'Connor [Thu, 10 Dec 2009 01:04:54 +0000 (20:04 -0500)]
Clear thread info on each boot.

Fix potential issue of threads being incorrect if ctrl+alt+del is
    pressed during POST.

14 years agoIntroduce optimized iomemcpy function for copying from io memory.
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.

14 years agoFix timing in readserial.py - use 10 bits per byte.
Kevin O'Connor [Sat, 5 Dec 2009 19:23:27 +0000 (14:23 -0500)]
Fix timing in readserial.py - use 10 bits per byte.

There is also a start bit, so 8N1 serial should use 10 bits to a byte.