Masahiro Yamada | d11b0b7 | 2016-09-17 03:33:11 +0900 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2016 Socionext Inc. |
| 3 | * Author: Masahiro Yamada <yamada.masahiro@socionext.com> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | |
| 10 | #include "../init.h" |
| 11 | #include "../sc64-regs.h" |
| 12 | #include "pll.h" |
| 13 | |
| 14 | int uniphier_ld20_pll_init(const struct uniphier_board_data *bd) |
| 15 | { |
| 16 | unsigned int dpll_ssc_rate = UNIPHIER_BD_DPLL_SSC_GET_RATE(bd->flags); |
| 17 | |
| 18 | uniphier_ld20_sscpll_init(SC_CPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4); |
| 19 | /* do nothing for SPLL */ |
| 20 | uniphier_ld20_sscpll_init(SC_SPLL2CTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4); |
| 21 | uniphier_ld20_sscpll_init(SC_MPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2); |
| 22 | uniphier_ld20_sscpll_init(SC_VPPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4); |
| 23 | uniphier_ld20_sscpll_init(SC_GPPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2); |
| 24 | |
| 25 | mdelay(1); |
| 26 | |
| 27 | if (dpll_ssc_rate > 0) { |
| 28 | uniphier_ld20_sscpll_ssc_en(SC_DPLL0CTRL); |
| 29 | uniphier_ld20_sscpll_ssc_en(SC_DPLL1CTRL); |
| 30 | uniphier_ld20_sscpll_ssc_en(SC_DPLL2CTRL); |
| 31 | } |
| 32 | |
| 33 | uniphier_ld20_vpll27_init(SC_VPLL27FCTRL); |
| 34 | uniphier_ld20_vpll27_init(SC_VPLL27ACTRL); |
| 35 | |
| 36 | uniphier_ld20_dspll_init(SC_VPLL8KCTRL); |
| 37 | uniphier_ld20_dspll_init(SC_A2PLLCTRL); |
| 38 | |
| 39 | return 0; |
| 40 | } |