blob: fcad762c030644d3d004cebbbdba9670a9b638a4 [file] [log] [blame]
Michal Simeke60148d2014-01-14 14:21:52 +01001/*
2 * (C) Copyright 2014 Xilinx, Inc. Michal Simek
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6#include <common.h>
7#include <spl.h>
8
9#include <asm/io.h>
10#include <asm/arch/hardware.h>
11#include <asm/arch/spl.h>
12#include <asm/arch/sys_proto.h>
13
14DECLARE_GLOBAL_DATA_PTR;
15
16void board_init_f(ulong dummy)
17{
18 ps7_init();
19
20 /* Clear the BSS. */
21 memset(__bss_start, 0, __bss_end - __bss_start);
22
23 /* Set global data pointer. */
24 gd = &gdata;
25
26 preloader_console_init();
27 arch_cpu_init();
28 board_init_r(NULL, 0);
29}
30
31u32 spl_boot_device(void)
32{
33 u32 mode;
34
35 switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
36#ifdef CONFIG_SPL_SPI_SUPPORT
37 case ZYNQ_BM_QSPI:
38 puts("qspi boot\n");
39 mode = BOOT_DEVICE_SPI;
40 break;
41#endif
42#ifdef CONFIG_SPL_MMC_SUPPORT
43 case ZYNQ_BM_SD:
44 puts("mmc boot\n");
45 mode = BOOT_DEVICE_MMC1;
46 break;
47#endif
48 default:
49 puts("Unsupported boot mode selected\n");
50 hang();
51 }
52
53 return mode;
54}
55
56#ifdef CONFIG_SPL_MMC_SUPPORT
57u32 spl_boot_mode(void)
58{
59 return MMCSD_MODE_FAT;
60}
61#endif
62
63#ifdef CONFIG_SPL_OS_BOOT
64int spl_start_uboot(void)
65{
66 /* boot linux */
67 return 0;
68}
69#endif