initf_dm,

static int initf_dm(void)
{
#if defined(CONFIG_DM) && CONFIG_VAL(SYS_MALLOC_F_LEN)

//CONFIG_DM和CONFIG_SYS_MALLOC_F_LEN都有定义
    int ret;

bootstage_start(BOOTSTATE_ID_ACCUM_DM_F, "dm_f");

uint32_t bootstage_start(enum bootstage_id id, const char *name)
    {
        struct bootstage_data *data = gd->bootstage;                 //data指向gd->bootstage
        struct bootstage_record *rec = ensure_id(data, id);

struct bootstage_record *ensure_id(struct bootstage_data *data,enum bootstage_id id)
         {
             struct bootstage_record *rec;

rec = find_id(data, id);

//去gd->bootstage->record的查找有没有匹配BOOTSTATE_ID_ACCUM_DM_F的记录

//有上篇博客可知目前record中只有BOOTSTAGE_ID_AWAKE和BOOTSTAGE_ID_START_UBOOT_F两个记录
             if (!rec && data->rec_count < RECORD_COUNT) {
                 rec = &data->record[data->rec_count++];                    //rec指向gd->bootstage->record[2]
                 rec->id = id;                                                                  //rec->id初始化为BOOTSTATE_ID_ACCUM_DM_F
                 return rec;
             }

return rec;
         }

ulong start_us = timer_get_boot_us();                                 //获取当前的boot时间

if (rec) {
            rec->start_us = start_us;
            rec->name = name;
        }

return start_us;
    }

//bootstage_start的主要功能是向gd->bootstage->record[2]中增加名字为dm_f的记录

ret = dm_init_and_scan(true);

这里参考函数说明:该函数初始化驱动树和uclass树,然后从平台数据和FDT中扫描和绑定可用的设备。当输入参数为true时,仅绑定含有DM_FLAG_PRE_RELOC标志位和特殊设备树特性的节点。

bootstage_accum(BOOTSTATE_ID_ACCUM_DM_F);

在先前的bootstage_start标记一项活动为开始状态后,调用bootstage_accum标记该任务为结束状态
    if (ret)
        return ret;
#endif
#ifdef CONFIG_TIMER_EARLY                 //未定义,不执行
    ret = dm_timer_init();
    if (ret)
        return ret;
#endif

return 0;
}

本文主要分析了initf_dm的功能,主要是初始化驱动树和uclass树,并绑定含有DM_FLAG_PRE_RELOC标志位和特殊设备树特性的节点。下篇博客将继续分析init_sequence_f 中的函数。
————————————————
版权声明:本文为CSDN博主「yanggx0929」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/yanggx0929/article/details/88860236

uboot initf_dm函数分析的更多相关文章

  1. uboot main_loop函数分析

    一.概述    main_loop()函数做的都是与具体平台无关的工作.主要包括的工作如下: (1)初始化启动次数限制机制 (2)Modem功能 (3)设置软件版本号 (4)启动延迟 (5)读取命令, ...

  2. u-boot initf_bootstage函数分析

    这篇博客主要分析 init_sequence_f 函数指针数组中的initf_bootstage函数: static int initf_bootstage(void){    bool from_s ...

  3. u-boot log_init函数分析

    log_init, int log_init(void){    struct log_driver *drv = ll_entry_start(struct log_driver, log_driv ...

  4. uboot的jumptable_init函数分析

    一.函数说明 函数功能:安装系统函数指针 函数位置:common/exports.c 二.函数分析 void jumptable_init (void) { int i; gd->jt = (v ...

  5. u-boot启动流程分析(2)_板级(board)部分

    转自:http://www.wowotech.net/u-boot/boot_flow_2.html 目录: 1. 前言 2. Generic Board 3. _main 4. global dat ...

  6. 基于335X的UBOOT网口驱动分析

    基于335X的UBOOT网口驱动分析 一.软硬件平台资料 1.  开发板:创龙AM3359核心板,网口采用RMII形式 2.  UBOOT版本:U-Boot-2016.05,采用FDT和DM. 参考链 ...

  7. Uboot启动流程分析(三)

    1.前言 在前面的文章Uboot启动流程分析(二)中,链接如下: https://www.cnblogs.com/Cqlismy/p/12002764.html 已经对_main函数的整个大体调用流程 ...

  8. u-boot源码分析之C语言段

    题外话: 最近一直在学习u-boot的源代码,从代码量到代码风格,都让我认识到什么才是真正的程序.以往我所学到的C语言知识和u-boot的源代码相比,实在不值一提.说到底,机器都是0和1控制的.感觉这 ...

  9. U-Boot GOT表分析和u-boot.lds解读

    转自:http://blog.sina.com.cn/s/blog_70dd16910100zab6.html u-boot-2010.09/arch/powerpc/cpu/mpc86xx/star ...

随机推荐

  1. if-else判断语句

    <1>if-else的使用格式 if 条件: 满足条件时要做的事情1 满足条件时要做的事情2 满足条件时要做的事情3 ...(省略)... else: 不满足条件时要做的事情1 不满足条件 ...

  2. 比较&关系运算符

    <1> 比较(即关系)运算符 python中的比较运算符如下表 运算符 描述 示例 == 检查两个操作数的值是否相等,如果是则条件变为真. 如a=3,b=3则(a == b) 为 true ...

  3. 阶段3 2.Spring_01.Spring框架简介_04.spring发展历程

  4. 【转】Unity ZTest 深度测试 & ZWrite 深度写入

    原文连接:https://www.cnblogs.com/ljx12138/p/5341381.html 参考另一篇写的比较好的:Unity Shader中的 ZTest & ZWrite 初 ...

  5. Screen Painter 程序设计

    一.Screen 的创建及维护, TCode:SE51 输入程序名称,单击[建立], 程序1000为SAP预留屏幕号,屏幕号必须定义1000外的其他数字,且最多不超过四位, 本例定义屏幕为SAP预留屏 ...

  6. iOS解决表格中TextField,TextView编辑时,输入框被键盘遮挡的问题

    方法1:在原来的 UIViewController 内部再添加一层 UITableViewController 代码如下 : // // ViewController.m // 键盘遮挡问题 // / ...

  7. centos7 忘记root密码,如何进入单用户模式。

    init方法 1.centos7的grub2界面会有两个入口,正常系统入口和救援模式: 2.修改grub2引导 在正常系统入口上按下"e",会进入edit模式,搜寻ro那一行,以l ...

  8. vtkTestHull将多个平面围成一个凸面体

    1.vtkHull produce an n-sided convex hull vtkHull is a filter which will produce an n-sided convex hu ...

  9. ${pagecontext.request.contextpath}绝对路径理解

    ${pageContext.request.contextPath}是JSP取得绝对路径的方法,等价于<%=request.getContextPath()%> .也就是取出部署的应用程序 ...

  10. <form:select>

    <form:select path="classification" class="input-medium"> <form:option v ...