mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
it8380dev: speed up flash verifying
No need to use EC in-direct fast read for verifying, just a pointer. symptom: ectool erase 128KB RW image will show "Timeout waiting for EC response", but the erase is success. Signed-off-by: Dino Li <dino.li@ite.com.tw> BRANCH=none BUG=none TEST=ectool erase RW image will show the correct message. Change-Id: Ie07d087ec004edc730bd084dd2e9b541f84adc2b Reviewed-on: https://chromium-review.googlesource.com/290525 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Dino Li <dino.li@ite.com.tw> Tested-by: Dino Li <dino.li@ite.com.tw>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
63a6068742
commit
67e88fa7b7
@@ -245,17 +245,18 @@ int FLASH_DMA_CODE dma_flash_verify(int addr, int size, const char *data)
|
||||
{
|
||||
int i;
|
||||
uint8_t *wbuf = (uint8_t *)data;
|
||||
uint8_t *flash = (uint8_t *)addr;
|
||||
|
||||
/* verify for erase */
|
||||
if (data == NULL) {
|
||||
for (i = 0; i < size; i++) {
|
||||
if (dma_flash_indirect_fast_read(addr + i) != 0xFF)
|
||||
if (flash[i] != 0xFF)
|
||||
return EC_ERROR_UNKNOWN;
|
||||
}
|
||||
/* verify for write */
|
||||
} else {
|
||||
for (i = 0; i < size; i++) {
|
||||
if (dma_flash_indirect_fast_read(addr + i) != wbuf[i])
|
||||
if (flash[i] != wbuf[i])
|
||||
return EC_ERROR_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user