1.uboot中修改分区,
在/uboot/include/configs/pdk7105.h 中:
#ifdef CONFIG_CMD_NAND /* NAND flash present ? */
# define CFG_MAX_NAND_DEVICE 1
# define NAND_MAX_CHIPS CFG_MAX_NAND_DEVICE
# define CFG_NAND0_BASE CFG_EMI_NAND_BASE
# define CFG_NAND_BASE_LIST { CFG_NAND0_BASE }
# define MTDPARTS_NAND \
"gen_nand.1:" /* First NAND flash device */ \
"128k(env-nand0)" /* first partition */ \
",4M(kernel-nand0)" \
",32M(root-nand0)" \
",-(RestOfNand0)" /* last partition */
# define MTDIDS_NAND \
"nand0=gen_nand.1" /* First NAND flash device */
# define CFG_MAX_NAND_DEVICE 1
# define NAND_MAX_CHIPS CFG_MAX_NAND_DEVICE
# define CFG_NAND0_BASE CFG_EMI_NAND_BASE
# define CFG_NAND_BASE_LIST { CFG_NAND0_BASE }
# define MTDPARTS_NAND \
"gen_nand.1:" /* First NAND flash device */ \
"128k(env-nand0)" /* first partition */ \
",4M(kernel-nand0)" \
",32M(root-nand0)" \
",-(RestOfNand0)" /* last partition */
# define MTDIDS_NAND \
"nand0=gen_nand.1" /* First NAND flash device */
这里可以修改成:
"1M(uboot-nand0)" /* first partition */ \
",4M(kernel-nand0)" \
",64M(yaffs2-nand0)" \
",-(RestOfNand0)" /* last partition */
",4M(kernel-nand0)" \
",64M(yaffs2-nand0)" \
",-(RestOfNand0)" /* last partition */
然后就可以make uboot。
2. kernel里修改分区:
在/kernel/arch/sh/board/st/pdk7105/setup.c 中
/* Configuration for NAND Flash */
static struct mtd_partition nand_parts[] = {
{
.name = "NAND root",
.offset = 0, //0x0400000
.size = 0x00800000 //0x4400000
}, {
.name = "NAND home",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL
},
};
static struct mtd_partition nand_parts[] = {
{
.name = "NAND root",
.offset = 0, //0x0400000
.size = 0x00800000 //0x4400000
}, {
.name = "NAND home",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL
},
};
修改成:
/* Configuration for NAND Flash */
static struct mtd_partition nand_parts[] = {
{
.name = "yaffs2 root",
.offset = 0x500000, //0x0500000
.size = 0x04500000 //0x4500000
}, {
. name = "RestOfNand0",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL
},
};
static struct mtd_partition nand_parts[] = {
{
.name = "yaffs2 root",
.offset = 0x500000, //0x0500000
.size = 0x04500000 //0x4500000
}, {
. name = "RestOfNand0",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL
},
};
然后make kernel即可。