Skip to contentSkip to conversation

sf: Pass rd_qeb_req variable as 0 for status and config reg reads

PATCH Superseded Jagannadha Sutradharudu Teki 2 participants 2 messages Dec 31, 2012 – Jan 11, 2013 Memory technology devices (MTD)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 12/12 sf: Pass rd_qeb_req variable as 0 for status and config reg reads

Config and Status register reads doesn't require to set the quad enable bit, hence rd_qeb_req variable passed as 0.

---
 drivers/mtd/spi/spi_flash.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/mtd/spi/spi_flash.c +4 -2
index 15ad05c..7a15a69 100644
@@ -293,7 +293,8 @@ int spi_flash_cmd_read_status(struct spi_flash *flash, void *data)
 	int ret;
 
 	cmd = CMD_READ_STATUS;
-	ret = spi_flash_read_common(flash, &cmd, sizeof(cmd), (void *)data, 1);
+	ret = spi_flash_read_common(flash, &cmd, 0,
+				sizeof(cmd), (void *)data, 1);
 	if (ret < 0) {
 		debug("SF: fail to read status register\n");
 		return ret;
@@ -343,7 +344,8 @@ int spi_flash_cmd_read_config(struct spi_flash *flash, void *data)
 	int ret;
 
 	cmd = CMD_READ_CONFIG;
-	ret = spi_flash_read_common(flash, &cmd, sizeof(cmd), (void *)data, 1);
+	ret = spi_flash_read_common(flash, &cmd, 0,
+				sizeof(cmd), (void *)data, 1);
 	if (ret < 0) {
 		debug("SF: fail to read config register\n");
 		return ret;
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 12/12 sf: Pass rd_qeb_req variable as 0 for status and config reg reads

Hi Jagannadha,

Quoted 4 lines · Jagannadha Sutradharudu Teki

Config and Status register reads doesn't require to set the quad enable bit, hence rd_qeb_req variable passed as 0.

A few more general comments:

Please can you look at enhancing 'sf test' to support your modes. Then we can run 'sf test' and test which ones work.

I wonder if we should something to help with things like spi_flash_read_common(flash, &cmd, sizeof(cmd), (void *)data, 1);

Perhaps you should define spi_flash_xfer_byte(flash, int cmd, int *resp)

which writes a single byte command and reads a single byte response?

Regards,
Simon

Quoted 35 lines
---
 drivers/mtd/spi/spi_flash.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/mtd/spi/spi_flash.c +4 -3
index 15ad05c..7a15a69 100644
@@ -293,7 +293,8 @@ int spi_flash_cmd_read_status(struct spi_flash *flash, void *data)
        int ret;
 
        cmd = CMD_READ_STATUS;
-       ret = spi_flash_read_common(flash, &cmd, sizeof(cmd), (void *)data, 1);
+       ret = spi_flash_read_common(flash, &cmd, 0,
+                               sizeof(cmd), (void *)data, 1);
        if (ret < 0) {
                debug("SF: fail to read status register\n");
                return ret;
@@ -343,7 +344,8 @@ int spi_flash_cmd_read_config(struct spi_flash *flash, void *data)
        int ret;
 
        cmd = CMD_READ_CONFIG;
-       ret = spi_flash_read_common(flash, &cmd, sizeof(cmd), (void *)data, 1);
+       ret = spi_flash_read_common(flash, &cmd, 0,
+                               sizeof(cmd), (void *)data, 1);
        if (ret < 0) {
                debug("SF: fail to read config register\n");
                return ret;
--

1.7.0.4

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot