2 * Copyright (C) 2012 Stefan Roese <sr@denx.de>
4 * SPDX-License-Identifier: GPL-2.0+
10 void spl_nor_load_image(void)
13 * Loading of the payload to SDRAM is done with skipping of
14 * the mkimage header in this SPL NOR driver
16 spl_image.flags |= SPL_COPY_PAYLOAD_ONLY;
18 #ifdef CONFIG_SPL_OS_BOOT
19 if (!spl_start_uboot()) {
20 const struct image_header *header;
23 * Load Linux from its location in NOR flash to its defined
26 header = (const struct image_header *)CONFIG_SYS_OS_BASE;
28 if (image_get_os(header) == IH_OS_LINUX) {
29 /* happy - was a Linux */
31 spl_parse_image_header(header);
33 memcpy((void *)spl_image.load_addr,
34 (void *)(CONFIG_SYS_OS_BASE +
35 sizeof(struct image_header)),
39 * Copy DT blob (fdt) to SDRAM. Passing pointer to
40 * flash doesn't work (16 KiB should be enough for DT)
42 memcpy((void *)CONFIG_SYS_SPL_ARGS_ADDR,
43 (void *)(CONFIG_SYS_FDT_BASE),
48 puts("The Expected Linux image was not found.\n"
49 "Please check your NOR configuration.\n"
50 "Trying to start u-boot now...\n");
56 * Load real U-Boot from its location in NOR flash to its
57 * defined location in SDRAM
59 spl_parse_image_header(
60 (const struct image_header *)CONFIG_SYS_UBOOT_BASE);
62 memcpy((void *)spl_image.load_addr,
63 (void *)(CONFIG_SYS_UBOOT_BASE + sizeof(struct image_header)),