[U-Boot] [PATCH 4/4 v2] cmd: mtd: Add info text to mtd erase subcommand

Stefan Roese
2018-08-07T13:38:00Z

Hi Boris,

On 07.08.2018 15:32, Boris Brezillon wrote:
> Hi Stefan,
>
> On Tue, 7 Aug 2018 14:16:55 +0200
> Stefan Roese <sr@denx.de> wrote:
>
>> 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;
>
> Hm, you might want to tell the user where the request failed (when it
> failed).
>
> Also, maybe we should squash your changes in Miquel's commits since
> the series has not been merged yet. Unless you'd like to keep them
> separate.

Squashing them would be just fine with me. I won't find much time
today to rework the remaining patches but will do so most likely
tomorrow. Please stay tuned and many thanks for the really helpful
reviews.

Thanks,
Stefan