aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* output: Add 64bit hex print support.Kevin O'Connor2012-03-063-36/+47
| | | | | Based on patch by Gerd Hoffmann <kraxel@redhat.com>. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Fixup missing includes.Kevin O'Connor2012-03-062-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Free USB MSC pipes on error.Kevin O'Connor2012-02-201-1/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Register drives directly in scsi_init_drive().Kevin O'Connor2012-02-183-49/+18
| | | | | | | | The scsi_init_drive() function has enough information to directly register the drive there, so do the registration there. This simplifies the calling code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Running vgabios during resume from S3 on QEMU by defaultGleb Natapov2012-02-181-1/+1
| | | | | | | | | | | Run vgabios during resume from S3 by default on QEMU. QEMU still able to modify SeaBIOS behavior if it wishes so by providing etc/s3-resume-vga-init file. With QEMU emulated vga cards this behaviour is desirable otherwise console becomes unusable with Linux guests after resume. Since we control vgabios source we can be sure that running it on resume from S3 is safe. Signed-off-by: Gleb Natapov <gleb@redhat.com>
* Fix missing NULL pointer checks causing boot failure on 1meg machines.Kevin O'Connor2012-02-152-1/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Direct compile 16bit C code instead of including via .S files.Kevin O'Connor2012-02-112-9/+3
| | | | | | | | | | | | Create a ".code16gcc" directive in src/code16gcc.s and use -Wa,src/code16gcc.s to tell gcc to compile directly to 16bit code. This eliminates the need to compile the C code to assembler and include in romlayout.S and vgaentry.S. This also allows those two assembler files to be compiled with debugging (-g) enabled. Also, includes some Makefile cleanups. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* disk: handle LBA I/O with zero sector countKevin O'Connor2012-02-111-0/+5
| | | | | | | | | Unlike basic_access, extended_access does not check for a zero sector count. However, this is a problem because for example it would be interpreted as 256 when processing an ATA request. Based on patch from: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cleanup process_usb_op() / process_scsi_op() declarationsLaszlo Ersek2012-02-112-2/+1
| | | | | | | | | | | | | Commit 1e749c85 removed the definition of process_usb_op(); let's remove the declaration too. The same commit added process_scsi_op(). The function has no declaration that is also not a definition, and its only call site is in the same file as the definition. Give the function internal linkage. Build tested. Signed-off-by: Laszlo Ersek <lersek@redhat.com>
* Xen: Use VGA Hooks to make VGA passthrough work on certain devicesJulian Pidancet2012-02-053-3/+22
| | | | | | | | | | | The Intel gfx VGA option ROM on certain platforms requires the 155f50 BIOS function to be implemented (even if it does nothing), to work properly. v2: Ignore the case where Option ROMs are pre-deployed. Make vgahook_setup independent of wether the CB* variables are set. VGA hooks can be enabled on non-coreboot and non-Xen configurations. Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
* Introduce config option to select which IO port to send debug output onJulian Pidancet2012-02-012-2/+19
| | | | | | | | | | Introduce CONFIG_DEBUG_IO_PORT config option which allow user to choose on which port to send debug on at configure time. Bochs users are likely to use 0x402 (default) for debugging purposes, whereas Xen uses 0xe9, as IO port address. Signed-off-by: Julian Pidancet <julian.pidancet@citrix.com>
* mask interrupts on S3 resumeGleb Natapov2012-02-011-0/+1
| | | | | | | | | | i8259 clears interrupt mask on reset. Interrupt need to be masked again before enabling interrupts on CPU. Since option roms are called with interrupts enabled, resume should mask interrupts in i8259 before calling vgabios. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add TSC emulation layer for 386/486 CPUs.Kevin O'Connor2012-02-013-7/+62
| | | | | | | Original patch from Rudolf Marek. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Detect CPUID instruction before using it.Kevin O'Connor2012-02-015-9/+28
| | | | | | | | | | Enable SeaBIOS to work on 386/486 machines that don't have CPUID instruction. Based on patch by Rudolf Marek. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Check for CONFIG_PS2PORT on all entry ps2 function entry points.Kevin O'Connor2012-02-011-0/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Move vgabios Kconfig definitions to vgasrc/Kconfig.Kevin O'Connor2012-01-161-78/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Build vgabios by default if enabled in Kconfig.Kevin O'Connor2012-01-161-1/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Improve vgabios Kconfig menu.Kevin O'Connor2012-01-161-25/+39
| | | | | | | | | | | Place driver types in a "choice" selection - only one driver type makes sense. Only prompt the user for PCI Vendor/Device ids if they wish to override the default choices. Otherwise, Kconfig wont know to use the proper defaults when building autoconf.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* BCVs should inherrit the legacy harddrive priority.Kevin O'Connor2012-01-141-1/+1
| | | | | | | | A BCV will (almost assuredly) be a hard drive, so it makes sense to prioritize them the same as builtin hard drives when only the legacy priority system is used. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Permit multiple BEV and BEV/BCV combinations in a single option rom.Kevin O'Connor2012-01-141-11/+10
| | | | | | | | | The BBS spec is unclear on multiple BEV entry points for a rom. However, the LSI scsi rom has been seen to register a BEV followed by multiple BCV entry points. Add support for it, as there's no harm in it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Add the geode GX2 functionality.Nils2012-01-141-0/+8
| | | | Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
* vgabios: Some little geode cleanup.Nils2012-01-141-2/+2
| | | | Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
* vgabios: Make the naming in the LX code generic to Geode.Nils2012-01-141-1/+1
| | | | Signed-off-by: Nils Jacobs <njacobs8 at adsltotaal.nl>
* vgabios: Minor fixes to struct vbe_info definition.Kevin O'Connor2011-12-301-3/+3
| | | | | | | | | | | | Although the VBE3 spec says there is 189 bytes of pad at the end of the vbe_info struct, the spec also says the total struct size should be 256 bytes. The VBE2 spec uses sufficient pad to get to 256 bytes. So, assume the spec was off by one and make the pad 190 bytes. Also, use u32 for capabilities and 'struct segoff_s' for win_func_ptr. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Don't leave upper bits of 64bit BARs unitialized during pci init.Kevin O'Connor2011-12-301-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vgabios: Merge support for GeodeLX vga bios.Kevin O'Connor2011-12-271-3/+11
| | | | | | | | | | | | | | | | GeodeLX support based on a patch sent by Chris Kindt on 20090825. The patch provides basic support for running the vga bios on a Geode device. The original patch has been updated with the following: * Updates to merge with the current code, * geode specific timings are loaded at init time * PCI code was dropped as the current code now supports pci * Updates for Kconfig * dropped redundant lxdprintf * dropped geode_demo screen writing Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Merge bootsplash and VGA ROM vbe structure definitionsJulian Pidancet2011-12-202-72/+171
| | | | Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
* Add vbe_flag field in BDAJulian Pidancet2011-12-201-1/+2
| | | | Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
* Add configuration menu for the VGA ROMJulian Pidancet2011-12-201-0/+39
| | | | | | | | | | | This patch adds a configuration menu for the VGA ROM, it also allow the creation of a PCI header so the ROM can be extracted from a PCI device. V2: Default Device IDs and Vendor IDs values for Cirrus and Bochs are now set by Kconfig. Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
* Move optionroms definitions into a separate headerJulian Pidancet2011-12-202-52/+60
| | | | | | Create optionroms.h so the VGA rom can reuse the definitions. Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
* Fix broken _DIS and _SRS methods in ACPI AML irq routing.Kevin O'Connor2011-12-172-106/+108
| | | | | | | | | | The RefOf() operator doesn't do what was expected (at least on Linux) - issuing "Store(1, RefOf(PRQ0))" doesn't write to the PRQ0 Field defined on the OperationRegion. Instead, it seems to redefine PRQ0 to be an integer. Fix this by defining the _DIS and _SRS methods as pre-processor macros. This way the RefOf() operator isn't needed.
* acpi: remove _RMVMichael S. Tsirkin2011-11-224-1303/+80
| | | | | | | | | | | The macro gen_pci_device is used to add _RMV method to a slot device so it is no longer needed: presence of _EJ0 now indicates that the slot is ejectable. It is also placing two devices with the same _ADR on the same bus, which isn't defined by the ACPI spec. So let's remove it. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: EJ0 method name patchingMichael S. Tsirkin2011-11-223-8/+108
| | | | | | | | | | | | | | | | | | | | | | | | | Modify ACPI to only supply _EJ0 methods for PCI slots that support hotplug. This is done by runtime patching: - Instrument SSDT ASL code with ACPI_EXTRACT directives tagging _EJ0 and _ADR fields. - At compile time, tools/acpi_extract.py looks for these methods in ASL source finds the matching AML, and stores the offsets of these methods in tables named aml_ej0_name and aml_adr_dword. - At run time, go over aml_ej0_name, use aml_adr_dword to get slot information and check which slots support hotplug. If hotplug is disabled, we patch the _EJ0 NameString in ACPI table, replacing _EJ0 with EJ0_. Note that this has the same checksum, but is ignored by OSPM. Note: the method used is robust in that we don't need to change any offsets manually in case of ASL code changes. As all parsing is done at compile time, any unexpected input causes build failure, not a runtime failure. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi: add ssdt for pci hotplugMichael S. Tsirkin2011-11-225-2776/+2860
| | | | | | | | | | | The point of this split is to make runtime patching easier. DSDT is required to supply: PCI0 - PCI root device object; PCEJ - Method object to eject a PCI slot. Additionally, SSDT is required to supply PCNT - Method object to notify OSPM of a PCI slot event. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio-pci: include pci.h and pci_regs.hSebastian Herbszt2011-11-221-0/+2
| | | | | | Include pci.h and pci_regs.h. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
* usb: fix boot pathsPaolo Bonzini2011-11-221-2/+2
| | | | | | | The fw paths for USB devices that SeaBIOS computes are off-by-one, because QEMU builds those paths with a numbering that starts from one (see usb_fill_port and usb_hub_initfn in QEMU). Fix that so that the numbering agrees.
* usb-ehci: Fix races with controller on updates to QH.Kevin O'Connor2011-11-191-72/+58
| | | | | | | | | | | | | | | The EHCI controller writes to the TD after writing to the QH, so the driver must wait for all the TDs to be complete before considering the transfer completed. (The previous implementation was particularly bad as it only checked that the last TD was in progress before considering the transfer complete.) Also, avoid writing to the qh.token field when starting a transfer to eliminate a potential race. Place the qh.token in an available state by default - that way only the qtd_next field needs to be updated to start the transfer. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb-uhci: Be sure to wrap pipe->iobase in GET_FLATPTR().Kevin O'Connor2011-11-171-3/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtio-pci: allocate vq in vp_find_vqPaolo Bonzini2011-11-173-13/+22
| | | | | | Another common bit that can be made generic. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* virtio-pci: introduce vp_init_simplePaolo Bonzini2011-11-173-8/+13
| | | | | | Put together the common parts of all virtio device initialization. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* always specify virtio-blk rather than virtioPaolo Bonzini2011-11-176-19/+19
| | | | | | Avoid ambiguity when virtio-scsi will be introduced. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* scsi: get physical chs geometry from mode page 0x04Paolo Bonzini2011-11-172-0/+61
| | | | | | The mode page is marked as obsolete, but QEMU can provide the information. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* usb-msc: move cdb dispatch to block.cPaolo Bonzini2011-11-172-31/+25
| | | | | | | virtio-scsi's low-level dispatch code is exactly the same as USB's, since in the end both are actually SCSI HBAs. Move it to common code. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* usb-msc: move common scsi code to blockcmd.cPaolo Bonzini2011-11-173-44/+69
| | | | | | | Finally move the INQUIRY/TEST UNIT READY/READ CAPACITY sequence to generic code, so that virtio-scsi will be able to use it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* usb-msc: go through TEST UNIT READY for hard disks.Paolo Bonzini2011-11-174-47/+54
| | | | | | | Add the wait loop that CDs are already using to usb-msc in the HD case, to cope with a NOT READY or UNIT ATTENTION condition. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* usb-msc: rename INQUIRY typesPaolo Bonzini2011-11-173-4/+4
| | | | | | They are generic SCSI constants, rename them as such. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* usb-msc: pass drive to setup_drive_*Paolo Bonzini2011-11-171-11/+11
| | | | | | The two functions do not need anymore a disk_op_s. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* usb-msc: move READ CAPACITY to usb_msc_init, fix off-by-onePaolo Bonzini2011-11-171-16/+14
| | | | | | | | | | | Only leave the bootprio code in setup_drive_hd, like in setup_drive_cdrom. This is a preparatory step; later, the SCSI code in usb_msc_init will become entirely generic. Also, the returned number of sectors is off by one. This will become more important when CHS translation is added later. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* usb-msc: support WRITE commandsPaolo Bonzini2011-11-173-6/+19
| | | | | | | Writes only require building the CDB and some care with the direction in the USB packet. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* usb-msc: add usb_msc_sendPaolo Bonzini2011-11-171-5/+14
| | | | | | This makes it a bit nicer to later introduce writes. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>