diff options
author | Simon Glass <sjg@chromium.org> | 2014-02-27 13:26:03 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-03-17 20:05:46 -0600 |
commit | d7f25f35f448b15f815d355abd9ba39836fd9e32 (patch) | |
tree | ff20a0da108f10c24f24f72634b8bc93e01cb7f3 /include/cros_ec.h | |
parent | 41364f0fbe1e550a3326dd4310e41adec5ce30d7 (diff) |
cros_ec: Add a function for decoding the Chrome OS EC flashmap
In order to talk to the EC properly we need to be able to understand the
layout of its internal flash memory. This permits emulation of the EC
for sandbox, and also software update in a system with a real EC.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/cros_ec.h')
-rw-r--r-- | include/cros_ec.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/cros_ec.h b/include/cros_ec.h index 22eae90605..999c3c90c5 100644 --- a/include/cros_ec.h +++ b/include/cros_ec.h @@ -63,6 +63,17 @@ struct mbkp_keyscan { uint8_t data[CROS_EC_KEYSCAN_COLS]; }; +/* Holds information about the Chrome EC */ +struct fdt_cros_ec { + struct fmap_entry flash; /* Address and size of EC flash */ + /* + * Byte value of erased flash, or -1 if not known. It is normally + * 0xff but some flash devices use 0 (e.g. STM32Lxxx) + */ + int flash_erase_value; + struct fmap_entry region[EC_FLASH_REGION_COUNT]; +}; + /** * Read the ID of the CROS-EC device * @@ -449,4 +460,12 @@ int cros_ec_board_init(void); */ int cros_ec_get_error(void); +/** + * Returns information from the FDT about the Chrome EC flash + * + * @param blob FDT blob to use + * @param config Structure to use to return information + */ +int cros_ec_decode_ec_flash(const void *blob, struct fdt_cros_ec *config); + #endif |