blob: d73e5cbaa745a23c74b511fa866d3e51096f4db6 [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
Michal Simeka831f1f2014-04-25 12:15:40 +020031#ifdef CONFIG_SPL_BOARD_INIT
32void spl_board_init(void)
33{
34 board_init();
35}
36#endif
37
Michal Simeke60148d2014-01-14 14:21:52 +010038u32 spl_boot_device(void)
39{
40 u32 mode;
41
42 switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
43#ifdef CONFIG_SPL_SPI_SUPPORT
44 case ZYNQ_BM_QSPI:
45 puts("qspi boot\n");
46 mode = BOOT_DEVICE_SPI;
47 break;
48#endif
49#ifdef CONFIG_SPL_MMC_SUPPORT
50 case ZYNQ_BM_SD:
51 puts("mmc boot\n");
52 mode = BOOT_DEVICE_MMC1;
53 break;
54#endif
55 default:
56 puts("Unsupported boot mode selected\n");
57 hang();
58 }
59
60 return mode;
61}
62
63#ifdef CONFIG_SPL_MMC_SUPPORT
64u32 spl_boot_mode(void)
65{
66 return MMCSD_MODE_FAT;
67}
68#endif
69
70#ifdef CONFIG_SPL_OS_BOOT
71int spl_start_uboot(void)
72{
73 /* boot linux */
74 return 0;
75}
76#endif
Masahiro Yamadac2d10792014-05-12 12:18:30 +090077
78__weak void ps7_init(void)
79{
80 /*
81 * This function is overridden by the one in
82 * board/xilinx/zynq/ps7_init.c, if it exists.
83 */
84}