vdec_reg.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License as published by
  4. * the Free Software Foundation; either version 2 of the named License,
  5. * or any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program; if not, write to the Free Software
  14. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
  15. *
  16. * Author: Tim Yao <timyao@amlogic.com>
  17. *
  18. */
  19. #ifndef VDEC_REG_H
  20. #define VDEC_REG_H
  21. #ifdef CONFIG_ARCH_MESON6
  22. #define READ_VREG(r) (__raw_readl(DOS_REG_ADDR(r)))
  23. #define WRITE_VREG(r, val) __raw_writel(val, DOS_REG_ADDR(r))
  24. #define WRITE_VREG_BITS(r, val, start, len) \
  25. WRITE_VREG(r, (READ_VREG(r) & ~(((1L<<(len))-1)<<(start)))|((unsigned)((val)&((1L<<(len))-1)) << (start)))
  26. #define SET_VREG_MASK(r, mask) WRITE_VREG(r, READ_VREG(r) | (mask))
  27. #define CLEAR_VREG_MASK(r, mask) WRITE_VREG(r, READ_VREG(r) & ~(mask))
  28. #define ASSIST_MBOX1_CLR_REG VDEC_ASSIST_MBOX1_CLR_REG
  29. #define ASSIST_MBOX1_MASK VDEC_ASSIST_MBOX1_MASK
  30. #define ASSIST_AMR1_INT0 VDEC_ASSIST_AMR1_INT0
  31. #define ASSIST_AMR1_INT1 VDEC_ASSIST_AMR1_INT1
  32. #define ASSIST_AMR1_INT2 VDEC_ASSIST_AMR1_INT2
  33. #define ASSIST_AMR1_INT3 VDEC_ASSIST_AMR1_INT3
  34. #define ASSIST_AMR1_INT4 VDEC_ASSIST_AMR1_INT4
  35. #define ASSIST_AMR1_INT5 VDEC_ASSIST_AMR1_INT5
  36. #define ASSIST_AMR1_INT6 VDEC_ASSIST_AMR1_INT6
  37. #define ASSIST_AMR1_INT7 VDEC_ASSIST_AMR1_INT7
  38. #define ASSIST_AMR1_INT8 VDEC_ASSIST_AMR1_INT8
  39. #define ASSIST_AMR1_INT9 VDEC_ASSIST_AMR1_INT9
  40. #else
  41. #define READ_VREG(r) READ_CBUS_REG(r)
  42. #define WRITE_VREG(r, val) WRITE_CBUS_REG(r, val)
  43. #define WRITE_VREG_BITS(r, val, start, len) WRITE_CBUS_REG_BITS(r, val, start, len)
  44. #define SET_VREG_MASK(r, mask) SET_CBUS_REG_MASK(r, mask)
  45. #define CLEAR_VREG_MASK(r, mask) CLEAR_CBUS_REG_MASK(r, mask)
  46. #endif
  47. #endif /* VDEC_REG_H */