Skip to content

Commit f34c82a

Browse files
committed
aarch64/layout: Add MMIO range to memory layout
Signed-off-by: Akira Moroo <retrage01@gmail.com>
1 parent 5c436c1 commit f34c82a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/arch/aarch64/layout.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ pub fn virt_mem_layout() -> &'static KernelVirtualLayout<NUM_MEM_RANGES> {
7979
&LAYOUT
8080
}
8181

82+
pub fn mmio_range() -> Range<usize> {
83+
map::mmio::START..map::mmio::END
84+
}
85+
8286
pub fn reserved_range() -> Range<usize> {
8387
map::dram::START..map::dram::KERNEL_START
8488
}
@@ -95,9 +99,14 @@ pub fn stack_range() -> Range<usize> {
9599
unsafe { (stack_start.get() as _)..(stack_end.get() as _) }
96100
}
97101

98-
const NUM_MEM_DESCS: usize = 4;
102+
const NUM_MEM_DESCS: usize = 5;
99103

100104
pub static MEM_LAYOUT: MemoryLayout<NUM_MEM_DESCS> = [
105+
MemoryDescriptor {
106+
name: "MMIO",
107+
range: mmio_range,
108+
attribute: MemoryAttribute::Mmio,
109+
},
101110
MemoryDescriptor {
102111
name: "Reserved",
103112
range: reserved_range,

src/efi/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -995,15 +995,6 @@ fn populate_allocator(info: &dyn bootinfo::Info, image_address: u64, image_size:
995995
);
996996
}
997997

998-
// Add IO map for RTC PL031 on aarch64
999-
#[cfg(target_arch = "aarch64")]
1000-
ALLOCATOR.borrow_mut().add_initial_allocation(
1001-
efi::MEMORY_MAPPED_IO,
1002-
1,
1003-
crate::arch::aarch64::layout::map::mmio::PL031_START as u64,
1004-
r_efi::efi::MEMORY_RUNTIME,
1005-
);
1006-
1007998
// Add the loaded binary
1008999
ALLOCATOR.borrow_mut().allocate_pages(
10091000
efi::ALLOCATE_ADDRESS,

0 commit comments

Comments
 (0)