seabios.git
12 years agoReplace CONFIG_PS2_KEYBOARD_SPINUP with "etc/ps2-keyboard-spinup" file.
Kevin O'Connor [Wed, 6 Jul 2011 00:44:00 +0000 (20:44 -0400)]
Replace CONFIG_PS2_KEYBOARD_SPINUP with "etc/ps2-keyboard-spinup" file.

12 years agoReplace CONFIG_EXTRA_PCI_ROOTS with dynamic "etc/extra-pci-roots" file.
Kevin O'Connor [Wed, 6 Jul 2011 00:40:11 +0000 (20:40 -0400)]
Replace CONFIG_EXTRA_PCI_ROOTS with dynamic "etc/extra-pci-roots" file.

12 years agoReplace CONFIG_BOOTMENU_WAIT with dynamic "etc/boot-menu-wait" file.
Kevin O'Connor [Wed, 6 Jul 2011 00:34:34 +0000 (20:34 -0400)]
Replace CONFIG_BOOTMENU_WAIT with dynamic "etc/boot-menu-wait" file.

12 years agoAdd "romfile" code to assist with extract integer config settings.
Kevin O'Connor [Wed, 6 Jul 2011 00:32:44 +0000 (20:32 -0400)]
Add "romfile" code to assist with extract integer config settings.

Add romfile_loadint() function which can be used to extract a
little-endian binary encoded integer from rom.

12 years agoReplace CONFIG_PCI_ROOT1/2 with CONFIG_EXTRA_PCI_ROOTS.
Kevin O'Connor [Sat, 2 Jul 2011 22:39:03 +0000 (18:39 -0400)]
Replace CONFIG_PCI_ROOT1/2 with CONFIG_EXTRA_PCI_ROOTS.

Instead of defining the bus id of each extra root bus, define the
number of extra root buses.  The bus id isn't necessarily stable from
one boot to the next.

12 years agoRename foreachbdf_in_bus to foreachbdf and simplify it.
Kevin O'Connor [Sat, 2 Jul 2011 18:49:41 +0000 (14:49 -0400)]
Rename foreachbdf_in_bus to foreachbdf and simplify it.

Now that all callers of foreachbdf have been converted to
foreachbdf_in_bus, simplify the pci_next() code - it no longer needs
to track PCI bridges.

Also, rename the remaining users of foreachbdf_in_bus to foreachbdf.

12 years agoConvert remaining callers of foreachbdf to foreachbdf_in_bus.
Kevin O'Connor [Sat, 2 Jul 2011 18:32:11 +0000 (14:32 -0400)]
Convert remaining callers of foreachbdf to foreachbdf_in_bus.

Convert the last few callers of foreachbdf to foreachbdf_in_bus.  This
is in preparation for simplification of foreachbdf_in_bus.

Also add in addition debugging messages to pci_probe.

12 years agoConvert pci_find_device/class to use 'struct pci_device'.
Kevin O'Connor [Sat, 2 Jul 2011 18:04:19 +0000 (14:04 -0400)]
Convert pci_find_device/class to use 'struct pci_device'.

12 years agoCalculate vgahook responses during setup instead of in 16bit code.
Kevin O'Connor [Sat, 2 Jul 2011 17:50:21 +0000 (13:50 -0400)]
Calculate vgahook responses during setup instead of in 16bit code.

Do vga type and parameter detection during setup and store the
necessary info in global variables for the 16bit code.  This
simplifies the "vgahook" 16bit code.

12 years agoUse 'struct pci_device' to note which devices have native drivers.
Kevin O'Connor [Wed, 22 Jun 2011 02:52:51 +0000 (22:52 -0400)]
Use 'struct pci_device' to note which devices have native drivers.

Remove the check in optionroms.c for CONFIG_ATA and
PCI_CLASS_STORAGE_IDE with a flag in 'struct pci_device'.  This
ensures devices using the ATA driver that aren't in
PCI_CLASS_STORAGE_IDE don't have their optionroms executed.  It also
allows other drivers to disable option rom execution in the future.

