From patchwork Mon Dec 31 12:45:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 208853 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 2A44D2C00A7 for ; Mon, 31 Dec 2012 23:45:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B3A2E4A14D; Mon, 31 Dec 2012 13:45:31 +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 nxEwvSwVx0Jn; Mon, 31 Dec 2012 13:45:31 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AA1474A151; Mon, 31 Dec 2012 13:45:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1BFEF4A14D for ; Mon, 31 Dec 2012 13:45:27 +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 OWYshiR2L9Qe for ; Mon, 31 Dec 2012 13:45:26 +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-f46.google.com (mail-da0-f46.google.com [209.85.210.46]) by theia.denx.de (Postfix) with ESMTPS id 08DAB4A14C for ; Mon, 31 Dec 2012 13:45:24 +0100 (CET) Received: by mail-da0-f46.google.com with SMTP id p5so5716926dak.5 for ; Mon, 31 Dec 2012 04:45:22 -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=RgIs6vwDMP1x2nE7y1hjjfYNjX2IAC331gjfumU1S4k=; b=CBLna6E+O/np3IZDTpaqrQGESKCil8pgX1Lr9LK8MVL6K8jNO9FbG/qEBEzEYFT5Qs gUZ/Nd5TVPc660WDEGB2Ygt0utvDOeeDJOpAruVxcKbiwUw+NaKnEqf4QO6nKRxnKI+L g2KLceKt8ew5bA0AkkyIYroLdIqYhHVHoNmd6wnv6HfvaerPFChazP2tr5A5m9C+W/xR 6XaEs+76u6Vl4Eb/xcK5Cbk9qlXaR3UJMXhmKDW4hpOgxlZM7Zr5ZQ2DQynQBCpalcl6 OSZ+u+zpqzBOPHSgD41vd9XIOGCPZBvOGSOw1SqiYPIqC+9MTR9grId6H2QnF4LXOdKy IFxg== X-Received: by 10.68.125.195 with SMTP id ms3mr126282296pbb.149.1356957922609; Mon, 31 Dec 2012 04:45:22 -0800 (PST) Received: from localhost.localdomain ([49.204.11.250]) by mx.google.com with ESMTPS id ov4sm24823864pbb.45.2012.12.31.04.45.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 31 Dec 2012 04:45:21 -0800 (PST) From: Jagannadha Sutradharudu Teki To: u-boot@lists.denx.de Date: Mon, 31 Dec 2012 18:15:08 +0530 Message-Id: <1356957909-20863-1-git-send-email-jagannadh.teki@gmail.com> X-Mailer: git-send-email 1.7.0.4 Subject: [U-Boot] [PATCH v2 1/2] cmd_sf: Add DIOFR(Dual IO Fast Read) read instruction support 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 provides a support to read a flash using 'diofr' read instruction(rd_inst) for 'sf read' and 'sf update' commands. 'diofr' is similar to the dofr(Dual Output Fast Read) except that it improves performance throughput by allowing input of the address bits using two bits per SCK via two input pins. Example: read 0x2000 length bytes starting at offset 0x0 to memory at 0x10000 using diofr read instruction. u-boot> sf read diofr 0x10000 0x0 0x2000 erase and write 0x2000 length bytes from memory at 0x10000 address to flash offset at 0x0 using pp write instruction and diofr read instruction. u-boot> sf update pp diofr 0x10000 0x0 0x2000 Signed-off-by: Jagannadha Sutradharudu Teki --- Changes in v2: Added command help on U_BOOT_CMD common/cmd_sf.c | 12 ++++++++---- include/spi_flash_inst.h | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/common/cmd_sf.c b/common/cmd_sf.c index a07effd..20879e7 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -293,7 +293,9 @@ static int sf_parse_rd_inst_arg(char *arg, u8 *rd_inst, u8 *rd_qeb_req) else if (strcmp(arg, "qofr") == 0) { *rd_inst = CMD_READ_QUAD_OUTPUT_FAST; *rd_qeb_req = 1; - } else + } else if (strcmp(arg, "diofr") == 0) + *rd_inst = CMD_READ_DUAL_IO_FAST; + else return 1; return 0; @@ -643,11 +645,12 @@ U_BOOT_CMD( "sf read rd_inst addr offset len\n" " - read `len' bytes starting at\n" " `offset' to memory at `addr' using\n" - " afr | asr | dofr | qofr `rd_inst' read instructions\n" + " afr | asr | dofr | qofr | diofr `rd_inst' read instructions\n" " afr (Array Fast Read, 0bh)\n" " asr (Array Slow Read, 02b)\n" " dofr (Dual Output Fast Read, 3bh)\n" " qofr (Quad Output Fast Read, 6bh)\n" + " diofr (Dual Input/Output Fast Read, bbh)\n" "sf write wr_inst addr offset len\n" " - write `len' bytes from memory\n" " at `addr' to flash at `offset' using\n" @@ -662,10 +665,11 @@ U_BOOT_CMD( " pp | qpp `wr_inst' write instructions and\n" " pp (Page Program, 02h)\n" " qpp (Quad Page Program, 32h)\n" - " afr | asr | dofr | qofr `rd_inst' read instructions\n" + " afr | asr | dofr | qofr | diofr `rd_inst' read instructions\n" " afr (Array Fast Read, 0bh)\n" " asr (Array Slow Read, 02b)\n" " dofr (Dual Output Fast Read, 3bh)\n" - " qofr (Quad Output Fast Read, 6bh)" + " qofr (Quad Output Fast Read, 6bh)\n" + " diofr (Dual Input/Output Fast Read, bbh)" SF_TEST_HELP ); diff --git a/include/spi_flash_inst.h b/include/spi_flash_inst.h index 67b22c8..e718e8e 100644 --- a/include/spi_flash_inst.h +++ b/include/spi_flash_inst.h @@ -33,5 +33,6 @@ #define CMD_READ_ARRAY_SLOW 0x03 #define CMD_READ_DUAL_OUTPUT_FAST 0x3b #define CMD_READ_QUAD_OUTPUT_FAST 0x6b +#define CMD_READ_DUAL_IO_FAST 0xbb #endif /* _SPI_FLASH_INST_H_ */