cru_rk3399.h 2.1 KB

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