diff options
author | Sean Anderson | 2023-10-14 16:48:04 -0400 |
---|---|---|
committer | Tom Rini | 2023-10-17 20:50:52 -0400 |
commit | 65efaac425e948dc56db5cf315d0497faeddb5b0 (patch) | |
tree | 449fb50044d0cbe31a9d13c8ee88c8b1ede3cfb4 /include/test | |
parent | 53d8bf8f9cff89dabf3c6461a1edeeddd49bccc6 (diff) |
test: spl: Add a test for the NOR load method
Add a test for the NOR load method. Since NOR is memory-mapped we can
substitute a buffer instead. The only major complication is testing LZMA
decompression. It's too complex to implement LZMA compression in a test, and we
have no in-tree compressor, so we just include some pre-compressed data. This
data was generated through something like
generate_data(plain, plain_size, "lzma")
cat plain.dat | lzma | hexdump -C
and was cleaned up further in my editor.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/test')
-rw-r--r-- | include/test/spl.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/test/spl.h b/include/test/spl.h index 009c6b35462..c1f64658502 100644 --- a/include/test/spl.h +++ b/include/test/spl.h @@ -27,12 +27,14 @@ void generate_data(char *data, size_t size, const char *test_name); /** * enum spl_test_image - Image types for testing * @LEGACY: "Legacy" uImages + * @LEGACY_LZMA: "Legacy" uImages, LZMA compressed * @IMX8: i.MX8 Container images * @FIT_INTERNAL: FITs with internal data * @FIT_EXTERNAL: FITs with external data */ enum spl_test_image { LEGACY, + LEGACY_LZMA, IMX8, FIT_INTERNAL, FIT_EXTERNAL, @@ -118,6 +120,9 @@ int do_spl_test_load(struct unit_test_state *uts, const char *test_name, static inline bool image_supported(enum spl_test_image type) { switch (type) { + case LEGACY_LZMA: + if (!IS_ENABLED(CONFIG_SPL_LZMA)) + return false; case LEGACY: return IS_ENABLED(CONFIG_SPL_LEGACY_IMAGE_FORMAT); case IMX8: |