2014-01-14 13:21:52 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2014 Xilinx, Inc. Michal Simek
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
#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>
|
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
|
|
|
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_MMC_SUPPORT
|
|
|
|
u32 spl_boot_mode(void)
|
|
|
|
{
|
2014-10-15 15:53:11 +00:00
|
|
|
return MMCSD_MODE_FS;
|
2014-01-14 13:21:52 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_SPL_OS_BOOT
|
|
|
|
int spl_start_uboot(void)
|
|
|
|
{
|
|
|
|
/* boot linux */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
2014-05-12 03:18:30 +00:00
|
|
|
|
|
|
|
__weak void ps7_init(void)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* This function is overridden by the one in
|
ARM: zynq: add default ps7_init_gpl.c/h for Zed, MicroZed, ZC70x
Due to licensing issues, the files ps7_init.c/h are not able to be
distributed with U-Boot source code. Recent Xilinx tools also
provide the GPL variants (ps7_init_gpl.c/h), compatible with U-Boot
license.
Prior to this commit, we had to copy ps7_init files into
board/xilinx/zynq/ before the compile.
To be more user-friendly, let's include ps7_init_gpl.c/h for
Zedboard, MicroZed, ZC702, ZC706.
These init code have been taken from the hwplatform_templates
directory of Xilinx SDK 2014.4.
You can still use customized ps7_init_gpl.c/h by enabling
CONFIG_ZYNQ_CUSTOM_INIT. The recommended directory for storing them
is now board/xilinx/zynq/custom_hw_platform, but board/xilinx/zynq
is still supported for backward compatibility. The latter emits
a warning message to prompt users to gradually switch to the new
directory.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2015-05-18 06:31:52 +00:00
|
|
|
* board/xilinx/zynq/(platform)/ps7_init_gpl.c, if it exists.
|
2014-05-12 03:18:30 +00:00
|
|
|
*/
|
|
|
|
}
|
2016-05-03 12:20:17 +00:00
|
|
|
|
2016-05-10 05:55:52 +00:00
|
|
|
__weak int ps7_post_config(void)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* This function is overridden by the one in
|
|
|
|
* board/xilinx/zynq/(platform)/ps7_init_gpl.c, if it exists.
|
|
|
|
*/
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|