main.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright 2011 Freescale Semiconductor, Inc.
  3. * Copyright 2011 Linaro Ltd.
  4. *
  5. * The code contained herein is licensed under the GNU General Public
  6. * License. You may obtain a copy of the GNU General Public License
  7. * Version 2 or later at the following locations:
  8. *
  9. * http://www.opensource.org/licenses/gpl-license.html
  10. * http://www.gnu.org/copyleft/gpl.html
  11. */
  12. #include <linux/init.h>
  13. #include <linux/types.h>
  14. #include <linux/clk.h>
  15. #include <linux/clkdev.h>
  16. #include <linux/err.h>
  17. #include <linux/io.h>
  18. #include <linux/of.h>
  19. #include <linux/of_address.h>
  20. #include <linux/of_irq.h>
  21. #include "clk.h"
  22. #include "common.h"
  23. #define CCGR0 0x68
  24. #define CCGR1 0x6c
  25. #define CCGR2 0x70
  26. #define CCGR3 0x74
  27. #define CCGR4 0x78
  28. #define CCGR5 0x7c
  29. #define CCGR6 0x80
  30. #define CCGR7 0x84
  31. #define CLPCR 0x54
  32. #define BP_CLPCR_LPM 0
  33. #define BM_CLPCR_LPM (0x3 << 0)
  34. #define BM_CLPCR_BYPASS_PMIC_READY (0x1 << 2)
  35. #define BM_CLPCR_ARM_CLK_DIS_ON_LPM (0x1 << 5)
  36. #define BM_CLPCR_SBYOS (0x1 << 6)
  37. #define BM_CLPCR_DIS_REF_OSC (0x1 << 7)
  38. #define BM_CLPCR_VSTBY (0x1 << 8)
  39. #define BP_CLPCR_STBY_COUNT 9
  40. #define BM_CLPCR_STBY_COUNT (0x3 << 9)
  41. #define BM_CLPCR_COSC_PWRDOWN (0x1 << 11)
  42. #define BM_CLPCR_WB_PER_AT_LPM (0x1 << 16)
  43. #define BM_CLPCR_WB_CORE_AT_LPM (0x1 << 17)
  44. #define BM_CLPCR_BYP_MMDC_CH0_LPM_HS (0x1 << 19)
  45. #define BM_CLPCR_BYP_MMDC_CH1_LPM_HS (0x1 << 21)
  46. #define BM_CLPCR_MASK_CORE0_WFI (0x1 << 22)
  47. #define BM_CLPCR_MASK_CORE1_WFI (0x1 << 23)
  48. #define BM_CLPCR_MASK_CORE2_WFI (0x1 << 24)
  49. #define BM_CLPCR_MASK_CORE3_WFI (0x1 << 25)
  50. #define BM_CLPCR_MASK_SCU_IDLE (0x1 << 26)
  51. #define BM_CLPCR_MASK_L2CC_IDLE (0x1 << 27)