okay thats the MPU set up i use:
void setup_mpu(void)
{
asm(
/* 0: basic setup: 4 GiB of addressable memory */
"MOV R0, #0x0000003F\n"
"MCR p15, 0, R0, c6, c0, 0\n"
/* 1: flash: 16 MiB of addressable flash memory */
"MOV R0, #0xF8000000\n"
"ORR R0, #0x0000002F\n"
"MCR p15, 0, R0, c6, c1, 0\n"
/* 2: I/O: 512 MiB of memory mapped IO devices */
"MOV R0, #0xC0000000\n"
"ORR R0, #0x00000039\n"
"MCR p15, 0, R0, c6, c2, 0\n"
/* 3: uncached RAM: 1 GiB of addressable memory */
"MOV R0, #0x40000000\n"
"ORR R0, #0x0000003B\n"
"MCR p15, 0, R0, c6, c3, 0\n"
/* disable 4-7 */
"MOV R0, #0x00\n"
"MCR p15, 0, R0, c6, c4, 0\n"
"MCR p15, 0, R0, c6, c5, 0\n"
"MCR p15, 0, R0, c6, c6, 0\n"
"MCR p15, 0, R0, c6, c7, 0\n"
/* cacheable/bufferable bits: enable 0 and 1, disable others */
"MOV R0, #0x03\n"
"MCR p15, 0, R0, c2, c0, 0\n"
"MCR p15, 0, R0, c2, c0, 1\n"
"MCR p15, 0, R0, c3, c0, 0\n"
/* access permissions: allow all */
"MOV R0, #0x33\n"
"ORR R0, R0, LSL#0x08\n"
"ORR R0, R0, LSL#0x10\n"
"MCR p15, 0, R0, c5, c0, 2\n"
"MCR p15, 0, R0, c5, c0, 3\n"
/* enable MPU */
"MRC p15, 0, R0, c1, c0, 0\n"
"ORR R0, R0, #1\n"
"MCR p15, 0, R0, c1, c0, 0\n"
: : : "r0"
);
}
basically i had to add it to
- loader
- uncompressor
- linux kernel
still the same problem with start_task ending up at PABT exception in qemu as you reported.
weird, i cannot even breakpoint when reaching it (i am using IDA and qemu's GDB interface)