]> xenbits.xensource.com Git - seabios.git/log
seabios.git
11 years agobuild: explicitly set ROM size
Gerd Hoffmann [Tue, 24 Sep 2013 08:06:16 +0000 (10:06 +0200)]
build: explicitly set ROM size

Add a config option to specify the rom size wanted.  Default is zero,
which will automatically figure the needed size.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agobuild: create output dirs in do-kconfig
Gerd Hoffmann [Wed, 25 Sep 2013 07:40:50 +0000 (09:40 +0200)]
build: create output dirs in do-kconfig

Unbreaks parallel builds.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoMinor - update file comments in src/malloc.c.
Kevin O'Connor [Sun, 29 Sep 2013 02:00:49 +0000 (22:00 -0400)]
Minor - update file comments in src/malloc.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoRemove ioport.h; disperse its contents to other header files.
Kevin O'Connor [Thu, 19 Sep 2013 01:41:48 +0000 (21:41 -0400)]
Remove ioport.h; disperse its contents to other header files.

Move the inb(), insb(), etc. code from ioport.h to x86.h.  Move the
PORT_* definitions to their appropriate hardware files.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove dma code to new file hw/dma.c.
Kevin O'Connor [Thu, 19 Sep 2013 01:04:03 +0000 (21:04 -0400)]
Move dma code to new file hw/dma.c.

Move the DMA controller code in resume.c and hw/floppy.c to a new file
hw/dma.c.  This centralizes the DMA controller code into one place.

Also, don't unmask the floppy DRQ during floppy setup - there is no
reason to unmask the DRQ prior to a command being programmed into the
DMA controller.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoRename hw/cmos.h to hw/rtc.h and copy RTC code from clock.c to hw/rtc.c.
Kevin O'Connor [Sun, 15 Sep 2013 06:29:06 +0000 (02:29 -0400)]
Rename hw/cmos.h to hw/rtc.h and copy RTC code from clock.c to hw/rtc.c.

Group the Real Time Clock code into hw/rtc.[ch].

Also, use rtc_read/write/mask function naming (instead of
inb/outb_cmos) to be more consistent with other register accessors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove PIT setup from clock.c to hw/timer.c.
Kevin O'Connor [Sun, 15 Sep 2013 05:50:00 +0000 (01:50 -0400)]
Move PIT setup from clock.c to hw/timer.c.

Move the hardware setup to the hw/timer.c code.  This eliminates the
need for a separate hw/pit.h file with definitions.

Also, move the IRQ counting code (which is dependent on the BDA) from
hw/timer.c to clock.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agobuild: simplify cross builds
Gerd Hoffmann [Fri, 20 Sep 2013 11:29:01 +0000 (13:29 +0200)]
build: simplify cross builds

This patch simplifies seabios cross-builds on !x86 platforms.
It adds a CROSS_PREFIX variable which is used to set CC, LD &
friends to the cross build binaries.  It also moves the common
command definitions up in the Makefile to make sure CC is set
correctly when probing compiler flags using $(call cc-option ...)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agofix buildversion.sh
Gerd Hoffmann [Fri, 13 Sep 2013 12:12:23 +0000 (14:12 +0200)]
fix buildversion.sh

Recent git versions place the submodule git repos into the
.git/modules directory of the toplevel repo.  In that case
.git of the seabios tree isn't a directory, but a regular
file, saying where the gitdir is.

Extent the git check to also allow .git being a regular file,
so buildversion.sh works correctly when called within the qemu
submodule.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agousb: add xhci support
Gerd Hoffmann [Mon, 3 Jun 2013 14:30:18 +0000 (16:30 +0200)]
usb: add xhci support

$subject says all.  Support for usb3 streams is not implemented yet,
otherwise it is fully functional.  Tested all usb devices supported
by qemu (keyboard, storage, usb hubs), except for usb attached scsi
in usb3 mode (which needs streams).

