blob: a34d3a167cc57533e432e43ccf3fd8c1f7952f33 [file] [log] [blame]
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +09001/*
Masahiro Yamada24ee11f2015-02-05 14:42:55 +09002 * Copyright (C) 2013-2015 Panasonic Corporation
Masahiro Yamada6b23db82015-03-23 00:07:25 +09003 * Copyright (C) 2015 Socionext Inc.
4 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +09005 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9#include <common.h>
10#include <spl.h>
Masahiro Yamada24ee11f2015-02-05 14:42:55 +090011#include <linux/compiler.h>
Masahiro Yamada95387e22015-02-27 02:26:44 +090012#include <mach/led.h>
13#include <mach/board.h>
Masahiro Yamada24ee11f2015-02-05 14:42:55 +090014
15void __weak bcu_init(void)
16{
17};
18void sbc_init(void);
19void sg_init(void);
20void pll_init(void);
21void pin_init(void);
Masahiro Yamadae28001b2015-02-27 02:27:04 +090022void memconf_init(void);
Masahiro Yamadac04368f2015-02-27 02:26:51 +090023void early_clkrst_init(void);
Masahiro Yamada0c2eeee2015-03-23 00:07:23 +090024void early_pin_init(void);
Masahiro Yamada24ee11f2015-02-05 14:42:55 +090025int umc_init(void);
26void enable_dpll_ssc(void);
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090027
28void spl_board_init(void)
29{
Masahiro Yamada24ee11f2015-02-05 14:42:55 +090030 bcu_init();
31
32 sbc_init();
33
34 sg_init();
35
36 uniphier_board_reset();
37
38 pll_init();
39
40 uniphier_board_init();
41
42 led_write(L, 0, , );
43
Masahiro Yamadae28001b2015-02-27 02:27:04 +090044 memconf_init();
Masahiro Yamada24ee11f2015-02-05 14:42:55 +090045
46 led_write(L, 1, , );
47
Masahiro Yamadae28001b2015-02-27 02:27:04 +090048 early_clkrst_init();
49
50 led_write(L, 2, , );
51
Masahiro Yamada0c2eeee2015-03-23 00:07:23 +090052 early_pin_init();
53
54 led_write(L, 3, , );
55
Masahiro Yamada6b23db82015-03-23 00:07:25 +090056#ifdef CONFIG_SPL_SERIAL_SUPPORT
57 preloader_console_init();
58#endif
59
60 led_write(L, 4, , );
61
Masahiro Yamada24ee11f2015-02-05 14:42:55 +090062 {
63 int res;
64
65 res = umc_init();
66 if (res < 0) {
67 while (1)
68 ;
69 }
70 }
Masahiro Yamada6b23db82015-03-23 00:07:25 +090071 led_write(L, 5, , );
Masahiro Yamada24ee11f2015-02-05 14:42:55 +090072
73 enable_dpll_ssc();
74
Masahiro Yamada6b23db82015-03-23 00:07:25 +090075 led_write(L, 6, , );
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090076}