blob: 521776705786aef848a3ee31e5f1f94cc2a0cb91 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Michal Simek26acb3e2014-01-21 07:30:37 +01002/*
3 * (C) Copyright 2013 - 2014 Xilinx, Inc
4 *
Michal Simeka8c94362023-07-10 14:35:49 +02005 * Michal Simek <michal.simek@amd.com>
Michal Simek26acb3e2014-01-21 07:30:37 +01006 */
7
Simon Glassed38aef2020-05-10 11:40:03 -06008#include <command.h>
Michal Simek26acb3e2014-01-21 07:30:37 +01009#include <image.h>
Simon Glass0f2af882020-05-10 11:40:05 -060010#include <log.h>
Michal Simek26acb3e2014-01-21 07:30:37 +010011#include <spl.h>
Michal Simek26acb3e2014-01-21 07:30:37 +010012#include <asm/io.h>
Ovidiu Panait9f97ced2021-11-30 18:33:57 +020013#include <linux/stringify.h>
Michal Simek26acb3e2014-01-21 07:30:37 +010014
Ovidiu Panait3d68e1f2021-11-30 18:33:50 +020015void board_boot_order(u32 *spl_boot_list)
Michal Simek26acb3e2014-01-21 07:30:37 +010016{
Ovidiu Panait3d68e1f2021-11-30 18:33:50 +020017 spl_boot_list[0] = BOOT_DEVICE_NOR;
18 spl_boot_list[1] = BOOT_DEVICE_RAM;
19 spl_boot_list[2] = BOOT_DEVICE_SPI;
Michal Simek26acb3e2014-01-21 07:30:37 +010020}
21
22/* Board initialization after bss clearance */
23void spl_board_init(void)
24{
Michal Simek26acb3e2014-01-21 07:30:37 +010025 /* enable console uart printing */
26 preloader_console_init();
27}
28
29#ifdef CONFIG_SPL_OS_BOOT
Vikas Manocha62b021c2017-04-07 15:38:13 -070030void __noreturn jump_to_image_linux(struct spl_image_info *spl_image)
Michal Simek26acb3e2014-01-21 07:30:37 +010031{
Vikas Manocha62b021c2017-04-07 15:38:13 -070032 debug("Entering kernel arg pointer: 0x%p\n", spl_image->arg);
Michal Simek26acb3e2014-01-21 07:30:37 +010033 typedef void (*image_entry_arg_t)(char *, ulong, ulong)
34 __attribute__ ((noreturn));
35 image_entry_arg_t image_entry =
Simon Glassb805c352016-09-24 18:19:54 -060036 (image_entry_arg_t)spl_image->entry_point;
Michal Simek26acb3e2014-01-21 07:30:37 +010037
Vikas Manocha62b021c2017-04-07 15:38:13 -070038 image_entry(NULL, 0, (ulong)spl_image->arg);
Michal Simek26acb3e2014-01-21 07:30:37 +010039}
Michal Simek26acb3e2014-01-21 07:30:37 +010040
41int spl_start_uboot(void)
42{
Ovidiu Panaitadc28912023-01-25 18:41:56 +020043 return 0;
Michal Simek26acb3e2014-01-21 07:30:37 +010044}
Ovidiu Panaitd482acd2023-01-25 18:41:55 +020045#endif /* CONFIG_SPL_OS_BOOT */
Michal Simek4e39ea82018-07-13 08:26:28 +020046
Simon Glassed38aef2020-05-10 11:40:03 -060047int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
Michal Simek4e39ea82018-07-13 08:26:28 +020048{
Ovidiu Panait9f97ced2021-11-30 18:33:57 +020049 __asm__ __volatile__ (
50 "mts rmsr, r0;" \
51 "brai " __stringify(CONFIG_XILINX_MICROBLAZE0_VECTOR_BASE_ADDR));
Michal Simek4e39ea82018-07-13 08:26:28 +020052
53 return 0;
54}