3 * Corscience GmbH & Co. KG - Simon Schwarz <schwarz@corscience.de>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #include <asm/u-boot.h>
25 #include <asm/utils.h>
26 #include <asm/arch/sys_proto.h>
29 #include <asm/omap_common.h>
32 void spl_nand_load_image(void)
34 struct image_header *header;
35 switch (omap_boot_mode()) {
36 case NAND_MODE_HW_ECC:
37 debug("spl: nand - using hw ecc\n");
42 puts("spl: ERROR: This bootmode is not implemented - hanging");
46 /*use CONFIG_SYS_TEXT_BASE as temporary storage area */
47 header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
49 #ifdef CONFIG_NAND_ENV_DST
50 nand_spl_load_image(CONFIG_ENV_OFFSET,
51 CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
52 spl_parse_image_header(header);
53 nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
54 (void *)image_load_addr);
55 #ifdef CONFIG_ENV_OFFSET_REDUND
56 nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
57 CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
58 spl_parse_image_header(header);
59 nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
60 (void *)image_load_addr);
64 nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
65 CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
66 spl_parse_image_header(header);
67 nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
68 spl_image.size, (void *)spl_image.load_addr);