diff options
| author | Vinod Koul <vkoul@kernel.org> | 2018-10-24 04:16:27 -0400 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2018-10-24 04:16:27 -0400 |
| commit | 4b4447bfadd0e12aa975c45d953ef6c34eb2e5cd (patch) | |
| tree | 8e23a6d26ffa58f8d408e2fb4cbe9cb48a1d2c9c /include/linux | |
| parent | 8e75ab9bd835bd29bc9f3a587d8e2799009d301a (diff) | |
| parent | 4ac695464763ecf696eaba563eff1c2ab994f6d8 (diff) | |
Merge branch 'topic/sprd' into for-linus
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/dma/sprd-dma.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/include/linux/dma/sprd-dma.h b/include/linux/dma/sprd-dma.h index b0115e340fbc..b42b80e52cc2 100644 --- a/include/linux/dma/sprd-dma.h +++ b/include/linux/dma/sprd-dma.h | |||
| @@ -58,4 +58,73 @@ enum sprd_dma_int_type { | |||
| 58 | SPRD_DMA_CFGERR_INT, | 58 | SPRD_DMA_CFGERR_INT, |
| 59 | }; | 59 | }; |
| 60 | 60 | ||
| 61 | /* | ||
| 62 | * struct sprd_dma_linklist - DMA link-list address structure | ||
| 63 | * @virt_addr: link-list virtual address to configure link-list node | ||
| 64 | * @phy_addr: link-list physical address to link DMA transfer | ||
| 65 | * | ||
| 66 | * The Spreadtrum DMA controller supports the link-list mode, that means slaves | ||
| 67 | * can supply several groups configurations (each configuration represents one | ||
| 68 | * DMA transfer) saved in memory, and DMA controller will link these groups | ||
| 69 | * configurations by writing the physical address of each configuration into the | ||
| 70 | * link-list register. | ||
| 71 | * | ||
| 72 | * Just as shown below, the link-list pointer register will be pointed to the | ||
| 73 | * physical address of 'configuration 1', and the 'configuration 1' link-list | ||
| 74 | * pointer will be pointed to 'configuration 2', and so on. | ||
| 75 | * Once trigger the DMA transfer, the DMA controller will load 'configuration | ||
| 76 | * 1' to its registers automatically, after 'configuration 1' transaction is | ||
| 77 | * done, DMA controller will load 'configuration 2' automatically, until all | ||
| 78 | * DMA transactions are done. | ||
| 79 | * | ||
| 80 | * Note: The last link-list pointer should point to the physical address | ||
| 81 | * of 'configuration 1', which can avoid DMA controller loads incorrect | ||
| 82 | * configuration when the last configuration transaction is done. | ||
| 83 | * | ||
| 84 | * DMA controller linklist memory | ||
| 85 | * ====================== ----------------------- | ||
| 86 | *| | | configuration 1 |<--- | ||
| 87 | *| DMA controller | ------->| | | | ||
| 88 | *| | | | | | | ||
| 89 | *| | | | | | | ||
| 90 | *| | | | | | | ||
| 91 | *| linklist pointer reg |---- ----| linklist pointer | | | ||
| 92 | * ====================== | ----------------------- | | ||
| 93 | * | | | ||
| 94 | * | ----------------------- | | ||
| 95 | * | | configuration 2 | | | ||
| 96 | * --->| | | | ||
| 97 | * | | | | ||
| 98 | * | | | | ||
| 99 | * | | | | ||
| 100 | * ----| linklist pointer | | | ||
| 101 | * | ----------------------- | | ||
| 102 | * | | | ||
| 103 | * | ----------------------- | | ||
| 104 | * | | configuration 3 | | | ||
| 105 | * --->| | | | ||
| 106 | * | | | | ||
| 107 | * | . | | | ||
| 108 | * . | | ||
| 109 | * . | | ||
| 110 | * . | | ||
| 111 | * | . | | ||
| 112 | * | ----------------------- | | ||
| 113 | * | | configuration n | | | ||
| 114 | * --->| | | | ||
| 115 | * | | | | ||
| 116 | * | | | | ||
| 117 | * | | | | ||
| 118 | * | linklist pointer |---- | ||
| 119 | * ----------------------- | ||
| 120 | * | ||
| 121 | * To support the link-list mode, DMA slaves should allocate one segment memory | ||
| 122 | * from always-on IRAM or dma coherent memory to store these groups of DMA | ||
| 123 | * configuration, and pass the virtual and physical address to DMA controller. | ||
| 124 | */ | ||
| 125 | struct sprd_dma_linklist { | ||
| 126 | unsigned long virt_addr; | ||
| 127 | phys_addr_t phy_addr; | ||
| 128 | }; | ||
| 129 | |||
| 61 | #endif | 130 | #endif |
