soc/intel/xeon_sp: Revise IIO domain ACPI name encoding
[coreboot2.git] / src / security / tpm / tss1.h
blob9894e80b200f66dfefba5261ba8ac35060ebc4c5
1 /* SPDX-License-Identifier: BSD-3-Clause */
3 #ifndef TSS1_H_
4 #define TSS1_H_
6 #include <types.h>
7 #include <vb2_sha.h>
9 #include <security/tpm/tss/tcg-1.2/tss_structures.h>
10 #include <security/tpm/tss_errors.h>
13 * TPM1.2-specific
15 * Some operations don't have counterparts in standard and are directly exposed
16 * here.
18 * Other operations are applicable to both TPM versions and have wrappers which
19 * pick the implementation based on version determined during initialization via
20 * tlcl_lib_init().
23 /**
24 * Define a space with permission [perm]. [index] is the index for the space,
25 * [size] the usable data size. The TPM error code is returned.
27 tpm_result_t tlcl1_define_space(uint32_t index, uint32_t perm, uint32_t size);
29 /**
30 * Issue a PhysicalEnable. The TPM error code is returned.
32 tpm_result_t tlcl1_set_enable(void);
34 /**
35 * Issue a SetDeactivated. Pass 0 to activate. Returns result code.
37 tpm_result_t tlcl1_set_deactivated(uint8_t flag);
39 /**
40 * Get flags of interest. Pointers for flags you aren't interested in may
41 * be NULL. The TPM error code is returned.
43 tpm_result_t tlcl1_get_flags(uint8_t *disable, uint8_t *deactivated, uint8_t *nvlocked);
45 /**
46 * Perform a raw TPM request/response transaction.
48 tpm_result_t tlcl1_send_receive(const uint8_t *request, uint8_t *response, int max_length);
50 /**
51 * Run the self test in the background.
53 tpm_result_t tlcl1_continue_self_test(void);
55 /**
56 * Set the nvLocked bit. The TPM error code is returned.
58 tpm_result_t tlcl1_set_nv_locked(void);
60 /**
61 * Get the entire set of permanent flags.
63 tpm_result_t tlcl1_get_permanent_flags(TPM_PERMANENT_FLAGS *pflags);
65 /**
66 * Set the bGlobalLock flag, which only a reboot can clear. The TPM error
67 * code is returned.
69 tpm_result_t tlcl1_set_global_lock(void);
71 /**
72 * Get the permission bits for the NVRAM space with |index|.
74 tpm_result_t tlcl1_get_permissions(uint32_t index, uint32_t *permissions);
77 * Declarations for "private" functions which are dispatched to by tss/tss.c
78 * based on TPM family.
81 tpm_result_t tlcl1_save_state(void);
82 tpm_result_t tlcl1_resume(void);
83 tpm_result_t tlcl1_startup(void);
84 tpm_result_t tlcl1_self_test_full(void);
85 tpm_result_t tlcl1_read(uint32_t index, void *data, uint32_t length);
86 tpm_result_t tlcl1_write(uint32_t index, const void *data, uint32_t length);
87 tpm_result_t tlcl1_assert_physical_presence(void);
88 tpm_result_t tlcl1_physical_presence_cmd_enable(void);
89 tpm_result_t tlcl1_finalize_physical_presence(void);
90 tpm_result_t tlcl1_force_clear(void);
91 tpm_result_t tlcl1_extend(int pcr_num, const uint8_t *digest_data,
92 enum vb2_hash_algorithm digest_algo);
94 #endif /* TSS1_H_ */