11 typedef _udi_handle_t udi_dma_handle_t;
12 #define UDI_NULL_DMA_HANDLE _NULL_HANDLE
13 typedef Uint64 udi_busaddr64_t; //!< \note Opaque
14 typedef struct udi_scgth_element_32_s udi_scgth_element_32_t;
15 typedef struct udi_scgth_element_64_s udi_scgth_element_64_t;
16 typedef struct udi_scgth_s udi_scgth_t;
17 typedef _udi_handle_t udi_dma_constraints_t;
18 #define UDI_NULL_DMA_CONSTRAINTS _NULL_HANDLE
20 * \name DMA constraints attributes
23 typedef udi_ubit8_t udi_dma_constraints_attr_t;
24 /* DMA Convenience Attribute Codes */
25 #define UDI_DMA_ADDRESSABLE_BITS 100
26 #define UDI_DMA_ALIGNMENT_BITS 101
27 /* DMA Constraints on the Entire Transfer */
28 #define UDI_DMA_DATA_ADDRESSABLE_BITS 110
29 #define UDI_DMA_NO_PARTIAL 111
30 /* DMA Constraints on the Scatter/Gather List */
31 #define UDI_DMA_SCGTH_MAX_ELEMENTS 120
32 #define UDI_DMA_SCGTH_FORMAT 121
33 #define UDI_DMA_SCGTH_ENDIANNESS 122
34 #define UDI_DMA_SCGTH_ADDRESSABLE_BITS 123
35 #define UDI_DMA_SCGTH_MAX_SEGMENTS 124
36 /* DMA Constraints on Scatter/Gather Segments */
37 #define UDI_DMA_SCGTH_ALIGNMENT_BITS 130
38 #define UDI_DMA_SCGTH_MAX_EL_PER_SEG 131
39 #define UDI_DMA_SCGTH_PREFIX_BYTES 132
40 /* DMA Constraints on Scatter/Gather Elements */
41 #define UDI_DMA_ELEMENT_ALIGNMENT_BITS 140
42 #define UDI_DMA_ELEMENT_LENGTH_BITS 141
43 #define UDI_DMA_ELEMENT_GRANULARITY_BITS 142
44 /* DMA Constraints for Special Addressing */
45 #define UDI_DMA_ADDR_FIXED_BITS 150
46 #define UDI_DMA_ADDR_FIXED_TYPE 151
47 #define UDI_DMA_ADDR_FIXED_VALUE_LO 152
48 #define UDI_DMA_ADDR_FIXED_VALUE_HI 153
49 /* DMA Constraints on DMA Access Behavior */
50 #define UDI_DMA_SEQUENTIAL 160
51 #define UDI_DMA_SLOP_IN_BITS 161
52 #define UDI_DMA_SLOP_OUT_BITS 162
53 #define UDI_DMA_SLOP_OUT_EXTRA 163
54 #define UDI_DMA_SLOP_BARRIER_BITS 164
55 /* Values for UDI_DMA_SCGTH_ENDIANNESS */
56 #define UDI_DMA_LITTLE_ENDIAN (1U<<6)
57 #define UDI_DMA_BIG_ENDIAN (1U<<5)
58 /* Values for UDI_DMA_ADDR_FIXED_TYPE */
59 #define UDI_DMA_FIXED_ELEMENT 1
63 // DMA Constraints Management
64 typedef struct udi_dma_constraints_attr_spec_s udi_dma_constraints_attr_spec_t;
65 typedef void udi_dma_constraints_attr_set_call_t(
66 udi_cb_t *gcb, udi_dma_constraints_t new_constraints, udi_status_t status
68 typedef struct udi_dma_limits_s udi_dma_limits_t;
72 // --- DMA Constraints Management ---
73 struct udi_dma_constraints_attr_spec_s
75 udi_dma_constraints_attr_t attr_type;
76 udi_ubit32_t attr_value;
79 struct udi_dma_limits_s
81 udi_size_t max_legal_contig_alloc;
82 udi_size_t max_safe_contig_alloc;
83 udi_size_t cache_line_size;
85 struct udi_scgth_element_32_s
87 udi_ubit32_t block_busaddr;
88 udi_ubit32_t block_length;
90 struct udi_scgth_element_64_s
92 udi_busaddr64_t block_busaddr;
93 udi_ubit32_t block_length;
94 udi_ubit32_t el_reserved;
97 #define UDI_SCGTH_EXT 0x80000000
100 udi_ubit16_t scgth_num_elements;
101 udi_ubit8_t scgth_format;
102 udi_boolean_t scgth_must_swap;
104 udi_scgth_element_32_t *el32p;
105 udi_scgth_element_64_t *el64p;
108 udi_scgth_element_32_t el32;
109 udi_scgth_element_64_t el64;
110 } scgth_first_segment;
112 /* Values for scgth_format */
113 #define UDI_SCGTH_32 (1U<<0)
114 #define UDI_SCGTH_64 (1U<<1)
115 #define UDI_SCGTH_DMA_MAPPED (1U<<6)
116 #define UDI_SCGTH_DRIVER_MAPPED (1U<<7)
121 // --- DMA Constraints Management ---
122 extern void udi_dma_constraints_attr_set(
123 udi_dma_constraints_attr_set_call_t *callback,
125 udi_dma_constraints_t src_constraints,
126 const udi_dma_constraints_attr_spec_t *attr_list,
127 udi_ubit16_t list_length,
130 /* Constraints Flags */
131 #define UDI_DMA_CONSTRAINTS_COPY (1U<<0)
133 extern void udi_dma_constraints_attr_reset(
134 udi_dma_constraints_t constraints,
135 udi_dma_constraints_attr_t attr_type
138 extern void udi_dma_constraints_free(udi_dma_constraints_t constraints);
140 #include <physio/meta_intr.h>
141 #include <physio/meta_bus.h>