diff options
Diffstat (limited to 'include/cros_board_info.h')
-rw-r--r-- | include/cros_board_info.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/include/cros_board_info.h b/include/cros_board_info.h index e7a1f1bb48..7650cfc078 100644 --- a/include/cros_board_info.h +++ b/include/cros_board_info.h @@ -46,6 +46,7 @@ struct cbi_data { * * @param version/sku_id/oem_id [OUT] Data read from EEPROM * @return EC_SUCCESS on success or EC_ERROR_* otherwise. + * EC_ERROR_BUSY to indicate data is not ready. */ int cbi_get_board_version(uint32_t *version); int cbi_get_sku_id(uint32_t *sku_id); @@ -53,14 +54,24 @@ int cbi_get_oem_id(uint32_t *oem_id); int cbi_get_model_id(uint32_t *id); /** - * Primitive accessors + * Get data from CBI store * * @param tag Tag of the target data. * @param buf Buffer where data is passed. * @param size (IN) Size of <buf>. (OUT) Size of the data returned. * @return EC_SUCCESS on success or EC_ERROR_* otherwise. + * EC_ERROR_BUSY to indicate data is not ready. */ int cbi_get_board_info(enum cbi_data_tag tag, uint8_t *buf, uint8_t *size); + +/** + * Set data in CBI store + * + * @param tag Tag of the target data. + * @param buf Buffer where data is passed. + * @param size (IN) Size of <buf>. (OUT) Size of the data returned. + * @return EC_SUCCESS on success or EC_ERROR_* otherwise. + */ int cbi_set_board_info(enum cbi_data_tag tag, const uint8_t *buf, uint8_t size); /* @@ -114,4 +125,21 @@ uint8_t *cbi_set_string(uint8_t *p, enum cbi_data_tag tag, const char *str); */ struct cbi_data *cbi_find_tag(const void *cbi, enum cbi_data_tag tag); +/** + * Callback implemented by board to manipulate data + * + * Note that this is part of the APIs (cbi_get_*) which can be called in any + * order any time. Your callback should return EC_SUCCESS only after it has all + * the data needed for manipulation. Until then, it should return EC_ERROR_BUSY. + * That'll provide a consistent view to the callers, which is critical for CBI + * to be functional. + * + * @param tag Tag of the data field to be manipulated + * @param buf Pointer to the buffer containing the data being manipulated. + * @param size size of the date in bytes + * @return EC_SUCCESS to indicate the data is ready. + * EC_ERROR_BUSY to indicate supplemental data is not ready. + */ +int cbi_board_override(enum cbi_data_tag tag, uint8_t *buf, uint8_t *size); + #endif /* __CROS_EC_CROS_BOARD_INFO_H */ |