diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2023-03-17 17:54:41 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2023-03-29 22:17:05 +0300 |
commit | ba064873ce5d193005e4fac66cdc436587a0dee2 (patch) | |
tree | 0d71e34f15205cec138c74e019f756fb40a9eadd /tools/perf/scripts/python/export-to-sqlite.py | |
parent | a069fcd9fa1822b81d9db1a67de6b4efd6b788e9 (diff) | |
download | linux-ba064873ce5d193005e4fac66cdc436587a0dee2.tar.xz |
i2c: cadence: Detect maximum transfer size
The maximum transfer length is a synthesis configuration parameters of the
Cadence I2C IP. Different SoCs might use different values for these
parameters.
Currently the driver has the maximum transfer length hardcoded to 255.
Trying to use the driver with an IP instance that uses smaller values for
these will work for short transfers. But longer transfers will fail.
The maximum transfer length can easily be detected at runtime since the
unused MSBs of the transfer length register are hardwired to 0. Writing
0xff and then reading back the value will give the maximum transfer length.
These changes have been tested with
1) The Xilinx MPSoC for which this driver was originally written which
has the previous hardcoded settings of 16 and 255.
2) Another instance of the Cadence I2C IP with FIFO depth of 8 and
maximum transfer length of 16.
Without these changes the latter would fail for I2C transfers longer than
16. With the updated driver both work fine even for longer transfers.
Note that the IP core and driver support chaining multiple transfers into a
single longer transfer using the HOLD bit. So the maximum transfer size is
not the limit for the length of the I2C transfer, but the limit for how
much data can be transferred without having to reprogram the control
registers.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions