trio_shm.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Copyright 2012 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. */
  14. /* Machine-generated file; do not edit. */
  15. #ifndef __ARCH_TRIO_SHM_H__
  16. #define __ARCH_TRIO_SHM_H__
  17. #include <arch/abi.h>
  18. #include <arch/trio_shm_def.h>
  19. #ifndef __ASSEMBLER__
  20. /**
  21. * TRIO DMA Descriptor.
  22. * The TRIO DMA descriptor is written by software and consumed by hardware.
  23. * It is used to specify the location of transaction data in the IO and Tile
  24. * domains.
  25. */
  26. __extension__
  27. typedef union
  28. {
  29. struct
  30. {
  31. /* Word 0 */
  32. #ifndef __BIG_ENDIAN__
  33. /** Tile side virtual address. */
  34. int_reg_t va : 42;
  35. /**
  36. * Encoded size of buffer used on push DMA when C=1:
  37. * 0 = 128 bytes
  38. * 1 = 256 bytes
  39. * 2 = 512 bytes
  40. * 3 = 1024 bytes
  41. * 4 = 1664 bytes
  42. * 5 = 4096 bytes
  43. * 6 = 10368 bytes
  44. * 7 = 16384 bytes
  45. */
  46. uint_reg_t bsz : 3;
  47. /**
  48. * Chaining designation. Always zero for pull DMA
  49. * 0 : Unchained buffer pointer
  50. * 1 : Chained buffer pointer. Next buffer descriptor (e.g. VA) stored
  51. * in 1st 8-bytes in buffer. For chained buffers, first 8-bytes of each
  52. * buffer contain the next buffer descriptor formatted exactly like a PDE
  53. * buffer descriptor. This allows a chained PDE buffer to be sent using
  54. * push DMA.
  55. */
  56. uint_reg_t c : 1;
  57. /**
  58. * Notification interrupt will be delivered when the transaction has
  59. * completed (all data has been read from or written to the Tile-side
  60. * buffer).
  61. */
  62. uint_reg_t notif : 1;
  63. /**
  64. * When 0, the XSIZE field specifies the total byte count for the
  65. * transaction. When 1, the XSIZE field is encoded as 2^(N+14) for N in
  66. * {0..6}:
  67. * 0 = 16KB
  68. * 1 = 32KB
  69. * 2 = 64KB
  70. * 3 = 128KB
  71. * 4 = 256KB
  72. * 5 = 512KB
  73. * 6 = 1MB
  74. * All other encodings of the XSIZE field are reserved when SMOD=1
  75. */
  76. uint_reg_t smod : 1;
  77. /**
  78. * Total number of bytes to move for this transaction. When SMOD=1,
  79. * this field is encoded - see SMOD description.
  80. */
  81. uint_reg_t xsize : 14;
  82. /** Reserved. */
  83. uint_reg_t __reserved_0 : 1;
  84. /**
  85. * Generation number. Used to indicate a valid descriptor in ring. When
  86. * a new descriptor is written into the ring, software must toggle this
  87. * bit. The net effect is that the GEN bit being written into new
  88. * descriptors toggles each time the ring tail pointer wraps.
  89. */
  90. uint_reg_t gen : 1;
  91. #else /* __BIG_ENDIAN__ */
  92. uint_reg_t gen : 1;
  93. uint_reg_t __reserved_0 : 1;
  94. uint_reg_t xsize : 14;
  95. uint_reg_t smod : 1;
  96. uint_reg_t notif : 1;
  97. uint_reg_t c : 1;
  98. uint_reg_t bsz : 3;
  99. int_reg_t va : 42;
  100. #endif
  101. /* Word 1 */
  102. #ifndef __BIG_ENDIAN__
  103. /** IO-side address */
  104. uint_reg_t io_address : 64;
  105. #else /* __BIG_ENDIAN__ */
  106. uint_reg_t io_address : 64;
  107. #endif
  108. };
  109. /** Word access */
  110. uint_reg_t words[2];
  111. } TRIO_DMA_DESC_t;
  112. #endif /* !defined(__ASSEMBLER__) */
  113. #endif /* !defined(__ARCH_TRIO_SHM_H__) */