From patchwork Mon Dec 31 12:13:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 208844 X-Patchwork-Delegate: vapier@gentoo.org 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 AF14F2C00A7 for ; Mon, 31 Dec 2012 23:14:18 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2B5CF4A14C; Mon, 31 Dec 2012 13:14:17 +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 SczJBzKVsh0h; Mon, 31 Dec 2012 13:14:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 11DF84A125; Mon, 31 Dec 2012 13:14:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 174604A125 for ; Mon, 31 Dec 2012 13:14:14 +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 nildhmD8-TkD for ; Mon, 31 Dec 2012 13:14:13 +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-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by theia.denx.de (Postfix) with ESMTPS id B8D9F4A11C for ; Mon, 31 Dec 2012 13:14:10 +0100 (CET) Received: by mail-pa0-f51.google.com with SMTP id fb11so7152326pad.10 for ; Mon, 31 Dec 2012 04:14:09 -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=aqQQNBLgSkb/V86gMTL4Fd6+YXlHnejOH6TaMgkdhSI=; b=q/DlpD7NrdwYQX08p5zwk7p8eq4dV9TKQom7xoEQDBiurMfPII9PYft6vQ61E77J4E BwTM4BjA9xJpDzfeql3pFQ8bxAf1766D1xnPOq3pD7uybFrzMoNTOJRLBRBDLNnfk1H7 2XqQN0v64sl9v8T3NfUqBCzSg/MkKhw8pftDfJMl6eizJxfL9FBg6se1IPsi+AyNXY1q w1H15MdAeJP56QVMejZsePzg+z7qlYeVYyAHQJlrtqg0tRA3m4H3mdrf5aVjdGzz1tDA 6TkePY5nqoM6KBqdeTJ837Bf/XO5fY12zMl/efnRkYFJ7u76gk1T8v+e9ub/gdd6Ndws OgvA== X-Received: by 10.66.84.195 with SMTP id b3mr120698756paz.30.1356956049414; Mon, 31 Dec 2012 04:14:09 -0800 (PST) Received: from localhost.localdomain ([49.204.11.250]) by mx.google.com with ESMTPS id wr4sm24780360pbc.72.2012.12.31.04.14.07 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 31 Dec 2012 04:14:08 -0800 (PST) From: Jagannadha Sutradharudu Teki To: u-boot@lists.denx.de Date: Mon, 31 Dec 2012 17:43:56 +0530 Message-Id: <1356956036-19908-1-git-send-email-jagannadh.teki@gmail.com> X-Mailer: git-send-email 1.7.0.4 Subject: [U-Boot] [PATCH 11/12] cmd_sf: Add QIOFR(Quad 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 'qiofr' read instruction(rd_inst) for 'sf read' and 'sf update' commands. 'qiofr' is similar to the qofr(Quad Output Fast Read) except that it improves performance throughput by allowing input of the address bits using four bits per SCK via four input pins. Example: read 0x2000 length bytes starting at offset 0x0 to memory at 0x10000 using qiofr read instruction. u-boot> sf read qiofr 0x10000 0x0 0x2000 erase and write 0x2000 length bytes from memory at 0x10000 address to flash offset at 0x0 using pp write instruction and qiofr read instruction. u-boot> sf update pp qiofr 0x10000 0x0 0x2000 Signed-off-by: Jagannadha Sutradharudu Teki --- common/cmd_sf.c | 9 +++++++-- include/spi_flash_inst.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common/cmd_sf.c b/common/cmd_sf.c index 5ced1cc..cd76f28 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -295,7 +295,10 @@ static int sf_parse_rd_inst_arg(char *arg, u8 *rd_inst, u8 *rd_qeb_req) *rd_qeb_req = 1; } else if (strcmp(arg, "diofr") == 0) *rd_inst = CMD_READ_DUAL_IO_FAST; - else + else if (strcmp(arg, "qiofr") == 0) { + *rd_inst = CMD_READ_QUAD_IO_FAST; + *rd_qeb_req = 1; + } else return 1; return 0; @@ -651,6 +654,7 @@ U_BOOT_CMD( " dofr (Dual Output Fast Read, 3bh)\n" " qofr (Quad Output Fast Read, 6bh)\n" " diofr (Dual Input/Output Fast Read, bbh)\n" + " qiofr (Quad Input/Output Fast Read, ebh)\n" "sf write wr_inst addr offset len\n" " - write `len' bytes from memory\n" " at `addr' to flash at `offset' using\n" @@ -670,6 +674,7 @@ U_BOOT_CMD( " 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)" + " diofr (Dual Input/Output Fast Read, bbh)\n" + " qiofr (Quad Input/Output Fast Read, ebh)" SF_TEST_HELP ); diff --git a/include/spi_flash_inst.h b/include/spi_flash_inst.h index e718e8e..556e179 100644 --- a/include/spi_flash_inst.h +++ b/include/spi_flash_inst.h @@ -34,5 +34,6 @@ #define CMD_READ_DUAL_OUTPUT_FAST 0x3b #define CMD_READ_QUAD_OUTPUT_FAST 0x6b #define CMD_READ_DUAL_IO_FAST 0xbb +#define CMD_READ_QUAD_IO_FAST 0xeb #endif /* _SPI_FLASH_INST_H_ */