blob: 661d73ae4a4628831248cfbc32277fdfe4f8b783 [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 Yamadaa86ac952015-02-27 02:26:44 +090010#include <mach/led.h>
11#include <mach/board.h>
Masahiro Yamada35adfc42015-02-05 14:42:55 +090012
13void __weak bcu_init(void)
14{
15};
Masahiro Yamada11f3afe2015-09-11 20:17:43 +090016
Masahiro Yamada13862332015-09-11 20:17:44 +090017void __weak sg_init(void)
18{
19};
20
Masahiro Yamada11f3afe2015-09-11 20:17:43 +090021void __weak early_pin_init(void)
22{
23};
24
Masahiro Yamada35adfc42015-02-05 14:42:55 +090025void sbc_init(void);
26void sg_init(void);
27void pll_init(void);
28void pin_init(void);
Masahiro Yamada6cc21202015-02-27 02:27:04 +090029void memconf_init(void);
Masahiro Yamada198a97a2015-02-27 02:26:51 +090030void early_clkrst_init(void);
Masahiro Yamada7d1a3a62015-03-23 00:07:23 +090031void early_pin_init(void);
Masahiro Yamada35adfc42015-02-05 14:42:55 +090032int umc_init(void);
33void enable_dpll_ssc(void);
Masahiro Yamada5894ca02014-10-03 19:21:06 +090034
35void spl_board_init(void)
36{
Masahiro Yamada35adfc42015-02-05 14:42:55 +090037 bcu_init();
38
39 sbc_init();
40
41 sg_init();
42
Masahiro Yamada0b198672015-09-22 00:27:30 +090043 support_card_reset();
Masahiro Yamada35adfc42015-02-05 14:42:55 +090044
45 pll_init();
46
Masahiro Yamada0b198672015-09-22 00:27:30 +090047 support_card_init();
Masahiro Yamada35adfc42015-02-05 14:42:55 +090048
49 led_write(L, 0, , );
50
Masahiro Yamada6cc21202015-02-27 02:27:04 +090051 memconf_init();
Masahiro Yamada35adfc42015-02-05 14:42:55 +090052
53 led_write(L, 1, , );
54
Masahiro Yamada6cc21202015-02-27 02:27:04 +090055 early_clkrst_init();
56
57 led_write(L, 2, , );
58
Masahiro Yamada7d1a3a62015-03-23 00:07:23 +090059 early_pin_init();
60
61 led_write(L, 3, , );
62
Masahiro Yamada499785b2015-03-23 00:07:25 +090063#ifdef CONFIG_SPL_SERIAL_SUPPORT
64 preloader_console_init();
65#endif
66
67 led_write(L, 4, , );
68
Masahiro Yamada35adfc42015-02-05 14:42:55 +090069 {
70 int res;
71
72 res = umc_init();
73 if (res < 0) {
74 while (1)
75 ;
76 }
77 }
Masahiro Yamada499785b2015-03-23 00:07:25 +090078 led_write(L, 5, , );
Masahiro Yamada35adfc42015-02-05 14:42:55 +090079
80 enable_dpll_ssc();
81
Masahiro Yamada499785b2015-03-23 00:07:25 +090082 led_write(L, 6, , );
Masahiro Yamada5894ca02014-10-03 19:21:06 +090083}