diff options
author | Moritz Fischer | 2016-09-13 14:44:49 -0700 |
---|---|---|
committer | sjg | 2016-10-09 09:30:32 -0600 |
commit | 7a71e4891d6fab9f9d54cee72e6012727ef45d82 (patch) | |
tree | 61b35b6e8b2522bdeee13ea776a7f9b2198f1611 | |
parent | 281ca88fab7f6b66a18d494c05a1f1fa39f11075 (diff) |
cros_ec: Add crosec flashinfo command
Add command to print out the flash info as reported by the
ec. The data read back includes size, write block size,
erase block size.
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de
Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | drivers/misc/cros_ec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c index bb6e8fe91db..05f1f600bd6 100644 --- a/drivers/misc/cros_ec.c +++ b/drivers/misc/cros_ec.c @@ -1364,6 +1364,15 @@ static int do_cros_ec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("Offset: %x\n", offset); printf("Size: %x\n", size); } + } else if (0 == strcmp("flashinfo", cmd)) { + struct ec_response_flash_info p; + + ret = cros_ec_read_flashinfo(dev, &p); + if (!ret) { + printf("Flash size: %u\n", p.flash_size); + printf("Write block size: %u\n", p.write_block_size); + printf("Erase block size: %u\n", p.erase_block_size); + } } else if (0 == strcmp("vbnvcontext", cmd)) { uint8_t block[EC_VBNV_BLOCK_SIZE]; char buf[3]; @@ -1483,6 +1492,7 @@ U_BOOT_CMD( "crosec events Read CROS-EC host events\n" "crosec clrevents [mask] Clear CROS-EC host events\n" "crosec regioninfo <ro|rw> Read image info\n" + "crosec flashinfo Read flash info\n" "crosec erase <ro|rw> Erase EC image\n" "crosec read <ro|rw> <addr> [<size>] Read EC image\n" "crosec write <ro|rw> <addr> [<size>] Write EC image\n" |