pll_defs.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2011
  4. * Heiko Schocher, DENX Software Engineering, hs@denx.de.
  5. */
  6. #ifndef _DV_PLL_DEFS_H_
  7. #define _DV_PLL_DEFS_H_
  8. struct dv_pll_regs {
  9. unsigned int pid; /* 0x00 */
  10. unsigned char rsvd0[224]; /* 0x04 */
  11. unsigned int rstype; /* 0xe4 */
  12. unsigned char rsvd1[24]; /* 0xe8 */
  13. unsigned int pllctl; /* 0x100 */
  14. unsigned char rsvd2[4]; /* 0x104 */
  15. unsigned int secctl; /* 0x108 */
  16. unsigned int rv; /* 0x10c */
  17. unsigned int pllm; /* 0x110 */
  18. unsigned int prediv; /* 0x114 */
  19. unsigned int plldiv1; /* 0x118 */
  20. unsigned int plldiv2; /* 0x11c */
  21. unsigned int plldiv3; /* 0x120 */
  22. unsigned int oscdiv1; /* 0x124 */
  23. unsigned int postdiv; /* 0x128 */
  24. unsigned int bpdiv; /* 0x12c */
  25. unsigned char rsvd5[8]; /* 0x130 */
  26. unsigned int pllcmd; /* 0x138 */
  27. unsigned int pllstat; /* 0x13c */
  28. unsigned int alnctl; /* 0x140 */
  29. unsigned int dchange; /* 0x144 */
  30. unsigned int cken; /* 0x148 */
  31. unsigned int ckstat; /* 0x14c */
  32. unsigned int systat; /* 0x150 */
  33. unsigned char rsvd6[12]; /* 0x154 */
  34. unsigned int plldiv4; /* 0x160 */
  35. unsigned int plldiv5; /* 0x164 */
  36. unsigned int plldiv6; /* 0x168 */
  37. unsigned int plldiv7; /* 0x16C */
  38. unsigned int plldiv8; /* 0x170 */
  39. unsigned int plldiv9; /* 0x174 */
  40. };
  41. #define PLL_MASTER_LOCK (1 << 4)
  42. #define PLLCTL_CLOCK_MODE_SHIFT 8
  43. #define PLLCTL_PLLEN (1 << 0)
  44. #define PLLCTL_PLLPWRDN (1 << 1)
  45. #define PLLCTL_PLLRST (1 << 3)
  46. #define PLLCTL_PLLDIS (1 << 4)
  47. #define PLLCTL_PLLENSRC (1 << 5)
  48. #define PLLCTL_RES_9 (1 << 8)
  49. #define PLLCTL_EXTCLKSRC (1 << 9)
  50. #define PLL_DIVEN (1 << 15)
  51. #define PLL_POSTDEN PLL_DIVEN
  52. #define PLL_SCSCFG3_DIV45PENA (1 << 2)
  53. #define PLL_SCSCFG3_EMA_CLKSRC (1 << 1)
  54. #define PLL_RSTYPE_POR (1 << 0)
  55. #define PLL_RSTYPE_XWRST (1 << 1)
  56. #define PLLSECCTL_TINITZ (1 << 16)
  57. #define PLLSECCTL_TENABLE (1 << 17)
  58. #define PLLSECCTL_TENABLEDIV (1 << 18)
  59. #define PLLSECCTL_STOPMODE (1 << 22)
  60. #define PLLCMD_GOSET (1 << 0)
  61. #define PLLCMD_GOSTAT (1 << 0)
  62. #define PLL0_LOCK 0x07000000
  63. #define PLL1_LOCK 0x07000000
  64. #define dv_pll0_regs ((struct dv_pll_regs *)DAVINCI_PLL_CNTRL0_BASE)
  65. #define dv_pll1_regs ((struct dv_pll_regs *)DAVINCI_PLL_CNTRL1_BASE)
  66. #define ARM_PLLDIV (offsetof(struct dv_pll_regs, plldiv2))
  67. #define DDR_PLLDIV (offsetof(struct dv_pll_regs, plldiv7))
  68. #define SPI_PLLDIV (offsetof(struct dv_pll_regs, plldiv4))
  69. unsigned int davinci_clk_get(unsigned int div);
  70. #endif /* _DV_PLL_DEFS_H_ */