summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteve Rae <srae@broadcom.com>2014-09-03 10:05:54 -0700
committerTom Rini <trini@ti.com>2014-09-16 12:23:57 -0400
commite6ca1ad604419619e2e6ba16a6e43cf15ff07fb1 (patch)
tree4977b4a24ef527a2da2633f03c7f994280ee6765 /include
parent1c39d856db8b3e32fe3d5b820fbfc8ba57ab8dd7 (diff)
downloadblackbird-obmc-uboot-e6ca1ad604419619e2e6ba16a6e43cf15ff07fb1.tar.gz
blackbird-obmc-uboot-e6ca1ad604419619e2e6ba16a6e43cf15ff07fb1.zip
implement the Android sparse image format
update to provide usable implementation to U-Boot Signed-off-by: Steve Rae <srae@broadcom.com>
Diffstat (limited to 'include')
-rw-r--r--include/aboot.h28
-rw-r--r--include/sparse_defs.h7
2 files changed, 35 insertions, 0 deletions
diff --git a/include/aboot.h b/include/aboot.h
new file mode 100644
index 0000000000..30e4d36df8
--- /dev/null
+++ b/include/aboot.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2014 Broadcom Corporation.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <part.h>
+#include <sparse_format.h>
+
+#define ROUNDUP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
+
+void fastboot_fail(const char *s);
+void fastboot_okay(const char *s);
+
+static inline int is_sparse_image(void *buf)
+{
+ sparse_header_t *s_header = (sparse_header_t *)buf;
+
+ if ((le32_to_cpu(s_header->magic) == SPARSE_HEADER_MAGIC) &&
+ (le16_to_cpu(s_header->major_version) == 1))
+ return 1;
+
+ return 0;
+}
+
+void write_sparse_image(block_dev_desc_t *dev_desc,
+ disk_partition_t *info, const char *part_name,
+ void *data, unsigned sz);
diff --git a/include/sparse_defs.h b/include/sparse_defs.h
new file mode 100644
index 0000000000..d0612c94e5
--- /dev/null
+++ b/include/sparse_defs.h
@@ -0,0 +1,7 @@
+/*
+ * Copyright 2014 Broadcom Corporation.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <linux/types.h>
OpenPOWER on IntegriCloud