Skip to content

Draft: Add more registers, and MPU support #6

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 17 commits into from
Feb 24, 2025

Conversation

thejpster
Copy link
Contributor

Updates #4 to add a bunch more registers.

I didn't do this with a macro to allow us to special-case each register in future, as demand requires.

jonathanpallant and others added 7 commits January 31, 2025 20:03
This is based off my copy at https://github.com/ferrous-systems/cortex-r/,
which you can visit for the pre-history. My only changes in moving to
this repository were removing the Ferrocene build (because you don't
have a key for it), and adding some QEMU based tests.
tee runs before rustc, so it might not be there
Comes with big scary warning sign though.
The values are taken from the Cortex-R52 Reference Manual. We
only have basic reads/writes for the new ones - I haven't drilled
down into the bitfields.
@thejpster thejpster requested a review from a team February 18, 2025 21:04
@thejpster
Copy link
Contributor Author

I added a PMSAv8-32 EL1 MPU driver. In doing so I realised a bunch of registers were Armv8-R only, so I moved them.

@thejpster
Copy link
Contributor Author

Hmm, my unit tests aren't running because they are in a module that is hidden unless you are targeting an Armv8-R processor.

@thejpster thejpster changed the title Draft: Add more registers Draft: Add more registers, and PMSAv8-32 MPU support Feb 20, 2025
@thejpster
Copy link
Contributor Author

Added support for Armv7-R MPUs. Similar, but different, to Armv8-R MPUs.

@thejpster thejpster changed the title Draft: Add more registers, and PMSAv8-32 MPU support Draft: Add more registers, and MPU support Feb 21, 2025
@thejpster
Copy link
Contributor Author

The PMSAv8 support was tested on real hardware and works great.

@thejpster
Copy link
Contributor Author

I added a Generic Timer driver, and tested in on QEMU's Cortex-R52 machine. I'm not aware of a Armv7-R processor that has the Generic Timer, but there are some Armv7-A processors that do.

@thejpster thejpster force-pushed the add-more-msrs branch 2 times, most recently from 62c136b to 3f43f19 Compare February 23, 2025 23:38
@thejpster
Copy link
Contributor Author

I had to change the generic_timer example so it would build for Armv7-R, because building the workspace builds everything, including all the examples. I'm not sure there's a way to have target-specific examples, sadly.

It just stubs out all the timer code.
The unit test code needs to see all the modules.
@jonathanpallant jonathanpallant merged commit cfeff79 into rust-embedded:master Feb 24, 2025
44 checks passed
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.

2 participants