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