microblaze: migrate CONFIG_SYS_USR_EXCEP to Kconfig
[platform/kernel/u-boot.git] / arch / microblaze / cpu / spl.c
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
18 void board_boot_order(u32 *spl_boot_list)
19 {
20         spl_boot_list[0] = BOOT_DEVICE_NOR;
21         spl_boot_list[1] = BOOT_DEVICE_RAM;
22         spl_boot_list[2] = BOOT_DEVICE_SPI;
23 }
24
25 /* Board initialization after bss clearance */
26 void spl_board_init(void)
27 {
28         /* enable console uart printing */
29         preloader_console_init();
30 }
31
32 #ifdef CONFIG_SPL_OS_BOOT
33 void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
34 {
35         debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg);
36         typedef void (*image_entry_arg_t)(char *, ulong, ulong)
37                 __attribute__ ((noreturn));
38         image_entry_arg_t image_entry =
39                 (image_entry_arg_t)spl_image->entry_point;
40
41         image_entry(NULL, 0, (ulong)spl_image->arg);
42 }
43 #endif /* CONFIG_SPL_OS_BOOT */
44
45 int spl_start_uboot(void)
46 {
47 #ifdef CONFIG_SPL_OS_BOOT
48         if (boot_linux)
49                 return 0;
50 #endif
51
52         return 1;
53 }
54
55 int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
56 {
57         __asm__ __volatile__ ("mts rmsr, r0;" \
58                               "bra r0");
59
60         return 0;
61 }