12 years agoConvert pci_init_device to use 'struct pci_device'.
Kevin O'Connor [Wed, 22 Jun 2011 02:41:15 +0000 (22:41 -0400)]
Convert pci_init_device to use 'struct pci_device'.

12 years agoMove pci_probe() call into pciinit() code.
Kevin O'Connor [Wed, 22 Jun 2011 02:22:58 +0000 (22:22 -0400)]
Move pci_probe() call into pciinit() code.

Call pci_probe after pci bridge setup and before pci device setup.
This will allow the pci device setup to use 'struct pci_device'.

12 years agoUse manual PCI search when making bios ram writable.
Kevin O'Connor [Wed, 22 Jun 2011 01:22:01 +0000 (21:22 -0400)]
Use manual PCI search when making bios ram writable.

During the ram unlock phase static variables can't be written, so
don't rely on the higher level PCI searching functions.  This will
allow for future simplification of those high level search functions.

This also limits the scan for the memory locking device to the first
bus - the device should also be on the root bus.

12 years agoReplace PCIPaths code with struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 03:29:15 +0000 (23:29 -0400)]
Replace PCIPaths code with struct pci_device.

12 years agoConvert USB detection code to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:23:02 +0000 (22:23 -0400)]
Convert USB detection code to use struct pci_device.

12 years agoConvert AHCI detection code to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:22:42 +0000 (22:22 -0400)]
Convert AHCI detection code to use struct pci_device.

12 years agoConvert virtio detection to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:22:08 +0000 (22:22 -0400)]
Convert virtio detection to use struct pci_device.

12 years agoConvert mptable code to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:21:11 +0000 (22:21 -0400)]
Convert mptable code to use struct pci_device.

12 years agoConvert ATA detection code to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:20:43 +0000 (22:20 -0400)]
Convert ATA detection code to use struct pci_device.

12 years agoConvert option rom scan to use struct pci_device.
Kevin O'Connor [Tue, 21 Jun 2011 02:19:17 +0000 (22:19 -0400)]
Convert option rom scan to use struct pci_device.

12 years agoRemove support for compiling in OPTIONROM_VENDEV_1/2.
Kevin O'Connor [Tue, 21 Jun 2011 01:52:44 +0000 (21:52 -0400)]
Remove support for compiling in OPTIONROM_VENDEV_1/2.

Passing in rom locations via absolute memory addresses hasn't been
needed since coreboot adopted CBFS support (which as several years
ago).

12 years agoFind all pci devices at startup and cache them for future use.
Kevin O'Connor [Sun, 19 Jun 2011 18:09:20 +0000 (14:09 -0400)]
Find all pci devices at startup and cache them for future use.

This adds 'struct pci_device' and pci_probe() which will locate and
store all found PCI devices in the system at startup.

12 years agoRename foreachpci macro to foreachbdf.
Kevin O'Connor [Sun, 19 Jun 2011 14:46:28 +0000 (10:46 -0400)]
Rename foreachpci macro to foreachbdf.

12 years agoAdd support for white-listing AHCI controllers as ATA compatible.
Kevin O'Connor [Sun, 19 Jun 2011 14:03:08 +0000 (10:03 -0400)]
Add support for white-listing AHCI controllers as ATA compatible.

To start, register the AMD ATA controller on the A50M chipset as
compatible with ATA mode even if it comes up in AHCI mode.

12 years agoConvert ATA pci scan to use pci_device_id table.
Kevin O'Connor [Sun, 19 Jun 2011 13:43:20 +0000 (09:43 -0400)]
Convert ATA pci scan to use pci_device_id table.

12 years agoRemove dev-i440fx.c/h - move code closer to its callers.
Kevin O'Connor [Sun, 19 Jun 2011 14:09:26 +0000 (10:09 -0400)]
Remove dev-i440fx.c/h - move code closer to its callers.

It's easier to understand the code when it is in the same file as its
callers.

12 years agoOnly allow CONFIG_XEN when not CONFIG_COREBOOT.
Kevin O'Connor [Wed, 15 Jun 2011 02:20:45 +0000 (22:20 -0400)]
Only allow CONFIG_XEN when not CONFIG_COREBOOT.

12 years agoCorrect fseg allocation for SMBIOS tables.
Ian Campbell [Tue, 14 Jun 2011 14:22:09 +0000 (15:22 +0100)]
Correct fseg allocation for SMBIOS tables.

Anthony Perard noticed that grub was unhappy because it sees no low memory and
that his e820 table was missing the first entry. He then pointed out this
rather glaring error in the allocation of space for the SMBIOS tables.

I've no idea why I didn't see this failure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Anthony Perard <anthony.perard@citrix.com>
12 years agoAdd support for use as Xen HVM BIOS.
Ian Campbell [Wed, 1 Jun 2011 10:00:29 +0000 (11:00 +0100)]
Add support for use as Xen HVM BIOS.

SeaBIOS is called by Xen's hvmloader which does the basic platform
setup (PCI, APIC, etc) and provides the various BIOS tables. Therefore
avoid re-doing that setup and copy out the tables as necessary. A
simple data structure is defined to pass the addresses of these
tables.

This patch also establishes the basic infrastructure to make
hypercalls, although it currently only uses it to query the hypervisor
version.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoMove support for copying out BIOS tables into its own file.
Ian Campbell [Wed, 1 Jun 2011 10:00:28 +0000 (11:00 +0100)]
Move support for copying out BIOS tables into its own file.

I'd like to use it for Xen support.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoFix OHCI keyboard repeat key issue.
Kevin O'Connor [Sun, 29 May 2011 13:48:28 +0000 (09:48 -0400)]
Fix OHCI keyboard repeat key issue.

Mask toggleCarry and Halted flags in endpoint descriptor dword #2 so that
the remaining head pointer field is valid for comparing with the next
pointer.

Signed-off-by: Scott Duplichan <scott@notabs.org>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoOnly show CONFIG_PS2_KEYBOARD_SPINUP when CONFIG_COREBOOT.
Kevin O'Connor [Sat, 28 May 2011 15:01:39 +0000 (11:01 -0400)]
Only show CONFIG_PS2_KEYBOARD_SPINUP when CONFIG_COREBOOT.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoAdd option to handle PS2 keyboards that have a slow power up.
Kevin O'Connor [Sat, 28 May 2011 15:00:28 +0000 (11:00 -0400)]
Add option to handle PS2 keyboards that have a slow power up.

Add PS2_KEYBOARD_SPINUP option to give certain keyboards more time to
initialize.

Based on report and feedback from: Sven Schnelle <svens@stackframe.org>

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agofix resume from S3 with QXL device
Kevin O'Connor [Wed, 25 May 2011 02:35:40 +0000 (22:35 -0400)]
fix resume from S3 with QXL device

From: Gleb Natapov <gleb@redhat.com>

QXL device is powered down during S3, so tell this to a guest OS
in AML code.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoCheck for broken LD that ships with Ubuntu 11.04.
Kevin O'Connor [Sun, 22 May 2011 01:05:04 +0000 (21:05 -0400)]
Check for broken LD that ships with Ubuntu 11.04.

Add a build test to ensure that LD can properly align sections.

13 years agoPrint E820 type names as well as numbers, as a debug aid
Ian Campbell [Fri, 13 May 2011 15:30:55 +0000 (16:30 +0100)]
Print E820 type names as well as numbers, as a debug aid

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoAdd Kconfig option to specify which serial port when serial debugging.
Kevin O'Connor [Wed, 11 May 2011 03:36:11 +0000 (23:36 -0400)]
Add Kconfig option to specify which serial port when serial debugging.

13 years agoAdd config option (CONFIG_BOOTORDER) to disable bootorder support.
Kevin O'Connor [Wed, 11 May 2011 02:08:30 +0000 (22:08 -0400)]
Add config option (CONFIG_BOOTORDER) to disable bootorder support.

13 years agoMove ps2ctr manipulation from mouse.c to ps2port.c.
Kevin O'Connor [Sat, 7 May 2011 18:19:29 +0000 (14:19 -0400)]
Move ps2ctr manipulation from mouse.c to ps2port.c.

This simplifies the mouse.c code.  It also prevents USB mouse
interaction from changing the ps2 port setup.

13 years agoMinor Kconfig help update.
Kevin O'Connor [Sat, 7 May 2011 17:57:42 +0000 (13:57 -0400)]
Minor Kconfig help update.

13 years agoFix struct bregs - it shouldn't have multiple members with the same name.
Kevin O'Connor [Sat, 7 May 2011 17:56:48 +0000 (13:56 -0400)]
Fix struct bregs - it shouldn't have multiple members with the same name.

This fixes a compile error on gcc 4.6.

13 years agoAdd config option to permit running option roms with bad checksums.
Kevin O'Connor [Mon, 7 Mar 2011 00:22:46 +0000 (19:22 -0500)]
Add config option to permit running option roms with bad checksums.

Based on a patch by: Stefan Reinauer <reinauer@google.com>

13 years agoAdd config option to disable MTRR initialization.
Kevin O'Connor [Mon, 7 Mar 2011 00:06:48 +0000 (19:06 -0500)]
Add config option to disable MTRR initialization.

Some versions of Bochs don't like the MTRR initialization, so add
CONFIG_MTRR_INIT to control whether SeaBIOS will touch the MTRRs.

13 years agoPrep version for next release.
Kevin O'Connor [Sun, 6 Mar 2011 23:26:13 +0000 (18:26 -0500)]
Prep version for next release.

13 years agoUpdate version to 0.6.2
Kevin O'Connor [Tue, 1 Mar 2011 02:09:34 +0000 (21:09 -0500)]
Update version to 0.6.2

13 years agolets pretend that RTC can be used to wakeup from S4
Gleb Natapov [Sun, 30 Jan 2011 12:17:11 +0000 (14:17 +0200)]
lets pretend that RTC can be used to wakeup from S4

WHQL complains otherwise.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoExpand user configurable parameters in Kconfig.
Kevin O'Connor [Sat, 29 Jan 2011 15:57:20 +0000 (10:57 -0500)]
Expand user configurable parameters in Kconfig.

Move most of the config settings in config.h to the Kconfig file.  The
remaining settings in config.h, are mostly build related.

13 years agoSupport non-local build directory - allow "make OUT=abc/" to work.
Kevin O'Connor [Sat, 29 Jan 2011 16:26:54 +0000 (11:26 -0500)]
Support non-local build directory - allow "make OUT=abc/" to work.

Don't require the build directory to be the "out/" directory of the
SeaBIOS source.

13 years agoThe vgabios build must depend on autoconf.h.
Kevin O'Connor [Sat, 29 Jan 2011 16:24:58 +0000 (11:24 -0500)]
The vgabios build must depend on autoconf.h.

13 years agofix parallel compilation of SeaBIOS
Stefan Reinauer [Fri, 28 Jan 2011 02:39:01 +0000 (18:39 -0800)]
fix parallel compilation of SeaBIOS

See patch.

Signed-off-by: Stefan Reinauer <reinauer@google.com>
13 years agoStart using Kconfig to configure SeaBIOS settings.
Kevin O'Connor [Thu, 27 Jan 2011 02:19:25 +0000 (21:19 -0500)]
Start using Kconfig to configure SeaBIOS settings.

Create autoconf.h during the build.

Move a couple of config settings from config.h to Kconfig.

13 years agoChange kconfig to emit disabled symbols in autoconf.h.
Kevin O'Connor [Thu, 27 Jan 2011 01:09:39 +0000 (20:09 -0500)]
Change kconfig to emit disabled symbols in autoconf.h.