Tested on qemu only, tagged with QEMU_HARDWARE because of that.
Testing with physical hardware to be done.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agousb: add usb_update_pipe()
Gerd Hoffmann [Wed, 21 Aug 2013 11:59:21 +0000 (13:59 +0200)]
usb: add usb_update_pipe()

Preparation for better xhci support: allows to notify host controllers
instead of going through a free+alloc cycle.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agouas: add (temporary) superspeed stopgap
Gerd Hoffmann [Thu, 13 Jun 2013 12:23:08 +0000 (14:23 +0200)]
uas: add (temporary) superspeed stopgap

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoAdd qemu detection to csm
Gerd Hoffmann [Tue, 3 Sep 2013 09:52:13 +0000 (11:52 +0200)]
Add qemu detection to csm

Add a qemu_preinit() call to csm initialization,
so PF_QEMU gets set when running on qemu.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoDrop coreboot qemu detection
Gerd Hoffmann [Tue, 3 Sep 2013 09:41:56 +0000 (11:41 +0200)]
Drop coreboot qemu detection

Not needed any more, the new qemu_detect() function
does the job instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoAdd generic qemu detection
Gerd Hoffmann [Tue, 3 Sep 2013 09:41:01 +0000 (11:41 +0200)]
Add generic qemu detection

This patch adds support for detecting whenever SeaBIOS runs on qemu
or not.  This is done by looking at the northbridge (pci device 00:00.0)
and check the subsystem id.  Most pci devices emulated by qemu -- the
two northbridges i440fx and q35 included -- have a subsystem id of
"1af4:1100".

In case the subsystem ID matches set PF_QEMU, log a message (including
the northbridge found while being at it) and also check for kvm.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoSort the sections of util.h.
Kevin O'Connor [Sun, 15 Sep 2013 04:43:51 +0000 (00:43 -0400)]
Sort the sections of util.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMerge bmp.h, boot.h, jpeg.h, and post.h into util.h.
Kevin O'Connor [Sun, 15 Sep 2013 04:31:17 +0000 (00:31 -0400)]
Merge bmp.h, boot.h, jpeg.h, and post.h into util.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove standard bda type info from biosvar.h to std/bda.h.
Kevin O'Connor [Sun, 15 Sep 2013 04:14:28 +0000 (00:14 -0400)]
Move standard bda type info from biosvar.h to std/bda.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoSplit disk.h into block.h and std/disk.h.
Kevin O'Connor [Sun, 15 Sep 2013 03:57:26 +0000 (23:57 -0400)]
Split disk.h into block.h and std/disk.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove pmm definitions to new file std/pmm.h.
Kevin O'Connor [Sun, 15 Sep 2013 03:09:06 +0000 (23:09 -0400)]
Move pmm definitions to new file std/pmm.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove pnpbios definition to new file std/pnpbios.h.
Kevin O'Connor [Sun, 15 Sep 2013 03:04:08 +0000 (23:04 -0400)]
Move pnpbios definition to new file std/pnpbios.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove fw/acpi.h to std/acpi.h.
Kevin O'Connor [Sun, 15 Sep 2013 02:54:44 +0000 (22:54 -0400)]
Move fw/acpi.h to std/acpi.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove fw/mptable.h to std/mptable.h.
Kevin O'Connor [Sun, 15 Sep 2013 02:48:04 +0000 (22:48 -0400)]
Move fw/mptable.h to std/mptable.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove fw/smbios.h to std/smbios.h.
Kevin O'Connor [Sun, 15 Sep 2013 02:45:05 +0000 (22:45 -0400)]
Move fw/smbios.h to std/smbios.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove fw/LegacyBios.h to std/LegacyBios.h and remove csm.h.
Kevin O'Connor [Sun, 15 Sep 2013 02:38:00 +0000 (22:38 -0400)]
Move fw/LegacyBios.h to std/LegacyBios.h and remove csm.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove vbe.h to std/vbe.h.
Kevin O'Connor [Sun, 15 Sep 2013 02:29:32 +0000 (22:29 -0400)]
Move vbe.h to std/vbe.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove optionroms.h to std/optionrom.h and util.h.
Kevin O'Connor [Sun, 15 Sep 2013 02:27:14 +0000 (22:27 -0400)]
Move optionroms.h to std/optionrom.h and util.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove pirtable definitions from hw/pci.h to std/pirtable.h and util.h.
Kevin O'Connor [Sun, 15 Sep 2013 02:22:28 +0000 (22:22 -0400)]
Move pirtable definitions from hw/pci.h to std/pirtable.h and util.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agobuild: Fix import of gcc dependency files.
Kevin O'Connor [Sun, 15 Sep 2013 02:05:58 +0000 (22:05 -0400)]
build: Fix import of gcc dependency files.

