mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
fastboot: sparse: resync common/image-sparse.c (part 1)
This file originally came from upstream code. While retaining the storage abstraction feature, this is the first set of the changes required to resync with the cmd_flash_mmc_sparse_img() in the file aboot.c from https://us.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=LE.BR.1.2.1 Signed-off-by: Steve Rae <srae@broadcom.com>
This commit is contained in:
parent
64ece84854
commit
cc0f08cd34
4 changed files with 213 additions and 355 deletions
|
@ -9,16 +9,17 @@
|
|||
|
||||
#define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
|
||||
|
||||
typedef struct sparse_storage {
|
||||
unsigned int block_sz;
|
||||
unsigned int start;
|
||||
unsigned int size;
|
||||
const char *name;
|
||||
struct sparse_storage {
|
||||
lbaint_t blksz;
|
||||
lbaint_t start;
|
||||
lbaint_t size;
|
||||
void *priv;
|
||||
|
||||
int (*write)(struct sparse_storage *storage, void *priv,
|
||||
unsigned int offset, unsigned int size,
|
||||
char *data);
|
||||
} sparse_storage_t;
|
||||
lbaint_t (*write)(struct sparse_storage *info,
|
||||
lbaint_t blk,
|
||||
lbaint_t blkcnt,
|
||||
const void *buffer);
|
||||
};
|
||||
|
||||
static inline int is_sparse_image(void *buf)
|
||||
{
|
||||
|
@ -31,5 +32,5 @@ static inline int is_sparse_image(void *buf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int store_sparse_image(sparse_storage_t *storage, void *storage_priv,
|
||||
void *data);
|
||||
void write_sparse_image(struct sparse_storage *info, const char *part_name,
|
||||
void *data, unsigned sz, char *response_str);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue