dwl_freertos.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #include "basetype.h"
  2. #include "dwl.h"
  3. //#define _DWL_DEBUG
  4. #ifdef _DWL_DEBUG
  5. #define DWL_DEBUG(fmt, args...) printf(__FILE__ ":%d: " fmt, __LINE__ , ## args)
  6. #else
  7. #define DWL_DEBUG(fmt, args...) /* not debugging: nothing */
  8. #endif
  9. #ifndef HX170DEC_IO_BASE
  10. #define HX170DEC_IO_BASE 0xC0000000U
  11. #endif
  12. #define HX170PP_REG_START 0xF0
  13. #define HX170DEC_REG_START 0x4
  14. #define HX170PP_SYNTH_CFG 100
  15. #define HX170DEC_SYNTH_CFG 50
  16. #define HX170DEC_SYNTH_CFG_2 54
  17. #define HX170PP_FUSE_CFG 99
  18. #define HX170DEC_FUSE_CFG 57
  19. #define DWL_DECODER_INT ((DWLReadReg(dec_dwl, HX170DEC_REG_START) >> 12) & 0xFFU)
  20. #define DWL_PP_INT ((DWLReadReg(dec_dwl, HX170PP_REG_START) >> 12) & 0xFFU)
  21. #define DEC_IRQ_ABORT (1 << 11)
  22. #define DEC_IRQ_RDY (1 << 12)
  23. #define DEC_IRQ_BUS (1 << 13)
  24. #define DEC_IRQ_BUFFER (1 << 14)
  25. #define DEC_IRQ_ASO (1 << 15)
  26. #define DEC_IRQ_ERROR (1 << 16)
  27. #define DEC_IRQ_SLICE (1 << 17)
  28. #define DEC_IRQ_TIMEOUT (1 << 18)
  29. #define PP_IRQ_RDY (1 << 12)
  30. #define PP_IRQ_BUS (1 << 13)
  31. #define DWL_STREAM_ERROR_BIT 0x010000 /* 16th bit */
  32. #define DWL_HW_TIMEOUT_BIT 0x040000 /* 18th bit */
  33. #define DWL_HW_ENABLE_BIT 0x000001 /* 0th bit */
  34. #define DWL_HW_PIC_RDY_BIT 0x001000 /* 12th bit */
  35. #ifdef _DWL_HW_PERFORMANCE
  36. /* signal that decoder/pp is enabled */
  37. void DwlDecoderEnable(void);
  38. void DwlPpEnable(void);
  39. #endif
  40. /* Function prototypes */
  41. /* wrapper information */
  42. typedef struct hX170dwl
  43. {
  44. u32 clientType;
  45. u32 numCores;
  46. volatile u32 *pRegBase; /* IO mem base */
  47. u32 regSize; /* IO mem size */
  48. u32 freeLinMem; /* Start address of free linear memory */
  49. u32 freeRefFrmMem; /* Start address of free reference frame memory */
  50. int semid;
  51. int sigio_needed;
  52. u32 bPPReserved;
  53. } hX170dwl_t;
  54. i32 DWLWaitPpHwReady(const void *instance, u32 timeout);
  55. i32 DWLWaitDecHwReady(const void *instance, u32 timeout);
  56. void DWLSoftResetAsic(void);