diff options
| author | Marek Vasut <[email protected]> | 2018-05-31 17:59:29 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2018-07-10 16:55:56 -0400 |
| commit | 26ad648ff4fcca2f5676a0690902be54a94f243d (patch) | |
| tree | 809e53e28cf94f35fe373413fdd18dbb6f25a358 /common | |
| parent | 8b1531f7bc66fae7e5c155d6ae5fa2e7aa77ade2 (diff) | |
spl: spi: Support full fitImage handling
Handle the case where the full fitImage support is enabled. In this
case, the whole fitImage must be loaded up front as some parts of the
fitImage code require memory-mapped access to the entire fitImage.
Signed-off-by: Marek Vasut <[email protected]>
Cc: Pantelis Antoniou <[email protected]>
Cc: Simon Glass <[email protected]>
Diffstat (limited to 'common')
| -rw-r--r-- | common/spl/spl_spi.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index df460467298..ba60a3a3c50 100644 --- a/common/spl/spl_spi.c +++ b/common/spl/spl_spi.c @@ -110,8 +110,17 @@ static int spl_spi_load_image(struct spl_image_info *spl_image, return err; } - if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && - image_get_magic(header) == FDT_MAGIC) { + if (IS_ENABLED(CONFIG_SPL_LOAD_FIT_FULL) && + image_get_magic(header) == FDT_MAGIC) { + err = spi_flash_read(flash, payload_offs, + roundup(fdt_totalsize(header), 4), + (void *)CONFIG_SYS_LOAD_ADDR); + if (err) + return err; + err = spl_parse_image_header(spl_image, + (struct image_header *)CONFIG_SYS_LOAD_ADDR); + } else if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) && + image_get_magic(header) == FDT_MAGIC) { struct spl_load_info load; debug("Found FIT\n"); |
