]> xenbits.xensource.com Git - seabios.git/log
seabios.git
12 years agoPOST: Reorganize post entry and "preinit" functions.
Kevin O'Connor [Mon, 21 Jan 2013 16:38:49 +0000 (11:38 -0500)]
POST: Reorganize post entry and "preinit" functions.

Unlocking ram in handle_post() is tricky and only needed under qemu.
Separate out that logic from the coreboot/xen paths by invoking
handle_elf_post separately.  This simplifies both the qemu and
non-qemu code paths.

Also, organize all the "pre-init" functions into one section of the
file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoPOST: Move QEMU specific ramsize and BIOS table setup to paravirt.c.
Kevin O'Connor [Mon, 21 Jan 2013 07:32:48 +0000 (02:32 -0500)]
POST: Move QEMU specific ramsize and BIOS table setup to paravirt.c.

Don't clutter post.c with the gory details of QEMU memory sizing and
BIOS table creation.  Instead, move that code to paravirt.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoAdd CSM support
David Woodhouse [Sat, 26 Jan 2013 01:46:25 +0000 (19:46 -0600)]
Add CSM support

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoEnsure exported symbols are visible in the final link
Kevin O'Connor [Wed, 6 Feb 2013 03:36:13 +0000 (22:36 -0500)]
Ensure exported symbols are visible in the final link

I'm about to introduce some post-processing in checkrom.py which will want
access to public symbols. So let's make sure they're defined in the final
link even if they're *not* cross-referenced from a different code section.
build: Define 16bit exported symbols in final rom.o object.

Based on patch by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoAdd pic_save_mask() and pic_restore_mask() functions
David Woodhouse [Tue, 5 Feb 2013 16:37:27 +0000 (16:37 +0000)]
Add pic_save_mask() and pic_restore_mask() functions

CSM will (unfortunately) need to use these.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoComplete and checksum EFI_COMPATIBILITY16_TABLE at build time
David Woodhouse [Thu, 17 Jan 2013 21:23:46 +0000 (21:23 +0000)]
Complete and checksum EFI_COMPATIBILITY16_TABLE at build time

GCC, for reasons unknown, will refuse to compile code such as
   extern int bar;
   uint16_t foo = &bar;

The assembler would happily emit a R_386_16 relocation for this if asked
nicely, and all would be well. But instead, GCC complains about the
initialiser not being constant.

So we tend to fill in 16-bit offsets at run-time, which is only
moderately inefficient. But for the CSM table used by EFI, it doesn't
work. We need the offset to be present in the *image*, before a line of
our own code has been run. Likewise the checksum.

This special-cases the table and entry point in checkrom.py rather than
attempting to do something generic. I did have a functional generic
implementation which could be invoked from csm.c along the lines of
 CHECKSUM(csm_compat_table, TableChecksum)
... and which would emit the required offsetof(typeof(\1), \2) into
a special data section which was elided from the final build but parsed
by 'objdump -s' and the location of the table to be checksummed was
inferred from the name of the *variable* that got put into that special
section... seriously, it's better just to special-case it.

It was baroque enough just for the checksums, and filling in the entry
point which required access to *two* symbols was probably going to involve
emitting a *string* into that special build-data section. It had to die.

So yes, we have hard-coded symbol names, and even magic numbers in the
python script for table offsets etc., but that's because this is an ABI.
It doesn't change, and neither do any of the other tables that we might
now consider filling at build time just to avoid having to spend time
on doing so at runtime.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoImport LegacyBios.h from OVMF
David Woodhouse [Thu, 17 Jan 2013 21:55:21 +0000 (21:55 +0000)]
Import LegacyBios.h from OVMF

This is under a BSD licence so it's fine to import directly.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoExport copy_smbios() from biostables.c
David Woodhouse [Sat, 26 Jan 2013 01:33:58 +0000 (19:33 -0600)]
Export copy_smbios() from biostables.c

Yes, copy_table() would invoke it, but CSM will *only* use it for SMBIOS
tables and however much we trick the compiler by gratuitously checking
the table signature right before calling copy_table(), it still doesn't
seem to notice that fact. And emits code for all the other three cases
we don't care about.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoExport callrom() for CSM to use
David Woodhouse [Sat, 26 Jan 2013 01:31:47 +0000 (19:31 -0600)]
Export callrom() for CSM to use

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agopost: Export functions which will be used individually by CSM
David Woodhouse [Sat, 26 Jan 2013 01:26:48 +0000 (19:26 -0600)]
post: Export functions which will be used individually by CSM

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoSupport calling a function other than maininit() from reloc_preinit().
Kevin O'Connor [Wed, 6 Feb 2013 01:57:10 +0000 (20:57 -0500)]
Support calling a function other than maininit() from reloc_preinit().

Pass a function pointer to reloc_preinit() instead of always running
maininit() after relocating the init code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoFix rebase error in commit 8a0a972f that broke LOWMEM variables.
Kevin O'Connor [Thu, 7 Feb 2013 05:06:18 +0000 (00:06 -0500)]
Fix rebase error in commit 8a0a972f that broke LOWMEM variables.

Due to a rebase error, commit 8a0a972f caused LOWMEM variables to not
be initialized correctly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoClean up #if in pirtable.c. CONFIG_PIRTABLE can't be set if CONFIG_COREBOOT is
David Woodhouse [Tue, 5 Feb 2013 16:01:31 +0000 (16:01 +0000)]
Clean up #if in pirtable.c. CONFIG_PIRTABLE can't be set if CONFIG_COREBOOT is

CONFIG_PIRTABLE, along with various other BIOS tables, is only selectable
if CONFIG_QEMU is selected. QEMU/COREBOOT/CSM is a choice, so you can't
enable CONFIG_PIRTABLE if you've selected COREBOOT or CSM. So kill the
excessive #if check for COREBOOT.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
12 years agoAdd macros for pushing and popping struct bregs
David Woodhouse [Sat, 19 Jan 2013 17:34:28 +0000 (17:34 +0000)]
Add macros for pushing and popping struct bregs

I want to do this too, and can't bring myself to introduce yet another copy.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Marc Jones <marc.jones@se-eng.com>
12 years agoPOST: Reorganize post init functions for better grouping and reusability.
Kevin O'Connor [Mon, 21 Jan 2013 06:53:31 +0000 (01:53 -0500)]
POST: Reorganize post init functions for better grouping and reusability.

Place the "interface initialization" functions together, "platform
hardware initialization" functions together, and "prepare to boot"
functions together.  This may also be useful for using SeaBIOS as a
CSM.

This slightly changes the order of some function invocations, but
should otherwise not change code behavior at all.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoNormalize POST initialization function name suffixes.
Kevin O'Connor [Mon, 21 Jan 2013 06:14:12 +0000 (01:14 -0500)]
Normalize POST initialization function name suffixes.

The POST phase has to invoke many initialization functions, and these
functions can have complex inter-dependencies.  Try to categorize the
functions into 4 classes:

preinit - functions called very early in POST where function ordering
    is very important and the code has limited access to other
    interfaces.

init - functions that initialize internal interfaces and standard
    external interfaces.  This code is generally not dependent on
    particular hardware and typically does not communicate directly
    with any hardware devices.

setup - functions which access hardware or are dependent on particular
    hardware or platform devices.

prepboot - functions that finalize internal interfaces and that
    prepare for the boot phase.

This patch attempts to normalize the suffixes - functions that used
_init(), _setup(), _finalize(), or similar that did not follow the
above pattern were renamed.  Other than function name changes, there
should be no code impact to this patch.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoMinor: Update README - variable changes are now reset on soft-reboots.
Kevin O'Connor [Sun, 20 Jan 2013 15:46:51 +0000 (10:46 -0500)]
Minor: Update README - variable changes are now reset on soft-reboots.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agopmm: Use 'struct segoff_s' in pmm header.
Kevin O'Connor [Sun, 20 Jan 2013 15:43:54 +0000 (10:43 -0500)]
pmm: Use 'struct segoff_s' in pmm header.

Minor cleanup - use 'struct segoff_s' instead of a manual
segment/offset pair.

