aboutsummaryrefslogtreecommitdiff
path: root/boot/image-host.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-10-14 12:47:54 -0600
committerTom Rini <trini@konsulko.com>2021-11-11 19:01:56 -0500
commit19a91f2464a89402a925fd4a2d8b7e28c804c7cc (patch)
tree35d48b06f479acac201447cb32fea47a78c87eb5 /boot/image-host.c
parent1e72ad6b387c599f477f83cda67ab525c089a9b0 (diff)
Create a new boot/ directory
Quite a lot of the code in common/relates to booting and images. Before adding more it seems like a good time to move the code into its own directory. Most files with 'boot' or 'image' in them are moved, except: - autoboot.c which relates to U-Boot automatically running a script - bootstage.c which relates to U-Boot timing Drop the removal of boot* files from the output directory, since this interfers with the symlinks created by tools and there does not appear to be any such file from my brief testing. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com>
Diffstat (limited to 'boot/image-host.c')
-rw-r--r--boot/image-host.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/boot/image-host.c b/boot/image-host.c
new file mode 100644
index 0000000000..20a9521948
--- /dev/null
+++ b/boot/image-host.c
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Image code used by host tools (and not boards)
+ *
+ * (C) Copyright 2008 Semihalf
+ *
+ * (C) Copyright 2000-2006
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ */
+
+#include <time.h>
+
+void memmove_wd(void *to, void *from, size_t len, ulong chunksz)
+{
+ memmove(to, from, len);
+}
+
+void genimg_print_size(uint32_t size)
+{
+ printf("%d Bytes = %.2f KiB = %.2f MiB\n", size, (double)size / 1.024e3,
+ (double)size / 1.048576e6);
+}
+
+void genimg_print_time(time_t timestamp)
+{
+ printf("%s", ctime(&timestamp));
+}