]> xenbits.xensource.com Git - seabios.git/log
seabios.git
13 years agotest-gcc: do not truncate stderr
Ian Campbell [Thu, 22 Mar 2012 15:25:24 +0000 (15:25 +0000)]
test-gcc: do not truncate stderr

Using "> /dev/fd/2" causes stderr to get truncated, which is mangles the log
file if the user happens to have redirected it there.

Use ">&2" instead which redirects to the already open stderr and doesn't
truncate it.

Reported-by: Tim Deegan <tim@xen.org>
Tested-by: Tim Deegan <tim@xen.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoUse "git describe" in the build generated version description.
Kevin O'Connor [Sat, 24 Mar 2012 15:42:53 +0000 (11:42 -0400)]
Use "git describe" in the build generated version description.

Move the build version generation to a script in tools/ and enhance
the system to call "git describe" when it appears the user has a git
repo.  Also, allow the version to be extracted from a ".version" file
for use in official tar releases.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoDrop FIX_RTC flag from FADT.
Gleb Natapov [Tue, 20 Mar 2012 08:02:17 +0000 (10:02 +0200)]
Drop FIX_RTC flag from FADT.

FIX_RTC flag should be set if RTC wake status is _not_ reported in fixed
register space, but this is not the case for QEMU. So drop it from FADT.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoata: send TEST UNIT READY correctly
Paolo Bonzini [Mon, 19 Mar 2012 10:41:09 +0000 (11:41 +0100)]
ata: send TEST UNIT READY correctly

The ATAPI driver does not need to support writes, but it does needs to
avoid the PIO transfer and DRQ check when TEST UNIT READY is sent.
Since TEST UNIT READY has no payload, checking for not busy is enough.

This fixes a timeout when booting from CD/DVD, which fellaw@gmx.net
reported to cause boot failures.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
13 years agovirtio-scsi: Fix virtio-scsi after cdb_is_read changes.
Paolo Bonzini [Fri, 16 Mar 2012 17:54:46 +0000 (18:54 +0100)]
virtio-scsi: Fix virtio-scsi after cdb_is_read changes.

The previous patch changes the way TEST_UNIT_READY is composed in the
buffers and breaks virtio-scsi.

13 years agoif HPET is not present do not report it in DSDT
Gleb Natapov [Sun, 11 Mar 2012 08:08:38 +0000 (10:08 +0200)]
if HPET is not present do not report it in DSDT

Replicate the check that detects if HPET table should be created
in AML too.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoUse OUT mode for all zero byte "scsi" transfers.
Kevin O'Connor [Thu, 15 Mar 2012 01:27:45 +0000 (21:27 -0400)]
Use OUT mode for all zero byte "scsi" transfers.

Some devices can get confused if asked to "read" data during a zero
byte transfer, so consider these transfers as "writes".  (Reported by
Steve Goodrich.)

Also, extract out the code to determine the transfer direction into
cdb_is_read().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoWhitespace changes - replace handful of tabs in core code with spaces.
Kevin O'Connor [Thu, 15 Mar 2012 01:11:39 +0000 (21:11 -0400)]
Whitespace changes - replace handful of tabs in core code with spaces.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agops2: Enable keyboard at end of PS2 port irq.
Kevin O'Connor [Mon, 12 Mar 2012 00:45:56 +0000 (20:45 -0400)]
ps2: Enable keyboard at end of PS2 port irq.

Looks like some old programs expect the keyboard irq to enable the
keyboard port at the end of the irq.  This behavior was seen on an
image of "Concurrent DOS".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoIncrease the debug level of several frequent dprintf() statements.
Kevin O'Connor [Sun, 11 Mar 2012 15:19:52 +0000 (11:19 -0400)]
Increase the debug level of several frequent dprintf() statements.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoUpdate drive type default boot order.
Kevin O'Connor [Sun, 11 Mar 2012 15:22:07 +0000 (11:22 -0400)]
Update drive type default boot order.

