cru_rk3399.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * (C) Copyright 2016 Rockchip Electronics Co., Ltd
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __ASM_ARCH_CRU_RK3399_H_
  7. #define __ASM_ARCH_CRU_RK3399_H_
  8. #include <common.h>
  9. /* Private data for the clock driver - used by rockchip_get_cru() */
  10. struct rk3399_clk_priv {
  11. struct rk3399_cru *cru;
  12. ulong rate;
  13. };
  14. struct rk3399_pmucru {
  15. u32 ppll_con[6];
  16. u32 reserved[0x1a];
  17. u32 pmucru_clksel[6];
  18. u32 pmucru_clkfrac_con[2];
  19. u32 reserved2[0x18];
  20. u32 pmucru_clkgate_con[3];
  21. u32 reserved3;
  22. u32 pmucru_softrst_con[2];
  23. u32 reserved4[2];
  24. u32 pmucru_rstnhold_con[2];
  25. u32 reserved5[2];
  26. u32 pmucru_gatedis_con[2];
  27. };
  28. check_member(rk3399_pmucru, pmucru_gatedis_con[1], 0x134);
  29. struct rk3399_cru {
  30. u32 apll_l_con[6];
  31. u32 reserved[2];
  32. u32 apll_b_con[6];
  33. u32 reserved1[2];
  34. u32 dpll_con[6];
  35. u32 reserved2[2];
  36. u32 cpll_con[6];
  37. u32 reserved3[2];
  38. u32 gpll_con[6];
  39. u32 reserved4[2];
  40. u32 npll_con[6];
  41. u32 reserved5[2];
  42. u32 vpll_con[6];
  43. u32 reserved6[0x0a];
  44. u32 clksel_con[108];
  45. u32 reserved7[0x14];
  46. u32 clkgate_con[35];
  47. u32 reserved8[0x1d];
  48. u32 softrst_con[21];
  49. u32 reserved9[0x2b];
  50. u32 glb_srst_fst_value;
  51. u32 glb_srst_snd_value;
  52. u32 glb_cnt_th;
  53. u32 misc_con;
  54. u32 glb_rst_con;
  55. u32 glb_rst_st;
  56. u32 reserved10[0x1a];
  57. u32 sdmmc_con[2];
  58. u32 sdio0_con[2];
  59. u32 sdio1_con[2];
  60. };
  61. check_member(rk3399_cru, sdio1_con[1], 0x594);
  62. #define MHz 1000000
  63. #define KHz 1000
  64. #define OSC_HZ (24*MHz)
  65. #define APLL_HZ (600*MHz)
  66. #define GPLL_HZ (594*MHz)
  67. #define CPLL_HZ (384*MHz)
  68. #define PPLL_HZ (676*MHz)
  69. #define PMU_PCLK_HZ (48*MHz)
  70. #define ACLKM_CORE_HZ (300*MHz)
  71. #define ATCLK_CORE_HZ (300*MHz)
  72. #define PCLK_DBG_HZ (100*MHz)
  73. #define PERIHP_ACLK_HZ (148500*KHz)
  74. #define PERIHP_HCLK_HZ (148500*KHz)
  75. #define PERIHP_PCLK_HZ (37125*KHz)
  76. #define PERILP0_ACLK_HZ (99000*KHz)
  77. #define PERILP0_HCLK_HZ (99000*KHz)
  78. #define PERILP0_PCLK_HZ (49500*KHz)
  79. #define PERILP1_HCLK_HZ (99000*KHz)
  80. #define PERILP1_PCLK_HZ (49500*KHz)
  81. #define PWM_CLOCK_HZ PMU_PCLK_HZ
  82. enum apll_l_frequencies {
  83. APLL_L_1600_MHZ,
  84. APLL_L_600_MHZ,
  85. };
  86. #endif /* __ASM_ARCH_CRU_RK3399_H_ */