Make sure dependency file import works with new hw/ and fw/
sub-directories.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove definition of struct segoff_s from farptr.h to types.h.
Kevin O'Connor [Sun, 15 Sep 2013 02:03:57 +0000 (22:03 -0400)]
Move definition of struct segoff_s from farptr.h to types.h.

The segoff_s definition is used by a number of header files that would
not otherwise need farptr.h, so move it to a more central location.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove function definitions for output.c from util.h to new file output.h.
Kevin O'Connor [Sun, 15 Sep 2013 01:55:26 +0000 (21:55 -0400)]
Move function definitions for output.c from util.h to new file output.h.

Also, sort the order of include files in the c files.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove malloc code from pmm.c to new files malloc.c and malloc.h.
Kevin O'Connor [Sun, 15 Sep 2013 00:23:54 +0000 (20:23 -0400)]
Move malloc code from pmm.c to new files malloc.c and malloc.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove romfile definitions from util.h to new file romfile.h.
Kevin O'Connor [Sat, 14 Sep 2013 23:37:36 +0000 (19:37 -0400)]
Move romfile definitions from util.h to new file romfile.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove stacks.c definitions from util.h to new file stacks.h.
Kevin O'Connor [Sat, 14 Sep 2013 23:28:55 +0000 (19:28 -0400)]
Move stacks.c definitions from util.h to new file stacks.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agobuild: Perform compile checking on vgasrc code.
Kevin O'Connor [Sun, 15 Sep 2013 05:17:06 +0000 (01:17 -0400)]
build: Perform compile checking on vgasrc code.

Perform a compile check on each individual C file of the vgabios code
similar to the way that the main bios code does individual C compile
tests.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoRename util.c to string.c and introduce string.h.
Kevin O'Connor [Sat, 14 Sep 2013 23:10:40 +0000 (19:10 -0400)]
Rename util.c to string.c and introduce string.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove keyboard calling code from util.c to boot.c.
Kevin O'Connor [Sat, 14 Sep 2013 17:09:27 +0000 (13:09 -0400)]
Move keyboard calling code from util.c to boot.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoSplit x86 specific functions out of util.c/h to new files x86.c/h.
Kevin O'Connor [Sat, 14 Sep 2013 17:01:30 +0000 (13:01 -0400)]
Split x86 specific functions out of util.c/h to new files x86.c/h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoreadme: Minor - fix typo in readme.
Kevin O'Connor [Sat, 14 Sep 2013 16:38:56 +0000 (12:38 -0400)]
readme: Minor - fix typo in readme.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agovgabios: Limit the range of the VBE number of "pages" parameter.
Kevin O'Connor [Fri, 13 Sep 2013 20:21:10 +0000 (16:21 -0400)]
vgabios: Limit the range of the VBE number of "pages" parameter.

Looking at the output of other VGA BIOS implementations, it appears
that the number of available video pages reported is always between 1
and 127.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agovgabios: Rename stdvga_bpp_factor to stdvga_vram_ratio.
Kevin O'Connor [Tue, 10 Sep 2013 14:41:33 +0000 (10:41 -0400)]
vgabios: Rename stdvga_bpp_factor to stdvga_vram_ratio.

