coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
common.c File Reference
#include <arch/mmio.h>
#include <console/console.h>
#include <cbfs.h>
#include <cpu/x86/cr.h>
#include <cpu/x86/mp.h>
#include <cpu/x86/msr.h>
#include <cpu/x86/mtrr.h>
#include <lib.h>
#include <smp/node.h>
#include <string.h>
#include <types.h>
#include <cf9_reset.h>
#include "txt.h"
#include "txt_register.h"
#include "txt_getsec.h"
Include dependency graph for common.c:

Go to the source code of this file.

Macros

#define MCU_BASE_ADDR   (TXT_BASE + 0x278)
 
#define BIOACM_ADDR   (TXT_BASE + 0x27c)
 
#define APINIT_ADDR   (TXT_BASE + 0x290)
 
#define SEMAPHORE   (TXT_BASE + 0x294)
 

Functions

void __noreturn txt_reset_platform (void)
 
int intel_txt_log_acm_error (const uint32_t acm_error)
 Dump the ACM error status bits. More...
 
void intel_txt_log_spad (void)
 
bool intel_txt_memory_has_secrets (void)
 
bool intel_txt_chipset_is_production_fused (void)
 
static struct acm_info_tablefind_info_table (const void *ptr)
 
static int validate_acm (const void *ptr)
 Validate that the provided ACM is usable on this platform. More...
 
static voidintel_txt_prepare_bios_acm (size_t *acm_len)
 
void intel_txt_run_sclean (void)
 
int intel_txt_run_bios_acm (const u8 input_params)
 
static bool check_precondition (const int cond)
 
bool intel_txt_prepare_txt_env (void)
 

Macro Definition Documentation

◆ APINIT_ADDR

#define APINIT_ADDR   (TXT_BASE + 0x290)

Definition at line 309 of file common.c.

◆ BIOACM_ADDR

#define BIOACM_ADDR   (TXT_BASE + 0x27c)

Definition at line 308 of file common.c.

◆ MCU_BASE_ADDR

#define MCU_BASE_ADDR   (TXT_BASE + 0x278)

Definition at line 307 of file common.c.

◆ SEMAPHORE

#define SEMAPHORE   (TXT_BASE + 0x294)

Definition at line 310 of file common.c.

Function Documentation

◆ check_precondition()

static bool check_precondition ( const int  cond)
static

Definition at line 382 of file common.c.

References BIOS_DEBUG, and printk.

Referenced by intel_txt_prepare_txt_env().

Here is the caller graph for this function:

◆ find_info_table()

static struct acm_info_table* find_info_table ( const void ptr)
static

Definition at line 165 of file common.c.

References acm_header_v0::header_len, and acm_header_v0::scratch_size.

Referenced by validate_acm().

Here is the caller graph for this function:

◆ intel_txt_chipset_is_production_fused()

bool intel_txt_chipset_is_production_fused ( void  )

Definition at line 149 of file common.c.

References read32(), true, TXT_VER_FSBIF, TXT_VER_PRODUCTION_FUSED, TXT_VER_QPIIF, and UINT32_MAX.

Referenced by txt_dump_chipset_info(), and validate_acm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intel_txt_log_acm_error()

int intel_txt_log_acm_error ( const uint32_t  acm_error)

Dump the ACM error status bits.

Parameters
acm_errorThe status register to dump
Returns
-1 on error (register is not valid) 0 on error (Class > 0 and Major > 0) 1 on success (Class == 0 and Major == 0 and progress > 0)

Definition at line 49 of file common.c.

References ACMERROR_TXT_AC_MODULE_TYPE_BIOS, ACMERROR_TXT_AC_MODULE_TYPE_SINIT, ACMERROR_TXT_CLASS_CODE, ACMERROR_TXT_CLASS_SHIFT, ACMERROR_TXT_EXTERNAL, ACMERROR_TXT_MAJOR_CODE, ACMERROR_TXT_MAJOR_SHIFT, ACMERROR_TXT_MINOR_CODE, ACMERROR_TXT_MINOR_SHIFT, ACMERROR_TXT_PROGRESS_CODE, ACMERROR_TXT_PROGRESS_SHIFT, ACMERROR_TXT_TYPE_CODE, ACMERROR_TXT_TYPE_SHIFT, ACMERROR_TXT_VALID, BIOS_ERR, printk, and type.

Referenced by check_secrets_txt(), intel_txt_log_bios_acm_error(), intel_txt_run_bios_acm(), and mainboard_romstage_entry().

Here is the caller graph for this function:

◆ intel_txt_log_spad()

void intel_txt_log_spad ( void  )

Definition at line 101 of file common.c.

References ACMSTS_BIOS_TRUSTED, ACMSTS_IBB_MEASURED, ACMSTS_TXT_DISABLED, ACMSTS_VERIFICATION_ERROR, BIOS_INFO, printk, read64(), and TXT_SPAD.

Referenced by init_intel_txt(), and mainboard_romstage_entry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intel_txt_memory_has_secrets()

bool intel_txt_memory_has_secrets ( void  )

Definition at line 135 of file common.c.

References BIOS_CRIT, CONFIG, printk, read64(), read8(), TXT_E2STS, TXT_E2STS_SECRET_STS, TXT_ESTS, and TXT_ESTS_WAKE_ERROR_STS.

Referenced by check_secrets_txt(), mainboard_romstage_entry(), and security_clear_dram_request().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intel_txt_prepare_bios_acm()

static void* intel_txt_prepare_bios_acm ( size_t acm_len)
static

Definition at line 238 of file common.c.

References ALIGN_UP, BIOS_ERR, cbfs_map(), cbfs_unmap(), CONFIG, get_var_mtrr_count(), IS_ALIGNED, log2_ceil(), NULL, popcnt(), printk, txt_dump_acm_info(), and validate_acm().

Referenced by intel_txt_run_bios_acm(), and intel_txt_run_sclean().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intel_txt_prepare_txt_env()

◆ intel_txt_run_bios_acm()

int intel_txt_run_bios_acm ( const u8  input_params)

Definition at line 353 of file common.c.

References ACMERROR_TXT_VALID, BIOS_ERR, cbfs_unmap(), getsec_enteraccs(), intel_txt_log_acm_error(), intel_txt_prepare_bios_acm(), printk, read32(), read64(), TXT_BIOSACM_ERRORCODE, and TXT_SPAD.

Referenced by check_secrets_txt(), init_intel_txt(), and lockdown_intel_txt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intel_txt_run_sclean()

void intel_txt_run_sclean ( void  )

Definition at line 313 of file common.c.

References BIOACM_ADDR, BIOS_ALERT, BIOS_CRIT, cbfs_unmap(), getsec_sclean(), intel_txt_prepare_bios_acm(), printk, SEMAPHORE, and write32().

Referenced by intel_txt_romstage_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ txt_reset_platform()

void __noreturn txt_reset_platform ( void  )

Definition at line 29 of file common.c.

References full_reset(), global_reset(), and set_global_reset().

Referenced by intel_txt_prepare_txt_env(), and intel_txt_romstage_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_acm()