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