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
Paolo Bonzini [Mon, 6 Aug 2012 11:15:06 +0000 (13:15 +0200)]
scsi: add AMD PCscsi driver
This is a driver for an AMD PCscsi (am53c974) SCSI card. It can be
used together with DOS or old operating systems such as Windows NT 3.1,
Windows 3.1 or Windows 98.
Paolo Bonzini [Thu, 2 Aug 2012 16:22:44 +0000 (18:22 +0200)]
scsi: fix detection of QEMU
The vendor string is null-terminated by the time scsi_init_drive looks
at it, so it is incorrect to pad the memcmp argument with spaces. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 2 Aug 2012 16:22:43 +0000 (18:22 +0200)]
lsi: do not reset on error
Resetting on any error (including for example a disconnected device)
will cause a unit attention condition on all devices. So if we cannot
probe for example target 6, the first read on target 0 will fail.
Reported-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
iasl versions starting with 20120320
(git commit 7fd09d993580e22a096a1b21d2a356d89e702153) enable
a preprocessor by default, which currently strips out
comments from the input. Happily the next release, 20120420, includes an option to disable the preprocessor.
Test and use this option when available.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
allow CPUs to have non-contiguous Local APIC IDs (v2)
Extract Local APIC IDs directly from the CPUs, and instead of check for
"i < CountCPUs", check if the APIC ID was present on boot, when building
ACPI tables and the MP-Table.
This keeps ACPI Processor ID == APIC ID, but allows the
hardware<->SeaBIOS interface be completely APIC-ID based and not depend
on any other kind of "CPU identifier". This way, SeaBIOS may change the
way ACPI Processor IDs are chosen in the future.
As currently SeaBIOS supports only xAPIC and not x2APIC, the list of
present-on-boot APIC IDs is a 256-bit bitmap. If one day SeaBIOS starts
to support x2APIC, the data structure used to enumerate the APIC IDs
will have to be changed (but this is an internal implementation detail,
not visible to the OS or on any hardware<=>SeaBIOS interface).
For current QEMU versions (that always make the APIC IDs contiguous),
the OS-visible behavior and resulting ACPI tables should be exactly the
same. This patch will simply allow QEMU to start setting non-contiguous
APIC IDs (that is a requirement for some sockets/cores/threads topology
settings).
Changes v1 -> v2:
- Use size suffixes on all asm instructions on smp.c
- New patch description
report real I/O APIC ID (0) on MADT and MP-table (v3)
When resetting an I/O APIC, its ID is set to 0, and SeaBIOS doesn't
change it, so report it correctly on the ACPI MADT table and MP-table.
Some hardware may require the BIOS to initialize I/O APIC ID to an
unique value, but SeaBIOS doesn't do that. This patch at least makes the
tables reflect reality.
Changes v2 -> v3:
- Fix MP-table too, not just ACPI MADT table
Changes v1 -> v2:
- Cosmetic: whitespace change (removed extra newline)
- New patch description
Kevin O'Connor [Sat, 21 Jul 2012 16:01:12 +0000 (12:01 -0400)]
Unify ATAPI command processing.
Unify the ATA and AHCI ATAPI command processing into one function in
block.c (process_atapi_op).
This patch disables the existing handlers for ATA ATAPI isready and
reset. However, it's unlikely that support is needed and it does not
appear that the implemented support is fully correct.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This patch adds support for the lsi53c895a scsi host adapter,
allowing seabios to boot from scsi disks and cdroms connected
to the lsi scsi hba emulated by qemu.
This driver was written by looking at the expectations of qemu's
lsi emulation. I have no idea idea how close this is to work on
real hardware, and I somehow doubt anyone cares given the age of
physical lsi scsi cards. It depends on !COREBOOT for that reason.
This patch adds support for booting from UAS (usb
attached scsi) devices.
For now only usb 2.0 support is there. On usb 3.0 the
UAS protocol uses streams, so changes will be required
to make usb 3.0 devices fly once we have a xhci host
controller driver.
So far the driver has been tested on qemu-emulated
virtual hardware only. In theory should just work on
bare metal too.
Enable bit 15 (USE_PLATFORM_CLOCK) of FADT flags field so that
older Windows guests do not make use of the TSC for timestamping.
From the ACPI manual:
"A value of one indicates that OSPM should use a platform provided timer
to drive any monotonically non-decreasing counters, such as OSPM
performance counter services. Which particular platform timer will be
used is OSPM specific, however, it is recommended that the timer used is
based on the following algorithm: If the HPET is exposed to OSPM, OSPM
should use the HPET. Otherwise, OSPM will use the ACPI power management
timer. A value of one indicates that the platform is known to have a
correctly implemented ACPI power management timer."
Problems using the TSC include:
1) Migration to a host with different frequency.
2) Unsynchronized TSCs in SMP hosts (KVM does not guarantee
synchronization).
3) Processors which do not increment TSC on low power states.
Gleb Natapov [Sun, 20 May 2012 09:03:40 +0000 (12:03 +0300)]
Get system state configuration from QEMU and patch DSDT with it.
QEMU may want to disable guest's S3/S4 support and it wants to distinguish
between regular powerdown and S4 powerdown. To support that new fw_cfg
option was added that passes supported system states and what value should
guest use to enter each state. States are passed in 6 byte array. Each
byte represents one system state. If byte at offset X has its MSB set
it means that system state X is supported and to enter it guest should
use the value from lowest 7 bits. Patch also detects old QEMU and uses
values that work in backwards compatible way there.
Kevin O'Connor [Wed, 13 Jun 2012 12:47:03 +0000 (08:47 -0400)]
Support USB MSC devices with multiples LUNs
There are USB Mass storage devices which have more than one device.
Examples are CD Changers, or USB sticks which are partitioned in a
CDROM and Harddisk device.
Signed-off-by: Sven Schnelle <svens@stackframe.org> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Gerd Hoffmann [Tue, 12 Jun 2012 07:27:15 +0000 (09:27 +0200)]
pci: runtime i/o window sizing
Update the pci i/o windows at runtime, depending on the amount memory
the machine has. The 32bit window starts above low memory and ends at
the ioapic map address, the 64bit window is placed above high memory.
Kevin O'Connor [Sat, 9 Jun 2012 17:46:11 +0000 (13:46 -0400)]
Remove SMBIOS generation on coreboot hack.
Early versions of coreboot did not create an SMBIOS table (which Linux
needs in order to use the ACPI tables), so SeaBIOS had a hack to
generate an SMBIOS table. However, recent versions of coreboot can
generate an SMBIOS table, so there is no longer a reason to support
this hack.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 9 Jun 2012 17:36:45 +0000 (13:36 -0400)]
Minor - Replace PirOffset with PirAddr.
Technically, the PIR table could be placed at 0xf0000, which would
result in a PirOffset=0, which would confuse the code. So, use an
absolute address (PirAddr) instead. This also matches what the ACPI
and SMBIOS code does.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Sat, 9 Jun 2012 01:14:19 +0000 (21:14 -0400)]
Avoid runtime relocation of 16bit "low" mem - calculate at build instead.
Some 16bit accesses to "low" mem variables use 16bit relocations
instead of the normal 32bit relocations. This causes build problems
if the "low" mem sections move more than 64K during relocation.
The final location of the "low" memory can be determined during the
build, so link the 16bit code with the final post-reloc location of
the "low" mem variables instead. This eliminates the need to do these
runtime relocations on the 16bit code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Gerd Hoffmann [Thu, 7 Jun 2012 08:34:33 +0000 (10:34 +0200)]
update dsdt ressources at runtime
Write the pci window location to memory and add a pointer to the SSDT
(BDAT region). Turn \\SB.PCI0._CRS into a method which looks up the
information there and updates the ressources accordingly.
Gerd Hoffmann [Thu, 7 Jun 2012 08:34:31 +0000 (10:34 +0200)]
update bios date
Linux ignores some information from acpi in case the bios is old
as acpi support used to be buggy in the early days. This affects
ressources for example (unless forced with pci=use_crs). So lets
go for something more recent. With this patch applied the
ressources for \\SB.PCI0 will show up in /proc/{iomem,ioports},
tagged as "PCI Bus 0000:00".
The winxp boot loader does something curious - it sets an int 0x1c
handler, records the stack location, and then spins in place with irqs
enabled. The 0x1c handler alters the memory just past the stack
pointer so that when the timer irq returns the code jumps to a new
location and stop spinning. The winxp code relies on the fact that a
hw irq will always place 6 bytes at a specific location and that it
can alter those bytes.
The ecdc655a patch does a full backup/restore of the register state.
Unfortunately, the restore overwrites the changes made by the winxp
0x1c handler.
This patch reverts much of ecdc655a. Hardware irqs are still handled
on the extra stack, but only the essential register state is backed up
and restored.
Also, stack_hop_back is changed to only use %sp when changing states -
this enables the entry code to store just %esp instead of both %esp
and %sp.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Thu, 31 May 2012 04:20:55 +0000 (00:20 -0400)]
Cache romfile entries.
Create a 'struct romfile_s' and populate a list of all romfiles at
start of init. Caching the romfiles both simplifies the code and
makes it more efficient.
Also, convert the ramdisk code to use romfile helpers instead of
directly accessing cbfs.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Thu, 31 May 2012 01:31:42 +0000 (21:31 -0400)]
remove iasl-generated hex files from git repo
Almost every linux distro has iasl packaged these days.
Lets make it a build dependency and stop the hassle we
have with updating the *.hex files in the git repo.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Mon, 28 May 2012 22:31:39 +0000 (18:31 -0400)]
Set noinline on kbd.c interface functions that take stack variable pointers.
Some versions of gcc have been found to inline these funcions and then
cause the calling functions to use very large stack usage. Since
these functions are called from 16bit mode, their stack space usage is
very sensitive.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Kevin O'Connor [Mon, 28 May 2012 18:42:16 +0000 (14:42 -0400)]
Remove "noinline" declarations from keyboard/mouse driver code.
Now that the extra stack is used for keyboard and mouse driver code,
there is no reason to set noinline (which was done to try and conserve
stack space).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>