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

I2C device tree descriptions in TOML #238

Merged
merged 35 commits into from
Nov 5, 2021
Merged

I2C device tree descriptions in TOML #238

merged 35 commits into from
Nov 5, 2021

Conversation

bcantrill
Copy link
Collaborator

@bcantrill bcantrill commented Oct 29, 2021

This work adds a description of I2C in TOML as part of an application
definition, allowing this description to be pulled out of hand-written
code, and into code that is automatically generated as part of the
build process. This allows for Humility to know the I2C device tree
based on the archive -- which in turn allows for much more robust
tooling for I2C and I2C-based protcols like PMBus. In addition to
adding support for I2C in TOML and definitions for every platform that
supports I2C, this work also:

  • Adds a preliminary Sidecar image
  • Adds QSPI support for the Nucleo board
  • Eliminates the notion of Port::Default
  • Adds a HIF sleep function and I2C bulk write function
  • Adds a HIF QSPI function to verify an image
  • Corrects the HIF QSPI error conditions

build-i2c/src/lib.rs Outdated Show resolved Hide resolved
build-i2c/src/lib.rs Outdated Show resolved Hide resolved
build-i2c/src/lib.rs Outdated Show resolved Hide resolved
build-i2c/src/lib.rs Outdated Show resolved Hide resolved
build-i2c/src/lib.rs Outdated Show resolved Hide resolved
drv/i2c-api/src/lib.rs Outdated Show resolved Hide resolved
sidecar/openocd.cfg Outdated Show resolved Hide resolved
sidecar/src/apiwrap.rs Outdated Show resolved Hide resolved
@bcantrill bcantrill changed the title I2c toml I2C device tree descriptions in TOML Nov 5, 2021
@bcantrill bcantrill marked this pull request as ready for review November 5, 2021 01:24
Copy link
Collaborator

@cbiffle cbiffle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good.

Be careful include!-ing generated files into a module with user definitions. Currently defining things in the config named, say, main will cause weird compile errors. Wrapping the include! in a module, e.g. mod i2c { ... }, would fix that.

@bcantrill
Copy link
Collaborator Author

This is looking good.

Be careful include!-ing generated files into a module with user definitions. Currently defining things in the config named, say, main will cause weird compile errors. Wrapping the include! in a module, e.g. mod i2c { ... }, would fix that.

Agreed; all of the generated code is wrapped with mod i2c_config to avoid this kind of pollution.

@bcantrill bcantrill merged commit 7a1f2d5 into master Nov 5, 2021
bcantrill added a commit to oxidecomputer/humility that referenced this pull request Nov 5, 2021
This is the Humility side of the Hubris I2C TOML work as described
in oxidecomputer/hubris#238.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants