blob: 86522f84479460102e739db78d4c23c06229f635 [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>
Simon Glass0f2af882020-05-10 11:40:05 -060011#include <log.h>
Michal Simek26acb3e2014-01-21 07:30:37 +010012#include <spl.h>
Michal Simek26acb3e2014-01-21 07:30:37 +010013#include <asm/io.h>
14#include <asm/u-boot.h>
15
Michal Simek26acb3e2014-01-21 07:30:37 +010016bool boot_linux;
17
18u32 spl_boot_device(void)
19{
20 return BOOT_DEVICE_NOR;
21}
22
23/* Board initialization after bss clearance */
24void spl_board_init(void)
25{
Michal Simek26acb3e2014-01-21 07:30:37 +010026 /* enable console uart printing */
27 preloader_console_init();
28}
29
30#ifdef CONFIG_SPL_OS_BOOT
Vikas Manocha62b021c2017-04-07 15:38:13 -070031void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
Michal Simek26acb3e2014-01-21 07:30:37 +010032{
Vikas Manocha62b021c2017-04-07 15:38:13 -070033 debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg);
Michal Simek26acb3e2014-01-21 07:30:37 +010034 typedef void (*image_entry_arg_t)(char *, ulong, ulong)
35 __attribute__ ((noreturn));
36 image_entry_arg_t image_entry =
Simon Glassb805c352016-09-24 18:19:54 -060037 (image_entry_arg_t)spl_image->entry_point;
Michal Simek26acb3e2014-01-21 07:30:37 +010038
Vikas Manocha62b021c2017-04-07 15:38:13 -070039 image_entry(NULL, 0, (ulong)spl_image->arg);
Michal Simek26acb3e2014-01-21 07:30:37 +010040}
41#endif /* CONFIG_SPL_OS_BOOT */
42
43int spl_start_uboot(void)
44{
45#ifdef CONFIG_SPL_OS_BOOT
46 if (boot_linux)
47 return 0;
48#endif
49
50 return 1;
51}
Michal Simek4e39ea82018-07-13 08:26:28 +020052
Simon Glassed38aef2020-05-10 11:40:03 -060053int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
Michal Simek4e39ea82018-07-13 08:26:28 +020054{
55 __asm__ __volatile__ ("mts rmsr, r0;" \
56 "bra r0");
57
58 return 0;
59}