Merge branch '2019-08-11-ti-imports'
[oweals/u-boot.git] / common / spl / spl_ext.c
index 559ba0b797126dc788ef243a67528771a90147d2..2a6252229ca157f2b3534ea12214bfb0cbc412fb 100644 (file)
@@ -1,8 +1,7 @@
-/*
- * SPDX-License-Identifier:    GPL-2.0+
- */
+// SPDX-License-Identifier: GPL-2.0+
 
 #include <common.h>
+#include <env.h>
 #include <spl.h>
 #include <asm/u-boot.h>
 #include <ext4fs.h>
@@ -18,8 +17,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
        loff_t filelen, actlen;
        disk_partition_t part_info = {};
 
-       header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
-                                               sizeof(struct image_header));
+       header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
 
        if (part_get_info(block_dev, partition, &part_info)) {
                printf("spl: no partition table found\n");