seabios.git
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>
12 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>
13 years agoutil: add memset_fl()
Gerd Hoffmann [Mon, 29 Nov 2010 08:42:11 +0000 (09:42 +0100)]
util: add memset_fl()

13 years agopci: add helper functions for mmio bar access from real mode.
Gerd Hoffmann [Mon, 29 Nov 2010 08:42:10 +0000 (09:42 +0100)]
pci: add helper functions for mmio bar access from real mode.

This patch adds helper pci_readl and pci_writel which can be used
to access pci mmio bars from real mode.  They work in 32bit mode
too.  ahci support needs this, also ohci for bulk transfers, and
probably more devices in the future.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoEnhance call32() to pass a parameter to called function.
Kevin O'Connor [Thu, 25 Nov 2010 14:17:31 +0000 (09:17 -0500)]
Enhance call32() to pass a parameter to called function.

Support passing a parameter to the 32bit function, as well as
returning the result of the function back to the 16bit code.

Also, make call32 available outside of stacks.c.

13 years agoDon't pass return address to transition(32,16,16big) on stack.
Kevin O'Connor [Thu, 25 Nov 2010 13:52:50 +0000 (08:52 -0500)]
Don't pass return address to transition(32,16,16big) on stack.

It's difficult to have a uniform view of the stack when transition
modes, so pass the return address in a register.  As a result, the
transition functions only access memory via the %cs selector now.

13 years agopciinit: use pci_region functions.
Isaku Yamahata [Thu, 28 Oct 2010 06:54:36 +0000 (15:54 +0900)]
pciinit: use pci_region functions.

This patch cleans up pci region allocation with pci_region.
Now it is aware of overflow.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
13 years agopci: introduce pci_region to manage pci io/memory/prefmemory regions.
Isaku Yamahata [Thu, 28 Oct 2010 06:54:35 +0000 (15:54 +0900)]
pci: introduce pci_region to manage pci io/memory/prefmemory regions.

This patch adds helper functions to manage pci area.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
13 years agomark irq9 active high in DSDT
Kevin O'Connor [Thu, 21 Oct 2010 01:59:11 +0000 (21:59 -0400)]
mark irq9 active high in DSDT

In PIIX4 SCI (irq9) is active high. Seabios marks it so in interrupt
override table, but some OSes (FreeBSD) require the same information to
be present in DSDT too. Make it so.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoReport meaningful error if pyserial not present in tools/readserial.py
Kevin O'Connor [Mon, 18 Oct 2010 01:38:38 +0000 (21:38 -0400)]
Report meaningful error if pyserial not present in tools/readserial.py

13 years agoShow size of non-relocatable runtime code during build.
Kevin O'Connor [Sun, 26 Sep 2010 22:32:13 +0000 (18:32 -0400)]
Show size of non-relocatable runtime code during build.

13 years agoCleanup - it's no longer necessary to manually reset global variables.
Kevin O'Connor [Sat, 25 Sep 2010 18:53:15 +0000 (14:53 -0400)]
Cleanup - it's no longer necessary to manually reset global variables.

Now that a soft-reboot forces a hard-reboot, it is no longer necessary
to manually reset global variables.

13 years agoAllow rom to grow to 256K.
Kevin O'Connor [Sat, 25 Sep 2010 16:48:43 +0000 (12:48 -0400)]
Allow rom to grow to 256K.

Enable rom size to be over 128K.

Apparently, only the first 128K of the rom are mirrored to the
0xc0000-0xfffff area under qemu, so make sure to copy the rom (via
make_bios_writable) in the non-init part of the startup code.  This
ensure the copy code is itself available.

13 years agoFix typo preventing relocated space from being used for option roms.
Kevin O'Connor [Sat, 25 Sep 2010 16:46:38 +0000 (12:46 -0400)]
Fix typo preventing relocated space from being used for option roms.

13 years agofix virtio-blk failure after reboot
Gleb Natapov [Wed, 15 Sep 2010 16:31:44 +0000 (18:31 +0200)]
fix virtio-blk failure after reboot

vring_virtqueue should be zeroed otherwise old values will be reused
after reboot.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
13 years agoAdd a debug method to AML code.
Kevin O'Connor [Mon, 20 Sep 2010 02:13:18 +0000 (22:13 -0400)]
Add a debug method to AML code.

