pll-ld20.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2016 Socionext Inc.
  4. * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  5. */
  6. #include <linux/delay.h>
  7. #include "../init.h"
  8. #include "../sc64-regs.h"
  9. #include "pll.h"
  10. /* PLL type: SSC */
  11. #define SC_CPLLCTRL (SC_BASE_ADDR | 0x1400) /* CPU/ARM */
  12. #define SC_SPLLCTRL (SC_BASE_ADDR | 0x1410) /* misc */
  13. #define SC_SPLL2CTRL (SC_BASE_ADDR | 0x1420) /* DSP */
  14. #define SC_MPLLCTRL (SC_BASE_ADDR | 0x1430) /* Video codec */
  15. #define SC_VPPLLCTRL (SC_BASE_ADDR | 0x1440) /* VPE etc. */
  16. #define SC_GPPLLCTRL (SC_BASE_ADDR | 0x1450) /* GPU/Mali */
  17. #define SC_DPLL0CTRL (SC_BASE_ADDR | 0x1460) /* DDR memory 0 */
  18. #define SC_DPLL1CTRL (SC_BASE_ADDR | 0x1470) /* DDR memory 1 */
  19. #define SC_DPLL2CTRL (SC_BASE_ADDR | 0x1480) /* DDR memory 2 */
  20. /* PLL type: VPLL27 */
  21. #define SC_VPLL27FCTRL (SC_BASE_ADDR | 0x1500)
  22. #define SC_VPLL27ACTRL (SC_BASE_ADDR | 0x1520)
  23. /* PLL type: DSPLL */
  24. #define SC_VPLL8KCTRL (SC_BASE_ADDR | 0x1540)
  25. #define SC_A2PLLCTRL (SC_BASE_ADDR | 0x15C0)
  26. void uniphier_ld20_pll_init(void)
  27. {
  28. uniphier_ld20_sscpll_init(SC_CPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
  29. /* do nothing for SPLL */
  30. uniphier_ld20_sscpll_init(SC_SPLL2CTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
  31. uniphier_ld20_sscpll_init(SC_MPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
  32. uniphier_ld20_sscpll_init(SC_VPPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4);
  33. uniphier_ld20_sscpll_init(SC_GPPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
  34. mdelay(1);
  35. uniphier_ld20_sscpll_ssc_en(SC_CPLLCTRL);
  36. uniphier_ld20_sscpll_ssc_en(SC_SPLL2CTRL);
  37. uniphier_ld20_sscpll_ssc_en(SC_MPLLCTRL);
  38. uniphier_ld20_sscpll_ssc_en(SC_VPPLLCTRL);
  39. uniphier_ld20_sscpll_ssc_en(SC_GPPLLCTRL);
  40. uniphier_ld20_sscpll_ssc_en(SC_DPLL0CTRL);
  41. uniphier_ld20_sscpll_ssc_en(SC_DPLL1CTRL);
  42. uniphier_ld20_sscpll_ssc_en(SC_DPLL2CTRL);
  43. uniphier_ld20_vpll27_init(SC_VPLL27FCTRL);
  44. uniphier_ld20_vpll27_init(SC_VPLL27ACTRL);
  45. uniphier_ld20_dspll_init(SC_VPLL8KCTRL);
  46. uniphier_ld20_dspll_init(SC_A2PLLCTRL);
  47. }