blob: 37b860a8b43f1be8eee6c235d8b6f5d4909d19a7 [file] [log] [blame]
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +09001/*
Masahiro Yamada68557ec2016-09-17 03:33:06 +09002 * Copyright (C) 2016 Socionext Inc.
3 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +09004 *
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
14int uniphier_ld20_init(const struct uniphier_board_data *bd)
15{
16 uniphier_sbc_init_savepin(bd);
Masahiro Yamada5eb41502016-04-28 15:37:15 +090017 uniphier_pxs2_sbc_init(bd);
Masahiro Yamadadacdb242016-09-26 13:13:16 +090018 /* pins for NAND and System Bus are multiplexed */
19 if (spl_boot_device() != BOOT_DEVICE_NAND)
20 uniphier_pin_init("system_bus_grp");
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +090021
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
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +090037#ifdef CONFIG_SPL_SERIAL_SUPPORT
38 preloader_console_init();
39#endif
40
Masahiro Yamada682e09f2016-09-17 03:33:11 +090041 led_puts("L3");
42
43 uniphier_ld20_dpll_init(bd);
44
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +090045 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
Masahiro Yamada0bd20202016-05-24 21:13:57 +090059 dcache_disable();
60
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +090061 return 0;
62}