aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-08-17sdcard: Support SDHCI v3.00 spec clock settingKevin O'Connor1-7/+22
The SDHCI v3 spec supports higher frequency clocks and has a different method to configure the clock divisor. This also fixes an error in v1/v2 clock calculation (ffs was used instead of fls). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Fill command bits according to specKevin O'Connor1-11/+17
Set the proper command bits for each command according to the SDHCI specification. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Fix typo - use sdcard_pio() instead of sdcard_pio_app()Kevin O'Connor1-2/+2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17Call cpu_relax() if yielding prior to interrupts being enabledKevin O'Connor1-1/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17Move CanInterrupt check to check_irqs()Kevin O'Connor1-7/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17edd: Reduce parameters to fill_generic_edd()Kevin O'Connor1-32/+45
Have callers of fill_generic_edd() calculate the edd iface_path field. Have callers determine if the bus type is PCI vs ISA. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17edd: Pass the segment/offset from int 1348 calls using a 'struct segoff_s'Kevin O'Connor3-9/+11
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-12optionroms: Don't run option rom on PCI bar if CBFS/fw_cfg version existsKevin O'Connor1-18/+12
If there exists a "pci%04x,%04x.rom" file in CBFS/fw_cfg then the code should not attempt to run a rom found on the PCI device itself - even if the one in CBFS/fw_cfg is not a valid rom. This makes the code match the documentation. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-10xhci: Count new Max Scratchpad Bufs bits from XHCI 1.1Julius Werner1-1/+1
The 1.1 revision of the XHCI specification added an extra 5 bits to the Max Scratchpad Bufs field of HCSPARAMS2 that newer controllers make use of. Not honoring these bits means we're not allocating as many scratchpad buffers as the controller expects, which means it will interpret some uninitialized values from the end of the pointer array as scratchpad buffer pointers. We just fixed this in libpayload and it seems to apply the same way to SeaBIOS (I only compile-tested this, though... sorry). Signed-off-by: Julius Werner <jwerner@chromium.org>
2015-08-04mptable: Don't create mptable if it is very largeKevin O'Connor2-0/+7
Very large mptable structures can fill up the space in the f-segment and cause other important f-segment allocations to fail. Limit the maximum size of the mptable to prevent this. On QEMU, with the current maximum size of 600 bytes, the mptable will not be created in configurations of ~20 cpus or more. The mptable is rarely used in modern OSes so this should not be a problem. Reported-by: Huaitong Han <huaitong.han@intel.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-04sdcard: Add proper delays during card power upKevin O'Connor1-0/+6
Add card power up timing delays as specified by the sd card "Physical Layer Simplified Specification Version 4.10". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-04sdcard: Improve SD card initialization command sequenceKevin O'Connor1-4/+40
Send the initialization commands that are specified for SD cards by the "SD Host Controller Simplified Specification Version 2.00" spec. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-04sdcard: Set timeout control register during init (to max allowed timeout)Kevin O'Connor1-0/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-04sdcard: Make sure controller support 3.3V before enabling itKevin O'Connor1-1/+11
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-04sdcard: Implement controller frequency setting according to sdhci specKevin O'Connor1-2/+42
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-04sdcard: Check if card is present before sending commands to cardKevin O'Connor1-2/+7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-04vgafb: Minor - move gfx_common() variables outside of switch statementKevin O'Connor1-12/+5
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-30smm: ignore bits 16,18-31 of SMM revision ID at runtime tooKevin O'Connor1-3/+3
Check only the relevant bits of the SMM revision ID for both the init check and during runtime checks. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-30smm: fix outl argument orderPaolo Bonzini1-1/+1
The value is the first argument and the port is the second, but the code was using the opposite order. Reported-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-07-24Minor - move declaration of CDRom_locks to code that uses itKevin O'Connor3-4/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-23ramdisk: Allow ramdisk support (CONFIG_FLASH_FLOPPY) under QEMUKevin O'Connor2-7/+8
Don't require coreboot to use CONFIG_FLASH_FLOPPY - with the latest QEMU, it's possible to place a floppy image into fw_cfg using the qemu command line (eg, "-fw_cfg name=floppyimg/MyFloppy,file=file.img"). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-23timer: Add CONFIG_TSC_TIMER build option to disable the CPU TSC timerKevin O'Connor2-17/+16
Allow users to remove the CPU timestamp counter support at compile time. The PMTIMER is frequently used instead of the TSC and this compile time option allows one to strip a few bytes from the final binary. This change also defaults the internal timer to use the PIT based timer until the PMTIMER or TSC is detected. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-22timer: Delay timestamp counter init until after pmtimer is probedKevin O'Connor1-2/+4
Delay call to timer_setup() until after the xxx_platform_setup() calls so that the pmtimer can be detected first. Most modern machines will have a pmtimer and calibrating the timestamp counter is frequently unnecessary. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-22ps2: Don't wait 100ms to discard possible extra reset receive byteKevin O'Connor2-8/+9
The existing PS2 port code waits 100ms to see if the device attached to the keyboard port responds to a reset command with two bytes (instead of the normal one byte). If an extra byte is received, it is discarded. Receiving two bytes would be unusual and waiting to check for that event is unnecessary because the next command in the keyboard init sequence already seamlessly discards any extra bytes in the command queue. This patch eliminates the 100ms wait, which notably reduces the SeaBIOS boot time on QEMU. This patch also forces PS2 mice to always respond with two bytes during a reset sequence (instead of just one byte), which is a good sanity check. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14Don't enable interrupts prior to IVT and PIC setupKevin O'Connor4-7/+11
The machine may crash if an interrupt occurs prior to the setup of the interrupt vector table (IVT) and programmable interrupt controller (PIC). This patch makes sure that interrupts remain disabled until these components are setup. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14ata: Make sure "chanid" is relative to PCI device for bootorder fileKevin O'Connor3-16/+16
When specifying drives in the bootorder file, the "drive@x" parameter should be relative to the given PCI device and not relative to the total number of ATA controllers in the machine. This patch separates the tracking of "chanid" (channel number relative to a given PCI devices) from the "ataid" (channel number relative to the total number of ATA channels). Reported-by: Jonathan A. Kollasch <jakllsch@kollasch.net> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14ps2: Support mode for polling the PS2 port instead of using irqsKevin O'Connor4-8/+42
Some recent hardware has trouble with routing PS2 port interrupts while the interrupt controller is in legacy routing mode. This patch adds a config mechanism (via "etc/ps2-poll-only") to force the PS2 code into a polling only mode so that interrupts are not required. It is not recommended to use this polling mode on hardware that does properly support PS2 irqs, because some very old (DOS-era) programs depend on the BIOS PS2 irq behavior. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14coreboot: Try to auto-detect if the CBFS anchor pointer is a relative pointerKevin O'Connor1-0/+3
If CONFIG_CBFS_LOCATION is set to a non-zero value then it means the CBFS flash is not at the very end of memory. In this case, it's unclear if the anchor pointer is an absolute pointer or if it is relative to CONFIG_CBFS_LOCATION. Some devices have been using absolute pointers, but it appears some devices are now using relative pointers there. Since the anchor pointer almost always points to a structure in the last 64K of the rom, it should be possible to auto-detect if the pointer is relative or not. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14block: Rename process_XXX_op() functions to XXX_process_op()Kevin O'Connor12-22/+21
Rename disk driver dispatch functions to a consistent naming style. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14blockcmd: Convert cdb_is_read() to scsi_is_read()Kevin O'Connor7-14/+14
Convert the cdb_is_read() function to a new function scsi_is_read() which takes a 'struct disk_op_s' as a paramter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14blockcmd: Remove unused scsi_process_op() and cdb_cmd_data()Kevin O'Connor2-22/+0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14pvscsi: Handle pvscsi drives directly via 'struct disk_op_s' requestsKevin O'Connor4-25/+15
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14pvscsi: Move pvscsi_fill_req() code into pvscsi_cmd()Kevin O'Connor1-24/+15
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14virtio-scsi: Handle virtio drives directly via 'struct disk_op_s' requestsKevin O'Connor4-27/+18
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14megasas: Handle Megasas drives directly via 'struct disk_op_s' requestsKevin O'Connor4-10/+10
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14esp-scsi: Handle ESP drives directly via 'struct disk_op_s' requestsKevin O'Connor4-22/+15
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14lsi-scsi: Handle LSI drives directly via 'struct disk_op_s' requestsKevin O'Connor4-22/+15
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14usb-uas: Handle USB drives directly via 'struct disk_op_s' requestsKevin O'Connor4-9/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14usb-msc: Handle USB drives directly via 'struct disk_op_s' requestsKevin O'Connor4-13/+12
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14ahci: Handle AHCI ATAPI drives directly via 'struct disk_op_s' requestsKevin O'Connor4-26/+9
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14ata: Handle ATA ATAPI drives directly via 'struct disk_op_s' requestsKevin O'Connor4-6/+10
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14blockcmd: Introduce scsi_fill_cmd()Kevin O'Connor2-30/+24
Introduce scsi_fill_cmd() which creates a scsi style "command data block" from a "struct disk_op_s" disk request. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14block: Route scsi style commands through 'struct disk_op_s'Kevin O'Connor3-10/+36
Support sending scsi style "command data block" commands (cdbcmd) through the 'struct disk_op_s' command request structure. And change the blockcmd.c and cdrom.c code to route these commands through the process_op() code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14block: Introduce default_process_op() with common command handling codesKevin O'Connor9-45/+25
Most disk drivers only implement a couple of the available bios commands. Unify the common fallback handling code into a new function default_process_op() to reduce boiler-plate code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14block: Split process_op() command dispatch up into multiple functionsKevin O'Connor5-60/+73
Introduce process_op_32(), process_op_16(), and process_op_both() and split the disk driver command dispatch by its runtime mode requirements. This makes it more clear which modes each driver runs in. It also reduces the call32() boiler-plate code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14ich9: initialise RCBA register through LPC interfacePaulo Alcantara2-0/+8
This patch initialises root complex register block BAR in order to support TCO watchdog emulation features on QEMU. Cc: Kevin O'Connor <kevin@koconnor.net> Cc: Gerd Hofmann <kraxel@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-07-06docs: Note release date of 1.8.2Kevin O'Connor1-0/+5
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-04Make sure all code checks for malloc failuresKevin O'Connor6-5/+25
This is the result of an audit of callers of the malloc_XXX() and memalign_XXX() calls. All callers need to check if these functions return NULL. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-04bootorder: Update "extra pci root" buses bootorder format to match qemuKevin O'Connor1-2/+2
The QEMU code will use the prefix "/pci@i0cf8,%x/" for devices on extra pci root buses, so change the SeaBIOS code to match that. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-01virtio-pci: use high memory for ringsGerd Hoffmann1-1/+1
That way we should be able to manage *alot* more devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>