diff --git a/src/arch/aarch64/layout.rs b/src/arch/aarch64/layout.rs index f4a1f388..84c13cdb 100644 --- a/src/arch/aarch64/layout.rs +++ b/src/arch/aarch64/layout.rs @@ -79,6 +79,10 @@ pub fn virt_mem_layout() -> &'static KernelVirtualLayout { &LAYOUT } +pub fn mmio_range() -> Range { + map::mmio::START..map::mmio::END +} + pub fn reserved_range() -> Range { map::dram::START..map::dram::KERNEL_START } @@ -95,9 +99,14 @@ pub fn stack_range() -> Range { unsafe { (stack_start.get() as _)..(stack_end.get() as _) } } -const NUM_MEM_DESCS: usize = 4; +const NUM_MEM_DESCS: usize = 5; pub static MEM_LAYOUT: MemoryLayout = [ + MemoryDescriptor { + name: "MMIO", + range: mmio_range, + attribute: MemoryAttribute::Mmio, + }, MemoryDescriptor { name: "Reserved", range: reserved_range, diff --git a/src/efi/mod.rs b/src/efi/mod.rs index 83e280df..c4cf434a 100644 --- a/src/efi/mod.rs +++ b/src/efi/mod.rs @@ -995,15 +995,6 @@ fn populate_allocator(info: &dyn bootinfo::Info, image_address: u64, image_size: ); } - // Add IO map for RTC PL031 on aarch64 - #[cfg(target_arch = "aarch64")] - ALLOCATOR.borrow_mut().add_initial_allocation( - efi::MEMORY_MAPPED_IO, - 1, - crate::arch::aarch64::layout::map::mmio::PL031_START as u64, - r_efi::efi::MEMORY_RUNTIME, - ); - // Add the loaded binary ALLOCATOR.borrow_mut().allocate_pages( efi::ALLOCATE_ADDRESS,