@@ -160,20 +160,20 @@ static void process_data(const void *buf, size_t length)
160
160
P_CC3XX -> host_rgf .host_rgf_icr |= 0xFF0U ;
161
161
162
162
if (dma_state .block_buf_needs_output ) {
163
- uintptr_t output_addr = dma_state .output_addr ;
163
+ const uintptr_t remap_output_addr = remap_addr ( dma_state .output_addr ) ;
164
164
#ifdef CC3XX_CONFIG_DMA_BURST_RESTRICTED_ENABLE
165
165
/* Force single transactions for restricted addresses */
166
- if (is_addr_burst_restricted (output_addr )) {
166
+ if (is_addr_burst_restricted (remap_output_addr )) {
167
167
P_CC3XX -> ahb .ahbm_singles = 0x1UL ;
168
168
} else {
169
169
P_CC3XX -> ahb .ahbm_singles = 0x0UL ;
170
170
}
171
171
#endif /* CC3XX_CONFIG_DMA_BURST_RESTRICTED_ENABLE */
172
172
173
- assert (!((output_addr == NULL ) && (length != 0 )));
173
+ assert (!((remap_output_addr == ( uintptr_t ) NULL ) && (length != 0 )));
174
174
175
175
/* Set the data target */
176
- P_CC3XX -> dout .dst_lli_word0 = output_addr ;
176
+ P_CC3XX -> dout .dst_lli_word0 = remap_output_addr ;
177
177
/* And the length */
178
178
P_CC3XX -> dout .dst_lli_word1 = length ;
179
179
@@ -185,7 +185,7 @@ static void process_data(const void *buf, size_t length)
185
185
* set up an MPU covering the input and output regions so they can be
186
186
* marked as SHAREABLE (which is not currently implemented).
187
187
*/
188
- SCB_CleanInvalidateDCache_by_Addr ((volatile void * )output_addr , length );
188
+ SCB_CleanInvalidateDCache_by_Addr ((volatile void * )remap_output_addr , length );
189
189
#endif /* CC3XX_CONFIG_DMA_CACHE_FLUSH_ENABLE */
190
190
191
191
dma_state .output_addr += length ;
@@ -194,7 +194,7 @@ static void process_data(const void *buf, size_t length)
194
194
195
195
if (dma_state .input_src == CC3XX_DMA_INPUT_SRC_CPU_MEM ) {
196
196
/* remap the address, particularly for TCMs */
197
- const uintptr_t remapped_buf = remap_addr ((uintptr_t )buf );
197
+ const uintptr_t remapped_buf = remap_addr ((uintptr_t )buf );
198
198
#ifdef CC3XX_CONFIG_DMA_CACHE_FLUSH_ENABLE
199
199
/* Flush the input data. Note that this is only enough to avoid cache
200
200
* issues if the CPU is in a busy-wait loop while the access completes.
@@ -351,10 +351,9 @@ void cc3xx_lowlevel_dma_set_buffer_size(size_t size) {
351
351
assert (size <= CC3XX_DMA_BLOCK_BUF_MAX_SIZE );
352
352
}
353
353
354
- void cc3xx_lowlevel_dma_set_output (void * buf , size_t length )
354
+ void cc3xx_lowlevel_dma_set_output (void * buf , size_t length )
355
355
{
356
- /* remap the address, particularly for TCMs */
357
- dma_state .output_addr = remap_addr ((uintptr_t )buf );
356
+ dma_state .output_addr = (uintptr_t )buf ;
358
357
dma_state .output_size = length ;
359
358
}
360
359
0 commit comments