Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | 68557ec | 2016-09-17 03:33:06 +0900 | [diff] [blame] | 2 | * Copyright (C) 2016 Socionext Inc. |
| 3 | * Author: Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <spl.h> |
| 10 | |
| 11 | #include "../init.h" |
| 12 | #include "../micro-support-card.h" |
| 13 | |
| 14 | int uniphier_ld20_init(const struct uniphier_board_data *bd) |
| 15 | { |
| 16 | uniphier_sbc_init_savepin(bd); |
Masahiro Yamada | 5eb4150 | 2016-04-28 15:37:15 +0900 | [diff] [blame] | 17 | uniphier_pxs2_sbc_init(bd); |
Masahiro Yamada | dacdb24 | 2016-09-26 13:13:16 +0900 | [diff] [blame] | 18 | /* pins for NAND and System Bus are multiplexed */ |
| 19 | if (spl_boot_device() != BOOT_DEVICE_NAND) |
| 20 | uniphier_pin_init("system_bus_grp"); |
Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 21 | |
| 22 | support_card_reset(); |
| 23 | |
| 24 | support_card_init(); |
| 25 | |
| 26 | led_puts("L0"); |
| 27 | |
| 28 | memconf_init(bd); |
| 29 | uniphier_pxs2_memconf_init(bd); |
| 30 | |
| 31 | led_puts("L1"); |
| 32 | |
| 33 | uniphier_ld20_early_clk_init(bd); |
| 34 | |
| 35 | led_puts("L2"); |
| 36 | |
Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 37 | #ifdef CONFIG_SPL_SERIAL_SUPPORT |
| 38 | preloader_console_init(); |
| 39 | #endif |
| 40 | |
Masahiro Yamada | 682e09f | 2016-09-17 03:33:11 +0900 | [diff] [blame] | 41 | led_puts("L3"); |
| 42 | |
| 43 | uniphier_ld20_dpll_init(bd); |
| 44 | |
Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 45 | led_puts("L4"); |
| 46 | |
| 47 | { |
| 48 | int res; |
| 49 | |
| 50 | res = uniphier_ld20_umc_init(bd); |
| 51 | if (res < 0) { |
| 52 | while (1) |
| 53 | ; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | led_puts("L5"); |
| 58 | |
Masahiro Yamada | 0bd2020 | 2016-05-24 21:13:57 +0900 | [diff] [blame] | 59 | dcache_disable(); |
| 60 | |
Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 61 | return 0; |
| 62 | } |