aboutsummaryrefslogtreecommitdiffstats
path: root/src/optionroms.c
Commit message (Collapse)AuthorAgeFilesLines
* Add stubs to permit devices to specify their boot priority.Kevin O'Connor2010-12-271-5/+20
| | | | | | Add support for passing in priorities to bootlist system. Based on patch by: Gleb Natapov <gleb@redhat.com>
* Simplify boot ordering by building an inclusive boot list.Kevin O'Connor2010-12-271-3/+3
| | | | | | | | | | | | | | | | | 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.
* Track the source of each optionrom deployed.Kevin O'Connor2010-12-241-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.
* Cleanup - it's no longer necessary to manually reset global variables.Kevin O'Connor2010-09-251-4/+1
| | | | | Now that a soft-reboot forces a hard-reboot, it is no longer necessary to manually reset global variables.
* Fix typo preventing relocated space from being used for option roms.Kevin O'Connor2010-09-251-1/+1
|
* Enable optionroms to use freed space due to CONFIG_RELOCATE_INIT.Kevin O'Connor2010-09-251-7/+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.
* Initial bootsplash support.Kevin O'Connor2010-06-281-11/+1
| | | | | | Support displaying a jpeg file (stored in cbfs) during bootup. Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
* Unify optionrom cbfs/qemu_cfg rom pulling code.Kevin O'Connor2010-06-131-30/+12
| | | | | | | | Make the qemu_cfg optionrom extraction code use an interface more similar to the cbfs file interface. Introduce a set of "romfile_" wrappers that select between cbfs and qemu cfg interface. Use these new wrappers in the optionrom code.
* Improve optionrom debugging statements.Kevin O'Connor2010-05-231-5/+7
| | | | Display device/vendor ids in traditional format.
* Some improvements to optionrom preemption support.Kevin O'Connor2010-04-021-0/+2
| | | | | | | | | | | | | | | | | | | | Enable preemption during VGA mode switch call - this call can take several milliseconds on real hardware. Call yield() in finish_preempt() - when preemption is configured it allows threads in wait_preempt() to run; when not configured it gives an opportunity for threads to execute after the implicit delay from optionrom execution. Don't penalize priority in run_thread(). The run_thread() code would implicitly yield because it created the new thread on the list after the current thread and then jumped to it. When in a preemption event, a yield effectively waits approximately one millisecond (to the next rtc irq). The implicit yielding in run_thread thus limited the number of threads one could launch during preemption to 1 per millisecond. So, change the code so that the new thread is created prior to the current thread - thus eliminating the effective yield from run_thread().
* Introduce standard warnings for allocation failures and timeouts.Kevin O'Connor2010-02-141-1/+1
| | | | | There is no need for custom warnings for many common failures. Introduce a common warning which is consistent and more visible.
* Be sure to add "void" to all function prototypes that take no args.Kevin O'Connor2010-01-031-4/+4
| | | | Omitting "void" leads to a K&R style declaration which was not intended.
* Add support for 32bit PCI BIOS entry.Kevin O'Connor2009-12-301-3/+3
| | | | | | | | | Create a new code blob (code32seg) with support for 32bit functions that need to utilize explicit segment accesses. This code blob uses global variables relative to %gs and with a dynamic code offset (determined by get_global_offset()). Add BIOS32 structure and code. Add code for 32bit PCI BIOS code.
* qemu: add rom loading via fw_cfgGerd Hoffmann2009-12-181-0/+23
| | | | | | | | | Add support for loading roms using the qemu fw_cfg interface, modeled after the existing cbfs support. Use it to look for vgabios (vgaroms/*) and option roms (genroms/*). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Enhance experimental option rom "threading" - enable preemption.Kevin O'Connor2009-12-131-0/+2
| | | | | | | | | | | | | When experimental support for parallelizing option roms and hardware init (default disabled) is selected, add support for checking on hardware init progress from the RTC irq handler. Enable ability for RTC to be turned on for additional users. Allow regular option roms (not just vga option roms) to run in parallel with hardware init. Don't use stack in transition32 / transition16 until new mode is entered. Also, cleanup leaking of data handlers in usb code. Also, decrease frequency of iomemcpy checks (every 2K instead of 1K).
* Introduce optimized iomemcpy function for copying from io memory.Kevin O'Connor2009-12-051-1/+1
| | | | | | | | Reading from IO memory (pci rom or flash) is very slow, so add iomemcpy() which will yield during copy. Use a 4 byte copy to optimize accesses. Also, decompress cbfs data files from a temp memory buffer so that ulzma doesn't read from slow IO memory.
* Interrupts should be enabled when calling 16bit code.Kevin O'Connor2009-09-241-0/+2
| | | | | Set most code paths to have interrupts on when calling 16bit code. This fixes at least one optionrom that needed irqs on.
* Allow rom to grow beyond 64K.Kevin O'Connor2009-09-201-5/+14
| | | | | | | | | | | | | | | | | | If rom is over 64K then use part of e-segment for 32bit code. Push 32bit code as high as it can go in the f-segment. Do version building before layoutrom.py - this way layoutrom knows full size of rom. Make layoutrom.py build the full ld script - remove now unused ld scripts that just imported the output of layoutrom.py. Also, use "objdump" instead of "nm" - reduce toolchain requirements. Enhance tools/checkrom.py so that it can pad bios.bin to size qemu is happy with. Also, add dependencies to build rules for local tools - if tool changes automatically rerun it. Make sure option roms don't overwrite the 32bit code (should the 32bit code be in the e-segment). Make sure shadow code works even if part of the code is in the e-segment.
* Add mechanism for describing internal drives in boot menu.Kevin O'Connor2009-09-121-1/+1
| | | | | | | | Allow each drive type to describe itself on the boot menu. This fixes a bug where driveid was used in place of ataid in the boot menu. Also, expand descriptions for each drive type. Don't overload the IPL type for BCVs - instead introduce new types.
* Replace common segment/offset pairs with struct segoff_s.Kevin O'Connor2009-09-091-2/+1
| | | | Introduce 'struct segoff_s' to more places.
* Further simplify cbfs functions - don't pass iscomp to callers.Kevin O'Connor2009-08-181-4/+2
| | | | | The cbfs data copy function can determine if the file is compressed on its own - it doesn't need the iscomp parameter passed in.
* Rework coreboot cbfs interface for added flexibility.Kevin O'Connor2009-08-161-5/+8
| | | | | Allow callers to track the cbfs_file pointer. Also, remove obsolete code for brute-force flash scanning.
* Add auto-generated version info to each build.Kevin O'Connor2009-07-291-4/+4
| | | | Add versioning info to initial debug and screen banner output.
* Add support for enabling ram in 0xc0000-0xf0000 area.Kevin O'Connor2009-07-261-22/+22
| | | | | | | | | | Enhance shadow ram support to enable read/write of option rom area. This enables support for option roms that modify themselves. Support copying the roms before enabling shadowing, to work around the qemu implementation of ram shadowing. Rename next_rom to RomEnd and export it. Support locking ram being used for optionroms before booting. Don't bother and'ing/or'ing 0x59 register - it's usage is well defined.
* Only run the vga option rom of an enabled vga device.Kevin O'Connor2009-07-191-1/+1
| | | | | Find the vga device with legacy range decoding enabled. This should allow multiple vga cards in the same machine to work properly.
* Expand int155f "vgahook" detection.Kevin O'Connor2009-07-191-1/+2
| | | | | | Verify VGA card vendor is via before supporting via 155f calls. Add support for future code depending on coreboot board id. Add code for via VX855 memory size and speed detection.
* Add option for running vga rom during s3 resume.Kevin O'Connor2009-07-041-0/+11
| | | | | Add support for running the vga rom when the option CONFIG_S3_RESUME_VGA_INIT is set (default is off).
* Optionrom code cleanup.Kevin O'Connor2009-07-041-76/+82
| | | | | | | | | | | | | Nearly all calers of callrom() use OPTION_ROM_INITVECTOR - make it default. Prefer (void*) to explicit casts. Rename init_optionrom to init_pcirom; rename verifysize_optionrom to init_optionrom. Add 'isvga' parameter to init_optionrom/init_pcirom; unify vga call path to use these functions. Extract cbfs directory scanning into new function run_cbfs_roms(). Allow roms in "vgaroms/" to run even if no pci vga device exists. Comment improvements.
* Support running non-pci specific vga option roms from CBFS.Kevin O'Connor2009-06-171-2/+15
| | | | Load option roms from the "vgaroms/" CBFS directory during VGA scan.
* Add support for gcc v3.x compilers.Kevin O'Connor2009-06-101-1/+1
| | | | | | | | Suppress __attribute__((externally_visible)) when no -fwhole-program Add switch hack for compilers without -fno-jump-tables Define memcpy() function (for compilers without -minline-all-stringops). Define call16_simpint as a macro (a param needs to be inlined). Make sure s3_resume is only defined in 32bit mode.
* Add support for field width argument to %x (eg, %08x).Kevin O'Connor2009-05-051-3/+6
| | | | Patch from Stefan Reinauer; modified by Kevin O'Connor.
* Add ability to run all option roms in CBFS directory "genroms/".Kevin O'Connor2009-04-301-13/+29
|
* Add support for compressed option roms.Kevin O'Connor2009-04-271-4/+5
|
* Fixup previous memcpy optimization.Kevin O'Connor2009-04-191-1/+1
| | | | | | | Different gcc versions handle __builtin_memcpy differently. Add -minline-all-string to force inlining of memcpy on old gcc. Always use __builtin_memcpy for all memcpy calls. Use memcpy4() for the option rom case where 4-byte accesses is important.
* Try to prevent mapping option roms over flash.Kevin O'Connor2009-04-181-1/+3
| | | | Don't map an option rom in last 4MiB of ram or at its max.
* Minor - add more debugging output to option rom scanning.Kevin O'Connor2009-04-161-1/+4
|
* Make sure optionroms have a non-zero size before using them.Kevin O'Connor2009-04-131-0/+2
|
* Initial support for finding option roms in coreboot flash layout.Kevin O'Connor2009-04-111-11/+17
| | | | | | | Add code to search for roms in the "coreboot file system". Change hardcode option rom detection to use vendor/deviceid instead of bus/device/fn. Move streq() function to generic place so cbfs functions can use it.
* Minor - change checksum functions to take a (void *).Kevin O'Connor2009-02-151-1/+1
| | | | This reduces the casts in calling code.
* Add support for selecting harddrive order in boot menu.Kevin O'Connor2009-02-081-4/+10
| | | | | | | | | Save ATA harddrive model name so that it can be shown from menu. Minor - use "ata0-1" not "ata0 slave". Fill fdpt info based on BIOS drive id - not the controller id. Add BCV support to IPL code. Use "BCV" system to set harddrive order (for both ata and option roms). Also, don't show floppy/cdrom in boot menu if no drives found.
* Reorganize boot code.Kevin O'Connor2009-02-081-25/+1
| | | | | | | | | Simplify keyboard handling in post_menu.c, and move to util.c. Move remaining functions in post_menu.c to boot.c; remove post_menu.c. Also, remove broken check for F12 when in boot menu. Move BEV setup code from post.c to boot.c. Move option rom BEV adding code from optionroms.c to boot.c. Avoid calling BX_PANIC during boot if there is an alternative.
* Rename MAKE_FARPTR (and similar) to MAKE_FLATPTR.Kevin O'Connor2009-01-191-4/+4
| | | | | | | | The term "far pointer" is used in many 16bit specs, and it is different from what MAKE_FARPTR creates. So, use the term "flat pointer" in the code to distinguish between the two meanings. Also, use the suffix "_fl" consistently when working with "flat pointers".
* Change license from GPLv3 to LGPLv3.Kevin O'Connor2009-01-151-1/+1
| | | | | | | | Change license of contributions from Kevin O'Connor from GPLv3 to LGPLv3 (or later). Since the work as a whole is based on Kevin's contributions and the "bochs bios" which has a license of LGPL (v2 or later), this effectively makes the work as a whole available under LGPLv3 (or later).
* Move IPL definitions from ebda to global variables.Kevin O'Connor2008-12-281-5/+6
| | | | | The boot sequence variable remains in ebda. Move boot specific definitions to a new header (boot.h)
* Support a relocatable ebda segment.Kevin O'Connor2008-12-261-6/+1
| | | | | Some option roms will try to relocate the ebda. Also fix an apparent typo in the assignment of ivecs[0x46].
* Initial PnP bios call support.Kevin O'Connor2008-12-211-6/+3
| | | | This commit provides just enough PnP support for gPXE to not hook int19.
* Support multiple BCVs in a single option rom.Kevin O'Connor2008-12-201-3/+19
|
* Call option roms in "big real mode".Kevin O'Connor2008-12-061-2/+1
|
* Add additional PCI option rom checks.Kevin O'Connor2008-12-061-14/+29
| | | | | | | | PCI_ROM_ADDRESS is only valid for PCI_HEADER_TYPE_NORMAL devices. Don't attempt to run a rom with address less than 16MiB. Don't run roms for IDE code when native IDE support is available. Also, move hardcode option rom defs to config.h. Also, add some minor code cleanups.
* Don't allow start_bdf with new auto max bus detection code.Kevin O'Connor2008-12-041-2/+2
| | | | | | | | It's not valid to set a "start bdf" when search for a device now, because we wont be able to properly detect the maximum bus unless we start at the beginning. Change callers that need to resume a search to use foreachpci() macro. Update all callers so that they don't pass in the now unused start_bdf.