You are welcome to try something like this (see below). I wanted to do the same thing enable the data cache and make a one to one. Some tools and docs and code can over complicate the issue. You need the trm from arm for the specific mmu in your core and/or the datasheet for the core wherever the mmu is documented.
I am using an arm11 mpcore which is likely similar to what you have, the mmu is similar enough to the arm9 as well. the mpcore had some new big block table entry that was 16 times bigger than the next one but it was a total waste because you had to put 16 copies of the same entry in the mmu table.
You need a chunk of ram to hold the mmu table, you need to put an entry in the table for the physical address for that chunk of ram that is the first entry it may look up, look in the mmu table to find out about the mmu table kind of a thing. Likewise the interrupt vector table area (address zero) should be in there. use the coarsest entries you can.
Remember that control register space should not be cached, you should probably not enable the data cache until your mmu table is working, then start caching areas until your code crashes, then uncache that last thing.
Since you are aiming for a one to one mapping and not looking to use the mmu like an operating system would you can do what I did and build your mmu table ahead of time. An operating system would need routines for doing it in real time. The code below is building the table in assembler which is then linked in to the program. your solution may vary.
#include
#include
#include
#define MMUTABLEBASE 0x00000000
#define MMUALLOC (0x8000>>2)
unsigned int mmu_table[MMUALLOC];
unsigned int mmu_table_owner[MMUALLOC];
#define TOP_LEVEL_WORDS (1>20;
if(mmu_table[ra])
{
printf("Address %08X already allocated\n",add);
return(1);
}
add=ra=MMUALLOC)
{
printf("Not enough room\n");
return(1);
}
nextfree=rc;
mmu_table[ra]=(MMUTABLEBASE+(rb