blob: 070c12cce9ecc1c9e9a60503ff6530f337b1f3b6 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Michal Simek9d242742014-01-21 07:30:37 +01002/*
3 * (C) Copyright 2013 - 2014 Xilinx, Inc
4 *
5 * Michal Simek <michal.simek@xilinx.com>
Michal Simek9d242742014-01-21 07:30:37 +01006 */
7
8#include <common.h>
9#include <image.h>
10#include <spl.h>
Michal Simek9d242742014-01-21 07:30:37 +010011#include <asm/io.h>
12#include <asm/u-boot.h>
13
Michal Simek9d242742014-01-21 07:30:37 +010014bool boot_linux;
15
16u32 spl_boot_device(void)
17{
18 return BOOT_DEVICE_NOR;
19}
20
21/* Board initialization after bss clearance */
22void spl_board_init(void)
23{
Michal Simek9d242742014-01-21 07:30:37 +010024 /* enable console uart printing */
25 preloader_console_init();
26}
27
28#ifdef CONFIG_SPL_OS_BOOT
Vikas Manocha5bf52502017-04-07 15:38:13 -070029void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
Michal Simek9d242742014-01-21 07:30:37 +010030{
Vikas Manocha5bf52502017-04-07 15:38:13 -070031 debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg);
Michal Simek9d242742014-01-21 07:30:37 +010032 typedef void (*image_entry_arg_t)(char *, ulong, ulong)
33 __attribute__ ((noreturn));
34 image_entry_arg_t image_entry =
Simon Glassca12e652016-09-24 18:19:54 -060035 (image_entry_arg_t)spl_image->entry_point;
Michal Simek9d242742014-01-21 07:30:37 +010036
Vikas Manocha5bf52502017-04-07 15:38:13 -070037 image_entry(NULL, 0, (ulong)spl_image->arg);
Michal Simek9d242742014-01-21 07:30:37 +010038}
39#endif /* CONFIG_SPL_OS_BOOT */
40
41int spl_start_uboot(void)
42{
43#ifdef CONFIG_SPL_OS_BOOT
44 if (boot_linux)
45 return 0;
46#endif
47
48 return 1;
49}
Michal Simek4a693662018-07-13 08:26:28 +020050
51int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
52{
53 __asm__ __volatile__ ("mts rmsr, r0;" \
54 "bra r0");
55
56 return 0;
57}