blob: af61ded42efe070ffe6d3102748a69c2735f57d7 [file] [log] [blame]
Stefan Roeseb0f80b92015-01-19 11:33:42 +01001/*
2 * Copyright (C) 2014 Stefan Roese <sr@denx.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <spl.h>
9#include <asm/io.h>
10#include <asm/arch/cpu.h>
11#include <asm/arch/soc.h>
12
13DECLARE_GLOBAL_DATA_PTR;
14
15u32 spl_boot_device(void)
16{
Stefan Roese8ed43b92015-07-20 11:20:36 +020017#if defined(CONFIG_SPL_SPI_FLASH_SUPPORT)
Stefan Roeseb0f80b92015-01-19 11:33:42 +010018 return BOOT_DEVICE_SPI;
Stefan Roese8ed43b92015-07-20 11:20:36 +020019#endif
20#if defined(CONFIG_SPL_MMC_SUPPORT)
21 return BOOT_DEVICE_MMC1;
22#endif
Stefan Roeseb0f80b92015-01-19 11:33:42 +010023}
24
Stefan Roese8ed43b92015-07-20 11:20:36 +020025#ifdef CONFIG_SPL_MMC_SUPPORT
26u32 spl_boot_mode(void)
27{
28 return MMCSD_MODE_RAW;
29}
30#endif
31
Stefan Roeseb0f80b92015-01-19 11:33:42 +010032void board_init_f(ulong dummy)
33{
34 /* Set global data pointer */
35 gd = &gdata;
36
37 /* Linux expects the internal registers to be at 0xf1000000 */
38 arch_cpu_init();
39
Stefan Roesee3cccf92015-04-17 18:13:06 +020040 /*
41 * Pin muxing needs to be done before UART output, since
42 * on A38x the UART pins need some re-muxing for output
43 * to work.
44 */
45 board_early_init_f();
46
Stefan Roeseb0f80b92015-01-19 11:33:42 +010047 preloader_console_init();
48
Stefan Roeseade741b2015-07-15 15:36:52 +020049 timer_init();
50
Stefan Roeseb0f80b92015-01-19 11:33:42 +010051 /* First init the serdes PHY's */
52 serdes_phy_config();
53
54 /* Setup DDR */
55 ddr3_init();
56
57 board_init_r(NULL, 0);
58}