Invert the values returned by stdvga_bpp_factor and rename it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agobochsvga: fallback to stdvga if dispi interface isn't present
Gerd Hoffmann [Thu, 5 Sep 2013 08:16:18 +0000 (10:16 +0200)]
bochsvga: fallback to stdvga if dispi interface isn't present

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoahci: add missing check for allocation failure
Gerd Hoffmann [Mon, 9 Sep 2013 14:33:06 +0000 (16:33 +0200)]
ahci: add missing check for allocation failure

Triggerable by creating a virtual machine with
*lots* of ahci controllers and disks.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoREADME: Update readme to note scripts/ directory rename and vgasrc/ directory.
Kevin O'Connor [Fri, 13 Sep 2013 20:29:11 +0000 (16:29 -0400)]
README: Update readme to note scripts/ directory rename and vgasrc/ directory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agobuild: Reorder makefile source list to group like files together.
Kevin O'Connor [Tue, 3 Sep 2013 01:38:57 +0000 (21:38 -0400)]
build: Reorder makefile source list to group like files together.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove code cenetered around firmware initialization to src/fw/
Kevin O'Connor [Tue, 3 Sep 2013 01:25:21 +0000 (21:25 -0400)]
Move code cenetered around firmware initialization to src/fw/

Move many C files from the src/ directory to the new src/fw/ directory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove code centered around specific hardware devices to src/hw/
Kevin O'Connor [Tue, 3 Sep 2013 00:48:46 +0000 (20:48 -0400)]
Move code centered around specific hardware devices to src/hw/

Move many C files from the src/ directory to the new src/hw/ directory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agobuild: Don't use vpath makefile directive.
Kevin O'Connor [Mon, 2 Sep 2013 23:58:48 +0000 (19:58 -0400)]
build: Don't use vpath makefile directive.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoUpdate kconfig to latest version.
Kevin O'Connor [Sat, 24 Aug 2013 17:43:09 +0000 (13:43 -0400)]
Update kconfig to latest version.

Update kconfig (from Linux v2.6.38-rc2) to the latest version (from
Linux v3.11-rc6).

This is a copy of kconfig from Linux with only the changes necessary
to work with the SeaBIOS build (the equivalent of the earlier SeaBIOS
0da7bfdf commit) and the changes necessary to always emit symbols
(SeaBIOS b623e7c5 commit).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoRename tools/ directory to scripts/ directory.
Kevin O'Connor [Sat, 17 Aug 2013 14:13:14 +0000 (10:13 -0400)]
Rename tools/ directory to scripts/ directory.

It's common for other projects (eg, QEMU, Linux) to put build scripts
into a "scripts/" directory.  There's no reason for SeaBIOS to be
different, so rename the "tools/" directory to "scripts/".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMinor - simplify rom_reserve().
Kevin O'Connor [Thu, 15 Aug 2013 03:37:56 +0000 (23:37 -0400)]
Minor - simplify rom_reserve().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMinor - no need to declare MaxCountCPUs as VARFSEG.
Kevin O'Connor [Sat, 10 Aug 2013 14:37:50 +0000 (10:37 -0400)]
Minor - no need to declare MaxCountCPUs as VARFSEG.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoAdd config option to support memory allocations in 9-segment.
Kevin O'Connor [Thu, 8 Aug 2013 03:03:47 +0000 (23:03 -0400)]
Add config option to support memory allocations in 9-segment.

Internal "low memory" allocations are currently placed in the UMB
region (0xc0000-0xf0000).  However, there have been reports of some
real machines that do not support DMA to this area of memory.  So, add
a compile time config option (off by default) to support placing all
internal low-memory allocations at the end of the 640K real-memory
area (0x90000-0xa0000).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMinor cleanups to smm assembler.
Kevin O'Connor [Sat, 10 Aug 2013 15:39:14 +0000 (11:39 -0400)]
Minor cleanups to smm assembler.

