-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Initial rp235x support #3243
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
Initial rp235x support #3243
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b185e02
Initial rp235x support
CBJamo 6f03c40
cargo fmt
CBJamo 6a797de
Fixup pac dep sources
CBJamo e5d8d8b
Switch to single pac
CBJamo 101977f
Maybe fix ci/build?
CBJamo 67c2ee2
Maybe fix ci/build II
CBJamo 05cb1ba
Fix ci/rustfmt
CBJamo ffdc60d
Move #![cfg]s to lib.rs
CBJamo 168a9f9
Intrinsics aren't implemented for 235x yet.
CBJamo 9a863f0
Handle pad isolation everywhere and in the same way.
CBJamo 0d41566
Switch to embassy's rp-pac repo, also use a patch.
CBJamo 9dc4375
rp: update PAC, fix CI.
Dirbaio 778241f
Fix CI, rename private feature, address comments from dirbaio.
CBJamo 752fbc6
Fix docs, ci
CBJamo 13cb431
Enable rp235x doc tests, fixup feature doc
CBJamo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,4 @@ SECTIONS { | |
| { | ||
| KEEP(*(.boot2)); | ||
| } > BOOT2 | ||
| } | ||
| } | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| //! Constants for binary info | ||
|
|
||
| /// All Raspberry Pi specified IDs have this tag. | ||
| /// | ||
| /// You can create your own for custom fields. | ||
| pub const TAG_RASPBERRY_PI: u16 = super::make_tag(b"RP"); | ||
|
|
||
| /// Used to note the program name - use with StringEntry | ||
| pub const ID_RP_PROGRAM_NAME: u32 = 0x02031c86; | ||
| /// Used to note the program version - use with StringEntry | ||
| pub const ID_RP_PROGRAM_VERSION_STRING: u32 = 0x11a9bc3a; | ||
| /// Used to note the program build date - use with StringEntry | ||
| pub const ID_RP_PROGRAM_BUILD_DATE_STRING: u32 = 0x9da22254; | ||
| /// Used to note the size of the binary - use with IntegerEntry | ||
| pub const ID_RP_BINARY_END: u32 = 0x68f465de; | ||
| /// Used to note a URL for the program - use with StringEntry | ||
| pub const ID_RP_PROGRAM_URL: u32 = 0x1856239a; | ||
| /// Used to note a description of the program - use with StringEntry | ||
| pub const ID_RP_PROGRAM_DESCRIPTION: u32 = 0xb6a07c19; | ||
| /// Used to note some feature of the program - use with StringEntry | ||
| pub const ID_RP_PROGRAM_FEATURE: u32 = 0xa1f4b453; | ||
| /// Used to note some whether this was a Debug or Release build - use with StringEntry | ||
| pub const ID_RP_PROGRAM_BUILD_ATTRIBUTE: u32 = 0x4275f0d3; | ||
| /// Used to note the Pico SDK version used - use with StringEntry | ||
| pub const ID_RP_SDK_VERSION: u32 = 0x5360b3ab; | ||
| /// Used to note which board this program targets - use with StringEntry | ||
| pub const ID_RP_PICO_BOARD: u32 = 0xb63cffbb; | ||
| /// Used to note which `boot2` image this program uses - use with StringEntry | ||
| pub const ID_RP_BOOT2_NAME: u32 = 0x7f8882e1; | ||
|
|
||
| // End of file |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,168 @@ | ||
| //! Handy macros for making Binary Info entries | ||
|
|
||
| /// Generate a static item containing the given environment variable, | ||
| /// and return its [`EntryAddr`](super::EntryAddr). | ||
| #[macro_export] | ||
| macro_rules! binary_info_env { | ||
| ($tag:expr, $id:expr, $env_var_name:expr) => { | ||
| $crate::binary_info_str!($tag, $id, { | ||
| let value = concat!(env!($env_var_name), "\0"); | ||
| // # Safety | ||
| // | ||
| // We used `concat!` to null-terminate on the line above. | ||
| let value_cstr = unsafe { core::ffi::CStr::from_bytes_with_nul_unchecked(value.as_bytes()) }; | ||
| value_cstr | ||
| }) | ||
| }; | ||
| } | ||
|
|
||
| /// Generate a static item containing the given string, and return its | ||
| /// [`EntryAddr`](super::EntryAddr). | ||
| /// | ||
| /// You must pass a numeric tag, a numeric ID, and `&CStr` (which is always | ||
| /// null-terminated). | ||
| #[macro_export] | ||
| macro_rules! binary_info_str { | ||
| ($tag:expr, $id:expr, $str:expr) => {{ | ||
| static ENTRY: $crate::binary_info::StringEntry = $crate::binary_info::StringEntry::new($tag, $id, $str); | ||
| ENTRY.addr() | ||
| }}; | ||
| } | ||
|
|
||
| /// Generate a static item containing the given string, and return its | ||
| /// [`EntryAddr`](super::EntryAddr). | ||
| /// | ||
| /// You must pass a numeric tag, a numeric ID, and `&CStr` (which is always | ||
| /// null-terminated). | ||
| #[macro_export] | ||
| macro_rules! binary_info_int { | ||
| ($tag:expr, $id:expr, $int:expr) => {{ | ||
| static ENTRY: $crate::binary_info::IntegerEntry = $crate::binary_info::IntegerEntry::new($tag, $id, $int); | ||
| ENTRY.addr() | ||
| }}; | ||
| } | ||
|
|
||
| /// Generate a static item containing the program name, and return its | ||
| /// [`EntryAddr`](super::EntryAddr). | ||
| #[macro_export] | ||
| macro_rules! binary_info_rp_program_name { | ||
| ($name:expr) => { | ||
| $crate::binary_info_str!( | ||
| $crate::binary_info::consts::TAG_RASPBERRY_PI, | ||
| $crate::binary_info::consts::ID_RP_PROGRAM_NAME, | ||
| $name | ||
| ) | ||
| }; | ||
| } | ||
|
|
||
| /// Generate a static item containing the `CARGO_BIN_NAME` as the program name, | ||
| /// and return its [`EntryAddr`](super::EntryAddr). | ||
| #[macro_export] | ||
| macro_rules! binary_info_rp_cargo_bin_name { | ||
| () => { | ||
| $crate::binary_info_env!( | ||
| $crate::binary_info::consts::TAG_RASPBERRY_PI, | ||
| $crate::binary_info::consts::ID_RP_PROGRAM_NAME, | ||
| "CARGO_BIN_NAME" | ||
| ) | ||
| }; | ||
| } | ||
|
|
||
| /// Generate a static item containing the program version, and return its | ||
| /// [`EntryAddr`](super::EntryAddr). | ||
| #[macro_export] | ||
| macro_rules! binary_info_rp_program_version { | ||
| ($version:expr) => {{ | ||
| $crate::binary_info_str!( | ||
| $crate::binary_info::consts::TAG_RASPBERRY_PI, | ||
| $crate::binary_info::consts::ID_RP_PROGRAM_VERSION, | ||
| $version | ||
| ) | ||
| }}; | ||
| } | ||
|
|
||
| /// Generate a static item containing the `CARGO_PKG_VERSION` as the program | ||
| /// version, and return its [`EntryAddr`](super::EntryAddr). | ||
| #[macro_export] | ||
| macro_rules! binary_info_rp_cargo_version { | ||
| () => { | ||
| $crate::binary_info_env!( | ||
| $crate::binary_info::consts::TAG_RASPBERRY_PI, | ||
| $crate::binary_info::consts::ID_RP_PROGRAM_VERSION_STRING, | ||
| "CARGO_PKG_VERSION" | ||
| ) | ||
| }; | ||
| } | ||
|
|
||
| /// Generate a static item containing the program URL, and return its | ||
| /// [`EntryAddr`](super::EntryAddr). | ||
| #[macro_export] | ||
| macro_rules! binary_info_rp_program_url { | ||
| ($url:expr) => { | ||
| $crate::binary_info_str!( | ||
| $crate::binary_info::consts::TAG_RASPBERRY_PI, | ||
| $crate::binary_info::consts::ID_RP_PROGRAM_URL, | ||
| $url | ||
| ) | ||
| }; | ||
| } | ||
|
|
||
| /// Generate a static item containing the `CARGO_PKG_HOMEPAGE` as the program URL, | ||
| /// and return its [`EntryAddr`](super::EntryAddr). | ||
| #[macro_export] | ||
| macro_rules! binary_info_rp_cargo_homepage_url { | ||
| () => { | ||
| $crate::binary_info_env!( | ||
| $crate::binary_info::consts::TAG_RASPBERRY_PI, | ||
| $crate::binary_info::consts::ID_RP_PROGRAM_URL, | ||
| "CARGO_PKG_HOMEPAGE" | ||
| ) | ||
| }; | ||
| } | ||
|
|
||
| /// Generate a static item containing the program description, and return its | ||
| /// [`EntryAddr`](super::EntryAddr). | ||
| #[macro_export] | ||
| macro_rules! binary_info_rp_program_description { | ||
| ($description:expr) => { | ||
| $crate::binary_info_str!( | ||
| $crate::binary_info::consts::TAG_RASPBERRY_PI, | ||
| $crate::binary_info::consts::ID_RP_PROGRAM_DESCRIPTION, | ||
| $description | ||
| ) | ||
| }; | ||
| } | ||
|
|
||
| /// Generate a static item containing whether this is a debug or a release | ||
| /// build, and return its [`EntryAddr`](super::EntryAddr). | ||
| #[macro_export] | ||
| macro_rules! binary_info_rp_program_build_attribute { | ||
| () => { | ||
| $crate::binary_info_str!( | ||
| $crate::binary_info::consts::TAG_RASPBERRY_PI, | ||
| $crate::binary_info::consts::ID_RP_PROGRAM_BUILD_ATTRIBUTE, | ||
| { | ||
| if cfg!(debug_assertions) { | ||
| c"debug" | ||
| } else { | ||
| c"release" | ||
| } | ||
| } | ||
| ) | ||
| }; | ||
| } | ||
|
|
||
| /// Generate a static item containing the specific board this program runs on, | ||
| /// and return its [`EntryAddr`](super::EntryAddr). | ||
| #[macro_export] | ||
| macro_rules! binary_info_rp_pico_board { | ||
| ($board:expr) => { | ||
| $crate::binary_info_str!( | ||
| $crate::binary_info::consts::TAG_RASPBERRY_PI, | ||
| $crate::binary_info::consts::ID_RP_PICO_BOARD, | ||
| $board | ||
| ) | ||
| }; | ||
| } | ||
|
|
||
| // End of file |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.