forked from oxidecomputer/hubris
-
Notifications
You must be signed in to change notification settings - Fork 0
Spdm resp #1
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
Merged
Merged
Spdm resp #1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code of conduct
…upport. Key changes: * Add slave mode operations to I2cDevice API: - configure_slave_address() - Set up slave address configuration - enable_slave_receive() - Start listening for incoming messages - check_slave_buffer() - Poll for received messages - disable_slave_receive() - Stop slave mode - get_slave_messages() - Convenient structured message retrieval * Enhance drv_i2c_types with slave mode infrastructure: - New Op variants for slave operations (ConfigureSlaveAddress, etc.) - SlaveMessage struct for structured message handling - SlaveConfig for slave configuration management - Additional ResponseCode variants for slave-specific errors * Documentation improvements: - Module-level documentation with usage examples - Detailed function documentation with examples - Error handling patterns and task reset behavior explanation - MCTP slave configuration examples The slave mode implementation follows Hubris patterns with polling-based message retrieval, fixed buffer sizes, and proper IPC serialization support. This enables protocols like PLDM-over-MCTP-over-I2C where devices need to both send and receive management messages.
[feat] Add slave mode capabilities to Hubris I2C subsystem for MCTP
1. Build the firmware image:
```
$ cargo xtask dist app/ast1060-starter/app.toml
$ gen_uart_booting_image.sh target/ast1060-starter/dist/default/final.bin \
target/ast1060-starter/dist/default/uart_final.bin
```
2. Using uart_final.bin for boot from UART.
3. Using humility over jtag to verify
```
$ humility -e env.json -t ast1060 tasks
humility: attached via JLink
system time = 114057
ID TASK GEN PRI STATE
0 jefe 0 0 recv, notif: fault timer(T+43)
1 idle 0 5 RUNNING
$ humility -e env.json -t ast1060 stackmargin
humility: attached via JLink
ID TASK STACKBASE STACKSIZE MAXDEPTH MARGIN
0 jefe 0x21000 1536 272 1264
1 idle 0x20c00 256 104 152
```
Note: the humility has some bug in gdb connection.
TODO:
- Adding Secure Boot Header within final.bin
- JTAG halt at main configured by features
Signed-off-by: Troy Lee <[email protected]>
Signed-off-by: Troy Lee <[email protected]>
helloworld task will send "Hello, world!\n" to uart driver task over IPC. Signed-off-by: Troy Lee <[email protected]>
Signed-off-by: Troy Lee <[email protected]>
Signed-off-by: Troy Lee <[email protected]>
Signed-off-by: Troy Lee <[email protected]>
Signed-off-by: Troy Lee <[email protected]>
Signed-off-by: Troy Lee <[email protected]>
Signed-off-by: Troy Lee <[email protected]>
Signed-off-by: Troy Lee <[email protected]>
- Add I2cHardware trait for platform-agnostic I2C operations - Master mode operations: write_read, write_read_block, timing config - Slave mode operations for MCTP protocol support: * configure_slave_mode() - Set up I2C slave addressing * enable/disable_slave_receive() - Control slave mode operation * poll_slave_messages() - Retrieve received slave messages * get_slave_status() - Monitor slave mode health and statistics - Define SlaveStatus struct for slave mode monitoring - Support cross-platform implementations (STM32, LPC55, RISC-V, etc.) - Enable generic I2C server architecture with hardware backend selection - Maintain existing ResponseCode error taxonomy for consistency - Design supports MCTP-over-I2C peer-to-peer communication protocols This establishes the foundation for a portable, generic I2C server that can work across different microcontroller families while supporting both legacy master operations and slave mode requirements for management protocols like MCTP.
- Implement lightweight mock I2C driver with optimized memory usage for 2048-byte stack limit - Create minimal build configuration generating only notifications - Add basic tracing for I2C transactions and slave configuration attempts - Focus on IPC protocol compliance for testing without hardware complexity
Components added: * app/ast1060-i2c-scaffold/: Complete application configuration * task/i2c-client/: Comprehensive I2C test client with UART output * drv/openprot-i2c-server/: Mock I2C server with slave mode support * chips/ast1060/chip.toml: Complete I2C peripheral definitions * run-*-scaffold-app.sh: QEMU and GDB execution scripts
…rver [feat] Ast1060 App with Mock I2C Driver
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.