Tim Wawrzynczak | 6b8599f | 2022-02-14 16:04:21 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-3-Clause */ |
| 2 | |
| 3 | #ifndef __DRIVERS_TPM_CR50_H__ |
| 4 | #define __DRIVERS_TPM_CR50_H__ |
| 5 | |
| 6 | #include <types.h> |
| 7 | |
Jes Klinke | 1430b04 | 2022-03-28 14:22:24 -0700 | [diff] [blame] | 8 | /* Structure describing the elements of GSC firmware version. */ |
Tim Wawrzynczak | 6b8599f | 2022-02-14 16:04:21 -0700 | [diff] [blame] | 9 | struct cr50_firmware_version { |
| 10 | int epoch; |
| 11 | int major; |
| 12 | int minor; |
| 13 | }; |
| 14 | |
| 15 | /* Indicates whether Cr50 ready pulses are guaranteed to be at least 100us. */ |
| 16 | bool cr50_is_long_interrupt_pulse_enabled(void); |
| 17 | |
Jes Klinke | 1430b04 | 2022-03-28 14:22:24 -0700 | [diff] [blame] | 18 | /* Get the GSC firmware version information. */ |
Subrata Banik | 60b2ab8 | 2022-03-09 12:55:34 +0530 | [diff] [blame] | 19 | enum cb_err cr50_get_firmware_version(struct cr50_firmware_version *version); |
Tim Wawrzynczak | 6b8599f | 2022-02-14 16:04:21 -0700 | [diff] [blame] | 20 | |
| 21 | /* Set the BOARD_CFG register depending on Cr50 Kconfigs */ |
Subrata Banik | 60b2ab8 | 2022-03-09 12:55:34 +0530 | [diff] [blame] | 22 | enum cb_err cr50_set_board_cfg(void); |
Tim Wawrzynczak | 6b8599f | 2022-02-14 16:04:21 -0700 | [diff] [blame] | 23 | |
Yu-Ping Wu | ae1e702 | 2022-05-17 09:33:18 +0800 | [diff] [blame] | 24 | /* Wait for IRQ to indicate the TPM is ready */ |
| 25 | enum cb_err cr50_wait_tpm_ready(void); |
| 26 | |
Grzegorz Bernacki | 7758b47 | 2023-06-14 12:01:32 +0000 | [diff] [blame^] | 27 | /* Check TPM IRQ and clear it, returns 1 when IRQ pending or 0 when not */ |
| 28 | int cr50_plat_irq_status(void); |
| 29 | |
Tim Wawrzynczak | 6b8599f | 2022-02-14 16:04:21 -0700 | [diff] [blame] | 30 | #endif /* __DRIVERS_TPM_CR50_H__ */ |