spl_onenand.c 837 B

12345678910111213141516171819202122232425262728293031
  1. /*
  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. *
  9. * SPDX-License-Identifier: GPL-2.0+
  10. */
  11. #include <common.h>
  12. #include <config.h>
  13. #include <spl.h>
  14. #include <asm/io.h>
  15. #include <onenand_uboot.h>
  16. void spl_onenand_load_image(void)
  17. {
  18. struct image_header *header;
  19. debug("spl: onenand\n");
  20. /*use CONFIG_SYS_TEXT_BASE as temporary storage area */
  21. header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
  22. /* Load u-boot */
  23. onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS,
  24. CONFIG_SYS_ONENAND_PAGE_SIZE, (void *)header);
  25. spl_parse_image_header(header);
  26. onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS,
  27. spl_image.size, (void *)spl_image.load_addr);
  28. }