AT91SAM9260的dataflash在U-boot-1.3.4中的分区文件:board/atmel/at91sam9260ek/partition.c
/*define the area offsets*/
dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
{0x00000000, 0x00003FFF, FLAG_PROTECT_SET, 0, "Bootstrap"}, /*16K*/
{0x00004000, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"}, /*17K*/
{0x00008400, 0x0003FFFF, FLAG_PROTECT_SET, 0, "U-Boot"}, /*223K*/
{0x00040000, 0x001FFFFF, FLAG_PROTECT_CLEAR, 0, "kernel"}, /*1M+768K*/
{0x00200000, 0x003FFFFF, FLAG_PROTECT_CLEAR, 0, "rootfs"}, /*2M*/
};
AT91SAM9260的dataflash和nandflash在linux-2.6.22内核中的分区文件:arch/arm/mach-at91/board-sam9260ek.c
static struct mtd_partition __initdata ek_nand_partition[] = {
{
name:"bootstrap - 128KB",
offset:0,
size:SZ_128K,
},
{
name:"uboot - 256KB",
offset:MTDPART_OFS_APPEND,
size:SZ_256K,
},
{
name:"uboot env - 128KB",
offset:MTDPART_OFS_APPEND,
size:SZ_128K,
},
{
name:"uboot env swap - 128KB",
offset:MTDPART_OFS_APPEND,
size:SZ_128K,
},
{
name:"kernel - 5MB",
offset:MTDPART_OFS_APPEND,
size:5 * SZ_1M,
},
{
name:"fs - 5MB",
offset:MTDPART_OFS_APPEND,
size:5 * SZ_1M,
},
{
name:"apps - 20MB",
offset:MTDPART_OFS_APPEND,
size:20 * SZ_1M,
},
{
name:"info - 1MB",
offset:MTDPART_OFS_APPEND,
size:1 * SZ_1M,
},
#define CONFIG_BACKUP_PARTITION
#ifndef CONFIG_BACKUP_PARTITION
{
name:"data - 224MB",
offset:MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
},
#else
{
name:"data - 168MB",
offset:MTDPART_OFS_APPEND,
size:168 * SZ_1M,
},
{
name:"restore - 40 MB" ,
offset:MTDPART_OFS_APPEND,
size: 40 * SZ_1M,
},
{
name:"uboot firmware backup - 16 MB",
offset:MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL, /*All left*/
},
#endif
其中offset是分区开始的偏移地址,MTDPART_OFS_APPEND,表示紧接着上一个分区,MTD Core会自动计算和处理分区地址;size是分区的大小,在最后一个分区我们设为MTDPART_SIZ_FULL,表示这个NADN剩下的所有部分。