Always emit CONFIG_X definitions in autoconf.h - set them to 0 when
they are disabled.

13 years agoBuild changes for Linux kconfig code to work in seabios dir structure.
Kevin O'Connor [Thu, 27 Jan 2011 02:14:59 +0000 (21:14 -0500)]
Build changes for Linux kconfig code to work in seabios dir structure.

13 years agoInitial commit of Kconfig build tool.
Kevin O'Connor [Tue, 25 Jan 2011 03:13:58 +0000 (22:13 -0500)]
Initial commit of Kconfig build tool.

This is a pure copy of the tool from the Linux v2.6.38-rc2
scripts/kconfig/ directory.

13 years agoMinor boot fixes.
Kevin O'Connor [Thu, 27 Jan 2011 02:04:01 +0000 (21:04 -0500)]
Minor boot fixes.

13 years agoMinor comment / code layout improvement to romlayout.S.
Kevin O'Connor [Sat, 22 Jan 2011 15:53:48 +0000 (10:53 -0500)]
Minor comment / code layout improvement to romlayout.S.

13 years agoFix to prevent infinite loop in build_pci_path().
Kevin O'Connor [Sat, 22 Jan 2011 15:53:08 +0000 (10:53 -0500)]
Fix to prevent infinite loop in build_pci_path().

Make sure the PCI path doesn't point to itself.

13 years agosupport T13 EDD3.0 spec
Gleb Natapov [Mon, 10 Jan 2011 08:50:27 +0000 (10:50 +0200)]
support T13 EDD3.0 spec

Some guests (such as Linux) expect BIOS to behave according to T13
EDD3.0 spec. T13 spec is much better then Phoenix since it provides
more information about interface and device paths. This patch adds
support for the spec. If guest provides buffer with enough space for
T13 EDD info return EDD according to T13 spec otherwise use Phoenix
one.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoAdd ability to track PCI paths and add to build_pci_path().
Kevin O'Connor [Mon, 10 Jan 2011 05:48:45 +0000 (00:48 -0500)]
Add ability to track PCI paths and add to build_pci_path().

Improve device path descriptions of devices on PCI buses.

13 years agoMove the CBFS payload setup to later in the boot.
Kevin O'Connor [Sat, 8 Jan 2011 17:24:39 +0000 (12:24 -0500)]
Move the CBFS payload setup to later in the boot.

Don't try to register payloads until after malloc has been setup.

13 years agoExtract space trimming code from ATA and use in USB and bootorder code.
Kevin O'Connor [Sat, 8 Jan 2011 17:06:54 +0000 (12:06 -0500)]
Extract space trimming code from ATA and use in USB and bootorder code.

Introduce function nullTrailingSpace() that nulls blank characters
from the end of a string.  Use this function in the ATA, USB MSC, and
bootorder code.

13 years agoseabios: acpi: add _RMV control method for PCI devices
Kevin O'Connor [Thu, 6 Jan 2011 02:25:18 +0000 (21:25 -0500)]
seabios: acpi: add _RMV control method for PCI devices

Use _RMV method to indicate whether device can be removed.

Data is retrieved from QEMU via I/O port 0xae0c.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Gleb Natapov <gleb@redhat.com>
13 years agoAdd support for finding the boot priority of USB drives.
Kevin O'Connor [Fri, 31 Dec 2010 19:38:10 +0000 (14:38 -0500)]
Add support for finding the boot priority of USB drives.

Use the device path of the USB device to find a bootorder entry.

13 years agoExtend 'usb_pipe' to track the controller and ports of each device.
Kevin O'Connor [Fri, 31 Dec 2010 19:35:26 +0000 (14:35 -0500)]
Extend 'usb_pipe' to track the controller and ports of each device.

Track the path of ports and controller of each usb device.  This is
useful for reporting the exact device path.

13 years agoAdd functions for boot device path parsing.
Kevin O'Connor [Sat, 1 Jan 2011 16:00:42 +0000 (11:00 -0500)]
Add functions for boot device path parsing.

