Lines Matching +full:hall +full:- +full:switch +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * Kylene Hall <[email protected]>
12 * Maintained by: <tpmdd-[email protected]>
54 len -= sizeof(*event_header); in tpm_is_tpm2_log()
59 efispecid = (struct tcg_efi_specid_event_head *)event_header->event; in tpm_is_tpm2_log()
61 n = memcmp(efispecid->signature, TCG_SPECID_SIG, in tpm_is_tpm2_log()
84 log = &chip->log; in tpm_read_log_acpi()
89 if (!chip->acpi_dev_handle) in tpm_read_log_acpi()
90 return -ENODEV; in tpm_read_log_acpi()
92 if (chip->flags & TPM_CHIP_FLAG_TPM2) { in tpm_read_log_acpi()
96 return -ENODEV; in tpm_read_log_acpi()
98 if (tbl->header.length < in tpm_read_log_acpi()
101 return -ENODEV; in tpm_read_log_acpi()
105 len = tpm2_phy->log_area_minimum_length; in tpm_read_log_acpi()
107 start = tpm2_phy->log_area_start_address; in tpm_read_log_acpi()
110 return -ENODEV; in tpm_read_log_acpi()
120 return -ENODEV; in tpm_read_log_acpi()
122 switch (buff->platform_class) { in tpm_read_log_acpi()
124 len = buff->server.log_max_len; in tpm_read_log_acpi()
125 start = buff->server.log_start_addr; in tpm_read_log_acpi()
129 len = buff->client.log_max_len; in tpm_read_log_acpi()
130 start = buff->client.log_start_addr; in tpm_read_log_acpi()
139 dev_warn(&chip->dev, "%s: TCPA log area empty\n", __func__); in tpm_read_log_acpi()
140 return -EIO; in tpm_read_log_acpi()
144 log->bios_event_log = kvmalloc(len, GFP_KERNEL); in tpm_read_log_acpi()
145 if (!log->bios_event_log) in tpm_read_log_acpi()
146 return -ENOMEM; in tpm_read_log_acpi()
148 log->bios_event_log_end = log->bios_event_log + len; in tpm_read_log_acpi()
152 dev_warn(&chip->dev, "%s: Failed to map ACPI memory\n", __func__); in tpm_read_log_acpi()
154 ret = -ENODEV; in tpm_read_log_acpi()
158 memcpy_fromio(log->bios_event_log, virt, len); in tpm_read_log_acpi()
162 if (chip->flags & TPM_CHIP_FLAG_TPM2 && in tpm_read_log_acpi()
163 !tpm_is_tpm2_log(log->bios_event_log, len)) { in tpm_read_log_acpi()
165 ret = -ENODEV; in tpm_read_log_acpi()
169 ret = devm_add_action(&chip->dev, tpm_bios_log_free, log->bios_event_log); in tpm_read_log_acpi()
171 log->bios_event_log = NULL; in tpm_read_log_acpi()
178 tpm_bios_log_free(log->bios_event_log); in tpm_read_log_acpi()
179 log->bios_event_log = NULL; in tpm_read_log_acpi()