]> git.ipfire.org Git - people/ms/u-boot.git/blame - arch/arm/mach-zynq/spl.c
spl: eMMC/SD: Provide one __weak spl_boot_mode() function
[people/ms/u-boot.git] / arch / arm / mach-zynq / spl.c
CommitLineData
d7e269cf 1/*
3e1b61de 2 * (C) Copyright 2014 - 2017 Xilinx, Inc. Michal Simek
d7e269cf
MS
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6#include <common.h>
c54c0a4c 7#include <debug_uart.h>
d7e269cf
MS
8#include <spl.h>
9
10#include <asm/io.h>
ae2ee77f 11#include <asm/spl.h>
bd44758a 12#include <asm/arch/hardware.h>
d7e269cf 13#include <asm/arch/sys_proto.h>
f0b619ec 14#include <asm/arch/ps7_init_gpl.h>
d7e269cf
MS
15
16DECLARE_GLOBAL_DATA_PTR;
17
18void board_init_f(ulong dummy)
19{
20 ps7_init();
21
d7e269cf 22 arch_cpu_init();
c54c0a4c
SG
23 /*
24 * The debug UART can be used from this point:
25 * debug_uart_init();
26 * printch('x');
27 */
d7e269cf
MS
28}
29
1540fb72
MS
30#ifdef CONFIG_SPL_BOARD_INIT
31void spl_board_init(void)
32{
5fa030b9 33 preloader_console_init();
1540fb72
MS
34 board_init();
35}
36#endif
37
d7e269cf
MS
38u32 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
63e3cea5
MS
49 case ZYNQ_BM_NAND:
50 mode = BOOT_DEVICE_NAND;
51 break;
52 case ZYNQ_BM_NOR:
53 mode = BOOT_DEVICE_NOR;
54 break;
d7e269cf
MS
55#ifdef CONFIG_SPL_MMC_SUPPORT
56 case ZYNQ_BM_SD:
57 puts("mmc boot\n");
58 mode = BOOT_DEVICE_MMC1;
59 break;
60#endif
63e3cea5
MS
61 case ZYNQ_BM_JTAG:
62 mode = BOOT_DEVICE_RAM;
63 break;
d7e269cf
MS
64 default:
65 puts("Unsupported boot mode selected\n");
66 hang();
67 }
68
69 return mode;
70}
71
d7e269cf
MS
72#ifdef CONFIG_SPL_OS_BOOT
73int spl_start_uboot(void)
74{
75 /* boot linux */
76 return 0;
77}
78#endif
66e6715c 79
f44e603f
MS
80void spl_board_prepare_for_boot(void)
81{
82 ps7_post_config();
83 debug("SPL bye\n");
84}
85
9a23f458
MS
86#ifdef CONFIG_SPL_LOAD_FIT
87int board_fit_config_name_match(const char *name)
88{
89 /* Just empty function now - can't decide what to choose */
90 debug("%s: %s\n", __func__, name);
91
92 return 0;
93}
94#endif