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 | a86ac95 | 2015-02-27 02:26:44 +0900 | [diff] [blame] | 10 | #include <mach/led.h> |
| 11 | #include <mach/board.h> |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 12 | |
| 13 | void __weak bcu_init(void) |
| 14 | { |
| 15 | }; |
Masahiro Yamada | 11f3afe | 2015-09-11 20:17:43 +0900 | [diff] [blame] | 16 | |
Masahiro Yamada | 1386233 | 2015-09-11 20:17:44 +0900 | [diff] [blame] | 17 | void __weak sg_init(void) |
| 18 | { |
| 19 | }; |
| 20 | |
Masahiro Yamada | 11f3afe | 2015-09-11 20:17:43 +0900 | [diff] [blame] | 21 | void __weak early_pin_init(void) |
| 22 | { |
| 23 | }; |
| 24 | |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 25 | void sbc_init(void); |
| 26 | void sg_init(void); |
| 27 | void pll_init(void); |
| 28 | void pin_init(void); |
Masahiro Yamada | 6cc2120 | 2015-02-27 02:27:04 +0900 | [diff] [blame] | 29 | void memconf_init(void); |
Masahiro Yamada | 198a97a | 2015-02-27 02:26:51 +0900 | [diff] [blame] | 30 | void early_clkrst_init(void); |
Masahiro Yamada | 7d1a3a6 | 2015-03-23 00:07:23 +0900 | [diff] [blame] | 31 | void early_pin_init(void); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 32 | int umc_init(void); |
| 33 | void enable_dpll_ssc(void); |
Masahiro Yamada | 5894ca0 | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 34 | |
| 35 | void spl_board_init(void) |
| 36 | { |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 37 | bcu_init(); |
| 38 | |
| 39 | sbc_init(); |
| 40 | |
| 41 | sg_init(); |
| 42 | |
Masahiro Yamada | 0b19867 | 2015-09-22 00:27:30 +0900 | [diff] [blame^] | 43 | support_card_reset(); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 44 | |
| 45 | pll_init(); |
| 46 | |
Masahiro Yamada | 0b19867 | 2015-09-22 00:27:30 +0900 | [diff] [blame^] | 47 | support_card_init(); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 48 | |
| 49 | led_write(L, 0, , ); |
| 50 | |
Masahiro Yamada | 6cc2120 | 2015-02-27 02:27:04 +0900 | [diff] [blame] | 51 | memconf_init(); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 52 | |
| 53 | led_write(L, 1, , ); |
| 54 | |
Masahiro Yamada | 6cc2120 | 2015-02-27 02:27:04 +0900 | [diff] [blame] | 55 | early_clkrst_init(); |
| 56 | |
| 57 | led_write(L, 2, , ); |
| 58 | |
Masahiro Yamada | 7d1a3a6 | 2015-03-23 00:07:23 +0900 | [diff] [blame] | 59 | early_pin_init(); |
| 60 | |
| 61 | led_write(L, 3, , ); |
| 62 | |
Masahiro Yamada | 499785b | 2015-03-23 00:07:25 +0900 | [diff] [blame] | 63 | #ifdef CONFIG_SPL_SERIAL_SUPPORT |
| 64 | preloader_console_init(); |
| 65 | #endif |
| 66 | |
| 67 | led_write(L, 4, , ); |
| 68 | |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 69 | { |
| 70 | int res; |
| 71 | |
| 72 | res = umc_init(); |
| 73 | if (res < 0) { |
| 74 | while (1) |
| 75 | ; |
| 76 | } |
| 77 | } |
Masahiro Yamada | 499785b | 2015-03-23 00:07:25 +0900 | [diff] [blame] | 78 | led_write(L, 5, , ); |
Masahiro Yamada | 35adfc4 | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 79 | |
| 80 | enable_dpll_ssc(); |
| 81 | |
Masahiro Yamada | 499785b | 2015-03-23 00:07:25 +0900 | [diff] [blame] | 82 | led_write(L, 6, , ); |
Masahiro Yamada | 5894ca0 | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 83 | } |