From 60ee07de99c2d52961cdfcb4132c8330ff089820 Mon Sep 17 00:00:00 2001 From: Craig Hesling Date: Tue, 19 Nov 2019 11:08:51 -0800 Subject: flash_fp_mcu: Fix spidev flakiness This small 100ms sleep is necessary to stabilize the spidev driver. Without it, we have seen that stm32mon is unable to catch the stm32h743 bootloader on the first attempt. This issue became more noticeable with the STM32H743 Rev V. Among other things, the following log shows test results from before adding this sleep and the flash_fp_mcu stress test results after adding this sleep: https://drive.google.com/open?id=1opJn5fPXxUMjMZz0VDtmqpCXN0mVnBr5 BRANCH=nocturne,hatch BUG=b:143374692,b:144729003,b:135033816 TEST=# Ensure PS crrev.com/c/1921705 is applied. # Run http://go/bit/hesling/5791510394044416 TEST=See the testing done in the above Google Drive log. Change-Id: I1777c894e1dd8911df4d407e33dc677373146eb1 Signed-off-by: Craig Hesling Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925174 Reviewed-by: Daisuke Nojiri --- util/flash_fp_mcu | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util/flash_fp_mcu') diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu index db9004c3f8..8baebbd6a3 100644 --- a/util/flash_fp_mcu +++ b/util/flash_fp_mcu @@ -179,6 +179,9 @@ flash_fp_mcu_stm32() { # load spidev (fail on cros-ec-spi first to change modalias) echo "${spiid}" > /sys/bus/spi/drivers/cros-ec-spi/bind 2>/dev/null echo "${spiid}" > /sys/bus/spi/drivers/spidev/bind + # The following sleep is a workaround to mitigate the effects of a + # poorly behaved chip select line. See b/145023809. + sleep 0.5 # Release reset as the SPI bus is now ready echo 1 > "/sys/class/gpio/gpio${gpio_nrst}/value" -- cgit v1.2.1