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