blob: 02befa298b465f06fe1af227a748f37686d6a148 [file] [log] [blame]
Masahiro Yamada090785d2016-09-22 07:42:19 +09001/*
2 * Copyright (C) 2016 Socionext Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <linux/io.h>
9
10#include "../init.h"
11#include "../sc64-regs.h"
12#include "pll.h"
13
14void uniphier_ld11_pll_init(void)
15{
16 uniphier_ld20_sscpll_init(SC_CPLLCTRL, 1960, 1, 2); /* 2000MHz -> 1960MHz */
17 /* do nothing for SPLL */
18 uniphier_ld20_sscpll_init(SC_MPLLCTRL, 1600, 1, 2); /* 1500MHz -> 1600MHz */
19 uniphier_ld20_sscpll_init(SC_VSPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
20
Masahiro Yamadaf366d382017-02-21 23:00:35 +090021 uniphier_ld20_sscpll_set_regi(SC_MPLLCTRL, 5);
22
Masahiro Yamada090785d2016-09-22 07:42:19 +090023 mdelay(1);
24
25 uniphier_ld20_sscpll_ssc_en(SC_CPLLCTRL);
26 uniphier_ld20_sscpll_ssc_en(SC_MPLLCTRL);
27 uniphier_ld20_sscpll_ssc_en(SC_VSPLLCTRL);
Masahiro Yamada0335cce2016-10-08 13:25:23 +090028 uniphier_ld20_sscpll_ssc_en(SC_DPLLCTRL);
Masahiro Yamada090785d2016-09-22 07:42:19 +090029
30 uniphier_ld20_vpll27_init(SC_VPLL27FCTRL);
31 uniphier_ld20_vpll27_init(SC_VPLL27ACTRL);
32
33 writel(0, SC_CA53_GEARSET); /* Gear0: CPLL/2 */
34 writel(SC_CA_GEARUPD, SC_CA53_GEARUPD);
35}