From 12fc1f3bb2237c6eee7bc775599c14df5c997534 Mon Sep 17 00:00:00 2001 From: Corneliu Doban Date: Mon, 9 Nov 2020 11:49:16 +0530 Subject: cmd: gpt: add eMMC and GPT support Add eMMC and GPT support. - GPT partition list and command to create the GPT added to u-boot environment - eMMC boot commands added to u-boot environment - new gpt commands (enumarate and setenv) that are used by broadcom update scripts and boot commands - eMMC specific u-boot configurations with environment saved in eMMC and GPT support Signed-off-by: Corneliu Doban Signed-off-by: Rayagonda Kokatanur [trini: Make gpt_setenv initialize ret to -1, given relevant return error values] Signed-off-by: Tom Rini --- include/part.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'include') diff --git a/include/part.h b/include/part.h index fac36364bd4..815515aa809 100644 --- a/include/part.h +++ b/include/part.h @@ -9,6 +9,7 @@ #include #include #include +#include #include struct block_drvr { @@ -481,5 +482,33 @@ int layout_mbr_partitions(struct disk_partition *p, int count, #endif +#ifdef CONFIG_PARTITIONS +/** + * part_driver_get_count() - get partition driver count + * + * @return - number of partition drivers + */ +static inline int part_driver_get_count(void) +{ + return ll_entry_count(struct part_driver, part_driver); +} + +/** + * part_driver_get_first() - get first partition driver + * + * @return - pointer to first partition driver on success, otherwise NULL + */ +static inline struct part_driver *part_driver_get_first(void) +{ + return ll_entry_start(struct part_driver, part_driver); +} + +#else +static inline int part_driver_get_count(void) +{ return 0; } + +static inline struct part_driver *part_driver_get_first(void) +{ return NULL; } +#endif /* CONFIG_PARTITIONS */ #endif /* _PART_H */ -- cgit v1.3.1