linux-3.4.2移植到FL2440上(二)--修改MTD分区
修改MTD分区:
在/arch/arm/mach-s3c24xx/common-smdk.c
修改:
1 /* NAND parititon from 2.4.18-swl5 */ 2 3 static struct mtd_partition smdk_default_nand_part[] = { 4 [0] = { 5 .name = "Boot Agent", 6 .size = SZ_16K, 7 .offset = 0, 8 }, 9 [1] = { 10 .name = "S3C2410 flash partition 1", 11 .offset = 0, 12 .size = SZ_2M, 13 }, 14 [2] = { 15 .name = "S3C2410 flash partition 2", 16 .offset = SZ_4M, 17 .size = SZ_4M, 18 }, 19 [3] = { 20 .name = "S3C2410 flash partition 3", 21 .offset = SZ_8M, 22 .size = SZ_2M, 23 }, 24 [4] = { 25 .name = "S3C2410 flash partition 4", 26 .offset = SZ_1M * 10, 27 .size = SZ_4M, 28 }, 29 [5] = { 30 .name = "S3C2410 flash partition 5", 31 .offset = SZ_1M * 14, 32 .size = SZ_1M * 10, 33 }, 34 [6] = { 35 .name = "S3C2410 flash partition 6", 36 .offset = SZ_1M * 24, 37 .size = SZ_1M * 24, 38 }, 39 [7] = { 40 .name = "S3C2410 flash partition 7", 41 .offset = SZ_1M * 48, 42 .size = MTDPART_SIZ_FULL, 43 } 44 }; 45 46 47
1 改为如下: 2 3 /* NAND parititon from 2.4.18-swl5 */ 4 /* by zhutao */ 5 static struct mtd_partition smdk_default_nand_part[] = { 6 [0] = { 7 .name = "U-BOOT", 8 .size = SZ_2M, 9 .offset = 0, 10 }, 11 [1] = { 12 .name = "KERNEL", 13 .offset = MTDPART_OFS_APPEND, 14 .size = SZ_4M, 15 }, 16 [2] = { 17 .name = "YAFFS2", 18 .offset = MTDPART_OFS_APPEND, 19 .size = MTDPART_SIZ_FULL, 20 } 21 };
编译启动内核:
打印信息分区信息:
Creating 3 MTD partitions on "NAND": 0x000000000000-0x000000200000 : "U-BOOT" 0x000000200000-0x000000600000 : "KERNEL" 0x000000600000-0x000010000000 : "YAFFS2"