cm3xxx.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * OMAP2/3 Clock Management (CM) register definitions
  3. *
  4. * Copyright (C) 2007-2009 Texas Instruments, Inc.
  5. * Copyright (C) 2007-2010 Nokia Corporation
  6. * Paul Walmsley
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * The CM hardware modules on the OMAP2/3 are quite similar to each
  13. * other. The CM modules/instances on OMAP4 are quite different, so
  14. * they are handled in a separate file.
  15. */
  16. #ifndef __ARCH_ASM_MACH_OMAP2_CM3XXX_H
  17. #define __ARCH_ASM_MACH_OMAP2_CM3XXX_H
  18. #include "prcm-common.h"
  19. #include "cm2xxx_3xxx.h"
  20. #define OMAP34XX_CM_REGADDR(module, reg) \
  21. OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
  22. /*
  23. * OMAP3-specific global CM registers
  24. * Use cm_{read,write}_reg() with these registers.
  25. * These registers appear once per CM module.
  26. */
  27. #define OMAP3430_CM_REVISION OMAP34XX_CM_REGADDR(OCP_MOD, 0x0000)
  28. #define OMAP3430_CM_SYSCONFIG OMAP34XX_CM_REGADDR(OCP_MOD, 0x0010)
  29. #define OMAP3430_CM_POLCTRL OMAP34XX_CM_REGADDR(OCP_MOD, 0x009c)
  30. #define OMAP3_CM_CLKOUT_CTRL_OFFSET 0x0070
  31. #define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
  32. /*
  33. * Module specific CM register offsets from CM_BASE + domain offset
  34. * Use cm_{read,write}_mod_reg() with these registers.
  35. * These register offsets generally appear in more than one PRCM submodule.
  36. */
  37. /* OMAP3-specific register offsets */
  38. #define OMAP3430_CM_CLKEN_PLL 0x0004
  39. #define OMAP3430ES2_CM_CLKEN2 0x0004
  40. #define OMAP3430ES2_CM_FCLKEN3 0x0008
  41. #define OMAP3430_CM_IDLEST_PLL CM_IDLEST2
  42. #define OMAP3430_CM_AUTOIDLE_PLL CM_AUTOIDLE2
  43. #define OMAP3430ES2_CM_AUTOIDLE2_PLL CM_AUTOIDLE2
  44. #define OMAP3430_CM_CLKSEL1 CM_CLKSEL
  45. #define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL
  46. #define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2
  47. #define OMAP3430_CM_SLEEPDEP CM_CLKSEL2
  48. #define OMAP3430_CM_CLKSEL3 OMAP2_CM_CLKSTCTRL
  49. #define OMAP3430_CM_CLKSTST 0x004c
  50. #define OMAP3430ES2_CM_CLKSEL4 0x004c
  51. #define OMAP3430ES2_CM_CLKSEL5 0x0050
  52. #define OMAP3430_CM_CLKSEL2_EMU 0x0050
  53. #define OMAP3430_CM_CLKSEL3_EMU 0x0054
  54. /* CM_IDLEST bit field values to indicate deasserted IdleReq */
  55. #define OMAP34XX_CM_IDLEST_VAL 1
  56. #ifndef __ASSEMBLER__
  57. extern void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask);
  58. extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask);
  59. extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask);
  60. extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask);
  61. extern bool omap3xxx_cm_is_clkdm_in_hwsup(s16 module, u32 mask);
  62. extern int omap3xxx_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id,
  63. u8 idlest_shift);
  64. extern int omap3xxx_cm_split_idlest_reg(void __iomem *idlest_reg,
  65. s16 *prcm_inst, u8 *idlest_reg_id);
  66. extern void omap3_cm_save_context(void);
  67. extern void omap3_cm_restore_context(void);
  68. extern int __init omap3xxx_cm_init(void);
  69. #endif
  70. #endif