2020-04-21 07:28:47 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 MediaTek Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Author: Weijie Gao <weijie.gao@mediatek.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2020-05-10 17:40:02 +00:00
|
|
|
#include <init.h>
|
2020-04-21 07:28:47 +00:00
|
|
|
#include <spl.h>
|
|
|
|
#include <asm/sections.h>
|
2020-10-31 03:38:53 +00:00
|
|
|
#include <linux/libfdt.h>
|
2020-04-21 07:28:47 +00:00
|
|
|
#include <linux/sizes.h>
|
|
|
|
#include <mach/serial.h>
|
|
|
|
|
|
|
|
void __noreturn board_init_f(ulong dummy)
|
|
|
|
{
|
|
|
|
spl_init();
|
|
|
|
|
2021-08-08 18:20:12 +00:00
|
|
|
#ifdef CONFIG_SPL_SERIAL
|
2020-04-21 07:28:47 +00:00
|
|
|
/*
|
|
|
|
* mtmips_spl_serial_init() is useful if debug uart is enabled,
|
|
|
|
* or DM based serial is not enabled.
|
|
|
|
*/
|
|
|
|
mtmips_spl_serial_init();
|
|
|
|
preloader_console_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
board_init_r(NULL, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void board_boot_order(u32 *spl_boot_list)
|
|
|
|
{
|
|
|
|
spl_boot_list[0] = BOOT_DEVICE_NOR;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long spl_nor_get_uboot_base(void)
|
|
|
|
{
|
|
|
|
void *uboot_base = __image_copy_end;
|
|
|
|
|
|
|
|
if (fdt_magic(uboot_base) == FDT_MAGIC)
|
|
|
|
return (unsigned long)uboot_base + fdt_totalsize(uboot_base);
|
|
|
|
|
|
|
|
return (unsigned long)uboot_base;
|
|
|
|
}
|