]> xenbits.xensource.com Git - seabios.git/log
seabios.git
9 years agovgabios: On bda_save_restore() the saved vbe_mode also has flags in it 1.8-stable upstream/1.8-stable rel-1.8.2
Kevin O'Connor [Tue, 17 Mar 2015 14:52:16 +0000 (10:52 -0400)]
vgabios: On bda_save_restore() the saved vbe_mode also has flags in it

When restoring a saved state, make sure to remove any flags from the
video mode prior to searching for that mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
9 years agobuild: CONFIG_VGA_FIXUP_ASM should depend on CONFIG_BUILD_VGABIOS
Kevin O'Connor [Wed, 10 Jun 2015 14:44:32 +0000 (10:44 -0400)]
build: CONFIG_VGA_FIXUP_ASM should depend on CONFIG_BUILD_VGABIOS

Add the dependency to CONFIG_VGA_FIXUP_ASM so the menu option only
appears when appropriate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit f24eb2f853d4aa28814761e0bbc7df78149f8029)

9 years agosmm: ignore bits 16,18-31 of SMM revision ID
Paolo Bonzini [Wed, 6 May 2015 10:38:29 +0000 (12:38 +0200)]
smm: ignore bits 16,18-31 of SMM revision ID

Bits 16-31 of the SMM revision ID are feature bits.  We only need to
check that SMBASE relocation is supported, but do not care about other
features.  In particular, this allows the SMM I/O instruction restart
feature to be present.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 92f9b9189eb00da42a8bfcf26c664f48ee8d2868)

9 years agovga: rework virtio-vga support
Gerd Hoffmann [Wed, 8 Apr 2015 08:36:22 +0000 (10:36 +0200)]
vga: rework virtio-vga support

Unlike planned earlier virtio-vga will be compatible with
the qemu stdvga, with the framebuffer in bar 0.  Drop the
virtio-vga chunk, update comment accordingly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 87f848ec2d6ca609252b313b062bbd57bd290565)

9 years agobuild: Support "make VERSION=xyz" to override the default build version
Kevin O'Connor [Wed, 3 Jun 2015 23:17:12 +0000 (19:17 -0400)]
build: Support "make VERSION=xyz" to override the default build version

Add a build option to explicitly set the version information compiled
into the seabios and seavgabios binaries.  This may assist in
reproducible builds or to better link builds to distribution packages.
If the new "VERSION=" parameter is not provided then the default build
version remains unchanged.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 624e812764beda88b47c0018b1cee3b86d5c59eb)

9 years agoahci: Ignore max_ports.
Vladimir Serbinenko [Mon, 18 May 2015 13:00:31 +0000 (15:00 +0200)]
ahci: Ignore max_ports.

At least AHCI on Intel on some machines claim to support only 6 ports
while in fact higher port numbers are present and work.
This is needed to access CD-ROM on PackardBell MS2290.
Both GRUB and Linux have a similar workaround.

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
(cherry picked from commit 40dfc0ee947c35f31e935ec290622e7780bb52b8)

9 years agovgabios: Emulate "leal" instruction
Kevin O'Connor [Thu, 9 Apr 2015 21:20:16 +0000 (17:20 -0400)]
vgabios: Emulate "leal" instruction

Emulate the "leal" instruction so that the vgabios can run on older
versions of x86emu.  (This removes the previous "leal" trap.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 0b2165d191f51ed2a522142c3ed3db55bc852627)

9 years agovgabios: Add config option for assembler fixups
Kevin O'Connor [Thu, 9 Apr 2015 21:15:23 +0000 (17:15 -0400)]
vgabios: Add config option for assembler fixups

Add a kconfig build option (CONFIG_VGA_FIXUP_ASM) to allow users to
build the vgabios without the complex assembler fixups that work
around emulator bugs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 799b20b0db45891845e2d820368a66af538d5664)

10 years agosmp: Fix smp race introduced in 0673b787 rel-1.8.1
Kevin O'Connor [Wed, 11 Mar 2015 21:45:47 +0000 (17:45 -0400)]
smp: Fix smp race introduced in 0673b787

In 0673b787 the QEMU SMP init code was changed to run in 32bit mode.
Unfortunately, the transition32 assembler function is not
multi-processor safe, because it modifies the global RTC index
register.  This race condition led to sporadic failures when emulating
machines with a large number of processors.

This patch changes the entry_smp code to use a variant of transition32
that does not touch the RTC registers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit 5ae3dd6f74e17a7cd06165a75214798b0c606115)

10 years agofw/pci: map memory and IO regions for multiple pci root buses
Marcel Apfelbaum [Mon, 16 Feb 2015 17:29:20 +0000 (19:29 +0200)]
fw/pci: map memory and IO regions for multiple pci root buses

