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