Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | 24ee11f | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 2 | * Copyright (C) 2013-2015 Panasonic Corporation |
Masahiro Yamada | 6b23db8 | 2015-03-23 00:07:25 +0900 | [diff] [blame] | 3 | * Copyright (C) 2015 Socionext Inc. |
| 4 | * Author: Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <spl.h> |
Masahiro Yamada | 24ee11f | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 11 | #include <linux/compiler.h> |
Masahiro Yamada | 95387e2 | 2015-02-27 02:26:44 +0900 | [diff] [blame] | 12 | #include <mach/led.h> |
| 13 | #include <mach/board.h> |
Masahiro Yamada | 24ee11f | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 14 | |
| 15 | void __weak bcu_init(void) |
| 16 | { |
| 17 | }; |
| 18 | void sbc_init(void); |
| 19 | void sg_init(void); |
| 20 | void pll_init(void); |
| 21 | void pin_init(void); |
Masahiro Yamada | e28001b | 2015-02-27 02:27:04 +0900 | [diff] [blame] | 22 | void memconf_init(void); |
Masahiro Yamada | c04368f | 2015-02-27 02:26:51 +0900 | [diff] [blame] | 23 | void early_clkrst_init(void); |
Masahiro Yamada | 0c2eeee | 2015-03-23 00:07:23 +0900 | [diff] [blame] | 24 | void early_pin_init(void); |
Masahiro Yamada | 24ee11f | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 25 | int umc_init(void); |
| 26 | void enable_dpll_ssc(void); |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 27 | |
| 28 | void spl_board_init(void) |
| 29 | { |
Masahiro Yamada | 24ee11f | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 30 | 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 Yamada | e28001b | 2015-02-27 02:27:04 +0900 | [diff] [blame] | 44 | memconf_init(); |
Masahiro Yamada | 24ee11f | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 45 | |
| 46 | led_write(L, 1, , ); |
| 47 | |
Masahiro Yamada | e28001b | 2015-02-27 02:27:04 +0900 | [diff] [blame] | 48 | early_clkrst_init(); |
| 49 | |
| 50 | led_write(L, 2, , ); |
| 51 | |
Masahiro Yamada | 0c2eeee | 2015-03-23 00:07:23 +0900 | [diff] [blame] | 52 | early_pin_init(); |
| 53 | |
| 54 | led_write(L, 3, , ); |
| 55 | |
Masahiro Yamada | 6b23db8 | 2015-03-23 00:07:25 +0900 | [diff] [blame] | 56 | #ifdef CONFIG_SPL_SERIAL_SUPPORT |
| 57 | preloader_console_init(); |
| 58 | #endif |
| 59 | |
| 60 | led_write(L, 4, , ); |
| 61 | |
Masahiro Yamada | 24ee11f | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 62 | { |
| 63 | int res; |
| 64 | |
| 65 | res = umc_init(); |
| 66 | if (res < 0) { |
| 67 | while (1) |
| 68 | ; |
| 69 | } |
| 70 | } |
Masahiro Yamada | 6b23db8 | 2015-03-23 00:07:25 +0900 | [diff] [blame] | 71 | led_write(L, 5, , ); |
Masahiro Yamada | 24ee11f | 2015-02-05 14:42:55 +0900 | [diff] [blame] | 72 | |
| 73 | enable_dpll_ssc(); |
| 74 | |
Masahiro Yamada | 6b23db8 | 2015-03-23 00:07:25 +0900 | [diff] [blame] | 75 | led_write(L, 6, , ); |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 76 | } |