Use size prefixes on assembler instructions.

Split the relocation smm handler into a separate section from the main
runtime smm handler.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoapm: fix shutdown
Gerd Hoffmann [Thu, 25 Jul 2013 07:47:18 +0000 (09:47 +0200)]
apm: fix shutdown

Qemu commit 9ee59f3 removed the bochs bios apm interface emulation at
port 0x8900.  That broke poweroff via APM.  Fix it by powering off the
machine using the acpi pm control register.

Old code is left in, so seabios wil try both poweroff methods.  Cleaning
that eventually up is left for another patch, after checking it isn't
needed.  Qemu never implemented "Standby" and "Suspend", only
"Shutdown", so it looks like there might be non-qemu use cases (bochs
probably).

Easiest way to test this is the syslinux poweroff module; modern linux
distros usually have CONFIG_APM turned off.

Reported-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoacpi_extract.py: document DEVICE directives
Michael S. Tsirkin [Thu, 1 Aug 2013 16:05:09 +0000 (19:05 +0300)]
acpi_extract.py: document DEVICE directives

commit 2b568ebb20b08c7881d976b5bc9f59a425bae5e6
    acpi_extract: detect DeviceOp
added new directives to acpi_extract.py, but didn't
document them.
Add documentation at top of file.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
11 years agoSupport custom boot menu prompt and custom boot menu key.
Kevin O'Connor [Fri, 2 Aug 2013 18:13:50 +0000 (14:13 -0400)]
Support custom boot menu prompt and custom boot menu key.

Allow configuration of the boot menu prompt and boot menu key (via the
romfile interface).  Some machines don't have an F12 key, so make this
configurable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoFix bug in CBFS file walking with compressed files.
Kevin O'Connor [Fri, 2 Aug 2013 18:12:09 +0000 (14:12 -0400)]
Fix bug in CBFS file walking with compressed files.

The file walking code was incorrectly using the uncompressed file size
when searching for the next file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoAdd missing mathcp_setup() call to CSM code.
Kevin O'Connor [Mon, 22 Jul 2013 00:01:07 +0000 (20:01 -0400)]
Add missing mathcp_setup() call to CSM code.

It looks like when mathcp_setup() got moved from interface_init() to
platform_hardware_setup() in 3a735baa the corresponding change was not
made to the CSM code.  Update it now.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoDefault unused UMB areas to be read-only.
Kevin O'Connor [Sun, 21 Jul 2013 20:38:18 +0000 (16:38 -0400)]
Default unused UMB areas to be read-only.

It looks like MSDOS 6 wants the UMB area to be read-only in order for
it to use it.  FreeDOS doesn't care, but it always maps a page from
high mem when it does use the area.  So, add an option to control
whether unused UMB ram is marked read-only and default it to read-only
as that seems to be more compatible.

This also fixes an off-by-one bug in the shadow range checking code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoUnify pmtimer_read() and pittimer_read() code.
Kevin O'Connor [Sat, 20 Jul 2013 23:09:07 +0000 (19:09 -0400)]
Unify pmtimer_read() and pittimer_read() code.

These two functions both need to add in extra high bits to their
timers, and this code is the bulk of these functions.  Factor out the
duplicate code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoSeparate out timer setup code.
Kevin O'Connor [Sat, 20 Jul 2013 22:39:37 +0000 (18:39 -0400)]
Separate out timer setup code.

Split timer_setup() - put the tsc calibration code in its own
function.

Group all the timer setup functions together.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoRename check_tsc() (and similar) to timer_check() and use u32.
Kevin O'Connor [Sat, 20 Jul 2013 22:22:57 +0000 (18:22 -0400)]
Rename check_tsc() (and similar) to timer_check() and use u32.

Rename the check_tsc() function to timer_check().  The CPU TSC is
often not the basis of the timer, so use a more appropriate name.