Also, while at it, define the header signature at compile time instead
of at run-time.  (Defining at run-time is a hold over from when
variable changes were persistent across soft-reboots.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: implement AX=1120H..1124H functions rel-1.7.2
Paolo Bonzini [Thu, 10 Jan 2013 12:41:36 +0000 (13:41 +0100)]
vgabios: implement AX=1120H..1124H functions

These function only have to set INT 1Fh and INT 43h, and set
the BDA height + number of rows.

I could not find out whether AX=1120h should also set the character
height to 8.  I think not, because INT 43h might still point to
14- or 16-pixel high characters and in this case INT 1Fh will not
be used at all.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoboot: Support "halt" in the boot order to prevent default boot attempts.
Kevin O'Connor [Sat, 12 Jan 2013 21:36:11 +0000 (16:36 -0500)]
boot: Support "halt" in the boot order to prevent default boot attempts.

Current seabios will attempt to boot from both configured devices and
a list of default devices.  Sometimes it is desirable to only attempt
to boot from the configured devices and not from any of the default
devices.  This patch adds support for a "HALT" item in the "bootorder"
file - its presence will prevent SeaBIOS from attempting any default
boot actions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Amos Kong <akong@redhat.com>
12 years agomegasas: Invert PCI device selection
Hannes Reinecke [Wed, 19 Dec 2012 14:12:47 +0000 (15:12 +0100)]
megasas: Invert PCI device selection

Stupid typo from my side ...

Signed-off-by: Hannes Reinecke <hare@suse.de>
12 years agoMinor: Separate UUID display from F12 boot prompt.
Kevin O'Connor [Sat, 22 Dec 2012 03:52:50 +0000 (22:52 -0500)]
Minor: Separate UUID display from F12 boot prompt.

Place the extra newline as part of the F12 prompt instead of the
SeaBIOS version banner so that a UUID report (when present) is still
visually separated from the boot menu prompt.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agodisplay_uuid(): fix incomplete check after the loop
Laszlo Ersek [Tue, 18 Dec 2012 04:11:39 +0000 (05:11 +0100)]
display_uuid(): fix incomplete check after the loop

In the v2->v3 change of what would become commit 37676f83
<http://www.seabios.org/pipermail/seabios/2012-December/005166.html>, the
defense against an initial "addr > end" condition ("wraparound") was
erroneously loosened.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
12 years agoacpi: Use prt_slot() macro to describe irq pins of first PCI device.
Kevin O'Connor [Sat, 15 Dec 2012 14:29:43 +0000 (09:29 -0500)]
acpi: Use prt_slot() macro to describe irq pins of first PCI device.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoacpi: reintroduce LNKS
Paolo Bonzini [Thu, 13 Dec 2012 07:42:02 +0000 (08:42 +0100)]
acpi: reintroduce LNKS

Commit 4540409 (acpi: LNKS is not needed, 2012-08-07) removed LNKS because
it basically worked by chance: _CRS returns something else then one of the
possible resources from _PRS, _DIS would not really disable the interrupt,
and there was no _SRS method.  It just happened to work because all OSes
have some kind of special-casing for SCI.

Unfortunately, the code after the patch is also against the spec, and it
breaks FreeBSD because it treats IRQ 9 polarity as active low without
the Interrupt() entry.  Actually, numeric _PRT entries are handled the
same in Linux and FreeBSD (as active-low).  However, under Linux it just
happens to trigger another special casing of SCI which sets SCI up from
its override entry in the MADT, ignoring the DSDT completely.

This patch adds back the LNKS, but without using the PIIX register for
LNKA in its methods.

Tested-by: Luigi Rizzo <rizzo@iet.unipi.it>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agomaininit(): print machine UUID under seabios version message
Laszlo Ersek [Fri, 14 Dec 2012 11:59:39 +0000 (12:59 +0100)]
maininit(): print machine UUID under seabios version message

There are users who would like to see the UUID at startup, and it probably
won't bother others.

Related RHBZ: 876250.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
12 years agoAdd compile checking phase to build.
Kevin O'Connor [Wed, 12 Dec 2012 03:40:16 +0000 (22:40 -0500)]
Add compile checking phase to build.

The build textually includes all the code together in one unit for the
compiler in order to use gcc's -fwhole-program option.  Textually
including all the code can mask subtle code errors (eg, forgetting to
include the correct headers) and can lead to confusing error reports
from the compiler.  So, compile each file individually in addition to
the normal textually inclusive build.  This improves the error
checking while still obtaining the benefits of -fwhole-program.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoDon't use gcc's -combine option.
Kevin O'Connor [Wed, 12 Dec 2012 02:59:45 +0000 (21:59 -0500)]
Don't use gcc's -combine option.

The combine option has been deprecated from gcc for the last few
revisions.  The option doesn't add any real benefits, so there's no
real point in checking for it on the few systems that will still have
it.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoDon't recursively evaluate CFLAGS variables.
Kevin O'Connor [Wed, 12 Dec 2012 02:43:05 +0000 (21:43 -0500)]
Don't recursively evaluate CFLAGS variables.

The $(cc-option) macro was being executed multiple times for each
compiler invocation.  That's a waste of time.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovga: Minor comment spelling fix.
Kevin O'Connor [Fri, 7 Dec 2012 17:23:27 +0000 (12:23 -0500)]
vga: Minor comment spelling fix.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agofloppy: Minor - reduce handle_0e code size when CONFIG_FLOPPY is disabled.
Kevin O'Connor [Fri, 7 Dec 2012 16:25:58 +0000 (11:25 -0500)]
floppy: Minor - reduce handle_0e code size when CONFIG_FLOPPY is disabled.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoacpi: drop irq 8 from hpet ressources
Gerd Hoffmann [Thu, 6 Dec 2012 15:46:08 +0000 (16:46 +0100)]
acpi: drop irq 8 from hpet ressources

Fixes WinXP BSOD.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: Minor - merge the two dsdt ISA areas into one ISA area.
Kevin O'Connor [Tue, 4 Dec 2012 00:04:55 +0000 (19:04 -0500)]
acpi: Minor - merge the two dsdt ISA areas into one ISA area.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoacpi: fix COM2._UID
Gerd Hoffmann [Tue, 4 Dec 2012 15:26:40 +0000 (16:26 +0100)]
acpi: fix COM2._UID

Commit 8d7449771068824b8bdb51fe622c10660b373d4f broke this.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: reorder PX13 + ISA
Gerd Hoffmann [Tue, 4 Dec 2012 15:26:39 +0000 (16:26 +0100)]
acpi: reorder PX13 + ISA

Without this windows 7 BSODs, probably because
we are referencing PX13 from ISA.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: PCI routing DSDT simplifications.
Kevin O'Connor [Sun, 2 Dec 2012 07:33:33 +0000 (02:33 -0500)]
acpi: PCI routing DSDT simplifications.

Use define_link() macro in PIIX4 hardware definitions.  Now that all
remaining irq links are the same it's possible to just use a macro to
define the link.

Port several size optimizations to the q35 irq routing definitions:
define the PRQx fields in the _SB scope to reduce size of register
references, define CRS and STA methods in _SB scope to reduce code
duplication, simplify acpi code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoACPI: Delineate q35 ACSP DSL code into sections.
Kevin O'Connor [Sun, 2 Dec 2012 06:40:07 +0000 (01:40 -0500)]
ACPI: Delineate q35 ACSP DSL code into sections.

Add comments around major sections of the DSL file.  Also, add scope
declarations where needed so that each section only contains one
scope.

This is the q35 equivalent of e9fe15b86c6e98a91b30511d005ecdcc8a3e578d.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoACPI: Move q35 PCI irq definitions together.
Kevin O'Connor [Sun, 2 Dec 2012 06:30:27 +0000 (01:30 -0500)]
ACPI: Move q35 PCI irq definitions together.

Place all the q35 irq definitions close to each other.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoACPI: Move PCI0 hotplug and irq definitions to there respective areas.
Kevin O'Connor [Sun, 2 Dec 2012 06:22:23 +0000 (01:22 -0500)]
ACPI: Move PCI0 hotplug and irq definitions to there respective areas.

Group the hotplug code and definitions together along with the irq
code and definitions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoACPI: Remove unnecessary Return(One) calls from q35 DSDT.
Kevin O'Connor [Sun, 2 Dec 2012 06:15:03 +0000 (01:15 -0500)]
ACPI: Remove unnecessary Return(One) calls from q35 DSDT.

Recent iasl compilers warn about spurious return calls.  Remove extra
return calls from the GPE event methods.  This is the q35 dsdt
equivalent of patch 475ce3f5f6a986877d637ac39f6ee23484ecc992.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoacpi: Reindent DSDT code.
Kevin O'Connor [Sun, 2 Dec 2012 06:09:17 +0000 (01:09 -0500)]
acpi: Reindent DSDT code.

This patch is purely cosmetic - no code changes should be observed.

Use a consistent indentation style with the ACPI DSDT code:
1 - Use spaces (no tabs) and 4 space indentation
2 - Place opening braces on same line as statement declaration
3 - Don't put a space between statement and opening parenthesis,
    except for control statements (If, Else, While, Return) where a
    space is always present

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoacpi: move isa devices to separate file [q35]
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:48 +0000 (10:17 +0100)]
acpi: move isa devices to separate file [q35]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoacpi: add mcfg table for mmconfig
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:35 +0000 (10:17 +0100)]
acpi: add mcfg table for mmconfig

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoq35: fix default vga address
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:49 +0000 (10:17 +0100)]
q35: fix default vga address

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: move isa devices to separate file
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:47 +0000 (10:17 +0100)]
acpi: move isa devices to separate file

