diff options
author | Govindraj Raja <govindraj.raja@arm.com> | 2023-10-12 16:41:07 -0500 |
---|---|---|
committer | Govindraj Raja <govindraj.raja@arm.com> | 2023-10-27 08:31:54 -0500 |
commit | f08460dc085283f25fd6b5df792f263ccdf22421 (patch) | |
tree | 97c783b2466a95740da618af2960403a67598610 | |
parent | 0f23e7eb1ee9a6a400e8e35bd8403f657b6405ae (diff) |
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>
-rw-r--r-- | drivers/partition/partition.c | 16 | ||||
-rw-r--r-- | include/drivers/partition/partition.h | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/partition/partition.c b/drivers/partition/partition.c index eff5c57cd..c60820dfc 100644 --- a/drivers/partition/partition.c +++ b/drivers/partition/partition.c @@ -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); } diff --git a/include/drivers/partition/partition.h b/include/drivers/partition/partition.h index 8e749c9dc..d567d4cbb 100644 --- a/include/drivers/partition/partition.h +++ b/include/drivers/partition/partition.h @@ -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 */ |