Convert all callers that were using u64 for the timers to use u32.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoRename check_timer() function (and similar) to irqtimer_check().
Kevin O'Connor [Sat, 20 Jul 2013 22:07:50 +0000 (18:07 -0400)]
Rename check_timer() function (and similar) to irqtimer_check().

Rename functions to be more consistent and so they are not confused
with the normal timer functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoShift CPU TSC down to reduce need for 64bit variables.
Kevin O'Connor [Sat, 20 Jul 2013 21:06:51 +0000 (17:06 -0400)]
Shift CPU TSC down to reduce need for 64bit variables.

The time-stamp-counter has a higher accuracy than is needed in
SeaBIOS.  Down shift it to ensure it safely fits in a 32bit variable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoRename cpu_khz to TimerKHz.
Kevin O'Connor [Sat, 20 Jul 2013 21:05:24 +0000 (17:05 -0400)]
Rename cpu_khz to TimerKHz.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoImprove accuracy of internal timers.
Kevin O'Connor [Sat, 20 Jul 2013 17:06:35 +0000 (13:06 -0400)]
Improve accuracy of internal timers.

The TICKS_PER_DAY setting is a bios standard and needs to be 1573040
for compatibility.  However, there are actually ~1573042.24 ticks in a
day.  So, only use TICKS_PER_DAY when working with the BDA
timer_counter - not when calculating any internal times.

The PIT hz is actually 143181800 / 12 (~1193181.667).  This can be
accurately encoded as PMTIMER hz / 3.  Because the PIT hz is usually
multiplied and divided by other numbers, we can use the PMTIMER hz and
defer the division by 3 to improve accuracy.

When doing division for delay time calculations, always round up the
division so the delay is never less than the requested time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoAdd helper functions to convert timer irqs to milliseconds.
Kevin O'Connor [Sat, 20 Jul 2013 16:08:48 +0000 (12:08 -0400)]
Add helper functions to convert timer irqs to milliseconds.

Add ticks_to_ms() and ticks_from_ms() helpers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoDon't pass khz to pmtimer_setup - it's always PM_TIMER_FREQUENCY.
Kevin O'Connor [Sat, 20 Jul 2013 15:06:51 +0000 (11:06 -0400)]
Don't pass khz to pmtimer_setup - it's always PM_TIMER_FREQUENCY.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMove internal timer code from clock.c to a new file timer.c.
Kevin O'Connor [Sat, 20 Jul 2013 14:51:58 +0000 (10:51 -0400)]
Move internal timer code from clock.c to a new file timer.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoacpi: sync FADT flags from PIIX4 to Q35
Michael S. Tsirkin [Wed, 17 Jul 2013 05:14:53 +0000 (08:14 +0300)]
acpi: sync FADT flags from PIIX4 to Q35

The following commits updated the FADT flags for PIIX4:
commit c7be281b3be0f2013aa4b5d5f400981a1adb6e63
    Drop FIX_RTC flag from FADT.
commit a4e2b9adbba95c2d783761e84444bbb3c8d6107b
    enable USE_PLATFORM_CLOCK bit in FADT flags

Q35 support was originally written before these commits in seabios, PIIX
got updated, Q35 didn't.  QEMU uses the same clock for both so there's
no reason for these bits to differ.  Sync them up.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
11 years agoPIC code cleanups.
Kevin O'Connor [Sun, 14 Jul 2013 19:07:21 +0000 (15:07 -0400)]
PIC code cleanups.

Preface PIC functions with a pic_ to provide a more consistent
naming.

Convert the irqmask code to a more consistent
pic_irqmask_read/write/mask form.

Move code from pic.h to pic.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoUpdate README to include info on VARLOW variables.
Kevin O'Connor [Sun, 14 Jul 2013 18:40:19 +0000 (14:40 -0400)]
Update README to include info on VARLOW variables.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoAdd CONFIG_DEBUG_COREBOOT config option
Gerd Hoffmann [Tue, 25 Jun 2013 13:45:30 +0000 (15:45 +0200)]
Add CONFIG_DEBUG_COREBOOT config option

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agocoreboot: add cbmem console support
Gerd Hoffmann [Mon, 24 Jun 2013 09:24:57 +0000 (11:24 +0200)]
coreboot: add cbmem console support

Add support for logging to the coreboot cbmem console.
Limitation: only supported in 32bit mode.  Use 'cbmem -c'
to see the logs (coreboot and seabios) after bootup.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoFix USB EHCI detection that was broken in hlist conversion of PCIDevices.
Kevin O'Connor [Sun, 14 Jul 2013 17:55:52 +0000 (13:55 -0400)]
Fix USB EHCI detection that was broken in hlist conversion of PCIDevices.

Make sure the PCI device list is ordered in bus order.

Don't iterate past the end of the list when detecting EHCI devices.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMinor - remove debugging dprintf added to pciinit.c. rel-1.7.3
Kevin O'Connor [Fri, 14 Jun 2013 01:35:51 +0000 (21:35 -0400)]
Minor - remove debugging dprintf added to pciinit.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoAnother fix for hlist_for_each_entry_safe.
Kevin O'Connor [Fri, 14 Jun 2013 01:24:14 +0000 (21:24 -0400)]
Another fix for hlist_for_each_entry_safe.

Although the previous patch does fix hlist_for_each_entry_safe for the
common case, it doesn't work correctly when deleting the current
node.  To fix this, introduce two macros - hlist_for_each_entry_safe
for iterating through a list that can be modified, and
hlist_for_each_entry_pprev for those users that only need access to
the "pprev" pointer.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agomake qemu_cfg_init depend on QEMU_HARDWARE instead of QEMU
Kevin O'Connor [Fri, 14 Jun 2013 00:04:31 +0000 (20:04 -0400)]
make qemu_cfg_init depend on QEMU_HARDWARE instead of QEMU

Gets qemu features like direct kernel boot and boot
ordering going when seabios runs on coreboot.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agotweak coreboot qemu detection
Gerd Hoffmann [Thu, 13 Jun 2013 05:42:58 +0000 (07:42 +0200)]
tweak coreboot qemu detection

I have patches for coreboot in the queue adding q35 support there,
which will change the mainboard names (adding the detected chipset).
Make SeaBIOS check the mainboard name starts with "QEMU" instead of
doing a full string match to handle this.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoConvert pciinit.c to use standard list manipulation code.
Kevin O'Connor [Sun, 9 Jun 2013 01:51:46 +0000 (21:51 -0400)]
Convert pciinit.c to use standard list manipulation code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoFix error in hlist_for_each_entry_safe macro.
Kevin O'Connor [Fri, 14 Jun 2013 00:44:09 +0000 (20:44 -0400)]
Fix error in hlist_for_each_entry_safe macro.

Fix broken macro - it did not work correctly at all.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoRevert "Convert pciinit.c to use standard list manipulation code."
Kevin O'Connor [Thu, 13 Jun 2013 12:42:29 +0000 (08:42 -0400)]
Revert "Convert pciinit.c to use standard list manipulation code."

This reverts commit aab42152881dc62b37f1833e79cbdb3dfa51603b.

11 years agocoreboot: add qemu detection
Gerd Hoffmann [Mon, 3 Jun 2013 06:06:27 +0000 (08:06 +0200)]
coreboot: add qemu detection

11 years agoconfig: allow DEBUG_IO for !QEMU
Gerd Hoffmann [Wed, 5 Jun 2013 07:37:24 +0000 (09:37 +0200)]
config: allow DEBUG_IO for !QEMU

Make DEBUG_IO depend on QEMU_HARDWARE instead of QEMU, so
it can be enabled for seabios builds running indirectly
(coreboot, csm) on qemu.

Add runtime check for PF_QEMU to debug port console to make
sure we don't poke on random ports on physical hardware.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoConvert PCIDevices list to use standard list manipultion code.
Kevin O'Connor [Sun, 9 Jun 2013 01:53:36 +0000 (21:53 -0400)]
Convert PCIDevices list to use standard list manipultion code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoConvert pciinit.c to use standard list manipulation code.
Kevin O'Connor [Sun, 9 Jun 2013 01:51:46 +0000 (21:51 -0400)]
Convert pciinit.c to use standard list manipulation code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoConvert boot.c to use standard list manipulation code.
Kevin O'Connor [Sun, 9 Jun 2013 01:50:53 +0000 (21:50 -0400)]
Convert boot.c to use standard list manipulation code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoConvert stacks.c to use standard list manipulation code.
Kevin O'Connor [Sun, 9 Jun 2013 01:50:15 +0000 (21:50 -0400)]
Convert stacks.c to use standard list manipulation code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoIntroduce helper function have_threads() in stacks.c.
Kevin O'Connor [Sun, 9 Jun 2013 02:11:07 +0000 (22:11 -0400)]
Introduce helper function have_threads() in stacks.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMinor - relocate code in stacks.c to keep low-level thread code together.
Kevin O'Connor [Sun, 9 Jun 2013 02:05:19 +0000 (22:05 -0400)]
Minor - relocate code in stacks.c to keep low-level thread code together.

Just code movement - no actual code changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoIntroduce and convert pmm code to use standard list helpers.
Kevin O'Connor [Sun, 9 Jun 2013 01:49:12 +0000 (21:49 -0400)]
Introduce and convert pmm code to use standard list helpers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMinor - move "tracked memory alloc" code in pmm.c.
Kevin O'Connor [Sun, 2 Jun 2013 17:09:30 +0000 (13:09 -0400)]
Minor - move "tracked memory alloc" code in pmm.c.

Move the "pmm_malloc" code closer to the low level alloc functions it
calls.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
11 years agoMinor - explicitly close files in buildrom.py.
Kevin O'Connor [Tue, 21 May 2013 01:39:56 +0000 (21:39 -0400)]
Minor - explicitly close files in buildrom.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoAdd pvpanic device driver
Hu Tao [Fri, 5 Apr 2013 07:17:51 +0000 (15:17 +0800)]
Add pvpanic device driver

pvpanic device is used to notify host(qemu) when guest panic happens.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
12 years agoacpi: Use cpu_to_leXX() consistently.
Kevin O'Connor [Sat, 30 Mar 2013 14:18:47 +0000 (10:18 -0400)]
acpi: Use cpu_to_leXX() consistently.

Audit the ACPI code and ensure that all multi-byte fields do proper
byte swabbing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoacpi: Remove dead code with descriptions of bit flags.
Kevin O'Connor [Sat, 30 Mar 2013 13:40:07 +0000 (09:40 -0400)]
acpi: Remove dead code with descriptions of bit flags.

Remove dead code from acpi table definitions - the ACPI specification
is the best place to get descriptions of the fields and tables anyway.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoacpi: Move ACPI table definitions from acpi.c to acpi.h.
Kevin O'Connor [Sat, 30 Mar 2013 13:34:10 +0000 (09:34 -0400)]
acpi: Move ACPI table definitions from acpi.c to acpi.h.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoUse container_of on romfile entries.
Kevin O'Connor [Sat, 30 Mar 2013 13:12:11 +0000 (09:12 -0400)]
Use container_of on romfile entries.

Create cbfs and fw_cfg specific romfile_s wrappers instead of using
private variables directly in romfile_s.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoCleanup QEMU_CFG_NUMA fw_cfg processing - split into two romfile entries.
Kevin O'Connor [Sat, 23 Mar 2013 15:38:45 +0000 (11:38 -0400)]
Cleanup QEMU_CFG_NUMA fw_cfg processing - split into two romfile entries.

The QEMU_CFG_NUMA fw_cfg entry is actually two separate tables in one
fw_cfg entry - a table for cpu affinity and a table for the memory
map.  Create two romfile entries to make that more clear.

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