Masahiro Yamada | 5894ca0 | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | 1386233 | 2015-09-11 20:17:44 +0900 | [diff] [blame] | 2 | * Copyright (C) 2013-2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | 5894ca0 | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 3 | * |
4 | * SPDX-License-Identifier: GPL-2.0+ | ||||
5 | */ | ||||
6 | |||||
7 | #include <common.h> | ||||
8 | #include <spl.h> | ||||
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 9 | #include <linux/compiler.h> |
Masahiro Yamada | 8469700 | 2015-09-22 00:27:31 +0900 | [diff] [blame] | 10 | #include <mach/micro-support-card.h> |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 11 | |
12 | void __weak bcu_init(void) | ||||
13 | { | ||||
14 | }; | ||||
Masahiro Yamada | 11f3afe | 2015-09-11 20:17:43 +0900 | [diff] [blame] | 15 | |
Masahiro Yamada | c8df23c | 2015-09-22 00:27:33 +0900 | [diff] [blame] | 16 | void __weak sbc_init(void) |
17 | { | ||||
18 | }; | ||||
19 | |||||
Masahiro Yamada | 1386233 | 2015-09-11 20:17:44 +0900 | [diff] [blame] | 20 | void __weak sg_init(void) |
21 | { | ||||
22 | }; | ||||
23 | |||||
Masahiro Yamada | 11f3afe | 2015-09-11 20:17:43 +0900 | [diff] [blame] | 24 | void __weak early_pin_init(void) |
25 | { | ||||
26 | }; | ||||
27 | |||||
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 28 | void sbc_init(void); |
29 | void sg_init(void); | ||||
30 | void pll_init(void); | ||||
31 | void pin_init(void); | ||||
Masahiro Yamada | 6cc2120 | 2015-02-27 02:27:04 +0900 | [diff] [blame] | 32 | void memconf_init(void); |
Masahiro Yamada | 198a97a | 2015-02-27 02:26:51 +0900 | [diff] [blame] | 33 | void early_clkrst_init(void); |
Masahiro Yamada | 7d1a3a6 | 2015-03-23 00:07:23 +0900 | [diff] [blame] | 34 | void early_pin_init(void); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 35 | int umc_init(void); |
36 | void enable_dpll_ssc(void); | ||||
Masahiro Yamada | 5894ca0 | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 37 | |
38 | void spl_board_init(void) | ||||
39 | { | ||||
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 40 | bcu_init(); |
41 | |||||
42 | sbc_init(); | ||||
43 | |||||
44 | sg_init(); | ||||
45 | |||||
Masahiro Yamada | 0b19867 | 2015-09-22 00:27:30 +0900 | [diff] [blame] | 46 | support_card_reset(); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 47 | |
48 | pll_init(); | ||||
49 | |||||
Masahiro Yamada | 0b19867 | 2015-09-22 00:27:30 +0900 | [diff] [blame] | 50 | support_card_init(); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 51 | |
Masahiro Yamada | 8469700 | 2015-09-22 00:27:31 +0900 | [diff] [blame] | 52 | led_puts("L0"); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 53 | |
Masahiro Yamada | 6cc2120 | 2015-02-27 02:27:04 +0900 | [diff] [blame] | 54 | memconf_init(); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 55 | |
Masahiro Yamada | 8469700 | 2015-09-22 00:27:31 +0900 | [diff] [blame] | 56 | led_puts("L1"); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 57 | |
Masahiro Yamada | 6cc2120 | 2015-02-27 02:27:04 +0900 | [diff] [blame] | 58 | early_clkrst_init(); |
59 | |||||
Masahiro Yamada | 8469700 | 2015-09-22 00:27:31 +0900 | [diff] [blame] | 60 | led_puts("L2"); |
Masahiro Yamada | 6cc2120 | 2015-02-27 02:27:04 +0900 | [diff] [blame] | 61 | |
Masahiro Yamada | 7d1a3a6 | 2015-03-23 00:07:23 +0900 | [diff] [blame] | 62 | early_pin_init(); |
63 | |||||
Masahiro Yamada | 8469700 | 2015-09-22 00:27:31 +0900 | [diff] [blame] | 64 | led_puts("L3"); |
Masahiro Yamada | 7d1a3a6 | 2015-03-23 00:07:23 +0900 | [diff] [blame] | 65 | |
Masahiro Yamada | 499785b | 2015-03-23 00:07:25 +0900 | [diff] [blame] | 66 | #ifdef CONFIG_SPL_SERIAL_SUPPORT |
67 | preloader_console_init(); | ||||
68 | #endif | ||||
69 | |||||
Masahiro Yamada | 8469700 | 2015-09-22 00:27:31 +0900 | [diff] [blame] | 70 | led_puts("L4"); |
Masahiro Yamada | 499785b | 2015-03-23 00:07:25 +0900 | [diff] [blame] | 71 | |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 72 | { |
73 | int res; | ||||
74 | |||||
75 | res = umc_init(); | ||||
76 | if (res < 0) { | ||||
77 | while (1) | ||||
78 | ; | ||||
79 | } | ||||
80 | } | ||||
Masahiro Yamada | 8469700 | 2015-09-22 00:27:31 +0900 | [diff] [blame] | 81 | |
82 | led_puts("L5"); | ||||
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 83 | |
84 | enable_dpll_ssc(); | ||||
85 | |||||
Masahiro Yamada | 8469700 | 2015-09-22 00:27:31 +0900 | [diff] [blame] | 86 | led_puts("L6"); |
Masahiro Yamada | 5894ca0 | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 87 | } |