1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2014 Broadcom Corporation.
8 #include <sparse_format.h>
10 #define FASTBOOT_MAX_BLK_WRITE 16384
12 #define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
14 struct sparse_storage {
20 lbaint_t (*write)(struct sparse_storage *info,
25 lbaint_t (*reserve)(struct sparse_storage *info,
29 void (*mssg)(const char *str, char *response);
32 static inline int is_sparse_image(void *buf)
34 sparse_header_t *s_header = (sparse_header_t *)buf;
36 if ((le32_to_cpu(s_header->magic) == SPARSE_HEADER_MAGIC) &&
37 (le16_to_cpu(s_header->major_version) == 1))
43 int write_sparse_image(struct sparse_storage *info, const char *part_name,
44 void *data, char *response);