6200 sdboot test version analysis (1)

Source: Internet
Author: User

When analyzing the Boot Code, analyze the storage space distribution (usually provided by hardware engineers), link scripts, and makefile files. Be sure to pay attention to the Startup Mode set by the board-level hardware (for example, SD card boot, nand start, nor start ). Before executing the program, the processor moves the code from the corresponding storage medium to ESRAM (for starting from nor, it is also possible to directly execute commands from nor ). For the 6200 test platform, the SD card is set to start. After the system powers on, 8 KB code is moved from the SD card to ESRAM, And the 0 address is mapped to ESRAM (note that when the system starts, ESRAM has three addresses: 0x0: ing and 0xb2000000: physical. The boot code is large, so the first 8 KB code will design code migration (sdboot is designed into two parts ). For the sdboot code under the server directory, the execution process is as follows:

Configure the system frequency, configure the serial port (debugging), and move part of the code to ESRAM (the size of ESRAM in this system is KB. This part is moved to the specified part of ESRAM, the system is moved to 0xb2002000 (sdio. in the c file, the readmultisd (16, 64, 0xb2002000) parameter indicates that 64 blocks are removed from the first block of the SD card to the esram0xb2002000 ), the starting address of the link script in the second part of the sdboot is this address. Of course, this is not necessary for commands Based on PC jump or access, but it is generally written in this way and secure, because there may be commands that are not based on PC jump or access ). After moving the boot code, the PC will jump to 0xb2002000 and start executing the second part of the boot code. The second part of the Code involves DDR2 configuration, the system startup process (by determining the sleepflag register value of the PMU part to determine whether the system is started in sleep mode or in powerup mode ). If it is started in sleep mode, you need to correctly configure the address of ddr_trainig to avoid overwriting valid data in the memory and recover the data (kernel registers, I/O registers, cache Management ......), Obtain the PC and start execution. If it is started in powerup mode, you need to continue loading the relevant parts (readmultisd (80,800, 0x42800000) in SD to the starting point of the memory address 0x42800000 (This part has not been analyzed, should involve the operating system decompression and loading), the PC absolutely jumps to 0x42800000 and starts executing in DDR2.


Delete error/comon/env_embedded.c

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.