blob: 30e4d36df8baf1e5b545bde99bbd8d85ae67c5e7 [file] [log] [blame]
Steve Raee6ca1ad2014-09-03 10:05:54 -07001/*
2 * Copyright 2014 Broadcom Corporation.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <part.h>
8#include <sparse_format.h>
9
10#define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
11
12void fastboot_fail(const char *s);
13void fastboot_okay(const char *s);
14
15static inline int is_sparse_image(void *buf)
16{
17 sparse_header_t *s_header = (sparse_header_t *)buf;
18
19 if ((le32_to_cpu(s_header->magic) == SPARSE_HEADER_MAGIC) &&
20 (le16_to_cpu(s_header->major_version) == 1))
21 return 1;
22
23 return 0;
24}
25
26void write_sparse_image(block_dev_desc_t *dev_desc,
27 disk_partition_t *info, const char *part_name,
28 void *data, unsigned sz);