Stuff them parameterized into #defines, so we can (a) reuse them for
q35 and (b) don't duplicate the serial line.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: rework enable bits
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:46 +0000 (10:17 +0100)]
acpi: rework enable bits

Model the device enable bits as fields so they can be accessed
directly by name.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: move cpu hotplug to separate file [q35]
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:45 +0000 (10:17 +0100)]
acpi: move cpu hotplug to separate file [q35]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: move cpu hotplug to separate file
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:44 +0000 (10:17 +0100)]
acpi: move cpu hotplug to separate file

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: move \_SB.PCI0._CRS to separate file [q35]
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:43 +0000 (10:17 +0100)]
acpi: move \_SB.PCI0._CRS to separate file [q35]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: move \_SB.PCI0._CRS to separate file
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:42 +0000 (10:17 +0100)]
acpi: move \_SB.PCI0._CRS to separate file

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: move \_SB.HPET to separate file [q35]
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:41 +0000 (10:17 +0100)]
acpi: move \_SB.HPET to separate file [q35]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: move \_SB.HPET to separate file
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:40 +0000 (10:17 +0100)]
acpi: move \_SB.HPET to separate file

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: move DBUG() to separate file [q35]
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:39 +0000 (10:17 +0100)]
acpi: move DBUG() to separate file [q35]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoacpi: move DBUG() to separate file
Gerd Hoffmann [Wed, 28 Nov 2012 09:17:38 +0000 (10:17 +0100)]
acpi: move DBUG() to separate file

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoseabios: q35: Register PCI IRQs as active high in APIC mode
Jan Kiszka [Wed, 28 Nov 2012 09:17:37 +0000 (10:17 +0100)]
seabios: q35: Register PCI IRQs as active high in APIC mode

