Files
OpenCellular/chip
Alexandru M Stan 68704fea5f stm32/spi: Reset peripheral after every packet
RX DMA seems to get misaligned sometimes yielding to extra bytes before the
first byte on the wire.
in_msg=[00 00 00 03 f4 09 00 00 ...]
                ^ real first byte

To fix this we want to reset and reinit the SPI peripheral after every packet,
in the same place where setup_for_transaction() is called.

This bug applies to the STM32F0 line but resetting the peripheral on other STM32
ECs should not break anything.

BUG=chrome-os-partner:31390
TEST=On STM32F0:
ap# cd /sys/class/power_supply/sbs-20-000b/; while true; do grep "" * >/dev/null 2>&1; done
You should not see "SPI rx bad data" with in_msg packets that have extra bytes
in the beggining. Wait though, it might take up to a few minutes for stuff to
break.
BRANCH=None

Change-Id: If9ab93c5c9040a2c7bda33d7cc990603f1121f3f
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/217527
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-09-25 01:56:24 +00:00
..
2014-07-29 02:21:22 +00:00