Skip to content

Conversation

rusty1968
Copy link
Contributor

@rusty1968 rusty1968 commented Sep 26, 2025

I2C Initialization Improvement
The original init() function had architectural limitations that prevented integration with system control task architectures:

  1. Mixed Concerns: Global I2C system setup + peripheral controller setup combined in one function.
  2. Silent Failures: No error propagation from reset/clock operations.
  3. **Direct SCU register access for reset ** makes it hard to integrate in an environment where we have a dedicated system control driver like Hubris.

I need help debugging and testing - this code is meant to serve more as a sample since I am not an expert in the ASPEED hardware.

…ait.

- Introduce init_with_system_control function.
- Make init function fallible.
1 - Introduce `init_peripheral_only()` that handles only:
- I2C controller register setup (`i2c.i2cc00()`)
- Interrupt configuration (`i2c.i2cm10()`, `i2c.i2cm14()`)
- Slave mode setup (if enabled)
- Timing configuration (peripheral-level only)
2.  Introduce init_i2c_global_system<S: ResetControl>(system_control: &mut S)
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.

1 participant