xref: /rk3399_rockchip-uboot/include/part.h (revision e35929e4a1ffe861f2f45e107986568c56c4f077)
1012771d8Swdenk /*
242dfe7a1Swdenk  * (C) Copyright 2000-2004
3012771d8Swdenk  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4012771d8Swdenk  *
51a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
6012771d8Swdenk  */
7012771d8Swdenk #ifndef _PART_H
8012771d8Swdenk #define _PART_H
9735dd97bSGrant Likely 
101a73661bSSimon Glass #include <blk.h>
116e592385Swdenk #include <ide.h>
12012771d8Swdenk 
130472fbfdSEgbert Eich #define LOG2(x) (((x & 0xaaaaaaaa) ? 1 : 0) + ((x & 0xcccccccc) ? 2 : 0) + \
140472fbfdSEgbert Eich 		 ((x & 0xf0f0f0f0) ? 4 : 0) + ((x & 0xff00ff00) ? 8 : 0) + \
150472fbfdSEgbert Eich 		 ((x & 0xffff0000) ? 16 : 0))
160472fbfdSEgbert Eich #define LOG2_INVALID(type) ((type)((sizeof(type)<<3)-1))
17ae1768a7SEgbert Eich 
18012771d8Swdenk /* Part types */
19012771d8Swdenk #define PART_TYPE_UNKNOWN	0x00
20012771d8Swdenk #define PART_TYPE_MAC		0x01
21012771d8Swdenk #define PART_TYPE_DOS		0x02
22012771d8Swdenk #define PART_TYPE_ISO		0x03
23c7de829cSwdenk #define PART_TYPE_AMIGA		0x04
2407f3d789Srichardretanubun #define PART_TYPE_EFI		0x05
25c7de829cSwdenk 
26b0fce99bSwdenk /*
27b0fce99bSwdenk  * Type string for U-Boot bootable partitions
28b0fce99bSwdenk  */
29b0fce99bSwdenk #define BOOT_PART_TYPE	"U-Boot"	/* primary boot partition type	*/
30b0fce99bSwdenk #define BOOT_PART_COMP	"PPCBoot"	/* PPCBoot compatibility type	*/
31b0fce99bSwdenk 
32012771d8Swdenk /* device types */
33012771d8Swdenk #define DEV_TYPE_UNKNOWN	0xff	/* not connected */
34012771d8Swdenk #define DEV_TYPE_HARDDISK	0x00	/* harddisk */
35012771d8Swdenk #define DEV_TYPE_TAPE		0x01	/* Tape */
36012771d8Swdenk #define DEV_TYPE_CDROM		0x05	/* CD-ROM */
37012771d8Swdenk #define DEV_TYPE_OPDISK		0x07	/* optical disk */
38012771d8Swdenk 
39012771d8Swdenk typedef struct disk_partition {
4004735e9cSFrederic Leroy 	lbaint_t	start;	/* # of first block in partition	*/
4104735e9cSFrederic Leroy 	lbaint_t	size;	/* number of blocks in partition	*/
42012771d8Swdenk 	ulong	blksz;		/* block size in bytes			*/
43012771d8Swdenk 	uchar	name[32];	/* partition name			*/
44012771d8Swdenk 	uchar	type[32];	/* string type description		*/
4540e0e568SRob Herring 	int	bootable;	/* Active/Bootable flag is set		*/
46894bfbbfSStephen Warren #ifdef CONFIG_PARTITION_UUIDS
47894bfbbfSStephen Warren 	char	uuid[37];	/* filesystem UUID as string, if exists	*/
48894bfbbfSStephen Warren #endif
497561b258SPatrick Delaunay #ifdef CONFIG_PARTITION_TYPE_GUID
507561b258SPatrick Delaunay 	char	type_guid[37];	/* type GUID as string, if exists	*/
517561b258SPatrick Delaunay #endif
52012771d8Swdenk } disk_partition_t;
53012771d8Swdenk 
54735dd97bSGrant Likely /* Misc _get_dev functions */
55df3fc526SMatthew McClintock #ifdef CONFIG_PARTITIONS
56fb1b7be9SSimon Glass /**
57db1d9e78SSimon Glass  * blk_get_dev() - get a pointer to a block device given its type and number
58fb1b7be9SSimon Glass  *
59fb1b7be9SSimon Glass  * Each interface allocates its own devices and typically struct blk_desc is
60fb1b7be9SSimon Glass  * contained with the interface's data structure. There is no global
61fb1b7be9SSimon Glass  * numbering for block devices, so the interface name must be provided.
62fb1b7be9SSimon Glass  *
63fb1b7be9SSimon Glass  * @ifname:	Interface name (e.g. "ide", "scsi")
64fb1b7be9SSimon Glass  * @dev:	Device number (0 for first device on that interface, 1 for
65fb1b7be9SSimon Glass  *		second, etc.
66fb1b7be9SSimon Glass  * @return pointer to the block device, or NULL if not available, or an
67fb1b7be9SSimon Glass  *	   error occurred.
68fb1b7be9SSimon Glass  */
69db1d9e78SSimon Glass struct blk_desc *blk_get_dev(const char *ifname, int dev);
704101f687SSimon Glass struct blk_desc *ide_get_dev(int dev);
714101f687SSimon Glass struct blk_desc *sata_get_dev(int dev);
724101f687SSimon Glass struct blk_desc *scsi_get_dev(int dev);
734101f687SSimon Glass struct blk_desc *usb_stor_get_dev(int dev);
744101f687SSimon Glass struct blk_desc *mmc_get_dev(int dev);
75fb1b7be9SSimon Glass 
76fb1b7be9SSimon Glass /**
77fb1b7be9SSimon Glass  * mmc_select_hwpart() - Select the MMC hardware partiion on an MMC device
78fb1b7be9SSimon Glass  *
79fb1b7be9SSimon Glass  * MMC devices can support partitioning at the hardware level. This is quite
80fb1b7be9SSimon Glass  * separate from the normal idea of software-based partitions. MMC hardware
81fb1b7be9SSimon Glass  * partitions must be explicitly selected. Once selected only the region of
82fb1b7be9SSimon Glass  * the device covered by that partition is accessible.
83fb1b7be9SSimon Glass  *
84fb1b7be9SSimon Glass  * The MMC standard provides for two boot partitions (numbered 1 and 2),
85fb1b7be9SSimon Glass  * rpmb (3), and up to 4 addition general-purpose partitions (4-7).
86fb1b7be9SSimon Glass  *
87fb1b7be9SSimon Glass  * @dev_num:	Block device number (struct blk_desc->dev value)
88fb1b7be9SSimon Glass  * @hwpart:	Hardware partition number to select. 0 means the raw device,
89fb1b7be9SSimon Glass  *		1 is the first partition, 2 is the second, etc.
90fb1b7be9SSimon Glass  * @return 0 if OK, other value for an error
91fb1b7be9SSimon Glass  */
92d2356284SStephen Warren int mmc_select_hwpart(int dev_num, int hwpart);
934101f687SSimon Glass struct blk_desc *systemace_get_dev(int dev);
944101f687SSimon Glass struct blk_desc *mg_disk_get_dev(int dev);
954101f687SSimon Glass struct blk_desc *host_get_dev(int dev);
964101f687SSimon Glass int host_get_dev_err(int dev, struct blk_desc **blk_devp);
97735dd97bSGrant Likely 
98012771d8Swdenk /* disk/part.c */
994101f687SSimon Glass int get_partition_info(struct blk_desc *dev_desc, int part,
1004101f687SSimon Glass 		       disk_partition_t *info);
1014101f687SSimon Glass void print_part(struct blk_desc *dev_desc);
1024101f687SSimon Glass void init_part(struct blk_desc *dev_desc);
1034101f687SSimon Glass void dev_print(struct blk_desc *dev_desc);
104ebac37cfSSimon Glass 
105ebac37cfSSimon Glass /**
106ebac37cfSSimon Glass  * blk_get_device_by_str() - Get a block device given its interface/hw partition
107ebac37cfSSimon Glass  *
108ebac37cfSSimon Glass  * Each interface allocates its own devices and typically struct blk_desc is
109ebac37cfSSimon Glass  * contained with the interface's data structure. There is no global
110ebac37cfSSimon Glass  * numbering for block devices, so the interface name must be provided.
111ebac37cfSSimon Glass  *
112ebac37cfSSimon Glass  * The hardware parition is not related to the normal software partitioning
113ebac37cfSSimon Glass  * of a device - each hardware partition is effectively a separately
114ebac37cfSSimon Glass  * accessible block device. When a hardware parition is selected on MMC the
115ebac37cfSSimon Glass  * other hardware partitions become inaccessible. The same block device is
116ebac37cfSSimon Glass  * used to access all hardware partitions, but its capacity may change when a
117ebac37cfSSimon Glass  * different hardware partition is selected.
118ebac37cfSSimon Glass  *
119ebac37cfSSimon Glass  * When a hardware partition number is given, the block device switches to
120ebac37cfSSimon Glass  * that hardware partition.
121ebac37cfSSimon Glass  *
122ebac37cfSSimon Glass  * @ifname:	Interface name (e.g. "ide", "scsi")
123ebac37cfSSimon Glass  * @dev_str:	Device and optional hw partition. This can either be a string
124ebac37cfSSimon Glass  *		containing the device number (e.g. "2") or the device number
125ebac37cfSSimon Glass  *		and hardware partition number (e.g. "2.4") for devices that
126ebac37cfSSimon Glass  *		support it (currently only MMC).
127ebac37cfSSimon Glass  * @dev_desc:	Returns a pointer to the block device on success
128ebac37cfSSimon Glass  * @return block device number (local to the interface), or -1 on error
129ebac37cfSSimon Glass  */
130ebac37cfSSimon Glass int blk_get_device_by_str(const char *ifname, const char *dev_str,
1314101f687SSimon Glass 			  struct blk_desc **dev_desc);
132*e35929e4SSimon Glass 
133*e35929e4SSimon Glass /**
134*e35929e4SSimon Glass  * blk_get_device_part_str() - Get a block device and partition
135*e35929e4SSimon Glass  *
136*e35929e4SSimon Glass  * This calls blk_get_device_by_str() to look up a device. It also looks up
137*e35929e4SSimon Glass  * a partition and returns information about it.
138*e35929e4SSimon Glass  *
139*e35929e4SSimon Glass  * @dev_part_str is in the format:
140*e35929e4SSimon Glass  *	<dev>.<hw_part>:<part> where <dev> is the device number,
141*e35929e4SSimon Glass  *	<hw_part> is the optional hardware partition number and
142*e35929e4SSimon Glass  *	<part> is the partition number
143*e35929e4SSimon Glass  *
144*e35929e4SSimon Glass  * If ifname is "hostfs" then this function returns the sandbox host block
145*e35929e4SSimon Glass  * device.
146*e35929e4SSimon Glass  *
147*e35929e4SSimon Glass  * If ifname is ubi, then this function returns 0, with @info set to a
148*e35929e4SSimon Glass  * special UBI device.
149*e35929e4SSimon Glass  *
150*e35929e4SSimon Glass  * If @dev_part_str is NULL or empty or "-", then this function looks up
151*e35929e4SSimon Glass  * the "bootdevice" environment variable and uses that string instead.
152*e35929e4SSimon Glass  *
153*e35929e4SSimon Glass  * If the partition string is empty then the first partition is used. If the
154*e35929e4SSimon Glass  * partition string is "auto" then the first bootable partition is used.
155*e35929e4SSimon Glass  *
156*e35929e4SSimon Glass  * @ifname:	Interface name (e.g. "ide", "scsi")
157*e35929e4SSimon Glass  * @dev_part_str:	Device and partition string
158*e35929e4SSimon Glass  * @dev_desc:	Returns a pointer to the block device on success
159*e35929e4SSimon Glass  * @info:	Returns partition information
160*e35929e4SSimon Glass  * @allow_whole_dev:	true to allow the user to select partition 0
161*e35929e4SSimon Glass  *		(which means the whole device), false to require a valid
162*e35929e4SSimon Glass  *		partition number >= 1
163*e35929e4SSimon Glass  * @return partition number, or -1 on error
164*e35929e4SSimon Glass  *
165*e35929e4SSimon Glass  */
166*e35929e4SSimon Glass int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
1674101f687SSimon Glass 			    struct blk_desc **dev_desc,
16810a37fd7SStephen Warren 			    disk_partition_t *info, int allow_whole_dev);
169df3fc526SMatthew McClintock #else
170db1d9e78SSimon Glass static inline struct blk_desc *blk_get_dev(const char *ifname, int dev)
17199d2c205SRob Herring { return NULL; }
1724101f687SSimon Glass static inline struct blk_desc *ide_get_dev(int dev) { return NULL; }
1734101f687SSimon Glass static inline struct blk_desc *sata_get_dev(int dev) { return NULL; }
1744101f687SSimon Glass static inline struct blk_desc *scsi_get_dev(int dev) { return NULL; }
1754101f687SSimon Glass static inline struct blk_desc *usb_stor_get_dev(int dev) { return NULL; }
1764101f687SSimon Glass static inline struct blk_desc *mmc_get_dev(int dev) { return NULL; }
177d2356284SStephen Warren static inline int mmc_select_hwpart(int dev_num, int hwpart) { return -1; }
1784101f687SSimon Glass static inline struct blk_desc *systemace_get_dev(int dev) { return NULL; }
1794101f687SSimon Glass static inline struct blk_desc *mg_disk_get_dev(int dev) { return NULL; }
1804101f687SSimon Glass static inline struct blk_desc *host_get_dev(int dev) { return NULL; }
181012771d8Swdenk 
1824101f687SSimon Glass static inline int get_partition_info(struct blk_desc *dev_desc, int part,
183df3fc526SMatthew McClintock 				     disk_partition_t *info) { return -1; }
1844101f687SSimon Glass static inline void print_part(struct blk_desc *dev_desc) {}
1854101f687SSimon Glass static inline void init_part(struct blk_desc *dev_desc) {}
1864101f687SSimon Glass static inline void dev_print(struct blk_desc *dev_desc) {}
187ebac37cfSSimon Glass static inline int blk_get_device_by_str(const char *ifname, const char *dev_str,
1884101f687SSimon Glass 					struct blk_desc **dev_desc)
1892023e608SStephen Warren { return -1; }
190*e35929e4SSimon Glass static inline int blk_get_device_part_str(const char *ifname,
19110a37fd7SStephen Warren 					   const char *dev_part_str,
1924101f687SSimon Glass 					   struct blk_desc **dev_desc,
19310a37fd7SStephen Warren 					   disk_partition_t *info,
19410a37fd7SStephen Warren 					   int allow_whole_dev)
19599d2c205SRob Herring { *dev_desc = NULL; return -1; }
196df3fc526SMatthew McClintock #endif
197012771d8Swdenk 
198012771d8Swdenk #ifdef CONFIG_MAC_PARTITION
199012771d8Swdenk /* disk/part_mac.c */
2004101f687SSimon Glass int get_partition_info_mac(struct blk_desc *dev_desc, int part,
2014101f687SSimon Glass 			   disk_partition_t *info);
2024101f687SSimon Glass void print_part_mac(struct blk_desc *dev_desc);
2034101f687SSimon Glass int test_part_mac(struct blk_desc *dev_desc);
204012771d8Swdenk #endif
205012771d8Swdenk 
206012771d8Swdenk #ifdef CONFIG_DOS_PARTITION
207012771d8Swdenk /* disk/part_dos.c */
2084101f687SSimon Glass int get_partition_info_dos(struct blk_desc *dev_desc, int part,
2094101f687SSimon Glass 			   disk_partition_t *info);
2104101f687SSimon Glass void print_part_dos(struct blk_desc *dev_desc);
2114101f687SSimon Glass int test_part_dos(struct blk_desc *dev_desc);
212012771d8Swdenk #endif
213012771d8Swdenk 
214012771d8Swdenk #ifdef CONFIG_ISO_PARTITION
215012771d8Swdenk /* disk/part_iso.c */
2164101f687SSimon Glass int get_partition_info_iso(struct blk_desc *dev_desc, int part,
2174101f687SSimon Glass 			   disk_partition_t *info);
2184101f687SSimon Glass void print_part_iso(struct blk_desc *dev_desc);
2194101f687SSimon Glass int test_part_iso(struct blk_desc *dev_desc);
220012771d8Swdenk #endif
221012771d8Swdenk 
222c7de829cSwdenk #ifdef CONFIG_AMIGA_PARTITION
223c7de829cSwdenk /* disk/part_amiga.c */
2244101f687SSimon Glass int get_partition_info_amiga(struct blk_desc *dev_desc, int part,
2254101f687SSimon Glass 			     disk_partition_t *info);
2264101f687SSimon Glass void print_part_amiga(struct blk_desc *dev_desc);
2274101f687SSimon Glass int test_part_amiga(struct blk_desc *dev_desc);
228c7de829cSwdenk #endif
229c7de829cSwdenk 
23007f3d789Srichardretanubun #ifdef CONFIG_EFI_PARTITION
23140684ddbSLukasz Majewski #include <part_efi.h>
23207f3d789Srichardretanubun /* disk/part_efi.c */
2334101f687SSimon Glass int get_partition_info_efi(struct blk_desc *dev_desc, int part,
2344101f687SSimon Glass 			   disk_partition_t *info);
23560bf9416SSteve Rae /**
23660bf9416SSteve Rae  * get_partition_info_efi_by_name() - Find the specified GPT partition table entry
23760bf9416SSteve Rae  *
23860bf9416SSteve Rae  * @param dev_desc - block device descriptor
23960bf9416SSteve Rae  * @param gpt_name - the specified table entry name
24060bf9416SSteve Rae  * @param info - returns the disk partition info
24160bf9416SSteve Rae  *
24260bf9416SSteve Rae  * @return - '0' on match, '-1' on no match, otherwise error
24360bf9416SSteve Rae  */
2444101f687SSimon Glass int get_partition_info_efi_by_name(struct blk_desc *dev_desc,
24560bf9416SSteve Rae 	const char *name, disk_partition_t *info);
2464101f687SSimon Glass void print_part_efi(struct blk_desc *dev_desc);
2474101f687SSimon Glass int test_part_efi(struct blk_desc *dev_desc);
24840684ddbSLukasz Majewski 
24940684ddbSLukasz Majewski /**
25040684ddbSLukasz Majewski  * write_gpt_table() - Write the GUID Partition Table to disk
25140684ddbSLukasz Majewski  *
25240684ddbSLukasz Majewski  * @param dev_desc - block device descriptor
25340684ddbSLukasz Majewski  * @param gpt_h - pointer to GPT header representation
25440684ddbSLukasz Majewski  * @param gpt_e - pointer to GPT partition table entries
25540684ddbSLukasz Majewski  *
25640684ddbSLukasz Majewski  * @return - zero on success, otherwise error
25740684ddbSLukasz Majewski  */
2584101f687SSimon Glass int write_gpt_table(struct blk_desc *dev_desc,
25940684ddbSLukasz Majewski 		  gpt_header *gpt_h, gpt_entry *gpt_e);
26040684ddbSLukasz Majewski 
26140684ddbSLukasz Majewski /**
26240684ddbSLukasz Majewski  * gpt_fill_pte(): Fill the GPT partition table entry
26340684ddbSLukasz Majewski  *
26440684ddbSLukasz Majewski  * @param gpt_h - GPT header representation
26540684ddbSLukasz Majewski  * @param gpt_e - GPT partition table entries
26640684ddbSLukasz Majewski  * @param partitions - list of partitions
26740684ddbSLukasz Majewski  * @param parts - number of partitions
26840684ddbSLukasz Majewski  *
26940684ddbSLukasz Majewski  * @return zero on success
27040684ddbSLukasz Majewski  */
27140684ddbSLukasz Majewski int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
27240684ddbSLukasz Majewski 		disk_partition_t *partitions, int parts);
27340684ddbSLukasz Majewski 
27440684ddbSLukasz Majewski /**
27540684ddbSLukasz Majewski  * gpt_fill_header(): Fill the GPT header
27640684ddbSLukasz Majewski  *
27740684ddbSLukasz Majewski  * @param dev_desc - block device descriptor
27840684ddbSLukasz Majewski  * @param gpt_h - GPT header representation
27940684ddbSLukasz Majewski  * @param str_guid - disk guid string representation
28040684ddbSLukasz Majewski  * @param parts_count - number of partitions
28140684ddbSLukasz Majewski  *
28240684ddbSLukasz Majewski  * @return - error on str_guid conversion error
28340684ddbSLukasz Majewski  */
2844101f687SSimon Glass int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h,
28540684ddbSLukasz Majewski 		char *str_guid, int parts_count);
28640684ddbSLukasz Majewski 
28740684ddbSLukasz Majewski /**
28840684ddbSLukasz Majewski  * gpt_restore(): Restore GPT partition table
28940684ddbSLukasz Majewski  *
29040684ddbSLukasz Majewski  * @param dev_desc - block device descriptor
29140684ddbSLukasz Majewski  * @param str_disk_guid - disk GUID
29240684ddbSLukasz Majewski  * @param partitions - list of partitions
29340684ddbSLukasz Majewski  * @param parts - number of partitions
29440684ddbSLukasz Majewski  *
29540684ddbSLukasz Majewski  * @return zero on success
29640684ddbSLukasz Majewski  */
2974101f687SSimon Glass int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
29840684ddbSLukasz Majewski 		disk_partition_t *partitions, const int parts_count);
2990ff7e585SSteve Rae 
3000ff7e585SSteve Rae /**
3010ff7e585SSteve Rae  * is_valid_gpt_buf() - Ensure that the Primary GPT information is valid
3020ff7e585SSteve Rae  *
3030ff7e585SSteve Rae  * @param dev_desc - block device descriptor
3040ff7e585SSteve Rae  * @param buf - buffer which contains the MBR and Primary GPT info
3050ff7e585SSteve Rae  *
3060ff7e585SSteve Rae  * @return - '0' on success, otherwise error
3070ff7e585SSteve Rae  */
3084101f687SSimon Glass int is_valid_gpt_buf(struct blk_desc *dev_desc, void *buf);
3090ff7e585SSteve Rae 
3100ff7e585SSteve Rae /**
3110ff7e585SSteve Rae  * write_mbr_and_gpt_partitions() - write MBR, Primary GPT and Backup GPT
3120ff7e585SSteve Rae  *
3130ff7e585SSteve Rae  * @param dev_desc - block device descriptor
3140ff7e585SSteve Rae  * @param buf - buffer which contains the MBR and Primary GPT info
3150ff7e585SSteve Rae  *
3160ff7e585SSteve Rae  * @return - '0' on success, otherwise error
3170ff7e585SSteve Rae  */
3184101f687SSimon Glass int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf);
319cef68bf9SLukasz Majewski 
320cef68bf9SLukasz Majewski /**
321cef68bf9SLukasz Majewski  * gpt_verify_headers() - Function to read and CRC32 check of the GPT's header
322cef68bf9SLukasz Majewski  *                        and partition table entries (PTE)
323cef68bf9SLukasz Majewski  *
324cef68bf9SLukasz Majewski  * As a side effect if sets gpt_head and gpt_pte so they point to GPT data.
325cef68bf9SLukasz Majewski  *
326cef68bf9SLukasz Majewski  * @param dev_desc - block device descriptor
327cef68bf9SLukasz Majewski  * @param gpt_head - pointer to GPT header data read from medium
328cef68bf9SLukasz Majewski  * @param gpt_pte - pointer to GPT partition table enties read from medium
329cef68bf9SLukasz Majewski  *
330cef68bf9SLukasz Majewski  * @return - '0' on success, otherwise error
331cef68bf9SLukasz Majewski  */
3324101f687SSimon Glass int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
333cef68bf9SLukasz Majewski 		       gpt_entry **gpt_pte);
334cef68bf9SLukasz Majewski 
335cef68bf9SLukasz Majewski /**
336cef68bf9SLukasz Majewski  * gpt_verify_partitions() - Function to check if partitions' name, start and
337cef68bf9SLukasz Majewski  *                           size correspond to '$partitions' env variable
338cef68bf9SLukasz Majewski  *
339cef68bf9SLukasz Majewski  * This function checks if on medium stored GPT data is in sync with information
340cef68bf9SLukasz Majewski  * provided in '$partitions' environment variable. Specificially, name, start
341cef68bf9SLukasz Majewski  * and size of the partition is checked.
342cef68bf9SLukasz Majewski  *
343cef68bf9SLukasz Majewski  * @param dev_desc - block device descriptor
344cef68bf9SLukasz Majewski  * @param partitions - partition data read from '$partitions' env variable
345cef68bf9SLukasz Majewski  * @param parts - number of partitions read from '$partitions' env variable
346cef68bf9SLukasz Majewski  * @param gpt_head - pointer to GPT header data read from medium
347cef68bf9SLukasz Majewski  * @param gpt_pte - pointer to GPT partition table enties read from medium
348cef68bf9SLukasz Majewski  *
349cef68bf9SLukasz Majewski  * @return - '0' on success, otherwise error
350cef68bf9SLukasz Majewski  */
3514101f687SSimon Glass int gpt_verify_partitions(struct blk_desc *dev_desc,
352cef68bf9SLukasz Majewski 			  disk_partition_t *partitions, int parts,
353cef68bf9SLukasz Majewski 			  gpt_header *gpt_head, gpt_entry **gpt_pte);
35407f3d789Srichardretanubun #endif
35507f3d789Srichardretanubun 
356012771d8Swdenk #endif /* _PART_H */
357