3 * NVIDIA Inc, <www.nvidia.com>
5 * Allen Martin <amartin@nvidia.com>
7 * See file CREDITS for list of people who contributed to this
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.
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.
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,
26 #include <asm/u-boot.h>
27 #include <asm/utils.h>
35 #include <linux/compiler.h>
39 #include <asm/arch/clock.h>
40 #include <asm/arch/pinmux.h>
41 #include <asm/arch/tegra.h>
42 #include <asm/arch-tegra/board.h>
43 #include <asm/arch-tegra/clk_rst.h>
44 #include <asm/arch-tegra/pmc.h>
45 #include <asm/arch-tegra/scu.h>
46 #include <asm/arch-tegra/sys_proto.h>
48 DECLARE_GLOBAL_DATA_PTR;
50 /* Define global data structure pointer to it*/
51 static gd_t gdata __attribute__ ((section(".data")));
52 static bd_t bdata __attribute__ ((section(".data")));
54 inline void hang(void)
56 puts("### ERROR ### Please RESET the board ###\n");
61 void board_init_f(ulong dummy)
65 /* Initialize periph GPIOs */
66 gpio_early_init_uart();
69 * We call relocate_code() with relocation target same as the
70 * CONFIG_SYS_SPL_TEXT_BASE. This will result in relocation getting
71 * skipped. Instead, only .bss initialization will happen. That's
74 debug(">>board_init_f()\n");
75 relocate_code(CONFIG_SPL_STACK, &gdata, CONFIG_SPL_TEXT_BASE);
78 /* This requires UART clocks to be enabled */
79 static void preloader_console_init(void)
81 const char *u_boot_rev = U_BOOT_VERSION;
85 gd->flags |= GD_FLG_RELOC;
86 gd->baudrate = CONFIG_BAUDRATE;
88 serial_init(); /* serial communications setup */
92 /* Avoid a second "U-Boot" coming from this string */
93 u_boot_rev = &u_boot_rev[7];
95 printf("\nU-Boot SPL %s (%s - %s)\n", u_boot_rev, U_BOOT_DATE,
99 void board_init_r(gd_t *id, ulong dummy)
101 struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
104 writel(0xC0, &pmt->pmt_cfg_ctl);
106 debug(">>spl:board_init_r()\n");
108 mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
109 CONFIG_SYS_SPL_MALLOC_SIZE);
111 #ifdef CONFIG_SPL_BOARD_INIT
117 preloader_console_init();
119 start_cpu((u32)CONFIG_SYS_TEXT_BASE);
124 int board_usb_init(const void *blob)