Add FVP system peripheral driver
The system peripheral on the FVP manages several system-level features,
including:
* System and processor identification
* LED and switch control
* Handling of volatile and non-volatile flags
* 100Hz and 24MHz counters
* System operations such as shutdown and reboot
* Various other miscellaneous functions
Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I6f18ec55d9baf6b217d95ee01b96cd31ecfb0bbd
diff --git a/src/lib.rs b/src/lib.rs
index 6c9551d..b02f407 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,6 +7,8 @@
#![no_std]
+pub mod system;
+
// Re-export peripheral drivers and common safe-mmio types
pub use arm_gic;
pub use arm_pl011_uart;
@@ -20,6 +22,7 @@
use core::{fmt::Debug, ops::RangeInclusive};
use power_controller::FvpPowerControllerRegisters;
use spin::mutex::Mutex;
+use system::FvpSystemRegisters;
static PERIPHERALS_TAKEN: Mutex<bool> = Mutex::new(false);
@@ -105,6 +108,7 @@
/// FVP peripherals
#[derive(Debug)]
pub struct Peripherals {
+ pub system: PhysicalInstance<FvpSystemRegisters>,
pub uart0: PhysicalInstance<PL011Registers>,
pub uart1: PhysicalInstance<PL011Registers>,
pub uart2: PhysicalInstance<PL011Registers>,
@@ -134,6 +138,7 @@
*PERIPHERALS_TAKEN.lock() = true;
Peripherals {
+ system: PhysicalInstance::new(*MemoryMap::VE_SYSTEM.start()),
uart0: PhysicalInstance::new(*MemoryMap::UART0.start()),
uart1: PhysicalInstance::new(*MemoryMap::UART1.start()),
uart2: PhysicalInstance::new(*MemoryMap::UART2.start()),