Skip to content

Commit 86d1bea

Browse files
committed
Supported ATCDMAC100 Driver ReWork
1 parent dfed2b6 commit 86d1bea

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

drivers/dma/dma_andes_atcdmac100.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ typedef void (*atcdmac100_cfg_func_t)(void);
111111

112112
struct __attribute__((packed, aligned(4))) chain_block {
113113
uint32_t ctrl;
114-
uint32_t srcaddrl;
115-
uint32_t dstaddrl;
114+
uint32_t srcaddr;
115+
uint32_t dstaddr;
116116
uint32_t transize;
117-
uint32_t llpointerl;
117+
uint32_t llpointer;
118118
struct chain_block *next_block;
119119
};
120120

@@ -367,20 +367,20 @@ static int dma_atcdmac100_config(const struct device *dev, uint32_t channel,
367367
dma_chain[channel][current_block_idx].transize =
368368
cfg_blocks->block_size/cfg->source_data_size;
369369

370-
dma_chain[channel][current_block_idx].srcaddrl =
370+
dma_chain[channel][current_block_idx].srcaddr =
371371
(uint32_t)cfg_blocks->source_address;
372372

373-
dma_chain[channel][current_block_idx].dstaddrl =
373+
dma_chain[channel][current_block_idx].dstaddr =
374374
(uint32_t)((long)cfg_blocks->dest_address);
375375

376376
if (cfg_blocks->next_block) {
377-
dma_chain[channel][current_block_idx].llpointerl =
377+
dma_chain[channel][current_block_idx].llpointer =
378378
(uint32_t)&dma_chain[channel][current_block_idx + 1];
379379

380380
current_block_idx = current_block_idx + 1;
381381

382382
} else {
383-
dma_chain[channel][current_block_idx].llpointerl = 0x0;
383+
dma_chain[channel][current_block_idx].llpointer = 0x0;
384384
dma_chain[channel][current_block_idx].next_block = NULL;
385385
}
386386
}

samples/hello_world/src/main.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,10 @@ int main(void)
301301
} else {
302302
printf("%s spi Object is Created. Test Via DMA\n", ATTR_INF);
303303
if(flash == NULL) {
304-
printf("%s flash has status disabled...%s\n", ATTR_ERR,ATTR_RST);
304+
printf("%s flash has status disabled or not initialized properly...%s\n", ATTR_ERR,ATTR_RST);
305305
} else {
306306
printf("%s flash Object is Created. Initialize to Test Via DMA%s\n", ATTR_INF,ATTR_RST);
307-
if(flash != NULL) {
308-
Flash_Test(flash, dma, 0x1000, 0, 20);
309-
} else {
310-
printf("%s Error Initializing DMA Device%s\n", ATTR_ERR,ATTR_RST);
311-
Flash_Test(flash, NULL, 0x1000, 0, 20);
312-
}
307+
Flash_Test(flash, dma, 0x1000, 0, 20);
313308
}
314309
}
315310

0 commit comments

Comments
 (0)