-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
89 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
mod panic; | ||
mod uart_console; | ||
mod interrupts; | ||
mod pl061; | ||
|
||
global_asm!(include_str!("start.s")); | ||
|
||
|
This file contains 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,33 @@ | ||
use tock_registers::{registers::{ReadWrite, WriteOnly}, register_bitfields, register_structs}; | ||
|
||
pub const PL061REGS: *mut PL061Regs = (0x0903_0000) as *mut PL061Regs; | ||
|
||
// https://developer.arm.com/documentation/ddi0190/b/programmer-s-model/summary-of-primecell-gpio-registers | ||
|
||
register_bitfields![ | ||
u32, | ||
|
||
// PrimeCell GPIO interrupt mask | ||
pub GPIOIE [ | ||
IO3 OFFSET(3) NUMBITS(1) [ | ||
Disabled = 0, | ||
Enabled = 1 | ||
] | ||
], | ||
|
||
// PrimeCell GPIO raw interrupt status, when system_powerdown, this reg: 0x00 -> 0x08 | ||
// pub GPIORIS [], | ||
|
||
// PrimeCell GPIO interrupt clear | ||
// pub GPIOIC [] | ||
]; | ||
|
||
register_structs! { | ||
pub PL061Regs { | ||
(0x000 => __reserved_0), | ||
(0x410 => pub ie: ReadWrite<u32, GPIOIE::Register>), | ||
(0x414 => __reserved_1), | ||
(0x41c => pub ic: WriteOnly<u32>), | ||
(0x420 => @END), | ||
} | ||
} |