This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/DM3730: where is mmu initialized ?

Guru 20755 points
Part Number: DM3730
Other Parts Discussed in Thread: AM3517,

Tool/software: Linux

Hello,

Can anyone point to where is mmu enabled  ? 

Thank you!

Ran

  • Hi Ran,

    You can enable MMU in the kernel config file. For example set CONFIG_MMU=y as it is done in ../linux-2.6.37-psp04.02.00.07.sdk/arch/arm/configs/am3517_evm_defconfig

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin,

    Thank you very much.

    We need to initialize mmu with other OS , not linux(I think it should be done in assembly ).

    Is it available ?

    We have mmu initlization of cortext A9, but I'm not sure if it can be used with dm3730 (which is cortext A8)  ?

    Best Regards,

    Ran

  • Ran,

    The most of the MMU registers are the same in Cortex A9 and DM3730 (Cortex A8) but in Cortex A9 there are 4 additional register which does not present in DM3730 (Cortex A8). Also the physical addresses of matching registers in both architectures are different.
    However MMU initialization seems very similar in both architectures. You can find details about how to configure MMU in DM3730 in the AM/DM37x Multimedia Device Technical Reference Manual - section 15.4 MMU Basic Programming Model at:
    www.ti.com/.../technicaldocuments
    Then you can compare initialization procedure in both architectures.

    BR
    Tsvetolin Shulev
  • Hi Tvestoliln,

    Attached is the A9-cortex which compiles for me.

    I am not sure if any of these registers are not aomptible with A8.

    Doesn't the compiler should complain ?

    If you know about some open source mmu initialization for mmu please let me know.

    Thank you,

    Ran

    init_mmu.S

  • Did you ever get your MMU running?  I'm having trouble getting the L1 Dcache enabled on a DM3730.  I'm not using Linux.

    dcache_disable();
    icache_disable();
    icache_invalidate();
    tlb_invalidate(); /* this is both iTLB and dTLB */
    init_mmu_ttb(); /* this is page table set up and MMU register programming */
    mmu_enable();
    dcache_invalidate();
    dcache_enable();
    dcache_preload();

    Those are the steps I take, but in dcache_preload() data writes are going to SDRAM and not to L1 dcache.  L2 cache is diabled.  Since the L1 dcache is allocate on read, I load a word, overwrite it, and expect the write to go to L1 and not to SDRAM, but my writes go to SDRAM.  It appears the MMU is working ok, but the dcache is not taking data.

  • Hi,

    Which OS is it ? Starterware/ucos / other ?
  • No OS.  Custom MLO post u-boot.  So I have to set up page tables (just 4096 1MB section level 1 pages, cacheable, bufferable, full access, VA=PA (TEX=000b, C=1, B=1, write-back, no read allocate) myself and enable L1 Dcache.  L2 cache is disabled, L1 Icache is disabled.  I'm testing for L1 Dcache enabled, by enabling it, Load/Store to 24 cachelines word by word, disable C-bit in Control Register and then printing.  I *expect* to print the SDRAM data and not the L1 Dcache data since I've disabled C-bit and TRM claims with C-bit disable there are no accesses to L1.  I would expect the L1 Dcache data to be valid and dirty, but up to me to clean and/or invalidate since I'm write-back.  The TRM claims the L1 Dcache is *only* read allocate which is why I do a load then a store to get the SDRAM data in to the L1 Dcache.  So it looks like the L1 Dcache is acting like write-through *or* it's not actually enabled.  Which is odd when control register C-bit is on and I have page tables set up.

  • Oh and to be clear, those functions listed are my asm functions copied from copious examples on the web for doing such things. I'm not calling someone else's functions. I'm just wondering if there's some poorly documented issue around using the L1 Dcache.
  • Interestingly enough, when I try to read the L1 tag and data ram contents using these instructions:
    infocenter.arm.com/.../index.jsp
    the CPU locks up.