X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fpart.h;h=6f604e7315acad10a342ca4f258ffdd0fd1e54d6;hb=9b5f9aeb3b48dbc059272168635a397ea5096a31;hp=1196220817e411c5114a8d6329381719e409dcbe;hpb=fd3654df3699ef08a4da91aacfb9799341680806;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/part.h b/include/part.h index 1196220..6f604e7 100644 --- a/include/part.h +++ b/include/part.h @@ -87,7 +87,7 @@ struct disk_part { }; /* Misc _get_dev functions */ -#ifdef CONFIG_PARTITIONS +#if CONFIG_IS_ENABLED(PARTITIONS) /** * blk_get_dev() - get a pointer to a block device given its type and number * @@ -104,7 +104,6 @@ struct disk_part { struct blk_desc *blk_get_dev(const char *ifname, int dev); struct blk_desc *mg_disk_get_dev(int dev); -int host_get_dev_err(int dev, struct blk_desc **blk_devp); /* disk/part.c */ int part_get_info(struct blk_desc *dev_desc, int part, @@ -276,6 +275,22 @@ static inline int blk_get_device_part_str(const char *ifname, struct disk_partition *info, int allow_whole_dev) { *dev_desc = NULL; return -1; } + +static inline int part_get_info_by_name_type(struct blk_desc *dev_desc, + const char *name, + struct disk_partition *info, + int part_type) +{ + return -ENOENT; +} + +static inline int part_get_info_by_name(struct blk_desc *dev_desc, + const char *name, + struct disk_partition *info) +{ + return -ENOENT; +} + static inline int part_get_info_by_dev_and_name_or_num(const char *dev_iface, const char *dev_part_str, @@ -288,6 +303,23 @@ part_get_info_by_dev_and_name_or_num(const char *dev_iface, } #endif +struct udevice; +/** + * part_create_block_devices - Create block devices for disk partitions + * + * Create UCLASS_PARTITION udevices for each of disk partitions in @parent + * + * @blk_dev: Whole disk device + */ +int part_create_block_devices(struct udevice *blk_dev); + +unsigned long dev_read(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt, void *buffer); +unsigned long dev_write(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt, const void *buffer); +unsigned long dev_erase(struct udevice *dev, lbaint_t start, + lbaint_t blkcnt); + /* * We don't support printing partition information in SPL and only support * getting partition information in a few cases. @@ -435,6 +467,16 @@ int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head, gpt_entry **gpt_pte); /** + * gpt_repair_headers() - Function to repair the GPT's header + * and partition table entries (PTE) + * + * @param dev_desc - block device descriptor + * + * Return: - '0' on success, otherwise error + */ +int gpt_repair_headers(struct blk_desc *dev_desc); + +/** * gpt_verify_partitions() - Function to check if partitions' name, start and * size correspond to '$partitions' env variable * @@ -497,7 +539,7 @@ int layout_mbr_partitions(struct disk_partition *p, int count, #endif -#ifdef CONFIG_PARTITIONS +#if CONFIG_IS_ENABLED(PARTITIONS) /** * part_driver_get_count() - get partition driver count *