dt_table.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: BSD-3-Clause */
  2. /*
  3. * This is from the Android Project,
  4. * Repository: https://android.googlesource.com/platform/system/libufdt
  5. * File: utils/src/dt_table.h
  6. * Commit: 2626d8b9e4d8e8c6cc67ceb1dc4e05a47779785c
  7. * Copyright (C) 2017 The Android Open Source Project
  8. */
  9. #ifndef DT_TABLE_H
  10. #define DT_TABLE_H
  11. #include <linux/types.h>
  12. #define DT_TABLE_MAGIC 0xd7b7ab1e
  13. #define DT_TABLE_DEFAULT_PAGE_SIZE 2048
  14. #define DT_TABLE_DEFAULT_VERSION 0
  15. struct dt_table_header {
  16. u32 magic; /* DT_TABLE_MAGIC */
  17. u32 total_size; /* includes dt_table_header + all dt_table_entry
  18. * and all dtb/dtbo
  19. */
  20. u32 header_size; /* sizeof(dt_table_header) */
  21. u32 dt_entry_size; /* sizeof(dt_table_entry) */
  22. u32 dt_entry_count; /* number of dt_table_entry */
  23. u32 dt_entries_offset; /* offset to the first dt_table_entry
  24. * from head of dt_table_header.
  25. * The value will be equal to header_size if
  26. * no padding is appended
  27. */
  28. u32 page_size; /* flash page size we assume */
  29. u32 version; /* DTBO image version, the current version is 0.
  30. * The version will be incremented when the
  31. * dt_table_header struct is updated.
  32. */
  33. };
  34. struct dt_table_entry {
  35. u32 dt_size;
  36. u32 dt_offset; /* offset from head of dt_table_header */
  37. u32 id; /* optional, must be zero if unused */
  38. u32 rev; /* optional, must be zero if unused */
  39. u32 custom[4]; /* optional, must be zero if unused */
  40. };
  41. #endif