blob: 4c3cad3b88baf0fd40a7ca5f0d88175eae138760 [file] [log] [blame]
Masahiro Yamada5894ca02014-10-03 19:21:06 +09001/*
Masahiro Yamada13862332015-09-11 20:17:44 +09002 * Copyright (C) 2013-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamada5894ca02014-10-03 19:21:06 +09003 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <spl.h>
Masahiro Yamada35adfc42015-02-05 14:42:55 +09009#include <linux/compiler.h>
Masahiro Yamada84697002015-09-22 00:27:31 +090010#include <mach/micro-support-card.h>
Masahiro Yamada35adfc42015-02-05 14:42:55 +090011
12void __weak bcu_init(void)
13{
14};
Masahiro Yamada11f3afe2015-09-11 20:17:43 +090015
Masahiro Yamadac8df23c2015-09-22 00:27:33 +090016void __weak sbc_init(void)
17{
18};
19
Masahiro Yamada13862332015-09-11 20:17:44 +090020void __weak sg_init(void)
21{
22};
23
Masahiro Yamada11f3afe2015-09-11 20:17:43 +090024void __weak early_pin_init(void)
25{
26};
27
Masahiro Yamada35adfc42015-02-05 14:42:55 +090028void sbc_init(void);
29void sg_init(void);
30void pll_init(void);
31void pin_init(void);
Masahiro Yamada6cc21202015-02-27 02:27:04 +090032void memconf_init(void);
Masahiro Yamada198a97a2015-02-27 02:26:51 +090033void early_clkrst_init(void);
Masahiro Yamada7d1a3a62015-03-23 00:07:23 +090034void early_pin_init(void);
Masahiro Yamada35adfc42015-02-05 14:42:55 +090035int umc_init(void);
36void enable_dpll_ssc(void);
Masahiro Yamada5894ca02014-10-03 19:21:06 +090037
38void spl_board_init(void)
39{
Masahiro Yamada35adfc42015-02-05 14:42:55 +090040 bcu_init();
41
42 sbc_init();
43
44 sg_init();
45
Masahiro Yamada0b198672015-09-22 00:27:30 +090046 support_card_reset();
Masahiro Yamada35adfc42015-02-05 14:42:55 +090047
48 pll_init();
49
Masahiro Yamada0b198672015-09-22 00:27:30 +090050 support_card_init();
Masahiro Yamada35adfc42015-02-05 14:42:55 +090051
Masahiro Yamada84697002015-09-22 00:27:31 +090052 led_puts("L0");
Masahiro Yamada35adfc42015-02-05 14:42:55 +090053
Masahiro Yamada6cc21202015-02-27 02:27:04 +090054 memconf_init();
Masahiro Yamada35adfc42015-02-05 14:42:55 +090055
Masahiro Yamada84697002015-09-22 00:27:31 +090056 led_puts("L1");
Masahiro Yamada35adfc42015-02-05 14:42:55 +090057
Masahiro Yamada6cc21202015-02-27 02:27:04 +090058 early_clkrst_init();
59
Masahiro Yamada84697002015-09-22 00:27:31 +090060 led_puts("L2");
Masahiro Yamada6cc21202015-02-27 02:27:04 +090061
Masahiro Yamada7d1a3a62015-03-23 00:07:23 +090062 early_pin_init();
63
Masahiro Yamada84697002015-09-22 00:27:31 +090064 led_puts("L3");
Masahiro Yamada7d1a3a62015-03-23 00:07:23 +090065
Masahiro Yamada499785b2015-03-23 00:07:25 +090066#ifdef CONFIG_SPL_SERIAL_SUPPORT
67 preloader_console_init();
68#endif
69
Masahiro Yamada84697002015-09-22 00:27:31 +090070 led_puts("L4");
Masahiro Yamada499785b2015-03-23 00:07:25 +090071
Masahiro Yamada35adfc42015-02-05 14:42:55 +090072 {
73 int res;
74
75 res = umc_init();
76 if (res < 0) {
77 while (1)
78 ;
79 }
80 }
Masahiro Yamada84697002015-09-22 00:27:31 +090081
82 led_puts("L5");
Masahiro Yamada35adfc42015-02-05 14:42:55 +090083
84 enable_dpll_ssc();
85
Masahiro Yamada84697002015-09-22 00:27:31 +090086 led_puts("L6");
Masahiro Yamada5894ca02014-10-03 19:21:06 +090087}