omap_opp_data.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * OMAP SoC specific OPP Data helpers
  3. *
  4. * Copyright (C) 2009-2010 Texas Instruments Incorporated - http://www.ti.com/
  5. * Nishanth Menon
  6. * Kevin Hilman
  7. * Copyright (C) 2010 Nokia Corporation.
  8. * Eduardo Valentin
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. *
  14. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  15. * kind, whether express or implied; without even the implied warranty
  16. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. */
  19. #ifndef __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
  20. #define __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
  21. #include <plat/omap_hwmod.h>
  22. /*
  23. * *BIG FAT WARNING*:
  24. * USE the following ONLY in opp data initialization common to an SoC.
  25. * DO NOT USE these in board files/pm core etc.
  26. */
  27. /**
  28. * struct omap_opp_def - OMAP OPP Definition
  29. * @hwmod_name: Name of the hwmod for this domain
  30. * @freq: Frequency in hertz corresponding to this OPP
  31. * @u_volt: Nominal voltage in microvolts corresponding to this OPP
  32. * @default_available: True/false - is this OPP available by default
  33. *
  34. * OMAP SOCs have a standard set of tuples consisting of frequency and voltage
  35. * pairs that the device will support per voltage domain. This is called
  36. * Operating Points or OPP. The actual definitions of OMAP Operating Points
  37. * varies over silicon within the same family of devices. For a specific
  38. * domain, you can have a set of {frequency, voltage} pairs and this is denoted
  39. * by an array of omap_opp_def. As the kernel boots and more information is
  40. * available, a set of these are activated based on the precise nature of
  41. * device the kernel boots up on. It is interesting to remember that each IP
  42. * which belongs to a voltage domain may define their own set of OPPs on top
  43. * of this - but this is handled by the appropriate driver.
  44. */
  45. struct omap_opp_def {
  46. char *hwmod_name;
  47. unsigned long freq;
  48. unsigned long u_volt;
  49. bool default_available;
  50. };
  51. /*
  52. * Initialization wrapper used to define an OPP for OMAP variants.
  53. */
  54. #define OPP_INITIALIZER(_hwmod_name, _enabled, _freq, _uv) \
  55. { \
  56. .hwmod_name = _hwmod_name, \
  57. .default_available = _enabled, \
  58. .freq = _freq, \
  59. .u_volt = _uv, \
  60. }
  61. /* Use this to initialize the default table */
  62. extern int __init omap_init_opp_table(struct omap_opp_def *opp_def,
  63. u32 opp_def_size);
  64. #endif /* __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H */