1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-26 16:13:55 +01:00

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>
This commit is contained in:
Simon Glass
2014-02-27 13:26:03 -07:00
parent 41364f0fbe
commit d7f25f35f4
2 changed files with 69 additions and 0 deletions

View File

@@ -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