For resource sizing and mapping purposes treat devices on extra root
buses as if they are on the default root bus (bus 0).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 0fe4c9ee7af5f6bb3a1fcbf1d39116a894600c90)

10 years agofw/pci: scan all buses if extraroots romfile is present
Marcel Apfelbaum [Mon, 16 Feb 2015 17:29:19 +0000 (19:29 +0200)]
fw/pci: scan all buses if extraroots romfile is present

If there are extra primary root buses, scanning the bus's 0
subtree is not enough. Scan all the range.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 5cc7eece39721f20b417770374a4112c454be801)

10 years agox86: add barrier to read{b,w,l} and write{b,w,l} functions
Ameya Palande [Tue, 17 Feb 2015 22:00:49 +0000 (14:00 -0800)]
x86: add barrier to read{b,w,l} and write{b,w,l} functions

Use barrier() for memory mapped IO functions.

This fixes pvscsi driver to boot on QEMU's pvscsi controller.
Test command:
qemu -m 512 --enable-kvm -device pvscsi,id=pvscsi0
-device scsi-disk,bus=pvscsi0.0,drive=drive0
-drive id=drive0,if=none,file=ubuntu1410.img,if=none
-bios seabios/out/bios.bin

Signed-off-by: Ameya Palande <2ameya@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit bc82fa431ef3a0791f637c54fc8065b3fbc13772)

10 years agodocs: Note v1.8.0 release rel-1.8.0
Kevin O'Connor [Wed, 18 Feb 2015 17:49:59 +0000 (12:49 -0500)]
docs: Note v1.8.0 release

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agodocs: There is only one VAR16 flag now
Kevin O'Connor [Wed, 18 Feb 2015 17:51:18 +0000 (12:51 -0500)]
docs: There is only one VAR16 flag now

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agodocs: Update release history with dates of stable releases
Kevin O'Connor [Wed, 18 Feb 2015 17:19:53 +0000 (12:19 -0500)]
docs: Update release history with dates of stable releases

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agodocs: Document why v1.6.3 release came after v0.6.2
Kevin O'Connor [Wed, 18 Feb 2015 16:59:19 +0000 (11:59 -0500)]
docs: Document why v1.6.3 release came after v0.6.2

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agocheckstack: Handle callw instruction
Kevin O'Connor [Mon, 19 Jan 2015 17:41:33 +0000 (12:41 -0500)]
checkstack: Handle callw instruction

Minor update to the checkstack.py tool.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Minor - properly free memory on get_device_config() error path
Kevin O'Connor [Thu, 1 Jan 2015 18:47:28 +0000 (13:47 -0500)]
usb: Minor - properly free memory on get_device_config() error path

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Control transfers always have an 8 byte command size
Kevin O'Connor [Wed, 31 Dec 2014 22:41:14 +0000 (17:41 -0500)]
usb: Control transfers always have an 8 byte command size

There is no need to pass 'cmdsize' to the usb drivers as the cmdsize
is always 8 bytes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoxhci: Merge some xhci_xfer_x() functions into xhci_send_pipe()
Kevin O'Connor [Wed, 31 Dec 2014 16:05:39 +0000 (11:05 -0500)]
xhci: Merge some xhci_xfer_x() functions into xhci_send_pipe()

The xhci_xfer_setup, xhci_xfer_data, xhci_xfer_status, and
xhci_xfer_normal functions are very similar - enhance xhci_xfer_queue
to reduce the boiler plate in the above functions.  Merge the
resulting setup, data, and status code into the only function that
uses them - xhci_send_pipe().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoxhci: Move xhci_xfer_x() functions together
Kevin O'Connor [Wed, 31 Dec 2014 07:25:58 +0000 (02:25 -0500)]
xhci: Move xhci_xfer_x() functions together

This is purely code movement - no code changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Use usb_send_pipe() now that all drivers have x_send_pipe()
Kevin O'Connor [Wed, 31 Dec 2014 07:11:36 +0000 (02:11 -0500)]
usb: Use usb_send_pipe() now that all drivers have x_send_pipe()

Now that all drivers have unified control and bulk transmit functions,
unify the driver calling code in usb.c as well.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoxhci: Merge xhci_send_control with xhci_send_bulk
Kevin O'Connor [Wed, 31 Dec 2014 07:07:37 +0000 (02:07 -0500)]
xhci: Merge xhci_send_control with xhci_send_bulk

Merge both the control and bulk pipe sending functions into one new
function: xhci_send_pipe().  This makes the xhci interface similar to
the other usb drivers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agouhci: Merge uhci_send_control with uhci_send_bulk
Kevin O'Connor [Wed, 31 Dec 2014 06:56:53 +0000 (01:56 -0500)]
uhci: Merge uhci_send_control with uhci_send_bulk

