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
阅读(1746) | 评论(0) | 转发(0) |