Uboot startup code Stage 1 Process

Source: Internet
Author: User

Some time ago I read the uboot source code and forgot about it after a while. Some comments are made to facilitate future study.

Stage 1CodeMainly in start. S. The process is as follows:

1. Set the interrupt vector table.

2. Set CPU to administrator mode.

3. Disable dogs.

4. disconnection.

5. Set the system clock.

6. Jump to cpu_init_crit. (Note that BL commands are relatively redirected. mov LR and PC are used for absolute redirection. Because the code in this phase is location-independent code, you must carefully understand the details of the jump)

. Make the cache invalid.

. Disable MMU and cache.

. Jump to lowlevel_init to set the memory clock.

The specific analysis of this function can be referred here: http://blog.csdn.net/xautfengzi/article/details/6306436

7. initialize the NAND controller.

8. Set the stack, FP pointer, Ro, R1, and R2 registers as real parameters.

9. Jump to nand_read_ii and copy uboot to SDRAM.

10. Compare the content of the first 4 K copied to SDRAM with that in steppingstone.

11. Set the SP pointer to clear the BSS segment.

12. Jump to start_armboot, that is, the second stage.

Distribution in memory at the end of the first phase is shown in the figure: this graph is transferred from http://my.unix-center.net /~ Xiaoshe/2010/01/03/U-boot % E7 % 9A % 84% E5 % 86% E5 % ad % 85% E5 % 98% E5 % B8 % 88% E5 % 86% 8C % E5 % 85% A8 % E5 % B1 % 80% E6 % 95% B0 % E6 % 8d % AE % E7 % BB % 93% E6 % 9e % 84/

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.