初级会员
- 积分
- 109
- 金钱
- 109
- 注册时间
- 2020-2-25
- 在线时间
- 19 小时
|
楼主 |
发表于 2022-2-19 21:03:45
|
显示全部楼层
本帖最后由 l3142600073 于 2022-4-30 18:33 编辑
gpmi_nand_init
mtd_device_parse_register
mtd_add_device_partitions
add_mtd_partitions
printk(KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n", nbparts, master->name);
for (i = 0; i < nbparts; i++) {
allocate_partition
printk(KERN_NOTICE "0x%012llx-0x%012llx : \"%s\"\n", (unsigned long long)slave->offset,
(unsigned long long)(slave->offset + slave->mtd.size), slave->mtd.name); }
//mtd分区解析
int parse_mtd_partitions(struct mtd_info *master, const char *const *types,
struct mtd_partition **pparts,
struct mtd_part_parser_data *data)
{
struct mtd_part_parser *parser;
int ret = 0;
if (!types)
types = default_mtd_part_types;
for ( ; ret <= 0 && *types; types++) {
pr_debug("%s: parsing partitions %s\n", master->name, *types);
parser = get_partition_parser(*types);
if (!parser && !request_module("%s", *types))
parser = get_partition_parser(*types);
pr_debug("%s: got parser %s\n", master->name, parser ? parser->name : NULL);
if (!parser)
continue;
ret = (*parser->parse_fn)(master, pparts, data);
put_partition_parser(parser);
if (ret > 0) {
printk("types is :%s\n",*types);
printk(KERN_NOTICE "%d %s partitions found on MTD device %s\n",
ret, parser->name, master->name);
break;
}
}
return ret;
}
|
|