coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
me.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <bootstate.h>
4 #include <intelblocks/cse.h>
5 #include <console/console.h>
6 #include <soc/me.h>
7 
8 static void dump_me_status(void *unused)
9 {
10  union me_hfsts1 hfsts1;
11  union me_hfsts2 hfsts2;
12  union me_hfsts3 hfsts3;
13  union me_hfsts4 hfsts4;
14  union me_hfsts5 hfsts5;
15  union me_hfsts6 hfsts6;
16 
17  if (!is_cse_enabled())
18  return;
19 
26 
27  printk(BIOS_DEBUG, "ME: HFSTS1 : 0x%08X\n", hfsts1.data);
28  printk(BIOS_DEBUG, "ME: HFSTS2 : 0x%08X\n", hfsts2.data);
29  printk(BIOS_DEBUG, "ME: HFSTS3 : 0x%08X\n", hfsts3.data);
30  printk(BIOS_DEBUG, "ME: HFSTS4 : 0x%08X\n", hfsts4.data);
31  printk(BIOS_DEBUG, "ME: HFSTS5 : 0x%08X\n", hfsts5.data);
32  printk(BIOS_DEBUG, "ME: HFSTS6 : 0x%08X\n", hfsts6.data);
33 
34  printk(BIOS_DEBUG, "ME: Manufacturing Mode : %s\n",
35  hfsts1.fields.mfg_mode ? "YES" : "NO");
36  printk(BIOS_DEBUG, "ME: FW Partition Table : %s\n",
37  hfsts1.fields.fpt_bad ? "BAD" : "OK");
38  printk(BIOS_DEBUG, "ME: Bringup Loader Failure : %s\n",
39  hfsts1.fields.ft_bup_ld_flr ? "YES" : "NO");
40  printk(BIOS_DEBUG, "ME: Firmware Init Complete : %s\n",
41  hfsts1.fields.fw_init_complete ? "YES" : "NO");
42  printk(BIOS_DEBUG, "ME: Boot Options Present : %s\n",
43  hfsts1.fields.boot_options_present ? "YES" : "NO");
44  printk(BIOS_DEBUG, "ME: Update In Progress : %s\n",
45  hfsts1.fields.update_in_progress ? "YES" : "NO");
46  printk(BIOS_DEBUG, "ME: D0i3 Support : %s\n",
47  hfsts1.fields.d0i3_support_valid ? "YES" : "NO");
48  printk(BIOS_DEBUG, "ME: Low Power State Enabled : %s\n",
49  hfsts2.fields.low_power_state ? "YES" : "NO");
50  printk(BIOS_DEBUG, "ME: CPU Replaced : %s\n",
51  hfsts2.fields.cpu_replaced ? "YES" : "NO");
52  printk(BIOS_DEBUG, "ME: CPU Replacement Valid : %s\n",
53  hfsts2.fields.cpu_replaced_valid ? "YES" : "NO");
54  printk(BIOS_DEBUG, "ME: Current Working State : %u\n",
55  hfsts1.fields.working_state);
56  printk(BIOS_DEBUG, "ME: Current Operation State : %u\n",
57  hfsts1.fields.operation_state);
58  printk(BIOS_DEBUG, "ME: Current Operation Mode : %u\n",
59  hfsts1.fields.operation_mode);
60  printk(BIOS_DEBUG, "ME: Error Code : %u\n",
61  hfsts1.fields.error_code);
62  printk(BIOS_DEBUG, "ME: CPU Debug Disabled : %s\n",
63  hfsts6.fields.cpu_debug_disable ? "YES" : "NO");
64  printk(BIOS_DEBUG, "ME: TXT Support : %s\n",
65  hfsts6.fields.txt_support ? "YES" : "NO");
66 }
67 
@ BS_OS_RESUME_CHECK
Definition: bootstate.h:85
@ BS_DEV_ENABLE
Definition: bootstate.h:82
@ BS_ON_EXIT
Definition: bootstate.h:96
void print_me_fw_version(void *unused)
Definition: cse.c:855
bool is_cse_enabled(void)
Definition: cse.c:640
uint32_t me_read_config32(int offset)
Definition: cse.c:645
#define printk(level,...)
Definition: stdlib.h:16
@ PCI_ME_HFSTS3
Definition: cse.h:73
@ PCI_ME_HFSTS4
Definition: cse.h:74
@ PCI_ME_HFSTS2
Definition: cse.h:72
@ PCI_ME_HFSTS6
Definition: cse.h:76
@ PCI_ME_HFSTS5
Definition: cse.h:75
@ PCI_ME_HFSTS1
Definition: cse.h:71
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_EXIT, print_me_fw_version, NULL)
void dump_me_status(void *unused)
Definition: me.c:97
#define NULL
Definition: stddef.h:19
Definition: me.h:9
u32 boot_options_present
Definition: me.h:22
u32 operation_state
Definition: me.h:15
u32 update_in_progress
Definition: me.h:18
u32 d0i3_support_valid
Definition: me.h:28
u32 fw_init_complete
Definition: me.h:16
u32 mfg_mode
Definition: me.h:13
u32 ft_bup_ld_flr
Definition: me.h:17
u32 operation_mode
Definition: me.h:20
u32 error_code
Definition: me.h:19
struct me_hfsts1::@464 fields
u32 data
Definition: me.h:10
u32 working_state
Definition: me.h:12
u32 fpt_bad
Definition: me.h:14
Definition: me.c:11
uint32_t cpu_replaced_valid
Definition: me.c:21
uint32_t cpu_replaced
Definition: me.c:17
uint32_t low_power_state
Definition: me.c:22
uint32_t data
Definition: me.c:12
struct me_hfsts2::@477 fields
Definition: me.h:33
u32 data
Definition: me.h:34
Definition: me.c:35
uint32_t data
Definition: me.c:36
Definition: me.c:51
uint32_t data
Definition: me.c:52
Definition: me.c:70
uint32_t data
Definition: me.c:71
struct me_hfsts6::@480 fields
uint32_t cpu_debug_disable
Definition: me.c:74
uint32_t txt_support
Definition: me.c:90