1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * (C) Copyright 2013 - 2014 Xilinx, Inc
4 *
5 * Michal Simek <michal.simek@xilinx.com>
6 */
7
8 #include <common.h>
9 #include <command.h>
10 #include <image.h>
11 #include <log.h>
12 #include <spl.h>
13 #include <asm/io.h>
14 #include <asm/u-boot.h>
15
16 bool boot_linux;
17
spl_boot_device(void)18 u32 spl_boot_device(void)
19 {
20 return BOOT_DEVICE_NOR;
21 }
22
23 /* Board initialization after bss clearance */
spl_board_init(void)24 void spl_board_init(void)
25 {
26 /* enable console uart printing */
27 preloader_console_init();
28 }
29
30 #ifdef CONFIG_SPL_OS_BOOT
jump_to_image_linux(struct spl_image_info * spl_image)31 void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
32 {
33 debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg);
34 typedef void (*image_entry_arg_t)(char *, ulong, ulong)
35 __attribute__ ((noreturn));
36 image_entry_arg_t image_entry =
37 (image_entry_arg_t)spl_image->entry_point;
38
39 image_entry(NULL, 0, (ulong)spl_image->arg);
40 }
41 #endif /* CONFIG_SPL_OS_BOOT */
42
spl_start_uboot(void)43 int 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 }
52
do_reset(struct cmd_tbl * cmdtp,int flag,int argc,char * const argv[])53 int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
54 {
55 __asm__ __volatile__ ("mts rmsr, r0;" \
56 "bra r0");
57
58 return 0;
59 }
60