aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* docs: Note v1.11.0 releaserel-1.11.0Kevin O'Connor2017-11-101-0/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sercon: Disable ScreenAndDebug in case both serial console and serial debug ↵Gerd Hoffmann2017-11-031-0/+4
| | | | | | are active Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* timer: Avoid integer overflows in usec and nsec calculationsKevin O'Connor2017-11-021-24/+31
| | | | | | | | | When timer_calc_usec() is used with large timeout values, such as 60s, the integer math can overflow and produce different results than when using timer_calc(time / 1000) for the same timeout. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* nvme: Use the Maximum Queue Entries Supported (MQES) to initialize I/O queuesFilippo Sironi2017-10-141-2/+8
| | | | | | | | | | | | | Use the Maximum Queue Entries Supported (MQES) to initialize I/O queues depth rather than picking a fixed number (256) which might not be supported by some NVMe controllers (the NVMe specification says that an NVMe controller may support any number between 2 to 4096). Still cap the I/O queues depth to 256 since, during my testing, SeaBIOS was running out of memory when using something higher than 256 (4096 on the NVMe controller that I've had a chance to try). Signed-off-by: Filippo Sironi <sironi@amazon.de>
* xhci: Verify the device is still present in xhci_cmd_submit()Kevin O'Connor2017-10-091-0/+11
| | | | | | | | Make sure the USB device is still present before altering the xhci "slot" for it. It appears some controllers will hang if a request is sent to a port no longer connected. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* nvme: fix out of memory behaviorJulian Stecklina2017-10-061-36/+111
| | | | | | | | | | If the allocation of I/O queues ran out of memory, the code would fail to detect that and happily use these queues at address zero. For me this happens for systems with more than 7 NVMe controllers. Fix the out of memory handling to gracefully handle this case. Signed-off-by: Julian Stecklina <jsteckli@amazon.de>
* xhci: Build TRBs directly in xhci_trb_queue()Kevin O'Connor2017-10-031-105/+59
| | | | | | | | | Use the logic for building a 'struct xhci_trb' that was in xhci_xfer_queue() up so that command and ring TRBs can also use that functionality. This eliminates the need to manually generate the xhci_trb struct from those code paths. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* virtio: Allocate drive_s storage in low memoryKevin O'Connor2017-09-273-9/+7
| | | | | | | | Use the "low" memory segment instead of the f-segment for the drive_s storage. This can help avoid running out of memory in the f-segment. Tested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* block: Rename disk_op_s->drive_gf to drive_flKevin O'Connor2017-09-2720-174/+174
| | | | | | | | | | Now that the drive_s struct does not need to be in the f-segment, rename references to drive_gf in the generic drive code to drive_fl. This is just variable renames - no code changes. Tested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* disk: Don't require the 'struct drive_s' to be in the f-segmentKevin O'Connor2017-09-273-18/+18
| | | | | | | | Allow the 'struct drive_s' drive description structure to be in either the "low" memory segment or the f-segment. Tested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* boot: Rename drive_g to driveKevin O'Connor2017-09-271-8/+8
| | | | | | | | | The 'struct drive_s' pointer is a 32bit pointer (and boot.c code is only compiled in 32bit mode), so avoid using the "_g" suffix on the pointer. Tested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* add serial console supportGerd Hoffmann2017-09-2210-18/+739
| | | | | | | | | Redirect int10 calls to serial console output. Parse serial input and queue key events. The serial console can work both as primary display and in parallel to another vga display (splitmode). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* paravirt: serial console configuration.Gerd Hoffmann2017-09-221-0/+8
| | | | | | | Read QEMU_CFG_NOGRAPHIC, if set add etc/sercon-port file to enable the serial console. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* romfile: add support for constant files.Gerd Hoffmann2017-09-222-0/+48
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* kbd: make enqueue_key public, add ascii_to_keycodeGerd Hoffmann2017-09-222-1/+19
| | | | | | | | serial console wants queue key events and needs to map ascii chars to the keycode, so make enqueue_key public and also exports a helper function so sercon can use the scan_to_keycode mapping table. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* std: add cp437 to unicode mapGerd Hoffmann2017-09-223-0/+277
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* pci: enable RedHat PCI bridges to reserve additional resources on PCI initAleksandr Bezzubikov2017-09-142-4/+105
| | | | | | | | In case of Red Hat Generic PCIE Root Port reserve additional buses and/or IO/MEM/PREF space, which values are provided in a vendor-specific capability. Signed-off-by: Aleksandr Bezzubikov <zuban32s@gmail.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
* pci: add QEMU-specific PCI capability structureAleksandr Bezzubikov2017-09-141-0/+52
| | | | | | | | | | | | | On PCI init PCI bridge devices may need some extra info about bus number to reserve, IO, memory and prefetchable memory limits. QEMU can provide this with special vendor-specific PCI capability. This capability is intended to be used only for Red Hat PCI bridges, i.e. QEMU cooperation. Signed-off-by: Aleksandr Bezzubikov <zuban32s@gmail.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
* pci: refactor pci_find_capapibilty to get bdf as the first argument instead ↵Aleksandr Bezzubikov2017-09-146-30/+30
| | | | | | | | | | | of the whole pci_device Refactor pci_find_capability function to get bdf instead of a whole pci_device* as the only necessary field for this function is still bdf. Signed-off-by: Aleksandr Bezzubikov <zuban32s@gmail.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
* tcgbios: Fix use of unitialized variableKevin O'Connor2017-09-141-2/+1
| | | | | Review-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* docs: Fix typos in Memory_Model.mdKevin O'Connor2017-09-021-3/+3
| | | | | Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* vga: Fix bug in stdvga_get_linesize()Kevin O'Connor2017-08-291-1/+1
| | | | | | Add required GET_GLOBAL() macro to vmode_g access. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb-xhci: use hub portmapGerd Hoffmann2017-07-251-4/+41
| | | | | | | | xhci controllers have two virtual ports per (usb3 capable) physical port, one for usb2 and one for usb3 devices. Add a hub portmap callback to map the virtual ports to physical ports. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: add hub portmapGerd Hoffmann2017-07-252-3/+11
| | | | | | | | Allow usb hubs to map (software) ports to physical ports via op callback. This is needed to make bootorder work in case there isn't a simple linear mapping. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* virtio: IOMMU supportJason Wang2017-07-073-2/+5
| | | | | | | | | Since we don't enable IOMMU at all, we can then simply enable the IOMMU support by claiming the support of VIRITO_F_IOMMU_PLATFORM. This fixes booting failure when iommu_platform is set from qemu cli. Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
* ahci: Disable Native Command QueueingZeh, Werner2017-07-021-1/+0
| | | | | | | | | | | The AHCI driver currently sets the NCQ bit for every command that is issued to the SATA drive. This is not needed as there is always only one command active at a time and in turn can lead to a hanging AHCI controller (true for Marvel 88SE9170). The following patch disables the usage of NCQ completely. With this patch the Marvel AHCI controller works just fine without any issues. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* nvme: Enable NVMe support for non-qemu hardwareYouness Alaoui2017-06-121-2/+1
| | | | | | | | | | NVMe support was tested on purism/librem13 laptops and SeaBIOS has no problems in detecting and booting the drives. This is a continuation of commit 235a8190 which was incomplete. Signed-off-by: Youness Alaoui <youness.alaoui@puri.sm> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* SeaVGABios/cbvga: Advertise compatible VESA modesPatrick Rudolph2017-06-121-1/+103
| | | | | | | | | | | | | | | | Advertise compatible VESA modes, that are smaller or equal to coreboot's active framebuffer. Only modes that have the same Bpp are advertise and can be selected. Allows the Windows 7 bootloader NTLDR to show up in VESA mode. Allows to show the Windows 7 boot logo. Allows Windows to boot in safe mode and in normal boot using VgaSave driver with resolution up to 1600x1200. This fixes most likely other bootloader and operating systems as well, in case the are relying on VESA framebuffer support. Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* SeaVGABios/cbvga: Use active mode to clear screenPatrick Rudolph2017-06-121-1/+1
| | | | | | As coreboot framebuffer is immutable always use CBmodeinfo. Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* SeaVGABIOS/vbe: Query driver for scanline pitch v2Patrick Rudolph2017-06-125-1/+21
| | | | | | | | | | | Query the driver for the real scanline pitch in bytes. As cbvga doesn't change the pitch on mode change, always return the same pitch, that might exceed width times Bytes-per-pixel. Report the default stdvga pitch for all other drivers. Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* SeaVGABios/cbvga: Advertise correct pixel formatPatrick Rudolph2017-06-121-1/+3
| | | | | | | | | | | | Accumulate the pixel format's bits instead relying on coreboot's bits_per_pixel, which says nothing about the active pixel format. Allows VBE to correctly advertise XRGB8 and BGRX8 framebuffer formats, commonly used by coreboot. Fixes at least Windows Bootloader and gfxboot. Signed-off-by: Patrick Rudolph <siro@das-labor.org>
* Revert "lsi-scsi: reset in case of a serious problem"Roman Kagan2017-06-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 11277846e819b9eef3db5ac833a6a47f95f5ef15. It was originally introduced to deal with the case when REPORT_LUNS caused an error in QEMU implementation of lsi53c895a and left it in a "confused" state making further interaction impossible. However the remedy was worse than the disease: the reset was controller-wide causing all luns to reset, losing all in-flight requests; upon that all luns lit up unit_attention condition, so that any non-informational request would fail with check_condition status. As a result, the lun enumeration succeeded and I saw the respective entries in the boot menu during my testing, but the read from those luns ended with an error and booting failed, which I didn't bother to test. So this reverts to the original error handling behavior. The problem with the failing REPORT_LUNS is addressed in the preceding patch, by making it unlikely to fail. Reported-by: Maciej Józefczyk <maciej.jozefczyk@corp.ovh.com> Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* blockcmd: start REPORT_LUNS with the smallest bufferRoman Kagan2017-06-121-1/+3
| | | | | | | | | | | | | | | | A number of emulated SCSI devices in QEMU incorrectly return an error to REPORT_LUNS command when the size of the data returned is smaller than the allocation length passed in. To work it around, start with the smallest allocation length possible: for 1 entry. This is a slight pessimization because it would require another REPORT_LUNS iteration if the target has more than a single LUN, but this appears to have negligible impact on boot times, and makes REPORT_LUNS enumeration work for more QEMU devices (lsi53c895a, mptsas1068). Reported-by: Maciej Józefczyk <maciej.jozefczyk@corp.ovh.com> Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* stacks: There is no need to disable NMI if it is already disabledKevin O'Connor2017-06-121-4/+9
| | | | | | | Don't write to the cmos index port on a mode switch if NMI is already disabled. This reduces the number of outb() calls. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stacks: Don't update the A20 settings if they haven't changedKevin O'Connor2017-05-163-6/+11
| | | | | | | The A20 setting is almost always enabled - only issue an outb() if the A20 is actually changing. This reduces the number of outb() calls. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stacks: Make sure to initialize Call16DataKevin O'Connor2017-05-161-0/+1
| | | | | | | | Initialize the Call16Data at startup - otherwise some early yield() calls may check for interrupts without using the preferred A20 setting. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* smm: Backup and restore A20 on an SMI based mode switchKevin O'Connor2017-05-161-1/+8
| | | | | | | | QEMU does not store the A20 setting in the SMM cpu environment area (and it does not look like real CPUs do either). So, manually backup and restore A20 on a mode switch. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* NVMe: Allow NVMe to be enabled on real hardwareKevin O'Connor2017-05-102-2/+2
| | | | | | | A couple of users have reported success with the NVMe driver on real hardware, so allow it to be enabled outside of QEMU. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* src: Minor - remove tab characters that slipped into SeaBIOS C codeKevin O'Connor2017-05-022-5/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lsi-scsi: try to enumerate luns with REPORT LUNSRoman Kagan2017-05-021-11/+26
| | | | | | | | | | | | | | Enumerate active luns with REPORT LUNS and, if that fails[*], fall back to sequentially enumerating them up to (arbitrarily chosen) #8 [**]. [*] in current QEMU, REPORT LUNS does fail in lsi53c895a because the returned data is smaller than the allocation length which is (wrongly) considered an underflow [**] in current QEMU, luns above 0 are not supported in lsi53c895a, so this patch is here only for completeness. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* lsi-scsi: reset in case of a serious problemRoman Kagan2017-05-021-0/+2
| | | | | | | | | | | | When the device reports a serious problem via SIST[01] registers, it needs to be reset, otherwise the following requests will most likely fail, too. In particular, REPORT LUNS which fails (wrongly) with underflow in QEMU makes all the following requests fail, too, rendering the device unusable. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* mpt-scsi: try to enumerate luns with REPORT LUNSRoman Kagan2017-05-021-14/+26
| | | | | | | | | | | | | | | Enumerate active luns with REPORT LUNS and, if that fails[*], fall back to sequentially enumerating them up to (arbitrarily chosen) #8. Note that this patch also makes mpt_scsi_cmd accept luns other than 0; I've no idea what was the original motivation not to, and what can break due to this change (nothing broke in my basic tests with QEMU). [*] in current QEMU, REPORT LUNS does fail in mptsas1068 because the returned data is smaller than the allocation length which is (wrongly) considered an underflow. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* pvscsi: fix the comment about lun enumerationRoman Kagan2017-05-021-1/+1
| | | | | | | | | | | | | The comment in pvscsi_scan_target (presumably c&p-ed from another driver) reads that REPORTS LUNS should better be used to enumerate the luns on the target. However, according to the Linux driver, the device supports no more than a single lun per target. So adjust the comment to tell exactly that. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* usb-uas: enumerate luns with REPORT LUNSRoman Kagan2017-05-021-16/+29
| | | | Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* esp-scsi: enumerate luns with REPORT LUNSRoman Kagan2017-05-021-10/+25
| | | | Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* virtio-scsi: enumerate luns with REPORT LUNSRoman Kagan2017-05-021-12/+26
| | | | Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* blockcmd: generic SCSI luns enumerationRoman Kagan2017-05-022-0/+98
| | | | | | | | | | | | | | | | | | | Add two generic functions to discover active LUNs on a SCSI target. The functions take a temporary drive descriptor on the target, and a callback to create a new drive descriptor with a new LUN using the temporary one as a template. One of the functions performs REPORT LUNS on the temporary drive to obtain the list of candidate luns; the other sequentially iterates the lun numbers up to the given maximum, and is meant as a fallback. Both functions return the number of successfully created drive descriptors, or a negative number if an error occured. This will allow to lift the limitation of most of the SCSI drivers that support booting off the LUN #0 only. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* blockcmd: accept only disks and CD-ROMsRoman Kagan2017-05-021-0/+3
| | | | | | | | | | Luns that report to INQUIRY with a type other than CD-ROM are considered disks. This isn't necessarily the case; working with such luns as disks may lead to unpredictable results. So bail out if the lun is neither CD-ROM nor disk. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
* boot: Increase description size in boot menuKevin O'Connor2017-04-251-1/+1
| | | | | | | | Increase the boot menu description size so that menu items up to 80 characters display without truncation. Reported-by: Rene Shuster <rene.shuster@bcsemail.org> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* coreboot: Adapt to upstream CBMEM console changesJulius Werner2017-04-251-6/+15
| | | | | | | | | | | | coreboot's CBMEM console format changed with https://review.coreboot.org/#/c/18301. This patch adapts the SeaBIOS implementation to support the new format. (SeaBIOS versions with this patch will continue to work fine with older version of coreboot. SeaBIOS versions without this patch may fail to log messages to the CBMEM console if run with newer versions of coreboot, but should not experience any more serious issues than that.) Signed-off-by: Julius Werner <jwerner@chromium.org>