blob: a34d3a167cc57533e432e43ccf3fd8c1f7952f33 [file] [log] [blame]
Masahiro Yamada5894ca02014-10-03 19:21:06 +09001/*
Masahiro Yamada35adfc42015-02-05 14:42:55 +09002 * Copyright (C) 2013-2015 Panasonic Corporation
Masahiro Yamada499785b2015-03-23 00:07:25 +09003 * Copyright (C) 2015 Socionext Inc.
4 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamada5894ca02014-10-03 19:21:06 +09005 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9#include <common.h>
10#include <spl.h>
Masahiro Yamada35adfc42015-02-05 14:42:55 +090011#include <linux/compiler.h>
Masahiro Yamadaa86ac952015-02-27 02:26:44 +090012#include <mach/led.h>
13#include <mach/board.h>
Masahiro Yamada35adfc42015-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 Yamada6cc21202015-02-27 02:27:04 +090022void memconf_init(void);
Masahiro Yamada198a97a2015-02-27 02:26:51 +090023void early_clkrst_init(void);
Masahiro Yamada7d1a3a62015-03-23 00:07:23 +090024void early_pin_init(void);
Masahiro Yamada35adfc42015-02-05 14:42:55 +090025int umc_init(void);
26void enable_dpll_ssc(void);
Masahiro Yamada5894ca02014-10-03 19:21:06 +090027
28void spl_board_init(void)
29{
Masahiro Yamada35adfc42015-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 Yamada6cc21202015-02-27 02:27:04 +090044 memconf_init();
Masahiro Yamada35adfc42015-02-05 14:42:55 +090045
46 led_write(L, 1, , );
47
Masahiro Yamada6cc21202015-02-27 02:27:04 +090048 early_clkrst_init();
49
50 led_write(L, 2, , );
51
Masahiro Yamada7d1a3a62015-03-23 00:07:23 +090052 early_pin_init();
53
54 led_write(L, 3, , );
55
Masahiro Yamada499785b2015-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 Yamada35adfc42015-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 Yamada499785b2015-03-23 00:07:25 +090071 led_write(L, 5, , );
Masahiro Yamada35adfc42015-02-05 14:42:55 +090072
73 enable_dpll_ssc();
74
Masahiro Yamada499785b2015-03-23 00:07:25 +090075 led_write(L, 6, , );
Masahiro Yamada5894ca02014-10-03 19:21:06 +090076}