Merge both the control and bulk pipe sending functions into one new
function: uhci_send_pipe().  The two existing functions were similar,
and by merging them the resulting code supports more flexible control
transfers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoohci: Merge ohci_send_control with ohci_send_bulk
Kevin O'Connor [Wed, 31 Dec 2014 06:55:48 +0000 (01:55 -0500)]
ohci: Merge ohci_send_control with ohci_send_bulk

Merge both the control and bulk pipe sending functions into one new
function: ohci_send_pipe().  The two existing functions were similar,
and by merging them the resulting code supports more flexible control
transfers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoehci: Merge ehci_send_control with ehci_send_bulk
Kevin O'Connor [Wed, 31 Dec 2014 02:16:04 +0000 (21:16 -0500)]
ehci: Merge ehci_send_control with ehci_send_bulk

Merge both the control and bulk pipe sending functions into one new
function: ehci_send_pipe().  The two existing functions were similar,
and by merging them the resulting code supports more flexible control
transfers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoehci: Simplify fillTDbuffer() and rename
Kevin O'Connor [Thu, 1 Jan 2015 17:51:04 +0000 (12:51 -0500)]
ehci: Simplify fillTDbuffer() and rename

Simplify the calculation of the maximum transfer size per qtd,
simplify the fillTDbuffer() function so that it only fills the buffer
pointers, and rename fillTDbuffer() to ehci_fill_tdbuf().

Also, don't modify 'data' or 'datasize' so that usb_xfer_time() can
use 'datasize' at the end of the function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoehci: No need to support td array wrapping
Kevin O'Connor [Wed, 31 Dec 2014 01:50:44 +0000 (20:50 -0500)]
ehci: No need to support td array wrapping

The maximum bulk transfer is 64K and 4 QTDs can always transfer 64K.
So, there is no need to support a transfer with more than 4 QTDs.
Build the entire transaction and then submit it in one operation to
simplify the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Support emulated text in gfx_read_char()
Kevin O'Connor [Tue, 6 Jan 2015 14:36:41 +0000 (09:36 -0500)]
vgabios: Support emulated text in gfx_read_char()

When emulating text mode on "coreboot framebuffer" SeaVGABIOS, return
a foreground and background attribute from gfx_read_char() and prefer
returning a space character (instead of null) on blank cells.

This also returns the foreground color (instead of always returning
zero) for regular graphics mode gfx_read_char() calls.  This seems
fine as tests show other vgabios implementations also return various
values here.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: implement read char in graphics mode
Paolo Bonzini [Fri, 2 Jan 2015 17:32:25 +0000 (12:32 -0500)]
vgabios: implement read char in graphics mode

GWBasic relies on this, so implement it to enable some serious retrocomputing.
There is no better way to do it than trying to match all characters one by one
against the current font.

This makes it possible to actually do something in SCREEN 1 and SCREEN 2
(without it, you can use graphics in the programs but not in direct mode).

I couldn't find documentation for what to return as the attribute, but
experimenting with DOSBox suggests 0 (and GWBasic accepts it).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: fix graphics operation with Bochs VGA in non-DISPI modes
Paolo Bonzini [Thu, 1 Jan 2015 20:27:46 +0000 (21:27 +0100)]
vgabios: fix graphics operation with Bochs VGA in non-DISPI modes

For legacy VGA modes that do not set the VBE_DISPI_ENABLED bit,
bochsvga_get_linelength returns 0.  Thus all characters are squashed
into the first scanline.  Fix this by falling back to stdvga for
the legacy modes.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agouhci: Increase bulk transfer STACKTDS to 16
Kevin O'Connor [Wed, 31 Dec 2014 06:42:38 +0000 (01:42 -0500)]
uhci: Increase bulk transfer STACKTDS to 16

Increase the number of simultaneous transfer descriptors that the
driver will build for uhci.  The old value of 4 was a leftover from
when SeaBIOS had a tiny 512 byte extra stack - now that there is a 2K
extra stack there is plenty of space for additional descriptors.
Using a value of 16 should allow for an entire 1ms frame of bulk
transfer content to be setup in advance (assuming the max packet size
is 64 bytes).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agouhci: Enable "depth" tree traversal for bulk transfers
Kevin O'Connor [Wed, 31 Dec 2014 06:40:07 +0000 (01:40 -0500)]
uhci: Enable "depth" tree traversal for bulk transfers

Set the "depth" flag on bulk transactions.  Since SeaBIOS doesn't use
bandwidth reclamation, without the depth flag the uhci controller will
only transfer one bulk packet per 1 ms frame.  This results in a
maximum of 64 bytes per millisecond, which severely limits the
transfer rate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agodocs: Add documentation on using readserial.py script
Kevin O'Connor [Wed, 31 Dec 2014 17:02:56 +0000 (12:02 -0500)]
docs: Add documentation on using readserial.py script

Update the debugging documentation with info on timing debug output
with readserial.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoreadserial: Enhance pipe support
Kevin O'Connor [Wed, 31 Dec 2014 05:18:05 +0000 (00:18 -0500)]
readserial: Enhance pipe support

Automatically close and open the pipe if it closes.  Also, better
document that the -f option is for pipes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Add support for OHCI bulk transfers
Kevin O'Connor [Mon, 29 Dec 2014 18:06:23 +0000 (13:06 -0500)]
usb: Add support for OHCI bulk transfers

Support bulk transfers (usb drives) on OHCI USB controllers.  Now that
there is support for 32bit only drive controllers, it is not that hard
to support disks on OHCI controllers, and it may be useful for some
old hardware.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoblock: Check for read/write requests over 64K
Kevin O'Connor [Mon, 29 Dec 2014 15:29:34 +0000 (10:29 -0500)]
block: Check for read/write requests over 64K

The standard BIOS disk read/write request interface should never get a
request for more than 64K of data.  Explicitly check for overly large
requests and reject them.  This way, the low-level drivers do not need
to check for or attempt to handle very large requests.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agocdrom: Break up very large read requests into smaller requests
Kevin O'Connor [Mon, 29 Dec 2014 15:15:57 +0000 (10:15 -0500)]
cdrom: Break up very large read requests into smaller requests

A cdrom boot image could be over 64K in size, but the low level
drivers may not support very large reads.  If a large cdrom image is
found, issue multiple reads so that a read request over 64K is never
issued.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoscsi: Don't export cdb_* functions
Kevin O'Connor [Mon, 29 Dec 2014 14:58:48 +0000 (09:58 -0500)]
scsi: Don't export cdb_* functions

The low-level cdb_* functions are now only used from within
cmdblock.c, so don't export them.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agocdrom: call scsi_process_op() instead of cdb_read()
Kevin O'Connor [Mon, 29 Dec 2014 14:48:24 +0000 (09:48 -0500)]
cdrom: call scsi_process_op() instead of cdb_read()

Use the scsi_process_op() function instead of the lower level
cdb_read() function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoscsi: Move process_scsi_op() to hw/blockcmd.c and rename
Kevin O'Connor [Mon, 29 Dec 2014 14:45:15 +0000 (09:45 -0500)]
scsi: Move process_scsi_op() to hw/blockcmd.c and rename

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoscsi: Move cdb_* functions above scsi_* functions
Kevin O'Connor [Mon, 29 Dec 2014 14:40:46 +0000 (09:40 -0500)]
scsi: Move cdb_* functions above scsi_* functions

This is just code movement - no code changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agodocs: Add page describing SeaBIOS final object linking
Kevin O'Connor [Sun, 28 Dec 2014 19:18:03 +0000 (14:18 -0500)]
docs: Add page describing SeaBIOS final object linking

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agodocs: Add info on MODE16/MODESEGMENT compile time flags
Kevin O'Connor [Sun, 28 Dec 2014 19:17:37 +0000 (14:17 -0500)]
docs: Add info on MODE16/MODESEGMENT compile time flags

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agodocs: Don't point to repo README files
Kevin O'Connor [Thu, 18 Dec 2014 22:36:12 +0000 (17:36 -0500)]
docs: Don't point to repo README files

Now that the README files have been simplified, don't point the wiki
pages to them.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoAdd wiki documentation to repository
Kevin O'Connor [Tue, 16 Dec 2014 13:53:24 +0000 (08:53 -0500)]
Add wiki documentation to repository

Add a docs/ directory that contains the contents of the SeaBIOS wiki
in markdown format.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agosdcard: Initial support for SD cards on PCI SDHCI controllers on QEMU
Kevin O'Connor [Tue, 16 Dec 2014 14:55:16 +0000 (09:55 -0500)]
sdcard: Initial support for SD cards on PCI SDHCI controllers on QEMU

This adds basic read/write support for SD cards emulated by QEMU.
This code is not expected to work on real hardware, because the
current controller and card initialization is not robust.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoSimplify README files - point to online documentation instead
Kevin O'Connor [Tue, 16 Dec 2014 02:44:13 +0000 (21:44 -0500)]
Simplify README files - point to online documentation instead

The README file and README.CSM file have gotten a bit out of date.
Instead of maintaining technical information in the README file, point
new users to the SeaBIOS wiki.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Update USB hub code to support super speed hubs
Kevin O'Connor [Fri, 12 Dec 2014 19:16:43 +0000 (14:16 -0500)]
usb: Update USB hub code to support super speed hubs

