]> xenbits.xensource.com Git - seabios.git/log
seabios.git
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>
13 years agovgabios: Use standard VGA IO wrapper functions in stdvga.c.
Kevin O'Connor [Sun, 15 Jan 2012 03:17:07 +0000 (22:17 -0500)]
vgabios: Use standard VGA IO wrapper functions in stdvga.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add wrapper functions for accessing standard VGA registers.
Kevin O'Connor [Sun, 15 Jan 2012 00:02:43 +0000 (19:02 -0500)]
vgabios: Add wrapper functions for accessing standard VGA registers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add cirrus linear framebuffer detection; enable VBE in cirrus.
Kevin O'Connor [Sat, 14 Jan 2012 21:59:21 +0000 (16:59 -0500)]
vgabios: Add cirrus linear framebuffer detection; enable VBE in cirrus.

Extract Cirrus framebuffer address from PCI config space.

Enable VBE code for Cirrus cards.

Also, rework bochsvga code to use direct PCI accesses instead of
calling into the BIOS.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Hook up Cirrus extended bios functions.
Kevin O'Connor [Sat, 14 Jan 2012 21:30:49 +0000 (16:30 -0500)]
vgabios: Hook up Cirrus extended bios functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Make cirrus line lengths standard.
Kevin O'Connor [Sat, 14 Jan 2012 19:52:01 +0000 (14:52 -0500)]
vgabios: Make cirrus line lengths standard.

Only two modes don't match their expected line length.  One looks like
a bug (it has a virtual line length of 1280 for a screen of 1600
bytes) and one looks like an optimization (2048 vs 1920).  Change the
mode line lengths to exactly match the expected line lengths so that
the VBE code is correct.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Unify cirrus and vbe vesa functions.
Kevin O'Connor [Sat, 14 Jan 2012 03:08:52 +0000 (22:08 -0500)]
vgabios: Unify cirrus and vbe vesa functions.

Unify the code for the Cirrus and VBE vesa functions 00-03.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Make VBE code independent of bochsvga.
Kevin O'Connor [Sat, 14 Jan 2012 01:00:35 +0000 (20:00 -0500)]
vgabios: Make VBE code independent of bochsvga.

Introduce new global variables (VBE_enabled, VBE_total_memory,
VBE_capabilities, VBE_framebuffer) to replace the need for function
calls that were specific to bochsvga.

Replace info received from bochsvga_mode_info with info found in
vgahw_find_mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Unify code to generate the vbe mode list.
Kevin O'Connor [Tue, 10 Jan 2012 01:55:31 +0000 (20:55 -0500)]
vgabios: Unify code to generate the vbe mode list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Use vgamode_s in cirrus and bochsvga mode tables.
Kevin O'Connor [Tue, 10 Jan 2012 01:21:31 +0000 (20:21 -0500)]
vgabios: Use vgamode_s in cirrus and bochsvga mode tables.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Extract out common parts of struct vgamode_s.
Kevin O'Connor [Tue, 10 Jan 2012 00:19:44 +0000 (19:19 -0500)]
vgabios: Extract out common parts of struct vgamode_s.

Extract out the fields in 'struct vgamode_s' that are used in the main
code.  The remaining fields are specific to the standard vga hardware
driver.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Unify page size calculations; remove page size from vgamode_s.
Kevin O'Connor [Sat, 7 Jan 2012 23:27:19 +0000 (18:27 -0500)]
vgabios: Unify page size calculations; remove page size from vgamode_s.

The previous code could obtain the page size in different ways - from
vmode_g->sslength, from SCREEN_MEM_START, or by manually multiplying
cols and rows.  Add a new func (calc_page_size) and use that in areas
that need to calculate the page size.

Convert readers of the page size to read it from the "video_pagesize"
entry in the BDA instead of recalculating it.

Remove the page size from struct vgamode_s (slength) as it is now
calculated dynamically.  The new calculated versions are different
from the existing values exported in video_param_table.  However, the
existing values (for CGA) did not look correct - I compared the values
to those exported by two other VGA BIOS manufacturers and used the
values that look more standard.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add memmodel field to bochsvga mode list.
Kevin O'Connor [Mon, 2 Jan 2012 16:32:11 +0000 (11:32 -0500)]
vgabios: Add memmodel field to bochsvga mode list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Make struct vgamode_s more similar to bochs/cirrus mode tables.
Kevin O'Connor [Mon, 2 Jan 2012 16:13:14 +0000 (11:13 -0500)]
vgabios: Make struct vgamode_s more similar to bochs/cirrus mode tables.

