switch-coreboot/src/lib
Vadim Bendebury 08f93599a9 cr50: process uninitialized values gracefully
The vboot code tries reading rollback protection indices from the TPM,
and if the attempt to read returns TPM_E_BADINDEX, it decides that the
TPM has not yet been initialized for the Chromebook use, and needs to
be taken through the factory initialization sequence.

TPM_E_BADINDEX is an internal representation of the TPM error 0x28b,
generated on attempts to read a non existing NVMEM space.

If the space exists, but has never been written the TPM returns error
0x14a. This condition (the space exists but not written) could happen
if the previous factory initialization attempt was interrupted right
after the space was created.

Let's map this error to the same internal representation
(TPM_E_BADINDEX) so that the Chrome OS device could recover when this
condition occurs.

BRANCH=reef, gru
BUG=b:37443842
TEST=verified that the Pyro device stuck in TPM error state recovered
      when this patch was applied.

Change-Id: I6ff976c839efcd23ae26cef3ee428e7ae02e68f8
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://review.coreboot.org/20299
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-06-21 20:29:11 +00:00
..
gnat Hook up libhwbase in ramstage 2016-11-29 23:45:40 +01:00
b64_decode.c src/lib: Add "int" following "unsigned" 2017-03-09 17:24:17 +01:00
boot_device.c lib/boot_device: add RW boot device construct 2016-08-19 03:07:05 +02:00
bootblock.c src/lib: Move asmlinkage before type 2017-03-13 17:21:26 +01:00
bootmem.c lib/bootmem: allow architecture specific bootmem ranges 2016-04-21 20:46:45 +02:00
bootmode.c bootmode: Get rid of CONFIG_BOOTMODE_STRAPS 2016-07-28 00:36:22 +02:00
cbfs.c src/lib: Fix space between type, * and variable name 2017-03-09 17:27:02 +01:00
cbmem_common.c src/lib: Wrap lines at 80 columns 2017-03-13 17:21:02 +01:00
cbmem_console.c cbmem_console: Fix undefined behavior 2017-06-14 19:51:38 +02:00
cbmem_stage_cache.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
compute_ip_checksum.c src/lib: Wrap lines at 80 columns 2017-03-13 17:21:02 +01:00
coreboot_table.c lib/coreboot_tables: Remove weak fill_lb_framebuffer() 2017-06-04 18:47:39 +02:00
debug.c src/lib: Add "int" following "unsigned" 2017-03-09 17:24:17 +01:00
delay.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
edid.c lib/edid: Split out fill_lb_framebuffer() 2017-05-30 18:32:44 +02:00
edid_fill_fb.c lib/edid: Split out fill_lb_framebuffer() 2017-05-30 18:32:44 +02:00
ext_stage_cache.c soc/intel/apollolake: Implement stage cache to improve resume time 2016-10-07 18:18:14 +02:00
fallback_boot.c Kconfig: Add choice of framebuffer mode 2017-06-04 18:47:19 +02:00
fmap.c lib/fmap: provide RW region device support 2016-08-19 18:17:04 +02:00
gcc.c src/lib: Move asmlinkage before type 2017-03-13 17:21:26 +01:00
gcov-glue.c src/lib: Clean up general issues found by checkpatch.pl 2017-03-15 05:05:04 +01:00
gcov-io.c src/lib: Use tabs instead of spaces 2017-03-13 15:46:02 +01:00
gcov-io.h src/lib: Fix brace positions 2017-03-13 17:21:16 +01:00
gcov-iov.h Implement GCC code coverage analysis 2013-01-12 19:09:55 +01:00
generic_dump_spd.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
generic_sdram.c src/lib: Wrap lines at 80 columns 2017-03-13 17:21:02 +01:00
gpio.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
halt.c src/lib: Fix brace positions 2017-03-13 17:21:16 +01:00
hardwaremain.c src/lib: Use tabs instead of spaces 2017-03-13 15:46:02 +01:00
hexdump.c lib/hexdump: Refactor to skip lines with all ones as well 2016-01-22 14:10:28 +01:00
hexstrtobin.c hexstrtobin: Add a library function to decode ASCII hex into binary 2016-05-21 05:58:51 +02:00
hw-time-timer.adb Hook up libhwbase in ramstage 2016-11-29 23:45:40 +01:00
imd.c src/lib: Remove unnecessary code 2017-03-13 21:23:58 +01:00
imd_cbmem.c src/lib: Use tabs instead of spaces 2017-03-13 15:46:02 +01:00
jpeg.c src/lib/jpeg: Fix missing closing brace 2017-03-29 13:05:18 +02:00
jpeg.h src/lib: Wrap lines at 80 columns 2017-03-13 17:21:02 +01:00
Kconfig lib/edid: Split out fill_lb_framebuffer() 2017-05-30 18:32:44 +02:00
libgcc.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
libgcov.c src/lib: Move assignment out of if condition 2017-03-15 05:04:45 +01:00
lzma.c src/lib: Wrap lines at 80 columns 2017-03-13 17:21:02 +01:00
lzmadecode.c src/lib: Remove semicolon from end of macro 2017-03-13 21:24:26 +01:00
lzmadecode.h src/lib: Wrap lines at 80 columns 2017-03-13 17:21:02 +01:00
Makefile.inc Add support for Undefined Behavior Sanitizer 2017-06-14 19:56:59 +02:00
malloc.c Remove leftover smi_get_tseg_base 2015-05-29 07:06:37 +02:00
memchr.c Add an implementation for the memchr library function 2012-03-09 20:00:53 +01:00
memcmp.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
memcpy.c fix compiler warnings (trivial) 2009-01-20 21:40:16 +00:00
memmove.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
memrange.c src/lib: Use tabs instead of spaces 2017-03-13 15:46:02 +01:00
memset.c fix compiler warnings (trivial) 2009-01-20 21:40:16 +00:00
nhlt.c lib/nhlt: add support for setting the oem_revision 2016-12-01 08:17:42 +01:00
primitive_memtest.c src/lib: Add space before ( 2017-03-09 17:30:21 +01:00
prog_loaders.c src/lib: Remove unnecessary code 2017-03-13 21:23:58 +01:00
prog_ops.c lib/prog_loading: introduce prog_segment_loaded() 2016-04-02 03:56:37 +02:00
program.ld lib/program.ld: add .sdata sections 2016-10-31 19:33:44 +01:00
ramtest.c src/lib: Remove unnecessary code 2017-03-13 21:23:58 +01:00
reg_script.c src/lib: Clean up general issues found by checkpatch.pl 2017-03-15 05:05:04 +01:00
region_file.c lib: add region file support 2016-12-08 16:10:28 +01:00
reset.c Consolidate reset API, add generic reset_prepare mechanism 2017-06-13 20:53:09 +02:00
rmodule.c src/lib: Use tabs instead of spaces 2017-03-13 15:46:02 +01:00
rmodule.ld rmodule: use program.ld for linking 2015-09-09 19:35:30 +00:00
romstage_handoff.c lib: put romstage_handoff implementation in own compilation unit 2016-12-01 08:16:47 +01:00
romstage_stack.c intel post-car: Increase stacktop alignment 2016-11-18 20:59:12 +01:00
rtc.c lib: Add real-time-clock functions 2016-06-24 20:22:05 +02:00
selfboot.c src: change coreboot to lowercase 2017-06-07 12:09:15 +02:00
spd_bin.c lib/spd_bin: Print out correct SMBus SPD address in dump_spd_info 2017-06-09 23:57:38 +02:00
stack.c src/lib: Wrap lines at 80 columns 2017-03-13 17:21:02 +01:00
thread.c src/lib: Wrap lines at 80 columns 2017-03-13 17:21:02 +01:00
timer.c src/lib: Clean up general issues found by checkpatch.pl 2017-03-15 05:05:04 +01:00
timer_queue.c src/lib: Fix spacing 2017-03-13 17:16:08 +01:00
timestamp.c src/lib: Fix space between type, * and variable name 2017-03-09 17:27:02 +01:00
tlcl.c src/lib: Clean up general issues found by checkpatch.pl 2017-03-15 05:05:04 +01:00
tlcl_internal.h src/lib: Fix brace positions 2017-03-13 17:21:16 +01:00
tlcl_structures.h src/lib: Wrap lines at 80 columns 2017-03-13 17:21:02 +01:00
tpm2_marshaling.c drivers/i2c/tpm: use iobuf library for marshaling commands 2017-04-24 19:07:07 +02:00
tpm2_marshaling.h drivers/i2c/tpm: use iobuf library for marshaling commands 2017-04-24 19:07:07 +02:00
tpm2_tlcl.c cr50: process uninitialized values gracefully 2017-06-21 20:29:11 +00:00
tpm2_tlcl_structures.h cr50: process uninitialized values gracefully 2017-06-21 20:29:11 +00:00
tpm_error_messages.h src/lib: Wrap lines at 80 columns 2017-03-13 17:21:02 +01:00
trace.c src/lib: Fix checkpatch warnings 2016-09-07 22:28:00 +02:00
ubsan.c Add support for Undefined Behavior Sanitizer 2017-06-14 19:56:59 +02:00
version.c lib/version: Correct whitespace alignment 2016-07-15 00:10:50 +02:00
wrdd.c lib: Implement framework for retrieving WiFi regulatory domain 2016-03-08 18:41:33 +01:00