coreboot/src/mainboard
Evgeny Zinoviev 833e9bad47 sb/intel/bd82x6x: Support ME Soft Temporary Disable Mode
- Add support for ME Soft Temporary Disable Mode. In this mode, ME
  doesn't load its kernel and freezes at Bring UP (BUP) phase. This mode
  is saved in ME NVRAM (and thus will remain for next reboots and
  poweroffs).

- Add support of new CMOS option for Sandy Bridge and Ivy Bridge
  ThinkPads.

HOW TO USE

To disable ME:
1. nvramtool -w me_state=Disabled
2. reboot

To enable it back:
1. nvramtool -w me_state=Normal
2. reboot

To check current status:
intelmetool -m

Tested on ThinkPad X230 and ThinkPad X220.

BACKGROUND

There's no Intel documentation that would explain how this should be
implemented, in public. Working binary sequence for MKHI command to put
ME in Soft Temporary Disable Mode, as well as a way to bring ME out of
it (by writing to H_GS register), was found and published by researchers
from PT Security:

1.  To disable ME, BIOS issues the disable command (before End of Post)
    and reboots. ME is supposed to be disabled on the next boot after
    DID (DRAM Init Done).

    My numerous tests show that issuing the command and rebooting is not
    enough. If we reboot too early, ME will not be disabled. Apparently,
    it is doing something in background after receiving the command. It
    works with a delay of 500-1000 ms.

    I also tried to dump all known (documented) registers, such as GMES
    and HFS, before and during the next 2 seconds after execution of the
    disable command to find a possible indication that something's
    changed in ME and we're ready to reboot. Found nothing
    unfortunately.

2.  To enable ME back, host writes value 0x20000000 to H_GS.

    PT slides don't contain any more information on it, but my tests
    show, that after writing this value, GMES[31:28] is changing from
    0x01 (BUP phase) to 0x03 (Policy Module) to 0x06 (Host
    Communication). Then, after some more time, fw_init_complete bit of
    HFS becomes 1.

    This means that ME starts loading its kernel immediately, without
    reboot.

    On the other hand, Lenovo BIOS clearly perform a reboot after
    enabling it (one reboot after saving the settings, then ThinkPad
    logo appears, and then one more reboot). I'm assuming we have to
    reset too.

Change-Id: Ic01526c9731cbef4e8552bbc352133a2415787c2
Signed-off-by: Evgeny Zinoviev <me@ch1p.io>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37115
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2021-02-07 23:06:52 +00:00
..
51nb ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
acer ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
adlink
amd src: Remove useless comments in "includes" lines 2021-02-04 10:18:49 +00:00
aopen arch/x86: Remove most C_ENV_BOOTBLOCK_SIZE limits 2021-01-28 08:55:31 +00:00
apple mb/apple/macbookair4_2: Add ACPI support for EC 2021-02-05 09:40:17 +00:00
asrock mb/asrock/e350m1: Convert to ASL 2.0 syntax 2021-01-28 21:33:12 +00:00
asus ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
bap ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
biostar mb/biostar/th61-itx/early_init.c: Clean includes 2021-02-03 08:53:27 +00:00
bostentech ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
cavium
clevo mb/clevo/cml-u/bootblock.c: Remove unused includes 2021-02-04 09:54:35 +00:00
compulab ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
dell ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
elmex mb/elmex/pcm205400: Convert to ASL 2.0 syntax 2021-01-28 18:02:34 +00:00
emulation mb/emulation/qemu-q35: Mark TSEG region as reserved 2021-02-06 18:51:29 +00:00
example
facebook treewide: Remove unused #includes of spi_winbond.h 2021-01-28 14:19:14 +00:00
foxconn ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
getac ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
gigabyte mb/gigabyte/ga-h61m-series: Drop broken thermal.asl 2021-02-05 17:46:54 +00:00
gizmosphere mb/gizmosphere/gizmo2: Convert to ASL 2.0 syntax 2021-01-28 21:34:38 +00:00
google mb/google/volteer/var/voxel: Add gpio-keys ACPI node for PENH 2021-02-07 21:55:27 +00:00
hp mb/hp/pavilion_m6_1035dx: Convert to ASL 2.0 syntax 2021-01-28 21:33:40 +00:00
ibase ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
intel mb/intel/shadowmountain: Add bootblock and verstage code 2021-02-06 09:09:16 +00:00
jetway ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
kontron ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
lenovo sb/intel/bd82x6x: Support ME Soft Temporary Disable Mode 2021-02-07 23:06:52 +00:00
libretrend ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
lippert src: Remove useless comments in "includes" lines 2021-02-04 10:18:49 +00:00
msi ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
ocp src: Remove unused <bootstate.h> 2021-02-04 09:51:10 +00:00
opencellular
packardbell ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
pcengines mb/pcengines/apu2: Switch to proper GPIO API 2021-02-01 10:33:44 +00:00
portwell treewide: Remove unused #includes of spi_winbond.h 2021-01-28 14:19:14 +00:00
prodrive mb/prodrive/hermes: Use some board settings from EEPROM 2021-02-04 10:19:33 +00:00
protectli ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
purism drivers/intel/fsp2_0: Fix running on x86_64 2021-02-04 10:21:42 +00:00
razer ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
roda sb/intel/i82801ix: Factor out common acpi_fill_madt 2021-02-01 09:04:25 +00:00
samsung ACPI: Move include for <vc/google/chromeos.asl> 2021-01-28 08:59:54 +00:00
sapphire ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
scaleway ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
siemens mb/siemens/mc_apl1: do UART pad configuration at board-level 2021-02-02 17:11:42 +00:00
sifive cbfs: Simplify load/map API names, remove type arguments 2020-12-02 22:13:17 +00:00
supermicro ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
system76 mb/system76/oryp5: Fix up DSDT 2021-01-28 11:03:56 +00:00
ti
up ACPI: Add top-level ASL 2021-01-27 15:35:13 +00:00
Kconfig