From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4 v2] cmd: mtd: Add info text to mtd erase subcommand
Date: Tue, 7 Aug 2018 14:16:55 +0200 [thread overview]
Message-ID: <20180807121655.22346-4-sr@denx.de> (raw)
In-Reply-To: <20180807121655.22346-1-sr@denx.de>
Adding this info helps seeing, what really is being erased - especially
if no arguments are passed for offset and size. Now this is the
output:
=> mtd erase spi-nand0
Erasing 0x00000000 ... 0x07ffffff (1024 eraseblock(s))
nand: attempt to erase a bad/reserved block @6000000
nand: attempt to erase a bad/reserved block @7fe0000
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Jagan Teki <jagan@openedev.com>
---
v2:
- Print number of eraseblocks instead of pages as suggested by Boris
cmd/mtd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/cmd/mtd.c b/cmd/mtd.c
index b29aec18ca..7dc77edf28 100644
--- a/cmd/mtd.c
+++ b/cmd/mtd.c
@@ -355,6 +355,9 @@ static int do_mtd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_FAILURE;
}
+ printf("Erasing 0x%08llx ... 0x%08llx (%d eraseblock(s))\n",
+ off, off + len - 1, mtd_div_by_eb(len, mtd));
+
erase_op.mtd = mtd;
erase_op.addr = off;
erase_op.len = len;
--
2.18.0
next prev parent reply other threads:[~2018-08-07 12:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 12:16 [U-Boot] [PATCH 1/4 v2] spi: spi-mem: Use 2 SPI messages instead of a single full-duplex one Stefan Roese
2018-08-07 12:16 ` [U-Boot] [PATCH 2/4 v2] cmd: mtd: Don't abort erase operation when a bad block is detected Stefan Roese
2018-08-07 13:05 ` Boris Brezillon
2018-08-07 12:16 ` [U-Boot] [PATCH 3/4 v2] cmd: mtd: Don't use with negative return codes for shell commands Stefan Roese
2018-08-07 13:29 ` Boris Brezillon
2018-08-07 12:16 ` Stefan Roese [this message]
2018-08-07 13:32 ` [U-Boot] [PATCH 4/4 v2] cmd: mtd: Add info text to mtd erase subcommand Boris Brezillon
2018-08-07 13:38 ` Stefan Roese
2018-08-07 13:28 ` [U-Boot] [PATCH 1/4 v2] spi: spi-mem: Use 2 SPI messages instead of a single full-duplex one Boris Brezillon
2018-08-08 8:56 ` Miquel Raynal
2018-08-09 5:24 ` Stefan Roese
2018-08-09 8:13 ` Miquel Raynal
2018-08-09 9:10 ` Stefan Roese
2018-08-09 14:50 ` Miquel Raynal
2018-08-09 14:53 ` Stefan Roese
2018-08-08 9:58 ` Miquel Raynal
2018-08-09 5:25 ` Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180807121655.22346-4-sr@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox