seabios.git
12 years agogrml... coreboot
Bernhard Urban [Fri, 6 Apr 2012 12:25:10 +0000 (14:25 +0200)]
grml...

12 years agotsc crap :/
Bernhard Urban [Fri, 6 Apr 2012 12:25:09 +0000 (14:25 +0200)]
tsc crap :/

12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 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>
12 years agovgabios: Framebuffer fixes for CGA and planar graphics modes.
Kevin O'Connor [Sun, 1 Jan 2012 15:33:51 +0000 (10:33 -0500)]
vgabios: Framebuffer fixes for CGA and planar graphics modes.

Fix missing divide by 2 in CGA mode scroll.  Consistently use
cheight/2 for all uses.

Planar graphics character write has a read to video memory with a side
effect - mark that as volatile so the compiler doesn't optimize it
away.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Unify X_init() functions.
Kevin O'Connor [Sun, 1 Jan 2012 00:42:21 +0000 (19:42 -0500)]
vgabios: Unify X_init() functions.

Use the same function signature for cirrus, bochsvga, geodelx, and
stdvga init code.

Have each hardware type explicitly call stdvga_init when needed.

To unify bochsvga_init() signature, store the device BDF passed into
the optionrom init code in a global variable (VgaBDF).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Unify X_set_mode() functions.
Kevin O'Connor [Sun, 1 Jan 2012 00:13:45 +0000 (19:13 -0500)]
vgabios: Unify X_set_mode() functions.

Use the same function signature for cirrus, bochsvga, and stdvga
set_mode code.

Make both the int1000 interface and the VBE 104f02 interface use the
same set_mode function.

Where clext and bochsvga need to fallback to the standard vga mode
switching, have them call vgastd_mode_switch directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Create clext.h and use "clext_" as prefix for exported funcs.
Kevin O'Connor [Sat, 31 Dec 2011 23:39:59 +0000 (18:39 -0500)]
vgabios: Create clext.h and use "clext_" as prefix for exported funcs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Refactor vga_set_mode and stdvga_set_mode.
Kevin O'Connor [Sat, 31 Dec 2011 23:19:22 +0000 (18:19 -0500)]
vgabios: Refactor vga_set_mode and stdvga_set_mode.

Split out the BDA setup part of vga_set_mode to new function
modeswitch_set_bda.  Move the remaining parts (palette loading, screen
clearing, font loading) of vga_set_mode into stdvga_set_mode.

Add new mode switching flags and pass them to stdvga_set_mode, so it
does not need to inspect modeset_ctl directly.

Move code needed by stdvga_set_mode (perform_gray_scale_summing,
clear_screen) to stdvga.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Change vga_set_mode() to directly setup BDA.
Kevin O'Connor [Sat, 31 Dec 2011 22:24:11 +0000 (17:24 -0500)]
vgabios: Change vga_set_mode() to directly setup BDA.

The calls to set_cursor_shape, set_cursor_pos, and set_active_page
have no impact other than to set the BDA variables, because the
standard vga mode switch already programed the registers these
functions set.  So, just setup the BDA directly.

The stdvga_set_text_block_specifier call is unnecessary - it sets
a register which is already programmed that way.

Call stdvga_get_crtc() to obtain the crtc address instead of inferring
it from the memory model.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Don't call int10 during mode switch.
Kevin O'Connor [Sat, 31 Dec 2011 21:22:35 +0000 (16:22 -0500)]
vgabios: Don't call int10 during mode switch.

Don't call int10 to load the fonts - instead call the font loading
functions directly.

Theoretically, this could change behavior if an external program has
captured int10 and redirects the font loading calls.  However, there
does not seem to be any indication that an external app could expect
that to work.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Introduce stdvga_get_crtc() and use it consistently.
Kevin O'Connor [Sat, 31 Dec 2011 21:00:54 +0000 (16:00 -0500)]
vgabios: Introduce stdvga_get_crtc() and use it consistently.

The low level VGA code shouldn't depend on the crtc address stored in
the BDA - it can find the address on its own.

The cirrus_get_crtc() function is the same - replace it with
stdvga_get_crtc().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Fix typo in release_font_access() - inb instead of inw.
Kevin O'Connor [Sat, 31 Dec 2011 20:52:22 +0000 (15:52 -0500)]
vgabios: Fix typo in release_font_access() - inb instead of inw.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Move vgafb_load_font to stdvga.c.
Kevin O'Connor [Sat, 31 Dec 2011 09:31:16 +0000 (04:31 -0500)]
vgabios: Move vgafb_load_font to stdvga.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Rename vgahw_* functions to stdvga_*.
Kevin O'Connor [Sat, 31 Dec 2011 09:24:20 +0000 (04:24 -0500)]
vgabios: Rename vgahw_* functions to stdvga_*.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Rename vgaio.c to stdvga.c.
Kevin O'Connor [Sat, 31 Dec 2011 09:15:12 +0000 (04:15 -0500)]
vgabios: Rename vgaio.c to stdvga.c.

Also, introduce stdvga.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Move vbe code from vgabios.c to new file vbe.c.
Kevin O'Connor [Sat, 31 Dec 2011 08:43:12 +0000 (03:43 -0500)]
vgabios: Move vbe code from vgabios.c to new file vbe.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Rename vga.c to vgabios.c.
Kevin O'Connor [Sat, 31 Dec 2011 08:30:40 +0000 (03:30 -0500)]
vgabios: Rename vga.c to vgabios.c.

Also, rename vgatables.h to vgabios.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Use bochsvga_ prefix for bochs vga functions.
Kevin O'Connor [Sat, 31 Dec 2011 08:18:18 +0000 (03:18 -0500)]
vgabios: Use bochsvga_ prefix for bochs vga functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Rename vbe.c to bochsvga.c.
Kevin O'Connor [Sat, 31 Dec 2011 08:09:55 +0000 (03:09 -0500)]
vgabios: Rename vbe.c to bochsvga.c.

The code is specific to the Bochs "dispi" interface, not the vesa
video bios extensions spec.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Continue port of clext.c.
Kevin O'Connor [Sat, 31 Dec 2011 08:00:59 +0000 (03:00 -0500)]
vgabios: Continue port of clext.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Minor fixes to struct vbe_info definition.
Kevin O'Connor [Fri, 30 Dec 2011 21:37:20 +0000 (16:37 -0500)]
vgabios: Minor fixes to struct vbe_info definition.

Although the VBE3 spec says there is 189 bytes of pad at the end of
the vbe_info struct, the spec also says the total struct size should
be 256 bytes.  The VBE2 spec uses sufficient pad to get to 256 bytes.
So, assume the spec was off by one and make the pad 190 bytes.

Also, use u32 for capabilities and 'struct segoff_s' for
win_func_ptr.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoDon't leave upper bits of 64bit BARs unitialized during pci init.
Kevin O'Connor [Fri, 30 Dec 2011 21:36:16 +0000 (16:36 -0500)]
Don't leave upper bits of 64bit BARs unitialized during pci init.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Merge support for GeodeLX vga bios.
Kevin O'Connor [Sat, 24 Dec 2011 05:44:07 +0000 (00:44 -0500)]
vgabios: Merge support for GeodeLX vga bios.

GeodeLX support based on a patch sent by Chris Kindt on 20090825.  The
patch provides basic support for running the vga bios on a Geode
device.

The original patch has been updated with the following:
  * Updates to merge with the current code,
  * geode specific timings are loaded at init time
  * PCI code was dropped as the current code now supports pci
  * Updates for Kconfig
  * dropped redundant lxdprintf
  * dropped geode_demo screen writing

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Place a signature at offset 0x1e of the rom.
Kevin O'Connor [Sat, 24 Dec 2011 04:01:48 +0000 (23:01 -0500)]
vgabios: Place a signature at offset 0x1e of the rom.

It appears some emulators look for a signature at offset 0x1e of the
option rom.  So, port the signature from the LGPL bios.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Generate video_param_table at runtime.
Kevin O'Connor [Sat, 24 Dec 2011 03:41:08 +0000 (22:41 -0500)]
vgabios: Generate video_param_table at runtime.

Now that all the mode info is available in vga_modes, generate the
externally visible video_param_table data from it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Use vgamode_s instead of video_param_table in code.
Kevin O'Connor [Sat, 24 Dec 2011 02:40:34 +0000 (21:40 -0500)]
vgabios: Use vgamode_s instead of video_param_table in code.

Now that all the info in video_param_table is also in vgamode_s, use
the info in vgamode_s throughout the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Extend information in internal vgamode_s struct.
Kevin O'Connor [Sat, 24 Dec 2011 02:20:09 +0000 (21:20 -0500)]
vgabios: Extend information in internal vgamode_s struct.

Copy all the data in video_param_table to vga_modes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Minor - use segoff_s for static_functionality ptr.
Kevin O'Connor [Sat, 24 Dec 2011 02:18:49 +0000 (21:18 -0500)]
vgabios: Minor - use segoff_s for static_functionality ptr.

12 years agovgabios: Define video_save_pointer_table layout.
Kevin O'Connor [Wed, 21 Dec 2011 14:05:32 +0000 (09:05 -0500)]
vgabios: Define video_save_pointer_table layout.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Fix compile error due to missing include in clext.c.
Kevin O'Connor [Wed, 28 Dec 2011 02:34:33 +0000 (21:34 -0500)]
vgabios: Fix compile error due to missing include in clext.c.

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