summaryrefslogtreecommitdiff
path: root/util/flash_fp_mcu
diff options
context:
space:
mode:
authorStephen Boyd <swboyd@chromium.org>2021-08-31 23:02:29 -0700
committerCommit Bot <commit-bot@chromium.org>2021-09-01 20:58:49 +0000
commit4e6e68a2f29fae523d2f2e9e92afe3174c1c54c9 (patch)
tree1f17f278fcd66ca028bf47916f61fdcf7d79d78b /util/flash_fp_mcu
parentc9b52beb497821dda34784e2252eacb559aed524 (diff)
downloadchrome-ec-4e6e68a2f29fae523d2f2e9e92afe3174c1c54c9.tar.gz
flash_fp_mcu: Add support for Herobrine
Add the logic to find the gpios on herobrine. BUG=None BRANCH=None TEST=flash_fp_mcu on Herobrine Signed-off-by: Stephen Boyd <swboyd@chromium.org> Change-Id: I8ed4f0df41d36f279a6e1d3a4dab74063d489f0f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3135042 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org>
Diffstat (limited to 'util/flash_fp_mcu')
-rw-r--r--util/flash_fp_mcu24
1 files changed, 20 insertions, 4 deletions
diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu
index 94551c5741..679478f1e2 100644
--- a/util/flash_fp_mcu
+++ b/util/flash_fp_mcu
@@ -406,10 +406,12 @@ flash_fp_mcu_stm32() {
gpio 0 "${gpio_boot0}" "${gpio_nrst}"
gpio 1 "${gpio_nrst}"
- # Give up GPIO control
- # TODO(b/179839337): Remove this for Strongbad DVT, where we should have
- # correct external pulls on these lines.
- if [[ "${PLATFORM_NAME}" != "strongbad" ]]; then
+ # Give up GPIO control, unless we need to keep these driving as
+ # outputs because they're not open-drain signals.
+ # TODO(b/179839337): Make this the default and properly support
+ # open-drain outputs on other platforms.
+ if [[ "${PLATFORM_NAME}" != "strongbad" ]] &&
+ [[ "${PLATFORM_NAME}" != "herobrine" ]]; then
gpio in "${gpio_boot0}" "${gpio_nrst}"
fi
gpio unexport "${gpio_boot0}" "${gpio_nrst}"
@@ -472,6 +474,20 @@ config_hatch() {
readonly GPIO_PWREN=467
}
+config_herobrine() {
+ readonly TRANSPORT="SPI"
+ readonly DEVICE="/dev/spidev11.0"
+ # TODO(b/179533783): Fix this script to look for non-ACPI modalias
+ readonly DEVICEID="spi11.0"
+
+ readonly GPIO_CHIP="gpiochip336"
+ # FPMCU RST_ODL is $(gpiofind FP_RST_L) is gpiochip0 78
+ readonly GPIO_NRST=$((336 + $(gpiofind FP_RST_L|cut -f2 -d" ")))
+ # FPMCU BOOT0 is $(gpiofind FPMCU_BOOT0) is gpiochip0 77
+ readonly GPIO_BOOT0=$((336 + $(gpiofind FPMCU_BOOT0|cut -f2 -d" ")))
+ # EN FP RAILS is $(gpiofind EN_FP_RAILS) is gpiochip0 42
+ readonly GPIO_PWREN=$((336 + $(gpiofind EN_FP_RAILS|cut -f2 -d" ")))
+}
config_nami() {
readonly TRANSPORT="SPI"