standardDeviationMemoryDefinition.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * OMAP2/3 clockdomain framework functions
  3. *
  4. * Copyright (C) 2008, 2012 Texas Instruments, Inc.
  5. * Copyright (C) 2008-2011 Nokia Corporation
  6. *
  7. * Paul Walmsley
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAIN_H
  14. #define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAIN_H
  15. #include <linux/init.h>
  16. #include <linux/spinlock.h>
  17. #include "powerdomain.h"
  18. #include "clock.h"
  19. #include "omap_hwmod.h"
  20. /*
  21. * Clockdomain flags
  22. *
  23. * XXX Document CLKDM_CAN_* flags
  24. *
  25. * CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this
  26. * clockdomain. (Currently, this applies to OMAP3 clockdomains only.)
  27. * CLKDM_ACTIVE_WITH_MPU: The PRCM guarantees that this clockdomain is
  28. * active whenever the MPU is active. True for interconnects and
  29. * the WKUP clockdomains.
  30. * CLKDM_MISSING_IDLE_REPORTING: The idle status of the IP blocks and
  31. * clocks inside this clockdomain are not taken into account by
  32. * the PRCM when determining whether the clockdomain is idle.
  33. * Without this flag, if the clockdomain is set to
  34. * hardware-supervised idle mode, the PRCM may transition the
  35. * enclosing powerdomain to a low power state, even when devices
  36. * inside the clockdomain and powerdomain are in use. (An example
  37. * of such a clockdomain is the EMU clockdomain on OMAP3/4.) If
  38. * this flag is set, and the clockdomain does not support the
  39. * force-sleep mode, then the HW_AUTO mode will be used to put the
  40. * clockdomain to sleep. Similarly, if the clockdomain supports
  41. * the force-wakeup mode, then it will be used whenever a clock or
  42. * IP block inside the clockdomain is active, rather than the
  43. * HW_AUTO mode.
  44. */
  45. #define CLKDM_CAN_FORCE_SLEEP (1 << 0)
  46. #define CLKDM_CAN_FORCE_WAKEUP (1 << 1)
  47. #define CLKDM_CAN_ENABLE_AUTO (1 << 2)
  48. #define CLKDM_CAN_DISABLE_AUTO (1 << 3)
  49. #define CLKDM_NO_AUTODEPS (1 << 4)
  50. #define CLKDM_ACTIVE_WITH_MPU (1 << 5)
  51. #define CLKDM_MISSING_IDLE_REPORTING (1 << 6)
  52. #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO)
  53. #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)
  54. #define CLKDM_CAN_HWSUP_SWSUP (CLKDM_CAN_SWSUP | CLKDM_CAN_HWSUP)
  55. /**
  56. * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode
  57. * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only
  58. *
  59. * A clockdomain that should have wkdeps and sleepdeps added when a
  60. * clockdomain should stay active in hwsup mode; and conversely,
  61. * removed when the clockdomain should be allowed to go inactive in
  62. * hwsup mode.
  63. *
  64. * Autodeps are deprecated and should be removed after
  65. * omap_hwmod-based fine-grained module idle control is added.
  66. */
  67. struct clkdm_autodep {
  68. union {
  69. const char *name;
  70. struct clockdomain *ptr;
  71. } clkdm;
  72. };
  73. /**
  74. * struct clkdm_dep - encode dependencies between clockdomains
  75. * @clkdm_name: clockdomain name
  76. * @clkdm: pointer to the struct clockdomain of @clkdm_name
  77. * @wkdep_usecount: Number of wakeup dependencies causing this clkdm to wake
  78. * @sleepdep_usecount: Number of sleep deps that could prevent clkdm from idle
  79. *
  80. * Statically defined. @clkdm is resolved from @clkdm_name at runtime and
  81. * should not be pre-initialized.