Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2013 - 2014 Xilinx, Inc |
| 4 | * |
| 5 | * Michal Simek <michal.simek@xilinx.com> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <image.h> |
| 10 | #include <spl.h> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 11 | #include <asm/io.h> |
| 12 | #include <asm/u-boot.h> |
| 13 | |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 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 | { |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 24 | /* enable console uart printing */ |
| 25 | preloader_console_init(); |
| 26 | } |
| 27 | |
| 28 | #ifdef CONFIG_SPL_OS_BOOT |
Vikas Manocha | 62b021c | 2017-04-07 15:38:13 -0700 | [diff] [blame] | 29 | void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 30 | { |
Vikas Manocha | 62b021c | 2017-04-07 15:38:13 -0700 | [diff] [blame] | 31 | debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg); |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 32 | typedef void (*image_entry_arg_t)(char *, ulong, ulong) |
| 33 | __attribute__ ((noreturn)); |
| 34 | image_entry_arg_t image_entry = |
Simon Glass | b805c35 | 2016-09-24 18:19:54 -0600 | [diff] [blame] | 35 | (image_entry_arg_t)spl_image->entry_point; |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 36 | |
Vikas Manocha | 62b021c | 2017-04-07 15:38:13 -0700 | [diff] [blame] | 37 | image_entry(NULL, 0, (ulong)spl_image->arg); |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 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 | } |