内核移植(3)修改MTD分区

发布者:梦想启航最新更新时间:2023-08-28 来源: elecfans关键字:内核移植 手机看文章 扫描二维码
随时随地手机看文章

修改MTD分区,在arch/arm/plat-s3c24xx/common-smdk.c修改:

static struct mtd_partition smdk_default_nand_part[] = {

        [0] = {

                .name   = "Boot Agent",

                .size   = SZ_16K,

                .offset = 0,

        },

        [1] = {

                .name   = "S3C2410 flash partition 1",

                .offset = 0,

                .size   = SZ_2M,

        },

        [2] = {

                .name   = "S3C2410 flash partition 2",

                .offset = SZ_4M,

                .size   = SZ_4M,

        },

        [3] = {

                .name   = "S3C2410 flash partition 3",

                .offset = SZ_8M,

                .size   = SZ_2M,

        },

       [4] = {

                .name   = "S3C2410 flash partition 4",

                .offset = SZ_1M * 10,

                .size   = SZ_4M,

        },

        [5] = {

                .name   = "S3C2410 flash partition 5",

                .offset = SZ_1M * 14,

                .size   = SZ_1M * 10,

        },

        [6] = {

                .name   = "S3C2410 flash partition 6",

                .offset = SZ_1M * 24,

                .size   = SZ_1M * 24,

        },

        [7] = {

                .name   = "S3C2410 flash partition 7",

                .offset = SZ_1M * 48,

                .size   = SZ_16M,

        }

};

修改为:

static struct mtd_partition smdk_default_nand_part[] = {

        [0] = {

               .name   = "kernel",//kernel

               .size   = SZ_2M,

               .offset = 0,

        },

        [1] = {

               .name   = "jffs2",

               .offset = MTDPART_OFS_APPEND,

               .size   = SZ_8M,

        },

        [2] = {

                .name   = "yaffs",

                .offset = MTDPART_OFS_APPEND,

                .size   = MTDPART_SIZ_FULL,

        }

/*      [0] = {

                .name   = "Boot Agent",

                .size   = SZ_16K,

                .offset = 0,

        },

       [1] = {

                .name   = "S3C2410 flash partition 1",

                .offset = 0,

                .size   = SZ_2M,

        },

        [2] = {

                .name   = "S3C2410 flash partition 2",

                .offset = SZ_4M,

                .size   = SZ_4M,

        },

        [3] = {

                .name   = "S3C2410 flash partition 3",

                .offset = SZ_8M,

                .size   = SZ_2M,

        },

        [4] = {

                .name   = "S3C2410 flash partition 4",

                .offset = SZ_1M * 10,

                .size   = SZ_4M,

        },

        [5] = {

                .name   = "S3C2410 flash partition 5",

                .offset = SZ_1M * 14,

                .size   = SZ_1M * 10,

        },

        [6] = {

                .name   = "S3C2410 flash partition 6",

                .offset = SZ_1M * 24,

                .size   = SZ_1M * 24,

        },

        [7] = {

                .name   = "S3C2410 flash partition 7",

                .offset = SZ_1M * 48,

                .size   = SZ_16M,

        }*/

};

U-Boot控制界面,看到内核的启动信息如下:

loop: module loaded

dm9000 Ethernet Driver

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx

BAST NOR-Flash Driver, (c) 2004 Simtec Electronics

S3C24XX NAND Driver, (c) 2004 Simtec Electronics

s3c2410-nand s3c2410-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns

NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)

Scanning device for bad blocks

Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":

[1] [2]
关键字:内核移植 引用地址:内核移植(3)修改MTD分区

上一篇:内核移植(4)移植yaffs文件系统
下一篇:内核移植(1)首次生成uImage映象文件

小广播
设计资源 培训 开发板 精华推荐

最新单片机文章
何立民专栏 单片机及嵌入式宝典

北京航空航天大学教授,20余年来致力于单片机与嵌入式系统推广工作。

换一换 更多 相关热搜器件

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved