2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2016-09-16 18:33:11 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Socionext Inc.
|
|
|
|
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
|
|
|
*/
|
|
|
|
|
2017-08-26 08:57:58 +00:00
|
|
|
#include <linux/delay.h>
|
2016-09-16 18:33:11 +00:00
|
|
|
|
|
|
|
#include "../init.h"
|
|
|
|
#include "../sc64-regs.h"
|
|
|
|
#include "pll.h"
|
|
|
|
|
2017-08-26 08:57:59 +00:00
|
|
|
/* PLL type: SSC */
|
2019-07-10 11:07:41 +00:00
|
|
|
#define SC_CPLLCTRL 0x1400 /* CPU/ARM */
|
|
|
|
#define SC_SPLLCTRL 0x1410 /* misc */
|
|
|
|
#define SC_SPLL2CTRL 0x1420 /* DSP */
|
|
|
|
#define SC_MPLLCTRL 0x1430 /* Video codec */
|
|
|
|
#define SC_VPPLLCTRL 0x1440 /* VPE etc. */
|
|
|
|
#define SC_GPPLLCTRL 0x1450 /* GPU/Mali */
|
|
|
|
#define SC_DPLL0CTRL 0x1460 /* DDR memory 0 */
|
|
|
|
#define SC_DPLL1CTRL 0x1470 /* DDR memory 1 */
|
|
|
|
#define SC_DPLL2CTRL 0x1480 /* DDR memory 2 */
|
2017-08-26 08:57:59 +00:00
|
|
|
|
|
|
|
/* PLL type: VPLL27 */
|
2019-07-10 11:07:41 +00:00
|
|
|
#define SC_VPLL27FCTRL 0x1500
|
|
|
|
#define SC_VPLL27ACTRL 0x1520
|
2017-08-26 08:57:59 +00:00
|
|
|
|
|
|
|
/* PLL type: DSPLL */
|
2019-07-10 11:07:41 +00:00
|
|
|
#define SC_VPLL8KCTRL 0x1540
|
|
|
|
#define SC_A2PLLCTRL 0x15C0
|
2017-08-26 08:57:59 +00:00
|
|
|
|
2017-01-15 05:59:02 +00:00
|
|
|
void uniphier_ld20_pll_init(void)
|
2016-09-16 18:33:11 +00:00
|
|
|
{
|
|
|
|
uniphier_ld20_sscpll_init(SC_CPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
|
|
|
|
/* do nothing for SPLL */
|
|
|
|
uniphier_ld20_sscpll_init(SC_SPLL2CTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
|
|
|
|
uniphier_ld20_sscpll_init(SC_MPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
|
|
|
|
uniphier_ld20_sscpll_init(SC_VPPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
|
|
|
|
uniphier_ld20_sscpll_init(SC_GPPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
|
|
|
|
|
|
|
|
mdelay(1);
|
|
|
|
|
2016-10-27 14:47:00 +00:00
|
|
|
uniphier_ld20_sscpll_ssc_en(SC_CPLLCTRL);
|
|
|
|
uniphier_ld20_sscpll_ssc_en(SC_SPLL2CTRL);
|
|
|
|
uniphier_ld20_sscpll_ssc_en(SC_MPLLCTRL);
|
|
|
|
uniphier_ld20_sscpll_ssc_en(SC_VPPLLCTRL);
|
|
|
|
uniphier_ld20_sscpll_ssc_en(SC_GPPLLCTRL);
|
|
|
|
uniphier_ld20_sscpll_ssc_en(SC_DPLL0CTRL);
|
|
|
|
uniphier_ld20_sscpll_ssc_en(SC_DPLL1CTRL);
|
|
|
|
uniphier_ld20_sscpll_ssc_en(SC_DPLL2CTRL);
|
2016-09-16 18:33:11 +00:00
|
|
|
|
|
|
|
uniphier_ld20_vpll27_init(SC_VPLL27FCTRL);
|
|
|
|
uniphier_ld20_vpll27_init(SC_VPLL27ACTRL);
|
|
|
|
|
|
|
|
uniphier_ld20_dspll_init(SC_VPLL8KCTRL);
|
|
|
|
uniphier_ld20_dspll_init(SC_A2PLLCTRL);
|
|
|
|
}
|