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> |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 9 | #include <command.h> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 10 | #include <image.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 11 | #include <log.h> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 12 | #include <spl.h> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 13 | #include <asm/io.h> |
| 14 | #include <asm/u-boot.h> |
Ovidiu Panait | 9f97ced | 2021-11-30 18:33:57 +0200 | [diff] [blame] | 15 | #include <linux/stringify.h> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 16 | |
Ovidiu Panait | 3d68e1f | 2021-11-30 18:33:50 +0200 | [diff] [blame] | 17 | void board_boot_order(u32 *spl_boot_list) |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 18 | { |
Ovidiu Panait | 3d68e1f | 2021-11-30 18:33:50 +0200 | [diff] [blame] | 19 | spl_boot_list[0] = BOOT_DEVICE_NOR; |
| 20 | spl_boot_list[1] = BOOT_DEVICE_RAM; |
| 21 | spl_boot_list[2] = BOOT_DEVICE_SPI; |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 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 |
Vikas Manocha | 62b021c | 2017-04-07 15:38:13 -0700 | [diff] [blame] | 32 | void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 33 | { |
Vikas Manocha | 62b021c | 2017-04-07 15:38:13 -0700 | [diff] [blame] | 34 | debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg); |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 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 | |
Vikas Manocha | 62b021c | 2017-04-07 15:38:13 -0700 | [diff] [blame] | 40 | image_entry(NULL, 0, (ulong)spl_image->arg); |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 41 | } |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 42 | |
| 43 | int spl_start_uboot(void) |
| 44 | { |
Ovidiu Panait | adc2891 | 2023-01-25 18:41:56 +0200 | [diff] [blame] | 45 | return 0; |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 46 | } |
Ovidiu Panait | d482acd | 2023-01-25 18:41:55 +0200 | [diff] [blame] | 47 | #endif /* CONFIG_SPL_OS_BOOT */ |
Michal Simek | 4e39ea8 | 2018-07-13 08:26:28 +0200 | [diff] [blame] | 48 | |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 49 | int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
Michal Simek | 4e39ea8 | 2018-07-13 08:26:28 +0200 | [diff] [blame] | 50 | { |
Ovidiu Panait | 9f97ced | 2021-11-30 18:33:57 +0200 | [diff] [blame] | 51 | __asm__ __volatile__ ( |
| 52 | "mts rmsr, r0;" \ |
| 53 | "brai " __stringify(CONFIG_XILINX_MICROBLAZE0_VECTOR_BASE_ADDR)); |
Michal Simek | 4e39ea8 | 2018-07-13 08:26:28 +0200 | [diff] [blame] | 54 | |
| 55 | return 0; |
| 56 | } |