Merge branch 'master' of git://git.denx.de/u-boot-tegra
[platform/kernel/u-boot.git] / arch / arm / mach-uniphier / init / init-ld20.c
1 /*
2  * Copyright (C) 2016 Socionext Inc.
3  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9 #include <spl.h>
10
11 #include "../init.h"
12 #include "../micro-support-card.h"
13
14 int uniphier_ld20_init(const struct uniphier_board_data *bd)
15 {
16         uniphier_sbc_init_savepin(bd);
17         uniphier_pxs2_sbc_init(bd);
18         /* pins for NAND and System Bus are multiplexed */
19         if (spl_boot_device() != BOOT_DEVICE_NAND)
20                 uniphier_pin_init("system_bus_grp");
21
22         support_card_reset();
23
24         support_card_init();
25
26         led_puts("L0");
27
28         memconf_init(bd);
29         uniphier_pxs2_memconf_init(bd);
30
31         led_puts("L1");
32
33         uniphier_ld20_early_clk_init(bd);
34
35         led_puts("L2");
36
37 #ifdef CONFIG_SPL_SERIAL_SUPPORT
38         preloader_console_init();
39 #endif
40
41         led_puts("L3");
42
43         uniphier_ld20_dpll_init(bd);
44
45         led_puts("L4");
46
47         {
48                 int res;
49
50                 res = uniphier_ld20_umc_init(bd);
51                 if (res < 0) {
52                         while (1)
53                                 ;
54                 }
55         }
56
57         led_puts("L5");
58
59         dcache_disable();
60
61         return 0;
62 }