diff mbox

[U-Boot,11/12] cmd_sf: Add QIOFR(Quad IO Fast Read) read instruction support

Message ID 1356956036-19908-1-git-send-email-jagannadh.teki@gmail.com
State Superseded
Delegated to: Mike Frysinger
Headers show

Commit Message

Jagan Teki Dec. 31, 2012, 12:13 p.m. UTC
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 <jagannadh.teki@gmail.com>
---
 common/cmd_sf.c          |    9 +++++++--
 include/spi_flash_inst.h |    1 +
 2 files changed, 8 insertions(+), 2 deletions(-)
diff mbox

Patch

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_ */