summaryrefslogtreecommitdiff
path: root/chip/g/usb_spi.c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2020-04-22 18:35:44 -0700
committerVadim Bendebury <vbendeb@chromium.org>2020-05-14 18:38:39 +0000
commitca83aee50469799a9b70b03ef6bd3fc1e86d6c38 (patch)
tree0ad6a589a259294c0f3cd341b3b5a027810a5a97 /chip/g/usb_spi.c
parent69a887265d737c628a3c55a03b923917cf1b471e (diff)
downloadchrome-ec-stabilize-13099.90.B-cr50_stab.tar.gz
The code which allows to read a section of AP or EC flash and calculate the section's SHA256 sum does not allow calculating the sum over multiple non-adjacent flash areas. This patch changes the implementation to allow calculations over more than one region. Initialization, calculation and reporting of the result become three separate API entries. The loop counting the number of the read flash chunks, is being simplified, a watchdog kick added to the brief loop interruptions, as it turns out that sleeping alone is not enough to prevent watchdog expiration when calculating hash over large SPI flash ranges. Also simplified prototypes for usb_spi_board_enable() and usb_spi_board_disable(). BUG=b:153764696 TEST=created an RO descriptor for the Atlas DUT and verified that 'gsctool -O' succeeds. Cq-Depend: chrome-internal:2939596 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: Iec7b8634c7c80ebc7600c5b708879eb322bc7fec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2163569 Reviewed-by: Andrey Pronin <apronin@chromium.org>
Diffstat (limited to 'chip/g/usb_spi.c')
-rw-r--r--chip/g/usb_spi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/chip/g/usb_spi.c b/chip/g/usb_spi.c
index d7f7ff031f..e41d9eab67 100644
--- a/chip/g/usb_spi.c
+++ b/chip/g/usb_spi.c
@@ -74,9 +74,10 @@ void usb_spi_deferred(struct usb_spi_config const *config)
if (enabled ^ config->state->enabled) {
if (enabled)
- rv = usb_spi_board_enable(config);
+ rv = usb_spi_board_enable(config->state->enabled_host);
+
else
- usb_spi_board_disable(config);
+ usb_spi_board_disable();
/* Only update our state if we were successful. */
if (rv == EC_SUCCESS)