aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2021-08-07 21:55:30 +0300
committerAntonio Borneo <borneo.antonio@gmail.com>2022-08-27 16:13:07 +0000
commit66d6f9a1e7c977faed71cf7fef977124a5edee7e (patch)
tree37a7efa04847187c78aceae4a62a15c9f7e7fb22 /src
parentf77c919cf4dd25d3540bdef7d0bf60f5b84d5dd6 (diff)
downloadriscv-openocd-66d6f9a1e7c977faed71cf7fef977124a5edee7e.zip
riscv-openocd-66d6f9a1e7c977faed71cf7fef977124a5edee7e.tar.gz
riscv-openocd-66d6f9a1e7c977faed71cf7fef977124a5edee7e.tar.bz2
flash: nor: use binary prefixes consistently
When printing memory sizes standard ISO 80000-1 prefixes should be used. Also a space should be added between any number and its unit according to papers publication rules. Change-Id: Id1d35e210766b55c201de4e80ac165d8d0414d0a Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/6416 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/flash/nor/efm32.c4
-rw-r--r--src/flash/nor/em357.c2
-rw-r--r--src/flash/nor/kinetis.c6
-rw-r--r--src/flash/nor/pic32mx.c2
-rw-r--r--src/flash/nor/psoc4.c4
-rw-r--r--src/flash/nor/stm32f1x.c2
-rw-r--r--src/flash/nor/stm32f2x.c2
-rw-r--r--src/flash/nor/stm32l4x.c2
-rw-r--r--src/flash/nor/stmqspi.c28
-rw-r--r--src/flash/nor/w600.c2
10 files changed, 27 insertions, 27 deletions
diff --git a/src/flash/nor/efm32.c b/src/flash/nor/efm32.c
index 54fdbd8..04b03c7 100644
--- a/src/flash/nor/efm32.c
+++ b/src/flash/nor/efm32.c
@@ -1075,8 +1075,8 @@ static int efm32x_probe(struct flash_bank *bank)
LOG_INFO("detected part: %s Gecko, rev %d",
efm32_mcu_info->family_data->name, efm32_mcu_info->prod_rev);
- LOG_INFO("flash size = %dkbytes", efm32_mcu_info->flash_sz_kib);
- LOG_INFO("flash page size = %dbytes", efm32_mcu_info->page_size);
+ LOG_INFO("flash size = %d KiB", efm32_mcu_info->flash_sz_kib);
+ LOG_INFO("flash page size = %d B", efm32_mcu_info->page_size);
assert(efm32_mcu_info->page_size != 0);
diff --git a/src/flash/nor/em357.c b/src/flash/nor/em357.c
index d73194b..63302f6 100644
--- a/src/flash/nor/em357.c
+++ b/src/flash/nor/em357.c
@@ -709,7 +709,7 @@ static int em357_probe(struct flash_bank *bank)
em357_info->ppage_size = 4;
- LOG_INFO("flash size = %dkbytes", num_pages*page_size/1024);
+ LOG_INFO("flash size = %d KiB", num_pages*page_size/1024);
free(bank->sectors);
diff --git a/src/flash/nor/kinetis.c b/src/flash/nor/kinetis.c
index 12e3f5f..61e7b17 100644
--- a/src/flash/nor/kinetis.c
+++ b/src/flash/nor/kinetis.c
@@ -2662,12 +2662,12 @@ static int kinetis_probe_chip(struct kinetis_chip *k_chip)
snprintf(k_chip->name, sizeof(k_chip->name), name, flash_marking);
LOG_INFO("Kinetis %s detected: %u flash blocks", k_chip->name, num_blocks);
- LOG_INFO("%u PFlash banks: %" PRIu32 "k total", k_chip->num_pflash_blocks, pflash_size_k);
+ LOG_INFO("%u PFlash banks: %" PRIu32 " KiB total", k_chip->num_pflash_blocks, pflash_size_k);
if (k_chip->num_nvm_blocks) {
nvm_size_k = k_chip->nvm_size / 1024;
dflash_size_k = k_chip->dflash_size / 1024;
- LOG_INFO("%u FlexNVM banks: %" PRIu32 "k total, %" PRIu32 "k available as data flash, %" PRIu32 "bytes FlexRAM",
- k_chip->num_nvm_blocks, nvm_size_k, dflash_size_k, ee_size);
+ LOG_INFO("%u FlexNVM banks: %" PRIu32 " KiB total, %" PRIu32 " KiB available as data flash, %"
+ PRIu32 " bytes FlexRAM", k_chip->num_nvm_blocks, nvm_size_k, dflash_size_k, ee_size);
}
k_chip->probed = true;
diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c
index 960fb8d..aacafa1 100644
--- a/src/flash/nor/pic32mx.c
+++ b/src/flash/nor/pic32mx.c
@@ -759,7 +759,7 @@ static int pic32mx_probe(struct flash_bank *bank)
}
}
- LOG_INFO("flash size = %" PRIu32 "kbytes", num_pages / 1024);
+ LOG_INFO("flash size = %" PRIu32 " KiB", num_pages / 1024);
free(bank->sectors);
diff --git a/src/flash/nor/psoc4.c b/src/flash/nor/psoc4.c
index 1bdd64a..8ca1a7c 100644
--- a/src/flash/nor/psoc4.c
+++ b/src/flash/nor/psoc4.c
@@ -774,7 +774,7 @@ static int psoc4_probe(struct flash_bank *bank)
num_macros++;
}
- LOG_DEBUG("SPCIF geometry: %" PRIu32 " kb flash, row %" PRIu32 " bytes.",
+ LOG_DEBUG("SPCIF geometry: %" PRIu32 " KiB flash, row %" PRIu32 " bytes.",
flash_size_in_kb, row_size);
/* if the user sets the size manually then ignore the probed value
@@ -788,7 +788,7 @@ static int psoc4_probe(struct flash_bank *bank)
if (num_macros > 1)
snprintf(macros_txt, sizeof(macros_txt), " in %" PRIu32 " macros", num_macros);
- LOG_INFO("flash size = %" PRIu32 " kbytes%s", flash_size_in_kb, macros_txt);
+ LOG_INFO("flash size = %" PRIu32 " KiB%s", flash_size_in_kb, macros_txt);
/* calculate number of pages */
uint32_t num_rows = flash_size_in_kb * 1024 / row_size;
diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c
index 455a06a..b00b70a 100644
--- a/src/flash/nor/stm32f1x.c
+++ b/src/flash/nor/stm32f1x.c
@@ -1006,7 +1006,7 @@ static int stm32x_probe(struct flash_bank *bank)
flash_size_in_kb = stm32x_info->user_bank_size / 1024;
}
- LOG_INFO("flash size = %dkbytes", flash_size_in_kb);
+ LOG_INFO("flash size = %d KiB", flash_size_in_kb);
/* did we assign flash size? */
assert(flash_size_in_kb != 0xffff);
diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c
index 5e95b9b..7b3f930 100644
--- a/src/flash/nor/stm32f2x.c
+++ b/src/flash/nor/stm32f2x.c
@@ -1125,7 +1125,7 @@ static int stm32x_probe(struct flash_bank *bank)
flash_size_in_kb = stm32x_info->user_bank_size / 1024;
}
- LOG_INFO("flash size = %" PRIu16 " kbytes", flash_size_in_kb);
+ LOG_INFO("flash size = %" PRIu16 " KiB", flash_size_in_kb);
/* did we assign flash size? */
assert(flash_size_in_kb != 0xffff);
diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c
index 2b428f0..6cb7588 100644
--- a/src/flash/nor/stm32l4x.c
+++ b/src/flash/nor/stm32l4x.c
@@ -1816,7 +1816,7 @@ static int stm32l4_probe(struct flash_bank *bank)
flash_size_kb = stm32l4_info->user_bank_size / 1024;
}
- LOG_INFO("flash size = %dkbytes", flash_size_kb);
+ LOG_INFO("flash size = %d KiB", flash_size_kb);
/* did we assign a flash size? */
assert((flash_size_kb != 0xffff) && flash_size_kb);
diff --git a/src/flash/nor/stmqspi.c b/src/flash/nor/stmqspi.c
index a533248..ca4d513 100644
--- a/src/flash/nor/stmqspi.c
+++ b/src/flash/nor/stmqspi.c
@@ -754,13 +754,13 @@ COMMAND_HANDLER(stmqspi_handle_set)
bank->sectors = sectors;
stmqspi_info->dev.name = stmqspi_info->devname;
if (stmqspi_info->dev.size_in_bytes / 4096)
- LOG_INFO("flash \'%s\' id = unknown\nchip size = %" PRIu32 "kbytes,"
- " bank size = %" PRIu32 "kbytes", stmqspi_info->dev.name,
+ LOG_INFO("flash \'%s\' id = unknown\nchip size = %" PRIu32 " KiB,"
+ " bank size = %" PRIu32 " KiB", stmqspi_info->dev.name,
stmqspi_info->dev.size_in_bytes / 1024,
(stmqspi_info->dev.size_in_bytes / 1024) << dual);
else
- LOG_INFO("flash \'%s\' id = unknown\nchip size = %" PRIu32 "bytes,"
- " bank size = %" PRIu32 "bytes", stmqspi_info->dev.name,
+ LOG_INFO("flash \'%s\' id = unknown\nchip size = %" PRIu32 " B,"
+ " bank size = %" PRIu32 " B", stmqspi_info->dev.name,
stmqspi_info->dev.size_in_bytes,
stmqspi_info->dev.size_in_bytes << dual);
@@ -2206,10 +2206,10 @@ static int stmqspi_probe(struct flash_bank *bank)
memcpy(&stmqspi_info->dev, p, sizeof(stmqspi_info->dev));
if (p->size_in_bytes / 4096)
LOG_INFO("flash1 \'%s\' id = 0x%06" PRIx32 " size = %" PRIu32
- "kbytes", p->name, id1, p->size_in_bytes / 1024);
+ " KiB", p->name, id1, p->size_in_bytes / 1024);
else
LOG_INFO("flash1 \'%s\' id = 0x%06" PRIx32 " size = %" PRIu32
- "bytes", p->name, id1, p->size_in_bytes);
+ " B", p->name, id1, p->size_in_bytes);
break;
}
}
@@ -2228,7 +2228,7 @@ static int stmqspi_probe(struct flash_bank *bank)
if (retval == ERROR_OK) {
LOG_INFO("flash1 \'%s\' id = 0x%06" PRIx32 " size = %" PRIu32
- "kbytes", temp.name, id1, temp.size_in_bytes / 1024);
+ " KiB", temp.name, id1, temp.size_in_bytes / 1024);
/* save info and retrieved *good* id as spi_sfdp clears all info */
memcpy(&stmqspi_info->dev, &temp, sizeof(stmqspi_info->dev));
stmqspi_info->dev.device_id = id1;
@@ -2246,10 +2246,10 @@ static int stmqspi_probe(struct flash_bank *bank)
if (p->device_id == id2) {
if (p->size_in_bytes / 4096)
LOG_INFO("flash2 \'%s\' id = 0x%06" PRIx32 " size = %" PRIu32
- "kbytes", p->name, id2, p->size_in_bytes / 1024);
+ " KiB", p->name, id2, p->size_in_bytes / 1024);
else
LOG_INFO("flash2 \'%s\' id = 0x%06" PRIx32 " size = %" PRIu32
- "bytes", p->name, id2, p->size_in_bytes);
+ " B", p->name, id2, p->size_in_bytes);
if (!id1)
memcpy(&stmqspi_info->dev, p, sizeof(stmqspi_info->dev));
@@ -2286,7 +2286,7 @@ static int stmqspi_probe(struct flash_bank *bank)
if (retval == ERROR_OK)
LOG_INFO("flash2 \'%s\' id = 0x%06" PRIx32 " size = %" PRIu32
- "kbytes", temp.name, id2, temp.size_in_bytes / 1024);
+ " KiB", temp.name, id2, temp.size_in_bytes / 1024);
else {
/* even not identified by SFDP, then give up */
LOG_WARNING("Unknown flash2 device id = 0x%06" PRIx32
@@ -2392,22 +2392,22 @@ static int get_stmqspi_info(struct flash_bank *bank, struct command_invocation *
}
command_print_sameline(cmd, "flash%s%s \'%s\', device id = 0x%06" PRIx32
- ", flash size = %" PRIu32 "%sbytes\n(page size = %" PRIu32
+ ", flash size = %" PRIu32 "%s B\n(page size = %" PRIu32
", read = 0x%02" PRIx8 ", qread = 0x%02" PRIx8
", pprog = 0x%02" PRIx8 ", mass_erase = 0x%02" PRIx8
- ", sector size = %" PRIu32 "%sbytes, sector_erase = 0x%02" PRIx8 ")",
+ ", sector size = %" PRIu32 " %sB, sector_erase = 0x%02" PRIx8 ")",
((stmqspi_info->saved_cr & (BIT(SPI_DUAL_FLASH) |
BIT(SPI_FSEL_FLASH))) != BIT(SPI_FSEL_FLASH)) ? "1" : "",
((stmqspi_info->saved_cr & (BIT(SPI_DUAL_FLASH) |
BIT(SPI_FSEL_FLASH))) != 0) ? "2" : "",
stmqspi_info->dev.name, stmqspi_info->dev.device_id,
bank->size / 4096 ? bank->size / 1024 : bank->size,
- bank->size / 4096 ? "k" : "", stmqspi_info->dev.pagesize,
+ bank->size / 4096 ? "Ki" : "", stmqspi_info->dev.pagesize,
stmqspi_info->dev.read_cmd, stmqspi_info->dev.qread_cmd,
stmqspi_info->dev.pprog_cmd, stmqspi_info->dev.chip_erase_cmd,
stmqspi_info->dev.sectorsize / 4096 ?
stmqspi_info->dev.sectorsize / 1024 : stmqspi_info->dev.sectorsize,
- stmqspi_info->dev.sectorsize / 4096 ? "k" : "",
+ stmqspi_info->dev.sectorsize / 4096 ? "Ki" : "",
stmqspi_info->dev.erase_cmd);
return ERROR_OK;
diff --git a/src/flash/nor/w600.c b/src/flash/nor/w600.c
index 52105bd..98c0f46 100644
--- a/src/flash/nor/w600.c
+++ b/src/flash/nor/w600.c
@@ -312,7 +312,7 @@ static int w600_probe(struct flash_bank *bank)
flash_size = 1 << flash_size;
}
- LOG_INFO("flash size = %" PRIu32 "kbytes", flash_size / 1024);
+ LOG_INFO("flash size = %" PRIu32 " KiB", flash_size / 1024);
/* calculate numbers of pages */
size_t num_pages = flash_size / W600_FLASH_SECSIZE;