1 // SPDX-License-Identifier: GPL-2.0+
4 * ISEE 2007 SL - Enric Balletbo i Serra <eballetbo@iseebcn.com>
6 * Based on common/spl/spl_nand.c
8 * Corscience GmbH & Co. KG - Simon Schwarz <schwarz@corscience.de>
14 #include <onenand_uboot.h>
16 static int spl_onenand_load_image(struct spl_image_info *spl_image,
17 struct spl_boot_device *bootdev)
19 struct image_header *header;
22 debug("spl: onenand\n");
24 header = spl_get_load_buffer(0, CONFIG_SYS_ONENAND_PAGE_SIZE);
26 onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS,
27 CONFIG_SYS_ONENAND_PAGE_SIZE, (void *)header);
28 ret = spl_parse_image_header(spl_image, header);
31 onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS,
32 spl_image->size, (void *)spl_image->load_addr);
36 /* Use priorty 1 so that Ubi can override this */
37 SPL_LOAD_IMAGE_METHOD("OneNAND", 1, BOOT_DEVICE_ONENAND,
38 spl_onenand_load_image);