Add DBUG() method to AML - it can write output to the standard qemu
bios debug port (port 0x402).

13 years agoWarn that ohci bulk is not supported.
Kevin O'Connor [Mon, 20 Sep 2010 02:10:08 +0000 (22:10 -0400)]
Warn that ohci bulk is not supported.

Print a meaningful warning message when trying to use OHCI bulk.

13 years agoEnable optionroms to use freed space due to CONFIG_RELOCATE_INIT.
Kevin O'Connor [Thu, 16 Sep 2010 02:06:19 +0000 (22:06 -0400)]
Enable optionroms to use freed space due to CONFIG_RELOCATE_INIT.

The space in the e-segment is available for option roms after
relocating the init code.

Also, zero all of the option rom space when !CONFIG_OPTIONROMS_DEPLOYED.

13 years agoMove the 32bit init code to high memory at runtime.
Kevin O'Connor [Sat, 25 Sep 2010 15:34:06 +0000 (11:34 -0400)]
Move the 32bit init code to high memory at runtime.

Add support for moving the 32bit init code out of the e/f-segments and
into temporary ram.  Update the relocations in the code so that it can
live at its new address.

This frees up memory for other uses in the e/f segments.

13 years agoMove init code from _start() to post().
Kevin O'Connor [Thu, 16 Sep 2010 01:59:11 +0000 (21:59 -0400)]
Move init code from _start() to post().

Move the shadow calls from _start() to post() - this ensures all the
one time init code is in post().

Also, reorg post so that malloc setup is done before ivt/bda/ebda
setup.

This is in preparation for relocating the 32bit flat init code.

13 years agoAdd memalign_tmp() helper function.
Kevin O'Connor [Wed, 15 Sep 2010 04:25:32 +0000 (00:25 -0400)]
Add memalign_tmp() helper function.

13 years agoTry to hard-reboot on rerun of post even on emulators.
Kevin O'Connor [Thu, 16 Sep 2010 01:48:16 +0000 (21:48 -0400)]
Try to hard-reboot on rerun of post even on emulators.

Extend the hard-reboot logic to qemu and kvm.  On qemu, a reboot will
not reset the memory settings for 0xc0000-0xfffff, so copy that memory
area manually before rebooting.  Unfortunately, kvm does not keep a
pristine copy of the BIOS at 0xffff0000, so detect that case and
shutdown the machine.

13 years agoDon't do shadow copying of optionroms when CONFIG_OPTIONROMS_DEPLOYED.
Kevin O'Connor [Tue, 14 Sep 2010 01:19:27 +0000 (21:19 -0400)]
Don't do shadow copying of optionroms when CONFIG_OPTIONROMS_DEPLOYED.

When CONFIG_OPTIONROMS_DEPLOYED is set, there is no need to copy the
0xc0000-0xf0000 space around - SeaBIOS ignores what's there when it
that mode.

13 years agoTry to hard-reboot processor on rerun of post under coreboot.
Kevin O'Connor [Tue, 14 Sep 2010 00:22:07 +0000 (20:22 -0400)]
Try to hard-reboot processor on rerun of post under coreboot.

Add several methods for rebooting a processor.

Detect a rerun of POST under coreboot and attempt to reboot the
processor.

13 years agoEnhance build to emit relocation information.
Kevin O'Connor [Wed, 15 Sep 2010 04:26:19 +0000 (00:26 -0400)]
Enhance build to emit relocation information.

Add support for determining which relocations need to be adjusted to
relocate the "32bit flat init" code.  Place those relocations in the
output object.

13 years agoSeparate out init code from the rest of the 32bit flat code.
Kevin O'Connor [Thu, 16 Sep 2010 01:38:16 +0000 (21:38 -0400)]
Separate out init code from the rest of the 32bit flat code.

Enhance tools/layoutrom.py code so that it can detect which sections
are used from the "32bit flat" runtime code.  All other "32bit flat"
sections can then be assured to be initialization code only.

This is in preparation for relocating the 32bit initialization code.

13 years agoModify tools/layoutrom.py to use classes instead of tuples.
Kevin O'Connor [Thu, 16 Sep 2010 01:28:31 +0000 (21:28 -0400)]
Modify tools/layoutrom.py to use classes instead of tuples.

Using classes and updating the values in the classes makes the code
easier to understand.