2012-08-31 08:30:09 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2012
|
|
|
|
* NVIDIA Inc, <www.nvidia.com>
|
|
|
|
*
|
|
|
|
* Allen Martin <amartin@nvidia.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2012-08-31 08:30:09 +00:00
|
|
|
*/
|
|
|
|
#include <common.h>
|
2017-07-25 14:29:57 +00:00
|
|
|
#include <debug_uart.h>
|
2012-10-19 21:08:23 +00:00
|
|
|
#include <spl.h>
|
2012-08-31 08:30:09 +00:00
|
|
|
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/arch/clock.h>
|
|
|
|
#include <asm/arch/pinmux.h>
|
2012-09-19 22:50:56 +00:00
|
|
|
#include <asm/arch/tegra.h>
|
2014-03-21 18:28:53 +00:00
|
|
|
#include <asm/arch-tegra/apb_misc.h>
|
2012-09-29 10:02:08 +00:00
|
|
|
#include <asm/arch-tegra/board.h>
|
2014-04-23 12:20:43 +00:00
|
|
|
#include <asm/spl.h>
|
2012-12-11 13:34:13 +00:00
|
|
|
#include "cpu.h"
|
2012-08-31 08:30:09 +00:00
|
|
|
|
2012-10-19 21:08:23 +00:00
|
|
|
void spl_board_init(void)
|
2012-08-31 08:30:09 +00:00
|
|
|
{
|
2014-03-21 18:28:53 +00:00
|
|
|
struct apb_misc_pp_ctlr *apb_misc =
|
|
|
|
(struct apb_misc_pp_ctlr *)NV_PA_APB_MISC_BASE;
|
2012-10-19 21:08:23 +00:00
|
|
|
|
|
|
|
/* enable JTAG */
|
2014-03-21 18:28:53 +00:00
|
|
|
writel(0xC0, &apb_misc->cfg_ctl);
|
2012-08-31 08:30:09 +00:00
|
|
|
|
|
|
|
board_init_uart_f();
|
|
|
|
|
|
|
|
/* Initialize periph GPIOs */
|
|
|
|
gpio_early_init_uart();
|
|
|
|
|
2012-10-19 21:08:23 +00:00
|
|
|
clock_early_init();
|
2017-07-25 14:29:57 +00:00
|
|
|
#ifdef CONFIG_DEBUG_UART
|
|
|
|
debug_uart_init();
|
|
|
|
#endif
|
2012-10-19 21:08:23 +00:00
|
|
|
preloader_console_init();
|
2012-08-31 08:30:09 +00:00
|
|
|
}
|
|
|
|
|
2012-10-19 21:08:23 +00:00
|
|
|
u32 spl_boot_device(void)
|
2012-08-31 08:30:09 +00:00
|
|
|
{
|
2012-10-19 21:08:23 +00:00
|
|
|
return BOOT_DEVICE_RAM;
|
2012-08-31 08:30:09 +00:00
|
|
|
}
|
|
|
|
|
2012-10-19 21:08:23 +00:00
|
|
|
void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
|
2012-08-31 08:30:09 +00:00
|
|
|
{
|
2017-01-02 11:48:31 +00:00
|
|
|
debug("image entry point: 0x%lX\n", spl_image->entry_point);
|
2012-08-31 08:30:09 +00:00
|
|
|
|
2012-10-19 21:08:23 +00:00
|
|
|
start_cpu((u32)spl_image->entry_point);
|
2012-08-31 08:30:09 +00:00
|
|
|
halt_avp();
|
|
|
|
}
|