]> www.infradead.org Git - users/borneoa/openocd-next.git/commit
driver/linuxspidev: Clear queue on allocation
authorRichard Pasek <rpasek@google.com>
Thu, 30 Jan 2025 10:38:08 +0000 (05:38 -0500)
committerTomas Vanek <vanekt@fbl.cz>
Tue, 11 Feb 2025 11:57:58 +0000 (11:57 +0000)
commitd09f53a930676817a49ae7c575c705487ea51861
treec9c1c0bcc22f7c5837aff673a6d6dc98d10477cb
parent82277462b91506a9e7ee4bdcee86d6b414d59149
driver/linuxspidev: Clear queue on allocation

SWD idle clocks are added to the queue by advancing the queue index
assuming the queue is zeroed. If the queue isn't zeroed, these idle
clocks end up being filled with junk data. Lets clear the queue and
associated buffers on queue allocation.

TEST: Connects successfully and ran the following TCL command:
  dump_image /dev/null 0x20000000 0x42000
  Host: Unnamed Qualcomm SoC with QUPv3 based SPI port
  Target: RT500

Signed-off-by: Richard Pasek <rpasek@google.com>
Change-Id: Ie660c10c27c4d0937ab0629138935ddbf5aeb0ae
Fixes: 83e0293f7ba3 ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8730
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Jonathon Reinhart <jrreinhart@google.com>
Tested-by: jenkins
src/jtag/drivers/linuxspidev.c