2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2014-01-14 13:21:52 +00:00
|
|
|
/*
|
2018-01-17 06:37:47 +00:00
|
|
|
* (C) Copyright 2014 - 2017 Xilinx, Inc. Michal Simek
|
2014-01-14 13:21:52 +00:00
|
|
|
*/
|
|
|
|
#include <common.h>
|
2015-10-18 01:41:22 +00:00
|
|
|
#include <debug_uart.h>
|
2014-01-14 13:21:52 +00:00
|
|
|
#include <spl.h>
|
|
|
|
|
|
|
|
#include <asm/io.h>
|
2014-08-11 12:03:15 +00:00
|
|
|
#include <asm/spl.h>
|
2015-10-18 01:41:21 +00:00
|
|
|
#include <asm/arch/hardware.h>
|
2014-01-14 13:21:52 +00:00
|
|
|
#include <asm/arch/sys_proto.h>
|
2017-11-08 15:14:47 +00:00
|
|
|
#include <asm/arch/ps7_init_gpl.h>
|
2014-01-14 13:21:52 +00:00
|
|
|
|
|
|
|
void board_init_f(ulong dummy)
|
|
|
|
{
|
|
|
|
ps7_init();
|
|
|
|
|
|
|
|
arch_cpu_init();
|
2015-10-18 01:41:22 +00:00
|
|
|
/*
|
|
|
|
* The debug UART can be used from this point:
|
|
|
|
* debug_uart_init();
|
|
|
|
* printch('x');
|
|
|
|
*/
|
2014-01-14 13:21:52 +00:00
|
|
|
}
|
|
|
|
|
2014-04-25 10:15:40 +00:00
|
|
|
#ifdef CONFIG_SPL_BOARD_INIT
|
|
|
|
void spl_board_init(void)
|
|
|
|
{
|
2015-10-19 12:50:02 +00:00
|
|
|
preloader_console_init();
|
2014-04-25 10:15:40 +00:00
|
|
|
board_init();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-01-14 13:21:52 +00:00
|
|
|
u32 spl_boot_device(void)
|
|
|
|
{
|
|
|
|
u32 mode;
|
|
|
|
|
|
|
|
switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
|
|
|
|
#ifdef CONFIG_SPL_SPI_SUPPORT
|
|
|
|
case ZYNQ_BM_QSPI:
|
|
|
|
puts("qspi boot\n");
|
|
|
|
mode = BOOT_DEVICE_SPI;
|
|
|
|
break;
|
|
|
|
#endif
|
2015-01-13 15:04:10 +00:00
|
|
|
case ZYNQ_BM_NAND:
|
|
|
|
mode = BOOT_DEVICE_NAND;
|
|
|
|
break;
|
|
|
|
case ZYNQ_BM_NOR:
|
|
|
|
mode = BOOT_DEVICE_NOR;
|
|
|
|
break;
|
2014-01-14 13:21:52 +00:00
|
|
|
#ifdef CONFIG_SPL_MMC_SUPPORT
|
|
|
|
case ZYNQ_BM_SD:
|
|
|
|
puts("mmc boot\n");
|
|
|
|
mode = BOOT_DEVICE_MMC1;
|
|
|
|
break;
|
|
|
|
#endif
|
2015-01-13 15:04:10 +00:00
|
|
|
case ZYNQ_BM_JTAG:
|
|
|
|
mode = BOOT_DEVICE_RAM;
|
|
|
|
break;
|
2014-01-14 13:21:52 +00:00
|
|
|
default:
|
|
|
|
puts("Unsupported boot mode selected\n");
|
|
|
|
hang();
|
|
|
|
}
|
|
|
|
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_SPL_OS_BOOT
|
|
|
|
int spl_start_uboot(void)
|
|
|
|
{
|
|
|
|
/* boot linux */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
2014-05-12 03:18:30 +00:00
|
|
|
|
2016-05-10 05:55:52 +00:00
|
|
|
void spl_board_prepare_for_boot(void)
|
|
|
|
{
|
|
|
|
ps7_post_config();
|
|
|
|
debug("SPL bye\n");
|
|
|
|
}
|
|
|
|
|
2016-05-03 12:20:17 +00:00
|
|
|
#ifdef CONFIG_SPL_LOAD_FIT
|
|
|
|
int board_fit_config_name_match(const char *name)
|
|
|
|
{
|
|
|
|
/* Just empty function now - can't decide what to choose */
|
|
|
|
debug("%s: %s\n", __func__, name);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|