Merge tag 'efi-2020-07-rc6' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
[oweals/u-boot.git] / common / spl / spl_xip.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
4  * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics.
5  */
6
7 #include <common.h>
8 #include <image.h>
9 #include <log.h>
10 #include <spl.h>
11
12 static int spl_xip(struct spl_image_info *spl_image,
13                    struct spl_boot_device *bootdev)
14 {
15 #ifdef CONFIG_SPL_OS_BOOT
16         if (!spl_start_uboot()) {
17                 spl_image->arg = (void *)CONFIG_SYS_FDT_BASE;
18                 spl_image->name = "Linux";
19                 spl_image->os = IH_OS_LINUX;
20                 spl_image->load_addr = CONFIG_SYS_LOAD_ADDR;
21                 spl_image->entry_point = CONFIG_SYS_LOAD_ADDR;
22                 debug("spl: payload xipImage, load addr: 0x%lx\n",
23                       spl_image->load_addr);
24                 return 0;
25         }
26 #endif
27         return(spl_parse_image_header(spl_image, (const struct image_header *)
28                CONFIG_SYS_UBOOT_BASE));
29 }
30 SPL_LOAD_IMAGE_METHOD("XIP", 0, BOOT_DEVICE_XIP, spl_xip);