pll-ld11.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2016 Socionext Inc.
  4. */
  5. #include <linux/delay.h>
  6. #include <linux/io.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_MPLLCTRL (SC_BASE_ADDR | 0x1430) /* DSP */
  14. #define SC_VSPLLCTRL (SC_BASE_ADDR | 0x1440) /* Video codec, VPE etc. */
  15. #define SC_DPLLCTRL (SC_BASE_ADDR | 0x1460) /* DDR memory */
  16. /* PLL type: VPLL27 */
  17. #define SC_VPLL27FCTRL (SC_BASE_ADDR | 0x1500)
  18. #define SC_VPLL27ACTRL (SC_BASE_ADDR | 0x1520)
  19. void uniphier_ld11_pll_init(void)
  20. {
  21. uniphier_ld20_sscpll_init(SC_CPLLCTRL, 1960, 1, 2); /* 2000MHz -> 1960MHz */
  22. /* do nothing for SPLL */
  23. uniphier_ld20_sscpll_init(SC_MPLLCTRL, 1600, 1, 2); /* 1500MHz -> 1600MHz */
  24. uniphier_ld20_sscpll_init(SC_VSPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 2);
  25. uniphier_ld20_sscpll_set_regi(SC_MPLLCTRL, 5);
  26. mdelay(1);
  27. uniphier_ld20_sscpll_ssc_en(SC_CPLLCTRL);
  28. uniphier_ld20_sscpll_ssc_en(SC_MPLLCTRL);
  29. uniphier_ld20_sscpll_ssc_en(SC_VSPLLCTRL);
  30. uniphier_ld20_sscpll_ssc_en(SC_DPLLCTRL);
  31. uniphier_ld20_vpll27_init(SC_VPLL27FCTRL);
  32. uniphier_ld20_vpll27_init(SC_VPLL27ACTRL);
  33. writel(0, SC_CA53_GEARSET); /* Gear0: CPLL/2 */
  34. writel(SC_CA_GEARUPD, SC_CA53_GEARUPD);
  35. }