aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-10-03acpi: strip compiler info in built-in DSDT if anyacpi-untestedacpiMichael S. Tsirkin1-1/+4
IASL stores it's revision in each table header it generates. That's a problem since guests see a change each time they move between hypervisors. We generally fill our own info for tables, but we forgot to do this for the built-in DSDT. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-10-03acpi: load and link tables through romfile loaderMichael S. Tsirkin2-0/+32
Load files through romfile loader and use for acpi tables. We need the RSDP pointer to hang the rest of the tables off it, to detect that we simply scan all memory in FSEG. Add an option to disable this feature (useful for old QEMU versions). This saves about 1Kbytes. enabled: Total size: 134932 Fixed: 61571 Free: 127212 (used 51.5% of 256KiB rom) disabled: Total size: 133836 Fixed: 61563 Free: 128308 (used 51.1% of 256KiB rom) Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-10-03romfile_loader: utility to patch in-memory ROM filesMichael S. Tsirkin3-1/+250
Add ability for a ROM file to point to it's image in memory. When file is in memory, add utility that can patch it, storing pointers to one file within another file. This is not a lot of code: together with the follow-up patch to load ACPI tables from ROM, it's about 1K extra. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-10-03biostables: support looking up RSDPMichael S. Tsirkin2-7/+35
Will be used when it's loaded from QEMU. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-09-23README: document which config options to useMichael S. Tsirkin1-2/+14
In the interim of moving ACPI tables out of seabios, developers should get the config from QEMU tree to keep things in sync. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-09-23license: allow QEMU to reuse acpi bits under GPLv2+Michael S. Tsirkin12-3/+171
You are getting this mail because you might have contributed code to one of the files in seabios that we want to reuse in QEMU, when this file was under GPLv3 or LGPLv3. QEMU is GPLv2 at the moment, so as a step in the process of moving acpi tables to qemu, we need to make sure the code we'll be moving is GPLv2 compatible. The code was originally LGPLv2 in bochs so these bits are OK. QEMU generally prefers GPLv2 or later, so this is what this patch does. The plan is therefore: - collect acks from everyone - copy code to QEMU and apply this patch to QEMU copy only If you allow the use of your contribution in QEMU under the terms of GPLv2 or later as proposed by this patch, please respond to this mail including the line: Acked-by: Name <email address> in the message body. Thanks! Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-09-19fix buildversion.shGerd Hoffmann1-1/+1
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>
2013-09-19usb: add xhci supportGerd Hoffmann7-8/+1302
$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>
2013-09-19usb: add usb_update_pipe()Gerd Hoffmann1-5/+17
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>
2013-09-19uas: add (temporary) superspeed stopgapGerd Hoffmann2-0/+5
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-19Add qemu detection to csmGerd Hoffmann1-0/+3
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>
2013-09-19Drop coreboot qemu detectionGerd Hoffmann1-4/+0
Not needed any more, the new qemu_detect() function does the job instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-19Add generic qemu detectionGerd Hoffmann1-5/+41
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>
2013-09-18Sort the sections of util.h.Kevin O'Connor1-119/+119
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Merge bmp.h, boot.h, jpeg.h, and post.h into util.h.Kevin O'Connor25-99/+57
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move standard bda type info from biosvar.h to std/bda.h.Kevin O'Connor8-162/+188
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Split disk.h into block.h and std/disk.h.Kevin O'Connor25-352/+381
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move pmm definitions to new file std/pmm.h.Kevin O'Connor2-13/+20
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move pnpbios definition to new file std/pnpbios.h.Kevin O'Connor4-19/+26
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move fw/acpi.h to std/acpi.h.Kevin O'Connor12-19/+17
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move fw/mptable.h to std/mptable.h.Kevin O'Connor5-6/+5
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move fw/smbios.h to std/smbios.h.Kevin O'Connor8-11/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move fw/LegacyBios.h to std/LegacyBios.h and remove csm.h.Kevin O'Connor5-21/+11
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move vbe.h to std/vbe.h.Kevin O'Connor5-4/+4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move optionroms.h to std/optionrom.h and util.h.Kevin O'Connor6-7/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move pirtable definitions from hw/pci.h to std/pirtable.h and util.h.Kevin O'Connor6-42/+42
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18build: Fix import of gcc dependency files.Kevin O'Connor1-1/+1
Make sure dependency file import works with new hw/ and fw/ sub-directories. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move definition of struct segoff_s from farptr.h to types.h.Kevin O'Connor7-16/+11
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>
2013-09-18Move function definitions for output.c from util.h to new file output.h.Kevin O'Connor73-370/+425
Also, sort the order of include files in the c files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move malloc code from pmm.c to new files malloc.c and malloc.h.Kevin O'Connor44-605/+658
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move romfile definitions from util.h to new file romfile.h.Kevin O'Connor16-13/+33
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move stacks.c definitions from util.h to new file stacks.h.Kevin O'Connor29-29/+62
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18build: Perform compile checking on vgasrc code.Kevin O'Connor1-1/+1
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>
2013-09-18Rename util.c to string.c and introduce string.h.Kevin O'Connor63-52/+111
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move keyboard calling code from util.c to boot.c.Kevin O'Connor3-43/+43
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Split x86 specific functions out of util.c/h to new files x86.c/h.Kevin O'Connor22-179/+212
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18readme: Minor - fix typo in readme.Kevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18vgabios: Limit the range of the VBE number of "pages" parameter.Kevin O'Connor1-0/+4
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>
2013-09-18vgabios: Rename stdvga_bpp_factor to stdvga_vram_ratio.Kevin O'Connor4-19/+18
Invert the values returned by stdvga_bpp_factor and rename it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-16bochsvga: fallback to stdvga if dispi interface isn't presentGerd Hoffmann1-19/+48
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-16ahci: add missing check for allocation failureGerd Hoffmann1-9/+16
Triggerable by creating a virtual machine with *lots* of ahci controllers and disks. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-09-13README: Update readme to note scripts/ directory rename and vgasrc/ directory.Kevin O'Connor1-1/+6
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-02build: Reorder makefile source list to group like files together.Kevin O'Connor1-11/+16
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-02Move code cenetered around firmware initialization to src/fw/Kevin O'Connor44-30/+30
Move many C files from the src/ directory to the new src/fw/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-02Move code centered around specific hardware devices to src/hw/Kevin O'Connor83-91/+91
Move many C files from the src/ directory to the new src/hw/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-02build: Don't use vpath makefile directive.Kevin O'Connor1-14/+12
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-08-24Update kconfig to latest version.Kevin O'Connor39-1170/+5304
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>
2013-08-17Rename tools/ directory to scripts/ directory.Kevin O'Connor56-34/+34
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>
2013-08-14Minor - simplify rom_reserve().Kevin O'Connor1-10/+7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-08-10Minor - no need to declare MaxCountCPUs as VARFSEG.Kevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-08-10Add config option to support memory allocations in 9-segment.Kevin O'Connor7-21/+156
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>
2013-08-10Minor cleanups to smm assembler.Kevin O'Connor1-18/+19
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>
2013-08-08apm: fix shutdownGerd Hoffmann4-0/+14
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>
2013-08-02acpi_extract.py: document DEVICE directivesMichael S. Tsirkin1-0/+3
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>
2013-08-02Support custom boot menu prompt and custom boot menu key.Kevin O'Connor1-3/+5
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>
2013-08-02Fix bug in CBFS file walking with compressed files.Kevin O'Connor1-1/+1
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>
2013-07-21Add missing mathcp_setup() call to CSM code.Kevin O'Connor1-0/+1
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>
2013-07-21Default unused UMB areas to be read-only.Kevin O'Connor2-3/+17
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>
2013-07-21Unify pmtimer_read() and pittimer_read() code.Kevin O'Connor1-48/+28
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>
2013-07-21Separate out timer setup code.Kevin O'Connor1-35/+49
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>
2013-07-21Rename check_tsc() (and similar) to timer_check() and use u32.Kevin O'Connor13-94/+89
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>
2013-07-21Rename check_timer() function (and similar) to irqtimer_check().Kevin O'Connor5-17/+17
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>
2013-07-21Shift CPU TSC down to reduce need for 64bit variables.Kevin O'Connor2-27/+31
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>
2013-07-20Rename cpu_khz to TimerKHz.Kevin O'Connor1-12/+12
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-07-20Improve accuracy of internal timers.Kevin O'Connor4-25/+25
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>
2013-07-20Add helper functions to convert timer irqs to milliseconds.Kevin O'Connor6-11/+22
Add ticks_to_ms() and ticks_from_ms() helpers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-07-20Don't pass khz to pmtimer_setup - it's always PM_TIMER_FREQUENCY.Kevin O'Connor5-8/+9
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-07-20Move internal timer code from clock.c to a new file timer.c.Kevin O'Connor10-245/+273
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-07-18acpi: sync FADT flags from PIIX4 to Q35Michael S. Tsirkin1-3/+3
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>
2013-07-14PIC code cleanups.Kevin O'Connor10-106/+90
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>
2013-07-14Update README to include info on VARLOW variables.Kevin O'Connor1-11/+14
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-07-14Add CONFIG_DEBUG_COREBOOT config optionGerd Hoffmann2-1/+11
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-07-14coreboot: add cbmem console supportGerd Hoffmann3-0/+35
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>
2013-07-14Fix USB EHCI detection that was broken in hlist conversion of PCIDevices.Kevin O'Connor2-1/+2
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>
2013-06-13Minor - remove debugging dprintf added to pciinit.c.Kevin O'Connor1-2/+0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-13Another fix for hlist_for_each_entry_safe.Kevin O'Connor4-8/+16
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>
2013-06-13make qemu_cfg_init depend on QEMU_HARDWARE instead of QEMUKevin O'Connor1-1/+4
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>
2013-06-13tweak coreboot qemu detectionGerd Hoffmann1-1/+1
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>
2013-06-13Convert pciinit.c to use standard list manipulation code.Kevin O'Connor1-34/+30
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-13Fix error in hlist_for_each_entry_safe macro.Kevin O'Connor1-2/+1
Fix broken macro - it did not work correctly at all. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-13Revert "Convert pciinit.c to use standard list manipulation code."Kevin O'Connor1-30/+34
This reverts commit aab42152881dc62b37f1833e79cbdb3dfa51603b.
2013-06-12coreboot: add qemu detectionGerd Hoffmann1-0/+5
2013-06-12config: allow DEBUG_IO for !QEMUGerd Hoffmann2-2/+3
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>
2013-06-08Convert PCIDevices list to use standard list manipultion code.Kevin O'Connor6-15/+15
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-08Convert pciinit.c to use standard list manipulation code.Kevin O'Connor1-34/+30
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-08Convert boot.c to use standard list manipulation code.Kevin O'Connor1-20/+17
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-08Convert stacks.c to use standard list manipulation code.Kevin O'Connor1-17/+15
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-08Introduce helper function have_threads() in stacks.c.Kevin O'Connor1-10/+12
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-08Minor - relocate code in stacks.c to keep low-level thread code together.Kevin O'Connor1-52/+57
Just code movement - no actual code changes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-08Introduce and convert pmm code to use standard list helpers.Kevin O'Connor3-48/+108
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-08Minor - move "tracked memory alloc" code in pmm.c.Kevin O'Connor1-98/+98
Move the "pmm_malloc" code closer to the low level alloc functions it calls. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-06-08Minor - explicitly close files in buildrom.py.Kevin O'Connor1-0/+2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-04-30Add pvpanic device driverHu Tao2-0/+49
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>
2013-03-30acpi: Use cpu_to_leXX() consistently.Kevin O'Connor2-26/+25
Audit the ACPI code and ensure that all multi-byte fields do proper byte swabbing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-30acpi: Remove dead code with descriptions of bit flags.Kevin O'Connor1-25/+1
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>
2013-03-30acpi: Move ACPI table definitions from acpi.c to acpi.h.Kevin O'Connor2-185/+175
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-30Use container_of on romfile entries.Kevin O'Connor3-44/+57
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>
2013-03-23Cleanup QEMU_CFG_NUMA fw_cfg processing - split into two romfile entries.Kevin O'Connor2-13/+19
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>
2013-03-22acpi: make default DSDT optionalMichael S. Tsirkin2-1/+12
Since commit f7e4dd6c18ccfbaf6cd2f5eaaed2b77cabc8a406 QEMU loads its own copy of DSDT, so let's not build in PIIX. This makes building in the DSDT an option, default to on (built-in). If no one complains for a while, we'll be able to switch it off and then maybe remove altogether. With CONFIG_ACPI_DSDT = y Total size: 127348 Fixed: 58892 Free: 3724 (used 97.2% of 128KiB rom) With CONFIG_ACPI_DSDT = n Total size: 122844 Fixed: 58884 Free: 8228 (used 93.7% of 128KiB rom) Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-03-22pciinit: Enable default VGA deviceAlex Williamson3-1/+42
As QEMU gains PCI bridge and PCIe root port support, we won't always find the VGA device on the root bus. We therefore need to add support to find and enable a VGA device and the path to it through the VGA Enable support in the PCI bridge control register. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2013-03-18mptable: Use same PCI irqs as ACPI code.Kevin O'Connor3-8/+8
The ACPI code has a hardcoded list of PCI interrupts. Use that same list in the mptable code generation. This will ensure that both tables are in synch - it may also make the mptable easier to generate from QEMU. Also, move the irq0_override lookup outside of the irq loop. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-18mptable: Don't describe pci-to-pci bridges.Kevin O'Connor1-12/+10
It should not be necessary to describe PCI-to-PCI bridges in the mptable. (The mptable was designed to fit in ROM, so it seems unlikely that it would be used for bridges that could be dynamically added.) Describing only the root bus should make it easier to port this content into QEMU. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-17Set ZF prior to keyboard read call in check_for_keystroke().Kevin O'Connor1-1/+1
Set the ZF flag to make sure the keyboard interrupt is actively clearing it on a key event. This fixes a hang when CONFIG_BOOTMENU is on and CONFIG_KEYBOARD is off. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-17Add dependencies to vgafixup.py and buildversion.sh scripts.Kevin O'Connor1-3/+3
Rebuild targets if these scripts change. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-17Update README - copy *.aml files for QEMU.Kevin O'Connor1-0/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-17virtio-scsi: Pack struct virtio_scsi_{req_cmd,resp_cmd}Asias He1-2/+2
Device needs the exact size of these data structure. Prevent padding. This fixes guest hang when booting seabios + tcm_vhost. Signed-off-by: Asias He <asias@redhat.com>
2013-03-17virtio-scsi: Set _DRIVER_OK flag before scsi target scanningAsias He1-2/+3
Before we start scsi target scanning, we need to set the VIRTIO_CONFIG_S_DRIVER_OK flag so the device can do setup properly. This fix a bug when booting tcm_vhost with seabios. Signed-off-by: Asias He <asias@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
2013-03-09Fix bug in NUMA node setup - don't create SRAT if NUMA not present.Kevin O'Connor1-0/+2
Make sure to check for the case where there are no NUMA nodes passed in from QEMU. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-09Minor - add missing newline to floppy debug statement.Kevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-09vgabios: Fix cirrus memory clear on mode switch.Kevin O'Connor3-6/+8
The cirrus_clear_vram() code wasn't actually doing anything because of a u8 overflow. Fix that. Fill with 0xff when performing a legacy cirrus mode switch (WinXP has been observed to incorrectly render dialog boxes if the memory is filled to 0). This was the behavior of the original LGPL vgabios code. To support this, add mechanism (MF_LEGACY) to allow vga drivers to detect if the mode switch is from vesa or int10. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-09vgabios: Fix stdvga_perform_gray_scale_summing().Kevin O'Connor1-0/+1
Fix conversion error that resulted in stdvga_perform_gray_scale_summing not actually writing the new results back. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-08Use VARVERIFY32INIT on global variables that point to "tmp" memory.Kevin O'Connor4-6/+8
Enable the recently added build check on global variables that are (or contain) pointers to memory allocated by malloc_tmp(). This helps detect cases where temporary memory is accessed after POST. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-08Add VARVERIFY32INIT attribute for variables only available during "init".Kevin O'Connor2-9/+13
Add a build check to verify certain variables are only reachable via the 32bit "init" code. This can be used as a mechanism to enforce certain data (and code that accesses that data) as only available during POST. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-08smm: Don't use PCIDevices list in smm_setup().Kevin O'Connor3-31/+37
The smm_setup() call is invoked from resume. The PCIDevices list is only valid during POST. Cache the necessary PCI BDF ids so that PCIDevices isn't needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-08shadow: Don't use PCIDevices list in make_bios_readonly().Kevin O'Connor1-21/+13
The make_bios_readonly() call is invoked from resume. The PCIDevices list is only valid during POST. Cache the necessary PCI BDF ids so that PCIDevices isn't needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-08Don't use __FILE__ in virtio-ring.c.Kevin O'Connor1-4/+2
Avoid referencing __FILE__ - that value changes depending on the user's build setting of OUT. The function and line number are sufficient. Also, use panic() instead of looping forever. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-08Add additional dependency checks to Makefile.Kevin O'Connor1-3/+6
Generate dependencies on pre-processed ASL files. This ensures that a change to an imported dsdt file will cause iasl to be called. Make .config depend on Kconfig files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-06acpi: Eliminate BDAT parameter passing to DSDT code.Kevin O'Connor5-75/+71
The "BDAT" construct is the only ACPI mechanism that relies on SeaBIOS reserved memory. Replace it with the SSDT based template system. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-06Rename src/ssdt-susp.dsl to src/ssdt-misc.dsl.Kevin O'Connor3-7/+7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-05Cache boot-fail-wait to avoid romfile access after POST.Kevin O'Connor1-6/+9
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>
2013-03-03Minor - note that passing QEMU config via cmos is deprecated.Kevin O'Connor1-0/+4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-03floppy: Actually do controller reset in floppy_reset().Kevin O'Connor1-2/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-03floppy: Implement media format sensing.Kevin O'Connor1-45/+78
Check for lower capacity media in the floppy drive and set the corresponding controller data rate for it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-03floppy: Improve floppy_pio() error checking.Kevin O'Connor1-18/+42
The controller can be busy on a response without it being an error. Don't spin infinitely if status isn't what is expected. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-03floppy: Move recalibration and results parsing to floppy_cmd().Kevin O'Connor1-98/+78
Move some prep and error checking into floppy_cmd() from its callers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-03floppy: Clean up Check Interrupt Status code.Kevin O'Connor1-44/+61
Don't run the Check Interrupt Status command from the floppy hardware interrupt handler. Instead, run it where it is needed - after controller startup and after a recalibration command. Also, use floppy_pio() to issue the command instead of open coding it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-03floppy: Cleanup floppy irq wait handling.Kevin O'Connor2-45/+45
Rename FRS_TIMEOUT to FRS_IRQ - the flag indicates that an irq has been received - it isn't directly related to timeouts. On a timeout event, disable the floppy controller instead of doing a full reset. Also, perform the disable directly in floppy_wait_irq(). Always wait for the floppy irq after enabling the controller and after a recalibrate command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-03floppy: Introduce 'struct floppy_pio_s' for floppy PIO ops.Kevin O'Connor1-68/+90
Populate a struct for the PIO operations and move the PIO manipulation done in floppy_cmd() to floppy_pio(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-03Minor - improve comments and grouping of handle_08().Kevin O'Connor1-3/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-03Support using the "extra stack" for all 16bit irq entry points.Kevin O'Connor2-0/+67
Using the internal stack reduces the amount of space that SeaBIOS uses on the caller's stack. This is known to help some very old operating systems (like DOS 1.0). However, there is a possibility that this will break any operating systems that calls a legacy 16bit irq in 16bit protected mode (no OSes have yet to be identified as doing this), so make the ability config dependent. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-03-03Separate out 16bit PCI-BIOS entry point from regular int 0x1a entry point.Kevin O'Connor5-13/+23
The PCI-BIOS entry point can be called in 16bit protected mode, so separate its entry code from the legacy 0x1a code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-23Minor - introduce numeric defines for the IVT offset of hw irqs.Kevin O'Connor3-5/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-23Minor - fix confusing final_sec32low_start name in layoutrom.py.Kevin O'Connor1-3/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-23Try to detect an unsuccessful hard-reboot to prevent soft-reboot loops.Kevin O'Connor2-4/+9
There have been various kvm bugs that prevent reboots from working properly. Generalize the existing test for a failed reboot to better catch these cases. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-23Add acpi_reboot() reset method using RESET_REGDavid Woodhouse3-11/+64
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-23Rename find_pmtimer() to find_acpi_features()David Woodhouse5-13/+11
I'm about to make it do more than just the pmtimer... Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-23Fix return type of le64_to_cpu() and be64_to_cpu()David Woodhouse1-2/+2
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-21seabios: Add a dummy PCI slot to irq mapping functionAlex Williamson1-1/+9
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>
2013-02-21seabios q35: Add new PCI slot to irq routing functionAlex Williamson1-1/+32
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>
2013-02-20Use CONFIG_ prefix for Kconfig variables; use BUILD_ for others.Kevin O'Connor10-42/+42
Rename remaining "build" settings in config.h that used the CONFIG_ prefix to use a BUILD_ prefix. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-19Eliminate separate BiosTableSpace[] space for f-segment allocations.Kevin O'Connor3-11/+19
The BiosTableSpace variable was used to ensure there was sufficient space in the f-segment for malloc_fseg() calls. However, it added 2K to the final image size to reserve that space. Update the build to determine where to put the f-segment allocations. In most cases (when code relocation is enabled) allocations can be done in the space free'd from the "init" sections and no additional space needs to be reserved in the final image. This also has the benefit of not fragmenting the f-segment allocation space. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-19Calculate "RamSize" needed by 16bit interface dynamically.Kevin O'Connor12-40/+40
Calculate a LegacyRamSize directly from the e820 map for use by handle_1588() and handle_15e801() (the only two external interfaces that require "RamSize"). All other users of the existing RamSize (and RamSizeOver4G) variables are specific to QEMU, so move the declarations to paravirt.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-19Move malloc's ZoneFSeg and ZoneLow setup to malloc_init.Kevin O'Connor1-10/+5
This reduces some duplicate code between malloc_preinit() and csm_malloc_preinit(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-19Don't relocate "varlow" variable references at runtime.Kevin O'Connor6-54/+54
Since the final location of the "varlow" variables are known at build time, link the final locations into the binary during the build. The 16bit code was already done at link time - update the build so the 32bit code is also done at link time. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-18Convert VAR16VISIBLE, VAR16EXPORT, and VAR32VISIBLE to VARFSEG.Kevin O'Connor25-72/+58
Convert all users of the alternative variable exports to VARFSEG. There isn't a significant distinction between the existing types of exports, so it's simpler to just use one type going forward. The new VARFSEG declaration is only emitting when in 32bit mode, so update and move some variables as needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-18Introduce VARFSEG for variables that will reside in the f-segment.Kevin O'Connor2-7/+26
Introduce a variable declaration that will force variables (that are compiled in 32bit mode) to be emitted into the f-segment. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-18Minor assembler enhancements to __csm_return.Kevin O'Connor1-9/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-18Remove unnecessary "export" declarations from assembler functions.Kevin O'Connor1-2/+2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-18seabios q35: Enable all PIRQn IRQs at startupAlex Williamson1-4/+2
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>
2013-02-18Disable handle_post() on CSM builds.Kevin O'Connor1-0/+3
This reduces the size of the CSM binary by a few bytes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-18Disable CONFIG_THREAD_OPTIONROMS for CSM buildDavid Woodhouse1-1/+1
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-18Verify CC is valid during build tests.Kevin O'Connor1-1/+8
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>
2013-02-17Clarify build generated "zone low" values.Kevin O'Connor6-36/+36
Rename datalow_base (and similar) to zonelow_base, and datalow_start (and similar) to varlow_start. This helps distinguish between the bounds for the runtime dynamic memory pool and the compile time global variables. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-17Report on f-segment UMB ram also.Kevin O'Connor1-1/+2
Some old DOS programs can also use f-segment space as Upper Memory Blocks (UMB), so also report on what space is available in debug messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-17Rename rom_get_top() to rom_get_max().Kevin O'Connor4-8/+8
Rename rom_get_top and try to make the difference between it and rom_get_last more clear. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-17build: Don't require $(OUT) to be a sub-directory of the main directory.Kevin O'Connor3-10/+10
Remove references to "../" and "out/" from the build so that "make OUT=/a/b/c/" will work. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-17Fix Makefile - don't reference "out/" directly, instead use "$(OUT)".Kevin O'Connor1-3/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-16Enable VGA output when setting Cirrus-specific modeLaszlo Ersek1-0/+1
This patch does the same for Cirrus as David's following patch for bochs, originally posted under <http://www.seabios.org/pipermail/seabios/2013-February/005434.html>: Enable VGA output when settings bochs-specific mode When used from OVMF+CSM, we got no video output. It appears that we were never enabling the display output except when configuring a text mode. Which never happens, in the OVMF+CSM case. In my testing on RHEL-6.3 with OVMF -D CSM_ENABLE / CONFIG_CSM bios.bin / CONFIG_QEMU vgabios.bin, using Cirrus, VESA mode 0x115 is selected (Direct Color, 800x600x24). According to <http://www.osdever.net/FreeVGA/vga/attrreg.htm>, cirrus_switch_mode() stdvga_attr_mask() currently keeps/sets the "Attribute Controller Graphics Enable" bit set in the "Attribute Mode Control Register". When invoked from OVMF+CSM, that is not enough however, so let's do the same as for Bochs: stdvga_attrindex_write(0x20); which corresponds to setting the "Palette Address Source" bit in the "Attribute Address Register": "This bit is set to 0 to load color values to the registers in the internal palette. It is set to 1 for normal operation of the attribute controller. [...]" clext_set_mode() stdvga_set_mode() -- for regular modes stdvga_attrindex_write() -- existing call cirrus_switch_mode() -- for Cirrus modes stdvga_attrindex_write() -- call added by this patch Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-16Enable VGA output when settings bochs-specific modeDavid Woodhouse1-0/+1
When used from OVMF+CSM, we got no video output. It appears that we were never enabling the display output except when configuring a text mode. Which never happens, in the OVMF+CSM case. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-15geodevga: fix wrong define nameChristian Gmeiner2-2/+2
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2013-02-15geodevga: add debug to msr functionsChristian Gmeiner1-0/+7
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2013-02-15geodevga: move output setup to own functionChristian Gmeiner1-29/+35
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2013-02-15geodevga: move framebuffer setupChristian Gmeiner1-12/+17
Framebuffer setup has nothing to do with dc_setup(..) so move it to geodevga_init(..). Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2013-02-15geodevga: fix errors in geode_fp_* functionsChristian Gmeiner1-2/+2
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2013-02-15Implement !CONFIG_BOOT for CSMDavid Woodhouse1-0/+15
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-15Implement !CONFIG_OPTIONROMS support for CSMDavid Woodhouse1-0/+5
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-15Make CONFIG_OPTIONROMS_DEPLOYED depend on CONFIG_QEMUDavid Woodhouse1-1/+1
Potentially we could even kill it off completely, since it only works with old versions of Qemu. But it can stay for now as long as it doesn't offend me in the CSM build... Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-15Warn on unaligned PCI ROM structure in option roms.Kevin O'Connor1-0/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-14USB-EHCI: Fix null pointer assignmentAvik Sil1-1/+1
cntl->regs should not be accessed before initializing it. Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
2013-02-13vgabios: Bochs/QEMU vgabios support should depend on CONFIG_QEMU.Kevin O'Connor1-3/+3
The Cirrus, Standard VGA, and Bochs VGA should depend on CONFIG_QEMU and not CONFIG_COREBOOT. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-13Group QEMU platform setup together and move to paravirt.c.Kevin O'Connor8-40/+49
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Integrate qemu_cfg_preinit() into qemu_romfile_init().Kevin O'Connor3-28/+16
Now that only qemu_romfile_init() uses the fw_cfg interface, it only needs to be detected in that function. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Process fw_cfg e820 entries during the fw_cfg setup stage.Kevin O'Connor2-41/+23
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Convert fw_cfg NUMA entries into a romfile entry.Kevin O'Connor3-34/+16
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Convert basic integer fw_cfg entries into romfile entries.Kevin O'Connor6-53/+9
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Convert fw_cfg SMBIOS entries into romfile entries.Kevin O'Connor3-176/+121
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Convert fw_cfg ACPI entries into romfile entries.Kevin O'Connor3-41/+38
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Support skipping content when reading from QEMU fw_cfg romfile entries.Kevin O'Connor3-17/+27
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Unify return path for CSM to go via csm_return()David Woodhouse2-21/+22
This allows us to keep the entry_csm code simple, and ensures that we consistently do things like saving the PIC mask (and later setting UmbStart) on the way back to UEFI. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-12Use find_pmtimer() after copying coreboot ACPI tablesDavid Woodhouse2-2/+3
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-12Use find_pmtimer() after copying Xen ACPI tablesDavid Woodhouse1-0/+3
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-12Move find_pmtimer() to ACPI table setup where it logically belongsDavid Woodhouse1-2/+2
We don't have the ordering dependency with timer_setup() any more. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-12Don't calibrate TSC if PMTIMER is already set upDavid Woodhouse1-4/+10
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-12Fix rom_reserve()/rom_confirm() for CSM oprom dispatchDavid Woodhouse1-1/+3
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-12Update tools/acpi_extract.py to handle iasl 20130117 release.Kevin O'Connor1-2/+2
The latest iasl release produces "lst" output with "number: " instead of "number....". Update the tool to support both formats. Reported-by: Bo Yang <boyang@suse.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12The mathcp setup touches the PIC and thus move to the "setup" phase.Kevin O'Connor3-3/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Start device_hardware_setup in mainint even with CONFIG_THREAD_OPTIONROMS.Kevin O'Connor1-8/+6
There's no real gain to starting the device_hardware_setup in the middle of the platform setup. Always start it just prior to the VGA rom. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Only perform SMP setup on QEMU.Kevin O'Connor1-13/+10
The SMP setup initializes MTRRs on extra CPUs and populates the CountCPUs variable. On coreboot the CPUs should already be initialized and the CountCPUs variable isn't used anywhere. There have also been reports of the SIPI does not work on some real machines. So, it's best not to invoke one if it isn't needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Minor - move definitions to paravirt.c from paravirt.h.Kevin O'Connor2-22/+25
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Convert kvm_para_available() to runningOnKVM().Kevin O'Connor2-25/+30
Make the KVM detection code use the same format as the QEMU/Xen detection code. Also, log when KVM is detected. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-12Consistently use CONFIG_COREBOOT, CONFIG_QEMU, and runningOnXen().Kevin O'Connor25-70/+57
CONFIG_QEMU means compile to start from QEMU (and possibly Xen/KVM/Bochs) and definitely running under QEMU (or Xen/KVM/Bochs). CONFIG_COREBOOT means compile for coreboot and definitely running under coreboot. Places that used CONFIG_COREBOOT to mean "running on real hardware" have been changed to use !CONFIG_QEMU. CONFIG_QEMU_HARDWARE enables support for some virtual hardware devices even if QEMU didn't start SeaBIOS. usingXen() is replaced by runningOnXen(). runningOnQEMU() is added to hardware devices that are only safe to access when we are sure we are running under QEMU (or Xen/KVM/Bochs). Neither the coreboot nor the csm code currently enable runningOnQEMU, but future patches may. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-10Add runningOnQEMU() and runningOnXen() for runtime platform detection.Kevin O'Connor5-7/+41
Introduce standard for performing and inspecting the run-time detection of para-virtualized environments. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-09No need to check both CONFIG_THREADS and CONFIG_THREAD_OPTIONROMS.Kevin O'Connor2-8/+6
CONFIG_THREAD_OPTIONROMS depends on CONFIG_THREADS, so the code can assume that the two are always on when CONFIG_THREAD_OPTIONROMS is on. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-09Determine century during init and store in VARLOW mem during runtime.Kevin O'Connor1-10/+16
Avoid reading/writing to cmos at runtime to get the QEMU century information. Instead, read it at startup and cache the info. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-08Enable PMTIMER for CSM buildDavid Woodhouse2-1/+3
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-08Add find_pmtimer() functionDavid Woodhouse2-12/+37
With CSM (and maybe coreboot) we'll want to find the pmtimer from the ACPI tables, instead of knowing where it is and *putting* it into the ACPI tables. Extract the first part of the existing find_resume_vector() function into a find_fadt() function, and use it from both find_resume_vector() and our new find_pmtimer(). Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-08Add README.CSMDavid Woodhouse1-0/+21
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-02-08Undo incorrect assumptions about Xen in commit 6ca0460f.Kevin O'Connor2-24/+8
Xen invokes SeaBIOS via entry_post, not entry_elf. As a result commit 6ca0460f broke Xen. This change effectively undoes that commit. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-07POST: Move cpu caching and dma setup to platform_hardware_setup().Kevin O'Connor3-13/+13
The CPU cache is enabled and DMA is disabled on all real-world POST entry situations, so no need to do this in the low-level "pre-init" phase. Instead, move it to the platform hardware setup stage. Also, move the setting of the reboot flags (which control reset-vector entry point handling) to ivt_init(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-02-07POST: Reorganize post entry and "preinit" functions.Kevin O'Connor3-39/+47
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>