summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2015-10-15 14:34:13 +0200
committerTom Rini <trini@konsulko.com>2015-11-12 13:17:31 -0500
commit3c8f98f5fed5c6f03bb185b79191477885748b14 (patch)
tree95759f3960b187fa22606e939bd37f35c0ca76d6 /include
parent40aeeda396024913835dc67fa17041693af97bd1 (diff)
downloadu-boot-imx-3c8f98f5fed5c6f03bb185b79191477885748b14.zip
u-boot-imx-3c8f98f5fed5c6f03bb185b79191477885748b14.tar.gz
u-boot-imx-3c8f98f5fed5c6f03bb185b79191477885748b14.tar.bz2
fastboot: Move fastboot response functions to fastboot core
The functions and a few define to generate a fastboot message to be sent back to the host were so far duplicated among the users. Move them all to a common place. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include')
-rw-r--r--include/aboot.h9
-rw-r--r--include/fastboot.h22
2 files changed, 25 insertions, 6 deletions
diff --git a/include/aboot.h b/include/aboot.h
index 30e4d36..18ff07a 100644
--- a/include/aboot.h
+++ b/include/aboot.h
@@ -9,9 +9,6 @@
#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;
@@ -23,6 +20,6 @@ static inline int is_sparse_image(void *buf)
return 0;
}
-void write_sparse_image(block_dev_desc_t *dev_desc,
- disk_partition_t *info, const char *part_name,
- void *data, unsigned sz);
+int 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/fastboot.h b/include/fastboot.h
new file mode 100644
index 0000000..db826d2
--- /dev/null
+++ b/include/fastboot.h
@@ -0,0 +1,22 @@
+/*
+ * (C) Copyright 2008 - 2009
+ * Windriver, <www.windriver.com>
+ * Tom Rix <Tom.Rix@windriver.com>
+ *
+ * Copyright 2011 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ *
+ * Copyright 2014 Linaro, Ltd.
+ * Rob Herring <robh@kernel.org>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+#ifndef _FASTBOOT_H_
+#define _FASTBOOT_H_
+
+/* The 64 defined bytes plus \0 */
+#define FASTBOOT_RESPONSE_LEN (64 + 1)
+
+void fastboot_fail(char *response, const char *reason);
+void fastboot_okay(char *response, const char *reason);
+
+#endif /* _FASTBOOT_H_ */