diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2017-08-01 10:14:57 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2017-08-25 15:41:39 +0200 |
commit | 509a9802af4f69315d85baa0979a1d705ca5460e (patch) | |
tree | dad95c7315f2e3ff7ff0fba68caedb357b7bb597 /mk/config.mk | |
parent | b3be2f66b22b7fceaeb67c58f07c18b1b0611191 (diff) |
Add support for compressed early TAs
Add decompression code to the early TA loader and update the Python
script accordingly. The compression algorithm is "deflate", which is
used by zlib and gzip in particular. It allows for compression ratios
comprised between 3 (for bigger TAs) and 4.7 (for smaller ones). Those
numbers were observed with 32-bit TAs (QEMU).
On QEMU (armv7), the code size overhead when CFG_EARLY_TA=y, including
the decompressor, is 12K when DEBUG=0 or 20K when DEBUG=1. The
decompressor allocates about 39K of heap.
Another library compatible with zlib was tried for comparison [1].
The code size overhead with miniz was 8K (DEBUG=0) or 16K (DEBUG=1).
On the other hand, the dynamic allocation was about 43K, so the total
memory required was about same. Speed was not compared. In the end,
zlib was preferred for licensing reasons and because it is widely used.
Link: [1] https://github.com/richgel999/miniz
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU)
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMUv8, pager)
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (D02 32/64 bits)
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (D02 32/64 bits, pager)
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Diffstat (limited to 'mk/config.mk')
-rw-r--r-- | mk/config.mk | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mk/config.mk b/mk/config.mk index 56d35706..3a2bf0ac 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -197,6 +197,9 @@ $(call force,CFG_EARLY_TA,y) else CFG_EARLY_TA ?= n endif +ifeq ($(CFG_EARLY_TA),y) +$(call force,CFG_ZLIB,y) +endif # Enable paging, requires SRAM, can't be enabled by default CFG_WITH_PAGER ?= n |