cru_rk3328.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2016 Rockchip Electronics Co., Ltd
  4. */
  5. #ifndef __ASM_ARCH_CRU_RK3328_H_
  6. #define __ASM_ARCH_CRU_RK3328_H_
  7. #include <common.h>
  8. struct rk3328_clk_priv {
  9. struct rk3328_cru *cru;
  10. ulong rate;
  11. };
  12. struct rk3328_cru {
  13. u32 apll_con[5];
  14. u32 reserved1[3];
  15. u32 dpll_con[5];
  16. u32 reserved2[3];
  17. u32 cpll_con[5];
  18. u32 reserved3[3];
  19. u32 gpll_con[5];
  20. u32 reserved4[3];
  21. u32 mode_con;
  22. u32 misc;
  23. u32 reserved5[2];
  24. u32 glb_cnt_th;
  25. u32 glb_rst_st;
  26. u32 glb_srst_snd_value;
  27. u32 glb_srst_fst_value;
  28. u32 npll_con[5];
  29. u32 reserved6[(0x100 - 0xb4) / 4];
  30. u32 clksel_con[53];
  31. u32 reserved7[(0x200 - 0x1d4) / 4];
  32. u32 clkgate_con[29];
  33. u32 reserved8[3];
  34. u32 ssgtbl[32];
  35. u32 softrst_con[12];
  36. u32 reserved9[(0x380 - 0x330) / 4];
  37. u32 sdmmc_con[2];
  38. u32 sdio_con[2];
  39. u32 emmc_con[2];
  40. u32 sdmmc_ext_con[2];
  41. };
  42. check_member(rk3328_cru, sdmmc_ext_con[1], 0x39c);
  43. #define MHz 1000000
  44. #define KHz 1000
  45. #define OSC_HZ (24 * MHz)
  46. #define APLL_HZ (600 * MHz)
  47. #define GPLL_HZ (576 * MHz)
  48. #define CPLL_HZ (594 * MHz)
  49. #define CLK_CORE_HZ (600 * MHz)
  50. #define ACLKM_CORE_HZ (300 * MHz)
  51. #define PCLK_DBG_HZ (300 * MHz)
  52. #define PERIHP_ACLK_HZ (144000 * KHz)
  53. #define PERIHP_HCLK_HZ (72000 * KHz)
  54. #define PERIHP_PCLK_HZ (72000 * KHz)
  55. #define PWM_CLOCK_HZ (74 * MHz)
  56. enum apll_frequencies {
  57. APLL_816_MHZ,
  58. APLL_600_MHZ,
  59. };
  60. #endif /* __ASM_ARCH_CRU_RK3328_H_ */