summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorJes B. Klinke <jbk@chromium.org>2023-05-10 11:34:59 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-05-10 20:35:29 +0000
commit0071d66e4de1f2a66cf02adb5f6537dd973da0dd (patch)
treea9102e0f27da7e49f3d2e72816d190ee4e9215e9 /board
parent29a412aefc792da36cdb019fd198500b7e7f7675 (diff)
downloadchrome-ec-0071d66e4de1f2a66cf02adb5f6537dd973da0dd.tar.gz
board/hyperdebug: Gpio monitoring verifies that list is same
The HyperDebug board can watch for edges on a set of pins, like a logic analyzer. It will buffer such events, for later retrieval by OpenTitanTool. The current logic depends on the list of signals at the time of retrieval is exactly identical to the list given at start of monitoring. This was almost verified, in that there were checks for pins being left our, or new pins being added to the list, but no check for the order of the given names. This CL adds a check that the order is the same. BUG=b:281857275 TEST=tast run - gscdevboard.Ti50EcReset TEST=Manual invocations of opentitantool to trigger error Change-Id: Ifcd9b96a319aff94b073ca758224045a5b1d67d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4518234 Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/hyperdebug/gpio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/board/hyperdebug/gpio.c b/board/hyperdebug/gpio.c
index a12b424032..dbffa7fefb 100644
--- a/board/hyperdebug/gpio.c
+++ b/board/hyperdebug/gpio.c
@@ -738,6 +738,11 @@ static int command_gpio_monitoring_read(int argc, const char **argv)
gpio_list[gpios[i]].name);
return EC_ERROR_PARAM3 + i;
}
+ if (slot->signal_no != i) {
+ ccprintf("Error: Inconsistent order at %s\n",
+ gpio_list[gpios[i]].name);
+ return EC_ERROR_PARAM3 + i;
+ }
if (buf == NULL) {
buf = slot->buffer;
} else if (buf != slot->buffer) {