[state-Embedded notes] [036] [Close MMU and cache]

Source: Internet
Author: User

Close the MMU and cache

1.Cache is a small, but very fast-access memory that holds a copy of the data in the most recently used memory. By function divided into icache (instruction cache) and Dcache (data cache)

2. The virtual address is the address used in the program, and the physical address is the actual address used in the physical storage unit. Virtual addresses allow the process to use a larger amount of space. The role of the MMU is to complete the conversion of the virtual address to the physical address

3. During the processor initialization phase, to prevent unexpected errors, you need to temporarily close the MMU and cache

Both the 4.MMU and the cache are controlled by the CP15 Coprocessor's R1 (Control Register) M (0-bit), C (2), I (12-bit), and R7 invalidate i/d caches. The I bit can be ignored because downloading to NAND flash does not involve instruction caches. The manual in the arm core can be found in the relevant description

5. The first step invalidates the Icahce and Dcache, and the second closes the ICAHCE, Dcache and MMU.

/** Name: disable_cache_mmu* Description: Close cache and MMU*/DISABLE_CACHE_MMU:MCR P15, 0, R0, C7, C7, 0   //disable cache MRC P15, 0, R0, C1, C0, 0   //load C1 to R0BICR0, R0, #0x5   //Clear 0 (-c-m) MCR P15, 0, R0, C1, C0, 0   //save R0 to C1mov pc, LR

[state-Embedded notes] [036] [Close MMU and cache]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.