Uboot启动流程分析(五)

1、前言

在前面的文章Uboot启动流程分析(五),链接如下:

https://www.cnblogs.com/Cqlismy/p/12147411.html

已经对board_init_f() 函数作出了简单的分析,该函数对一些早期的外设进行了初始化,例如调试串口,并填充了gd_t结构体中的成员变量,最主要的是对整个DRAM的内存进行了分配,以便uboot的重定位,接下来,先回顾一下_main函数的大概流程,如下:

_main
    |
    board_init_f_alloc_reserve-->reserve gd and early malloc area
    |
    board_init_f_init_reserve-->initialize global data
    |
    board_init_f-->initialize ddr,timer...,and fill gd_t
    |
    relocate_code-->relocate uboot code
    |
    relocate_vectors-->relocate vectors
    |
    board_init_r-->calling board_init_r

在_main函数中,调用完了board_init_f()函数后,将DRAM的内存分配好,填充gd_t结构体成员变量,接下来,就是调用relocate_code()函数重定位uboot代码,调用relocate_vectors()函数重定位中断向量表,本篇文章将简单分析uboot的大概重定位过程。

2、uboot相关变量

3、relocate_code函数

4、relocate_vectors函数

5、小结

猜你喜欢

转载自www.cnblogs.com/Cqlismy/p/12152400.html