Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: add usb-i2c mctp app #525

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

twilfredo
Copy link
Contributor

@twilfredo twilfredo commented Dec 20, 2023

Overview

Add a sample libtock-rs app that allows a host machine without exposed I2C/SMBus capabilities to communicate to an MCTP endpoint.

The following topology is used:

[Host PC] <-- UART --> [Usb-I2C Bridge Device] <-- I2C --> [Target Endpoint]

This app operates by first waiting for an MCTP request packet to be sent over UART from the host, which is then forwarded to the target endpoint (based on the target address) through the I2C bus. The endpoint must then master the I2C bus and write a response back to us, as we wait in target mode (Note: MCTP mandates writes only). This is then forwarded to the host machine via UART.

A sample use-case can be to communicate with an SPDM responder that uses MCTP/SMBus/I2C, directly from the host machine.

Host app requirements

The host app must attach a small packet header (metadata) that wraps the data message, the packet formatting is detailed in the rust-docs for the app. It must also parse the same packet upon reception of data.

@twilfredo
Copy link
Contributor Author

@alistair23

@twilfredo twilfredo force-pushed the wilfred/usb-i2c-bridge branch from 87153a0 to 902fa5c Compare December 20, 2023 06:43
examples/usb_i2c_spdm.rs Outdated Show resolved Hide resolved
examples/usb_i2c_spdm.rs Outdated Show resolved Hide resolved
examples/usb_i2c_spdm.rs Outdated Show resolved Hide resolved
@twilfredo twilfredo force-pushed the wilfred/usb-i2c-bridge branch from 902fa5c to 9410653 Compare January 9, 2024 03:01
examples/README.md Outdated Show resolved Hide resolved
@twilfredo twilfredo force-pushed the wilfred/usb-i2c-bridge branch 2 times, most recently from 974cd01 to 7d3d35a Compare January 9, 2024 03:58
examples/usb_i2c_mctp.rs Outdated Show resolved Hide resolved
@twilfredo twilfredo force-pushed the wilfred/usb-i2c-bridge branch 2 times, most recently from c64694c to 1d12a73 Compare January 9, 2024 04:48
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
@twilfredo twilfredo force-pushed the wilfred/usb-i2c-bridge branch from 1d12a73 to 1a99fbb Compare January 9, 2024 04:51
@jrvanwhy jrvanwhy added the upkeep Indicates a PR is upkeep as defined by the code review policy. label Jan 10, 2024
@twilfredo
Copy link
Contributor Author

ping! this is ready to merge

@jrvanwhy jrvanwhy added this pull request to the merge queue Jan 16, 2024
Merged via the queue into tock:master with commit 84cf8d2 Jan 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upkeep Indicates a PR is upkeep as defined by the code review policy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants