mx28evk: Use 512k for fdt partition to align it
PATCH 1/2 mx28evk: Use 512k for fdt partition to align it
Using 512k for fdt partition allow it to be aligned with the other small partitions and 512k erase block size.
--- include/configs/mx28evk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/mx28evk.h +1 -1
@@ -97,7 +97,7 @@"512k(environment)," \"512k(redundant-environment)," \"4m(kernel)," \ -"128k(fdt)," \ +"512k(fdt)," \"8m(ramdisk)," \ "-(filesystem)"#endif
Signature · 1 line
1.8.4.rc3
PATCH 2/2 mtd: Fix size overflow
When using a NAND IC with 4GiB of size, mtdparts go crazy as the 32bit size variables overview resulting in:
,----
| MX28EVK U-Boot > mtdparts default
| gpmi-nand: partitioning exceeds flash size
`----
Using a 64bit variable fixes the problem.
--- common/cmd_mtdparts.c | 24 ++++++++++++------------ include/jffs2/load_kernel.h | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-)
common/cmd_mtdparts.c +12 -12
@@ -395,7 +395,7 @@ static int part_validate(struct mtdids *id, struct part_info *part) part->size = id->size - part->offset;if (part->offset > id->size) { -printf ("%s: offset %08x beyond flash size %08x\n" , +printf ("%s: offset %08llx beyond flash size %08llx\n" , id->mtd_id, part->offset, id->size);return 1 ; }
@@ -578,8 +578,8 @@ static int part_add(struct mtd_device *dev, struct part_info *part)static int part_parse (const char *const partdef,const char **ret,struct part_info **retpart) {struct part_info *part; -unsigned long size; -unsigned long offset; +u64 size; +u64 offset;const char *name;int name_len;unsigned int mask_flags;
@@ -598,7 +598,7 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i }else { size =memsize_parse (p, &p);if (size <MIN_PART_SIZE ) { -printf ("partition size too small (%lx)\n" , size); +printf ("partition size too small (%llx)\n" , size);return 1 ; } }
@@ -670,14 +670,14 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i part->auto_name =0 ; }else {/* auto generated name in form of size at offset */ -sprintf (part->name,"0x%08lx at 0x%08lx" , size, offset); +sprintf (part->name,"0x%08llx at 0x%08llx" , size, offset); part->auto_name =1 ; } part->name[name_len -1 ] ='\0' ;INIT_LIST_HEAD (&part->link); -debug ("+ partition: name %-22s size 0x%08x offset 0x%08x mask flags %d\n" , +debug ("+ partition: name %-22s size 0x%08llx offset 0x%08llx mask flags %d\n" , part->name, part->size, part->offset, part->mask_flags);
@@ -693,7 +693,7 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i* @param size a pointer to the size of the mtd device (output) * @return 0 if device is valid, 1 otherwise */ -static int mtd_device_validate (u8 type,u8 num,u32 *size) +static int mtd_device_validate (u8 type,u8 num,u64 *size) {struct mtd_info *mtd =NULL ;
@@ -1270,7 +1270,7 @@ static void print_partition_table(void)list_for_each (pentry, &dev->parts) { part = list_entry(pentry, struct part_info, link); -printf ("%2d: %-20s0x%08x\t0x%08x\t%d\n" , +printf ("%2d: %-20s0x%08llx\t0x%08llx\t%d\n" , part_num, part->name, part->size, part->offset, part->mask_flags);#endif /* defined(CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES) */
@@ -1297,7 +1297,7 @@ static void list_partitions(void)if (current_mtd_dev) { part =mtd_part_info (current_mtd_dev, current_mtd_partnum);if (part) { -printf ("\nactive partition: %s%d,%d - (%s) 0x%08x @ 0x%08x\n" , +printf ("\nactive partition: %s%d,%d - (%s) 0x%08llx @ 0x%08llx\n" ,MTD_DEV_TYPE (current_mtd_dev->id->type), current_mtd_dev->id->num, current_mtd_partnum, part->name, part->size, part->offset);
@@ -1397,7 +1397,7 @@ static int delete_partition(const char *id)if (find_dev_and_part (id, &dev, &pnum, &part) ==0 ) { -debug ("delete_partition: device = %s%d, partition %d = (%s) 0x%08x at 0x%08x\n" , +debug ("delete_partition: device = %s%d, partition %d = (%s) 0x%08llx at 0x%08llx\n" ,MTD_DEV_TYPE (dev->id->type), dev->id->num, pnum, part->name, part->size, part->offset);
@@ -1589,7 +1589,7 @@ static int parse_mtdids(const char *const ids)struct list_head *entry, *n;struct mtdids *id_tmp;u8 type, num; -u32 size; +u64 size;int ret =1 ;debug ("\n---parse_mtdids---\nmtdids = %s\n\n" , ids);
@@ -1663,7 +1663,7 @@ static int parse_mtdids(const char *const ids) id->mtd_id[mtd_id_len -1 ] ='\0' ;INIT_LIST_HEAD (&id->link); -debug ("+ id %s%d\t%16d bytes\t%s\n" , +debug ("+ id %s%d\t%16llu bytes\t%s\n" ,MTD_DEV_TYPE (id->type), id->num, id->size, id->mtd_id);
include/jffs2/load_kernel.h +3 -3
@@ -32,8 +32,8 @@ struct part_info {struct list_head link;char *name;/* partition name */ u8 auto_name;/* set to 1 for generated name */ -u32 size;/* total size of the partition */ -u32 offset;/* offset within device */ +u64 size;/* total size of the partition */ +u64 offset;/* offset within device */ void *jffs2_priv;/* used internaly by jffs2 */ u32 mask_flags;/* kernel MTD mask flags */ u32 sector_size;/* size of sector */
@@ -44,7 +44,7 @@ struct mtdids {struct list_head link;u8 type;/* device type */ u8 num;/* device number */ -u32 size;/* device size */ +u64 size;/* device size */ char *mtd_id;/* linux kernel device id */ };
Signature · 1 line
1.8.4.rc3
PATCH 1/2 mx28evk: Use 512k for fdt partition to align it
In reply to Otavio SalvadorDear Otavio Salvador,
Quoted 13 lines · In message <[email protected]> you…
Using 512k for fdt partition allow it to be aligned with the other small partitions and 512k erase block size.
Signed-off-by Otavio Salvador <[email protected]>--- include/configs/mx28evk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/configs/mx28evk.h +0
-0
include/configs/mx28evk.h line 102
Quoted 7 lines
include/configs/mx28evk.h +1
-1@@ -97,7 +97,7 @@"512k(environment)," \"512k(redundant-environment)," \"4m(kernel)," \ -"128k(fdt)," \ +"512k(fdt)," \"8m(ramdisk)," \"-(filesystem)"
Are you positively sure there is a 0.5 MiB erase block size?
Which exact NAND device is this?
Sorry for asking, there is no NAND at all on the mx28evk in our lab, so I really have no clue...
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If you're out of tree, you don't exist.
- David Woodhouse in <[email protected]>PATCH 1/2 mx28evk: Use 512k for fdt partition to align it
Quoted 26 lines · Wolfgang Denk
Dear Otavio Salvador,
Quoted 13 lines · In message <[email protected]> you…
Using 512k for fdt partition allow it to be aligned with the other small partitions and 512k erase block size.
Signed-off-by Otavio Salvador <[email protected]>--- include/configs/mx28evk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/configs/mx28evk.h +0
-0include/configs/mx28evk.h line 102
Quoted 7 lines
include/configs/mx28evk.h +1
-1@@ -97,7 +97,7 @@"512k(environment)," \"512k(redundant-environment)," \"4m(kernel)," \ -"128k(fdt)," \ +"512k(fdt)," \"8m(ramdisk)," \"-(filesystem)" Are you positively sure there is a 0.5 MiB erase block size?
Quoted 4 lines
Which exact NAND device is this?
Sorry for asking, there is no NAND at all on the mx28evk in our lab, so I really have no clue...
Sure; it does.
It is a 4G NAND.
The part# is K9LBG08U0D-PCB0
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750