云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 移植Linux内核到norflash

移植Linux内核到norflash

  • 62 次阅读
  • 3 次下载
  • 2026/1/9 9:41:09

},

/*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 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

}, /*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[] = { NUL

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com