pl080.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /* arch/arm/include/asm/hardware/pl080.h
  2. *
  3. * Copyright 2008 Openmoko, Inc.
  4. * Copyright 2008 Simtec Electronics
  5. * http://armlinux.simtec.co.uk/
  6. * Ben Dooks <ben@simtec.co.uk>
  7. *
  8. * ARM PrimeCell PL080 DMA controller
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. /* Note, there are some Samsung updates to this controller block which
  15. * make it not entierly compatible with the PL080 specification from
  16. * ARM. When in doubt, check the Samsung documentation first.
  17. *
  18. * The Samsung defines are PL080S, and add an extra control register,
  19. * the ability to move more than 2^11 counts of data and some extra
  20. * OneNAND features.
  21. */
  22. #ifndef ASM_PL080_H
  23. #define ASM_PL080_H
  24. #define PL080_INT_STATUS (0x00)
  25. #define PL080_TC_STATUS (0x04)
  26. #define PL080_TC_CLEAR (0x08)
  27. #define PL080_ERR_STATUS (0x0C)
  28. #define PL080_ERR_CLEAR (0x10)
  29. #define PL080_RAW_TC_STATUS (0x14)
  30. #define PL080_RAW_ERR_STATUS (0x18)
  31. #define PL080_EN_CHAN (0x1c)
  32. #define PL080_SOFT_BREQ (0x20)
  33. #define PL080_SOFT_SREQ (0x24)
  34. #define PL080_SOFT_LBREQ (0x28)
  35. #define PL080_SOFT_LSREQ (0x2C)
  36. #define PL080_CONFIG (0x30)
  37. #define PL080_CONFIG_M2_BE (1 << 2)
  38. #define PL080_CONFIG_M1_BE (1 << 1)
  39. #define PL080_CONFIG_ENABLE (1 << 0)
  40. #define PL080_SYNC (0x34)
  41. /* Per channel configuration registers */
  42. #define PL080_Cx_STRIDE (0x20)
  43. #define PL080_Cx_BASE(x) ((0x100 + (x * 0x20)))
  44. #define PL080_Cx_SRC_ADDR(x) ((0x100 + (x * 0x20)))
  45. #define PL080_Cx_DST_ADDR(x) ((0x104 + (x * 0x20)))
  46. #define PL080_Cx_LLI(x) ((0x108 + (x * 0x20)))
  47. #define PL080_Cx_CONTROL(x) ((0x10C + (x * 0x20)))
  48. #define PL080_Cx_CONFIG(x) ((0x110 + (x * 0x20)))
  49. #define PL080S_Cx_CONTROL2(x) ((0x110 + (x * 0x20)))
  50. #define PL080S_Cx_CONFIG(x) ((0x114 + (x * 0x20)))
  51. #define PL080_CH_SRC_ADDR (0x00)
  52. #define PL080_CH_DST_ADDR (0x04)
  53. #define PL080_CH_LLI (0x08)
  54. #define PL080_CH_CONTROL (0x0C)
  55. #define PL080_CH_CONFIG (0x10)
  56. #define PL080S_CH_CONTROL2 (0x10)
  57. #define PL080S_CH_CONFIG (0x14)
  58. #define PL080_LLI_ADDR_MASK (0x3fffffff << 2)
  59. #define PL080_LLI_ADDR_SHIFT (2)
  60. #define PL080_LLI_LM_AHB2 (1 << 0)
  61. #define PL080_CONTROL_TC_IRQ_EN (1 << 31)
  62. #define PL080_CONTROL_PROT_MASK (0x7 << 28)
  63. #define PL080_CONTROL_PROT_SHIFT (28)
  64. #define PL080_CONTROL_PROT_CACHE (1 << 30)
  65. #define PL080_CONTROL_PROT_BUFF (1 << 29)
  66. #define PL080_CONTROL_PROT_SYS (1 << 28)
  67. #define PL080_CONTROL_DST_INCR (1 << 27)
  68. #define PL080_CONTROL_SRC_INCR (1 << 26)
  69. #define PL080_CONTROL_DST_AHB2 (1 << 25)
  70. #define PL080_CONTROL_SRC_AHB2 (1 << 24)
  71. #define PL080_CONTROL_DWIDTH_MASK (0x7 << 21)
  72. #define PL080_CONTROL_DWIDTH_SHIFT (21)
  73. #define PL080_CONTROL_SWIDTH_MASK (0x7 << 18)
  74. #define PL080_CONTROL_SWIDTH_SHIFT (18)
  75. #define PL080_CONTROL_DB_SIZE_MASK (0x7 << 15)
  76. #define PL080_CONTROL_DB_SIZE_SHIFT (15)
  77. #define PL080_CONTROL_SB_SIZE_MASK (0x7 << 12)
  78. #define PL080_CONTROL_SB_SIZE_SHIFT (12)
  79. #define PL080_CONTROL_TRANSFER_SIZE_MASK (0xfff << 0)
  80. #define PL080_CONTROL_TRANSFER_SIZE_SHIFT (0)
  81. #define PL080_BSIZE_1 (0x0)
  82. #define PL080_BSIZE_4 (0x1)
  83. #define PL080_BSIZE_8 (0x2)
  84. #define PL080_BSIZE_16 (0x3)
  85. #define PL080_BSIZE_32 (0x4)
  86. #define PL080_BSIZE_64 (0x5)
  87. #define PL080_BSIZE_128 (0x6)
  88. #define PL080_BSIZE_256 (0x7)
  89. #define PL080_WIDTH_8BIT (0x0)
  90. #define PL080_WIDTH_16BIT (0x1)
  91. #define PL080_WIDTH_32BIT (0x2)
  92. #define PL080_CONFIG_HALT (1 << 18)
  93. #define PL080_CONFIG_ACTIVE (1 << 17) /* RO */
  94. #define PL080_CONFIG_LOCK (1 << 16)
  95. #define PL080_CONFIG_TC_IRQ_MASK (1 << 15)
  96. #define PL080_CONFIG_ERR_IRQ_MASK (1 << 14)
  97. #define PL080_CONFIG_FLOW_CONTROL_MASK (0x7 << 11)
  98. #define PL080_CONFIG_FLOW_CONTROL_SHIFT (11)
  99. #define PL080_CONFIG_DST_SEL_MASK (0xf << 6)
  100. #define PL080_CONFIG_DST_SEL_SHIFT (6)
  101. #define PL080_CONFIG_SRC_SEL_MASK (0xf << 1)
  102. #define PL080_CONFIG_SRC_SEL_SHIFT (1)
  103. #define PL080_CONFIG_ENABLE (1 << 0)
  104. #define PL080_FLOW_MEM2MEM (0x0)
  105. #define PL080_FLOW_MEM2PER (0x1)
  106. #define PL080_FLOW_PER2MEM (0x2)
  107. #define PL080_FLOW_SRC2DST (0x3)
  108. #define PL080_FLOW_SRC2DST_DST (0x4)
  109. #define PL080_FLOW_MEM2PER_PER (0x5)
  110. #define PL080_FLOW_PER2MEM_PER (0x6)
  111. #define PL080_FLOW_SRC2DST_SRC (0x7)
  112. /* DMA linked list chain structure */
  113. struct pl080_lli {
  114. u32 src_addr;
  115. u32 dst_addr;
  116. u32 next_lli;
  117. u32 control0;
  118. };
  119. struct pl080s_lli {
  120. u32 src_addr;
  121. u32 dst_addr;
  122. u32 next_lli;
  123. u32 control0;
  124. u32 control1;
  125. };
  126. #endif /* ASM_PL080_H */