omap_opp_data.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * OMAP SoC specific OPP Data helpers
  4. *
  5. * Copyright (C) 2009-2010 Texas Instruments Incorporated - https://www.ti.com/
  6. * Nishanth Menon
  7. * Kevin Hilman
  8. * Copyright (C) 2010 Nokia Corporation.
  9. * Eduardo Valentin
  10. */
  11. #ifndef __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
  12. #define __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
  13. #include "omap_hwmod.h"
  14. #include "voltage.h"
  15. /*
  16. * *BIG FAT WARNING*:
  17. * USE the following ONLY in opp data initialization common to an SoC.
  18. * DO NOT USE these in board files/pm core etc.
  19. */
  20. /**
  21. * struct omap_opp_def - OMAP OPP Definition
  22. * @hwmod_name: Name of the hwmod for this domain
  23. * @freq: Frequency in hertz corresponding to this OPP
  24. * @u_volt: Nominal voltage in microvolts corresponding to this OPP
  25. * @default_available: True/false - is this OPP available by default
  26. *
  27. * OMAP SOCs have a standard set of tuples consisting of frequency and voltage
  28. * pairs that the device will support per voltage domain. This is called
  29. * Operating Points or OPP. The actual definitions of OMAP Operating Points
  30. * varies over silicon within the same family of devices. For a specific
  31. * domain, you can have a set of {frequency, voltage} pairs and this is denoted
  32. * by an array of omap_opp_def. As the kernel boots and more information is
  33. * available, a set of these are activated based on the precise nature of
  34. * device the kernel boots up on. It is interesting to remember that each IP
  35. * which belongs to a voltage domain may define their own set of OPPs on top
  36. * of this - but this is handled by the appropriate driver.
  37. */
  38. struct omap_opp_def {
  39. char *hwmod_name;
  40. unsigned long freq;
  41. unsigned long u_volt;
  42. bool default_available;
  43. };
  44. /*
  45. * Initialization wrapper used to define an OPP for OMAP variants.
  46. */
  47. #define OPP_INITIALIZER(_hwmod_name, _enabled, _freq, _uv) \
  48. { \
  49. .hwmod_name = _hwmod_name, \
  50. .default_available = _enabled, \
  51. .freq = _freq, \
  52. .u_volt = _uv, \
  53. }
  54. /*
  55. * Initialization wrapper used to define SmartReflex process data
  56. * XXX Is this needed? Just use C99 initializers in data files?
  57. */
  58. #define VOLT_DATA_DEFINE(_v_nom, _efuse_offs, _errminlimit, _errgain) \
  59. { \
  60. .volt_nominal = _v_nom, \
  61. .sr_efuse_offs = _efuse_offs, \
  62. .sr_errminlimit = _errminlimit, \
  63. .vp_errgain = _errgain \
  64. }
  65. /* Use this to initialize the default table */
  66. extern int __init omap_init_opp_table(struct omap_opp_def *opp_def,
  67. u32 opp_def_size);
  68. extern struct omap_volt_data omap34xx_vddmpu_volt_data[];
  69. extern struct omap_volt_data omap34xx_vddcore_volt_data[];
  70. extern struct omap_volt_data omap36xx_vddmpu_volt_data[];
  71. extern struct omap_volt_data omap36xx_vddcore_volt_data[];
  72. extern struct omap_volt_data omap443x_vdd_mpu_volt_data[];
  73. extern struct omap_volt_data omap443x_vdd_iva_volt_data[];
  74. extern struct omap_volt_data omap443x_vdd_core_volt_data[];
  75. extern struct omap_volt_data omap446x_vdd_mpu_volt_data[];
  76. extern struct omap_volt_data omap446x_vdd_iva_volt_data[];
  77. extern struct omap_volt_data omap446x_vdd_core_volt_data[];
  78. #endif /* __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H */