DMA: shdma: 40-bit address prototype
PATCH v2 2/7 DMA: shdma: 40-bit address prototype
From: Magnus Damm <[email protected]>
Hack up 40-bit address support via the FIXSAR and FIXDAR addresses provided by the SYS-DMAC hardware in R-Car Gen2.
The data sheet says that auto increment overflow from SAR to FIXSAR and DAR to FIXDAR does not happen, so based on that limit size of DMA transactions that try to cross the 32-bit boundary.
Not for upstream merge.
Signed-off-by Magnus Damm <[email protected]>
---
Changes since V1:
- Fix transfer length truncation calculation - thanks Geert!
drivers/dma/sh/shdma.h | 4 ++-- drivers/dma/sh/shdmac.c | 46 ++++++++++++++++++++++++++++++++++++++++------ include/linux/sh_dma.h | 2 ++ 3 files changed, 44 insertions(+), 8 deletions(-)
drivers/dma/sh/shdma.h +2 -2
@@ -46,8 +46,8 @@ struct sh_dmae_device { };struct sh_dmae_regs { -u32 sar;/* SAR / source address */ -u32 dar;/* DAR / destination address */ +dma_addr_t sar;/* SAR / source address */ +dma_addr_t dar;/* DAR / destination address */ u32 tcr;/* TCR / transfer count */ };
drivers/dma/sh/shdmac.c +40 -6
83 lines not on this page · raw message
include/linux/sh_dma.h +2 -0
@@ -70,6 +70,7 @@ struct sh_dmae_channel {* @chclr_present: DMAC has one or several CHCLR registers * @chclr_bitwise: channel CHCLR registers are bitwise * @slave_only: DMAC cannot be used for MEMCPY +* @fourty_bits_addr: Hardware support dealing with 40 bit addresses */ struct sh_dmae_pdata {const struct sh_dmae_slave_config *slave;
@@ -92,6 +93,7 @@ struct sh_dmae_pdata { unsigned int chclr_present:1; unsigned int chclr_bitwise:1; unsigned int slave_only:1; + unsigned int fourty_bits_addr:1; };/* DMAOR definitions */