common: image-fit: add API to get "/totalsize"
Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Change-Id: Icca5200040ab14ad76515888cdaa4cd16f554af0
This commit is contained in:
parent
28e3182f59
commit
4fe117be42
|
|
@ -527,6 +527,29 @@ int fit_get_timestamp(const void *fit, int noffset, time_t *timestamp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* fit_get_totalsize - get node totalsize property.
|
||||
*
|
||||
* @fit: pointer to the FIT image header
|
||||
* @totalsize: holds the /totalsize property
|
||||
*
|
||||
* returns:
|
||||
* 0, on success
|
||||
* -ENOENT if the property could not be found
|
||||
*/
|
||||
int fit_get_totalsize(const void *fit, int *totalsize)
|
||||
{
|
||||
const fdt32_t *val;
|
||||
|
||||
val = fdt_getprop(fit, 0, FIT_TOTALSIZE_PROP, NULL);
|
||||
if (!val)
|
||||
return -ENOENT;
|
||||
|
||||
*totalsize = fdt32_to_cpu(*val);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* fit_image_get_node - get node offset for component image of a given unit name
|
||||
* @fit: pointer to the FIT format image header
|
||||
|
|
|
|||
|
|
@ -1001,6 +1001,7 @@ static inline const char *fit_get_name(const void *fit_hdr,
|
|||
|
||||
int fit_get_desc(const void *fit, int noffset, char **desc);
|
||||
int fit_get_timestamp(const void *fit, int noffset, time_t *timestamp);
|
||||
int fit_get_totalsize(const void *fit, int *totalsize);
|
||||
|
||||
int fit_image_get_node(const void *fit, const char *image_uname);
|
||||
int fit_image_get_os(const void *fit, int noffset, uint8_t *os);
|
||||
|
|
|
|||
Loading…
Reference in New Issue