blob: af7d82eb62f39959c1a2b194ec879e11fb0c9bb5 [file] [log] [blame]
Enric Balletbo i Serrad6b5eed2013-02-07 23:14:48 +00001/*
2 * Copyright (C) 2013
3 * ISEE 2007 SL - Enric Balletbo i Serra <eballetbo@iseebcn.com>
4 *
5 * Based on common/spl/spl_nand.c
6 * Copyright (C) 2011
7 * Corscience GmbH & Co. KG - Simon Schwarz <schwarz@corscience.de>
8 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02009 * SPDX-License-Identifier: GPL-2.0+
Enric Balletbo i Serrad6b5eed2013-02-07 23:14:48 +000010 */
11#include <common.h>
12#include <config.h>
13#include <spl.h>
14#include <asm/io.h>
15#include <onenand_uboot.h>
16
Nikita Kiryanov33eefe42015-11-08 17:11:49 +020017int spl_onenand_load_image(void)
Enric Balletbo i Serrad6b5eed2013-02-07 23:14:48 +000018{
19 struct image_header *header;
20
21 debug("spl: onenand\n");
22
23 /*use CONFIG_SYS_TEXT_BASE as temporary storage area */
24 header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
25 /* Load u-boot */
26 onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS,
27 CONFIG_SYS_ONENAND_PAGE_SIZE, (void *)header);
28 spl_parse_image_header(header);
29 onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS,
30 spl_image.size, (void *)spl_image.load_addr);
Nikita Kiryanov33eefe42015-11-08 17:11:49 +020031
32 return 0;
Enric Balletbo i Serrad6b5eed2013-02-07 23:14:48 +000033}