aboutsummaryrefslogtreecommitdiff
path: root/src/hw
AgeCommit message (Collapse)AuthorFilesLines
2015-09-03megasas: Use outl() on MFI_IDB registerKevin O'Connor1-1/+1
The outw() should be an outl(). Reported-by: Stefan Weil <sw@weilnetz.de> Reported-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-09-03megasas: Fix outw, outl argument orderStefan Weil1-4/+4
The value is the first argument and the port is the second, but the code was using the opposite order. Cc: Hannes Reinecke <hare@suse.de> Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-09-03sdcard: Obtain card capacity and report it on the boot menuKevin O'Connor1-5/+43
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-09-03sdcard: Display sdcard product name in boot menuKevin O'Connor1-2/+10
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-09-03sdcard: Turn card_type into a bitmap and store if card is MMC typeKevin O'Connor1-10/+9
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-09-03sdcard: Move drive registration to sdcard_card_setup()Kevin O'Connor1-15/+15
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-09-03sdcard: Move frequency setting into sdcard_card_setup()Kevin O'Connor1-8/+10
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-09-03sdcard: Move sdcard_set_frequency()/sdcard_set_power() in sdcard.cKevin O'Connor1-58/+58
Just code movement; no code changes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-09-01rtc: Disable NMI in rtc_mask()Kevin O'Connor1-0/+1
The rtc_mask() function should make sure the NMI disable bit is set (just as rtc_read() and rtc_write() do). Reported-by: Tim Shearer <tim.shearer@overturenetworks.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-24xhci: Minor - add USB port type comments to xhci_hub_reset()Kevin O'Connor1-0/+2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-24sdcard: Allow sdcard addresses to be specified in CBFS filesKevin O'Connor1-12/+36
Allow a hardcoded address to be specified in cbfs files with a prefix of "etc/sdcard". Some real-world devices have valid SDHCI controllers that do not show up as PCI devices. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-24ps2: Eliminate "etc/ps2-poll-only"; use CONFIG_HARDWARE_IRQ insteadKevin O'Connor1-10/+6
The "etc/ps2-poll-only" runtime setting is directly tied to the new CONFIG_HARDWARE_IRQ setting - use the compile time setting to control both. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-24Add minimal support for machines without hardware interruptsKevin O'Connor3-0/+20
Some Chromebooks (with Baytrail CPUs) apparently do not support routing of legacy interrupts. This patch adds minimal support for running SeaBIOS in such an environment. Even with this patch, it is known that old operating systems and even some recent bootloaders will not function without real hardware interrupts. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17rtc: Support disabling the RTC timer irq supportKevin O'Connor1-0/+6
Add a build time config option to remove support for RTC timer interrupts along with the associated bios calls requiring that support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Allow the sdcard driver to run on real hardwareKevin O'Connor1-6/+0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Initial support for MMC cardsKevin O'Connor1-17/+26
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Check for error events during sdcard_pio()Kevin O'Connor1-2/+13
Check for command errors and clear the error status if an error is found. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Perform a controller reset at start of initKevin O'Connor1-0/+20
Ask the controller to reset itself during controller setup. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Rename waitw() to sdcard_waitw() and simplifyKevin O'Connor1-16/+13
Calculate end timeout in code and return if any bit in the provided mask is set. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Implement timeout on every block read in sdcard_pio_transfer()Kevin O'Connor1-5/+4
The sdcard specs don't specify a maximum time for arbitrary transfers. Instead, each block has a maximum timeout. So, change the code to check for a timeout on each block transferred. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: The card should never be in a busy state at start of sdcard_pio()Kevin O'Connor1-6/+9
Return an error if the controller is busy at the start of a command instead of waiting. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Power down controller on failureKevin O'Connor1-4/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Power controller up to maximum voltage supportedKevin O'Connor1-4/+18
Don't error out if the controller does not support 3.3V - instead supply the most voltage the controller supports. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-08-17sdcard: Move power setup to new function sdcard_set_power()Kevin O'Connor1-13/+24
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
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-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-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-07-23ramdisk: Allow ramdisk support (CONFIG_FLASH_FLOPPY) under QEMUKevin O'Connor1-1/+1
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'Connor1-15/+8
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-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-14ata: Make sure "chanid" is relative to PCI device for bootorder fileKevin O'Connor2-12/+14
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'Connor2-8/+39
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-14block: Rename process_XXX_op() functions to XXX_process_op()Kevin O'Connor9-10/+9
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'Connor3-24/+13
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'Connor3-27/+16
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14megasas: Handle Megasas drives directly via 'struct disk_op_s' requestsKevin O'Connor3-9/+8
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14esp-scsi: Handle ESP drives directly via 'struct disk_op_s' requestsKevin O'Connor3-22/+13
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14lsi-scsi: Handle LSI drives directly via 'struct disk_op_s' requestsKevin O'Connor3-22/+13
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14usb-uas: Handle USB drives directly via 'struct disk_op_s' requestsKevin O'Connor3-9/+5
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14usb-msc: Handle USB drives directly via 'struct disk_op_s' requestsKevin O'Connor3-13/+9
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>