flash/nor: use target_addr_t for flash bank base
[openocd.git] / src / flash / nor / cfi.c
index a2db50f3322fde08d958cded4fa499db99cf9520..163862817066b6d1d9113f89d1bff4e162cd3cfc 100644 (file)
@@ -889,8 +889,8 @@ static int cfi_intel_erase(struct flash_bank *bank, int first, int last)
                        if (retval != ERROR_OK)
                                return retval;
 
-                       LOG_ERROR("couldn't erase block %i of flash bank at base 0x%"
-                                       PRIx32, i, bank->base);
+                       LOG_ERROR("couldn't erase block %i of flash bank at base "
+                                       TARGET_ADDR_FMT, i, bank->base);
                        return ERROR_FLASH_OPERATION_FAILED;
                }
        }
@@ -937,8 +937,8 @@ static int cfi_spansion_erase(struct flash_bank *bank, int first, int last)
                        if (retval != ERROR_OK)
                                return retval;
 
-                       LOG_ERROR("couldn't erase block %i of flash bank at base 0x%"
-                               PRIx32, i, bank->base);
+                       LOG_ERROR("couldn't erase block %i of flash bank at base "
+                               TARGET_ADDR_FMT, i, bank->base);
                        return ERROR_FLASH_OPERATION_FAILED;
                }
        }
@@ -2001,8 +2001,9 @@ static int cfi_intel_write_word(struct flash_bank *bank, uint8_t *word, uint32_t
                if (retval != ERROR_OK)
                        return retval;
 
-               LOG_ERROR("couldn't write word at base 0x%" PRIx32 ", address 0x%" PRIx32,
-                       bank->base, address);
+               LOG_ERROR("couldn't write word at base " TARGET_ADDR_FMT
+                               ", address 0x%" PRIx32,
+                               bank->base, address);
                return ERROR_FLASH_OPERATION_FAILED;
        }
 
@@ -2026,9 +2027,9 @@ static int cfi_intel_write_words(struct flash_bank *bank, const uint8_t *word,
 
        /* Check for valid range */
        if (address & buffermask) {
-               LOG_ERROR("Write address at base 0x%" PRIx32 ", address 0x%" PRIx32
-                       " not aligned to 2^%d boundary",
-                       bank->base, address, cfi_info->max_buf_write_size);
+               LOG_ERROR("Write address at base " TARGET_ADDR_FMT ", address 0x%"
+                               PRIx32 " not aligned to 2^%d boundary",
+                               bank->base, address, cfi_info->max_buf_write_size);
                return ERROR_FLASH_OPERATION_FAILED;
        }
 
@@ -2056,7 +2057,8 @@ static int cfi_intel_write_words(struct flash_bank *bank, const uint8_t *word,
                        return retval;
 
                LOG_ERROR(
-                       "couldn't start buffer write operation at base 0x%" PRIx32 ", address 0x%" PRIx32,
+                       "couldn't start buffer write operation at base " TARGET_ADDR_FMT
+                       ", address 0x%" PRIx32,
                        bank->base,
                        address);
                return ERROR_FLASH_OPERATION_FAILED;
@@ -2085,7 +2087,7 @@ static int cfi_intel_write_words(struct flash_bank *bank, const uint8_t *word,
                if (retval != ERROR_OK)
                        return retval;
 
-               LOG_ERROR("Buffer write at base 0x%" PRIx32
+               LOG_ERROR("Buffer write at base " TARGET_ADDR_FMT
                        ", address 0x%" PRIx32 " failed.", bank->base, address);
                return ERROR_FLASH_OPERATION_FAILED;
        }
@@ -2121,7 +2123,7 @@ static int cfi_spansion_write_word(struct flash_bank *bank, uint8_t *word, uint3
                if (retval != ERROR_OK)
                        return retval;
 
-               LOG_ERROR("couldn't write word at base 0x%" PRIx32
+               LOG_ERROR("couldn't write word at base " TARGET_ADDR_FMT
                        ", address 0x%" PRIx32, bank->base, address);
                return ERROR_FLASH_OPERATION_FAILED;
        }
@@ -2147,7 +2149,7 @@ static int cfi_spansion_write_words(struct flash_bank *bank, const uint8_t *word
 
        /* Check for valid range */
        if (address & buffermask) {
-               LOG_ERROR("Write address at base 0x%" PRIx32
+               LOG_ERROR("Write address at base " TARGET_ADDR_FMT
                        ", address 0x%" PRIx32 " not aligned to 2^%d boundary",
                        bank->base, address, cfi_info->max_buf_write_size);
                return ERROR_FLASH_OPERATION_FAILED;
@@ -2193,7 +2195,7 @@ static int cfi_spansion_write_words(struct flash_bank *bank, const uint8_t *word
                if (retval != ERROR_OK)
                        return retval;
 
-               LOG_ERROR("couldn't write block at base 0x%" PRIx32
+               LOG_ERROR("couldn't write block at base " TARGET_ADDR_FMT
                        ", address 0x%" PRIx32 ", size 0x%" PRIx32, bank->base, address,
                        bufferwsize);
                return ERROR_FLASH_OPERATION_FAILED;

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)