diff options
author | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2022-05-04 09:21:27 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-26 21:30:33 +0000 |
commit | f6b8bb547708c089159e3fbfa27ab9a82816bcad (patch) | |
tree | 2e5632de7053661b5946f5fa5c860da44a9270a2 /include | |
parent | ae7b0b0bcd4fb42e3d77cbb8ab96b70136589ed0 (diff) | |
download | chrome-ec-f6b8bb547708c089159e3fbfa27ab9a82816bcad.tar.gz |
chip/npcx: Add function to poll DIRTY bit for virtual wire changes
The NCPX eSPI Module has a set of registers called VWEVSM. These
contain information about the various virtual wires connected via eSPI
to the host. One of these is a 'DIRTY' which will be set when the host
recognizes a change in the status of one of the virtual wires that the
particular VWEVSM register is responsible for.
This patch adds a function to poll the DIRTY bit for a given virtual
wire until it is no longer set, i.e. the VWIRE change has been
acknowledged by the host.
BUG=b:230366077
BRANCH=none
TEST=tested with next patch
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Change-Id: I87ae66c7af067bd14633edf04f6ee9dc5ffcde99
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3626782
Reviewed-by: caveh jalali <caveh@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Reviewed-by: Jeremy Compostella <jeremy.compostella@intel.corp-partner.google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/espi.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/espi.h b/include/espi.h index d1b8af3425..a717e7e414 100644 --- a/include/espi.h +++ b/include/espi.h @@ -93,5 +93,12 @@ const char *espi_vw_get_wire_name(enum espi_vw_signal signal); */ int espi_signal_is_vw(int signal); +/** + * Wait for the specified VW's DIRTY bit to be cleared. + * @param signal VW to poll DIRTY bit for + * @param timeout max time in microseconds to poll. + */ +void espi_wait_vw_not_dirty(enum espi_vw_signal signal, + unsigned int timeout_us); #endif /* __CROS_EC_ESPI_H */ |