regs-dmac.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * PKUnity Direct Memory Access Controller (DMAC)
  4. */
  5. /*
  6. * Interrupt Status Reg DMAC_ISR.
  7. */
  8. #define DMAC_ISR (PKUNITY_DMAC_BASE + 0x0020)
  9. /*
  10. * Interrupt Transfer Complete Status Reg DMAC_ITCSR.
  11. */
  12. #define DMAC_ITCSR (PKUNITY_DMAC_BASE + 0x0050)
  13. /*
  14. * Interrupt Transfer Complete Clear Reg DMAC_ITCCR.
  15. */
  16. #define DMAC_ITCCR (PKUNITY_DMAC_BASE + 0x0060)
  17. /*
  18. * Interrupt Error Status Reg DMAC_IESR.
  19. */
  20. #define DMAC_IESR (PKUNITY_DMAC_BASE + 0x0080)
  21. /*
  22. * Interrupt Error Clear Reg DMAC_IECR.
  23. */
  24. #define DMAC_IECR (PKUNITY_DMAC_BASE + 0x0090)
  25. /*
  26. * Enable Channels Reg DMAC_ENCH.
  27. */
  28. #define DMAC_ENCH (PKUNITY_DMAC_BASE + 0x00B0)
  29. /*
  30. * DMA control reg. Space [byte]
  31. */
  32. #define DMASp 0x00000100
  33. /*
  34. * Source Addr DMAC_SRCADDR(ch).
  35. */
  36. #define DMAC_SRCADDR(ch) (PKUNITY_DMAC_BASE + (ch)*DMASp + 0x00)
  37. /*
  38. * Destination Addr DMAC_DESTADDR(ch).
  39. */
  40. #define DMAC_DESTADDR(ch) (PKUNITY_DMAC_BASE + (ch)*DMASp + 0x04)
  41. /*
  42. * Control Reg DMAC_CONTROL(ch).
  43. */
  44. #define DMAC_CONTROL(ch) (PKUNITY_DMAC_BASE + (ch)*DMASp + 0x0C)
  45. /*
  46. * Configuration Reg DMAC_CONFIG(ch).
  47. */
  48. #define DMAC_CONFIG(ch) (PKUNITY_DMAC_BASE + (ch)*DMASp + 0x10)
  49. #define DMAC_IR_MASK FMASK(6, 0)
  50. /*
  51. * select channel (ch)
  52. */
  53. #define DMAC_CHANNEL(ch) FIELD(1, 1, (ch))
  54. #define DMAC_CONTROL_SIZE_BYTE(v) (FIELD((v), 12, 14) | \
  55. FIELD(0, 3, 9) | FIELD(0, 3, 6))
  56. #define DMAC_CONTROL_SIZE_HWORD(v) (FIELD((v) >> 1, 12, 14) | \
  57. FIELD(1, 3, 9) | FIELD(1, 3, 6))
  58. #define DMAC_CONTROL_SIZE_WORD(v) (FIELD((v) >> 2, 12, 14) | \
  59. FIELD(2, 3, 9) | FIELD(2, 3, 6))
  60. #define DMAC_CONTROL_DI FIELD(1, 1, 13)
  61. #define DMAC_CONTROL_SI FIELD(1, 1, 12)
  62. #define DMAC_CONTROL_BURST_1BYTE (FIELD(0, 3, 3) | FIELD(0, 3, 0))
  63. #define DMAC_CONTROL_BURST_4BYTE (FIELD(3, 3, 3) | FIELD(3, 3, 0))
  64. #define DMAC_CONTROL_BURST_8BYTE (FIELD(5, 3, 3) | FIELD(5, 3, 0))
  65. #define DMAC_CONTROL_BURST_16BYTE (FIELD(7, 3, 3) | FIELD(7, 3, 0))
  66. #define DMAC_CONFIG_UART0_WR (FIELD(2, 4, 11) | FIELD(1, 2, 1))
  67. #define DMAC_CONFIG_UART0_RD (FIELD(2, 4, 7) | FIELD(2, 2, 1))
  68. #define DMAC_CONFIG_UART1_WR (FIELD(3, 4, 11) | FIELD(1, 2, 1))
  69. #define DMAC_CONFIG_UART1RD (FIELD(3, 4, 7) | FIELD(2, 2, 1))
  70. #define DMAC_CONFIG_AC97WR (FIELD(4, 4, 11) | FIELD(1, 2, 1))
  71. #define DMAC_CONFIG_AC97RD (FIELD(4, 4, 7) | FIELD(2, 2, 1))
  72. #define DMAC_CONFIG_MMCWR (FIELD(7, 4, 11) | FIELD(1, 2, 1))
  73. #define DMAC_CONFIG_MMCRD (FIELD(7, 4, 7) | FIELD(2, 2, 1))
  74. #define DMAC_CONFIG_MASKITC FIELD(1, 1, 4)
  75. #define DMAC_CONFIG_MASKIE FIELD(1, 1, 3)
  76. #define DMAC_CONFIG_EN FIELD(1, 1, 0)