diff options
author | Jes Klinke <jbk@google.com> | 2022-02-22 16:00:09 -0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2022-03-15 22:06:27 +0000 |
commit | 19baa9d51e4f1b36473dc750735eb6e5345bebda (patch) | |
tree | 60aada7f006fd73797b5c566d704e2b0ed5b728f /src/device/Kconfig | |
parent | ca82e6161af7a453b512f35dd695a98084a1d7cf (diff) |
i2c: Add configurable I2C transfer timeout
This patch introduces CONFIG_I2C_TRANSFER_TIMEOUT_US,
which controls how long to wait for an I2C devices to
produce/accept all the data bytes in a single transfer.
(The device can delay transfer by stretching the clock of
the ack bit.)
The default value of this new setting is 500ms. Existing
code had timeouts anywhere from tens of milliseconds to a
full second beween various drivers. Drivers can still have
their own shorter timeouts for setup/communication with the
I2C host controller (as opposed to transactions with I2C
devices on the bus.)
In general, the timeout is not meant to be reached except in
situations where there is already serious problem with the
boot, and serves to make sure that some useful diagnostic
output is produced on the console.
Change-Id: I6423122f32aad1dbcee0bfe240cdaa8cb512791f
Signed-off-by: Jes B. Klinke <jbk@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62278
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/device/Kconfig')
-rw-r--r-- | src/device/Kconfig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/device/Kconfig b/src/device/Kconfig index 7f20d709ad..388972ccf4 100644 --- a/src/device/Kconfig +++ b/src/device/Kconfig @@ -906,6 +906,14 @@ config SOFTWARE_I2C I2C controller is not (yet) available. The platform code needs to provide bindings to manually toggle I2C lines. +config I2C_TRANSFER_TIMEOUT_US + int "I2C transfer timeout in microseconds" + default 500000 + help + Timeout for a read/write transfers on the I2C bus, that is, the + maximum time a device could stretch clock bits before the transfer + is aborted and an error returned. + config RESOURCE_ALLOCATOR_V3 bool default n |