blob: d39a03ed95d6017377b36f994db06365de3c4095 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#include <common.h>
#include <asm/mmu.h>
#include <errno.h>
#include <linux/sizes.h>
#include <asm/memory.h>
#include <asm/system.h>
#include <asm/cache.h>
#include "mmu.h"
static uint32_t *ttb;
static void map_cachable(unsigned long start, unsigned long size)
{
start = ALIGN_DOWN(start, SZ_1M);
size = ALIGN(size, SZ_1M);
create_sections(ttb, start, start + size - 1, PMD_SECT_DEF_CACHED);
}
void mmu_early_enable(unsigned long membase, unsigned long memsize,
unsigned long _ttb)
{
ttb = (uint32_t *)_ttb;
arm_set_cache_functions();
set_ttbr(ttb);
set_domain(DOMAIN_MANAGER);
create_flat_mapping(ttb);
map_cachable(membase, memsize);
__mmu_cache_on();
}
|