From 82b43e680d744b8e42eb08476123fde916873369 Mon Sep 17 00:00:00 2001 From: Hridya Valsaraju Date: Wed, 27 Jun 2018 17:38:08 -0700 Subject: Support DT compression using zlib/gzip When using a DTBO header of version 1, the four least significant bits of the flags field in dt_table_entry will indicate the compression format of the DT entry. Currently zlib and gzip compressions are supported. Bug: 109892148 Test: make Change-Id: Ie880c4508b5dd71ccf7725b06489b8701431bcb2 --- utils/README.md | 2 +- utils/src/dt_table.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/utils/README.md b/utils/README.md index 6fa3409..fa326ee 100644 --- a/utils/README.md +++ b/utils/README.md @@ -3,7 +3,7 @@ libufdt `utils` folder This folder contains utilities for device tree overlay. -mkdtimg +mkdtimg (DEPRECATED, use mkdtboimg.py instead.) ------- If your DTB/DTBO is in an unique partition, e.g. `dtb` and `dtbo` partition. diff --git a/utils/src/dt_table.h b/utils/src/dt_table.h index 831b80f..fc37941 100644 --- a/utils/src/dt_table.h +++ b/utils/src/dt_table.h @@ -46,6 +46,12 @@ struct dt_table_header { struct is updated. */ }; +enum dt_compression_info { + NO_COMPRESSION, + ZLIB_COMPRESSION, + GZIP_COMPRESSION +}; + struct dt_table_entry { uint32_t dt_size; uint32_t dt_offset; /* offset from head of dt_table_header */ @@ -55,6 +61,18 @@ struct dt_table_entry { uint32_t custom[4]; /* optional, must be zero if unused */ }; +struct dt_table_entry_v1 { + uint32_t dt_size; + uint32_t dt_offset; /* offset from head of dt_table_header */ + + uint32_t id; /* optional, must be zero if unused */ + uint32_t rev; /* optional, must be zero if unused */ + uint32_t flags; /* For version 1 of dt_table_header, the 4 least significant bits + of 'flags' will be used indicate the compression + format of the DT entry as per the enum 'dt_compression_info' */ + uint32_t custom[3]; /* optional, must be zero if unused */ +}; + void dt_table_header_init(struct dt_table_header *header); #endif -- cgit v1.2.3