]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: nand: Show reserved block in chip.erase
authorMichael Trimarchi <michael@amarulasolutions.com>
Mon, 27 Feb 2023 15:01:43 +0000 (16:01 +0100)
committerDario Binacchi <dario.binacchi@amarulasolutions.com>
Mon, 27 Feb 2023 15:30:13 +0000 (16:30 +0100)
The "nand chip.erase" command always printed as bad blocks even in the
case of reserved blocks. Reserved blocks are used for storing bad block
tables. The patch displays "bbt reserved" when printing reserved blocks in
"nand chip.erase" command.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
drivers/mtd/nand/raw/nand_util.c

index b2345dca7f71f233585b90c7ecb863436a623474..72cc24f40376eb95349c3984f0c32bb12ebb5a97 100644 (file)
@@ -113,9 +113,10 @@ int nand_erase_opts(struct mtd_info *mtd,
                        int ret = mtd_block_isbad(mtd, erase.addr);
                        if (ret > 0) {
                                if (!opts->quiet)
-                                       printf("\rSkipping bad block at  "
+                                       printf("\rSkipping %s at  "
                                               "0x%08llx                 "
                                               "                         \n",
+                                              ret == 1 ? "bad block" : "bbt reserved",
                                               erase.addr);
 
                                if (!opts->spread)