aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
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'Connor2-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move optionroms.h to std/optionrom.h and util.h.Kevin O'Connor5-6/+7
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-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'Connor66-339/+393
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'Connor43-604/+657
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-18Rename util.c to string.c and introduce string.h.Kevin O'Connor55-44/+98
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'Connor21-178/+211
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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-02Move code cenetered around firmware initialization to src/fw/Kevin O'Connor43-22/+22
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'Connor78-72/+72
Move many C files from the src/ directory to the new src/hw/ directory. 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'Connor5-14/+125
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-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'Connor9-244/+272
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>