2011-11-01 20:00:29 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011
|
|
|
|
* Heiko Schocher, DENX Software Engineering, hs@denx.de.
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2011-11-01 20:00:29 +00:00
|
|
|
*/
|
|
|
|
#include <common.h>
|
2012-08-14 19:27:13 +00:00
|
|
|
#include <config.h>
|
|
|
|
#include <spl.h>
|
2011-11-01 20:00:29 +00:00
|
|
|
#include <asm/u-boot.h>
|
|
|
|
#include <asm/utils.h>
|
|
|
|
#include <nand.h>
|
|
|
|
#include <asm/arch/dm365_lowlevel.h>
|
|
|
|
#include <ns16550.h>
|
2011-12-09 09:47:36 +00:00
|
|
|
#include <malloc.h>
|
|
|
|
#include <spi_flash.h>
|
2012-06-24 21:35:20 +00:00
|
|
|
#include <mmc.h>
|
2011-12-09 09:47:36 +00:00
|
|
|
|
2011-12-14 08:54:36 +00:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
2011-11-01 20:00:29 +00:00
|
|
|
|
2012-08-14 19:27:13 +00:00
|
|
|
#ifndef CONFIG_SPL_LIBCOMMON_SUPPORT
|
2011-11-01 20:00:29 +00:00
|
|
|
void puts(const char *str)
|
|
|
|
{
|
|
|
|
while (*str)
|
|
|
|
putc(*str++);
|
|
|
|
}
|
|
|
|
|
|
|
|
void putc(char c)
|
|
|
|
{
|
|
|
|
if (c == '\n')
|
|
|
|
NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), '\r');
|
|
|
|
|
|
|
|
NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), c);
|
|
|
|
}
|
2011-12-09 09:47:36 +00:00
|
|
|
#endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */
|
|
|
|
|
2015-01-22 14:38:10 +00:00
|
|
|
void spl_board_init(void)
|
2011-11-01 20:00:29 +00:00
|
|
|
{
|
2011-12-09 09:47:36 +00:00
|
|
|
#ifdef CONFIG_SOC_DM365
|
2011-11-01 20:00:29 +00:00
|
|
|
dm36x_lowlevel_init(0);
|
2011-12-09 09:47:36 +00:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SOC_DA8XX
|
|
|
|
arch_cpu_init();
|
|
|
|
#endif
|
2012-08-14 19:27:13 +00:00
|
|
|
preloader_console_init();
|
|
|
|
}
|
2012-06-24 21:35:18 +00:00
|
|
|
|
2016-05-14 21:42:07 +00:00
|
|
|
u32 spl_boot_mode(const u32 boot_device)
|
2012-08-14 19:27:13 +00:00
|
|
|
{
|
|
|
|
return MMCSD_MODE_RAW;
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 spl_boot_device(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_SPL_NAND_SIMPLE
|
|
|
|
return BOOT_DEVICE_NAND;
|
|
|
|
#elif defined(CONFIG_SPL_SPI_LOAD)
|
|
|
|
return BOOT_DEVICE_SPI;
|
|
|
|
#elif defined(CONFIG_SPL_MMC_LOAD)
|
|
|
|
return BOOT_DEVICE_MMC1;
|
|
|
|
#else
|
|
|
|
puts("Unknown boot device\n");
|
|
|
|
hang();
|
2012-06-24 21:35:20 +00:00
|
|
|
#endif
|
2011-11-01 20:00:29 +00:00
|
|
|
}
|