-
Notifications
You must be signed in to change notification settings - Fork 189
Support chips which don't support MIE/MIP CSRs #332
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
Support chips which don't support MIE/MIP CSRs #332
Conversation
rmsyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this only needed for the riscv-rt crate on the platforms you mention? For example, would we also want to remove the mie/mip modules in riscv::register?
Otherwise, LGTM.
|
I don't think we need to remove registers from riscv. As long as you don't use it, it should be OK. Otherwise, we would also need to add numerous features for supervisor mode or other anomalies |
romancardenas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much! For completeness, could you rename the feature to no-xie-xip and apply the same scheme for supervisor mode too?
riscv-rt/Cargo.toml
Outdated
| u-boot = ["riscv-rt-macros/u-boot", "single-hart"] | ||
| no-interrupts = [] | ||
| no-exceptions = [] | ||
| no-mie-mip = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| no-mie-mip = [] | |
| no-xie-xip = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - that makes sense 👍
romancardenas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I sugggested a small update in the changelog to align with the new feature name
riscv-rt/CHANGELOG.md
Outdated
| - New `#[riscv_rt::post_init]` attribute to aid in the definition of the `__post_init` function. | ||
| - Added `.uninit` section to the linker file. Due to its similarities with `.bss`, the | ||
| linker will place this new section in `REGION_BSS`. | ||
| - Additional feature `no-mie-mip` to work on chips without the MIE and MIP CSRs (e.g. ESP32-C2, ESP32-C3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Additional feature `no-mie-mip` to work on chips without the MIE and MIP CSRs (e.g. ESP32-C2, ESP32-C3) | |
| - Additional feature `no-xie-xip` to work on chips without the XIE and XIP CSRs (e.g. ESP32-C2, ESP32-C3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️ ofc ... sorry I missed that
romancardenas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you so much
We'd love to use
riscv-rtfor ESP32-Cx / Hx - unfortunately C2 and C3 don't support the MIE/MIP CSRs.This adds a feature "no-mie-mip" (which should fit the naming - e.g. "no-interrupts","no-exceptions")