Super speed hubs (usb3 spec) have specific initialization
requirements.  Add the code necessary to detect and initialize these
hubs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoEliminate FUNCFSEG - only force portions of inline asm to f-segment
Kevin O'Connor [Wed, 3 Dec 2014 17:53:01 +0000 (12:53 -0500)]
Eliminate FUNCFSEG - only force portions of inline asm to f-segment

The FUNCFSEG macro was introduced to force a C function into the
f-segment.  This was needed for some C functions that used inline
assembler that contained some 16bit code.  Instead of forcing the
entire C function into the f-segment, just force the small subset of
inline assembler into the f-segment.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoUse macros for .code16/32 mode switches in inline asm in stacks.c
Kevin O'Connor [Wed, 3 Dec 2014 17:39:28 +0000 (12:39 -0500)]
Use macros for .code16/32 mode switches in inline asm in stacks.c

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoMinor - be consistent in placement of .code16/32 in romlayout.S
Kevin O'Connor [Wed, 3 Dec 2014 17:22:14 +0000 (12:22 -0500)]
Minor - be consistent in placement of .code16/32 in romlayout.S

Place .code32 in those functions that need it, and make sure every
function ends in .code16 mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agofloppy: Make sure to yield() during floppy PIO
Kevin O'Connor [Sat, 29 Nov 2014 18:04:46 +0000 (13:04 -0500)]
floppy: Make sure to yield() during floppy PIO

The floppy Programmed IO code really should yield while the controller
is busy.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agobuild: set LC_ALL=C
Gerd Hoffmann [Wed, 3 Dec 2014 14:14:57 +0000 (15:14 +0100)]
build: set LC_ALL=C

Avoids tools such as layoutrom stumble over localized messages.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-By: Patrick Georgi <pgeorgi@google.com>
10 years agoadd scripts/tarball.sh
Gerd Hoffmann [Mon, 17 Nov 2014 07:32:00 +0000 (08:32 +0100)]
add scripts/tarball.sh

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agopciinit: Fix build warning in mch_pci_slot_get_irq()
Kevin O'Connor [Wed, 12 Nov 2014 23:00:30 +0000 (18:00 -0500)]
pciinit: Fix build warning in mch_pci_slot_get_irq()

Some old versions of gcc warn that 'irq might be used uninitialized'.
Replace the switch statement with an if statement to suppress the
warning.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoFix build issue on gcc34
Kevin O'Connor [Wed, 12 Nov 2014 22:49:33 +0000 (17:49 -0500)]
Fix build issue on gcc34

Older versions of gcc may not inline on_extra_stack() and thus cause a
link error when compiling in 32bit segmented mode.  Test for MODE16
explicitly in stack_hop_back() to prevent the problem.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoMinor - comment updates in romlayout.S
Kevin O'Connor [Wed, 5 Nov 2014 17:04:53 +0000 (12:04 -0500)]
Minor - comment updates in romlayout.S

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoUse an aligned stack offset when entering on the extra stack
Kevin O'Connor [Wed, 5 Nov 2014 14:05:36 +0000 (09:05 -0500)]
Use an aligned stack offset when entering on the extra stack

The size of 'struct bregs' is not evenly divisible by four and where
the assembler placed a 'struct bregs' on the extra stack as part of
entering into the C functions it caused the C functions to run with a
non-aligned stack.  It's technically not correct to use an unaligned
stack and it is certainly less efficient.

This patch avoids using BREGS_size (the sizeof struct bregs) and
instead introduces PUSHBREGS_size (the size of the general purpose
registers in struct bregs) in the assembler.  Where the code actually
did use the %cs:%ip and flags, an extra 8 (instead of 6) bytes are
added to maintain a sane alignment.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Add software cursor capability
Kevin O'Connor [Sat, 18 Oct 2014 02:15:42 +0000 (22:15 -0400)]
vgabios: Add software cursor capability

Add mechanism for drawing a cursor to the framebuffer to implement a
cursor in software.  The timer interrupt is "hooked" so that the
cursor can blink.  This can be useful for "coreboot native vga".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Support emulating text mode attributes while in graphics mode
Kevin O'Connor [Thu, 30 Oct 2014 16:09:19 +0000 (12:09 -0400)]
vgabios: Support emulating text mode attributes while in graphics mode

Add support for simple text mode attribute emulation while in graphics
mode.  This improves text highlighting and background color on some
boot-loaders.  Enable it only for CBVGA vgabios and only when a text
mode is requested.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoMinor - move PORT_PS2_CTRLB from hw/ps2port.h to hw/timer.c
Kevin O'Connor [Mon, 3 Nov 2014 14:48:21 +0000 (09:48 -0500)]
Minor - move PORT_PS2_CTRLB from hw/ps2port.h to hw/timer.c

