Michael Schwingen <rincewind@discworld.dascon.de> add non-CFI SST flashs
[openocd.git] / src / flash / cfi.c
index 0426fd2e6f144b3104f5ef6f57a30527f40df186..b4bb605339e9076c732909de4dca69d6e50cfa55 100644 (file)
@@ -296,13 +296,14 @@ u8 cfi_intel_wait_status_busy(flash_bank_t *bank, int timeout)
 int cfi_spansion_wait_status_busy(flash_bank_t *bank, int timeout)
 {
        u8 status, oldstatus;
+       cfi_flash_bank_t *cfi_info = bank->driver_priv;
 
        oldstatus = cfi_get_u8(bank, 0, 0x0);
 
        do {
                status = cfi_get_u8(bank, 0, 0x0);
                if ((status ^ oldstatus) & 0x40) {
-                       if (status & 0x20) {
+                       if (status & cfi_info->status_poll_mask & 0x20) {
                                oldstatus = cfi_get_u8(bank, 0, 0x0);
                                status = cfi_get_u8(bank, 0, 0x0);
                                if ((status ^ oldstatus) & 0x40) {
@@ -313,7 +314,7 @@ int cfi_spansion_wait_status_busy(flash_bank_t *bank, int timeout)
                                        return(ERROR_OK);
                                }
                        }
-               } else {
+               } else { /* no toggle: finished, OK */
                        LOG_DEBUG("status: 0x%x", status);
                        return(ERROR_OK);
                }
@@ -2283,6 +2284,7 @@ static int cfi_probe(struct flash_bank_s *bank)
                                break;
                        /* AMD/Spansion, Atmel, ... command set */
                        case 0x0002:
+                               cfi_info->status_poll_mask = CFI_STATUS_POLL_MASK_DQ5_DQ6_DQ7; /* default for all CFI flashs */
                                cfi_read_0002_pri_ext(bank);
                                break;
                        default:
@@ -2303,7 +2305,7 @@ static int cfi_probe(struct flash_bank_s *bank)
                {
                        return retval;
                }
-       }
+       } /* end CFI case */
 
        /* apply fixups depending on the primary command set */
        switch(cfi_info->pri_id)

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)