AnsweredAssumed Answered

mmu on mcf5441x, some questions

Question asked by Angelo Dureghello on Aug 14, 2017
Latest reply on Oct 1, 2017 by Angelo Dureghello


have some doubts on how mmu works for this cpu.


Testing now the linux kernel, in head.S mmu is enabled and then there is a jmp.


      *     Identity mapping for the kernel region.

     movel     #(MMUBASE+1),%d0          /* enable MMUBAR registers */
     movec     %d0,%MMUBAR
     movel     #MMUOR_CA,%d0               /* clear TLB entries */
     movel     %d0,MMUOR
     movel     #0,%d0                    /* set ASID to 0 */
     movec     %d0,%asid

     movel     #MMUCR_EN,%d0               /* Enable the identity map */
     movel     %d0,MMUCR
     nop                         /* sync i-pipeline */

     movel     #_vstart,%a0               /* jump to "virtual" space */
     jmp     %a0@

#endif /* CONFIG_MMU */


What is not clear is: i have a kernel loaded in 0x40001000 (so DDR2), and mmu get enabled here in the above code.


Ho can the same code already loaded in memory work (and seems it works, at leas on first kernel init parts) if it was build with load and entry at 0x40001000 ? I was expecting that after that mmu enabling, the addresses of code jumps are no more valid. Also, in init/main.c accessing to .data vars seems still working, and for .data also i was expecting addresses was converted from virtual to physical so .data init values was no more valid, unless they are not re-initialized later.


From the datahseet, what i understand is that addresses, if they don't match some important physical register address, are always translated to as virtual to physical.


Every light on this is welcome.