The PORT_PS2_CTRLB port is only used by timers - it's just a
historical artifact that it was part of the original ps2 controller.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agomegasas: read addional PCI I/O bar
Hannes Reinecke [Thu, 6 Nov 2014 13:31:56 +0000 (14:31 +0100)]
megasas: read addional PCI I/O bar

Some newer cards have the I/O bar at BAR 0, so we need to check
that, too, if we cannot get an address for BAR 2.
Without this patch the new 'megasas-gen2' emulation in qemu
is not detected.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoFix PNP regression introduced in 99cb8f3e due to missed conversion
Kevin O'Connor [Mon, 3 Nov 2014 14:45:51 +0000 (09:45 -0500)]
Fix PNP regression introduced in 99cb8f3e due to missed conversion

Commit 99cb8f3e missed a conversion from 12(%esp) to BREGS_eax(%esp)
causing winxp to break.

Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Add support for reading framebuffer in "direct" mode
Kevin O'Connor [Fri, 17 Oct 2014 04:20:14 +0000 (00:20 -0400)]
vgabios: Add support for reading framebuffer in "direct" mode

Support reading high memory "direct" framebuffers and translating the
results to 8 bit attribute values.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Fill in available legacy modes in video_func_static at runtime
Kevin O'Connor [Thu, 23 Oct 2014 20:37:08 +0000 (16:37 -0400)]
vgabios: Fill in available legacy modes in video_func_static at runtime

Instead of hard coding the list of modes, fill them in from the list
of supported modes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Move standard table definitions to std/vga.h
Kevin O'Connor [Thu, 23 Oct 2014 20:24:36 +0000 (16:24 -0400)]
vgabios: Move standard table definitions to std/vga.h

Move the standard video bios definitions into a new header file.
Also, define a struct with the layout for the static functionality
table.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Only set the dcc_index=8 if stdvga ports are available
Kevin O'Connor [Thu, 23 Oct 2014 19:54:59 +0000 (15:54 -0400)]
vgabios: Only set the dcc_index=8 if stdvga ports are available

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Only init BDA device details in init_bios_area()
Kevin O'Connor [Thu, 23 Oct 2014 17:04:17 +0000 (13:04 -0400)]
vgabios: Only init BDA device details in init_bios_area()

Don't set the device details when changing modes, and don't set mode
details outside of mode setting.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Refactor get/set_cursor_shape() code
Kevin O'Connor [Thu, 23 Oct 2014 00:57:37 +0000 (20:57 -0400)]
vgabios: Refactor get/set_cursor_shape() code

Rework the code so that it is possible to calculate the current cursor
shape even when not changing it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Set cursor shape fixes
Kevin O'Connor [Thu, 23 Oct 2014 00:27:28 +0000 (20:27 -0400)]
vgabios: Set cursor shape fixes

The "cursor scaling" mode is determined by the first bit of the
video_ctl bda value, not the modeset_ctl value.  Also, on a
set_scan_lines() call, the shape should be set to lines-3/lines-2 and
the shape must be set after char_height has been updated.

The existing cursor shape code matches the legacy "lgpl vgabios", but
the behavior doesn't match bios documentation nor observations with an
ati vga bios.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Rename vbe_flags to flags
Kevin O'Connor [Tue, 21 Oct 2014 19:15:44 +0000 (15:15 -0400)]
vgabios: Rename vbe_flags to flags

Allow the custom bda field vbe_flags to be used for flags outside of
vbe.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Don't pass vmode_g to vgafb_move_chars() / vgafb_clear_chars()
Kevin O'Connor [Sat, 18 Oct 2014 01:47:10 +0000 (21:47 -0400)]
vgabios: Don't pass vmode_g to vgafb_move_chars() / vgafb_clear_chars()

Now that a pointer to the current video mode info struct is cached in
memory, it's not necessary to pass the struct into the vgafb code.
The vgafb code can lookup the struct itself.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Cache a pointer to the current mode struct in the BDA
Kevin O'Connor [Sat, 18 Oct 2014 01:37:23 +0000 (21:37 -0400)]
vgabios: Cache a pointer to the current mode struct in the BDA

Cache a pointer to the current mode 'vgamode_s' struct in the BDA to
avoid doing a linear scan of all available vga modes when the struct
is needed.

This uses an additional two bytes in the BDA (at offset 0xbc).  It's
possible this could conflict with some other software, but that seams
unlikely because that part of the BDA seems reserved for BIOS and
VGABIOS uses.  (And neither SeaBIOS nor Bochs BIOS currently make use
of that area.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agovgabios: Don't declare custom internal BDA storage in std/bda.h
Kevin O'Connor [Sat, 18 Oct 2014 01:17:48 +0000 (21:17 -0400)]
vgabios: Don't declare custom internal BDA storage in std/bda.h

The vgabios uses storage in the BDA at offset 0xb9 for internal custom
storage (the contents do not appear to be part of any bios standard).
Move the description of this custom vgabios area from std/bda.h to
vgasrc/vgabios.h.  Add two new macros (GET_BDA_EXT and SET_BDA_EXT).
This should make it more clear that the area is for custom internal
storage.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoRemove unused macro ENTRY_ST
Kevin O'Connor [Tue, 21 Oct 2014 18:39:47 +0000 (14:39 -0400)]
Remove unused macro ENTRY_ST

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoDo full BREGS backup/restore for pmm, pnp, and irqentry_extrastack
Kevin O'Connor [Tue, 21 Oct 2014 18:34:06 +0000 (14:34 -0400)]
Do full BREGS backup/restore for pmm, pnp, and irqentry_extrastack

Although these entry points only require backup and restore of the
registers that the C code clobbers, there is no harm in backing up
some additional registers.  This allows the BREGS macros to be used
which makes the code a little more readable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoCreate assembler macros for saving and restoring 'struct bregs'
Kevin O'Connor [Tue, 21 Oct 2014 06:23:02 +0000 (02:23 -0400)]
Create assembler macros for saving and restoring 'struct bregs'

Create macros SAVEBREGS_POP_DSEAX and RESTOREBREGS_DSEAX for saving
and restoring the cpu state.  These are similar to the existing
PUSHBREGS and POPBREGS macros.

This also fixes a bug in __farcall16 which inadvertently restored %ds
in %es and vice-versa.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoDon't clobber %ax on ENTRY_INTO32 macro
Kevin O'Connor [Tue, 21 Oct 2014 07:19:55 +0000 (03:19 -0400)]
Don't clobber %ax on ENTRY_INTO32 macro

There's no need to clobber %ax in ENTRY_INTO32.  Now that %eax isn't
clobbered, use ENTRY_INTO32 in entry_csm.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoUse 32bit memcpy in int1587 when applicable
Kevin O'Connor [Tue, 21 Oct 2014 03:06:04 +0000 (23:06 -0400)]
Use 32bit memcpy in int1587 when applicable

If the amount of data to be copied is an even number of four, then
copy the data in four byte chunks.  This 32bit copy is more efficient,
in particular when copying to/from memory mapped io.  This should
improve the performance of framebuffer draws in cbvga SeaVGABIOS.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Use usb_realloc_pipe for pipe alloc, update, and free.
Kevin O'Connor [Thu, 16 Oct 2014 18:03:39 +0000 (14:03 -0400)]
usb: Use usb_realloc_pipe for pipe alloc, update, and free.

Now that the usb controller drivers all support the realloc method,
use that for all pipe allocations, reallocations, and freeing.  This
gives the driver more control over the pipe life cycle.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoehci: Export ehci_realloc_pipe() instead of ehci_alloc_pipe()
Kevin O'Connor [Thu, 16 Oct 2014 17:40:42 +0000 (13:40 -0400)]
ehci: Export ehci_realloc_pipe() instead of ehci_alloc_pipe()

Support alloc, update, and free from the single exported function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoohci: Export ohci_realloc_pipe() instead of ohci_alloc_pipe()
Kevin O'Connor [Thu, 16 Oct 2014 17:36:41 +0000 (13:36 -0400)]
ohci: Export ohci_realloc_pipe() instead of ohci_alloc_pipe()

Support alloc, update, and free from the single exported function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agouhci: Export uhci_realloc_pipe() instead of uhci_alloc_pipe()
Kevin O'Connor [Thu, 16 Oct 2014 17:33:35 +0000 (13:33 -0400)]
uhci: Export uhci_realloc_pipe() instead of uhci_alloc_pipe()

Support alloc, update, and free from the single exported function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoxhci: Change xhci_update_pipe() to xhci_realloc_pipe() and use for alloc too
Kevin O'Connor [Thu, 16 Oct 2014 17:23:08 +0000 (13:23 -0400)]
xhci: Change xhci_update_pipe() to xhci_realloc_pipe() and use for alloc too

Instead of exporting both xhci_alloc_pipe() and xhci_update_pipe(),
export only xhci_realloc_pipe() and support alloc, update, and free
from it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Clarify usb freelist manipulations
Kevin O'Connor [Thu, 16 Oct 2014 16:31:42 +0000 (12:31 -0400)]
usb: Clarify usb freelist manipulations

Rename usb_getFreePipe() to usb_get_freelist().  Add usb_is_freelist()
and usb_add_freelist() functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Rename free_pipe() to usb_free_pipe()
Kevin O'Connor [Thu, 16 Oct 2014 15:59:45 +0000 (11:59 -0400)]
usb: Rename free_pipe() to usb_free_pipe()

Also, pass in usbdev to usb_free_pipe().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Rename send_default_control() to usb_send_default_control()
Kevin O'Connor [Thu, 16 Oct 2014 16:11:12 +0000 (12:11 -0400)]
usb: Rename send_default_control() to usb_send_default_control()

This is just function renaming - no code implementation changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Rename findEndPointDesc() to usb_find_desc()
Kevin O'Connor [Thu, 16 Oct 2014 16:08:00 +0000 (12:08 -0400)]
usb: Rename findEndPointDesc() to usb_find_desc()

This is just function renaming - no code implementation changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Rename usb_getFrameExp() to usb_get_period()
Kevin O'Connor [Thu, 16 Oct 2014 16:05:09 +0000 (12:05 -0400)]
usb: Rename usb_getFrameExp() to usb_get_period()

This is just function renaming - no code implementation changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agousb: Rename ?hci_control() to ?hci_send_control()
Kevin O'Connor [Thu, 16 Oct 2014 15:55:16 +0000 (11:55 -0400)]
usb: Rename ?hci_control() to ?hci_send_control()

This is just function renaming - no code implementation changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoBackup and restore a20 on call32_sloppy()
Kevin O'Connor [Sat, 11 Oct 2014 17:27:16 +0000 (13:27 -0400)]
Backup and restore a20 on call32_sloppy()

Previously, the a20 line would always be enabled and left on after
call32_sloppy().  The setting should really be backed up and restored
on each call.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoMove a20 code from system.c and ps2port.h to x86.h
Kevin O'Connor [Sat, 11 Oct 2014 17:16:12 +0000 (13:16 -0400)]
Move a20 code from system.c and ps2port.h to x86.h

Although the a20 functionality was originally implemented in the ps2
controller, that is just a historical artifact.  It's a core feature
of modern x86 cpus and the code is better located in the x86.h header.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoImplement call32 mechanism using SMIs.
Kevin O'Connor [Fri, 11 Apr 2014 15:20:41 +0000 (11:20 -0400)]
Implement call32 mechanism using SMIs.

Add support for jumping into 32bit mode using a System Management Mode
(SMM) handler.  When available, this allows SeaBIOS to transition to
32bit mode even when called in vm86 mode.  It will also prevent the
clobbering of the segment registers.

Currently, the SMM mode is only supported in QEMU when running in TCG
mode.  Also, QEMU v2.1 (or later) is needed for it to work when in
vm86 mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoFully restore 16bit state during call16_sloppy()
Kevin O'Connor [Tue, 30 Sep 2014 16:55:54 +0000 (12:55 -0400)]
Fully restore 16bit state during call16_sloppy()

When transitioning back to 16bit mode from within call32(), restore
the full state (cmos index, gdt, fs/gs) in addition to restoring the
original stack.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoBreak up call32() into call32() and call32_sloppy()
Kevin O'Connor [Tue, 30 Sep 2014 16:13:44 +0000 (12:13 -0400)]
Break up call32() into call32() and call32_sloppy()

This separates call32() into two functions.  It also moves the
call16_sloppy() code next to the call32_sloppy() code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoMove call16() functions from romlayout.S to inline assembler in stacks.c
Kevin O'Connor [Wed, 24 Sep 2014 21:48:28 +0000 (17:48 -0400)]
Move call16() functions from romlayout.S to inline assembler in stacks.c

Use inline assembler in call16 type functions instead of using
__call16() in romlayout.S.

Since call16() and call16big() are now only called with %ss==0 they do
not need to update the stack pointer.  Only call16_sloppy() requires
the stack manipulation code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agobuild: Support declaring 32bit C functions that must reside in the f-segment
Kevin O'Connor [Wed, 24 Sep 2014 19:58:12 +0000 (15:58 -0400)]
build: Support declaring 32bit C functions that must reside in the f-segment

Add support for a FUNCFSEG macro that will force a "32bit flat" C
function to be located in the f-segment.  This is useful for 32bit
code with inline assembler that thunks to 16bit mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoUpdate reset() to use call16_back()
Kevin O'Connor [Tue, 30 Sep 2014 04:17:44 +0000 (00:17 -0400)]
Update reset() to use call16_back()

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
10 years agoSimplify farcall16 code
Kevin O'Connor [Tue, 30 Sep 2014 04:11:38 +0000 (00:11 -0400)]
Simplify farcall16 code

With this change, farcall16() is only used for external API calls and
is only invoked from a 32bit mode entered directly via transition32.
farcall16big() is also only used for external API calls and is only
invoked from a 32bit mode entered directly via transition32.

call16_int() now calls _farcall16() directly, and it will use normal
16bit mode or big real mode as required.

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