diff --exclude CVS -uNr mtd-utils/mtd_debug.c mtd-utils.modified/mtd_debug.c --- mtd-utils/mtd_debug.c 2008-06-18 17:16:40.000000000 -0400 +++ mtd-utils.modified/mtd_debug.c 2010-03-06 15:25:10.000000000 -0500 @@ -47,6 +47,14 @@ } /* + * ECCGETLAYOUT + */ +static int eccgetlayout (int fd,struct nand_ecclayout *ecclayout) +{ + return (ioctl (fd,ECCGETLAYOUT,ecclayout)); +} + +/* * MEMERASE */ static int memerase (int fd,struct erase_info_user *erase) @@ -328,6 +336,38 @@ printf ("\nmtd.oobsize = "); printsize (mtd.oobsize); + if (mtd.type == MTD_NANDFLASH) { + struct nand_ecclayout ecclayout; + + err = eccgetlayout (fd,&ecclayout); + if (err < 0) + { + perror ("ECCGETLAYOUT"); + return (1); + } + printf("\necclayout = {\n\teccbytes = %d,\n", ecclayout.eccbytes); + if (ecclayout.eccbytes) { + printf("\teccpos = { "); + for (i=0; i