Chinaunix首页 | 论坛 | 博客
  • 博客访问: 466511
  • 博文数量: 100
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 955
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-21 09:30
文章分类

全部博文(100)

文章存档

2017年(1)

2016年(16)

2015年(83)

我的朋友

分类: 嵌入式

2015-09-10 17:49:55

uboot的设备驱动的执行步骤:
注册设备(将新设备加入设备链表),才能操作设备。

mmc驱动注册流程:
omap_mmc_init->mmc_register(mmc)

omap_mmc_init用来填充mmc结构体。其实就是omap的mmc操作函数,给mmc的函数指针赋值。

struct mmc {
    struct list_head link;
    char name[32];
    void *priv;
    uint voltages;
    uint version;
    uint has_init;
    uint f_min;
    uint f_max;
    int high_capacity;
    uint bus_width;
    uint clock;
    uint card_caps;
    uint host_caps;
    uint ocr;
    uint scr[2];
    uint csd[4];
    uint cid[4];
    ushort rca;
    char part_config;
    char part_num;
    uint tran_speed;
    uint read_bl_len;
    uint write_bl_len;
    uint erase_grp_size;
    u64 capacity;
    u64 capacity_user;
    u64 capacity_boot;
    u64 capacity_rpmb;
    u64 capacity_gp[4];
    block_dev_desc_t block_dev;
    int (*send_cmd)(struct mmc *mmc,
            struct mmc_cmd *cmd, struct mmc_data *data);
    void (*set_ios)(struct mmc *mmc);
    int (*init)(struct mmc *mmc);
    int (*getcd)(struct mmc *mmc);
    int (*getwp)(struct mmc *mmc);
    uint b_max;
    char op_cond_pending;    /* 1 if we are waiting on an op_cond command */
    char init_in_progress;    /* 1 if we have done mmc_start_init() */
    char preinit;        /* start init as early as possible */
    uint op_cond_response;    /* the response byte from the last op_cond */
};

重点是ft

阅读(1696) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~