dma-register.h 1009 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * SH3 CPU-specific DMA definitions, used by both DMA drivers
  3. *
  4. * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef CPU_DMA_REGISTER_H
  11. #define CPU_DMA_REGISTER_H
  12. #define CHCR_TS_LOW_MASK 0x18
  13. #define CHCR_TS_LOW_SHIFT 3
  14. #define CHCR_TS_HIGH_MASK 0
  15. #define CHCR_TS_HIGH_SHIFT 0
  16. #define DMAOR_INIT DMAOR_DME
  17. /*
  18. * The SuperH DMAC supports a number of transmit sizes, we list them here,
  19. * with their respective values as they appear in the CHCR registers.
  20. */
  21. enum {
  22. XMIT_SZ_8BIT,
  23. XMIT_SZ_16BIT,
  24. XMIT_SZ_32BIT,
  25. XMIT_SZ_128BIT,
  26. };
  27. /* log2(size / 8) - used to calculate number of transfers */
  28. #define TS_SHIFT { \
  29. [XMIT_SZ_8BIT] = 0, \
  30. [XMIT_SZ_16BIT] = 1, \
  31. [XMIT_SZ_32BIT] = 2, \
  32. [XMIT_SZ_128BIT] = 4, \
  33. }
  34. #define TS_INDEX2VAL(i) (((i) & 3) << CHCR_TS_LOW_SHIFT)
  35. #endif