ewl_x280_common.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*------------------------------------------------------------------------------
  2. -- --
  3. -- This software is confidential and proprietary and may be used --
  4. -- only as expressly authorized by a licensing agreement from --
  5. -- --
  6. -- Hantro Products Oy. --
  7. -- --
  8. -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY --
  9. -- ALL RIGHTS RESERVED --
  10. -- --
  11. -- The entire notice above must be reproduced --
  12. -- on all copies and should not be removed. --
  13. -- --
  14. --------------------------------------------------------------------------------
  15. --
  16. -- Abstract : Hantro 6280/7280/8270/8290 Encoder Wrapper Layer for OS services
  17. --
  18. ------------------------------------------------------------------------------*/
  19. #ifndef __EWL_X280_COMMON_H__
  20. #define __EWL_X280_COMMON_H__
  21. #include <stdio.h>
  22. #include <signal.h>
  23. extern FILE *fEwl;
  24. /* Macro for debug printing */
  25. #undef PTRACE
  26. #ifdef TRACE_EWL
  27. # include <stdio.h>
  28. # define PTRACE(...) if (fEwl) {fprintf(fEwl,"%s:%d:",__FILE__,__LINE__);fprintf(fEwl,__VA_ARGS__);}
  29. #else
  30. # define PTRACE(...) /* no trace */
  31. #endif
  32. #define ASIC_STATUS_SLICE_READY 0x100
  33. #define ASIC_STATUS_TEST_COPY_RDY 0x80
  34. #define ASIC_STATUS_TEST_IRQ 0x40
  35. #define ASIC_STATUS_BUFF_FULL 0x20
  36. #define ASIC_STATUS_RESET 0x10
  37. #define ASIC_STATUS_ERROR 0x08
  38. #define ASIC_STATUS_FRAME_READY 0x04
  39. #define ASIC_IRQ_LINE 0x01
  40. #define ASIC_STATUS_ALL (ASIC_STATUS_SLICE_READY |\
  41. ASIC_STATUS_TEST_IRQ |\
  42. ASIC_STATUS_TEST_COPY_RDY |\
  43. ASIC_STATUS_FRAME_READY | \
  44. ASIC_STATUS_BUFF_FULL | \
  45. ASIC_STATUS_RESET | \
  46. ASIC_STATUS_ERROR)
  47. /* the encoder device driver nod */
  48. #ifndef MEMALLOC_MODULE_PATH
  49. #define MEMALLOC_MODULE_PATH "/tmp/dev/memalloc"
  50. #endif
  51. #ifndef ENC_MODULE_PATH
  52. #define ENC_MODULE_PATH "/tmp/dev/hx280"
  53. #endif
  54. #ifndef SDRAM_LM_BASE
  55. #define SDRAM_LM_BASE 0x00000000
  56. #endif
  57. /* EWL internal information for Linux */
  58. typedef struct
  59. {
  60. u32 clientType;
  61. int fd_mem; /* /dev/mem */
  62. int fd_enc; /* /dev/hx280 */
  63. int fd_memalloc; /* /dev/memalloc */
  64. u32 regSize; /* IO mem size */
  65. u32 regBase;
  66. volatile u32 *pRegBase; /* IO mem base */
  67. volatile u32 *pSysReg; /* IO mem base */
  68. int semid;
  69. int sigio_needed;
  70. } hx280ewl_t;
  71. void HandleSIGIO(hx280ewl_t * enc);
  72. #endif /* __EWLX280_COMMON_H__ */