第一范文网 - 专业文章范例文档资料分享平台

移植Linux内核到norflash

来源:用户分享 时间:2025/6/4 16:16:39 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

},

/*2: Rootfs(jffs2): 0x240000-0x7f0000 0x5b0000=5824KB=5.6875MB*/ {

.name = “Rootfs(jffs2)”, .size = 0x5b0000, .offset = 0x240000, },

/*3: U-Boot Parameters: 0x7f0000-0x800000 0x10000=64KB*/ {.name = “Parameter”, .size = 0x010000, .offset = 0x7f0000, }, };

//static const char *probes[] = { “RedBoot”, “cmdlinepart”, NULL };

static const char *probes[] = { NULL }; #endif

static int mtd_parts_nb = 0;

static struct mtd_partition *mtd_parts = 0; int __init init_s3c2440nor(void) {

static const char *rom_probe_types[] = PROBETYPES; const char **type; const char *part_type = 0;

printk(KERN_NOTICE MSG_PREFIX “0xx at 0xxn”, WINDOW_SIZE, WINDOW_ADDR);

s3c2440nor_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);

if (!s3c2440nor_map.virt) {

printk(MSG_PREFIX “failed to ioremapn”); return -EIO; }

simple_map_init(&s3c2440nor_map); mymtd = 0;

type = rom_probe_types; for(; !mymtd && *type; type++) {

mymtd = do_map_probe(*type, &s3c2440nor_map); flash_debug(“func:%s[%d] mymtd:%x type:%sn”, __func__, __LINE__, mymtd, *type); }

if (mymtd) {

mymtd->owner = THIS_MODULE;

#ifdef CONFIG_MTD_PARTITIONS

mtd_parts_nb = parse_mtd_partitions(mymtd, probes, &mtd_parts, MTDID);

if (mtd_parts_nb > 0) part_type = “detected”;

if (mtd_parts_nb == 0){ mtd_parts = static_partitions;

mtd_parts_nb = ARRAY_SIZE(static_partitions); part_type = “static”; }

#endif add_mtd_device(mymtd);

if (mtd_parts_nb == 0)

printk(KERN_NOTICE MSG_PREFIX “no partition info availablen”); else{

printk(KERN_NOTICE MSG_PREFIX

“using %s partition definitionn”, part_type); add_mtd_partitions(mymtd, mtd_parts, mtd_parts_nb); }

return 0; }

iounmap((void *)s3c2440nor_map.virt);

return -ENXIO; }

static void __exit cleanup_s3c2440nor(void) {

if (mymtd) {

del_mtd_device(mymtd); map_destroy(mymtd); }

if (s3c2440nor_map.virt) {

iounmap((void *)s3c2440nor_map.virt); s3c2440nor_map.virt = 0; } }

module_init(init_s3c2440nor); module_exit(cleanup_s3c2440nor); MODULE_LICENSE(“GPL”);

MODULE_AUTHOR(“GengYaoJun “);

MODULE_DESCRIPTION(“Generic configurable MTD map driver”);

搜索更多关于: 移植Linux内核到norflash 的文档
移植Linux内核到norflash.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c6i7n393xmz9nplx1m54t1j03v4iv5u00auy_5.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top