xref: /openbmc/u-boot/arch/microblaze/cpu/spl.c (revision 87a62bce)
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 <image.h>
10 #include <spl.h>
11 #include <asm/io.h>
12 #include <asm/u-boot.h>
13 
14 bool boot_linux;
15 
16 u32 spl_boot_device(void)
17 {
18 	return BOOT_DEVICE_NOR;
19 }
20 
21 /* Board initialization after bss clearance */
22 void spl_board_init(void)
23 {
24 	/* enable console uart printing */
25 	preloader_console_init();
26 }
27 
28 #ifdef CONFIG_SPL_OS_BOOT
29 void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
30 {
31 	debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg);
32 	typedef void (*image_entry_arg_t)(char *, ulong, ulong)
33 		__attribute__ ((noreturn));
34 	image_entry_arg_t image_entry =
35 		(image_entry_arg_t)spl_image->entry_point;
36 
37 	image_entry(NULL, 0, (ulong)spl_image->arg);
38 }
39 #endif /* CONFIG_SPL_OS_BOOT */
40 
41 int 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 }
50