• 一、主要是start.S 里面的 board_init_f 以及 board_init_r 函数分析,MLO与 u-boot.omg 的区别就在这里

* ### 二、 MLO 加载完毕,他会重新回到 start.S 重新开始
* ### 三、 board_init_f 函数的实现在 arch/arm/lib/board.c 里面
```c
264 void board_init_f(ulong bootflag)
265 {
266 bd_t *bd;
267 init_fnc_t **init_fnc_ptr;
268 gd_t *id;
269 ulong addr, addr_sp;
270
271
272 /* Pointer is writable since we allocated a register for it */
273 gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR) & ~0x07);
274 /* compiler optimization barrier needed for GCC >= 3.4 */
275 __asm__ __volatile__("": : :"memory");
276
277 memset((void *)gd, 0, sizeof(gd_t));
278
279 gd->mon_len = _bss_end_ofs;
280 // 这里有一个函数指针数组,里面包含很多初始化
281 for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
282 if ((*init_fnc_ptr)() != 0) {
283 hang ();
284 }
285 }
// ... ...
412 gd->bd->bi_baudrate = gd->baudrate;
413 /* Ram ist board specific, so move it to board code ... */
414 dram_init_banksize();
415 display_dram_config(); /* and display it */
416
417 gd->relocaddr = addr;
418 gd->start_addr_sp = addr_sp;
419 gd->reloc_off = addr - _TEXT_BASE;
420 debug("relocation Offset is: %08lx\n", gd->reloc_off);
421 memcpy(id, (void *)gd, sizeof(gd_t));
422
423 relocate_code(addr_sp, id, addr); // 最后回到 start.S 然后又到了 board_init_r
424
425 /* NOTREACHED - relocate_code() does not return */
426 }
```
* ### 接上函数指针数组 init_sequence
```c
235 init_fnc_t *init_sequence[] = {
236 #if defined(CONFIG_ARCH_CPU_INIT)
237 arch_cpu_init, /* basic arch cpu dependent setup */
238 #endif
239 #if defined(CONFIG_BOARD_EARLY_INIT_F)
240 board_early_init_f,
241 #endif
242 timer_init, /* initialize timer */
243 #ifdef CONFIG_FSL_ESDHC
244 get_clocks,
245 #endif
246 env_init, /* initialize environment */
247 init_baudrate, /* initialze baudrate settings */
248 serial_init, /* serial communications setup */
249 console_init_f, /* stage 1 init of console */
250 display_banner, /* say that we are here */
251 #if defined(CONFIG_DISPLAY_CPUINFO)
252 print_cpuinfo, /* display cpu info (and speed) */
253 #endif
254 #if defined(CONFIG_DISPLAY_BOARDINFO)
255 checkboard, /* display board info */
256 #endif
257 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
258 init_func_i2c,
259 #endif
260 dram_init, /* configure available RAM banks */
261 NULL,
262 };
```