Add functions that find boot device path for pci/ata/floppy/rom devices.

13 years agoUse bootprio_find_named_rom() for ramdisk and cbfs payload priorities.
Kevin O'Connor [Thu, 30 Dec 2010 02:59:44 +0000 (21:59 -0500)]
Use bootprio_find_named_rom() for ramdisk and cbfs payload priorities.

13 years agoRemove drive->desc field.
Kevin O'Connor [Thu, 30 Dec 2010 02:41:19 +0000 (21:41 -0500)]
Remove drive->desc field.

The description field is only available during the POST phase - it is
confusing to have it live in a structure available through all phases.

The description was only used by the boot menu code - pass each drive
description directly to the bootlist code.

Add a helper (znprintf) to automatically malloc_tmp the required
space.

Also, fixup ramdisk handling - it was using an incorrect floppy
priority.

13 years agoMinor reorganization of some of the boot_xxx code in boot.c.
Kevin O'Connor [Wed, 29 Dec 2010 16:52:33 +0000 (11:52 -0500)]
Minor reorganization of some of the boot_xxx code in boot.c.

13 years agoMove IPL.fw_bootorder to static variables in boot.c.
Kevin O'Connor [Wed, 29 Dec 2010 16:37:41 +0000 (11:37 -0500)]
Move IPL.fw_bootorder to static variables in boot.c.

13 years agoMove IPL.bev to static variables in boot.c
Kevin O'Connor [Wed, 29 Dec 2010 16:25:14 +0000 (11:25 -0500)]
Move IPL.bev to static variables in boot.c

Move the BEV storage to static variables in boot.c.

Also, increase the maximum number of BEV entries from 8 to 20.

13 years agoMove IPL.checkfloppysig to a global (CheckFloppySig) in boot.c.
Kevin O'Connor [Wed, 29 Dec 2010 16:18:04 +0000 (11:18 -0500)]
Move IPL.checkfloppysig to a global (CheckFloppySig) in boot.c.

13 years agoRemove Drives global struct in favor of independent global variables.
Kevin O'Connor [Wed, 29 Dec 2010 16:05:46 +0000 (11:05 -0500)]
Remove Drives global struct in favor of independent global variables.

The "Drives" struct just held three global variables - declare the
three global variables independently.

13 years agoDon't access drive_g->desc from boot_cdrom().
Kevin O'Connor [Wed, 29 Dec 2010 18:26:01 +0000 (13:26 -0500)]
Don't access drive_g->desc from boot_cdrom().

The drive description is allocated with malloc_tmp() and is thus only
available during the POST phase - boot_cdrom() is called during the
boot phase.

13 years agoSimplify keyboard reading code in the interactive boot menu.
Kevin O'Connor [Wed, 29 Dec 2010 18:25:18 +0000 (13:25 -0500)]
Simplify keyboard reading code in the interactive boot menu.

13 years agoCall setup_translation() from map_hd_drive().
Kevin O'Connor [Tue, 28 Dec 2010 02:08:53 +0000 (21:08 -0500)]
Call setup_translation() from map_hd_drive().

Unify the calling of setup_translation().

13 years agoRename add_ordered_drive() to add_drive() and use in map_hd_drive().
Kevin O'Connor [Mon, 27 Dec 2010 13:37:38 +0000 (08:37 -0500)]
Rename add_ordered_drive() to add_drive() and use in map_hd_drive().

13 years agoAdd stubs to permit devices to specify their boot priority.
Kevin O'Connor [Tue, 28 Dec 2010 00:26:57 +0000 (19:26 -0500)]
Add stubs to permit devices to specify their boot priority.

Add support for passing in priorities to bootlist system.

Based on patch by: Gleb Natapov <gleb@redhat.com>

13 years agoSimplify boot ordering by building an inclusive boot list.
Kevin O'Connor [Tue, 28 Dec 2010 00:07:49 +0000 (19:07 -0500)]
Simplify boot ordering by building an inclusive boot list.

