一. 修改内核大小
1. 在你的配置文件下uboot/include/config/xxx.h 里面有一个宏定义
#define MTDPARTS_DEFAULT "mtdparts=jz2440-0:256k(u-boot)," "128k(params)," "4m(kernel)," "-(rootfs)"
此处将kerner对应的字段修改后即可修改uboot为linux内核分配的空间, kernel内为flash分配的分区下面分析。
二. 修改Nand Flash分区
1. 修改arch/arm/mach-s3c24xx/common-smdk.c文件中如下内容
static struct mtd_partition smdk_default_nand_part[] = { [0] = { .name = "bootloader", .size = SZ_256K, .offset = 0, }, [1] = { .name = "params", .offset = MTDPART_OFS_APPEND, .size = SZ_128K, }, [2] = { .name = "kernel", .offset = MTDPART_OFS_APPEND, .size = SZ_4M, }, [3] = { .name = "rootfs", .offset = MTDPART_OFS_APPEND, .size = MTDPART_SIZ_FULL, } };
arm/mach-s3c24xx/mach-mini2440.c中配套修改
static struct mtd_partition mini2440_default_nand_part[] __initdata = { [0] = { .name = "bootloader", .size = SZ_256K, .offset = 0, }, [1] = { .name = "params", .offset = MTDPART_OFS_APPEND, .size = SZ_128K, }, [2] = { .name = "kernel", .offset = MTDPART_OFS_APPEND, .size = SZ_4M, }, [3] = { .name = "rootfs", .offset = MTDPART_OFS_APPEND, .size = MTDPART_SIZ_FULL, } };
2. 修改系统晶振时钟
在文件arch/arm/mach-s3c24xx/mach-smdk2440.c中将时钟改位12M
static void __init smdk2410_init_time(void) { s3c2410_init_clocks(12000000); samsung_timer_init(); }
3. 修改完成后执行make uImage LOADADDR=0x30108000 -j8进行编译