summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2022-09-21 21:56:24 +0200
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-20 09:32:37 +0000
commitc56fcc601f443721999c1e8787eb1371b5ac9ce3 (patch)
tree7e269af2735ac0e3cc7427fe715c43e0bd29e5ba
parentea4e0494b26976cd178cf252b6044d1c3822f620 (diff)
downloadchrome-ec-c56fcc601f443721999c1e8787eb1371b5ac9ce3.tar.gz
flash_fp_mcu: Don't change GPIO direction to input on Skyrim
If we change nRST (pin 780) GPIO direction to input, the value on that line will be 0, so FPMCU will be in reset until we reboot DUT. As a result flash_fp_mcu script could accidentally reset FPMCU while disabling sector write protection (first FPMCU boot with HW WP disabled). This will corrupt STM32 flash internal structures in a way that can be only recovered by flashing new firmware using internal bootloader (running flash_fp_mcu). BUG=b:253362456 BRANCH=none TEST=After running 'flash_fp_mcu --hello' execute 'echo "780" > /sys/class/gpio/export'. Make sure that: 'cat /sys/class/gpio/gpio780/direction' prints 'out' and 'cat /sys/class/gpio/gpio780/value' prints '1'. Change-Id: I42497bb01bff4a7fe5a1342c38d861284d5e4d68 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4264110 Reviewed-by: Andrea Grandi <agrandi@google.com> Commit-Queue: Patryk Duda <patrykd@google.com> Tested-by: Patryk Duda <patrykd@google.com>
-rw-r--r--util/flash_fp_mcu3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu
index 714a864da0..b857ba82f6 100644
--- a/util/flash_fp_mcu
+++ b/util/flash_fp_mcu
@@ -468,7 +468,8 @@ flash_fp_mcu_stm32() {
# open-drain outputs on other platforms.
if [[ "${PLATFORM_BASE_NAME}" != "strongbad" ]] &&
[[ "${PLATFORM_BASE_NAME}" != "herobrine" ]] &&
- [[ "${PLATFORM_BASE_NAME}" != "zork" ]]; then
+ [[ "${PLATFORM_BASE_NAME}" != "zork" ]] &&
+ [[ "${PLATFORM_BASE_NAME}" != "skyrim" ]]; then
gpio in "${gpio_boot0}" "${gpio_nrst}"
fi
gpio unexport "${gpio_boot0}" "${gpio_nrst}"