]> git.karo-electronics.de Git - karo-tx-uboot.git/blob - arch/arm/cpu/armv7/zynq/spl.c
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / zynq / spl.c
1 /*
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/spl.h>
12 #include <asm/arch/sys_proto.h>
13
14 DECLARE_GLOBAL_DATA_PTR;
15
16 void 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         preloader_console_init();
24         arch_cpu_init();
25         board_init_r(NULL, 0);
26 }
27
28 #ifdef CONFIG_SPL_BOARD_INIT
29 void spl_board_init(void)
30 {
31         board_init();
32 }
33 #endif
34
35 u32 spl_boot_device(void)
36 {
37         u32 mode;
38
39         switch ((zynq_slcr_get_boot_mode()) & ZYNQ_BM_MASK) {
40 #ifdef CONFIG_SPL_SPI_SUPPORT
41         case ZYNQ_BM_QSPI:
42                 puts("qspi boot\n");
43                 mode = BOOT_DEVICE_SPI;
44                 break;
45 #endif
46 #ifdef CONFIG_SPL_MMC_SUPPORT
47         case ZYNQ_BM_SD:
48                 puts("mmc boot\n");
49                 mode = BOOT_DEVICE_MMC1;
50                 break;
51 #endif
52         default:
53                 puts("Unsupported boot mode selected\n");
54                 hang();
55         }
56
57         return mode;
58 }
59
60 #ifdef CONFIG_SPL_MMC_SUPPORT
61 u32 spl_boot_mode(void)
62 {
63         return MMCSD_MODE_FS;
64 }
65 #endif
66
67 #ifdef CONFIG_SPL_OS_BOOT
68 int spl_start_uboot(void)
69 {
70         /* boot linux */
71         return 0;
72 }
73 #endif
74
75 __weak void ps7_init(void)
76 {
77         /*
78          * This function is overridden by the one in
79          * board/xilinx/zynq/ps7_init.c, if it exists.
80          */
81 }