diff options
author | Sean Anderson | 2023-11-08 11:48:51 -0500 |
---|---|---|
committer | Tom Rini | 2023-11-16 13:49:14 -0500 |
commit | 11f834614e8577bffea04d39e7eb235ee1271b29 (patch) | |
tree | 8e283345f610386afcc54a451c35d9ae293758d1 /test | |
parent | 5d3401a448353767c5e67246a79271c9ee6f3f73 (diff) |
spl: Convert nand to spl_load
This converts the nand load method to use spl_load. nand_page_size may not
be valid until after nand_spl_load_image is called (see e.g. fsl_ifc_spl),
so we set bl_len in spl_nand_read. Since spl_load reads the header for us,
we can remove that argument from spl_nand_load_element.
There are two possible regressions which could result from this commit.
First, we ask for a negative address from spl_get_load_buffer. That is,
instead of
header = spl_get_load_buffer(0, sizeof(*header));
we do
header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
this could cause a problem if spl_get_load_buffer does not return valid
memory for negative offsets. Second, we now set bl_len for legacy images.
This can cause memory up to a bl_len - 1 before the image load address to
be written, which might not have been the case before. If this turns out to
be a problem, we can add an option for a bounce buffer.
We can't load FITs with external data with SPL_LOAD_FIT_FULL, so disable the
test in that case. No boards enable SPL_NAND_SUPPORT and SPL_LOAD_FIT_FULL, so
this is not a regression.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/image/spl_load_nand.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/image/spl_load_nand.c b/test/image/spl_load_nand.c index 30179de98e7..ec242207948 100644 --- a/test/image/spl_load_nand.c +++ b/test/image/spl_load_nand.c @@ -51,4 +51,6 @@ SPL_IMG_TEST(spl_test_nand, LEGACY, DM_FLAGS); SPL_IMG_TEST(spl_test_nand, LEGACY_LZMA, DM_FLAGS); SPL_IMG_TEST(spl_test_nand, IMX8, DM_FLAGS); SPL_IMG_TEST(spl_test_nand, FIT_INTERNAL, DM_FLAGS); +#if !IS_ENABLED(CONFIG_SPL_LOAD_FIT_FULL) SPL_IMG_TEST(spl_test_nand, FIT_EXTERNAL, DM_FLAGS); +#endif |