Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Vikas Manocha | c6d9e9d | 2017-05-28 12:55:11 -0700 | [diff] [blame] | 2 | /* |
Patrice Chotard | 3bc599c | 2017-10-23 09:53:58 +0200 | [diff] [blame] | 3 | * Copyright (C) 2017, STMicroelectronics - All Rights Reserved |
| 4 | * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics. |
Vikas Manocha | c6d9e9d | 2017-05-28 12:55:11 -0700 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Simon Glass | 4d72caa | 2020-05-10 11:40:01 -0600 | [diff] [blame] | 8 | #include <image.h> |
Simon Glass | f7ae49f | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 9 | #include <log.h> |
Vikas Manocha | c6d9e9d | 2017-05-28 12:55:11 -0700 | [diff] [blame] | 10 | #include <spl.h> |
| 11 | |
| 12 | static int spl_xip(struct spl_image_info *spl_image, |
| 13 | struct spl_boot_device *bootdev) |
| 14 | { |
Tom Rini | 7115007 | 2021-10-30 23:03:48 -0400 | [diff] [blame] | 15 | #if CONFIG_IS_ENABLED(OS_BOOT) |
Vikas Manocha | c6d9e9d | 2017-05-28 12:55:11 -0700 | [diff] [blame] | 16 | if (!spl_start_uboot()) { |
Tom Rini | b4b9a00 | 2022-05-27 22:06:52 -0400 | [diff] [blame] | 17 | spl_image->arg = (void *)CONFIG_SYS_SPL_ARGS_ADDR; |
Vikas Manocha | c6d9e9d | 2017-05-28 12:55:11 -0700 | [diff] [blame] | 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 |
Pali Rohár | 2e0429b | 2022-01-14 14:31:38 +0100 | [diff] [blame] | 27 | return(spl_parse_image_header(spl_image, bootdev, |
Tom Rini | 65cc0e2 | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 28 | (const struct legacy_img_hdr *)CFG_SYS_UBOOT_BASE)); |
Vikas Manocha | c6d9e9d | 2017-05-28 12:55:11 -0700 | [diff] [blame] | 29 | } |
| 30 | SPL_LOAD_IMAGE_METHOD("XIP", 0, BOOT_DEVICE_XIP, spl_xip); |