Seems important for Windows.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
12 years agoseabios: q35: add dsdt
Isaku Yamahata [Wed, 28 Nov 2012 09:17:36 +0000 (10:17 +0100)]
seabios: q35: add dsdt

add dsdt for q35 chipset of qemu.

[jbaron: remove suspd bits since they are now auto-generated, move pci window to 0xb0000000,
    add framework for auto generated pci windows]
[kraxel: remove pci express root ports + pci bridge]

Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
12 years agoseabios: add q35 initialization functions.
Isaku Yamahata [Wed, 28 Nov 2012 09:17:33 +0000 (10:17 +0100)]
seabios: add q35 initialization functions.

add q35 initialization functions.

[jbaron@redhat.com: restructured to current seabios base, updated pci base to 0xb0000000]
[kraxel@redhat.com: join the two lpc init funcs into one]

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoseabios: pci: enable SERR of normal device.
Isaku Yamahata [Wed, 28 Nov 2012 09:17:32 +0000 (10:17 +0100)]
seabios: pci: enable SERR of normal device.

enable SERR of normal device for AER.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
12 years agoseabios: acpi, fadt: make while fadt initialization chipset specific
Isaku Yamahata [Wed, 28 Nov 2012 09:17:31 +0000 (10:17 +0100)]
seabios: acpi, fadt: make while fadt initialization chipset specific

make while fadt initialization chipset specific.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
12 years agoseabios: make mttr UC area setup dynamic
Jason Baron [Wed, 28 Nov 2012 09:17:30 +0000 (10:17 +0100)]
seabios: make mttr UC area setup dynamic

Set up the UC area of mtrr dynamically based on mtrr_base. This allows
the bios to work for other chipsets that might want to set the mtrr.
Since BUILD_MAX_HIGHMEM is no longer used we can remove the config parameter.

This change reverses the order of pci_setup() and smm_init() with
mtrr_setup().

Signed-off-by: Jason Baron <jbaron@redhat.com>
12 years agofloppy: Allow floppy code to be used with coreboot.
Kevin O'Connor [Mon, 26 Nov 2012 16:18:11 +0000 (11:18 -0500)]
floppy: Allow floppy code to be used with coreboot.

Allow coreboot users to enable the floppy support (via CBFS files
etc/floppy0 and etc/floppy1) on real hardware.  It is unknown if the
Bochs derived floppy controller support will work on real hardware,
but this option will make it easier for those wishing to test.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agofloppy: Minor cleanup - reduce some cut-and-paste code.
Kevin O'Connor [Mon, 26 Nov 2012 16:14:00 +0000 (11:14 -0500)]
floppy: Minor cleanup - reduce some cut-and-paste code.

The diskette_param_table is a copy of diskette_param_table2 - just
memcpy it at runtime instead of duplicating the configuration in the
code.

