2018-11-15 02:07:52 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 MediaTek Inc.
|
|
|
|
* Author: Ryder Lee <ryder.lee@mediatek.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <clk.h>
|
|
|
|
#include <common.h>
|
2019-12-28 17:45:07 +00:00
|
|
|
#include <hang.h>
|
2020-05-10 17:40:02 +00:00
|
|
|
#include <init.h>
|
2018-11-15 02:07:52 +00:00
|
|
|
#include <spl.h>
|
|
|
|
|
|
|
|
#include "init.h"
|
|
|
|
|
|
|
|
void board_init_f(ulong dummy)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = spl_early_init();
|
|
|
|
if (ret)
|
|
|
|
hang();
|
|
|
|
|
|
|
|
/* enable console uart printing */
|
|
|
|
preloader_console_init();
|
|
|
|
|
|
|
|
/* soc early initialization */
|
|
|
|
ret = mtk_soc_early_init();
|
|
|
|
if (ret)
|
|
|
|
hang();
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 spl_boot_device(void)
|
|
|
|
{
|
2021-08-08 18:20:14 +00:00
|
|
|
#if defined(CONFIG_SPL_SPI)
|
2018-11-15 02:07:52 +00:00
|
|
|
return BOOT_DEVICE_SPI;
|
2021-08-08 18:20:09 +00:00
|
|
|
#elif defined(CONFIG_SPL_MMC)
|
2018-11-15 02:07:52 +00:00
|
|
|
return BOOT_DEVICE_MMC1;
|
|
|
|
#elif defined(CONFIG_SPL_NAND_SUPPORT)
|
|
|
|
return BOOT_DEVICE_NAND;
|
|
|
|
#elif defined(CONFIG_SPL_NOR_SUPPORT)
|
|
|
|
return BOOT_DEVICE_NOR;
|
|
|
|
#else
|
|
|
|
return BOOT_DEVICE_NONE;
|
|
|
|
#endif
|
|
|
|
}
|