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 | * |
Michal Simek | a8c9436 | 2023-07-10 14:35:49 +0200 | [diff] [blame] | 5 | * Michal Simek <michal.simek@amd.com> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 8 | #include <command.h> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 9 | #include <image.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 10 | #include <log.h> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 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> |
Ovidiu Panait | 9f97ced | 2021-11-30 18:33:57 +0200 | [diff] [blame] | 14 | #include <linux/stringify.h> |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 15 | |
Ovidiu Panait | 3d68e1f | 2021-11-30 18:33:50 +0200 | [diff] [blame] | 16 | void board_boot_order(u32 *spl_boot_list) |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 17 | { |
Ovidiu Panait | 3d68e1f | 2021-11-30 18:33:50 +0200 | [diff] [blame] | 18 | spl_boot_list[0] = BOOT_DEVICE_NOR; |
| 19 | spl_boot_list[1] = BOOT_DEVICE_RAM; |
| 20 | spl_boot_list[2] = BOOT_DEVICE_SPI; |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | /* Board initialization after bss clearance */ |
| 24 | void spl_board_init(void) |
| 25 | { |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 26 | /* enable console uart printing */ |
| 27 | preloader_console_init(); |
| 28 | } |
| 29 | |
| 30 | #ifdef CONFIG_SPL_OS_BOOT |
Vikas Manocha | 62b021c | 2017-04-07 15:38:13 -0700 | [diff] [blame] | 31 | void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 32 | { |
Vikas Manocha | 62b021c | 2017-04-07 15:38:13 -0700 | [diff] [blame] | 33 | debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg); |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 34 | typedef void (*image_entry_arg_t)(char *, ulong, ulong) |
| 35 | __attribute__ ((noreturn)); |
| 36 | image_entry_arg_t image_entry = |
Simon Glass | b805c35 | 2016-09-24 18:19:54 -0600 | [diff] [blame] | 37 | (image_entry_arg_t)spl_image->entry_point; |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 38 | |
Vikas Manocha | 62b021c | 2017-04-07 15:38:13 -0700 | [diff] [blame] | 39 | image_entry(NULL, 0, (ulong)spl_image->arg); |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 40 | } |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 41 | |
| 42 | int spl_start_uboot(void) |
| 43 | { |
Ovidiu Panait | adc2891 | 2023-01-25 18:41:56 +0200 | [diff] [blame] | 44 | return 0; |
Michal Simek | 26acb3e | 2014-01-21 07:30:37 +0100 | [diff] [blame] | 45 | } |
Ovidiu Panait | d482acd | 2023-01-25 18:41:55 +0200 | [diff] [blame] | 46 | #endif /* CONFIG_SPL_OS_BOOT */ |
Michal Simek | 4e39ea8 | 2018-07-13 08:26:28 +0200 | [diff] [blame] | 47 | |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 48 | 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] | 49 | { |
Ovidiu Panait | 9f97ced | 2021-11-30 18:33:57 +0200 | [diff] [blame] | 50 | __asm__ __volatile__ ( |
| 51 | "mts rmsr, r0;" \ |
| 52 | "brai " __stringify(CONFIG_XILINX_MICROBLAZE0_VECTOR_BASE_ADDR)); |
Michal Simek | 4e39ea8 | 2018-07-13 08:26:28 +0200 | [diff] [blame] | 53 | |
| 54 | return 0; |
| 55 | } |