blob: a1d504bbd277b3b3106be90e9b24ae4a9e78c010 [file] [log] [blame]
Philipp Tomsicha900e7c2017-06-12 10:33:20 +02001/*
2 * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <debug_uart.h>
9#include <dm.h>
10#include <dm/pinctrl.h>
11#include <ram.h>
12#include <spl.h>
13#include <asm/io.h>
14#include <asm/arch/cru_rk3368.h>
15#include <asm/arch/grf_rk3368.h>
16#include <asm/arch/hardware.h>
17#include <asm/arch/periph.h>
18#include <asm/arch/timer.h>
19
Philipp Tomsicha900e7c2017-06-12 10:33:20 +020020void board_debug_uart_init(void)
21{
22}
23
24void board_init_f(ulong dummy)
25{
26 struct udevice *pinctrl;
27 struct udevice *dev;
28 int ret;
29
30 ret = spl_early_init();
31 if (ret) {
32 debug("spl_early_init() failed: %d\n", ret);
33 hang();
34 }
35
Philipp Tomsicha900e7c2017-06-12 10:33:20 +020036 /* Set up our preloader console */
37 ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
38 if (ret) {
Masahiro Yamada81e10422017-09-16 14:10:41 +090039 pr_err("%s: pinctrl init failed: %d\n", __func__, ret);
Philipp Tomsicha900e7c2017-06-12 10:33:20 +020040 hang();
41 }
42
43 ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART0);
44 if (ret) {
Masahiro Yamada81e10422017-09-16 14:10:41 +090045 pr_err("%s: failed to set up console UART\n", __func__);
Philipp Tomsicha900e7c2017-06-12 10:33:20 +020046 hang();
47 }
48
49 preloader_console_init();
50
51 ret = uclass_get_device(UCLASS_RAM, 0, &dev);
52 if (ret) {
53 debug("DRAM init failed: %d\n", ret);
54 return;
55 }
56}
57
Philipp Tomsicha900e7c2017-06-12 10:33:20 +020058u32 spl_boot_device(void)
59{
60 return BOOT_DEVICE_MMC1;
61}
62
63#ifdef CONFIG_SPL_LOAD_FIT
64int board_fit_config_name_match(const char *name)
65{
66 /* Just empty function now - can't decide what to choose */
67 debug("%s: %s\n", __func__, name);
68
69 return 0;
70}
71#endif