This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM926ejs MMU problem

Note: This was originally posted on 17th December 2010 at http://forums.arm.com

I am working on an ARM926ejs core (Fiujitsu) with Linux as the OS.

I am trying to disable the MMU and re enable it again. I read lot of articles on the net and tried to follow the same procedure:
1. Invalidate D-cache (and I-cache)
2. Invalidated TLB
3. Disable MMU

however, I observed that as soon as I turned OFF the MMU the system got stuck, but if I run the same code without disabling the MMU, it works fine.
I want to know what exactly is going wrong after the MMU is disabled?

Following is the code snipped I used to disable the MMU:
     /* The Instruction and Data Cache are disabled:: code not pasted here */   

     mov   r0,#0
    
     /* Invalidate TLB */
     mcr  p15, 0, r0, c8, c7, 0

#if 1
     nop
     mcr  p15, 0, r2, c1, c0, 0   /* Disable MMU */
     mov  r2,r2                /* these could be in pipeline with MVA */
     mov  r2,r2                /* these could be in pipeline with MVA */
     mov  r2,r2                /* these could be in pipeline with MVA */
     mov  pc,r10               /* jump to Enable MMU: this could be the actual PA to jump */
#endif


I tried to disable the "Instruction Prefetch" in the co-processor c15 register. I've been struggling to get this to work for the past one month and unable to get the desired outcome.
If there's anyone who could help me solve this, I would greatly appreciate.
Parents
  • Note: This was originally posted on 17th December 2010 at http://forums.arm.com

    As soon as you disable the MMU, the address translation will become flat mapped.

    Before you turn the MMU off, the instructions at VA are being fetched from PA = f(VA), after you turn it off, the instructions at VA are fetched from PA = VA.

    Have you ensured that the instructions at VA are the same as f(VA), or have you ensured that the page you are executing from before you disable the MMU is already flat mapped?

    Further, if something subsequently makes use of the stack (or C library) have you ensured these have valid mappings with the MMU disabled?

    hth
    s.
Reply
  • Note: This was originally posted on 17th December 2010 at http://forums.arm.com

    As soon as you disable the MMU, the address translation will become flat mapped.

    Before you turn the MMU off, the instructions at VA are being fetched from PA = f(VA), after you turn it off, the instructions at VA are fetched from PA = VA.

    Have you ensured that the instructions at VA are the same as f(VA), or have you ensured that the page you are executing from before you disable the MMU is already flat mapped?

    Further, if something subsequently makes use of the stack (or C library) have you ensured these have valid mappings with the MMU disabled?

    hth
    s.
Children
No data