board_init_f在/u-boot-2018.07-fmxx/arch/arm/mach-fmxx/spl.c中定义

board_init_f
之后,和转载的部分有出入: u-boot-2018.07-fmxx/arch/arm/lib/crt0.S 来仔细分析如下代码: #if ! defined(CONFIG_SPL_BUILD) //不执行 /*
 * Set up intermediate environment (new sp and gd) and call
 * relocate_code(addr_moni). Trick here is that we'll return
 * 'here' but relocated.
 */     ldr    r0, [r9, #GD_START_ADDR_SP]    /* sp = gd->start_addr_sp */
    bic    r0, r0, #7    /* 8-byte alignment for ABI compliance */
    mov    sp, r0
    ldr    r9, [r9, #GD_BD]        /* r9 = gd->bd */
    sub    r9, r9, #GD_SIZE        /* new GD is below bd */     adr    lr, here
    ldr    r0, [r9, #GD_RELOC_OFF]        /* r0 = gd->reloc_off */
    add    lr, lr, r0
#if defined(CONFIG_CPU_V7M)
    orr    lr, #1                /* As required by Thumb-only */
#endif
    ldr    r0, [r9, #GD_RELOCADDR]        /* r0 = gd->relocaddr */
    b    relocate_code
here:
/*
 * now relocate vectors
 */     bl    relocate_vectors /* Set up final (full) environment */     bl    c_runtime_cpu_setup    /* we still call old routine here */
#endif //#if ! defined(CONFIG_SPL_BUILD) 因为定义了CONFIG_SPL_BUILD 所以不包含上述段落 #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_FRAMEWORK) //!defined(CONFIG_SPL_BUILD)为假 defined(CONFIG_SPL_FRAMEWORK) 为真 下面代码执行
# ifdef CONFIG_SPL_BUILD //执行
    /* Use a DRAM stack for the rest of SPL, if requested */
    bl    spl_relocate_stack_gd //common/spl/spl.c中定义
    cmp    r0, #0
    movne    sp, r0
    movne    r9, r0
# endif
    ldr    r0, =__bss_start    /* this is auto-relocated! */ #ifdef CONFIG_USE_ARCH_MEMSET //执行
    ldr    r3, =__bss_end        /* this is auto-relocated! */
    mov    r1, #0x00000000        /* prepare zero to clear BSS */     subs    r2, r3, r0        /* r2 = memset len */
    bl    memset
#else //不执行
    ldr    r1, =__bss_end        /* this is auto-relocated! */
    mov    r2, #0x00000000        /* prepare zero to clear BSS */ clbss_l:cmp    r0, r1            /* while not at end of BSS */
#if defined(CONFIG_CPU_V7M) //不执行
    itt    lo
#endif
    strlo    r2, [r0]        /* clear 32-bit BSS word */
    addlo    r0, r0, #4        /* move to next */
    blo    clbss_l
#endif // CONFIG_USE_ARCH_MEMSET #if ! defined(CONFIG_SPL_BUILD) //不执行
    bl coloured_LED_init
    bl red_led_on
#endif
    /* call board_init_r(gd_t *id, ulong dest_addr) */
    mov     r0, r9                  /* gd_t */
    ldr    r1, [r9, #GD_RELOCADDR]    /* dest_addr */
    /* call board_init_r */
#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
    ldr    lr, =board_init_r    /* this is auto-relocated! */
    bx    lr
#else //执行
    ldr    pc, =board_init_r    /* this is auto-relocated! */
#endif //CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
    /* we should not return here. */
#endif ENDPROC(_main) 大概流程是
bl    spl_relocate_stack_gd
bl    memset  //bss清零
ldr    pc, =board_init_r //跳转到board_init_r

一般SPL会定义CONFIG_SPL,
在common/spl/Kconfig中
config SPL_FRAMEWORK
    bool "Support SPL based upon the common SPL framework"
    depends on SPL
    default y
默认选中SPL_FRAMEWORK 到底使用那个函数,要看Makefile和config的值 board_init_r在common/spl/spl.c中定义 该函数中有些调用
比如spl_board_init 在/u-boot-2018.07-fmxx/arch/arm/mach-fmxx/spl.c中定义
而spl_board_init又调用了preloader_console_init在common/spl/spl.c中定义
https://blog.csdn.net/voice_shen/article/details/17373671

https://www.cnblogs.com/maxpak/p/5593019.html

[uboot] (第三章)uboot流程——uboot-spl代码流程 后续2018版本分析的更多相关文章

  1. u-boot移植(三)---修改前工作:代码流程分析2

    一.vectors.S 1.1 代码地址 vectors.S (arch\arm\lib) 1.2 流程跳转 跳转符号 B 为 start.S 中的 reset 执行代码,暂且先不看,先看看 vect ...

  2. 第三章、Tiny4412 U-BOOT移植三 时钟设置【转】

    本文转自:http://blog.csdn.net/eshing/article/details/37521789 这一章说明配置时钟频率基本原理 OK,接着说,这次先讲讲CPU的系统时钟.U-BOO ...

  3. C语言 第三章 关系、逻辑运算与分支流程控制

    目录 一.关系运算 二.逻辑运算 三.运算优先级 四.if语句 4.0.代码块 4.1.单if语句 4.2.if else 4.3.多重if 4.4.?号:号表达式 五.switch语句 一.关系运算 ...

  4. SpringMvc执行流程及底层代码流程

    SpringMVC执行流程   01.客户端发送请求被我们在web.xml中配置DispatcherServlet(核心控制器)拦截: 默认执行DispatcherServlet中的 protecte ...

  5. git 一般的开发流程中的代码管理

    一般的开发流程中的代码管理 1. 从版本库中下载代码 git clone ssh://wenbin@192.168.1.3:29418/mustang-web 2. 针对某个feature(比如ins ...

  6. [uboot] (第三章)uboot流程——uboot-spl代码流程

    http://blog.csdn.net/ooonebook/article/details/52957395 以下例子都以project X项目tiny210(s5pv210平台,armv7架构)为 ...

  7. [uboot] (第三章)uboot流程——uboot-spl代码流程(转)

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/ooonebook/article/det ...

  8. [uboot] (第五章)uboot流程——uboot启动流程

    http://blog.csdn.net/ooonebook/article/details/53070065 以下例子都以project X项目tiny210(s5pv210平台,armv7架构)为 ...

  9. [uboot] (第四章)uboot流程——uboot编译流程

    http://blog.csdn.net/ooonebook/article/details/53000893 以下例子都以project X项目tiny210(s5pv210平台,armv7架构)为 ...

随机推荐

  1. C++类中的一些细节(重载、重写、覆盖、隐藏,构造函数、析构函数、拷贝构造函数、赋值函数在继承时的一些问题)

    1 函数的重载.重写(重定义).函数覆盖及隐藏 其实函数重载与函数重写.函数覆盖和函数隐藏不是一个层面上的概念.前者是同一个类内,或者同一个函数作用域内,同名不同参数列表的函数之间的关系.而后三者是基 ...

  2. Django-ORM之聚合和分组查询、F和Q查询、事务

    聚合查询 聚合对查询的结果进行一步的计算加工. aggregate()是QuerySet 的一个终止子句 ,他的作用是,返回一个包含一些键值对的字典.键的名称是聚合值的标识符,值是计算出来的聚合值.键 ...

  3. android webview 添加内置对象

    package com.android.EBrowser; import android.app.Activity;import android.graphics.Rect;import androi ...

  4. 记录一次MySQL进程崩溃,无法重启故障排查

    最近程序在跑着没几天,突然访问不了,查看应用进程都还在.只有数据库的进程down掉了.于是找到日志文件看到如下错误 -- :: [Note] InnoDB: Initializing buffer p ...

  5. mysql --single-transaction 在从库导入完数据以后要在配置文件/etc/my.cnf 中加上read_only=1的参数

    1.在做数据库的主从时,防止在这个过程中,有数据访问进来,要: 要想连super权限用户的写操作也禁止,就使用"flush tables with read lock;",这样设置 ...

  6. .Net Core Grpc Consul 实现服务注册 服务发现 负载均衡

    本文是基于..net core grpc consul 实现服务注册 服务发现 负载均衡(二)的,很多内容是直接复制过来的,..net core grpc consul 实现服务注册 服务发现 负载均 ...

  7. 新建项目报错'/Users/yanguobin/IdeaProjects/Demo/pom.xml' already exists in VFS

    出现该情况的原因:是删除的时候并没有删除干净,点击如下位置会清除Idea的本地代码历史,然后重新创建项目就可以了

  8. 笛卡尔树--牛客第四场(sequence)

    思路: O(n)建一颗笛卡尔树,再O(n)dfs向上合并答案就行了. #define IOS ios_base::sync_with_stdio(0); cin.tie(0); #include &l ...

  9. nigx下配置tp5.1路由

    打开宝塔面板,找到你要配置路由的网站并找到配置文件(如图1) (图1) 2.在配置文件里添加一下代码 set $root = /www/wwwroot/www.blogs.test/public; # ...

  10. 小白学习tornado第二站-tornado简单介绍

    tornado基本web应用结构 分为两大块类 Application对象(只会实例化一次) 路由表URl映射 (r'/', MainHandler) 关键词参数settings RequestHan ...