Kevin O'Connor [Tue, 5 Mar 2013 09:52:21 +0000 (17:52 +0800)]
Cache boot-fail-wait to avoid romfile access after POST.
Memory allocated with malloc_tmp() can't be used after the POST phase.
So, access boot-fail-wait in post phase and store it for the boot
phase to use. This fixes the regression introduced by commit 59d6ca52.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-off-by: Amos Kong <akong@redhat.com>
(cherry picked from commit 11a7234491cb2a027b0fa5e82af38a3e78b44c80)
Alex Williamson [Thu, 21 Feb 2013 16:12:23 +0000 (09:12 -0700)]
seabios: Add a dummy PCI slot to irq mapping function
This should never get called, but if we somehow get a new chipset
that fails to implement their own pci_slot_get_irq function, fail
gracefully and add a debug log message.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Fri, 15 Feb 2013 21:11:41 +0000 (14:11 -0700)]
seabios q35: Add new PCI slot to irq routing function
q35/ich9 doesn't use the same interrupt mapping function as
i440fx/piix. PIRQA:D and PIRQE:H are programmed identically, but we
start at index 0, not index -1. Slots 25 through 31 are also
programmed independently.
When running qemu w/o this patch, a device at address 0:6.0 will have
its PCI interrupt line register programmed with irq 10 (as seen by
info pci), but it actually uses irq 11 (as reported the guest). Half
of the interrupt lines are misprogrammedi like this. Functionally, a
fully emulated qemu guest doesn't care much, but when we try to use
device assignment, we really need to know the correct irqs.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson [Fri, 15 Feb 2013 21:11:35 +0000 (14:11 -0700)]
seabios q35: Enable all PIRQn IRQs at startup
We seem to use the IRQEN bit of the PIRQn registers interchangeably
to select APIC mode or to disable an IRQ. I can't decide if we're
intending to disable the IRQ or select APIC mode here, but in either
case it prevents PIC mode assigned devices from working. When seabios
writes IRQEN to these registers, qemu interprets that as APIC mode,
so while the boot ROM driver is waiting for an interrupt on ISA
compatible IRQ 10 or 11, KVM is injecting interrupts to APIC pins
16 - 23. Devices on the root bus use PIRQE:H while the root ports
use PIRQA:D. Enable them all so we don't limit where we support boot
ROMs. The guest will later disable unused IRQs with the ACPI _DIS
method.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Kevin O'Connor [Mon, 18 Feb 2013 15:28:55 +0000 (10:28 -0500)]
Verify CC is valid during build tests.
Update test-build.sh to report if it can't run the c compiler at all.
Without this test, a totally non-working build environment will yield
an "invalid LD" message which can be confusing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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>
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>
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>
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.
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>
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>
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>
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>
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>
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>
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>
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().
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>
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>
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>
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>
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).
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.
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>
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>
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.
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>
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>
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>
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.
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>
Paolo Bonzini [Thu, 2 Aug 2012 13:07:23 +0000 (15:07 +0200)]
acpi_extract: fix off-by-one
Single-byte package length values do use bits 4-5, and this will
happen with the PCI hotplug devices. pkglenbytes has not yet been
decremented, so multi-byte values are detected with pkglenbytes > 1.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 2 Aug 2012 13:07:21 +0000 (15:07 +0200)]
acpi: move s3/s4/s5 to build_ssdt
Move the _S3/_S4/_S5 packages out of ssdt-pcihp.dsl and into a separate
file. Correspondingly, move the patching from build_pcihp to build_ssdt.
Place this part at the beginning of the SSDT. Offset computation is a
bit simpler, and anyway the packages do not need to be inside Scope(_SB).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
I had a disk full condition and a partial hex file
got generated. Following make failed trying to use it.
We can make build a bit more robust by instructing
make to remove output files on error.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Eduardo Habkost [Fri, 31 Aug 2012 18:11:16 +0000 (15:11 -0300)]
apic_id_is_present: fix undefined behavior
This patch addresses some feedback sent by Laszlo[1] on the
non-contiguous APIC ID patches I have sent recently.
- (1 << 31) is undefined for 32-bit signed ints
- Use !! on the returned value, so the function return value
can be an int without a unsigned -> signed conversion