]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - include/image-sparse.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2014 Broadcom Corporation.
7 #include <sparse_format.h>
9 #define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
11 struct sparse_storage
{
17 lbaint_t (*write
)(struct sparse_storage
*info
,
22 lbaint_t (*reserve
)(struct sparse_storage
*info
,
26 void (*mssg
)(const char *str
);
29 static inline int is_sparse_image(void *buf
)
31 sparse_header_t
*s_header
= (sparse_header_t
*)buf
;
33 if ((le32_to_cpu(s_header
->magic
) == SPARSE_HEADER_MAGIC
) &&
34 (le16_to_cpu(s_header
->major_version
) == 1))
40 int write_sparse_image(struct sparse_storage
*info
, const char *part_name
,