Also, setup the floppy interrupt vector in the floppy.c code instead
of the post.c code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agopciinit: Align start of PCI memory on i440 chipset.
Kevin O'Connor [Mon, 26 Nov 2012 16:05:32 +0000 (11:05 -0500)]
pciinit: Align start of PCI memory on i440 chipset.

Align the start of PCI memory space to simplify mtrr ranges.  This is
configured per chipset so future chipsets can configure different
start addresses.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoCollapse PCI device tables in pci_bios_init_devices().
Kevin O'Connor [Wed, 21 Nov 2012 01:29:26 +0000 (20:29 -0500)]
Collapse PCI device tables in pci_bios_init_devices().

Use just one "struct pci_device_id" device table list in the
pci_bios_init_devices initialization code instead of three separate
tables.  There isn't any compelling reason to use multiple tables.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoesp: enable busmaster
Paolo Bonzini [Tue, 20 Nov 2012 17:33:41 +0000 (18:33 +0100)]
esp: enable busmaster

The HBA does DMA, thus we must enable the busmaster bit,
otherwise dma access will fail with recent qemu versions.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agolsi: enable busmaster
Gerd Hoffmann [Tue, 20 Nov 2012 11:02:52 +0000 (12:02 +0100)]
lsi: enable busmaster

The HBA does DMA, thus we must enable the busmaster bit,
otherwise dma access will fail with recent qemu versions.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agomegasas: Add boot support for LSI MegaRAID SAS
Hannes Reinecke [Tue, 13 Nov 2012 14:03:31 +0000 (15:03 +0100)]
megasas: Add boot support for LSI MegaRAID SAS

This patch adds boot support for LSI MegaRAID SAS controllers.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: Kevin O'Connor <kevin@koconnor.net>
Cc: Gerd Hofmann <kraxel@redhat.com>
Cc: Alex Graf <agraf@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
12 years agoDSDT: Fix HPET _CRS Method
Gabriel L. Somlo [Thu, 8 Nov 2012 17:35:17 +0000 (12:35 -0500)]
DSDT: Fix HPET _CRS Method

Updated _CRS method for HPET, bringing it in line with the way it is
presented on recent hardware (e.g. Dell Latitude D630, MacPro5,1, etc);
Allows it to be detected and utilized from Mac OS X; Also tested OK on
Linux (F16 64-bit install DVD) and Windows (Win7 64-bit install DVD).

Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
12 years agoconfig: add coreboot / qemu choice
Gerd Hoffmann [Mon, 29 Oct 2012 10:28:32 +0000 (11:28 +0100)]
config: add coreboot / qemu choice

Makes the config less confusing as we don't have to
use "!COREBOOT" if we wanna say "QEMU".

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoACPI: Remove unnecessary Return(One) calls from DSDT.
Kevin O'Connor [Sun, 28 Oct 2012 01:31:12 +0000 (21:31 -0400)]
ACPI: Remove unnecessary Return(One) calls from DSDT.

Recent iasl compilers warn about spurious return calls.  Remove extra
return calls from the GPE event methods.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoProvide correct dpte pointer to indicate absence of dpte
Bruce Rogers [Thu, 25 Oct 2012 19:48:16 +0000 (13:48 -0600)]
Provide correct dpte pointer to indicate absence of dpte

The Pheonix EDD v3.0 spec says that if no dpte is present,
the dpte pointer should contain ffffh:ffffh, not the 0h:0h
which is currently used. This bit me when using NetWare as
a KVM guest.

Signed-off-by: Bruce Rogers <brogers@suse.com>
12 years agogeodevga: Setup flat panel if needed
Christian Gmeiner [Mon, 1 Oct 2012 12:02:49 +0000 (14:02 +0200)]
geodevga: Setup flat panel if needed

This patch does basic setup of the flat panel and turns the
panel on.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agogeodevga: Add defines for VP_MSR_PADSEL
Christian Gmeiner [Mon, 1 Oct 2012 12:02:48 +0000 (14:02 +0200)]
geodevga: Add defines for VP_MSR_PADSEL

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agogeodevga: Setup output based on .config
Christian Gmeiner [Mon, 1 Oct 2012 12:02:46 +0000 (14:02 +0200)]
geodevga: Setup output based on .config

The geode hardware can be configured to use different
outputs. This patch adds support this feature based on
the current .config

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agogeodevga: Add configuration option for output modes
Christian Gmeiner [Mon, 1 Oct 2012 12:02:47 +0000 (14:02 +0200)]
geodevga: Add configuration option for output modes

Geode GX2 and LX are supporting Flat Panels. Add new
configuration options to support different output modes.
You can choose between:
* CRT
* Flat Panel
* CRT and Flat Panel

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agogeodevga: Add VP_MSR_CONFIG defines
Christian Gmeiner [Mon, 1 Oct 2012 12:02:45 +0000 (14:02 +0200)]
geodevga: Add VP_MSR_CONFIG defines

This patch adds all needed defines to setup the wanted
output mode.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agogeodevga: Add some basic flat panel defines
Christian Gmeiner [Mon, 1 Oct 2012 12:02:44 +0000 (14:02 +0200)]
geodevga: Add some basic flat panel defines

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agogeodevga: Add functions to work with fp register
Christian Gmeiner [Mon, 1 Oct 2012 12:02:43 +0000 (14:02 +0200)]
geodevga: Add functions to work with fp register

The Flat Panel Display Controller belongs to the Video
Processor unit but its register are starting at offset
0x400. Provide functions to work with fp register.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agogeodevga: Rename defines to better match a well defined naming schema
Christian Gmeiner [Mon, 1 Oct 2012 12:02:42 +0000 (14:02 +0200)]
geodevga: Rename defines to better match a well defined naming schema

The following nameing schema is used:
    PART_REGISTER_BIT_DESCRIPTION

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agogeodevga: Access global variables using GET_GLOBAL/SET_VGA macros.
Kevin O'Connor [Sun, 16 Sep 2012 17:24:30 +0000 (13:24 -0400)]
geodevga: Access global variables using GET_GLOBAL/SET_VGA macros.

The vgabios runs in 16bit mode so all global variables must be
accessed via macros.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoFix 'union u64_u32_u' member names.
Kevin O'Connor [Sat, 15 Sep 2012 16:17:37 +0000 (12:17 -0400)]
Fix 'union u64_u32_u' member names.

Use 'lo' to mean the low bits and 'hi' to mean the high bits of a
64bit value.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoadd acpi pmtimer support
Gerd Hoffmann [Thu, 6 Sep 2012 06:01:00 +0000 (08:01 +0200)]
add acpi pmtimer support

This patch makes seabios use the acpi pmtimer instead of tsc for
timekeeping.  The pmtimer has a fixed frequency and doesn't need
calibration, thus it doesn't suffer from calibration errors due to a
loaded host machine.

