]> Git Repo - u-boot.git/commitdiff
sf: Read back and check once spansion quad bit set
authorJagan Teki <[email protected]>
Tue, 15 Dec 2015 06:58:39 +0000 (12:28 +0530)
committerJagan Teki <[email protected]>
Wed, 13 Jan 2016 13:17:26 +0000 (18:47 +0530)
One spansion quad bit set using CR, it's good to
read back and check the written bit and also if
it's already been set check for the bit and return.

Cc: Vignesh R <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Siva Durga Prasad Paladugu <[email protected]>
Tested-by: Mugunthan V N <[email protected]>
Signed-off-by: Jagan Teki <[email protected]>
drivers/mtd/spi/spi_flash.c

index d9124c5fc572f134bf8c1bd2b5d1b8982a710bb7..b7c0da46a251cb06494fa7d133456dd5e0a2ba62 100644 (file)
@@ -862,12 +862,18 @@ static int spansion_quad_enable(struct spi_flash *flash)
        if (ret < 0)
                return ret;
 
-       if (qeb_status & STATUS_QEB_WINSPAN) {
-               debug("SF: winspan: QEB is already set\n");
-       } else {
-               ret = write_cr(flash, STATUS_QEB_WINSPAN);
-               if (ret < 0)
-                       return ret;
+       if (qeb_status & STATUS_QEB_WINSPAN)
+               return 0;
+
+       ret = write_cr(flash, STATUS_QEB_WINSPAN);
+       if (ret < 0)
+               return ret;
+
+       /* read CR and check it */
+       ret = read_cr(flash, &qeb_status);
+       if (!(ret >= 0 && (qeb_status & STATUS_QEB_WINSPAN))) {
+               printf("SF: Spansion CR Quad bit not clear\n");
+               return -EINVAL;
        }
 
        return ret;
This page took 0.032064 seconds and 4 git commands to generate.