1.1 --- a/pkg/devices/lib/dma/include/dma-jz4780.h Thu Nov 09 18:40:31 2023 +0100
1.2 +++ b/pkg/devices/lib/dma/include/dma-jz4780.h Fri Nov 10 02:02:11 2023 +0100
1.3 @@ -21,6 +21,7 @@
1.4
1.5 #pragma once
1.6
1.7 +#include <l4/re/c/dma_space.h>
1.8 #include <l4/sys/types.h>
1.9 #include <stdint.h>
1.10
1.11 @@ -72,6 +73,14 @@
1.12 Dma_request_des_in = 47,
1.13 };
1.14
1.15 +/* Descriptor structure. */
1.16 +
1.17 +struct jz4780_dma_descriptor
1.18 +{
1.19 + uint32_t command, source, destination, transfer_count,
1.20 + stride, request_source, reserved0, reserved1;
1.21 +};
1.22 +
1.23
1.24
1.25 #ifdef __cplusplus
1.26 @@ -103,7 +112,9 @@
1.27 bool source_increment, bool destination_increment,
1.28 uint8_t source_width, uint8_t destination_width,
1.29 uint8_t transfer_unit_size,
1.30 - enum Dma_jz4780_request_type type=Dma_request_auto);
1.31 + enum Dma_jz4780_request_type type=Dma_request_auto,
1.32 + l4_addr_t desc_vaddr = 0,
1.33 + l4re_dma_space_dma_addr_t desc_paddr = 0);
1.34
1.35 unsigned int wait();
1.36
1.37 @@ -160,6 +171,10 @@
1.38 bool halted();
1.39
1.40 bool have_interrupt(uint8_t channel);
1.41 +
1.42 + // Descriptor operations.
1.43 +
1.44 + void commit_descriptor(uint8_t channel);
1.45 };
1.46
1.47 #endif /* __cplusplus */
1.48 @@ -186,6 +201,16 @@
1.49 uint8_t transfer_unit_size,
1.50 enum Dma_jz4780_request_type type);
1.51
1.52 +unsigned int jz4780_dma_transfer_descriptor(void *dma_channel,
1.53 + uint32_t source, uint32_t destination,
1.54 + unsigned int count,
1.55 + int source_increment, int destination_increment,
1.56 + uint8_t source_width, uint8_t destination_width,
1.57 + uint8_t transfer_unit_size,
1.58 + enum Dma_jz4780_request_type type,
1.59 + l4_addr_t desc_vaddr,
1.60 + l4re_dma_space_dma_addr_t desc_paddr);
1.61 +
1.62 unsigned int jz4780_dma_wait(void *dma_channel);
1.63
1.64 EXTERN_C_END