For graphics modes, store pixel width/height instead of text
width/height.  Add explicit char width field.  Where needed, calculate
text width/height from pixel width/height by dividing pixel count by
character size.

Rename some fields and change field sizes to match cirrus/bochs
definitions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Remove dummy 0xfe mode from list of cirrus modes.
Kevin O'Connor [Mon, 2 Jan 2012 15:51:26 +0000 (10:51 -0500)]
vgabios: Remove dummy 0xfe mode from list of cirrus modes.

The 0xfe mode isn't a real mode, it's a place holder for settings
needed to switch back to non-cirrus modes.  Handle it that way.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add char width to stdvga mode table.
Kevin O'Connor [Mon, 2 Jan 2012 07:35:07 +0000 (02:35 -0500)]
vgabios: Add char width to stdvga mode table.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Use standard naming for cirrus memmodel.
Kevin O'Connor [Mon, 2 Jan 2012 07:23:17 +0000 (02:23 -0500)]
vgabios: Use standard naming for cirrus memmodel.

The cirrus mode array stores memmodel as vesacolortype - rename it to
'memmodel' and use common field names.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Use vesa style memory model flags in stdvga code.
Kevin O'Connor [Sun, 1 Jan 2012 17:32:53 +0000 (12:32 -0500)]
vgabios: Use vesa style memory model flags in stdvga code.

Replace the custom flags with the flags defined in the VBE spec.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoBCVs should inherrit the legacy harddrive priority.
Kevin O'Connor [Sat, 14 Jan 2012 16:58:14 +0000 (11:58 -0500)]
BCVs should inherrit the legacy harddrive priority.

A BCV will (almost assuredly) be a hard drive, so it makes sense to
prioritize them the same as builtin hard drives when only the legacy
priority system is used.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agoPermit multiple BEV and BEV/BCV combinations in a single option rom.
Kevin O'Connor [Sat, 14 Jan 2012 16:55:35 +0000 (11:55 -0500)]
Permit multiple BEV and BEV/BCV combinations in a single option rom.

The BBS spec is unclear on multiple BEV entry points for a rom.
However, the LSI scsi rom has been seen to register a BEV followed by
multiple BCV entry points.  Add support for it, as there's no harm in
it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Actually remove vgasrc/geodelx.[ch] - fixup of patch apply.
Kevin O'Connor [Sat, 14 Jan 2012 17:57:03 +0000 (12:57 -0500)]
vgabios: Actually remove vgasrc/geodelx.[ch] - fixup of patch apply.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Add the geode GX2 functionality.
Nils [Sat, 14 Jan 2012 17:15:14 +0000 (12:15 -0500)]
vgabios: Add the geode GX2 functionality.

Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
13 years agovgabios: Some little geode cleanup.
Nils [Sat, 14 Jan 2012 17:13:34 +0000 (12:13 -0500)]
vgabios: Some little geode cleanup.

Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
13 years agovgabios: Make the naming in the LX code generic to Geode.
Nils [Sat, 14 Jan 2012 17:11:41 +0000 (12:11 -0500)]
vgabios: Make the naming in the LX code generic to Geode.

Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
13 years agovgabios: Add scrolling for linear (packed pixel) graphics mode.
Kevin O'Connor [Sun, 1 Jan 2012 16:04:42 +0000 (11:04 -0500)]
vgabios: Add scrolling for linear (packed pixel) graphics mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
13 years agovgabios: Minor - make FB scroll functions look similar.
Kevin O'Connor [Sun, 1 Jan 2012 15:54:19 +0000 (10:54 -0500)]
vgabios: Minor - make FB scroll functions look similar.

All three scroll function variants have the same format, but those
that have an implicit character width or height of 1 have those
multiplications omitted.  Add those multiplications back in (the
compiler will optimize them away) so all the variants look similar.

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