* [U-Boot] [PATCH] Import Android's dt_table.h for DT image format
[not found] <f42878729a647cf9dbd7ffacc6ba455e17a91676>
@ 2018-05-28 15:19 ` Alex Deymo
2018-05-29 13:23 ` Sam Protsenko
2018-05-30 1:57 ` [U-Boot] " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Alex Deymo @ 2018-05-28 15:19 UTC (permalink / raw)
To: u-boot
Android documentation defines the recommended image format for storing
DTB/DTBO files in a single dtbo.img image. This patch includes the
latest header file with the struct definitions for this format from
AOSP.
The header was adapted to U-Boot's coding style and the function
declarations were removed.
Signed-off-by: Alex Deymo <deymo@google.com>
---
include/dt_table.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
create mode 100644 include/dt_table.h
diff --git a/include/dt_table.h b/include/dt_table.h
new file mode 100644
index 00000000000..f91657c0c76
--- /dev/null
+++ b/include/dt_table.h
@@ -0,0 +1,50 @@
+/*
+ * This is from the Android Project,
+ * Repository: https://android.googlesource.com/platform/system/libufdt
+ * File: utils/src/dt_table.h
+ * Commit: 2626d8b9e4d8e8c6cc67ceb1dc4e05a47779785c
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef DT_TABLE_H
+#define DT_TABLE_H
+
+#include <linux/types.h>
+
+#define DT_TABLE_MAGIC 0xd7b7ab1e
+#define DT_TABLE_DEFAULT_PAGE_SIZE 2048
+#define DT_TABLE_DEFAULT_VERSION 0
+
+struct dt_table_header {
+ u32 magic; /* DT_TABLE_MAGIC */
+ u32 total_size; /* includes dt_table_header + all dt_table_entry
+ * and all dtb/dtbo
+ */
+ u32 header_size; /* sizeof(dt_table_header) */
+
+ u32 dt_entry_size; /* sizeof(dt_table_entry) */
+ u32 dt_entry_count; /* number of dt_table_entry */
+ u32 dt_entries_offset; /* offset to the first dt_table_entry
+ * from head of dt_table_header.
+ * The value will be equal to header_size if
+ * no padding is appended
+ */
+ u32 page_size; /* flash page size we assume */
+ u32 version; /* DTBO image version, the current version is 0.
+ * The version will be incremented when the
+ * dt_table_header struct is updated.
+ */
+};
+
+struct dt_table_entry {
+ u32 dt_size;
+ u32 dt_offset; /* offset from head of dt_table_header */
+
+ u32 id; /* optional, must be zero if unused */
+ u32 rev; /* optional, must be zero if unused */
+ u32 custom[4]; /* optional, must be zero if unused */
+};
+
+#endif
--
2.17.0.921.gf22659ad46-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] Import Android's dt_table.h for DT image format
2018-05-28 15:19 ` [U-Boot] [PATCH] Import Android's dt_table.h for DT image format Alex Deymo
@ 2018-05-29 13:23 ` Sam Protsenko
2018-05-30 1:57 ` [U-Boot] " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Sam Protsenko @ 2018-05-29 13:23 UTC (permalink / raw)
To: u-boot
On 28 May 2018 at 18:19, Alex Deymo <deymo@google.com> wrote:
> Android documentation defines the recommended image format for storing
> DTB/DTBO files in a single dtbo.img image. This patch includes the
> latest header file with the struct definitions for this format from
> AOSP.
>
> The header was adapted to U-Boot's coding style and the function
> declarations were removed.
>
> Signed-off-by: Alex Deymo <deymo@google.com>
> ---
> include/dt_table.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
> create mode 100644 include/dt_table.h
>
Hi Tom,
Can you please pull this one along with my patches for DT image support [1,2]?
Thanks!
[1] https://lists.denx.de/pipermail/u-boot/2018-April/326050.html
[2] https://lists.denx.de/pipermail/u-boot/2018-April/326051.html
> diff --git a/include/dt_table.h b/include/dt_table.h
> new file mode 100644
> index 00000000000..f91657c0c76
> --- /dev/null
> +++ b/include/dt_table.h
> @@ -0,0 +1,50 @@
> +/*
> + * This is from the Android Project,
> + * Repository: https://android.googlesource.com/platform/system/libufdt
> + * File: utils/src/dt_table.h
> + * Commit: 2626d8b9e4d8e8c6cc67ceb1dc4e05a47779785c
> + * Copyright (C) 2017 The Android Open Source Project
> + *
> + * SPDX-License-Identifier: BSD-3-Clause
> + */
> +
> +#ifndef DT_TABLE_H
> +#define DT_TABLE_H
> +
> +#include <linux/types.h>
> +
> +#define DT_TABLE_MAGIC 0xd7b7ab1e
> +#define DT_TABLE_DEFAULT_PAGE_SIZE 2048
> +#define DT_TABLE_DEFAULT_VERSION 0
> +
> +struct dt_table_header {
> + u32 magic; /* DT_TABLE_MAGIC */
> + u32 total_size; /* includes dt_table_header + all dt_table_entry
> + * and all dtb/dtbo
> + */
> + u32 header_size; /* sizeof(dt_table_header) */
> +
> + u32 dt_entry_size; /* sizeof(dt_table_entry) */
> + u32 dt_entry_count; /* number of dt_table_entry */
> + u32 dt_entries_offset; /* offset to the first dt_table_entry
> + * from head of dt_table_header.
> + * The value will be equal to header_size if
> + * no padding is appended
> + */
> + u32 page_size; /* flash page size we assume */
> + u32 version; /* DTBO image version, the current version is 0.
> + * The version will be incremented when the
> + * dt_table_header struct is updated.
> + */
> +};
> +
> +struct dt_table_entry {
> + u32 dt_size;
> + u32 dt_offset; /* offset from head of dt_table_header */
> +
> + u32 id; /* optional, must be zero if unused */
> + u32 rev; /* optional, must be zero if unused */
> + u32 custom[4]; /* optional, must be zero if unused */
> +};
> +
> +#endif
> --
> 2.17.0.921.gf22659ad46-goog
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] Import Android's dt_table.h for DT image format
2018-05-28 15:19 ` [U-Boot] [PATCH] Import Android's dt_table.h for DT image format Alex Deymo
2018-05-29 13:23 ` Sam Protsenko
@ 2018-05-30 1:57 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2018-05-30 1:57 UTC (permalink / raw)
To: u-boot
On Mon, May 28, 2018 at 05:19:35PM +0200, Alex Deymo wrote:
> Android documentation defines the recommended image format for storing
> DTB/DTBO files in a single dtbo.img image. This patch includes the
> latest header file with the struct definitions for this format from
> AOSP.
>
> The header was adapted to U-Boot's coding style and the function
> declarations were removed.
>
> Signed-off-by: Alex Deymo <deymo@google.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180529/9ce9006e/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-30 1:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <f42878729a647cf9dbd7ffacc6ba455e17a91676>
2018-05-28 15:19 ` [U-Boot] [PATCH] Import Android's dt_table.h for DT image format Alex Deymo
2018-05-29 13:23 ` Sam Protsenko
2018-05-30 1:57 ` [U-Boot] " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.