blob: a9a1c39c73e0ef31175242e488a7910d56c2ea0c [file] [log] [blame]
Allen Martine60ab6e2012-08-31 08:30:09 +00001/*
2 * (C) Copyright 2012
3 * NVIDIA Inc, <www.nvidia.com>
4 *
5 * Allen Martin <amartin@nvidia.com>
6 *
7 * See file CREDITS for list of people who contributed to this
8 * project.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA
24 */
25#include <common.h>
Allen Martin36ea6272012-10-19 21:08:23 +000026#include <spl.h>
Allen Martine60ab6e2012-08-31 08:30:09 +000027
28#include <asm/io.h>
Allen Martine60ab6e2012-08-31 08:30:09 +000029#include <asm/arch/clock.h>
Allen Martine60ab6e2012-08-31 08:30:09 +000030#include <asm/arch/pinmux.h>
Tom Warrenab371962012-09-19 15:50:56 -070031#include <asm/arch/tegra.h>
Lucas Stache80f7ca2012-09-29 10:02:08 +000032#include <asm/arch-tegra/board.h>
Allen Martin36ea6272012-10-19 21:08:23 +000033#include <asm/arch/spl.h>
Tom Warren9c79abe2012-12-11 13:34:13 +000034#include "cpu.h"
Allen Martine60ab6e2012-08-31 08:30:09 +000035
Allen Martin36ea6272012-10-19 21:08:23 +000036void spl_board_init(void)
Allen Martine60ab6e2012-08-31 08:30:09 +000037{
Allen Martin36ea6272012-10-19 21:08:23 +000038 struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
Allen Martine60ab6e2012-08-31 08:30:09 +000039
Allen Martin36ea6272012-10-19 21:08:23 +000040 /* enable JTAG */
41 writel(0xC0, &pmt->pmt_cfg_ctl);
42
Allen Martine60ab6e2012-08-31 08:30:09 +000043 board_init_uart_f();
44
45 /* Initialize periph GPIOs */
Allen Martine60ab6e2012-08-31 08:30:09 +000046 gpio_early_init_uart();
Allen Martine60ab6e2012-08-31 08:30:09 +000047
Allen Martin36ea6272012-10-19 21:08:23 +000048 clock_early_init();
49 preloader_console_init();
Allen Martine60ab6e2012-08-31 08:30:09 +000050}
51
Allen Martin36ea6272012-10-19 21:08:23 +000052u32 spl_boot_device(void)
Allen Martine60ab6e2012-08-31 08:30:09 +000053{
Allen Martin36ea6272012-10-19 21:08:23 +000054 return BOOT_DEVICE_RAM;
Allen Martine60ab6e2012-08-31 08:30:09 +000055}
56
Allen Martin36ea6272012-10-19 21:08:23 +000057void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
Allen Martine60ab6e2012-08-31 08:30:09 +000058{
Allen Martin36ea6272012-10-19 21:08:23 +000059 debug("image entry point: 0x%X\n", spl_image->entry_point);
Allen Martine60ab6e2012-08-31 08:30:09 +000060
Allen Martin36ea6272012-10-19 21:08:23 +000061 start_cpu((u32)spl_image->entry_point);
Allen Martine60ab6e2012-08-31 08:30:09 +000062 halt_avp();
Allen Martine60ab6e2012-08-31 08:30:09 +000063}