blob: c280ab7d0f9c89bc60fec15077709087999da0fe [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 Martine60ab6e2012-08-31 08:30:09 +000026#include "cpu.h"
Allen Martin36ea6272012-10-19 21:08:23 +000027#include <spl.h>
Allen Martine60ab6e2012-08-31 08:30:09 +000028
29#include <asm/io.h>
Allen Martine60ab6e2012-08-31 08:30:09 +000030#include <asm/arch/clock.h>
Allen Martine60ab6e2012-08-31 08:30:09 +000031#include <asm/arch/pinmux.h>
Tom Warrenab371962012-09-19 15:50:56 -070032#include <asm/arch/tegra.h>
Lucas Stache80f7ca2012-09-29 10:02:08 +000033#include <asm/arch-tegra/board.h>
Allen Martin36ea6272012-10-19 21:08:23 +000034#include <asm/arch/spl.h>
Allen Martine60ab6e2012-08-31 08:30:09 +000035
Allen Martine60ab6e2012-08-31 08:30:09 +000036
Allen Martin36ea6272012-10-19 21:08:23 +000037void spl_board_init(void)
Allen Martine60ab6e2012-08-31 08:30:09 +000038{
Allen Martin36ea6272012-10-19 21:08:23 +000039 struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
Allen Martine60ab6e2012-08-31 08:30:09 +000040
Allen Martin36ea6272012-10-19 21:08:23 +000041 /* enable JTAG */
42 writel(0xC0, &pmt->pmt_cfg_ctl);
43
Allen Martine60ab6e2012-08-31 08:30:09 +000044 board_init_uart_f();
45
46 /* Initialize periph GPIOs */
Allen Martine60ab6e2012-08-31 08:30:09 +000047 gpio_early_init_uart();
Allen Martine60ab6e2012-08-31 08:30:09 +000048
Allen Martin36ea6272012-10-19 21:08:23 +000049 clock_early_init();
50 preloader_console_init();
Allen Martine60ab6e2012-08-31 08:30:09 +000051}
52
Allen Martin36ea6272012-10-19 21:08:23 +000053u32 spl_boot_device(void)
Allen Martine60ab6e2012-08-31 08:30:09 +000054{
Allen Martin36ea6272012-10-19 21:08:23 +000055 return BOOT_DEVICE_RAM;
Allen Martine60ab6e2012-08-31 08:30:09 +000056}
57
Allen Martin36ea6272012-10-19 21:08:23 +000058void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
Allen Martine60ab6e2012-08-31 08:30:09 +000059{
Allen Martin36ea6272012-10-19 21:08:23 +000060 debug("image entry point: 0x%X\n", spl_image->entry_point);
Allen Martine60ab6e2012-08-31 08:30:09 +000061
Allen Martin36ea6272012-10-19 21:08:23 +000062 start_cpu((u32)spl_image->entry_point);
Allen Martine60ab6e2012-08-31 08:30:09 +000063 halt_avp();
Allen Martine60ab6e2012-08-31 08:30:09 +000064}