xref: /aosp_15_r20/external/coreboot/src/soc/intel/common/block/include/intelblocks/tco.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef SOC_INTEL_COMMON_BLOCK_TCO_H
4 #define SOC_INTEL_COMMON_BLOCK_TCO_H
5 
6 #include <stdint.h>
7 
8 /* Get base address of TCO I/O registers. */
9 uint16_t tco_get_bar(void);
10 /*
11  * Enable TCO BAR using SMBUS TCO base to access TCO related register
12  * also disable the timer.
13  */
14 void tco_configure(void);
15 /* Lockdown TCO registers before booting to OS */
16 void tco_lockdown(void);
17 /*
18  * Resets the tco status registers. This function clears the tco_sts register
19  * and returns the status bits set.
20  */
21 uint32_t tco_reset_status(void);
22 uint16_t tco_read_reg(uint16_t tco_reg);
23 void tco_write_reg(uint16_t tco_reg, uint16_t value);
24 
25 /* Get TCO timer period in milliseconds */
26 uint32_t tco_get_timer_period(void);
27 /* Get the minimum time value for the TCO timer */
28 uint32_t tco_get_timer_min_value(void);
29 /* Get the maximum time value for the TCO timer */
30 uint32_t tco_get_timer_max_value(void);
31 
32 #endif /* SOC_INTEL_COMMON_BLOCK_TCO_H */
33