2 * tboot.h: shared data structure with tboot and kernel and functions
3 * used by kernel for runtime support of Intel(R) Trusted
6 * Copyright (c) 2006-2009, Intel Corporation
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
26 #include <acpi/acpi.h>
28 /* these must have the values from 0-5 in this order */
30 TB_SHUTDOWN_REBOOT = 0,
38 #ifdef CONFIG_INTEL_TXT
40 /* used to communicate between tboot and the launched kernel */
42 #define TB_KEY_SIZE 64 /* 512 bits */
44 #define MAX_TB_MAC_REGIONS 32
46 struct tboot_mac_region {
47 u64 start; /* must be 64 byte -aligned */
48 u32 size; /* must be 64 byte -granular */
51 /* GAS - Generic Address Structure (ACPI 2.0+) */
52 struct tboot_acpi_generic_address {
61 * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec
62 * (http://www.acpi.info/)
64 struct tboot_acpi_sleep_info {
65 struct tboot_acpi_generic_address pm1a_cnt_blk;
66 struct tboot_acpi_generic_address pm1b_cnt_blk;
67 struct tboot_acpi_generic_address pm1a_evt_blk;
68 struct tboot_acpi_generic_address pm1b_evt_blk;
73 u64 kernel_s3_resume_vector;
77 * shared memory page used for communication between tboot and kernel
87 /* version number: 5 is current */
90 /* physical addr of tb_log_t log */
94 * physical addr of entry point for tboot shutdown and
95 * type of shutdown (TB_SHUTDOWN_*) being requested
100 /* kernel-specified ACPI info for Sx shutdown */
101 struct tboot_acpi_sleep_info acpi_sinfo;
103 /* tboot location in memory (physical) */
107 /* memory regions (phys addrs) for tboot to MAC on S3 */
109 struct tboot_mac_region mac_regions[MAX_TB_MAC_REGIONS];
116 /* symmetric key for use by kernel; will be encrypted on S3 */
117 u8 s3_key[TB_KEY_SIZE];
124 /* used to 4byte-align num_in_wfs */
125 u8 reserved_align[3];
127 /* number of processors in wait-for-SIPI */
132 * UUID for tboot data struct to facilitate matching
133 * defined as {663C8DFF-E8B3-4b82-AABF-19EA4D057A08} by tboot, which is
134 * represented as {} in the char array used here
136 #define TBOOT_UUID {0xff, 0x8d, 0x3c, 0x66, 0xb3, 0xe8, 0x82, 0x4b, 0xbf,\
137 0xaa, 0x19, 0xea, 0x4d, 0x5, 0x7a, 0x8}
139 extern struct tboot *tboot;
141 static inline int tboot_enabled(void)
143 return tboot != NULL;
146 extern void tboot_probe(void);
147 extern void tboot_create_trampoline(void);
148 extern void tboot_shutdown(u32 shutdown_type);
149 extern void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control);
150 extern int tboot_wait_for_aps(int num_aps);
151 extern struct acpi_table_header *tboot_get_dmar_table(
152 struct acpi_table_header *dmar_tbl);
153 extern int tboot_force_iommu(void);
155 #else /* CONFIG_INTEL_TXT */
157 static inline int tboot_enabled(void)
162 static inline void tboot_probe(void)
166 static inline void tboot_create_trampoline(void)
170 static inline void tboot_shutdown(u32 shutdown_type)
174 static inline void tboot_sleep(u8 sleep_state, u32 pm1a_control,
179 static inline int tboot_wait_for_aps(int num_aps)
184 static inline struct acpi_table_header *tboot_get_dmar_table(
185 struct acpi_table_header *dmar_tbl)
190 static inline int tboot_force_iommu(void)
195 #endif /* !CONFIG_INTEL_TXT */
197 #endif /* _ASM_TBOOT_H */