blob: c633e83853ee1c4fc1191325d2d141cb20288a1b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Michal Simek26acb3e2014-01-21 07:30:37 +01002/*
3 * (C) Copyright 2013 - 2014 Xilinx, Inc
4 *
5 * Michal Simek <michal.simek@xilinx.com>
Michal Simek26acb3e2014-01-21 07:30:37 +01006 */
7
8#include <common.h>
Simon Glassed38aef2020-05-10 11:40:03 -06009#include <command.h>
Michal Simek26acb3e2014-01-21 07:30:37 +010010#include <image.h>
11#include <spl.h>
Michal Simek26acb3e2014-01-21 07:30:37 +010012#include <asm/io.h>
13#include <asm/u-boot.h>
14
Michal Simek26acb3e2014-01-21 07:30:37 +010015bool boot_linux;
16
17u32 spl_boot_device(void)
18{
19 return BOOT_DEVICE_NOR;
20}
21
22/* Board initialization after bss clearance */
23void spl_board_init(void)
24{
Michal Simek26acb3e2014-01-21 07:30:37 +010025 /* enable console uart printing */
26 preloader_console_init();
27}
28
29#ifdef CONFIG_SPL_OS_BOOT
Vikas Manocha62b021c2017-04-07 15:38:13 -070030void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
Michal Simek26acb3e2014-01-21 07:30:37 +010031{
Vikas Manocha62b021c2017-04-07 15:38:13 -070032 debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg);
Michal Simek26acb3e2014-01-21 07:30:37 +010033 typedef void (*image_entry_arg_t)(char *, ulong, ulong)
34 __attribute__ ((noreturn));
35 image_entry_arg_t image_entry =
Simon Glassb805c352016-09-24 18:19:54 -060036 (image_entry_arg_t)spl_image->entry_point;
Michal Simek26acb3e2014-01-21 07:30:37 +010037
Vikas Manocha62b021c2017-04-07 15:38:13 -070038 image_entry(NULL, 0, (ulong)spl_image->arg);
Michal Simek26acb3e2014-01-21 07:30:37 +010039}
40#endif /* CONFIG_SPL_OS_BOOT */
41
42int spl_start_uboot(void)
43{
44#ifdef CONFIG_SPL_OS_BOOT
45 if (boot_linux)
46 return 0;
47#endif
48
49 return 1;
50}
Michal Simek4e39ea82018-07-13 08:26:28 +020051
Simon Glassed38aef2020-05-10 11:40:03 -060052int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
Michal Simek4e39ea82018-07-13 08:26:28 +020053{
54 __asm__ __volatile__ ("mts rmsr, r0;" \
55 "bra r0");
56
57 return 0;
58}