aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-11-23tpm: Avoid scatter-gather copying in build_and_send_cmd()Kevin O'Connor1-20/+17
Setup the tpm hardware request in a linear area of memory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-23tpm: There is no need to pass event_length to hash/extend functionsKevin O'Connor1-24/+17
The event_length field is already in pcpes->eventdatasize. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-23tpm: Perform hashing separately from loggingKevin O'Connor1-33/+19
Instead of calculating the hash in hash_log_event(), create a new function (tpm_fill_hash) that will create the hash, and update all callers to use tpm_fill_hash() before calling hash_log_event(). This reduce the number of parameters to hash_log_event(). Rename hash_log_event() and hash_log_extent_event() to tpm_log_event() and tpm_log_extend_event() now that these functions no longer implement the hashing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-23tpm: There is no need to pass pcrindex to hash_log_extend_event()Kevin O'Connor1-8/+5
The pcrindex is already in pcpes->pcrindex, so no need to pass it as a parameter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-23tpm: Don't pass entry_count around in parameters to/from tpm_extend_acpi_log()Kevin O'Connor1-23/+11
Now that entry_count is in a global variable there is no need to pass it around as function parameters. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-23tpm: pcpes->event is a variable length arrayKevin O'Connor2-14/+12
The event field can be of an arbitrary length. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-22tpm: Move tpm_start_option_rom_scan() and tpm_calling_int19h() into callersKevin O'Connor1-29/+2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-22tpm: Move tpm_add_bootdevice() into callersKevin O'Connor1-44/+7
The switch statement in tpm_add_bootdevice() corresponds with its call sites - just perform the appropriate action in each caller. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-22tpm: Change tpm_add_measurement() to tpm_add_action()Kevin O'Connor1-42/+13
Make the only caller of tpm_add_measurement() with EV_SEPARATOR directly call tpm_add_measurement_to_log(). Rename to tpm_add_action() and change all callers with EV_ACTION to use this function. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-22tpm: Open code tpm_ipl() into callersKevin O'Connor2-62/+24
The only three callers of tpm_ipl() exactly correlate with the three switch branches in tpm_ipl(), so just move the appropriate code into the callers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-22tpm: Move error recovery from tpm_extend_acpi_log() to only callerKevin O'Connor1-14/+8
Move tpm state checking and error handling from tpm_extend_acpi_log() to its only caller hash_log_event(). This makes tpm_extend_acpi_log() specific to just ACPI table handling. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-22tpm: Move code around in tcgbios.cKevin O'Connor1-653/+638
Move like functions near each other. Reduce forward function declarations. This is only code movement - no code changes. This groups the code into six sections: TPM state tracking, TPM hardware interface, ACPI TCPA table interface, Helper functions, Setup and Measurements, BIOS interface. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-22tpm: Add "static" declaration to functions not used outside tcgbios.cKevin O'Connor1-3/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-22tpm: Rename remaining interrupt functionsStefan Berger1-16/+24
Rename all remaining functions called directly by the BIOS interrupt by adding the suffix '_int' to them. Add the check for whether the preboot interface is shut down where missing. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-22tpm: Refactor pass_through_to_tpmStefan Berger2-56/+37
Refactor the signature of the pass_through_to_tpm function to take individual pointers as parameters and introduce pass_through_to_tpm_int as a function to be called with the parameters passed from the BIOS interrupt. Refactor existing callers that now do not have to build up the data structure expected by the BIOS interface. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-22tpm: Cache all log related pointers in tpm_stateStefan Berger1-62/+48
Move the tpm_state to RAM area and add all log related pointers to it so they can be cached. Remove functions that previously determined these pointers by searching for the TCPA ACPI table and walking the log. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-22tpm: Set timeouts and durations to microsecond valuesStefan Berger3-24/+38
Fix the timeouts and durations -- they are provided in microseconds. Adapt the TPM driver for it. Get TPM specific timeout and duration values earlier from the device. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-22tpm: Drop code using the TPM for sha1Stefan Berger4-112/+7
Drop the code that is using the TPM for sha1 calculations. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-20util.h: Minor - HaveRunPost is in misc.c not resume.cKevin O'Connor1-3/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19tpm: Move standard definitions from tcgbios.h to new file std/tcg.hKevin O'Connor4-358/+357
Tested-by: Stefan Berger <stefanb@us.ibm.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19tpm: fix compiler warning with older gcc versionsStefan Berger1-1/+1
gcc v3.4 shows a warning due to "comparison is always false due to limited range of data type". This patch fixes it. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-19tpm: Refactor hash_log_extend_eventStefan Berger1-54/+55
Refactor the signature of the hash_log_extend_event to take individual pointers as parameters and introduce hash_log_extend_event_int as a function to be called with the parameters passed from the BIOS interrupt. Refactor existing callers to hash_log_extend_event that now do not have to build up the data structure expected by the BIOS interface. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-19tpm: Refactor hash_log_event BIOS interface functionStefan Berger1-25/+32
Refactor the signature of hash_log_event to take individual pointers as parameters and introduce hash_log_event_int as an function to be called with the parameters passed from the BIOS interrupt. Refactor existing callers to hash_log_event that now do not have to build up the data structures expected by the BIOS interface. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-19tpm: Refactor the parameters being passed to tpm_extend_acpi_logStefan Berger1-9/+19
Refactor the parameters being passed to tpm_extend_acpi_log in such a way that the header of the logged event is passed in separate from the 'body'. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-19tpm: Refactor function building TPM commandsStefan Berger2-27/+20
Refactor the function building TPM commands to get rid of one of the buffers it uses for building a command. To do that, have it use the iovec also for the 'append' array that's being passed to the function. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-19tpm: Temporarily deactivate the TPM in case of failureStefan Berger2-6/+45
Temporarily deactivate the TPM in case of failure of TPM commands and failure to log measurements. Introduce the tpm_set_failure() function replacing occurrences of 'tpm_state.tpm_working = 0' and invoke it in error paths. Temporarily deactivating the TPM means that it will be active again upon reboot. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-19acpi: Remove build check for iaslKevin O'Connor1-13/+0
The iasl program is no longer used on a default build. Do not require it to be installed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19acpi: Don't build SSDT files on every build; store them in gitKevin O'Connor6-6/+721
The SSDT files are rarely modified - recent QEMU versions don't use them at all and adding features to them in SeaBIOS has been deprecated. It no longer makes sense to generate them on every build. The content will remain (for use on old machine types in QEMU) in static files committed to the SeaBIOS git repo. If the contents do need to be generated a new build target (make iasl) is available. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19acpi_extract: Don't generate unused (and empty) q35-acpi-dsdt.hex fileKevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19acpi_extract: Make the generated .hex files more human readableKevin O'Connor1-4/+11
Add a comment to the top of the generated file indicating that is is an automatically generated file. Compress output so that up to eight hex values are placed on a single line. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19acpi_extract: Move main code to new function main()Kevin O'Connor1-110/+115
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19sdcard: Enable extra debugging on sdcard_waitw() timeoutKevin O'Connor1-0/+1
On a timeout, report what register failed to update. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19sdcard: fix typo causing 32bit write to 16bit block_size fieldKevin O'Connor1-1/+1
The block_size field is 16bits and only 16bit writes should be used with it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19sdcard: Only enable error_irq_enable for bits defined in SDHCI v1 specKevin O'Connor1-1/+1
The SDHCI v1 spec only defines the first 9 error_irq_enable bits and reserves other bits in the field. Don't enable the 10th bit (which was defined in the v2 spec) as it's not needed anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-19xhci: Check for device disconnects during USB2 reset pollingKevin O'Connor1-5/+19
Some XHCI controllers register super-speed devices on high-speed ports and then disconnect them when the super-speed detection completes. Make sure to recognize these disconnect events during the reset process. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-17usb: Allow configuration of sigatt time (in etc/usb-time-sigatt)Kevin O'Connor2-1/+6
Several users have reported devices that take more than 100ms to announce their presence on a USB port. Allow the sigatt timeout to be specified at runtime as a way to extend the default timeout. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-17docs: Note v1.9.0 releaserel-1.9.0Kevin O'Connor1-0/+19
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-11buildversion: Add debugging messagesKevin O'Connor1-2/+19
Add ability to output debug messages from the buildversion.py build script. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-09buildversion: Avoid subprocess.check_output() as that requires python2.7Kevin O'Connor1-13/+19
Don't require python2.7 in buildversion.py. Also, ignore only those exceptions that are known to be possible. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-11-04PCI SDHCI driver: Fix base addressKyösti Mälkki1-0/+1
MMIO register space was off by 4 bytes, bottom bits of PCI BAR registers are not part of the address. Test boot on real hardware: PCI device 00:14.7 (vd=3D1022:7813 c=3D0805) Searching bootorder for: /pci@i0cf8/*@14,7 sdhci@0xfeb25500 ver=3D1001 cap=3D31fe3fb2 2570 sdcard_set_frequency 63 400 8000 sdcard_pio command stop (code=3D1) sdcard_set_frequency 63 25000 200 Found sdcard at 0xfeb25500: SD card SD01G 982MiB Registering bootable: SD card SD01G 982MiB (type:2 prio:103 data:f46e0) Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2015-10-26docs: Minor - replace seavgabios text in Build_overview.md with linkKevin O'Connor2-6/+3
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-24virtio: Minor - replace tab characters with spaceKevin O'Connor1-2/+2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-24biostables: Minor - fix incorrect indentationKevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-24coreboot: Minor - avoid K&R style function declarationKevin O'Connor1-1/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-23build: Allow official tarball builds to be considered "clean"Kevin O'Connor1-2/+8
If building from an official tarball and EXTRAVERSION info is provided, then consider the build to be "clean" (don't include hostname/build timestamp). This is done on the expectation that EXTRAVERSION will have enough information to allow developers to find the builder and build environment should a defect be reported, and therefore the hostname/timestamp is not necessary. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-23docs: Document 'make EXTRAVERSION=xyz' and scripts/tarball.shKevin O'Connor1-0/+28
Document the existence of the EXTRAVERSION field and the information expected to be present in it. Document the use of tarball.sh in build environments that lack git. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-22build: Be more permissive in buildversion.py tool version scanKevin O'Connor1-25/+23
There is some variation in version strings between various tool chain builds. Make the version tool scan more permissive to attempt to handle these variations. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-21Add QEMU fw_cfg DMA interfaceMarc Marí2-12/+93
Add support for the new fw_cfg DMA interface. The protocol is explained in QEMU documentation. Signed-off-by: Marc Marí <markmb@redhat.com>
2015-10-15malloc: Rename csm_malloc_preinit() to malloc_csm_preinit()Kevin O'Connor3-4/+4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-10-15stacks: Use macro wrappers for call32() and stack_hop_back()Kevin O'Connor8-44/+41
The C code only uses _cfuncX_ prefixes for parameters to the call32(), stack_hop_back(), and call32_params() functions. It's simpler to use macro wrappers around those functions which provide the required prefix. This also changes the parameter order of stack_hop() and stack_hop_back() to use the more natural (func, params) ordering. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>