extern flash_info_t flash_info[];
flash_info_t *flash;
int offset_aligned;
- u32 end_offset;
+ u32 end_offset, sector_size = 0;
int i;
flash = &flash_info[id->num];
+ /* size of last sector */
+ part->sector_size = flash->size -
+ (flash->start[flash->sector_count-1] - flash->start[0]);
+
offset_aligned = 0;
for (i = 0; i < flash->sector_count; i++) {
if ((flash->start[i] - flash->start[0]) == part->offset) {
}
end_offset = part->offset + part->size;
+ offset_aligned = 0;
for (i = 0; i < flash->sector_count; i++) {
+ if (i) {
+ sector_size = flash->start[i] - flash->start[i-1];
+ if (part->sector_size < sector_size)
+ part->sector_size = sector_size;
+ }
if ((flash->start[i] - flash->start[0]) == end_offset)
- return 0;
+ offset_aligned = 1;
}
- if (flash->size == end_offset)
+ if (offset_aligned || flash->size == end_offset)
return 0;
printf("%s%d: partition (%s) size alignment incorrect\n",
nand = &nand_info[id->num];
+ part->sector_size = nand->erasesize;
+
if ((unsigned long)(part->offset) % nand->erasesize) {
printf("%s%d: partition (%s) start offset alignment incorrect\n",
MTD_DEV_TYPE(id->type), id->num, part->name);
mtd = &onenand_mtd;
+ part->sector_size = mtd->erasesize;
+
if ((unsigned long)(part->offset) % mtd->erasesize) {
printf("%s%d: partition (%s) start offset"
"alignment incorrect\n",
u32 offset; /* offset within device */
void *jffs2_priv; /* used internaly by jffs2 */
u32 mask_flags; /* kernel MTD mask flags */
+ u32 sector_size; /* size of sector */
struct mtd_device *dev; /* parent device */
};