#include #include "mmu-imx31.h" #include "cpu.h" static void enable_mmu(void); static void set_ttb(void); static void set_page_tables(void); static void map_section(unsigned int pa, unsigned int va, int mb, int cache_flags); #define SECTION_ADDRESS_MASK (-1 << 20) #define CACHE_ALL (1 << 3 | 1 << 2 ) #define CACHE_NONE 0 #define BUFFERED (1 << 2) #define MB (1 << 20) void memory_init(void) { set_ttb(); set_page_tables(); enable_mmu(); } unsigned int* ttb_base = (unsigned int *) TTB_BASE; const int ttb_size = 4096; void set_ttb() { int i; int* ttbPtr; int domain_access; /* must be 16Kb (0x4000) aligned */ ttb_base = (int*) TTB_BASE; for (i=0; i> 20; /* sections are 1Mb size */ ttbPtr = ttb_base + section_no; pa &= SECTION_ADDRESS_MASK; /* align to 1Mb */ for(i=0; i