[ v4: mask port ioport read ]
[ v2: add CONFIG_PMTIMER ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoReport stdvga modes in VBE via int10 (AX = 4F00h)
Christian Gmeiner [Sat, 1 Sep 2012 15:12:55 +0000 (17:12 +0200)]
Report stdvga modes in VBE via int10 (AX = 4F00h)

As all supported graphic adapters are supporting VGA we should
list them in int10 (AX = 4F00h). Also clext.c and bochsvga.c
are haveing a function named like is_XXX_mode() which checks
if its a default VGA mode or a VESA mode. If its a normal VGA
mode stdvga_set_mode() gets called.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agovgabios: Add support for text and cga modes to vbe_104f01().
Kevin O'Connor [Tue, 4 Sep 2012 22:39:51 +0000 (18:39 -0400)]
vgabios: Add support for text and cga modes to vbe_104f01().

Attempt to handle cga and text modes in the vbe get_mode_info call.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Check for relocatable windows before advertising support for it.
Kevin O'Connor [Tue, 4 Sep 2012 17:16:36 +0000 (13:16 -0400)]
vgabios: Check for relocatable windows before advertising support for it.

Use the VBE_win_granularity field to determine if the memory windows
are relocatable.  (Bochs and Cirrus vga support relocatable windows
while the standard vga controller does not.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agovgabios: Ignore mode flags in vbe get_mode_info call.
Kevin O'Connor [Mon, 3 Sep 2012 17:54:28 +0000 (13:54 -0400)]
vgabios: Ignore mode flags in vbe get_mode_info call.

Ignore any mode flags a caller may have set on the vbe get_mode_info
call.  The spec doesn't require ignoring of flags, but it appears at
least some real-world vgabios vbe implementations do this.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agobootsplash: Don't pass mode flags to VBE get_mode_info call.
Kevin O'Connor [Mon, 3 Sep 2012 17:52:50 +0000 (13:52 -0400)]
bootsplash: Don't pass mode flags to VBE get_mode_info call.

The spec doesn't specify one can pass flags into the get_mode_info
call, so don't do that.

Also, use the VBE_MODE_LINEAR_FRAME_BUFFER name where appropriate.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoGeode vga: Use standard format read/write_mask register functions.
Kevin O'Connor [Mon, 3 Sep 2012 16:32:01 +0000 (12:32 -0400)]
Geode vga: Use standard format read/write_mask register functions.

Rework the Geode code to use the same style register accessors as the
standard vga code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
12 years agoAdd helper functions to access DC and VP register
Christian Gmeiner [Sat, 1 Sep 2012 15:13:04 +0000 (17:13 +0200)]
Add helper functions to access DC and VP register

This change introduces some helper functions, which are making
the code more readable and easier to debug.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agoChange return values for vp_setup() and dc_setup()
Christian Gmeiner [Sat, 1 Sep 2012 15:13:03 +0000 (17:13 +0200)]
Change return values for vp_setup() and dc_setup()

There is no reason to have a return code for vp_setup()
and dc_setup(). So get rid of them.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agoAdd global struct geode
Christian Gmeiner [Sat, 1 Sep 2012 15:13:02 +0000 (17:13 +0200)]
Add global struct geode

This struct is used to store some PCI BAR values, which are used
during hw init.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agoUpdate VBE variables
Christian Gmeiner [Sat, 1 Sep 2012 15:13:01 +0000 (17:13 +0200)]
Update VBE variables

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agoAdd framebuffer size detection
Christian Gmeiner [Sat, 1 Sep 2012 15:12:56 +0000 (17:12 +0200)]
Add framebuffer size detection

It is possible to read out the framebuffer size via msr. The size
information is needed for VESA later.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agoRemove Extened CRTC Register functions
Christian Gmeiner [Sat, 1 Sep 2012 15:12:54 +0000 (17:12 +0200)]
Remove Extened CRTC Register functions

As the access the DC registers via memory, we dont need to
work with the extended CRTC register to setup the DC-VGA-mapping.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agoRemove all dc_ functions as they are not needed anymore
Christian Gmeiner [Sat, 1 Sep 2012 15:12:53 +0000 (17:12 +0200)]
Remove all dc_ functions as they are not needed anymore

As we access teh DC registers via memory we do not need all
the DC-VGA-mapping functions anymore.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agoAccess DC registers via geode_mem[Read|Write]
Christian Gmeiner [Sat, 1 Sep 2012 15:12:52 +0000 (17:12 +0200)]
Access DC registers via geode_mem[Read|Write]

There is no reason to access the DC registers via VGA
memory mapping if we could the access via memory.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
12 years agoacpi: LNKS is not needed
Paolo Bonzini [Tue, 7 Aug 2012 13:01:29 +0000 (15:01 +0200)]
acpi: LNKS is not needed

LNKS is a bit strange in that it reuses the same PIIX register as LNKA,
but has a different interrupt.  This means that the _CRS it returns will
not be one of the possible resources from _PRS.  This shows up in the
Linux boot logs as

   ACPI: PCI Interrupt Link [LNKS] (IRQs 9) *0

Instead of that, we can simply use a hardwired interrupt index.

Cc: Gleb Natapov <gnatapov@redhat.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoacpi: build PCI hotplug devices from a single template
Paolo Bonzini [Thu, 2 Aug 2012 13:07:26 +0000 (15:07 +0200)]
acpi: build PCI hotplug devices from a single template

More than 1kb of data is taken by the 32 copies of the PCI hotplug SSDT
methods.  We can build them from a single template like we do for CPUs
(wrapped in a Scope(\_SB.PCI0) block).

Three items differ for each slot: the device name, bits 16-23 of _ADR,
the _SUN value.  On top of this we have to rename the eject method for
non-removable slots, like we already do in build_pcihp.

There is a small change in the ASL: instead of including the number of
the slot in the implementation of _EJ0, we just call _SUN.  This is also
similar to what we do for CPU hotplug.

Once we do this, there is no need to keep a separate SSDT for PCI hotplug.
Everything can reside in the same table.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoacpi: build PCNT dynamically
Paolo Bonzini [Thu, 2 Aug 2012 13:07:25 +0000 (15:07 +0200)]
acpi: build PCNT dynamically

We already build the CPU notification method in src/acpi.c, and we can
reuse most of the code for PCI hotplug.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoacpi_extract: detect DeviceOp
Paolo Bonzini [Thu, 2 Aug 2012 13:07:24 +0000 (15:07 +0200)]
acpi_extract: detect DeviceOp

The DeviceOp AML opcode has more or less the same structure as ProcessorOp,
except that there is no processor ID.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>