common: fit: add fit_image_get_comp_addr()

Add API to get compress address of image.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id33d96795d5bb5db8d55a537f7d1c7a425b5b3e8
This commit is contained in:
Joseph Chen 2020-06-28 21:02:23 +08:00 committed by Jianhong Chen
parent a91da5984b
commit 7385816b5a
2 changed files with 20 additions and 0 deletions

View File

@ -785,6 +785,24 @@ int fit_image_get_load(const void *fit, int noffset, ulong *load)
return fit_image_get_address(fit, noffset, FIT_LOAD_PROP, load);
}
/**
* fit_image_get_comp_addr() - get compress addr property for given component image node
* @fit: pointer to the FIT format image header
* @noffset: component image node offset
* @comp: pointer to the uint32_t, will hold load address
*
* fit_image_get_comp_addr() finds compress address property in a given component
* image node. If the property is found, its value is returned to the caller.
*
* returns:
* 0, on success
* -1, on failure
*/
int fit_image_get_comp_addr(const void *fit, int noffset, ulong *comp)
{
return fit_image_get_address(fit, noffset, FIT_COMP_ADDR_PROP, comp);
}
/**
* fit_image_set_load() - set load addr property for given component image node
* @fit: pointer to the FIT format image header

View File

@ -927,6 +927,7 @@ int bootz_setup(ulong image, ulong *start, ulong *end);
#define FIT_TYPE_PROP "type"
#define FIT_OS_PROP "os"
#define FIT_COMP_PROP "compression"
#define FIT_COMP_ADDR_PROP "comp"
#define FIT_ENTRY_PROP "entry"
#define FIT_LOAD_PROP "load"
#define FIT_ROLLBACK_PROP "rollback-index"
@ -1012,6 +1013,7 @@ int fit_image_get_type(const void *fit, int noffset, uint8_t *type);
int fit_image_get_comp(const void *fit, int noffset, uint8_t *comp);
int fit_image_get_load(const void *fit, int noffset, ulong *load);
int fit_image_get_entry(const void *fit, int noffset, ulong *entry);
int fit_image_get_comp_addr(const void *fit, int noffset, ulong *comp);
int fit_image_set_load(const void *fit, int noffset, ulong load);
int fit_image_set_entry(const void *fit, int noffset, ulong entry);
int fit_image_get_data(const void *fit, int noffset,