* ### 三、board_init_r 也在 arch/arm/lib/board.c
```c
443 void board_init_r(gd_t *id, ulong dest_addr)
444 {
445 char *s;
446 bd_t *bd;
447 ulong malloc_start;
448 #if !defined(CONFIG_SYS_NO_FLASH)
449 ulong flash_size;
450 #endif
451
452
453 gd = id;
454 bd = gd->bd;
455
456 gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
457
458 monitor_flash_len = _end_ofs;
459
460 /* Enable caches */
461 enable_caches();
462
463 debug("monitor flash len: %08lX\n", monitor_flash_len);
464 board_init(); /* Setup chipselects */
465
466 #ifdef CONFIG_SERIAL_MULTI
467 serial_initialize();
468
469 #endif
81 /* The Malloc area is immediately below the monitor copy in DRAM */
482 malloc_start = dest_addr - TOTAL_MALLOC_LEN;
483 mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN);
484
485 stdio_init(); /* get the devices list going. */
486
487 puts("zengjf :\n");
523 #if defined(CONFIG_CMD_NAND)
524 puts("NAND : ");
525 nand_init(); /* go init the NAND */
526 #endif
// ... ...
531
532 #ifdef CONFIG_GENERIC_MMC
533 puts("MMC: ");
534 mmc_initialize(bd);
535 #endif
// .. ...
559
560 console_init_r(); /* fully init console as a device */
561
566 #if defined(CONFIG_MISC_INIT_R)
567 /* miscellaneous platform dependent initialisations */
568 misc_init_r();
569 #endif

// ... ...
649 for (;;) {
650 main_loop();
651 }
652
653 /* NOTREACHED - no way out of command loop except booting */
654 }

* ### u-boot 加载 kernel 参考:
http://www.cnblogs.com/chenfulin5/p/6937334.html * ### MLO 的流程参考:
http://www.cnblogs.com/chenfulin5/p/8398399.html

u-boot2011.09 u-boot.img 的流程跟踪的更多相关文章

  1. Spring Boot 自动装配流程

    Spring Boot 自动装配流程 本文以 mybatis-spring-boot-starter 为例简单分析 Spring Boot 的自动装配流程. Spring Boot 发现自动配置类 这 ...

  2. I.MX6 Linux Qt 启动流程跟踪

    /************************************************************************** * I.MX6 Linux Qt 启动流程跟踪 ...

  3. activiti流程跟踪图算法

    流程跟踪图-推导算法 工作中使用activiti实现流程图相关业务,但是上线后遇到问题,偶尔流程图出不来.查阅了一下画流程图的实现,基本上是参见:activiti-流程图颜色变化之一篇. 核心类,参见 ...

  4. Buildroot 打包文件系统流程跟踪

    /********************************************************************************* * Buildroot 打包文件系 ...

  5. am335x u-boot2011.09 SPL 流程跟踪

    跟踪一下 u-boot 2011.09 MLO在 nandflash 下运行的流程 首先,直接进入 start.S // arch/arm/cpu/armv7/start.S 36 .globl _s ...

  6. 头秃了,二十三张图带你从源码了解Spring Boot 的启动流程~

    持续原创输出,点击上方蓝字关注我 目录 前言 源码版本 从哪入手? 源码如何切分? 如何创建SpringApplication? 设置应用类型 设置初始化器(Initializer) 设置监听器(Li ...

  7. Spring Boot :Request请求处理流程

    技术交流群:233513714

  8. 2018.09.07 最新cocoapods安装流程

    这篇写在简书了,就不费力气搬了,给简书留一篇. https://www.jianshu.com/p/13bbbf804b71

  9. show create table底层流程跟踪

    GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 导语 SHOW CREATE TABLE语句用于为指定表/视图显示创建的语句,本文将简要描述如何在MySQL源码里跟踪和学 ...

随机推荐

  1. Android Studio多Module开发需要注意的问题

    多module开发,其中的一个为入口module,其他module为独立的“应用”(library) 1.在原有的项目导入另外个项目的module为主项目的次module,即在A项目中添加一个启动B项 ...

  2. html 图片在一个div中放大缩小效果

    <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> &l ...

  3. SQL Server中关于跟踪(Trace)那点事(转载)

    前言 一提到跟踪俩字,很多人想到警匪片中的场景,同样在我们的SQL Server数据库中“跟踪”也是无处不在的,如果我们利用好了跟踪技巧,就可以针对某些特定的场景做定向分析,找出充足的证据来破案. 简 ...

  4. JavaWeb 返回json数据的两种方式

    1.说明 由于一般情况下,由浏览器(前端)发送请求,服务器(后台)响应json数据,所以这里结合js进行说明: A服务器发送请求至B服务器,并接收其返回的json数据,见文末推荐,这里不再赘述! 2. ...

  5. gitlab 迁移、升级打怪之路:8.8.5--> 8.10.8 --> 8.17.8 --> 9.5.9 --> 10.1.4 --> 10.2.5

    gitlab 迁移.升级打怪之路:8.8.5--> 8.10.8 --> 8.17.8 --> 9.5.9 --> 10.1.4 --> 10.2.5 gitlab 数据 ...

  6. Android app 全局异常统一处理

    异常处理需求 Android app 出现 crash 时,会出现 "程序异常退出" 的提示并关闭,体验不好,另外主要是无法知道哪里出现的崩溃,需要知道哪里造成的异常,就需要一个全 ...

  7. Java设计模式之工厂模式的两种实现方式

    工厂模式(Factory Pattern)是 Java 中最常用的设计模式之一.这种类型的设计模式属于创建型模式,它提供了一种创建对象的最佳方式. 1. 为什么要有工厂模式? "Talk i ...

  8. 深入理解Linux内核-信号

    信号:1.最初被引入作为用户态进程间通信2.内核也使用信号通知进程系统所发生的事件3.信号很短,发送给进程的唯一信息通常是一个数.4.名称通常以SIG为前缀5.信号时可消费资源,每个信号只能被传递一次 ...

  9. Web Component探索

    概述 各种网站往往需要一些相同的模块,比如日历.调色板等等,这种模块就被称为“组件”(component).Web Component就是网页组件式开发的技术规范. 采用组件进行网站开发,有很多优点. ...

  10. 菜鸟学JS(三)——自动隐藏的悬浮框

    今天写一个小实例,用js和css写一个可以自动隐藏的悬浮框.css肯定是用来控制样式的,js用来控制器显示与隐藏的.显示与隐藏通常有两种方法实现:1,用js控制其显示属性:2,用js控制其大小. 今天 ...