Michał Żygowski has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/56023 )
Change subject: board_enable.c: Add ME unlock function for TUXEDO laptops ......................................................................
board_enable.c: Add ME unlock function for TUXEDO laptops
Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com Change-Id: I6bf1c40900aa674e3ea4f6add12dae8b73759fbb --- M board_enable.c M flashrom.8.tmpl 2 files changed, 39 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/23/56023/1
diff --git a/board_enable.c b/board_enable.c index 9cf0103..6780786 100644 --- a/board_enable.c +++ b/board_enable.c @@ -2306,6 +2306,37 @@ return 0; }
+static int tuxedo_unlock_me(void) +{ + uint8_t data; + char *arg; + + arg = extract_programmer_param("unlockmeonly"); + if (!arg && strcmp(arg, "yes")) + return 0; + + free(arg); + + if (!ec_write_cmd(EC_CONTROL, 0xc2)) { + msg_perr("Failed to start ME unlocking.\n"); + return -1; + } + + if (!ec_read_reg(0xda, &data)) { + msg_perr("Failed to read ME state register\n"); + return -1; + } + + if (!ec_write_reg(0xda, data | 0x08)) { + msg_perr("Failed to update ME state register\n"); + return -1; + } + + msg_perr("ME has been unlocked. Power off and then power on to take effect.\n"); + + return 0; +} + #endif
/* @@ -2527,6 +2558,8 @@ {0x1106, 0x0259, 0x1106, 0xAA07, 0x1106, 0x3227, 0x1106, 0xAA07, NULL, NULL, NULL, P3, "VIA", "EPIA EK", 0, NT, via_vt823x_gpio9_raise}, {0x1106, 0x3177, 0x1106, 0xAA01, 0x1106, 0x3123, 0x1106, 0xAA01, NULL, NULL, NULL, P3, "VIA", "EPIA M/MII/...", 0, OK, via_vt823x_gpio15_raise}, {0x1106, 0x0259, 0x1106, 0x3227, 0x1106, 0x3065, 0x1106, 0x3149, NULL, NULL, NULL, P3, "VIA", "EPIA-N/NL", 0, OK, via_vt823x_gpio9_raise}, + {0x8086, 0xa082, 0x1558, 0x14a1, 0x8086, 0x9a14, 0x1558, 0x14a1, NULL, NULL, NULL, P3, "TUXEDO", "InfinityBook S 14 Gen6", 0, OK, tuxedo_unlock_me}, + {0x8086, 0xa082, 0x1558, 0x14a1, 0x8086, 0x9a14, 0x1558, 0x14a1, NULL, NULL, NULL, P3, "TUXEDO", "InfinityBook S 15 Gen6", 0, OK, tuxedo_unlock_me}, #endif { 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, P3, NULL, NULL, 0, NT, NULL}, /* end marker */ }; diff --git a/flashrom.8.tmpl b/flashrom.8.tmpl index 228e17b..ccacd86 100644 --- a/flashrom.8.tmpl +++ b/flashrom.8.tmpl @@ -645,6 +645,12 @@ .B " flashrom -p internal:laptop=this_is_not_a_laptop" .sp to tell flashrom (at your own risk) that it is not running on a laptop. +.sp +Parameter +.B unlockmeonly +can be used to unlock updating flash on Clevo/Tuxedo laptops. Syntax is +.sp +.B " flashrom -p internal:unlockmeonly=yes" .SS .BR "dummy " programmer .IP