feat(partition): add interface to init gpt

Current interface 'partition_init' accepts parameter image_id
and returns no value. But the entire partition driver is build
only to parse and handle GPT partitions, so add new interface
gpt_partition_init which would return failure to platform code
if it fails to parse the image.

Change-Id: Iaf574d2ad01a15d0723c1475290c31dc4a078835
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
This commit is contained in:
Govindraj Raja 2023-10-12 16:41:07 -05:00
parent 0f23e7eb1e
commit f08460dc08
2 changed files with 16 additions and 1 deletions

View file

@ -460,5 +460,19 @@ const partition_entry_list_t *get_partition_entry_list(void)
*/
void partition_init(unsigned int image_id)
{
load_partition_table(image_id);
int ret;
ret = load_partition_table(image_id);
if (ret != 0) {
ERROR("Failed to parse partition with image id = %u\n",
image_id);
}
}
/*
* Load a GPT based image.
*/
int gpt_partition_init(void)
{
return load_partition_table(GPT_IMAGE_ID);
}

View file

@ -50,5 +50,6 @@ const partition_entry_t *get_partition_entry_by_type(const uuid_t *type_guid);
const partition_entry_t *get_partition_entry_by_uuid(const uuid_t *part_uuid);
const partition_entry_list_t *get_partition_entry_list(void);
void partition_init(unsigned int image_id);
int gpt_partition_init(void);
#endif /* PARTITION_H */