xref: /openbmc/u-boot/arch/powerpc/lib/spl.c (revision 713cb680)
1 /*
2  * Copyright 2012 Stefan Roese <sr@denx.de>
3  *
4  * See file CREDITS for list of people who contributed to this
5  * project.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  */
17 #include <common.h>
18 #include <config.h>
19 #include <spl.h>
20 #include <image.h>
21 #include <linux/compiler.h>
22 
23 DECLARE_GLOBAL_DATA_PTR;
24 
25 /*
26  * This function jumps to an image with argument. Normally an FDT or ATAGS
27  * image.
28  * arg: Pointer to paramter image in RAM
29  */
30 #ifdef CONFIG_SPL_OS_BOOT
31 void __noreturn jump_to_image_linux(void *arg)
32 {
33 	debug("Entering kernel arg pointer: 0x%p\n", arg);
34 	typedef void (*image_entry_arg_t)(void *, ulong r4, ulong r5, ulong r6,
35 					  ulong r7, ulong r8, ulong r9)
36 		__attribute__ ((noreturn));
37 	image_entry_arg_t image_entry =
38 		(image_entry_arg_t)spl_image.entry_point;
39 
40 	image_entry(arg, 0, 0, EPAPR_MAGIC, CONFIG_SYS_BOOTMAPSZ, 0, 0);
41 }
42 #endif /* CONFIG_SPL_OS_BOOT */
43