diff options
author | Keith Short <keithshort@chromium.org> | 2021-09-13 16:09:42 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-14 21:08:16 +0000 |
commit | b4b8a64287cdbff49dbcb6abd1983576123f0c55 (patch) | |
tree | 1d88ab6f1b8b796f8ec6077ae78ff9622e5b9b9d /zephyr/shim/src/i2c.c | |
parent | dfbeff4b5f6d8e078c7f69b1fe5050a4288a1d66 (diff) | |
download | chrome-ec-b4b8a64287cdbff49dbcb6abd1983576123f0c55.tar.gz |
zephyr: Add default mapping for remote I2C ports
For TCPC firmware updates, the host first queries the I2C port from the
EC and passes this back during I2C passthrough operations. Default to a
1:1 mapping of the remote port to local port, if the devicetree doesn't
explicitly set the remote-port property.
BUG=b:197153501
BRANCH=none
TEST=Boot zephyr with AUX firmware updates enabled in depthcharge,
verify the TCPC firmware is updated.
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: Ie45d302044e94c0325b36cc41c528fc0ca858384
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3158974
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
Diffstat (limited to 'zephyr/shim/src/i2c.c')
-rw-r--r-- | zephyr/shim/src/i2c.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/zephyr/shim/src/i2c.c b/zephyr/shim/src/i2c.c index 68dd212b1d..3dba7cde38 100644 --- a/zephyr/shim/src/i2c.c +++ b/zephyr/shim/src/i2c.c @@ -94,8 +94,12 @@ int i2c_get_port_from_remote_port(int remote_port) return port; } - /* Remote port is not defined, return -1 to signal the problem */ - return -1; + /* + * Remote port is not defined, return 1:1 mapping to support TCPC + * firmware updates, which always query the EC for the correct I2C + * port number. + */ + return remote_port; } int i2c_get_physical_port(int enum_port) |