![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <arch/cpu.h>
#include <console/console.h>
#include <cbfs.h>
#include <commonlib/region.h>
#include <fmap.h>
#include <intelblocks/cse.h>
#include <intelblocks/cse_layout.h>
#include <intelbasecode/debug_feature.h>
#include <security/vboot/vboot_common.h>
#include <security/vboot/misc.h>
#include <soc/intel/common/reset.h>
Go to the source code of this file.
Data Structures | |
struct | cse_bp_entry |
struct | cse_bp_info |
struct | get_bp_info_rsp |
Macros | |
#define | BPDT_HEADER_SZ sizeof(struct bpdt_header) |
#define | BPDT_ENTRY_SZ sizeof(struct bpdt_entry) |
#define | SUBPART_HEADER_SZ sizeof(struct subpart_hdr) |
#define | SUBPART_ENTRY_SZ sizeof(struct subpart_entry) |
#define | SUBPART_MANIFEST_HDR_SZ sizeof(struct subpart_entry_manifest_header) |
#define | GET_BP_STR(bp_index) (bp_index ? "RW" : "RO") |
#define | CSE_RW_SIGNATURE 0x000055aa |
#define | CSE_RW_SIGN_SIZE sizeof(uint32_t) |
#define | CSE_MAX_BOOT_PARTITIONS 3 |
Enumerations | |
enum | boot_partition_id { RO = 0 , RW = 1 } |
enum | bp_status { BP_STATUS_SUCCESS = 0 , BP_STATUS_GENERAL_FAILURE = 1 , BP_STATUS_PARTITION_NOT_PRESENT = 2 , BP_STATUS_DATA_FAILURE = 3 } |
enum | bp_info_flags { BP_INFO_REDUNDANCY_EN = 1 << 0 , BP_INFO_MIN_RECOV_MODE_EN = 1 << 1 , BP_INFO_READ_ONLY_CFG = 1 << 2 } |
enum | cse_update_status { CSE_UPDATE_NOT_REQUIRED , CSE_UPDATE_UPGRADE , CSE_UPDATE_DOWNGRADE , CSE_UPDATE_CORRUPTED , CSE_UPDATE_METADATA_ERROR } |
Variables | |
struct cse_bp_entry | __packed |
static const char *const | cse_regions [] = {"RO", "RW"} |
#define BPDT_ENTRY_SZ sizeof(struct bpdt_entry) |
Definition at line 16 of file cse_lite.c.
#define BPDT_HEADER_SZ sizeof(struct bpdt_header) |
Definition at line 15 of file cse_lite.c.
#define CSE_MAX_BOOT_PARTITIONS 3 |
Definition at line 38 of file cse_lite.c.
#define CSE_RW_SIGN_SIZE sizeof(uint32_t) |
Definition at line 28 of file cse_lite.c.
#define CSE_RW_SIGNATURE 0x000055aa |
Definition at line 25 of file cse_lite.c.
#define GET_BP_STR | ( | bp_index | ) | (bp_index ? "RW" : "RO") |
Definition at line 22 of file cse_lite.c.
#define SUBPART_ENTRY_SZ sizeof(struct subpart_entry) |
Definition at line 18 of file cse_lite.c.
#define SUBPART_HEADER_SZ sizeof(struct subpart_hdr) |
Definition at line 17 of file cse_lite.c.
#define SUBPART_MANIFEST_HDR_SZ sizeof(struct subpart_entry_manifest_header) |
Definition at line 19 of file cse_lite.c.
enum boot_partition_id |
Enumerator | |
---|---|
RO | |
RW |
Definition at line 41 of file cse_lite.c.
enum bp_info_flags |
Enumerator | |
---|---|
BP_INFO_REDUNDANCY_EN | |
BP_INFO_MIN_RECOV_MODE_EN | |
BP_INFO_READ_ONLY_CFG |
Definition at line 77 of file cse_lite.c.
enum bp_status |
Enumerator | |
---|---|
BP_STATUS_SUCCESS | |
BP_STATUS_GENERAL_FAILURE | |
BP_STATUS_PARTITION_NOT_PRESENT | |
BP_STATUS_DATA_FAILURE |
Definition at line 53 of file cse_lite.c.
enum cse_update_status |
Enumerator | |
---|---|
CSE_UPDATE_NOT_REQUIRED | |
CSE_UPDATE_UPGRADE | |
CSE_UPDATE_DOWNGRADE | |
CSE_UPDATE_CORRUPTED | |
CSE_UPDATE_METADATA_ERROR |
Definition at line 582 of file cse_lite.c.
Definition at line 350 of file cse_lite.c.
Referenced by cse_set_and_boot_from_next_bp().
|
static |
Definition at line 454 of file cse_lite.c.
References cse_get_current_bp(), cse_set_and_boot_from_next_bp(), and RO.
Referenced by cse_prep_for_component_update(), and cse_prep_for_rw_update().
|
static |
Definition at line 373 of file cse_lite.c.
References cse_get_current_bp(), cse_set_and_boot_from_next_bp(), and RW.
Referenced by cse_fix_data_failure_err().
|
static |
Definition at line 590 of file cse_lite.c.
References BIOS_ERR, printk, and skip_atoi().
Referenced by cse_fw_update().
|
static |
Definition at line 527 of file cse_lite.c.
References fw_version::build, fw_version::hotfix, fw_version::major, and fw_version::minor.
|
static |
Definition at line 571 of file cse_lite.c.
References BIOS_ERR, buf, offset, printk, and rdev_writeat().
Referenced by cse_sub_part_trigger_update(), and cse_write_rw_region().
|
static |
Definition at line 312 of file cse_lite.c.
References __packed, BIOS_DEBUG, BIOS_ERR, cse_get_current_bp(), cse_is_hfs1_com_soft_temp_disable(), cse_is_hfs1_cws_normal(), HECI_MKHI_ADDR, heci_send_receive(), MKHI_BUP_COMMON_DATA_CLEAR, MKHI_GROUP_ID_BUP_COMMON, printk, mkhi_hdr::result, and RO.
Referenced by cse_fix_data_failure_err(), and cse_prep_for_rw_update().
|
static |
Definition at line 562 of file cse_lite.c.
References BIOS_ERR, printk, rdev_eraseat(), and region_device_sz().
Referenced by cse_sub_part_trigger_update().
|
static |
Definition at line 394 of file cse_lite.c.
References cse_boot_to_rw(), cse_data_clear_request(), and cse_is_rw_dp_valid().
Definition at line 1042 of file cse_lite.c.
Referenced by mainboard_romstage_entry().
|
static |
Definition at line 763 of file cse_lite.c.
References BIOS_DEBUG, BIOS_ERR, cse_check_update_status(), cse_get_target_rdev(), CSE_LITE_SKU_RW_ACCESS_ERROR, CSE_LITE_SKU_RW_METADATA_NOT_FOUND, CSE_NO_ERROR, cse_trigger_fw_update(), CSE_UPDATE_METADATA_ERROR, CSE_UPDATE_NOT_REQUIRED, and printk.
bool cse_get_boot_performance_data | ( | struct cse_boot_perf_rsp * | boot_perf_rsp | ) |
Definition at line 133 of file cse_lite.c.
References __packed, BIOS_ERR, cse_boot_perf_rsp::hdr, HECI_MKHI_ADDR, heci_send_receive(), MKHI_BUP_COMMON_GET_BOOT_PERF_DATA, MKHI_GROUP_ID_BUP_COMMON, printk, and mkhi_hdr::result.
Referenced by cbmem_inject_telemetry_data().
|
static |
Definition at line 169 of file cse_lite.c.
References cse_bp_info::bp_entries.
Referenced by cse_get_bp_entry_range(), cse_get_bp_entry_version(), cse_is_rw_bp_status_valid(), cse_is_rw_dp_valid(), and cse_print_boot_partition_info().
|
static |
Definition at line 425 of file cse_lite.c.
References cse_get_bp_entry(), cse_bp_entry::end_offset, and cse_bp_entry::start_offset.
Referenced by cse_get_target_rdev(), and cse_locate_area_as_rdev_rw().
|
static |
Definition at line 411 of file cse_lite.c.
References cse_get_bp_entry(), and cse_bp_entry::fw_ver.
Referenced by cse_get_rw_version().
|
static |
Definition at line 226 of file cse_lite.c.
References __packed, BIOS_ERR, get_bp_info_rsp::bp_info, cse_is_bp_cmd_info_possible(), cse_print_boot_partition_info(), get_bp_info_rsp::hdr, HECI_MKHI_ADDR, heci_send_receive(), MKHI_BUP_COMMON_GET_BOOT_PARTITION_INFO, MKHI_GROUP_ID_BUP_COMMON, printk, and mkhi_hdr::result.
|
static |
Definition at line 164 of file cse_lite.c.
References cse_bp_info::current_bp.
Referenced by cse_boot_to_ro(), cse_boot_to_rw(), and cse_data_clear_request().
|
static |
Definition at line 462 of file cse_lite.c.
References BIOS_ERR, fmap_locate_area_as_rdev_rw(), printk, and rdev.
Referenced by cse_get_target_rdev(), and cse_locate_area_as_rdev_rw().
|
static |
Definition at line 420 of file cse_lite.c.
References cse_get_bp_entry_version(), and RW.
|
static |
Definition at line 508 of file cse_lite.c.
References NULL, vboot_get_context(), and vboot_is_firmware_slot_a().
|
static |
Definition at line 866 of file cse_lite.c.
References subpart_entry_manifest_header::binary_version, BIOS_ERR, subpart_entry_manifest_header::build, cse_sub_part_str(), fw_ver, subpart_entry_manifest_header::hotfix, subpart_entry_manifest_header::major, subpart_entry_manifest_header::minor, subpart_entry::offset_bytes, printk, rdev, rdev_readat(), SUBPART_ENTRY_SZ, SUBPART_HEADER_SZ, SUBPART_MANIFEST_HDR_SZ, and type.
|
static |
Definition at line 485 of file cse_lite.c.
References BIOS_DEBUG, cse_get_bp_entry_range(), cse_get_rw_rdev(), printk, rdev_chain(), and RW.
Referenced by cse_fw_update().
Definition at line 213 of file cse_lite.c.
References cse_is_hfs1_com_normal(), cse_is_hfs1_com_secover_mei_msg(), cse_is_hfs1_com_soft_temp_disable(), and cse_is_hfs1_cws_normal().
Referenced by cse_get_bp_info(), and cse_set_next_boot_partition().
|
static |
Definition at line 473 of file cse_lite.c.
References BIOS_ERR, CSE_RW_SIGN_SIZE, CSE_RW_SIGNATURE, printk, and rdev_readat().
|
static |
Definition at line 440 of file cse_lite.c.
References BIOS_ERR, BP_STATUS_GENERAL_FAILURE, BP_STATUS_PARTITION_NOT_PRESENT, cse_get_bp_entry(), printk, RW, and cse_bp_entry::status.
|
static |
Definition at line 382 of file cse_lite.c.
References BP_STATUS_DATA_FAILURE, cse_get_bp_entry(), RW, and cse_bp_entry::status.
Referenced by cse_fix_data_failure_err().
|
static |
Definition at line 795 of file cse_lite.c.
References BIOS_DEBUG, cse_get_bp_entry_range(), cse_get_rw_rdev(), cse_regions, printk, rdev_chain(), RO, RW, and strcmp().
Referenced by cse_sub_part_get_target_rdev().
|
static |
Definition at line 910 of file cse_lite.c.
References cse_boot_to_ro(), and cse_hmrfpo_enable().
|
static |
Definition at line 697 of file cse_lite.c.
References BIOS_ERR, cse_boot_to_ro(), cse_data_clear_request(), cse_hmrfpo_enable(), CSE_UPDATE_CORRUPTED, CSE_UPDATE_DOWNGRADE, and printk.
|
static |
Definition at line 175 of file cse_lite.c.
References BIOS_DEBUG, fw_version::build, cse_get_bp_entry(), cse_bp_info::current_bp, cse_bp_entry::end_offset, cse_bp_info::flags, cse_bp_entry::fw_ver, GET_BP_STR, fw_version::hotfix, fw_version::major, fw_version::minor, cse_bp_info::next_bp, printk, RO, RW, cse_bp_entry::start_offset, cse_bp_entry::status, and cse_bp_info::total_number_of_bp.
Referenced by cse_get_bp_info().
|
static |
Definition at line 356 of file cse_lite.c.
References cse_board_reset(), cse_set_next_boot_partition(), die(), and do_global_reset().
Referenced by cse_boot_to_ro(), and cse_boot_to_rw().
|
static |
Definition at line 269 of file cse_lite.c.
References __packed, BIOS_ERR, BIOS_INFO, cse_is_bp_cmd_info_possible(), GET_BP_STR, HECI_MKHI_ADDR, heci_send_receive(), MKHI_BUP_COMMON_SET_BOOT_PARTITION_INFO, MKHI_GROUP_ID_BUP_COMMON, printk, mkhi_hdr::result, RO, and RW.
Referenced by cse_set_and_boot_from_next_bp().
|
static |
Definition at line 948 of file cse_lite.c.
References CSE_LITE_SKU_PART_UPDATE_SUCCESS, CSE_LITE_SKU_SUB_PART_UPDATE_NOT_REQ, and cse_trigger_vboot_recovery().
Referenced by cse_sub_part_fw_update().
|
static |
Definition at line 1023 of file cse_lite.c.
References BIOS_INFO, CSE_LITE_SKU_SUB_PART_UPDATE_NOT_REQ, cse_sub_part_fw_component_update(), handle_cse_sub_part_fw_update_rv(), IOM_FW, NPHY_FW, printk, and skip_cse_sub_part_update().
|
static |
Definition at line 895 of file cse_lite.c.
References subpart_entry_manifest_header::binary_version, subpart_entry_manifest_header::build, fw_ver, subpart_entry_manifest_header::hotfix, subpart_entry_manifest_header::major, subpart_entry_manifest_header::minor, subpart_entry::offset_bytes, and SUBPART_HEADER_SZ.
|
static |
Definition at line 821 of file cse_lite.c.
References BIOS_ERR, BIOS_INFO, BPDT_ENTRY_SZ, BPDT_HEADER_SZ, cse_locate_area_as_rdev_rw(), cse_regions, cse_sub_part_str(), bpdt_header::descriptor_count, MAX_SUBPARTS, offset, printk, rdev_chain(), rdev_readat(), bpdt_entry::size, and type.
|
static |
Definition at line 783 of file cse_lite.c.
References IOM_FW, NPHY_FW, and type.
Referenced by cse_get_sub_part_fw_version(), cse_sub_part_get_target_rdev(), and cse_sub_part_trigger_update().
|
static |
Definition at line 923 of file cse_lite.c.
References BIOS_ERR, BIOS_INFO, cse_copy_rw(), cse_erase_rw_region(), CSE_LITE_SKU_PART_UPDATE_SUCCESS, CSE_LITE_SKU_SUB_PART_LAYOUT_MISMATCH_ERROR, CSE_LITE_SKU_SUB_PART_UPDATE_FAIL, cse_sub_part_str(), GET_BP_STR, printk, region_device_sz(), and type.
|
static |
Definition at line 697 of file cse_lite.c.
Referenced by cse_fw_update().
|
static |
Definition at line 667 of file cse_lite.c.
References CONFIG, and is_debug_cse_fw_update_disable().
|
static |
Definition at line 645 of file cse_lite.c.
References BIOS_INFO, cse_copy_rw(), CSE_RW_SIGN_SIZE, and printk.
Definition at line 948 of file cse_lite.c.
Referenced by cse_sub_part_fw_update().
Definition at line 667 of file cse_lite.c.
|
static |
Definition at line 590 of file cse_lite.c.
struct get_bp_info_rsp __packed |
|
static |
Definition at line 131 of file cse_lite.c.
Referenced by cse_locate_area_as_rdev_rw(), and cse_sub_part_get_target_rdev().