aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2011-10-30seabios: fix mptable nmi entryHEADmasterKenji Kaneshige1-1/+1
In the current seabios MP table description, NMI is connected only to BSP's LINT1. But usually NMI is connected to all the CPUs' LINT1 as indicated in MP specification. This patch changes seabios MP table to describe NMI is connected to all the CPUs' LINT1. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
2011-10-30seabios: Add Local APIC NMI Structure to ACPI MADTKenji Kaneshige1-2/+20
ACPI NMI Structure describes LINT pin (LINT0 or LINT1) information to which NMI is connected, and it is needed by OS to initialize local APIC. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
2011-10-30acpi: extract aml from .lstMichael S. Tsirkin7-941/+7180
Add ACPI_EXTRACT_ALL_CODE directive, to support extracting AML code from listing into a named array. Use that instead including C file generated by iasl, this makes it possible to include multiple AML tables without resorting to preprocessor tricks. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-10-30seabios: acpi: allow qemu to load dsdt as external acpi table.Isaku Yamahata1-8/+39
allow qemu to load dsdt as external acpi table. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2011-10-30util: add le32_to_cpu()Isaku Yamahata1-0/+5
this will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2011-10-15Simplify pci_bios_init_root_regions().Kevin O'Connor1-25/+13
Add some comments and refactor out some duplicated code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-15Move pciinit device init code together.Kevin O'Connor1-11/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-15Locally allocate pciinit busses[] variable.Kevin O'Connor1-13/+13
No need for a global variable - only a few functions use the busses array. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-15Replace recursive pci init system with linear passes.Kevin O'Connor1-82/+74
The existing PCI sizing and mapping uses a recursive algorithm to visit every bus and its devices in order. Replace that with an algorithm that visits every device and then every bus. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-15Replace pciinit busses_count with MaxPCIBus.Kevin O'Connor1-14/+6
Use the existing bus count instead of calculating a new one. Also, the MaxPCIBus is guaranteed to encompass all pci->secondary_bus references, so no need to check for overruns. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-13Simplify pci_slot_get_irq().Kevin O'Connor1-13/+7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-13Use pci->header_type in pci_bar() to avoid unnecessary pci_config_readb.Kevin O'Connor1-29/+23
Pass a 'struct pci_device' into pci_bar and update all callers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-13Separate pciinit.c into clearly delineated sections.Kevin O'Connor1-100/+121
There are four separate phases of the current PCI initialization code: bus initialization, bus sizing, bar allocation, and misc device init. Move the code exclusively called in each phase next to each other, and clearly mark each section. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-13Use standard formatting for PCI info during PCI init pass.Kevin O'Connor1-5/+7
Format BDF (bus, device, fn), vendor:device, and prefmem debug output in a more user-readable format. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-12acpi: automatically generated ssdt procMichael S. Tsirkin5-34/+65
Get rid of manually cut and pasted ssdt_proc, use ssdt compiled by iasl and offsets extracted by acpi_extract instead. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-10-12acpi: generate and parse mixed asl/aml listingMichael S. Tsirkin4-5/+329
Use iasl -l flag to produce a mixed listing, where a source line is followed by matching AML. Add a tool tools/acpi_extract.py to process this listing. The tool looks for ACPI_EXTRACT tags in the ASL source and outputs matching AML offsets in an array. To make these directives pass through ASL without affecting AML, and to make it possible to match AML to source exactly, add a preprocessing stage, which prepares input for iasl, and puts each ACPI_EXTRACT tag within a comment, on a line by itself. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-10-12Consolidate DSDT copy-and-paste PCI IRQ code into method calls.Kevin O'Connor2-406/+241
Use method calls in LNK[ABCDS] object methods - this reduces the cut-and-paste code. It also makes it simpler and the object size smaller. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-12Move code from PCI hotplug DSDT macros to methods.Kevin O'Connor2-684/+569
Simplify the hotplug code by moving the bulk of the logic out of the macros and into static method definitions. This also reduces the ACPI DSDT code size. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-12Simplify PCI hotplug acpi macros.Kevin O'Connor2-236/+235
Change the macros to pass the slot number via hex, and then remove passing of duplicate information. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-12Consolidate PCI hotplug definitions together in DSL file.Kevin O'Connor2-1041/+877
Move the PCI hotplug definitions next to each other. This introduces a notify method (\_SB.PCI0.PCNF) to help consolidate the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-12Delineate ACSP DSL code into sections.Kevin O'Connor2-770/+843
Add comments around major sections of the DSL file. Also, add scope declarations where needed so that each section only contains one scope. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-04Prep version for next release.Kevin O'Connor1-1/+1
2011-10-04Update version to 1.6.3Kevin O'Connor1-1/+1
2011-10-04Update README file.Kevin O'Connor1-26/+9
2011-10-01Fix alignment bug in pci_bios_init_root_regions().Kevin O'Connor1-1/+1
If there are no memory allocations for a given type then the "max" bar size is zero. However, ALIGN_DOWN does not handle an alignment of zero properly. Catch and handle the zero case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-01Reorder build objects to work around gcc bug with -combine.Kevin O'Connor1-1/+1
Some versions of gcc have difficulties with externally visible variables that are used before they are declared. Now that pmm.c contains only 32bit code and has a reference to CanPreempt, make sure the declaration of CanPreempt (in stacks.c) is compiled first. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-10-01Probe PCI existenceJan Kiszka3-4/+20
This prevents lockups when trying to allocate PCI resources on an ISA-only system like QEMU can emulate. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2011-09-20Define handle_post as VISIBLE32FLAT as work around for QEmu memory layout.Kevin O'Connor1-11/+20
QEmu only copies the top 128K of the BIOS image to low memory (0xe0000-0xfffff). Images over 128K are only fully mapped in high memory (0xfff00000). However, the SeaBIOS shadow functions (make_bios_writable_intel) will copy up to 256K to low memory. SeaBIOS generally works with 256K roms because they are automatically copied to low memory during the BIOS init. However, this only works if the shadow function code is itself part of the bios image that is placed in low memory by QEmu. Defining handle_post() as VISIBLE32FLAT will make the linker scripts more likely to place the initial shadow code in the last 128K of the image. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-09-20Minor - move ACPI_HPET_ADDRESS definition to config.h.Kevin O'Connor2-11/+9
Move ACPI_HPET_ADDRESS to BUILD_HPET_ADDRESS in config.h so that it is listed with similar hardcoded addresses. Also, organize the BUILD_*_ADDRESS definitions in config.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-09-02Minor formatting and comment updates to acpi.c.Kevin O'Connor1-16/+13
2011-09-02Probe HPET existenceJan Kiszka1-1/+13
QEMU does not provide a HPET block if it was configured with -no-hpet, other machines SeaBIOS runs on may lack a HPET as well. Perform basic checks the ID register for a reasonable vendor ID and a clock period within the valid range, do not build the HPET table if that fails. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2011-08-28Use coreboot smbios table if found.Kevin O'Connor4-3/+12
The coreboot init code now looks for an existing smbios table and will use it. A locally generated smbios table will only be created if no coreboot table is found.
2011-08-09pci: re-add isa bridge setupGerd Hoffmann1-0/+5
The switch to the two-pass pci initialization dropped the isa bridge initialization by accident. That broke interrupts on FreeBSD 4.4 and maybe also other older guests which don't use ACPI for IRQ routing setup. Add the bits back in. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Bjørn Mork <bjorn@mork.no>
2011-08-06ahci: enable by defaultGerd Hoffmann1-1/+1
Lack of real hardware testing was the main reason to turn it off by default. The AHCI has been fixed to work on both qemu and real hardware, so lets flip the switch now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-08-06ahci: use malloc_tmp memory for probing portsGerd Hoffmann1-3/+11
Also allocate the ahci port struct itself from tmp memory for probing, then copy to fseg memory in case we detected some device. This way we don't waste fseg memory for unused ports. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-08-06ahci: move device registrationGerd Hoffmann2-13/+16
Stick description and boot priority into the port struct, so it holds everything needed to register the device, so we can do the registration after ahci_port_init returned. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-08-06ahci: ignore atapi devices which are not cdromsGerd Hoffmann1-7/+8
Also simplify the code a bit further down the road as we know iscd must be true ;) Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-08-06ahci: probe each port in its own threadGerd Hoffmann1-21/+20
Instead if creating a single thread which probes all ports one after another kick one thread per port, so ports are probed in parallel. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-08-06ahci/cdrom: shared bounce bufferGerd Hoffmann4-10/+23
This patch creates a common bounce buffer in block.c which is shared by the cdrom and ahci drivers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-08-03Allow allocation of SMBIOS table in f-segment if it is small.Kevin O'Connor2-2/+11
If the SMBIOS is small (less than 600 bytes) allow it to be allocated in the f-segment. This works around a bug in JunOS - it crashes on SMBIOS tables located in high memory.
2011-08-03Allow free space in f-segment to be used by malloc_fseg().Kevin O'Connor2-1/+8
2011-07-29Warn if not enough space in smp_mtrr array.Kevin O'Connor1-1/+3
2011-07-29seabios: increase smp_mtrr array sizeMarcelo Tosatti1-1/+1
Windows Server 2008 checked build complains about lack of consistency between MTRR MSRs in SMP guests. Problem is the smp_mtrr array is not large enough to hold all MSRs (31 entries with current qemu/kvm implementations). Increase it to 32. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-07-24ahci: bootprio supportGerd Hoffmann2-6/+12
Wind up bootprio support in the ahci driver so boot device ordering works for ahci disks too. No extra work needed on qemu side. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-24ahci: rework init workflow & fix timeout handlingGerd Hoffmann1-62/+127
Rework init workflow to match suggestions in the ahci specs better, especially remove the shortcut which tries to detect drives without enabling FIS receiving. This makes memory allocation a bit complicated as we are using malloc_tmp() allocated memory now to probe the devices so we can free it when no drive is present. In case we detect a drive we have to free and realloc the memory with malloc_low() so it is available after POST when the boot loader wants read stuff via int13. Also use TSC to calculate timeout instead of delays and loop counts. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-24ahci: don't expect ATA_CB_STAT_DRQ being clearGerd Hoffmann1-3/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-24ahci: handle unaligned buffers.Scott Duplichan1-2/+51
This change allows unaligned buffers to be used for reads or writes to non-atapi devices. Currently only MS-DOS boot is known to need unaligned buffer support. Signed-off-by: Scott Duplichan <scott@notabs.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-24ahci: add error recovery codeGerd Hoffmann1-3/+47
By Scott Duplichan. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-24ahci: use interrupt status registerGerd Hoffmann1-15/+28
Poll interrupt status register to figure when the device has updated the status and possibly finished the request, continue polling until BSY is clear as we might see multiple status updates per request. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-24ahci/sata: Fix FIS setup.Gerd Hoffmann1-4/+3
FIS setup does't follow the SATA specs, fix it. Credits go to Jonathan Kollasch and Scott Duplichan for finding those. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-20xen: actually setup hypercalls.Ian Campbell1-0/+3
This was somehow dropped during the iterations of the original Xen patches. It's actually harmless at the moment since there are no users of hypercalls but patches are being written to support Xen PV block devices which need this. It's not clear exactly how early this needs to be but I think it needs to be at least before init_hw() (since that would detect disk devices). Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-07-16Remove 16bit wrappers from PMM code.Kevin O'Connor1-76/+55
Now that the PMM code is only run in 32bit mode, remove the GET/SET_PMMVAR macros and other 16bit wrappers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-16Run option rom visible PMM code in 32bit mode instead of 16bit mode.Kevin O'Connor5-14/+50
Use call32() to jump into handle_pmm(). This reduces the amount of 16bit code needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-12pci: set BUILD_PCIMEM_START to 0xe0000000Gerd Hoffmann1-1/+1
... and make it match with the declarations in acpi-dsdt.dsl. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-12pci: cleanup config.hGerd Hoffmann2-15/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-12pci: remove old pci initilaization codeGerd Hoffmann4-304/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-12pci: activate two-pass pci initialization codeGerd Hoffmann1-4/+34
This patch actually enables the two-pass pci initialization and deactivates the old pci initialization bits. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-12pci: add two-pass pci initialization codeGerd Hoffmann2-3/+319
This patch adds a second device scan to the pci initialization, which counts the memory bars of the various sizes and types. Then it calculates the sizes and the packing of the prefetchable and non-prefetchable pci memory windows and prints the results. The patch doesn't actually map the devices to make debugging easier. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-12Updates to TODO list.Kevin O'Connor1-8/+0
2011-07-12Fix compile error - remove bmp.c from being compiled twice.Kevin O'Connor1-1/+1
2011-07-10Rename the apm, pcibios, and elf entry points.Kevin O'Connor4-20/+20
Use a more consistent naming that matches entry_xxx to handle_xxx where possible. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Simplify POST entry code by moving reboot logic from post.c to resume.c.Kevin O'Connor5-146/+113
Detect a resume/reboot by inspecting HaveRunPost instead of inspecting the cmos reset code. Inspecting a global variable is both simpler and safer. Move the reboot logic from post.c to resume.c - this makes the code in post.c simpler as it is now only called once on machine startup. This also makes it easier to ensure all POST initialization code resides in the relocatable "init" sections. Also, rename _start() to handle_post() so that it is more in keeping with the entry_xxx() and handle_xxx() function naming. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Minor fix - check for malloc failure in USB cntl allocation.Kevin O'Connor3-0/+12
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Minor fix - make sure not to call ohci/uhci_init from irq handler.Kevin O'Connor1-0/+4
When CONFIG_THREAD_OPTIONROMS is enabled, accessing the PCI config space from a thread could potentially race with an option rom. Make sure the ohci/uhci_init() functions (which access PCI config space) are never run while an optionrom could also be running. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Fix serial port flushing code.Kevin O'Connor1-2/+2
debug_serial() was doing a full flush while debug_serial_flush() was only doing a partial flush. Fix that. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Remove now unneeded find_pci().Kevin O'Connor1-13/+0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Push use of 'struct pci_device' to bootprio_find_pci_rom().Kevin O'Connor3-5/+5
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Push use of 'struct pci_device' to bootprio_find_ata_device().Kevin O'Connor4-13/+16
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Push use of 'struct pci_device' to bootprio_find_fdc_device().Kevin O'Connor3-5/+5
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Push use of 'struct pci_device' to bootprio_find_pci_device().Kevin O'Connor3-6/+7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Push use of 'struct pci_device' to bootprio_find_usb().Kevin O'Connor3-6/+6
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-10Push 'struct pci_device' into USB code (instead of using u16 bdf).Kevin O'Connor9-40/+33
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-07-09Extend tools/readserial.py to support serial port timing calibration.Kevin O'Connor1-12/+61
Some serial ports have slightly different timing. These timing variations result in less accurate boot time reporting. So, add a calibration mechanism to the tool so that one can determine how much time a specific machine's serial port uses. Also, extend the main part of the tool to allow the user to specify an exact timing parameter.
2011-07-09Fix jpeg decoder problem when it is used in 24 BPP mode.Wayne Xia3-12/+26
Signed-off-by: Wayne Xia <xiawenc@linux.vnet.ibm.com>
2011-07-09Add an option to let seabios show BMP file as a logo.Wayne Xia4-28/+211
Signed-off-by: Wayne Xia <xiawenc@linux.vnet.ibm.com>
2011-07-05Add utility "tools/encodeint.py" for CBFS config file creation.Kevin O'Connor1-0/+21
2011-07-05Replace CONFIG_SCREEN_AND_DEBUG with "etc/screen-and-debug" file.Kevin O'Connor4-10/+6
2011-07-05Replace CONFIG_S3_RESUME_VGA_INIT with "etc/s3-resume-vga-init" file.Kevin O'Connor2-7/+4
2011-07-05Replace "CONFIG_OPTIONROMS_CHECKSUM" with "etc/optionroms-checksum" file.Kevin O'Connor2-12/+5
2011-07-05Replace CONFIG_PS2_KEYBOARD_SPINUP with "etc/ps2-keyboard-spinup" file.Kevin O'Connor2-10/+4
2011-07-05Replace CONFIG_EXTRA_PCI_ROOTS with dynamic "etc/extra-pci-roots" file.Kevin O'Connor3-15/+5
2011-07-05Replace CONFIG_BOOTMENU_WAIT with dynamic "etc/boot-menu-wait" file.Kevin O'Connor2-7/+4
2011-07-05Add "romfile" code to assist with extract integer config settings.Kevin O'Connor2-0/+20
Add romfile_loadint() function which can be used to extract a little-endian binary encoded integer from rom.
2011-07-02Replace CONFIG_PCI_ROOT1/2 with CONFIG_EXTRA_PCI_ROOTS.Kevin O'Connor2-18/+12
Instead of defining the bus id of each extra root bus, define the number of extra root buses. The bus id isn't necessarily stable from one boot to the next.
2011-07-02Rename foreachbdf_in_bus to foreachbdf and simplify it.Kevin O'Connor6-52/+26
Now that all callers of foreachbdf have been converted to foreachbdf_in_bus, simplify the pci_next() code - it no longer needs to track PCI bridges. Also, rename the remaining users of foreachbdf_in_bus to foreachbdf.
2011-07-02Convert remaining callers of foreachbdf to foreachbdf_in_bus.Kevin O'Connor2-72/+89
Convert the last few callers of foreachbdf to foreachbdf_in_bus. This is in preparation for simplification of foreachbdf_in_bus. Also add in addition debugging messages to pci_probe.
2011-07-02Convert pci_find_device/class to use 'struct pci_device'.Kevin O'Connor6-39/+38
2011-07-02Calculate vgahook responses during setup instead of in 16bit code.Kevin O'Connor4-158/+109
Do vga type and parameter detection during setup and store the necessary info in global variables for the 16bit code. This simplifies the "vgahook" 16bit code.
2011-06-21Use 'struct pci_device' to note which devices have native drivers.Kevin O'Connor3-3/+5
Remove the check in optionroms.c for CONFIG_ATA and PCI_CLASS_STORAGE_IDE with a flag in 'struct pci_device'. This ensures devices using the ATA driver that aren't in PCI_CLASS_STORAGE_IDE don't have their optionroms executed. It also allows other drivers to disable option rom execution in the future.
2011-06-21Convert pci_init_device to use 'struct pci_device'.Kevin O'Connor7-70/+77
2011-06-21Move pci_probe() call into pciinit() code.Kevin O'Connor2-3/+6
Call pci_probe after pci bridge setup and before pci device setup. This will allow the pci device setup to use 'struct pci_device'.
2011-06-21Use manual PCI search when making bios ram writable.Kevin O'Connor1-18/+13
During the ram unlock phase static variables can't be written, so don't rely on the higher level PCI searching functions. This will allow for future simplification of those high level search functions. This also limits the scan for the memory locking device to the first bus - the device should also be on the root bus.
2011-06-20Replace PCIPaths code with struct pci_device.Kevin O'Connor4-51/+24
2011-06-20Convert USB detection code to use struct pci_device.Kevin O'Connor2-23/+21
2011-06-20Convert AHCI detection code to use struct pci_device.Kevin O'Connor1-6/+6
2011-06-20Convert virtio detection to use struct pci_device.Kevin O'Connor1-7/+6
2011-06-20Convert mptable code to use struct pci_device.Kevin O'Connor1-4/+6
2011-06-20Convert ATA detection code to use struct pci_device.Kevin O'Connor1-10/+9
2011-06-20Convert option rom scan to use struct pci_device.Kevin O'Connor3-97/+55
2011-06-20Remove support for compiling in OPTIONROM_VENDEV_1/2.Kevin O'Connor2-15/+0
Passing in rom locations via absolute memory addresses hasn't been needed since coreboot adopted CBFS support (which as several years ago).
2011-06-20Find all pci devices at startup and cache them for future use.Kevin O'Connor3-0/+81
This adds 'struct pci_device' and pci_probe() which will locate and store all found PCI devices in the system at startup.
2011-06-19Rename foreachpci macro to foreachbdf.Kevin O'Connor10-26/+26
2011-06-19Add support for white-listing AHCI controllers as ATA compatible.Kevin O'Connor1-3/+19
To start, register the AMD ATA controller on the A50M chipset as compatible with ATA mode even if it comes up in AHCI mode.
2011-06-19Convert ATA pci scan to use pci_device_id table.Kevin O'Connor1-48/+56
2011-06-19Remove dev-i440fx.c/h - move code closer to its callers.Kevin O'Connor8-153/+109
It's easier to understand the code when it is in the same file as its callers.
2011-06-14Only allow CONFIG_XEN when not CONFIG_COREBOOT.Kevin O'Connor1-0/+1
2011-06-14Correct fseg allocation for SMBIOS tables.Ian Campbell1-1/+1
Anthony Perard noticed that grub was unhappy because it sees no low memory and that his e820 table was missing the first entry. He then pointed out this rather glaring error in the allocation of space for the SMBIOS tables. I've no idea why I didn't see this failure. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Tested-by: Anthony Perard <anthony.perard@citrix.com>
2011-06-13Add support for use as Xen HVM BIOS.Ian Campbell10-6/+332
SeaBIOS is called by Xen's hvmloader which does the basic platform setup (PCI, APIC, etc) and provides the various BIOS tables. Therefore avoid re-doing that setup and copy out the tables as necessary. A simple data structure is defined to pass the addresses of these tables. This patch also establishes the basic infrastructure to make hypercalls, although it currently only uses it to query the hypervisor version. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-06-13Move support for copying out BIOS tables into its own file.Ian Campbell4-76/+89
I'd like to use it for Xen support. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-05-29Fix OHCI keyboard repeat key issue.Kevin O'Connor1-1/+1
Mask toggleCarry and Halted flags in endpoint descriptor dword #2 so that the remaining head pointer field is valid for comparing with the next pointer. Signed-off-by: Scott Duplichan <scott@notabs.org> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-05-28Only show CONFIG_PS2_KEYBOARD_SPINUP when CONFIG_COREBOOT.Kevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-05-28Add option to handle PS2 keyboards that have a slow power up.Kevin O'Connor2-3/+20
Add PS2_KEYBOARD_SPINUP option to give certain keyboards more time to initialize. Based on report and feedback from: Sven Schnelle <svens@stackframe.org> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-05-24fix resume from S3 with QXL deviceKevin O'Connor2-708/+722
From: Gleb Natapov <gleb@redhat.com> QXL device is powered down during S3, so tell this to a guest OS in AML code. Signed-off-by: Gleb Natapov <gleb@redhat.com>
2011-05-21Check for broken LD that ships with Ubuntu 11.04.Kevin O'Connor2-3/+36
Add a build test to ensure that LD can properly align sections.
2011-05-14Print E820 type names as well as numbers, as a debug aidIan Campbell1-2/+16
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-05-10Add Kconfig option to specify which serial port when serial debugging.Kevin O'Connor2-8/+13
2011-05-10Add config option (CONFIG_BOOTORDER) to disable bootorder support.Kevin O'Connor2-0/+22
2011-05-07Move ps2ctr manipulation from mouse.c to ps2port.c.Kevin O'Connor2-21/+14
This simplifies the mouse.c code. It also prevents USB mouse interaction from changing the ps2 port setup.
2011-05-07Minor Kconfig help update.Kevin O'Connor1-0/+5
2011-05-07Fix struct bregs - it shouldn't have multiple members with the same name.Kevin O'Connor1-3/+3
This fixes a compile error on gcc 4.6.
2011-03-06Add config option to permit running option roms with bad checksums.Kevin O'Connor2-1/+13
Based on a patch by: Stefan Reinauer <reinauer@google.com>
2011-03-06Add config option to disable MTRR initialization.Kevin O'Connor2-1/+7
Some versions of Bochs don't like the MTRR initialization, so add CONFIG_MTRR_INIT to control whether SeaBIOS will touch the MTRRs.
2011-03-06Prep version for next release.Kevin O'Connor1-1/+1
2011-02-28Update version to 0.6.2Kevin O'Connor1-1/+1
2011-02-04lets pretend that RTC can be used to wakeup from S4Gleb Natapov1-2/+2
WHQL complains otherwise. Signed-off-by: Gleb Natapov <gleb@redhat.com>
2011-01-30Expand user configurable parameters in Kconfig.Kevin O'Connor2-113/+347
Move most of the config settings in config.h to the Kconfig file. The remaining settings in config.h, are mostly build related.
2011-01-29Support non-local build directory - allow "make OUT=abc/" to work.Kevin O'Connor4-5/+6
Don't require the build directory to be the "out/" directory of the SeaBIOS source.
2011-01-29The vgabios build must depend on autoconf.h.Kevin O'Connor1-1/+1
2011-01-29fix parallel compilation of SeaBIOSStefan Reinauer1-1/+4
See patch. Signed-off-by: Stefan Reinauer <reinauer@google.com>
2011-01-29Start using Kconfig to configure SeaBIOS settings.Kevin O'Connor4-12/+30
Create autoconf.h during the build. Move a couple of config settings from config.h to Kconfig.
2011-01-29Change kconfig to emit disabled symbols in autoconf.h.Kevin O'Connor1-1/+10
Always emit CONFIG_X definitions in autoconf.h - set them to 0 when they are disabled.
2011-01-29Build changes for Linux kconfig code to work in seabios dir structure.Kevin O'Connor5-26/+48
2011-01-26Initial commit of Kconfig build tool.Kevin O'Connor40-0/+22689
This is a pure copy of the tool from the Linux v2.6.38-rc2 scripts/kconfig/ directory.
2011-01-26Minor boot fixes.Kevin O'Connor2-1/+1
2011-01-22Minor comment / code layout improvement to romlayout.S.Kevin O'Connor1-17/+18
2011-01-22Fix to prevent infinite loop in build_pci_path().Kevin O'Connor1-2/+3
Make sure the PCI path doesn't point to itself.
2011-01-16support T13 EDD3.0 specGleb Natapov2-18/+39
Some guests (such as Linux) expect BIOS to behave according to T13 EDD3.0 spec. T13 spec is much better then Phoenix since it provides more information about interface and device paths. This patch adds support for the spec. If guest provides buffer with enough space for T13 EDD info return EDD according to T13 spec otherwise use Phoenix one. Signed-off-by: Gleb Natapov <gleb@redhat.com>
2011-01-10Add ability to track PCI paths and add to build_pci_path().Kevin O'Connor4-5/+47
Improve device path descriptions of devices on PCI buses.
2011-01-08Move the CBFS payload setup to later in the boot.Kevin O'Connor3-3/+4
Don't try to register payloads until after malloc has been setup.
2011-01-08Extract space trimming code from ATA and use in USB and bootorder code.Kevin O'Connor5-11/+21
Introduce function nullTrailingSpace() that nulls blank characters from the end of a string. Use this function in the ATA, USB MSC, and bootorder code.
2011-01-05seabios: acpi: add _RMV control method for PCI devicesKevin O'Connor2-771/+999
Use _RMV method to indicate whether device can be removed. Data is retrieved from QEMU via I/O port 0xae0c. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Gleb Natapov <gleb@redhat.com>
2011-01-01Add support for finding the boot priority of USB drives.Kevin O'Connor3-3/+25
Use the device path of the USB device to find a bootorder entry.
2011-01-01Extend 'usb_pipe' to track the controller and ports of each device.Kevin O'Connor5-0/+9
Track the path of ports and controller of each usb device. This is useful for reporting the exact device path.
2011-01-01Add functions for boot device path parsing.Kevin O'Connor1-13/+95
Add functions that find boot device path for pci/ata/floppy/rom devices.
2010-12-30Use bootprio_find_named_rom() for ramdisk and cbfs payload priorities.Kevin O'Connor2-5/+6
2010-12-29Remove drive->desc field.Kevin O'Connor12-94/+114
The description field is only available during the POST phase - it is confusing to have it live in a structure available through all phases. The description was only used by the boot menu code - pass each drive description directly to the bootlist code. Add a helper (znprintf) to automatically malloc_tmp the required space. Also, fixup ramdisk handling - it was using an incorrect floppy priority.
2010-12-29Minor reorganization of some of the boot_xxx code in boot.c.Kevin O'Connor1-18/+25
2010-12-29Move IPL.fw_bootorder to static variables in boot.c.Kevin O'Connor2-18/+9
2010-12-29Move IPL.bev to static variables in boot.cKevin O'Connor2-26/+19
Move the BEV storage to static variables in boot.c. Also, increase the maximum number of BEV entries from 8 to 20.
2010-12-29Move IPL.checkfloppysig to a global (CheckFloppySig) in boot.c.Kevin O'Connor2-4/+4
2010-12-29Remove Drives global struct in favor of independent global variables.Kevin O'Connor4-20/+15
The "Drives" struct just held three global variables - declare the three global variables independently.
2010-12-29Don't access drive_g->desc from boot_cdrom().Kevin O'Connor1-1/+1
The drive description is allocated with malloc_tmp() and is thus only available during the POST phase - boot_cdrom() is called during the boot phase.
2010-12-29Simplify keyboard reading code in the interactive boot menu.Kevin O'Connor1-16/+16
2010-12-27Call setup_translation() from map_hd_drive().Kevin O'Connor6-11/+4
Unify the calling of setup_translation().
2010-12-27Rename add_ordered_drive() to add_drive() and use in map_hd_drive().Kevin O'Connor1-25/+18
2010-12-27Add stubs to permit devices to specify their boot priority.Kevin O'Connor10-53/+122
Add support for passing in priorities to bootlist system. Based on patch by: Gleb Natapov <gleb@redhat.com>
2010-12-27Simplify boot ordering by building an inclusive boot list.Kevin O'Connor10-308/+216
Replace the bcv list with a full list of all "bootable objects". All ordering can then be done on this list. The final boot menu, drive mapping, and BEV list generation is then driven from this authoritative list. Move "Floppy" and "DVD/CD" description prefixes into drive description generation code to simplify boot menu generation. Rework QEMU's CMOS defined bootorder to work with priority scheme in new boot list. Have every CBFS entry create it's own BEV entry (instead of one entry for all CBFS payloads). Move CBFS payload detection code into coreboot.c.
2010-12-26Populate drive_g->desc prior to calling add_bcv_internal().Kevin O'Connor2-8/+5
Make sure the description is populated before registering a drive.
2010-12-26pciinit: fix off-by-oneIsaku Yamahata1-1/+1
IO port ends at 64K - 1. not 64K. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2010-12-26Minor build fixes.Kevin O'Connor2-2/+2
I made these two tiny changes to SeaBIOS when I was playing with the HEAD version. The Makefile change prevents the test command from failing if CC contains a space. The coreboot change prevents a warning on our gcc 4.5.2 in certain circumstances when sizeof seems to be unsigned long int instead of unsigned int. They're both unintrusive, shouldn't have potential for breaking anything. Signed-off-by: Stefan Reinauer <stepan@coreboot.org>
2010-12-24Track the source of each optionrom deployed.Kevin O'Connor1-10/+24
It's useful to track where each optionrom in the system originated from when initializing bev/bcvs. So, keep a map of the rom address to its source.
2010-12-24Support qemu based romfile wrappers called out of order.Kevin O'Connor1-6/+23
If the file requested isn't the last file read, then reread the index to find the given file.
2010-12-24Breakup boot_setup() bootorder code into its own function.Kevin O'Connor1-30/+41
2010-12-24Add romfile_loadfile() helper function.Kevin O'Connor4-23/+34
Add function to find, malloc, and copy a romfile. Use it in the bootsplash and bootorder code.
2010-12-24Read bootorder file into memory.Gleb Natapov2-0/+47
Read bootorder file, parse it and put it into array for easy consumption. Signed-off-by: Gleb Natapov <gleb@redhat.com>
2010-12-24Add strchr() function.Kevin O'Connor2-0/+10
2010-12-24Add romfile_name() function.Gleb Natapov2-0/+14
romfile_name() return file name given file handler. Works for qemu and coreboot. Signed-off-by: Gleb Natapov <gleb@redhat.com>
2010-12-24Add BAID for ahci cdrom.Gleb Natapov1-1/+3
Signed-off-by: Gleb Natapov <gleb@redhat.com>
2010-12-24Provide full EDD 3.0 info for virtio diskGleb Natapov1-53/+73
Fill out entire EDD 3.0 structure for virtio disk. Currently only EDD 1.0 part is filled which is missing such important info as device path. Use SCSI device type since virtio is not defined by EDD spec and virtio disk pci device uses SCSI class. Signed-off-by: Gleb Natapov <gleb@redhat.com>
2010-12-24Enhance layoutrom.py to work around a binutils quirk.Kevin O'Connor1-1/+10
Some binutils (report of 2.20.1) don't create dummy symbols for each section - work around that.
2010-12-12Create separate IPL entry for each CD/DVDGleb Natapov6-13/+52
Current code creates only one IPL entry of type IPL_TYPE_CDROM even if there are more then one CDROM drive present. If CDROM that the entry refers to is not bootable there is no way to retry boot from another CDROM. Fix this by creating IPL entry for each CDROM drive found. First CDROM will always be placed in IPL entry 3 for backwards compatibility. Signed-off-by: Gleb Natapov <gleb@redhat.com>
2010-12-12ahci: set controller idGerd Hoffmann1-0/+1
Fill the controller id in the drive struct with the port number so we get a sane boot menu ordering with multiple hard disks attached. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-12ahci: fix off-by-one in port countGerd Hoffmann1-1/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-12ahci: enable io/mem/dmaKevin O'Connor1-0/+3
Make sure IO, MMIO and DMA are enabled in pci config space before using the device. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-12ahci: set dma feature flagGerd Hoffmann1-0/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-05Check if capability enabled in XXX_cmd_data functions.Kevin O'Connor3-0/+9
Make sure to check if CONFIG_AHCI, CONFIG_ATA, CONFIG_USB_MSC is enabled in their respective cmd_data functions. This reduces the compile size when they are not enabled.
2010-12-05Require a "_cfuncXX_" symbol prefix for inter-mode c function references.Kevin O'Connor6-36/+47
The compiler can get confused when referencing a C function in a different mode. (It reasonably assumes that the C function in the current mode is desired.) To avoid this compiler confusion, introduce symbol prefixes (_cfunc16_, _cfunc32flat_, _cfunc32seg_) that must be used on C function symbols that are referenced from other compilation modes. This makes it less likely compiler confusion will occur. It will also makes it easier to implement and use vtable like operation structures.
2010-12-05add ahci supportGerd Hoffmann8-1/+688
This patch adds AHCI support to seabios. Tested with virtual hardware only (upcoming ahci support in qemu). Coded by looking at the recommandations in the intel ahci specs, so I don't expect much trouble on real hardware. Tested booting fedora install from hard disk and a opensuse live iso from cdrom. [ v2: disable by default ] [ v2: add check for malloc failure ] [ v2: wind up disk write support ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-05ata: make helpers availableGerd Hoffmann2-9/+13
Make ata helper functions available outside ata.c, so others (i.e. upcoming ahci support) can use them. Prefix them with ata_ to avoid name clashes. Also don't hard-code buffer size for the model name. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-05util: add memset_fl()Gerd Hoffmann2-0/+10
2010-12-05pci: add helper functions for mmio bar access from real mode.Gerd Hoffmann2-0/+55
This patch adds helper pci_readl and pci_writel which can be used to access pci mmio bars from real mode. They work in 32bit mode too. ahci support needs this, also ohci for bulk transfers, and probably more devices in the future. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-11-25Enhance call32() to pass a parameter to called function.Kevin O'Connor2-9/+10
Support passing a parameter to the 32bit function, as well as returning the result of the function back to the 16bit code. Also, make call32 available outside of stacks.c.
2010-11-25Don't pass return address to transition(32,16,16big) on stack.Kevin O'Connor4-8/+14
It's difficult to have a uniform view of the stack when transition modes, so pass the return address in a register. As a result, the transition functions only access memory via the %cs selector now.
2010-11-13pciinit: use pci_region functions.Isaku Yamahata1-62/+60
This patch cleans up pci region allocation with pci_region. Now it is aware of overflow. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2010-11-13pci: introduce pci_region to manage pci io/memory/prefmemory regions.Isaku Yamahata3-1/+108
This patch adds helper functions to manage pci area. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2010-10-20mark irq9 active high in DSDTKevin O'Connor2-981/+1041
In PIIX4 SCI (irq9) is active high. Seabios marks it so in interrupt override table, but some OSes (FreeBSD) require the same information to be present in DSDT too. Make it so. Signed-off-by: Gleb Natapov <gleb@redhat.com>
2010-10-17Report meaningful error if pyserial not present in tools/readserial.pyKevin O'Connor1-1/+9
2010-09-26Show size of non-relocatable runtime code during build.Kevin O'Connor1-2/+5
2010-09-25Cleanup - it's no longer necessary to manually reset global variables.Kevin O'Connor17-79/+7
Now that a soft-reboot forces a hard-reboot, it is no longer necessary to manually reset global variables.
2010-09-25Allow rom to grow to 256K.Kevin O'Connor2-7/+8
Enable rom size to be over 128K. Apparently, only the first 128K of the rom are mirrored to the 0xc0000-0xfffff area under qemu, so make sure to copy the rom (via make_bios_writable) in the non-init part of the startup code. This ensure the copy code is itself available.
2010-09-25Fix typo preventing relocated space from being used for option roms.Kevin O'Connor1-1/+1
2010-09-25fix virtio-blk failure after rebootGleb Natapov1-0/+1
vring_virtqueue should be zeroed otherwise old values will be reused after reboot. Signed-off-by: Gleb Natapov <gleb@redhat.com>
2010-09-25Add a debug method to AML code.Kevin O'Connor2-996/+1016
Add DBUG() method to AML - it can write output to the standard qemu bios debug port (port 0x402).
2010-09-25Warn that ohci bulk is not supported.Kevin O'Connor3-2/+19
Print a meaningful warning message when trying to use OHCI bulk.
2010-09-25Enable optionroms to use freed space due to CONFIG_RELOCATE_INIT.Kevin O'Connor2-12/+11
The space in the e-segment is available for option roms after relocating the init code. Also, zero all of the option rom space when !CONFIG_OPTIONROMS_DEPLOYED.
2010-09-25Move the 32bit init code to high memory at runtime.Kevin O'Connor2-2/+58
Add support for moving the 32bit init code out of the e/f-segments and into temporary ram. Update the relocations in the code so that it can live at its new address. This frees up memory for other uses in the e/f segments.
2010-09-15Move init code from _start() to post().Kevin O'Connor2-34/+60
Move the shadow calls from _start() to post() - this ensures all the one time init code is in post(). Also, reorg post so that malloc setup is done before ivt/bda/ebda setup. This is in preparation for relocating the 32bit flat init code.
2010-09-15Add memalign_tmp() helper function.Kevin O'Connor1-0/+9
2010-09-15Try to hard-reboot on rerun of post even on emulators.Kevin O'Connor5-13/+40
Extend the hard-reboot logic to qemu and kvm. On qemu, a reboot will not reset the memory settings for 0xc0000-0xfffff, so copy that memory area manually before rebooting. Unfortunately, kvm does not keep a pristine copy of the BIOS at 0xffff0000, so detect that case and shutdown the machine.
2010-09-15Don't do shadow copying of optionroms when CONFIG_OPTIONROMS_DEPLOYED.Kevin O'Connor1-17/+10
When CONFIG_OPTIONROMS_DEPLOYED is set, there is no need to copy the 0xc0000-0xf0000 space around - SeaBIOS ignores what's there when it that mode.