From patchwork Mon Aug 6 15:12:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 953949 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41kh7s2ZMjz9s3q for ; Tue, 7 Aug 2018 01:16:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1D17EC21E4E; Mon, 6 Aug 2018 15:14:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8D25CC21E4E; Mon, 6 Aug 2018 15:13:39 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 85AF3C21E7D; Mon, 6 Aug 2018 15:13:02 +0000 (UTC) Received: from mx2.mailbox.org (mx2.mailbox.org [80.241.60.215]) by lists.denx.de (Postfix) with ESMTPS id 22F55C21E96 for ; Mon, 6 Aug 2018 15:12:57 +0000 (UTC) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id E278541103; Mon, 6 Aug 2018 17:12:56 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id 6_GTuJ-TC5Lm; Mon, 6 Aug 2018 17:12:55 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Date: Mon, 6 Aug 2018 17:12:53 +0200 Message-Id: <20180806151253.31205-4-sr@denx.de> In-Reply-To: <20180806151253.31205-1-sr@denx.de> References: <20180806151253.31205-1-sr@denx.de> Cc: Boris Brezillon , Jagan Teki , Miquel Raynal Subject: [U-Boot] [PATCH 4/4] cmd: mtd: Add info text to mtd erase subcommand X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 (65536 page(s)) nand: attempt to erase a bad/reserved block @6000000 nand: attempt to erase a bad/reserved block @7fe0000 Signed-off-by: Stefan Roese Cc: Miquel Raynal Cc: Boris Brezillon Cc: Jagan Teki --- cmd/mtd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/mtd.c b/cmd/mtd.c index 38a89736cf..6d27698d1e 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 EINVAL; } + printf("Erasing 0x%08llx ... 0x%08llx (%d page(s))\n", + off, off + len - 1, mtd_len_to_pages(mtd, len)); + erase_op.mtd = mtd; erase_op.addr = off; erase_op.len = len;