summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-11-06 09:32:54 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-11-10 08:42:29 +0100
commitc03481bfcb29abfebf62e491a60caa0ebfb57a36 (patch)
tree9971af05edc84f71df5f64211c2a94c4e0dd2691 /commands
parent3376ed2b01dc8d43d268a5778ddfe58e73622caf (diff)
downloadbarebox-c03481bfcb29abfebf62e491a60caa0ebfb57a36.tar.gz
barebox-c03481bfcb29abfebf62e491a60caa0ebfb57a36.tar.xz
nand command: Print OOB information
NAND mtd devices carry information how the OOB area is used. So far there is no way to visualize it, so print it along with other NAND informations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/nand.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/commands/nand.c b/commands/nand.c
index ed2864fb7b..67e43eba30 100644
--- a/commands/nand.c
+++ b/commands/nand.c
@@ -13,6 +13,7 @@
#include <ioctl.h>
#include <nand.h>
#include <linux/mtd/mtd-abi.h>
+#include <linux/mtd/mtd.h>
#include <fcntl.h>
#include <libgen.h>
@@ -130,6 +131,8 @@ static int do_nand(int argc, char *argv[])
loff_t ofs;
int bad = 0;
+ printf("---- bad blocks ----\n");
+
for (ofs = 0; ofs < mtdinfo.size; ofs += mtdinfo.erasesize) {
if (ioctl(fd, MEMGETBADBLOCK, &ofs)) {
printf("Block at 0x%08llx is bad\n", ofs);
@@ -139,6 +142,8 @@ static int do_nand(int argc, char *argv[])
if (!bad)
printf("No bad blocks\n");
+
+ mtd_print_oob_info(mtdinfo.mtd);
}
out: