Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2013 - 2014 Xilinx, Inc |
| 3 | * |
| 4 | * Michal Simek <michal.simek@xilinx.com> |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <image.h> |
| 11 | #include <spl.h> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 12 | #include <asm/io.h> |
| 13 | #include <asm/u-boot.h> |
| 14 | |
| 15 | DECLARE_GLOBAL_DATA_PTR; |
| 16 | |
| 17 | bool boot_linux; |
| 18 | |
| 19 | u32 spl_boot_device(void) |
| 20 | { |
| 21 | return BOOT_DEVICE_NOR; |
| 22 | } |
| 23 | |
| 24 | /* Board initialization after bss clearance */ |
| 25 | void spl_board_init(void) |
| 26 | { |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 27 | /* enable console uart printing */ |
| 28 | preloader_console_init(); |
| 29 | } |
| 30 | |
| 31 | #ifdef CONFIG_SPL_OS_BOOT |
Simon Glass | b805c35 | 2016-09-24 18:19:54 -0600 | [diff] [blame] | 32 | void __noreturn jump_to_image_linux(struct spl_image_info *spl_image, void *arg) |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 33 | { |
| 34 | debug("Entering kernel arg pointer: 0x%p\n", arg); |
| 35 | typedef void (*image_entry_arg_t)(char *, ulong, ulong) |
| 36 | __attribute__ ((noreturn)); |
| 37 | image_entry_arg_t image_entry = |
Simon Glass | b805c35 | 2016-09-24 18:19:54 -0600 | [diff] [blame] | 38 | (image_entry_arg_t)spl_image->entry_point; |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 39 | |
| 40 | image_entry(NULL, 0, (ulong)arg); |
| 41 | } |
| 42 | #endif /* CONFIG_SPL_OS_BOOT */ |
| 43 | |
| 44 | int spl_start_uboot(void) |
| 45 | { |
| 46 | #ifdef CONFIG_SPL_OS_BOOT |
| 47 | if (boot_linux) |
| 48 | return 0; |
| 49 | #endif |
| 50 | |
| 51 | return 1; |
| 52 | } |