Use zerocopy in place of references for the definition of PartitionEntry#4839
Open
B83C wants to merge 8 commits into
Open
Use zerocopy in place of references for the definition of PartitionEntry#4839B83C wants to merge 8 commits into
B83C wants to merge 8 commits into
Conversation
bugadani
reviewed
Jan 26, 2026
Comment on lines
+106
to
+129
| if #[cfg(feature = "esp32")] { | ||
| let paddr = unsafe { | ||
| ((0x3FF10000 as *const u32).read_volatile() & 0xff) << 16 | ||
| }; | ||
| } else if #[cfg(feature = "esp32s2")] { | ||
| let paddr = unsafe { | ||
| (((0x61801000 + 128 * 4) as *const u32).read_volatile() & 0xff) << 16 | ||
| }; | ||
| } else if #[cfg(feature = "esp32s3")] { | ||
| // Revisit this once we support XiP from PSRAM for ESP32-S3 | ||
| let paddr = unsafe { | ||
| ((0x600C5000 as *const u32).read_volatile() & 0xff) << 16 | ||
| }; | ||
| } else if #[cfg(any(feature = "esp32c2", feature = "esp32c3"))] { | ||
| let paddr = unsafe { | ||
| ((0x600c5000 as *const u32).read_volatile() & 0xff) << 16 | ||
| }; | ||
| } else if #[cfg(any(feature = "esp32c6", feature = "esp32h2"))] { | ||
| let paddr = unsafe { | ||
| ((0x60002000 + 0x380) as *mut u32).write_volatile(0); | ||
| (((0x60002000 + 0x37c) as *const u32).read_volatile() & 0xff) << 16 | ||
| }; | ||
| } else { | ||
| compile_error!("Paddr not defined for the current esp32 device, check if you have enabled it, or raise an issue about it"); |
Contributor
There was a problem hiding this comment.
Can we use the PACs here?
Contributor
There was a problem hiding this comment.
I think with the exception of H2/C6 we don't have the necessary registers in the SVDs, yet. (Ofc we should add them)
But I think this code is duplicated - so we should at least de-dup it
|
New commits in main have made this PR unmergeable. Please resolve the conflicts. |
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
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.
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packagescommand to ensure that all changed code is formatted correctly.CHANGELOG.mdin the proper section.Extra:
Pull Request Details 📖
Use zerocopy in place of references to define PartitionEntry.
Details are provided in issue
Testing
command ran: