m00233_video_measure_memmap_package.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Copyright 2014-2015 Cisco Systems, Inc. and/or its affiliates.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you may redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; version 2 of the License.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  10. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  11. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  12. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  13. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  14. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  15. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  16. * SOFTWARE.
  17. */
  18. #ifndef M00233_VIDEO_MEASURE_MEMMAP_PACKAGE_H
  19. #define M00233_VIDEO_MEASURE_MEMMAP_PACKAGE_H
  20. /*******************************************************************
  21. * Register Block
  22. * M00233_VIDEO_MEASURE_MEMMAP_PACKAGE_VHD_REGMAP
  23. *******************************************************************/
  24. struct m00233_video_measure_regmap {
  25. uint32_t irq_status; /* Reg 0x0000 */
  26. /* The vertical counter starts on rising edge of vsync */
  27. uint32_t vsync_time; /* Reg 0x0004 */
  28. uint32_t vback_porch; /* Reg 0x0008 */
  29. uint32_t vactive_area; /* Reg 0x000c */
  30. uint32_t vfront_porch; /* Reg 0x0010 */
  31. /* The horizontal counter starts on rising edge of hsync. */
  32. uint32_t hsync_time; /* Reg 0x0014 */
  33. uint32_t hback_porch; /* Reg 0x0018 */
  34. uint32_t hactive_area; /* Reg 0x001c */
  35. uint32_t hfront_porch; /* Reg 0x0020 */
  36. uint32_t control; /* Reg 0x0024, Default=0x0 */
  37. uint32_t irq_triggers; /* Reg 0x0028, Default=0xff */
  38. /* Value is given in number of register bus clock periods between */
  39. /* falling and rising edge of hsync. Must be non-zero. */
  40. uint32_t hsync_timeout_val; /* Reg 0x002c, Default=0x1fff */
  41. uint32_t status; /* Reg 0x0030 */
  42. };
  43. #define M00233_VIDEO_MEASURE_REG_IRQ_STATUS_OFST 0
  44. #define M00233_VIDEO_MEASURE_REG_VSYNC_TIME_OFST 4
  45. #define M00233_VIDEO_MEASURE_REG_VBACK_PORCH_OFST 8
  46. #define M00233_VIDEO_MEASURE_REG_VACTIVE_AREA_OFST 12
  47. #define M00233_VIDEO_MEASURE_REG_VFRONT_PORCH_OFST 16
  48. #define M00233_VIDEO_MEASURE_REG_HSYNC_TIME_OFST 20
  49. #define M00233_VIDEO_MEASURE_REG_HBACK_PORCH_OFST 24
  50. #define M00233_VIDEO_MEASURE_REG_HACTIVE_AREA_OFST 28
  51. #define M00233_VIDEO_MEASURE_REG_HFRONT_PORCH_OFST 32
  52. #define M00233_VIDEO_MEASURE_REG_CONTROL_OFST 36
  53. #define M00233_VIDEO_MEASURE_REG_IRQ_TRIGGERS_OFST 40
  54. #define M00233_VIDEO_MEASURE_REG_HSYNC_TIMEOUT_VAL_OFST 44
  55. #define M00233_VIDEO_MEASURE_REG_STATUS_OFST 48
  56. /*******************************************************************
  57. * Bit Mask for register
  58. * M00233_VIDEO_MEASURE_MEMMAP_PACKAGE_VHD_BITMAP
  59. *******************************************************************/
  60. /* irq_status [7:0] */
  61. #define M00233_IRQ_STATUS_BITMAP_VSYNC_TIME_OFST (0)
  62. #define M00233_IRQ_STATUS_BITMAP_VSYNC_TIME_MSK (0x1 << M00233_IRQ_STATUS_BITMAP_VSYNC_TIME_OFST)
  63. #define M00233_IRQ_STATUS_BITMAP_VBACK_PORCH_OFST (1)
  64. #define M00233_IRQ_STATUS_BITMAP_VBACK_PORCH_MSK (0x1 << M00233_IRQ_STATUS_BITMAP_VBACK_PORCH_OFST)
  65. #define M00233_IRQ_STATUS_BITMAP_VACTIVE_AREA_OFST (2)
  66. #define M00233_IRQ_STATUS_BITMAP_VACTIVE_AREA_MSK (0x1 << M00233_IRQ_STATUS_BITMAP_VACTIVE_AREA_OFST)
  67. #define M00233_IRQ_STATUS_BITMAP_VFRONT_PORCH_OFST (3)
  68. #define M00233_IRQ_STATUS_BITMAP_VFRONT_PORCH_MSK (0x1 << M00233_IRQ_STATUS_BITMAP_VFRONT_PORCH_OFST)
  69. #define M00233_IRQ_STATUS_BITMAP_HSYNC_TIME_OFST (4)
  70. #define M00233_IRQ_STATUS_BITMAP_HSYNC_TIME_MSK (0x1 << M00233_IRQ_STATUS_BITMAP_HSYNC_TIME_OFST)
  71. #define M00233_IRQ_STATUS_BITMAP_HBACK_PORCH_OFST (5)
  72. #define M00233_IRQ_STATUS_BITMAP_HBACK_PORCH_MSK (0x1 << M00233_IRQ_STATUS_BITMAP_HBACK_PORCH_OFST)
  73. #define M00233_IRQ_STATUS_BITMAP_HACTIVE_AREA_OFST (6)
  74. #define M00233_IRQ_STATUS_BITMAP_HACTIVE_AREA_MSK (0x1 << M00233_IRQ_STATUS_BITMAP_HACTIVE_AREA_OFST)
  75. #define M00233_IRQ_STATUS_BITMAP_HFRONT_PORCH_OFST (7)
  76. #define M00233_IRQ_STATUS_BITMAP_HFRONT_PORCH_MSK (0x1 << M00233_IRQ_STATUS_BITMAP_HFRONT_PORCH_OFST)
  77. /* control [4:0] */
  78. #define M00233_CONTROL_BITMAP_HSYNC_POLARITY_LOW_OFST (0)
  79. #define M00233_CONTROL_BITMAP_HSYNC_POLARITY_LOW_MSK (0x1 << M00233_CONTROL_BITMAP_HSYNC_POLARITY_LOW_OFST)
  80. #define M00233_CONTROL_BITMAP_VSYNC_POLARITY_LOW_OFST (1)
  81. #define M00233_CONTROL_BITMAP_VSYNC_POLARITY_LOW_MSK (0x1 << M00233_CONTROL_BITMAP_VSYNC_POLARITY_LOW_OFST)
  82. #define M00233_CONTROL_BITMAP_ENABLE_MEASURE_OFST (2)
  83. #define M00233_CONTROL_BITMAP_ENABLE_MEASURE_MSK (0x1 << M00233_CONTROL_BITMAP_ENABLE_MEASURE_OFST)
  84. #define M00233_CONTROL_BITMAP_ENABLE_INTERRUPT_OFST (3)
  85. #define M00233_CONTROL_BITMAP_ENABLE_INTERRUPT_MSK (0x1 << M00233_CONTROL_BITMAP_ENABLE_INTERRUPT_OFST)
  86. #define M00233_CONTROL_BITMAP_UPDATE_ON_HSYNC_OFST (4)
  87. #define M00233_CONTROL_BITMAP_UPDATE_ON_HSYNC_MSK (0x1 << M00233_CONTROL_BITMAP_UPDATE_ON_HSYNC_OFST)
  88. /* irq_triggers [7:0] */
  89. #define M00233_IRQ_TRIGGERS_BITMAP_VSYNC_TIME_OFST (0)
  90. #define M00233_IRQ_TRIGGERS_BITMAP_VSYNC_TIME_MSK (0x1 << M00233_IRQ_TRIGGERS_BITMAP_VSYNC_TIME_OFST)
  91. #define M00233_IRQ_TRIGGERS_BITMAP_VBACK_PORCH_OFST (1)
  92. #define M00233_IRQ_TRIGGERS_BITMAP_VBACK_PORCH_MSK (0x1 << M00233_IRQ_TRIGGERS_BITMAP_VBACK_PORCH_OFST)
  93. #define M00233_IRQ_TRIGGERS_BITMAP_VACTIVE_AREA_OFST (2)
  94. #define M00233_IRQ_TRIGGERS_BITMAP_VACTIVE_AREA_MSK (0x1 << M00233_IRQ_TRIGGERS_BITMAP_VACTIVE_AREA_OFST)
  95. #define M00233_IRQ_TRIGGERS_BITMAP_VFRONT_PORCH_OFST (3)
  96. #define M00233_IRQ_TRIGGERS_BITMAP_VFRONT_PORCH_MSK (0x1 << M00233_IRQ_TRIGGERS_BITMAP_VFRONT_PORCH_OFST)
  97. #define M00233_IRQ_TRIGGERS_BITMAP_HSYNC_TIME_OFST (4)
  98. #define M00233_IRQ_TRIGGERS_BITMAP_HSYNC_TIME_MSK (0x1 << M00233_IRQ_TRIGGERS_BITMAP_HSYNC_TIME_OFST)
  99. #define M00233_IRQ_TRIGGERS_BITMAP_HBACK_PORCH_OFST (5)
  100. #define M00233_IRQ_TRIGGERS_BITMAP_HBACK_PORCH_MSK (0x1 << M00233_IRQ_TRIGGERS_BITMAP_HBACK_PORCH_OFST)
  101. #define M00233_IRQ_TRIGGERS_BITMAP_HACTIVE_AREA_OFST (6)
  102. #define M00233_IRQ_TRIGGERS_BITMAP_HACTIVE_AREA_MSK (0x1 << M00233_IRQ_TRIGGERS_BITMAP_HACTIVE_AREA_OFST)
  103. #define M00233_IRQ_TRIGGERS_BITMAP_HFRONT_PORCH_OFST (7)
  104. #define M00233_IRQ_TRIGGERS_BITMAP_HFRONT_PORCH_MSK (0x1 << M00233_IRQ_TRIGGERS_BITMAP_HFRONT_PORCH_OFST)
  105. /* status [1:0] */
  106. #define M00233_STATUS_BITMAP_HSYNC_TIMEOUT_OFST (0)
  107. #define M00233_STATUS_BITMAP_HSYNC_TIMEOUT_MSK (0x1 << M00233_STATUS_BITMAP_HSYNC_TIMEOUT_OFST)
  108. #define M00233_STATUS_BITMAP_INIT_DONE_OFST (1)
  109. #define M00233_STATUS_BITMAP_INIT_DONE_MSK (0x1 << M00233_STATUS_BITMAP_INIT_DONE_OFST)
  110. #endif /*M00233_VIDEO_MEASURE_MEMMAP_PACKAGE_H*/