Merge branch 'master' of git://git.denx.de/u-boot-socfpga
[oweals/u-boot.git] / common / spl / spl_onenand.c
index fc98e9cbe5806bbe376bb09993747dd2e540924d..ee30f328e6027e92a22f0b387b7aa326c467dbae 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2013
  * ISEE 2007 SL - Enric Balletbo i Serra <eballetbo@iseebcn.com>
@@ -5,8 +6,6 @@
  * Based on common/spl/spl_nand.c
  * Copyright (C) 2011
  * Corscience GmbH & Co. KG - Simon Schwarz <schwarz@corscience.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <config.h>
@@ -22,8 +21,7 @@ static int spl_onenand_load_image(struct spl_image_info *spl_image,
 
        debug("spl: onenand\n");
 
-       /*use CONFIG_SYS_TEXT_BASE as temporary storage area */
-       header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
+       header = spl_get_load_buffer(0, CONFIG_SYS_ONENAND_PAGE_SIZE);
        /* Load u-boot */
        onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS,
                CONFIG_SYS_ONENAND_PAGE_SIZE, (void *)header);