The default boot order among different drive types is determined by
the driver id (DTYPE_X).  Reorder them to make more sense (USB drives
shouldn't have a higher default priority than AHCI/virtio drives).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Remove QH_MULT_SHIFT flag from qh.info1.
Kevin O'Connor [Sun, 11 Mar 2012 02:07:26 +0000 (21:07 -0500)]
usb: Remove QH_MULT_SHIFT flag from qh.info1.

That flag is for qh.info2 - it being set in qh.info1 appears to be a
typo.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Fix barrier() placement in OHCI interrupt schedule add.
Kevin O'Connor [Sat, 10 Mar 2012 17:30:27 +0000 (12:30 -0500)]
usb: Fix barrier() placement in OHCI interrupt schedule add.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Populate OHCI endpoint descriptor info at pipe allocation.
Kevin O'Connor [Sat, 10 Mar 2012 17:12:27 +0000 (12:12 -0500)]
usb: Populate OHCI endpoint descriptor info at pipe allocation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Move EHCI tt_* fields to EHCI controller code.
Kevin O'Connor [Sat, 10 Mar 2012 15:09:56 +0000 (10:09 -0500)]
usb: Move EHCI tt_* fields to EHCI controller code.

Move the code to setup the ehci specific queue head fields to the ehci
code.  Also, setup the ehci queue head fields once during pipe
allocation instead of on each transfer.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Move code around in usb.c.
Kevin O'Connor [Sat, 10 Mar 2012 14:13:58 +0000 (09:13 -0500)]
usb: Move code around in usb.c.

Move code around to put like functions near each other.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Generalize controller alloc_async_pipe / alloc_intr_pipe code.
Kevin O'Connor [Sat, 10 Mar 2012 14:03:25 +0000 (09:03 -0500)]
usb: Generalize controller alloc_async_pipe / alloc_intr_pipe code.

Use one function (X_alloc_pipe) as the main entry point for usb pipe
allocation in the controller code.  The determination of
interrupt/bulk/control can be done within the controller.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Move code around in usb controller code.
Kevin O'Connor [Sat, 10 Mar 2012 13:53:58 +0000 (08:53 -0500)]
usb: Move code around in usb controller code.

No code changes - just movement of code to place pipe allocater
functions next to each other.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Pass 'struct usbdevice_s' to controller alloc_intr_pipe functions.
Kevin O'Connor [Sat, 10 Mar 2012 13:48:31 +0000 (08:48 -0500)]
usb: Pass 'struct usbdevice_s' to controller alloc_intr_pipe functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Pass 'struct usbdevice_s' into controller alloc_async functions.
Kevin O'Connor [Fri, 9 Mar 2012 12:52:33 +0000 (07:52 -0500)]
usb: Pass 'struct usbdevice_s' into controller alloc_async functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Pass usbdevice_s to alloc_async_pipe.
Kevin O'Connor [Thu, 8 Mar 2012 13:44:32 +0000 (08:44 -0500)]
usb: Pass usbdevice_s to alloc_async_pipe.

Build the control pipe information in alloc_async_pipe directly from
the usbdevice and usb_endpoint_descriptor information.  This
simplifies the callers as they now only need to allocate/free the
devices, and do not need to peek into the pipe structure.

Replace alloc_bulk_pipe with alloc_async_pipe as they both perform the
same action now.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Build path via chain of usbdevice_s.
Kevin O'Connor [Thu, 8 Mar 2012 12:49:09 +0000 (07:49 -0500)]
usb: Build path via chain of usbdevice_s.

Instead of building a dummy u64 with the path, construct the path via
the 'struct usbdevice_s' links.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Push 'struct usbdevice_s' usage through to pipe allocation.
Kevin O'Connor [Thu, 8 Mar 2012 12:20:30 +0000 (07:20 -0500)]
usb: Push 'struct usbdevice_s' usage through to pipe allocation.

Pass the usbdevice_s info to device configuration and allocation
code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Introduce 'struct usbdevice_s' to describe info for a given device.
Kevin O'Connor [Tue, 6 Mar 2012 13:20:40 +0000 (08:20 -0500)]
usb: Introduce 'struct usbdevice_s' to describe info for a given device.

Create the usbdevice_s struct and use it during the enumeration
processes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Obtain free list items in main code.
Kevin O'Connor [Tue, 6 Mar 2012 03:41:21 +0000 (22:41 -0500)]
usb: Obtain free list items in main code.

Each controller freelist finding code is the same - move it to the
common code.  This also merges the alloc_control and alloc_bulk code
paths.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Remove cntl->defaultpipe cache.
Kevin O'Connor [Tue, 6 Mar 2012 03:03:03 +0000 (22:03 -0500)]
usb: Remove cntl->defaultpipe cache.

Now that all pipes use a free list, there is no need to cache the
controller's default pipe.  The regular free list provides the same
capability.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agousb: Centralize pipe free list code.
Kevin O'Connor [Tue, 6 Mar 2012 02:48:34 +0000 (21:48 -0500)]
usb: Centralize pipe free list code.

Now that all controllers use a free list, maintain the free list in
the common code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoBatch free USB pipes on EHCI controllers.
Kevin O'Connor [Mon, 20 Feb 2012 17:54:49 +0000 (12:54 -0500)]
Batch free USB pipes on EHCI controllers.

Instead of unregistering each control "endpoint descriptor" after it
is used, keep them around for later users.  Free all unused
descriptors in one batch at the end of initialization.  This should
slightly optimize boot time, and it requires less overall interaction
with the controller.

This also merges the code that allocates the control and bulk pipes,
as they were quite similar before.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoBatch free USB pipes on UHCI controllers.
Kevin O'Connor [Mon, 20 Feb 2012 17:54:49 +0000 (12:54 -0500)]
Batch free USB pipes on UHCI controllers.

Instead of unregistering each control "endpoint descriptor" after it
is used, keep them around for later users.  Free all unused
descriptors in one batch at the end of initialization.  This should
slightly optimize boot time, and it requires less overall interaction
with the controller.

This also merges the code that allocates the control and bulk pipes,
as they were quite similar before.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoBatch free USB pipes on OHCI controllers.
Kevin O'Connor [Mon, 20 Feb 2012 17:54:49 +0000 (12:54 -0500)]
Batch free USB pipes on OHCI controllers.

Instead of unregistering each control "endpoint descriptor" after it
is used, keep them around for later users.  Free all unused
descriptors in one batch at the end of initialization.  This should
slightly optimize boot time, and it requires less overall interaction
with the controller.

This also makes the descriptor free code more compliant with the spec.
The descriptor lists will only be modified after the list processing
has been disabled on the controller.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoadd virtio-scsi driver
Paolo Bonzini [Mon, 27 Feb 2012 16:22:23 +0000 (17:22 +0100)]
add virtio-scsi driver

virtio-scsi is a simple HBA that talks to the host via a single
vring.  The implementation looks like a hybrid of usb-msc and
virtio-blk.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
13 years agoscsi: do not send MODE SENSE except to QEMU disks
Paolo Bonzini [Mon, 5 Mar 2012 11:29:12 +0000 (12:29 +0100)]
scsi: do not send MODE SENSE except to QEMU disks

This is the simplest way to avoid breaking boot on USB sticks that
stall when asked for the MODE SENSE page 4.  Some old sticks do
not support the MODE SENSE command at all and just return a
"medium may have changed" unit attention condition when SeaBIOS
sends it!

Reported-by: Dave Frodin <dave@camp.se-eng.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
13 years agovgabios: Fetch _rom_header_size from the global segment when computing the ROM's...
Julian Pidancet [Mon, 5 Mar 2012 14:20:45 +0000 (14:20 +0000)]
vgabios: Fetch _rom_header_size from the global segment when computing the ROM's checksum

Otherwise, checksum_far is getting called with zero as the length
parameter, and the ROM checksum in the header end up beeing zero
after vga_post() is called.

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
13 years agovgabios: Initial support for fixing up assembler to workaround x86emu.
Kevin O'Connor [Mon, 5 Mar 2012 22:45:55 +0000 (17:45 -0500)]
vgabios: Initial support for fixing up assembler to workaround x86emu.

Perform post-processing of the vgabios assembler to remove certain
instructions that gcc generates and x86emu can't handle.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoDon't compile with -mrtd.
Kevin O'Connor [Mon, 5 Mar 2012 22:39:32 +0000 (17:39 -0500)]
Don't compile with -mrtd.

The "mrtd" mode is a bit funky - the gain from it isn't worth the
complexity.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: int1009 handler bug limits count to 256 characters.
Kevin O'Connor [Mon, 5 Mar 2012 22:11:50 +0000 (17:11 -0500)]
vgabios: int1009 handler bug limits count to 256 characters.

Fix bug (u8 overflow) causing large screen fills to fail.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Fixup clext far return instruction.
Kevin O'Connor [Mon, 5 Mar 2012 22:10:13 +0000 (17:10 -0500)]
vgabios: Fixup clext far return instruction.

Fix typo causing incorrect far return instruction - use explicit ATT
syntax - "lretw".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agooutput: Add 64bit hex print support.
Kevin O'Connor [Mon, 5 Mar 2012 15:14:07 +0000 (10:14 -0500)]
output: Add 64bit hex print support.

Based on patch by Gerd Hoffmann <kraxel@redhat.com>.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoFixup missing includes.
Kevin O'Connor [Tue, 6 Mar 2012 12:18:07 +0000 (07:18 -0500)]
Fixup missing includes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoUse "#!/bin/sh" instead of ":" in tools/gen-offsets.sh.
Kevin O'Connor [Mon, 20 Feb 2012 14:33:23 +0000 (09:33 -0500)]
Use "#!/bin/sh" instead of ":" in tools/gen-offsets.sh.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoFree USB MSC pipes on error.
Kevin O'Connor [Mon, 20 Feb 2012 07:59:36 +0000 (02:59 -0500)]
Free USB MSC pipes on error.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoRegister drives directly in scsi_init_drive().
Kevin O'Connor [Sat, 18 Feb 2012 16:02:27 +0000 (11:02 -0500)]
Register drives directly in scsi_init_drive().

The scsi_init_drive() function has enough information to directly
register the drive there, so do the registration there.  This
simplifies the calling code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoRunning vgabios during resume from S3 on QEMU by default
Gleb Natapov [Mon, 13 Feb 2012 11:01:07 +0000 (13:01 +0200)]
Running vgabios during resume from S3 on QEMU by default

Run vgabios during resume from S3 by default on QEMU. QEMU
still able to modify SeaBIOS behavior if it wishes so by providing
etc/s3-resume-vga-init file. With QEMU emulated vga cards this behaviour
is desirable otherwise console becomes unusable with Linux guests after
resume. Since we control vgabios source we can be sure that running it
on resume from S3 is safe.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoFix missing NULL pointer checks causing boot failure on 1meg machines.
Kevin O'Connor [Thu, 16 Feb 2012 01:13:05 +0000 (20:13 -0500)]
Fix missing NULL pointer checks causing boot failure on 1meg machines.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Some tweaks to optimize stack space.
Kevin O'Connor [Tue, 14 Feb 2012 01:09:02 +0000 (20:09 -0500)]
vgabios: Some tweaks to optimize stack space.

Gcc seems to handle passing structs by value if they are 4 bytes in
size instead of 3 bytes.  So, add a pad byte to struct carattr and
struct cursorpos.

Reorganize set_cursor_pos(), verify_scroll(), and handle_1013() so
there are less live variables.

Don't inline the VBE functions into the main handler code.  Code
calling VBE functions are newer and are more likely to provide
adequate stack space - inlining can cause more stack usage for older
functions (which may be stack constrained).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Minor vgabios fixes.
Kevin O'Connor [Sun, 12 Feb 2012 16:50:52 +0000 (11:50 -0500)]
vgabios: Minor vgabios fixes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Claim VBE 3 support; minor VBE cleanups.
Kevin O'Connor [Sun, 12 Feb 2012 16:49:25 +0000 (11:49 -0500)]
vgabios: Claim VBE 3 support; minor VBE cleanups.

Claim support for VBE3 - that spec is actually more lenient for
required minimum support.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add version string to debug output.
Kevin O'Connor [Sat, 11 Feb 2012 16:02:03 +0000 (11:02 -0500)]
vgabios: Add version string to debug output.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoDirect compile 16bit C code instead of including via .S files.
Kevin O'Connor [Sat, 11 Feb 2012 15:49:45 +0000 (10:49 -0500)]
Direct compile 16bit C code instead of including via .S files.

Create a ".code16gcc" directive in src/code16gcc.s and use
-Wa,src/code16gcc.s to tell gcc to compile directly to 16bit code.
This eliminates the need to compile the C code to assembler and
include in romlayout.S and vgaentry.S.  This also allows those two
assembler files to be compiled with debugging (-g) enabled.

Also, includes some Makefile cleanups.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agodisk: handle LBA I/O with zero sector count
Kevin O'Connor [Sat, 11 Feb 2012 14:38:44 +0000 (09:38 -0500)]
disk: handle LBA I/O with zero sector count

Unlike basic_access, extended_access does not check for a zero
sector count.  However, this is a problem because for example
it would be interpreted as 256 when processing an ATA request.

Based on patch from: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agocleanup process_usb_op() / process_scsi_op() declarations
Laszlo Ersek [Thu, 9 Feb 2012 15:55:30 +0000 (16:55 +0100)]
cleanup process_usb_op() / process_scsi_op() declarations

Commit 1e749c85 removed the definition of process_usb_op(); let's remove
the declaration too.

The same commit added process_scsi_op(). The function has no declaration
that is also not a definition, and its only call site is in the same file
as the definition. Give the function internal linkage.

Build tested.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
13 years agoPermit .rodata.__PRETTY_FUNCTION__. sections in roms.
Kevin O'Connor [Thu, 9 Feb 2012 01:23:36 +0000 (20:23 -0500)]
Permit .rodata.__PRETTY_FUNCTION__. sections in roms.

Some versions of gcc appear to define these sections even though they
aren't used in the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoAdd PYTHON definition to Makefile.
Kevin O'Connor [Thu, 9 Feb 2012 01:21:29 +0000 (20:21 -0500)]
Add PYTHON definition to Makefile.

Add PYTHON definition to Makefile so users can override it.  This
allows users to specify an exact python executable name to use during
the build.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Don't allow building of emulator vgaroms on coreboot.
Kevin O'Connor [Wed, 8 Feb 2012 02:03:23 +0000 (21:03 -0500)]
vgabios: Don't allow building of emulator vgaroms on coreboot.

If coreboot building is selected, don't allow the emulator based vga
roms to be selected.  Also, clarify the help text to make this clear.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovga: fix bochs lfb size display
Gerd Hoffmann [Mon, 6 Feb 2012 14:51:43 +0000 (15:51 +0100)]
vga: fix bochs lfb size display

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoXen: Use VGA Hooks to make VGA passthrough work on certain devices
Julian Pidancet [Sun, 5 Feb 2012 04:51:06 +0000 (04:51 +0000)]
Xen: Use VGA Hooks to make VGA passthrough work on certain devices

The Intel gfx VGA option ROM on certain platforms requires the 155f50 BIOS
function to be implemented (even if it does nothing), to work properly.

v2: Ignore the case where Option ROMs are pre-deployed.
    Make vgahook_setup independent of wether the CB* variables are set.
    VGA hooks can be enabled on non-coreboot and non-Xen configurations.

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
13 years agovgabios: Implement VBE save/restore state function (func 04).
Kevin O'Connor [Sat, 4 Feb 2012 17:40:02 +0000 (12:40 -0500)]
vgabios: Implement VBE save/restore state function (func 04).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Move save/restore state code from vgabios.c to stdvga.c.
Kevin O'Connor [Sat, 4 Feb 2012 16:59:02 +0000 (11:59 -0500)]
vgabios: Move save/restore state code from vgabios.c to stdvga.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add support for VBE get/set dac palette format (func 08).
Kevin O'Connor [Sat, 4 Feb 2012 16:08:39 +0000 (11:08 -0500)]
vgabios: Add support for VBE get/set dac palette format (func 08).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Handle VGA option rom being re-run.
Kevin O'Connor [Fri, 3 Feb 2012 03:52:17 +0000 (22:52 -0500)]
vgabios: Handle VGA option rom being re-run.

Check for the case where the option rom is executed a second time - in
that case re-init the hardware, but do not set any variables.  This
should make the rom better behaving when run from S3 resume.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Fix screen attrs on cga scroll.
Kevin O'Connor [Fri, 3 Feb 2012 01:56:38 +0000 (20:56 -0500)]
vgabios: Fix screen attrs on cga scroll.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Simplify cga/packed character screen writing.
Kevin O'Connor [Fri, 3 Feb 2012 01:56:10 +0000 (20:56 -0500)]
vgabios: Simplify cga/packed character screen writing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoIntroduce config option to select which IO port to send debug output on
Julian Pidancet [Wed, 1 Feb 2012 16:03:24 +0000 (16:03 +0000)]
Introduce config option to select which IO port to send debug output on

Introduce CONFIG_DEBUG_IO_PORT config option which allow user
to choose on which port to send debug on at configure time.

Bochs users are likely to use 0x402 (default) for debugging purposes,
whereas Xen uses 0xe9, as IO port address.

Signed-off-by: Julian Pidancet <julian.pidancet@citrix.com>
13 years agovgabios: Move bocshvga mode checking from runtime to init.
Kevin O'Connor [Thu, 2 Feb 2012 02:54:55 +0000 (21:54 -0500)]
vgabios: Move bocshvga mode checking from runtime to init.

Check mode validity at init.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Minor - organize cirrus code so like functions are near each other.
Kevin O'Connor [Thu, 2 Feb 2012 02:16:34 +0000 (21:16 -0500)]
vgabios: Minor - organize cirrus code so like functions are near each other.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Simplify cirrus find mode code.
Kevin O'Connor [Thu, 2 Feb 2012 02:10:44 +0000 (21:10 -0500)]
vgabios: Simplify cirrus find mode code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Rework bochsvga mode switching.
Kevin O'Connor [Wed, 1 Feb 2012 03:51:56 +0000 (22:51 -0500)]
vgabios: Rework bochsvga mode switching.

Make the bochsvga mode switch more similar to the original lgpl
vgabios code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Fix linelength calculations in bochsvga and vbe.
Kevin O'Connor [Sun, 29 Jan 2012 16:42:44 +0000 (11:42 -0500)]
vgabios: Fix linelength calculations in bochsvga and vbe.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Compare PCI ids against pci rom struct instead of config settings.
Kevin O'Connor [Sun, 29 Jan 2012 17:17:33 +0000 (12:17 -0500)]
vgabios: Compare PCI ids against pci rom struct instead of config settings.

QEMU can update the pci rom struct - so use that as the location to
determine if the pci address passed into the option rom is accurate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agomask interrupts on S3 resume
Gleb Natapov [Tue, 24 Jan 2012 12:33:42 +0000 (14:33 +0200)]
mask interrupts on S3 resume

i8259 clears interrupt mask on reset. Interrupt need to be
masked again before enabling interrupts on CPU. Since option
roms are called with interrupts enabled, resume should mask
interrupts in i8259 before calling vgabios.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoAdd TSC emulation layer for 386/486 CPUs.
Kevin O'Connor [Sun, 29 Jan 2012 19:15:14 +0000 (14:15 -0500)]
Add TSC emulation layer for 386/486 CPUs.

Original patch from Rudolf Marek.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoDetect CPUID instruction before using it.
Kevin O'Connor [Sun, 29 Jan 2012 18:30:56 +0000 (13:30 -0500)]
Detect CPUID instruction before using it.

Enable SeaBIOS to work on 386/486 machines that don't have CPUID
instruction.

Based on patch by Rudolf Marek.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoCheck for CONFIG_PS2PORT on all entry ps2 function entry points.
Kevin O'Connor [Sun, 29 Jan 2012 17:25:46 +0000 (12:25 -0500)]
Check for CONFIG_PS2PORT on all entry ps2 function entry points.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: handle vmware vga in bochsvga.
Kevin O'Connor [Sun, 29 Jan 2012 16:53:59 +0000 (11:53 -0500)]
vgabios: handle vmware vga in bochsvga.

The vmware vga emulated by qemu has a I/O region in pci bar 0.
The framebuffer is in pci bar 1.  Handle that by checking the
type of bar 0 in case it is a I/O bar use bar 1 instead.

Also make bochsbios report lfb size in debug output.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Update copyright statements in bochsvga.c and vbe.c.
Kevin O'Connor [Wed, 1 Feb 2012 03:54:49 +0000 (22:54 -0500)]
vgabios: Update copyright statements in bochsvga.c and vbe.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Fix missing "extern" declaration on vbe variables.
Kevin O'Connor [Sun, 29 Jan 2012 16:37:01 +0000 (11:37 -0500)]
vgabios: Fix missing "extern" declaration on vbe variables.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Move stdvga_set_mode() to stdvgamodes.c.
Kevin O'Connor [Sat, 28 Jan 2012 04:09:02 +0000 (23:09 -0500)]
vgabios: Move stdvga_set_mode() to stdvgamodes.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Minor - pass display address to stdvga_set_cursor_pos().
Kevin O'Connor [Sat, 28 Jan 2012 03:59:46 +0000 (22:59 -0500)]
vgabios: Minor - pass display address to stdvga_set_cursor_pos().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add VBE power management (10h) stub function.
Kevin O'Connor [Sat, 28 Jan 2012 01:52:29 +0000 (20:52 -0500)]
vgabios: Add VBE power management (10h) stub function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add support for VBE get/set display start function.
Kevin O'Connor [Sat, 28 Jan 2012 01:37:45 +0000 (20:37 -0500)]
vgabios: Add support for VBE get/set display start function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add support for vbe get/set line length function.
Kevin O'Connor [Tue, 24 Jan 2012 05:07:44 +0000 (00:07 -0500)]
vgabios: Add support for vbe get/set line length function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add support for vesa get/set window function.
Kevin O'Connor [Sat, 21 Jan 2012 16:53:44 +0000 (11:53 -0500)]
vgabios: Add support for vesa get/set window function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Move BDA setting from driver code to common code.
Kevin O'Connor [Sat, 21 Jan 2012 16:26:37 +0000 (11:26 -0500)]
vgabios: Move BDA setting from driver code to common code.

Always setup the BDA on a mode switch.  Call that BDA setup code
unconditionally.

Also, always set vbe_mode and use that for finding the current mode
and for reporting the mode to vbe callers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Extract out current mode finding into new function.
Kevin O'Connor [Sat, 21 Jan 2012 16:08:35 +0000 (11:08 -0500)]
vgabios: Extract out current mode finding into new function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Set cwidth/cheight/sstart in vgamode_s for cirrus/bochs.
Kevin O'Connor [Sat, 21 Jan 2012 16:00:11 +0000 (11:00 -0500)]
vgabios: Set cwidth/cheight/sstart in vgamode_s for cirrus/bochs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Use stored total memory in cirrus code instead of recalculating.
Kevin O'Connor [Sat, 21 Jan 2012 15:43:30 +0000 (10:43 -0500)]
vgabios: Use stored total memory in cirrus code instead of recalculating.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Check that the PCI BDF passed in is valid before using.
Kevin O'Connor [Tue, 17 Jan 2012 00:05:27 +0000 (19:05 -0500)]
vgabios: Check that the PCI BDF passed in is valid before using.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Simplify planar4 vgafb code.
Kevin O'Connor [Mon, 16 Jan 2012 23:48:26 +0000 (18:48 -0500)]
vgabios: Simplify planar4 vgafb code.

Don't bother programming the vga registers to manipulate the
framebuffer when in planar4 mode.  Instead, just switch between the
four planes and do the manipulation with regular reads and writes.
This makes the code simpler to understand (the vga hardware
manipulations are arcane and complex).

Note, this could make text scrolling in planar4 mode slower and more
likely to result in tearing.  However, it's unlikely anything
important uses the vgabios in planar4 mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Use regular pci_config_readl func in geode code.
Kevin O'Connor [Sun, 15 Jan 2012 05:06:33 +0000 (00:06 -0500)]
vgabios: Use regular pci_config_readl func in geode code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Don't have geode code peak into stdvga mode struct.
Kevin O'Connor [Sun, 15 Jan 2012 04:25:24 +0000 (23:25 -0500)]
vgabios: Don't have geode code peak into stdvga mode struct.

Create a wrapper (stdvga_override_crtc) so the Geode code doesn't need
to access the stdvga mode tables directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Make VBE code depend on a config setting.
Kevin O'Connor [Sun, 15 Jan 2012 07:43:19 +0000 (02:43 -0500)]
vgabios: Make VBE code depend on a config setting.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Move vgabios Kconfig definitions to vgasrc/Kconfig.
Kevin O'Connor [Sun, 15 Jan 2012 07:01:24 +0000 (02:01 -0500)]
vgabios: Move vgabios Kconfig definitions to vgasrc/Kconfig.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Build vgabios by default if enabled in Kconfig.
Kevin O'Connor [Sun, 15 Jan 2012 06:52:27 +0000 (01:52 -0500)]
vgabios: Build vgabios by default if enabled in Kconfig.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Improve vgabios Kconfig menu.
Kevin O'Connor [Sun, 15 Jan 2012 06:12:20 +0000 (01:12 -0500)]
vgabios: Improve vgabios Kconfig menu.

Place driver types in a "choice" selection - only one driver type
makes sense.

Only prompt the user for PCI Vendor/Device ids if they wish to
override the default choices.  Otherwise, Kconfig wont know to use the
proper defaults when building autoconf.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Rename vgatables.c to stdvgamodes.c.
Kevin O'Connor [Sun, 15 Jan 2012 04:20:05 +0000 (23:20 -0500)]
vgabios: Rename vgatables.c to stdvgamodes.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Move video_param_table definition to vgabios.c.
Kevin O'Connor [Sun, 15 Jan 2012 04:15:40 +0000 (23:15 -0500)]
vgabios: Move video_param_table definition to vgabios.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Move static_functionality[] from vgatables.c to vgabios.c.
Kevin O'Connor [Sun, 15 Jan 2012 03:55:11 +0000 (22:55 -0500)]
vgabios: Move static_functionality[] from vgatables.c to vgabios.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Use standard VGA IO wrappers in geodevga.c.
Kevin O'Connor [Sun, 15 Jan 2012 03:18:18 +0000 (22:18 -0500)]
vgabios: Use standard VGA IO wrappers in geodevga.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Use standard VGA IO wrappers in clext.c.
Kevin O'Connor [Sun, 15 Jan 2012 03:18:02 +0000 (22:18 -0500)]
vgabios: Use standard VGA IO wrappers in clext.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Use standard VGA IO wrapper functions in bochsvga.
Kevin O'Connor [Sun, 15 Jan 2012 03:17:43 +0000 (22:17 -0500)]
vgabios: Use standard VGA IO wrapper functions in bochsvga.

Also, this alters some of the IO port settings in bochsvga_set_mode to
fix what looks like errors during the asm to C conversion.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>