summaryrefslogtreecommitdiff
path: root/common/spl/spl_fit.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl/spl_fit.c')
-rw-r--r--common/spl/spl_fit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index dbf5ac33a84..cb0cc5299bc 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -354,7 +354,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
struct spl_image_info image_info;
int node = -1;
int images, ret;
- int base_offset, align_len = ARCH_DMA_MINALIGN - 1;
+ int base_offset, hsize, align_len = ARCH_DMA_MINALIGN - 1;
int index = 0;
/*
@@ -383,8 +383,8 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
* For FIT with data embedded, data is loaded as part of FIT image.
* For FIT with external data, data is not loaded in this step.
*/
- fit = (void *)((CONFIG_SYS_TEXT_BASE - size - info->bl_len -
- align_len) & ~align_len);
+ hsize = (size + info->bl_len + align_len) & ~align_len;
+ fit = spl_get_load_buffer(-hsize, hsize);
sectors = get_aligned_image_size(info, size, 0);
count = info->read(info, sector, sectors, fit);
debug("fit read sector %lx, sectors=%d, dst=%p, count=%lu\n",