From patchwork Wed Dec 19 16:27:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 207452 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 9DB6D2C0097 for ; Thu, 20 Dec 2012 03:28:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 70B6A4A051; Wed, 19 Dec 2012 17:28:36 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3PS5gbVrLXgA; Wed, 19 Dec 2012 17:28:36 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C2FDC4A03B; Wed, 19 Dec 2012 17:28:26 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BC8F64A026 for ; Wed, 19 Dec 2012 17:28:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8lcUqYCk9oms for ; Wed, 19 Dec 2012 17:28:17 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-da0-f41.google.com (mail-da0-f41.google.com [209.85.210.41]) by theia.denx.de (Postfix) with ESMTPS id A2CCE4A01F for ; Wed, 19 Dec 2012 17:28:14 +0100 (CET) Received: by mail-da0-f41.google.com with SMTP id e20so1006394dak.14 for ; Wed, 19 Dec 2012 08:28:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=87FX0cUyZebpj2CBzA1Jqnwm7B9xJ38984ILJfc+jrs=; b=QaEwX78joJGOOfHOK+U3lPm6BumF/RxaZyofBTAbvXq60bcIn7l7/DtxIYdrHdEoRo HJTVEcXCFA66p1TOzRjerTWHMR0afemOmH+gC1kXfziaXx7qBerdIWgvKrXrwZVGrFTZ kkta3FvXExLo3r2W/rGt4uoddwHaCRBnQjWMR/S6bOFBmPmWFbkYYLidRPrh2UB0q5qB T8gxqlG8Fgs8hKMrV3xMhHFXLo6Y+xv28mDSuRm1bWDcUbYNnJCOFgbnnyjGIOEUGjrr Uc8Z8gjaBHxmyJKgKkW9wHbdqAcsCFVvfYYJtMu5fyRGEL7nHOrTz48quIT724iHUaSQ vEsw== X-Received: by 10.68.227.41 with SMTP id rx9mr19990679pbc.121.1355934490142; Wed, 19 Dec 2012 08:28:10 -0800 (PST) Received: from localhost.localdomain ([123.237.83.48]) by mx.google.com with ESMTPS id z5sm3683430pax.9.2012.12.19.08.28.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Dec 2012 08:28:08 -0800 (PST) From: Jagannadha Sutradharudu Teki To: u-boot@lists.denx.de Date: Wed, 19 Dec 2012 21:57:38 +0530 Message-Id: <1355934463-24319-1-git-send-email-jagannadh.teki@gmail.com> X-Mailer: git-send-email 1.7.0.4 Subject: [U-Boot] [U-Boot, v2 1/6] cmd_sf: Add print messages on flash erase command X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This patch adds a print messages while using 'sf erase' command to make sure that how many bytes erased in flash device. Signed-off-by: Jagannadha Sutradharudu Teki --- Changes in v2: Move print messages from spi_flash.c into cmd_sf.c common/cmd_sf.c | 11 ++++++----- drivers/mtd/spi/spi_flash.c | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/common/cmd_sf.c b/common/cmd_sf.c index 5ac1d0c..ddb1a65 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -266,13 +266,14 @@ static int do_spi_flash_erase(int argc, char * const argv[]) return 1; } + printf("SF: Erasing flash... "); + ret = spi_flash_erase(flash, offset, len); - if (ret) { - printf("SPI flash %s failed\n", argv[0]); - return 1; - } - return 0; + printf("%zu bytes @ %#x erased: %s\n", (size_t)len, (u32)offset, + ret ? "ERROR" : "OK"); + + return ret == 0 ? 0 : 1; } static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 00aece9..43e0334 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -235,8 +235,6 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len) goto out; } - debug("SF: Successfully erased %zu bytes @ %#x\n", len, start); - out: spi_release_bus(flash->spi); return ret;