Krishna Prasad Bhat | ed34967 | 2020-04-21 19:09:43 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Krishna Prasad Bhat | ed34967 | 2020-04-21 19:09:43 +0530 | [diff] [blame] | 2 | |
| 3 | #include <bootstate.h> |
| 4 | #include <intelblocks/cse.h> |
| 5 | #include <console/console.h> |
| 6 | #include <soc/me.h> |
Krishna Prasad Bhat | ed34967 | 2020-04-21 19:09:43 +0530 | [diff] [blame] | 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 | |
| 20 | hfsts1.data = me_read_config32(PCI_ME_HFSTS1); |
| 21 | hfsts2.data = me_read_config32(PCI_ME_HFSTS2); |
| 22 | hfsts3.data = me_read_config32(PCI_ME_HFSTS3); |
| 23 | hfsts4.data = me_read_config32(PCI_ME_HFSTS4); |
| 24 | hfsts5.data = me_read_config32(PCI_ME_HFSTS5); |
| 25 | hfsts6.data = me_read_config32(PCI_ME_HFSTS6); |
| 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 | |
| 68 | BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_EXIT, print_me_fw_version, NULL); |
| 69 | BOOT_STATE_INIT_ENTRY(BS_OS_RESUME_CHECK, BS_ON_EXIT, dump_me_status, NULL); |