rmparser.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * AMLOGIC Audio/Video streaming port driver.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the named License,
  7. * or any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
  17. *
  18. * Author: Chen Zhang <chen.zhang@amlogic.com>
  19. *
  20. */
  21. #ifndef RMPARSER_H
  22. #define RMPARSER_H
  23. extern void rm_set_vasid(u32 vid, u32 aid);
  24. extern ssize_t rmparser_write(struct file *file,
  25. struct stream_buf_s *vbuf,
  26. struct stream_buf_s *abuf,
  27. const char __user *buf, size_t count);
  28. s32 rmparser_init(void);
  29. extern void rmparser_release(void);
  30. extern void rm_audio_reset(void);
  31. #ifdef CONFIG_ARCH_MESON6
  32. // TODO: move to register headers
  33. #define ES_PACK_SIZE_BIT 8
  34. #define ES_PACK_SIZE_WID 24
  35. #define ES_CTRL_WID 8
  36. #define ES_CTRL_BIT 0
  37. #define ES_TYPE_MASK (3 << 6)
  38. #define ES_TYPE_VIDEO (0 << 6)
  39. #define ES_TYPE_AUDIO (1 << 6)
  40. #define ES_TYPE_SUBTITLE (2 << 6)
  41. #define ES_WRITE (1<<5)
  42. #define ES_PASSTHROUGH (1<<4)
  43. #define ES_INSERT_BEFORE_ES_WRITE (1<<3)
  44. #define ES_DISCARD (1<<2)
  45. #define ES_SEARCH (1<<1)
  46. #define ES_PARSER_START (1<<0)
  47. #define ES_PARSER_BUSY (1<<0)
  48. #define PARSER_INTSTAT_FETCH_CMD (1<<7)
  49. #define PARSER_INTSTAT_PARSE (1<<4)
  50. #define PARSER_INTSTAT_DISCARD (1<<3)
  51. #define PARSER_INTSTAT_INSZERO (1<<2)
  52. #define PARSER_INTSTAT_ACT_NOSSC (1<<1)
  53. #define PARSER_INTSTAT_SC_FOUND (1<<0)
  54. #define FETCH_CIR_BUF (1<<31)
  55. #define FETCH_CHK_BUF_STOP (1<<30)
  56. #define FETCH_PASSTHROUGH (1<<29)
  57. #define FETCH_ENDIAN 27
  58. #define FETCH_PASSTHROUGH_TYPE_MASK (0x3<<27)
  59. #define FETCH_ENDIAN_MASK (0x7<<27)
  60. #define FETCH_BUF_SIZE_MASK (0x7ffffff)
  61. #define FETCH_CMD_PTR_MASK 3
  62. #define FETCH_CMD_RD_PTR_BIT 5
  63. #define FETCH_CMD_WR_PTR_BIT 3
  64. #define FETCH_CMD_NUM_MASK 3
  65. #define FETCH_CMD_NUM_BIT 0
  66. #define ES_COUNT_MASK 0xfff
  67. #define ES_COUNT_BIT 20
  68. #define ES_REQ_PENDING (1<<19)
  69. #define ES_PASSTHROUGH_EN (1<<18)
  70. #define ES_PASSTHROUGH_TYPE_MASK (3<<16)
  71. #define ES_PASSTHROUGH_TYPE_VIDEO (0<<16)
  72. #define ES_PASSTHROUGH_TYPE_AUDIO (1<<16)
  73. #define ES_PASSTHROUGH_TYPE_SUBTITLE (2<<16)
  74. #define ES_WR_ENDIAN_MASK (0x7)
  75. #define ES_SUB_WR_ENDIAN_BIT 9
  76. #define ES_SUB_MAN_RD_PTR (1<<8)
  77. #define ES_AUD_WR_ENDIAN_BIT 5
  78. #define ES_AUD_MAN_RD_PTR (1<<4)
  79. #define ES_VID_WR_ENDIAN_BIT 1
  80. #define ES_VID_MAN_RD_PTR (1<<0)
  81. #define PS_CFG_FETCH_DMA_URGENT (1<<31)
  82. #define PS_CFG_STREAM_DMA_URGENT (1<<30)
  83. #define PS_CFG_FORCE_PFIFO_REN (1<<29)
  84. #define PS_CFG_PFIFO_PEAK_EN (1<<28)
  85. #define PS_CFG_SRC_SEL_BIT 24
  86. #define PS_CFG_SRC_SEL_MASK (3<<PS_CFG_SRC_SEL_BIT)
  87. #define PS_CFG_SRC_SEL_FETCH (0<<PS_CFG_SRC_SEL_BIT)
  88. #define PS_CFG_SRC_SEL_AUX1 (1<<PS_CFG_SRC_SEL_BIT) // from NDMA
  89. #define PS_CFG_SRC_SEL_AUX2 (2<<PS_CFG_SRC_SEL_BIT)
  90. #define PS_CFG_SRC_SEL_AUX3 (3<<PS_CFG_SRC_SEL_BIT)
  91. #define PS_CFG_PFIFO_EMPTY_CNT_BIT 16
  92. #define PS_CFG_PFIFO_EMPTY_CNT_MASK 0xff
  93. #define PS_CFG_MAX_ES_WR_CYCLE_BIT 12
  94. #define PS_CFG_MAX_ES_WR_CYCLE_MASK 0xf
  95. #define PS_CFG_STARTCODE_WID_MASK (0x3<<10)
  96. #define PS_CFG_STARTCODE_WID_8 (0x0<<10)
  97. #define PS_CFG_STARTCODE_WID_16 (0x1<<10)
  98. #define PS_CFG_STARTCODE_WID_24 (0x2<<10)
  99. #define PS_CFG_STARTCODE_WID_32 (0x3<<10)
  100. #define PS_CFG_PFIFO_ACCESS_WID_MASK (0x3<<8)
  101. #define PS_CFG_PFIFO_ACCESS_WID_8 (0x0<<8)
  102. #define PS_CFG_PFIFO_ACCESS_WID_16 (0x1<<8)
  103. #define PS_CFG_PFIFO_ACCESS_WID_24 (0x2<<8)
  104. #define PS_CFG_PFIFO_ACCESS_WID_32 (0x3<<8)
  105. #define PS_CFG_MAX_FETCH_CYCLE_BIT 0
  106. #define PS_CFG_MAX_FETCH_CYCLE_MASK 0xff
  107. #define PARSER_INT_DISABLE_CNT_MASK 0xffff
  108. #define PARSER_INT_DISABLE_CNT_BIT 16
  109. #define PARSER_INT_HOST_EN_MASK 0xff
  110. #define PARSER_INT_HOST_EN_BIT 8
  111. #define PARSER_INT_AMRISC_EN_MASK 0xff
  112. #define PARSER_INT_AMRISC_EN_BIT 0
  113. #define PARSER_INT_ALL 0xff
  114. #define RESET_PARSER (1<<8)
  115. #define TS_HIU_ENABLE 5
  116. #define USE_HI_BSF_INTERFACE 7
  117. #endif
  118. #endif /* RMPARSER_H */