ARMV7: add a function to disable MMU entries
It is useful to be able to lock out certain address ranges, NULL being the most important example. void mmu_disable_range(unsigned long start_mb, unsigned long size_mb) will allow us to lock out selected virtual addresses on MiB boundaries. As in other ARM mmu functions, the addresses and quantities are in units of MiB. Change-Id: If516ce955ee2d12c5a409f25acbb5a4b424f699b Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: http://review.coreboot.org/3160 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks <dhendrix@chromium.org>
This commit is contained in:
parent
043b823a73
commit
c0466d46b7
|
@ -303,6 +303,8 @@ enum dcache_policy {
|
|||
DCACHE_WRITETHROUGH,
|
||||
};
|
||||
|
||||
/* disable the mmu for a range. Primarily useful to lock out address 0. */
|
||||
void mmu_disable_range(unsigned long start_mb, unsigned long size_mb);
|
||||
/* mmu range configuration (set dcache policy) */
|
||||
void mmu_config_range(unsigned long start_mb, unsigned long size_mb,
|
||||
enum dcache_policy policy);
|
||||
|
|
|
@ -39,6 +39,19 @@
|
|||
|
||||
static uintptr_t ttb_addr;
|
||||
|
||||
void mmu_disable_range(unsigned long start_mb, unsigned long size_mb)
|
||||
{
|
||||
unsigned int i;
|
||||
uint32_t *ttb_entry = (uint32_t *)ttb_addr;
|
||||
printk(BIOS_DEBUG, "Disabling: 0x%08lx:0x%08lx\n",
|
||||
start_mb << 20, ((start_mb + size_mb) << 20) - 1);
|
||||
|
||||
for (i = start_mb; i < start_mb + size_mb; i++) {
|
||||
ttb_entry[i] = 0;
|
||||
tlbimvaa(i);
|
||||
}
|
||||
}
|
||||
|
||||
void mmu_config_range(unsigned long start_mb, unsigned long size_mb,
|
||||
enum dcache_policy policy)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue