blob: 77c23ba05978b2c301541cad49e03e948aa2ae13 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Vikas Manochac6d9e9d2017-05-28 12:55:11 -07002/*
Patrice Chotard3bc599c2017-10-23 09:53:58 +02003 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
4 * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics.
Vikas Manochac6d9e9d2017-05-28 12:55:11 -07005 */
6
7#include <common.h>
Simon Glass4d72caa2020-05-10 11:40:01 -06008#include <image.h>
Simon Glassf7ae49f2020-05-10 11:40:05 -06009#include <log.h>
Vikas Manochac6d9e9d2017-05-28 12:55:11 -070010#include <spl.h>
11
12static int spl_xip(struct spl_image_info *spl_image,
13 struct spl_boot_device *bootdev)
14{
Tom Rini71150072021-10-30 23:03:48 -040015#if CONFIG_IS_ENABLED(OS_BOOT)
Vikas Manochac6d9e9d2017-05-28 12:55:11 -070016 if (!spl_start_uboot()) {
Tom Rinib4b9a002022-05-27 22:06:52 -040017 spl_image->arg = (void *)CONFIG_SYS_SPL_ARGS_ADDR;
Vikas Manochac6d9e9d2017-05-28 12:55:11 -070018 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
Pali Rohár2e0429b2022-01-14 14:31:38 +010027 return(spl_parse_image_header(spl_image, bootdev,
Tom Rini65cc0e22022-11-16 13:10:41 -050028 (const struct legacy_img_hdr *)CFG_SYS_UBOOT_BASE));
Vikas Manochac6d9e9d2017-05-28 12:55:11 -070029}
30SPL_LOAD_IMAGE_METHOD("XIP", 0, BOOT_DEVICE_XIP, spl_xip);