Skip to content

Commit

Permalink
feat: allow S-Mode access all address after 0x40000000
Browse files Browse the repository at this point in the history
Because Linux want to access peripheral register, so change the pmp
config to make address 0x40000000-0xFFFFFFFF accessible to Linux.

Signed-off-by: tfx2001 <tfx2001@outlook.com>
  • Loading branch information
tfx2001 committed Jul 24, 2024
1 parent d0c24aa commit 76f380b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn set_pmp() {
pmpcfg0::set_pmp(0, Range::OFF, Permission::NONE, false);
pmpaddr0::write((0x4000_0000) >> 2);
pmpcfg0::set_pmp(1, Range::TOR, Permission::RWX, false);
pmpaddr1::write((0x4200_0000) >> 2);
pmpaddr1::write(usize::MAX >> 2);
}
}

Expand Down

0 comments on commit 76f380b

Please sign in to comment.