Replace the bcv list with a full list of all "bootable objects".  All
ordering can then be done on this list.  The final boot menu, drive
mapping, and BEV list generation is then driven from this
authoritative list.

Move "Floppy" and "DVD/CD" description prefixes into drive description
generation code to simplify boot menu generation.

Rework QEMU's CMOS defined bootorder to work with priority scheme in
new boot list.

Have every CBFS entry create it's own BEV entry (instead of one entry
for all CBFS payloads).  Move CBFS payload detection code into
coreboot.c.

13 years agoPopulate drive_g->desc prior to calling add_bcv_internal().
Kevin O'Connor [Sun, 26 Dec 2010 22:22:28 +0000 (17:22 -0500)]
Populate drive_g->desc prior to calling add_bcv_internal().

Make sure the description is populated before registering a drive.

13 years agopciinit: fix off-by-one
Isaku Yamahata [Fri, 24 Dec 2010 01:51:08 +0000 (10:51 +0900)]
pciinit: fix off-by-one

IO port ends at 64K - 1. not 64K.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
13 years agoMinor build fixes.
Kevin O'Connor [Sun, 26 Dec 2010 19:16:22 +0000 (14:16 -0500)]
Minor build fixes.

I made these two tiny changes to SeaBIOS when I was playing with the
HEAD version.

The Makefile change prevents the test command from failing if CC
contains a space.

The coreboot change prevents a warning on our gcc 4.5.2 in certain
circumstances when sizeof seems to be unsigned long int instead of
unsigned int.

They're both unintrusive, shouldn't have potential for breaking
anything.

Signed-off-by: Stefan Reinauer <stepan@coreboot.org>
13 years agoTrack the source of each optionrom deployed.
Kevin O'Connor [Fri, 24 Dec 2010 19:42:42 +0000 (14:42 -0500)]
Track the source of each optionrom deployed.

It's useful to track where each optionrom in the system originated
from when initializing bev/bcvs.  So, keep a map of the rom address to
its source.

13 years agoSupport qemu based romfile wrappers called out of order.
Kevin O'Connor [Fri, 24 Dec 2010 18:53:32 +0000 (13:53 -0500)]
Support qemu based romfile wrappers called out of order.

If the file requested isn't the last file read, then reread the index
to find the given file.

13 years agoBreakup boot_setup() bootorder code into its own function.
Kevin O'Connor [Fri, 24 Dec 2010 16:17:03 +0000 (11:17 -0500)]
Breakup boot_setup() bootorder code into its own function.

13 years agoAdd romfile_loadfile() helper function.
Kevin O'Connor [Fri, 24 Dec 2010 16:15:26 +0000 (11:15 -0500)]
Add romfile_loadfile() helper function.

Add function to find, malloc, and copy a romfile.  Use it in the
bootsplash and bootorder code.

13 years agoRead bootorder file into memory.
Gleb Natapov [Thu, 23 Dec 2010 09:29:38 +0000 (11:29 +0200)]
Read bootorder file into memory.

Read bootorder file, parse it and put it into array for easy
consumption.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoAdd strchr() function.
Kevin O'Connor [Fri, 24 Dec 2010 15:39:32 +0000 (10:39 -0500)]
Add strchr() function.

13 years agoAdd romfile_name() function.
Gleb Natapov [Thu, 23 Dec 2010 09:29:39 +0000 (11:29 +0200)]
Add romfile_name() function.

romfile_name() return file name given file handler. Works for qemu and
coreboot.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoAdd BAID for ahci cdrom.
Gleb Natapov [Thu, 23 Dec 2010 09:29:36 +0000 (11:29 +0200)]
Add BAID for ahci cdrom.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoProvide full EDD 3.0 info for virtio disk
Gleb Natapov [Thu, 23 Dec 2010 09:29:35 +0000 (11:29 +0200)]
Provide full EDD 3.0 info for virtio disk

