diff options
author | Tomas Vanek <vanekt@fbl.cz> | 2018-07-21 11:17:59 +0200 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2018-08-21 19:25:53 +0100 |
commit | 20922f47c74b97c5d39f8e3036a107ebfdc7e8c3 (patch) | |
tree | d49dd73ccffaeb2d2ef19ae923385c9cb5fe49c9 | |
parent | e537e807f6e634eb921988ad5db353cdcf03ee50 (diff) | |
download | riscv-openocd-20922f47c74b97c5d39f8e3036a107ebfdc7e8c3.zip riscv-openocd-20922f47c74b97c5d39f8e3036a107ebfdc7e8c3.tar.gz riscv-openocd-20922f47c74b97c5d39f8e3036a107ebfdc7e8c3.tar.bz2 |
flash/at91sam4: emit flash bank info
Change related LOG_INFO to LOG_DEBUG
Change-Id: I0c09b1ec83da631b26980dc8632b9031fe2921a3
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4610
Tested-by: jenkins
Reviewed-by: Erwin Oegema <blablaechthema@hotmail.com>
Reviewed-by: Svetoslav Enchev <svetoslav.enchev@gmail.com>
-rw-r--r-- | src/flash/nor/at91sam4.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/flash/nor/at91sam4.c b/src/flash/nor/at91sam4.c index f922c76..b8f4e16 100644 --- a/src/flash/nor/at91sam4.c +++ b/src/flash/nor/at91sam4.c @@ -2550,7 +2550,7 @@ static int sam4_GetDetails(struct sam4_bank_private *pPrivate) sam4_explain_chipid_cidr(pPrivate->pChip); return ERROR_FAIL; } else { - LOG_INFO("SAM4 Found chip %s, CIDR 0x%08x", pDetails->name, pDetails->chipid_cidr); + LOG_DEBUG("SAM4 Found chip %s, CIDR 0x%08x", pDetails->name, pDetails->chipid_cidr); } /* DANGER: THERE ARE DRAGONS HERE */ @@ -2586,6 +2586,27 @@ static int sam4_GetDetails(struct sam4_bank_private *pPrivate) return ERROR_OK; } +static int sam4_info(struct flash_bank *bank, char *buf, int buf_size) +{ + struct sam4_bank_private *pPrivate; + int k = bank->size / 1024; + + pPrivate = get_sam4_bank_private(bank); + if (pPrivate == NULL) { + buf[0] = '\0'; + return ERROR_FAIL; + } + + snprintf(buf, buf_size, + "%s bank %d: %d kB at 0x%08" PRIx32, + pPrivate->pChip->details.name, + pPrivate->bank_number, + k, + bank->base); + + return ERROR_OK; +} + static int sam4_probe(struct flash_bank *bank) { unsigned x; @@ -2621,7 +2642,7 @@ static int sam4_probe(struct flash_bank *bank) for (x = 0; x < SAM4_MAX_FLASH_BANKS; x++) { if (bank->base == pPrivate->pChip->details.bank[x].base_address) { bank->size = pPrivate->pChip->details.bank[x].size_bytes; - LOG_INFO("SAM4 Set flash bank to %08X - %08X, idx %d", bank->base, bank->base + bank->size, x); + LOG_DEBUG("SAM4 Set flash bank to %08X - %08X, idx %d", bank->base, bank->base + bank->size, x); break; } } @@ -3209,5 +3230,6 @@ struct flash_driver at91sam4_flash = { .auto_probe = sam4_auto_probe, .erase_check = default_flash_blank_check, .protect_check = sam4_protect_check, + .info = sam4_info, .free_driver_priv = sam4_free_driver_priv, }; |