About MMU in Linux uboot

Source: Internet
Author: User

In the Platform header files

# Ifdef config_enable_mmu
# Define pai_to_phys (x) pai_to_phy_smdkc110 (X)
# Else
# Define pai_to_phys (x) (X)
# Endif

 

What is the conversion from a virtual address to a physical address?

In the do_movi function

If (ADDR> = 0xc0000000)
ADDR = pai_to_phys (ADDR );

The do_bootm function also has

ADDR = pai_to_phys (ADDR );

Slave

This definition

# Ifdef config_enable_mmu
# Define pai_to_phys (x) pai_to_phy_smdkc110 (X)
# Else
# Define pai_to_phys (x) (X)
# Endif

It can be explained that even if I disable MMU, the kernel can be started normally without changing the default startup environment variable, because the above two key functions are converted to the final physical address!

# Define config_bootcommand "movi read kernel c0008000; movi read rootfs 30a00000180000; bootm c0008000 30a00000"

Let's see virt_to_phy_smdkc110 (X)
How can this happen.

 

 
# Ifdef config_enable_mmu # ifdef config_mcp_singleulong convert (ulong ADDR) {If (0xc0000000 <= ADDR) & (ADDR <0xd0000000) Return (ADDR-0xc0000000 + 0x20000000 ); elseprintf ("the input address don't need" \ "a virtual-to-physical Translation: % 08lx \ n", ADDR); Return ADDR ;} # elseulong pai_to_phy_smdkc110 (ulong ADDR) {If (0xc0000000 <= ADDR) & (ADDR <0xd0000000) Return (ADDR-0xc0000000 + 0x30000000 ); else if (0x30000000 <= ADDR) & (ADDR <0x50000000) return ADDR; elseprintf ("the input address don't need" \ "a virtual-to-physical Translation: % 08lx \ n", ADDR); Return ADDR;} # endif

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.