Fill out entire EDD 3.0 structure for virtio disk. Currently only EDD 1.0
part is filled which is missing such important info as device path. Use
SCSI device type since virtio is not defined by EDD spec and virtio disk pci
device uses SCSI class.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoEnhance layoutrom.py to work around a binutils quirk.
Kevin O'Connor [Fri, 24 Dec 2010 15:23:10 +0000 (10:23 -0500)]
Enhance layoutrom.py to work around a binutils quirk.

Some binutils (report of 2.20.1) don't create dummy symbols for each
section - work around that.

13 years agoCreate separate IPL entry for each CD/DVD
Gleb Natapov [Tue, 7 Dec 2010 11:50:54 +0000 (13:50 +0200)]
Create separate IPL entry for each CD/DVD

Current code creates only one IPL entry of type IPL_TYPE_CDROM even if
there are more then one CDROM drive present. If CDROM that the entry
refers to is not bootable there is no way to retry boot from another
CDROM. Fix this by creating IPL entry for each CDROM drive found. First
CDROM will always be placed in IPL entry 3 for backwards compatibility.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoahci: set controller id
Gerd Hoffmann [Thu, 9 Dec 2010 07:39:48 +0000 (08:39 +0100)]
ahci: set controller id

Fill the controller id in the drive struct with the port number so we
get a sane boot menu ordering with multiple hard disks attached.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoahci: fix off-by-one in port count
Gerd Hoffmann [Thu, 9 Dec 2010 07:39:47 +0000 (08:39 +0100)]
ahci: fix off-by-one in port count

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoahci: enable io/mem/dma
Kevin O'Connor [Sun, 12 Dec 2010 19:01:47 +0000 (14:01 -0500)]
ahci: enable io/mem/dma

Make sure IO, MMIO and DMA are enabled in pci config space
before using the device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoahci: set dma feature flag
Gerd Hoffmann [Thu, 9 Dec 2010 07:39:45 +0000 (08:39 +0100)]
ahci: set dma feature flag

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoCheck if capability enabled in XXX_cmd_data functions.
Kevin O'Connor [Sun, 5 Dec 2010 17:52:02 +0000 (12:52 -0500)]
Check if capability enabled in XXX_cmd_data functions.

Make sure to check if CONFIG_AHCI, CONFIG_ATA, CONFIG_USB_MSC is
enabled in their respective cmd_data functions.  This reduces the
compile size when they are not enabled.

13 years agoRequire a "_cfuncXX_" symbol prefix for inter-mode c function references.
Kevin O'Connor [Sun, 5 Dec 2010 17:38:33 +0000 (12:38 -0500)]
Require a "_cfuncXX_" symbol prefix for inter-mode c function references.

The compiler can get confused when referencing a C function in a
different mode.  (It reasonably assumes that the C function in the
current mode is desired.)  To avoid this compiler confusion, introduce
symbol prefixes (_cfunc16_, _cfunc32flat_, _cfunc32seg_) that must be
used on C function symbols that are referenced from other compilation
modes.

This makes it less likely compiler confusion will occur.  It will also
makes it easier to implement and use vtable like operation structures.

13 years agoadd ahci support
Gerd Hoffmann [Mon, 29 Nov 2010 08:42:13 +0000 (09:42 +0100)]
add ahci support

This patch adds AHCI support to seabios.  Tested with virtual hardware
only (upcoming ahci support in qemu).  Coded by looking at the
recommandations in the intel ahci specs, so I don't expect much trouble
on real hardware.  Tested booting fedora install from hard disk and a
opensuse live iso from cdrom.

[ v2: disable by default           ]
[ v2: add check for malloc failure ]
[ v2: wind up disk write support   ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoata: make helpers available
Gerd Hoffmann [Mon, 29 Nov 2010 08:42:12 +0000 (09:42 +0100)]
ata: make helpers available

Make ata helper functions available outside ata.c, so others (i.e.
upcoming ahci support) can use them.  Prefix them with ata_ to avoid
name clashes.  Also don't hard-code buffer size for the model name.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>