blob: 9b3590ff3d20b0ec105a7c4e7df13dd9b4f45a25 [file] [log] [blame]
Ryder Leecbd2fba2018-11-15 10:07:52 +08001// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2018 MediaTek Inc.
4 * Author: Ryder Lee <ryder.lee@mediatek.com>
5 */
6
7#include <clk.h>
8#include <common.h>
9#include <spl.h>
10
11#include "init.h"
12
13void board_init_f(ulong dummy)
14{
15 int ret;
16
17 ret = spl_early_init();
18 if (ret)
19 hang();
20
21 /* enable console uart printing */
22 preloader_console_init();
23
24 /* soc early initialization */
25 ret = mtk_soc_early_init();
26 if (ret)
27 hang();
28}
29
30u32 spl_boot_device(void)
31{
32#if defined(CONFIG_SPL_SPI_SUPPORT)
33 return BOOT_DEVICE_SPI;
34#elif defined(CONFIG_SPL_MMC_SUPPORT)
35 return BOOT_DEVICE_MMC1;
36#elif defined(CONFIG_SPL_NAND_SUPPORT)
37 return BOOT_DEVICE_NAND;
38#elif defined(CONFIG_SPL_NOR_SUPPORT)
39 return BOOT_DEVICE_NOR;
40#else
41 return BOOT_DEVICE_NONE;
42#endif
43}